Oasys.PRIMER.Material class¶
Properties¶
- property Material.addDamageGissmo: boolean¶
True if *MAT_ADD_DAMAGE_GISSMO exists for material, false if not defined
- property Material.addErosion: boolean¶
True if *MAT_ADD_EROSION exists for material, false if not defined
- property Material.addKeywords(read only): integer¶
The number of extra *MAT_ADD_xxxx keywords that this material definition has. Note that if there is only a single *MAT_ADD_xxxx keyword for an ID this will be 0. For example, if for material 1 both a *MAT_PIECEWISE_LINEAR_PLASTICITY card and a *MAT_ADD_EROSION card exist then this will return 1. If for material 2 only a *MAT_ADD_EROSION card exists then this will return 0. Also see
Material.Keyword()
andMaterial.KeywordCards()
- property Material.colour: Colour¶
The colour of the material
- property Material.cols(read only): float¶
The number of columns of data the material has
- property Material.exists(read only): boolean¶
true if material exists, false if referred to but not defined
- property Material.label: integer or string¶
Material
number or character label. Also see themid
property which is an alternative name for this
- property Material.mid: integer or string¶
Material
number or character label. Also see thelabel
property which is an alternative name for this
- property Material.optionalCards(read only): integer¶
The number of optional extra cards that this material definition can have. Also see
Material.AddOptionalCards()
- property Material.properties: integer¶
The total number of properties that the material has
- property Material.rows(read only): integer¶
The number of rows of data the material has
- property Material.transparency: integer¶
The transparency of the material (0-100) 0% is opaque, 100% is transparent
- property Material.type: string¶
The material type name(e.g. ‘ELASTIC’, ‘RIGID’ etc)
- property Material.typeNumber: string¶
The material type number (e.g. ‘001’, ‘034M’)
Constructor¶
- classmethod Material(model, mid, type)¶
Create a new
Material
object
- Parameters:
- Returns:
Material object
- Return type:
dict
Example
To create a new rigid material in model m with label 100
mat = Oasys.PRIMER.Material(m, 100, "RIGID")or
mat = Oasys.PRIMER.Material(m, 100, "020")or
mat = Oasys.PRIMER.Material(m, 100, "\*MAT_RIGID")or
mat = Oasys.PRIMER.Material(m, 100, "\*MAT_020")
Static methods¶
- classmethod Material.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the materials in the model
- Parameters:
model (Model) –
Model
that all materials will be blanked inredraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To blank all of the materials in model m:
Oasys.PRIMER.Material.BlankAll(m)
- classmethod Material.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged materials in the model
- Parameters:
model (Model) –
Model
that all the flagged materials will be blanked inflag (Flag) – Flag set on the materials that you want to blank
redraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To blank all of the materials in model m flagged with f:
Oasys.PRIMER.Material.BlankFlagged(m, f)
- classmethod Material.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a material
- Parameters:
model (Model) –
Model
that the material will be created inmodal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
Material object (or None if not made)
- Return type:
dict
Example
To start creating a material in model m:
mat = Oasys.PRIMER.Material.Create(m)
- classmethod Material.First(model)¶
Returns the first material in the model
- Parameters:
model (Model) –
Model
to get first material in- Returns:
Material object (or None if there are no materials in the model)
- Return type:
Material
Example
To get the first material in model m:
m = Oasys.PRIMER.Material.First(m)
- classmethod Material.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free material label in the model. Also see
Material.LastFreeLabel()
,Material.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
Material label
- Return type:
int
Example
To get the first free material label in model m:
label = Oasys.PRIMER.Material.FirstFreeLabel(m)
- classmethod Material.FlagAll(model, flag)¶
Flags all of the materials in the model with a defined flag
- Parameters:
model (Model) –
Model
that all materials will be flagged inflag (Flag) – Flag to set on the materials
- Returns:
No return value
- Return type:
None
Example
To flag all of the materials with flag f in model m:
Oasys.PRIMER.Material.FlagAll(m, f)
- classmethod Material.GetAll(model)¶
Returns a list of Material objects for all of the materials in a model in PRIMER
- Parameters:
model (Model) –
Model
to get materials from- Returns:
List of Material objects
- Return type:
list
Example
To make a list of Material objects for all of the materials in model m
m = Oasys.PRIMER.Material.GetAll(m)
- classmethod Material.GetFlagged(model, flag)¶
Returns a list of Material objects for all of the flagged materials in a model in PRIMER
- Parameters:
model (Model) –
Model
to get materials fromflag (Flag) – Flag set on the materials that you want to retrieve
- Returns:
List of Material objects
- Return type:
list
Example
To make a list of Material objects for all of the materials in model m flagged with f
m = Oasys.PRIMER.Material.GetFlagged(m, f)
- classmethod Material.GetFromID(model, number)¶
Returns the Material object for a material ID
- Parameters:
model (Model) –
Model
to find the material innumber (integer) – number of the material you want the Material object for
- Returns:
Material object (or None if material does not exist)
- Return type:
Material
Example
To get the Material object for material 100 in model m
m = Oasys.PRIMER.Material.GetFromID(m, 100)
- classmethod Material.Last(model)¶
Returns the last material in the model
- Parameters:
model (Model) –
Model
to get last material in- Returns:
Material object (or None if there are no materials in the model)
- Return type:
Material
Example
To get the last material in model m:
m = Oasys.PRIMER.Material.Last(m)
- classmethod Material.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free material label in the model. Also see
Material.FirstFreeLabel()
,Material.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
Material label
- Return type:
int
Example
To get the last free material label in model m:
label = Oasys.PRIMER.Material.LastFreeLabel(m)
- classmethod Material.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) material label in the model. Also see
Material.FirstFreeLabel()
,Material.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
Material label
- Return type:
int
Example
To get the next free material label in model m:
label = Oasys.PRIMER.Material.NextFreeLabel(m)
- classmethod Material.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a material
- Parameters:
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only materials from that model can be picked. If the argument is aFlag
then only materials that are flagged with limit can be selected. If omitted, or None, any materials from any model can be selected. from any modelmodal (boolean) – Optional. If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal
button_text (string) – Optional. By default the window with the prompt will have a button labelled ‘Cancel’ which if pressed will cancel the pick and return None. If you want to change the text on the button use this argument. If omitted ‘Cancel’ will be used
- Returns:
Material object (or None if not picked)
- Return type:
dict
Example
To pick a material from model m giving the prompt ‘Pick material from screen’:
m = Oasys.PRIMER.Material.Pick('Pick material from screen', m)
- classmethod Material.RenumberAll(model, start)¶
Renumbers all of the materials in the model
- Parameters:
model (Model) –
Model
that all materials will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the materials in model m, from 1000000:
Oasys.PRIMER.Material.RenumberAll(m, 1000000)
- classmethod Material.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged materials in the model
- Parameters:
model (Model) –
Model
that all the flagged materials will be renumbered inflag (Flag) – Flag set on the materials that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the materials in model m flagged with f, from 1000000:
Oasys.PRIMER.Material.RenumberFlagged(m, f, 1000000)
- classmethod Material.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select materials using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting materials
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only materials from that model can be selected. If the argument is aFlag
then only materials that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any materials can be selected. from any modelmodal (boolean) – Optional. If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal
- Returns:
Number of materials selected or None if menu cancelled
- Return type:
int
Example
To select materials from model m, flagging those selected with flag f, giving the prompt ‘Select materials’:
Oasys.PRIMER.Material.Select(f, 'Select materials', m)To select materials, flagging those selected with flag f but limiting selection to materials flagged with flag l, giving the prompt ‘Select materials’:
Oasys.PRIMER.Material.Select(f, 'Select materials', l)
- classmethod Material.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged materials in the model. The materials will be sketched until you either call
Material.Unsketch()
,Material.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged materials will be sketched inflag (Flag) – Flag set on the materials that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the materials are sketched. If omitted redraw is true. If you want to sketch flagged materials several times and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To sketch all materials flagged with flag in model m:
Oasys.PRIMER.Material.SketchFlagged(m, flag)
- classmethod Material.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of materials in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing materials should be counted. If false or omitted referenced but undefined materials will also be included in the total
- Returns:
number of materials
- Return type:
int
Example
To get the total number of materials in model m:
total = Oasys.PRIMER.Material.Total(m)
- classmethod Material.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the materials in the model
- Parameters:
model (Model) –
Model
that all materials will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the materials in model m:
Oasys.PRIMER.Material.UnblankAll(m)
- classmethod Material.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged materials in the model
- Parameters:
model (Model) –
Model
that the flagged materials will be unblanked inflag (Flag) – Flag set on the materials that you want to unblank
redraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the materials in model m flagged with f:
Oasys.PRIMER.Material.UnblankFlagged(m, f)
- classmethod Material.UnflagAll(model, flag)¶
Unsets a defined flag on all of the materials in the model
- Parameters:
model (Model) –
Model
that the defined flag for all materials will be unset inflag (Flag) – Flag to unset on the materials
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the materials in model m:
Oasys.PRIMER.Material.UnflagAll(m, f)
- classmethod Material.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all materials
- Parameters:
model (Model) –
Model
that all materials will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the materials are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch all materials in model m:
Oasys.PRIMER.Material.UnsketchAll(m)
- classmethod Material.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged materials in the model
- Parameters:
model (Model) –
Model
that all materials will be unsketched inflag (Flag) – Flag set on the materials that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the materials are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch all materials flagged with flag in model m:
Oasys.PRIMER.Material.UnsketchAll(m, flag)
Instance methods¶
- Material.AddOptionalCards()¶
Adds any optional cards for the material.
Some materials have extra optional cards in the input. If they are there LS-DYNA will read them but they are not required input. For example a material could have three required cards and one extra optional card. If PRIMER reads this material from a keyword file and it only has the three required cards then the properties in the material will only be defined for those cards. i.e. there will not be any properties in the material for the extra optional line.
If you edit the material interactively in PRIMER then the extra optional card will be shown so you can add values if required. When writing the material to a keyword file the extra optional card will be omitted if none of the fields are used.
If you want to add one of the properties for the extra optional card in JavaScript this method will ensure that the extra card is defined and the properties added to the material as zero values. You can then useMaterial.SetPropertyByIndex()
,Material.SetPropertyByName()
orMaterial.SetPropertyByRowCol()
as normal to set the properties. Also see theoptionalCards
property
- Returns:
no return value
- Return type:
None
Example
To add any optional cards for material m:
m.AddOptionalCards()
- Material.AssociateComment(comment)¶
Associates a comment with a material
- Parameters:
comment (Comment) –
Comment
that will be attached to the material- Returns:
No return value
- Return type:
None
Example
To associate comment c to the material m:
m.AssociateComment(c)
- Material.Blank()¶
Blanks the material
- Returns:
No return value
- Return type:
None
Example
To blank material m:
m.Blank()
- Material.Blanked()¶
Checks if the material is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if material m is blanked:
if m.Blanked(): do_something..
- Material.Browse(modal=Oasys.gRPC.defaultArg)¶
Starts an edit panel in Browse mode
- Parameters:
modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
no return value
- Return type:
None
Example
To Browse material m:
m.Browse()
- Material.ClearFlag(flag)¶
Clears a flag on the material
- Parameters:
flag (Flag) – Flag to clear on the material
- Returns:
No return value
- Return type:
None
Example
To clear flag f for material m:
m.ClearFlag(f)
- Material.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the material. The target include of the copied material can be set using
Options.copy_target_include
- Parameters:
range (boolean) – Optional. If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use
Include.MakeCurrentLayer()
- Returns:
Material object
- Return type:
Material
Example
To copy material m into material z:
z = m.Copy()
- Material.Density()¶
Get the density material
- Returns:
float
- Return type:
float
Example
To get the density for material m:
density = m.Density()
- Material.DetachComment(comment)¶
Detaches a comment from a material
- Parameters:
comment (Comment) –
Comment
that will be detached from the material- Returns:
No return value
- Return type:
None
Example
To detach comment c from the material m:
m.DetachComment(c)
- Material.Edit(modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel
- Parameters:
modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal
- Returns:
no return value
- Return type:
None
Example
To Edit material m:
m.Edit()
- Material.ExtractColour()¶
Extracts the actual colour used for material.
By default in PRIMER many entities such as elements get their colour automatically from the part that they are in. PRIMER cycles through 13 default colours based on the label of the entity. In this case the materialcolour
property will return the valueColour.PART
instead of the actual colour. This method will return the actual colour which is used for drawing the material
- Returns:
colour value (integer)
- Return type:
int
Example
To return the colour used for drawing material m:
colour = m.ExtractColour()
- Material.Flagged(flag)¶
Checks if the material is flagged or not
- Parameters:
flag (Flag) – Flag to test on the material
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if material m has flag f set on it:
if m.Flagged(f): do_something..
- Material.GetAddDamageGissmoData()¶
Returns the *MAT_ADD_DAMAGE_GISSMO data of material
- Returns:
Dict with properties
- biaxf:
(real) Reduction factor for regularization at triaxiality=2/3
- dcrit:
(real) Damage treshold value
- dmgexp:
(real) Exponent for nonlinear damage accumalation
- dtyp:
(real) Flag for GISSMO damage type
- ecrit:
(real/integer) Critical plastic strain (Curve/ table ID if negative)
- fadexp:
(real/integer) Exponent for damage-related stress fadeout (Curve/ table ID if negative)
- hisvn:
(real) History variable used to evaluate th 3-D table LCSDG
- instf:
(integer) Flag for governing the behavior of instability measure F and fading exponent FADEXP
- lcdlim:
(integer) Curve ID: damage limit values as a function of triaxiality
- lcregd:
(integer) Curve/ table ID (positive) or Table ID (negative): Element-size dependent fading exponent
- lcsdg:
(integer) Curve/ table ID (positive) or Function ID (negative): Failure strain curve/table or function
- lcsoft:
(integer) Soft reduction factor for failure strain in crashfront elements
- lcsrs:
(integer) Curve/ table ID: Failure strain rate scaling factor v/s strain rate
- lp2bi:
(real) Option to use bending indicator instead of the Lode parameter
- midfail:
(integer) Mid-plane failure option for shell elements and GISSMO
- numfip:
(real) Number of failed integration points prior to element deletion
- refsz:
(real) Reference element size
- rgtr1:
(real) First triaxiality value for optional “tub-shaped” regularization
- rgtr2:
(real) Second triaxiality value for optional “tub-shaped” regularization
- shrf:
(real) Reduction factor for regularization at triaxiality=0
- soft:
(real) Softening reduction factor for failure strain in crashfront elements
- stochastic:
(logical) stochastic = true if _STOCHASTIC is ON. Otherwise, _STOCHASTIC is OFF
- volfrac:
(real) Volume fraction required to fail before element deletion
- Return type:
dict
Example
To get the *MAT_ADD_DAMAGE_GISSMO data of material m:
m.GetAddDamageGissmoData()
- Material.GetAddErosionData()¶
Returns the *MAT_ADD_EROSION data of material. Note that this method does not support pre-R11 properties
- Returns:
Dict with properties
- dteflt:
(real) Time period for the low pass filter
- dtmin:
(real) Minimum time step size at failure
- effeps:
(real) Maximum effective strain at failure
- engcrt:
(real) Critical energy for nonlocal failure criterion
- epssh:
(real) Shear strain at failure
- epsthin:
(real) Thinning strain at failure for shells
- excl:
(real) The exclusion number
- failtm:
(real) Failure time
- idam:
(integer) Flag for damage model
- impulse:
(real) Stress impulse for failure
- lceps12:
(integer) Load curve ID defining in-plane shear strain limit vs elem size
- lceps13:
(integer) Load curve ID defining through-thickness shear strain limit vs elem size
- lcepsmx:
(integer) Load curve ID defining in-plane major strain limit vs elem size
- lcfld:
(integer) Curve (negative) or table (positive) ID: Forming limit diagram
- lcregd:
(integer) Curve ID: Element-size dependent fading exponent
- mneps:
(real) Minimum principal strain at failure
- mnpres:
(real) Pressure at failure
- mxeps:
(real/integer) Principal strain at failure (curve ID if negative)
- mxpres:
(real) Maximum pressure at failure
- mxtmp:
(real) Maximum temperature at failure
- ncs:
(real) Number of failure conditions to satisfy before failure occurs
- nsff:
(real) Number of explicit time step cycles for stress fade-out used in the LCFLD criterion
- numfip:
(real) Number of failed integration points prior to element deletion
- radcrt:
(real) Critical radius for nonlocal failure criterion
- sigp1:
(real) Principal stress at failure
- sigth:
(real) Threshold stress
- sigvm:
(real/integer) Equivalent stress at failure (curve ID if negative)
- voleps:
(real) Volumetric strain at failure
- volfrac:
(real) The volume fraction required to fail before the element is deleted
- Return type:
dict
Example
To get the *MAT_ADD_EROSION data of material m:
m.GetAddErosionData()
- Material.GetComments()¶
Extracts the comments associated to a material
- Returns:
List of Comment objects (or None if there are no comments associated to the node)
- Return type:
list
Example
To get the list of comments associated to the material m:
comm_list = m.GetComments()
- Material.GetParameter(prop)¶
Checks if a Material property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the
Options.property_parameter_names
option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using theMaterial.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – material property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if Material property m.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if m.GetParameter(m.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if Material property m.example is a parameter by using the GetParameter method:
if m.ViewParameters().GetParameter(m.example): do_something..
- Material.GetPropertyByIndex(index)¶
Returns the value of property at index index for this
Material
object or None if no property exists
- Parameters:
index (integer) – The index of the property value to retrieve. (the number of properties can be found from
properties
) Note that indices start at 0. There is no link between indices and rows/columns so adjacent fields on a line for a material may not have adjacent indices- Returns:
Property value (float/integer)
- Return type:
int
Example
To return the property at index 2, for material m:
prop = m.GetPropertyByIndex(2)
- Material.GetPropertyByName(acronym)¶
Returns the value of property string acronym for this
Material
object or None if no property exists
- Parameters:
acronym (string) – The acronym of the property value to retrieve
- Returns:
Property value (float/integer)
- Return type:
int
Example
To return the value of RO for material m:
ro = m.GetPropertyByName("RO")
- Material.GetPropertyByRowCol(row, col)¶
Returns the value of the property for row and col for this
Material
object or None if no property exists. Note that rows and columns start at 0
- Parameters:
row (integer) – The row of the property value to retrieve
col (integer) – The column of the property value to retrieve
- Returns:
Property value (float/integer)
- Return type:
int
Example
To return the value of the property at row 0, column 1 for material m:
prop = m.GetPropertyByRowCol(0, 1)
- Material.GetPropertyNameForIndex(index)¶
Returns the name of the property at index index for this
Material
object or None if there is no property
- Parameters:
index (integer) – The index of the property name to retrieve. (the number of properties can be found from
properties
) Note that indices start at 0. There is no link between indices and rows/columns so adjacent fields on a line for a material may not have adjacent indices- Returns:
Property name (string)
- Return type:
str
Example
To return the name of the property at index 2, for material m:
name = m.GetPropertyNameForIndex(2)
- Material.GetPropertyNameForRowCol(row, col)¶
Returns the name of the property at row and col for this
Material
object or None if there is no property. Note that rows and columns start at 0
- Parameters:
row (integer) – The row of the property name to retrieve
col (integer) – The column of the property name to retrieve
- Returns:
Property name (string)
- Return type:
str
Example
To return the name of the property at row 0, column 1 for material m:
name = m.GetPropertyNameForRowCol(0, 1)
- Material.Keyword(index=Oasys.gRPC.defaultArg)¶
Returns the keyword for this material (e.g. *MAT_RIGID, *MAT_ELASTIC etc). Note that a carriage return is not added. See also
Material.KeywordCards()
- Parameters:
index (integer) – Optional. If this argument is not given then the material keyword is returned as normal. However if the material also has *MAT_ADD_xxxx cards defined for it (e.g. *MAT_ADD_EROSION) then the index can be used to return the title for the *MAT_ADD card instead. The index value starts from zero. The number of *MAT_ADD cards can be found from the
addKeywords
property- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for material m:
key = m.Keyword()To print all of the keywords and keyword cards for any *MAT_ADD cards for material m:
for i in range(m.addKeywords): Message(m.Keyword(i)) Message(m.KeywordCards(i))
- Material.KeywordCards(index=Oasys.gRPC.defaultArg)¶
Returns the keyword cards for the material. Note that a carriage return is not added. See also
Material.Keyword()
- Parameters:
index (integer) – Optional. If this argument is not given then the material keyword cards are returned as normal. However if the material also has *MAT_ADD_xxxx cards defined for it (e.g. *MAT_ADD_EROSION) then the index can be used to return the cards for the *MAT_ADD card instead. The index value starts from zero. The number of *MAT_ADD cards can be found from the
addKeywords
property- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for material m:
cards = m.KeywordCards()To print all of the keywords and keyword cards for any *MAT_ADD cards for material m:
for i in range(m.addKeywords): Message(m.Keyword(i)) Message(m.KeywordCards(i))
- Material.Next()¶
Returns the next material in the model
- Returns:
Material object (or None if there are no more materials in the model)
- Return type:
Material
Example
To get the material in model m after material m:
m = m.Next()
- Material.PoissonsRatio()¶
Get Poissons ratio for the material
- Returns:
float
- Return type:
float
Example
To get Poissons ratio for material m:
pr = m.PoissonsRatio(f)
- Material.Previous()¶
Returns the previous material in the model
- Returns:
Material object (or None if there are no more materials in the model)
- Return type:
Material
Example
To get the material in model m before material m:
m = m.Previous()
- Material.SetAddDamageGissmoData(data)¶
Sets the *MAT_ADD_DAMAGE_GISSMO data of material
- Parameters:
data (dict) –
Data returned from
Material.GetAddDamageGissmoData
- biaxf:
(real) Reduction factor for regularization at triaxiality=2/3
- dcrit:
(real) Damage treshold value
- dmgexp:
(real) Exponent for nonlinear damage accumalation
- dtyp:
(real) Flag for GISSMO damage type
- ecrit:
(real/integer) Critical plastic strain (Curve/ table ID if negative)
- fadexp:
(real/integer) Exponent for damage-related stress fadeout (Curve/ table ID if negative)
- hisvn:
(real) History variable used to evaluate th 3-D table LCSDG
- instf:
(integer) Flag for governing the behavior of instability measure F and fading exponent FADEXP
- lcdlim:
(integer) Curve ID: damage limit values as a function of triaxiality
- lcregd:
(integer) Curve/ table ID (positive) or Table ID (negative): Element-size dependent fading exponent
- lcsdg:
(integer) Curve/ table ID (positive) or Function ID (negative): Failure strain curve/table or function
- lcsoft:
(integer) Soft reduction factor for failure strain in crashfront elements
- lcsrs:
(integer) Curve/ table ID: Failure strain rate scaling factor v/s strain rate
- lp2bi:
(real) Option to use bending indicator instead of the Lode parameter
- midfail:
(integer) Mid-plane failure option for shell elements and GISSMO
- numfip:
(real) Number of failed integration points prior to element deletion
- refsz:
(real) Reference element size
- rgtr1:
(real) First triaxiality value for optional “tub-shaped” regularization
- rgtr2:
(real) Second triaxiality value for optional “tub-shaped” regularization
- shrf:
(real) Reduction factor for regularization at triaxiality=0
- soft:
(real) Softening reduction factor for failure strain in crashfront elements
- stochastic:
(logical) stochastic = true if _STOCHASTIC is ON. Otherwise, _STOCHASTIC is OFF
- volfrac:
(real) Volume fraction required to fail before element deletion
- Returns:
No return value
- Return type:
None
Example
To set the value of MIDFAIL Damage Gissmo for material m to be 3:
data = m.GetAddDamageGissmoData() data["midfail"] = 3 m.SetAddDamageGissmoData(data)
- Material.SetAddErosionData(data)¶
Sets the *MAT_ADD_EROSION data of material. Note that this method does not support pre-R11 properties
- Parameters:
data (dict) –
Data returned from
Material.GetAddErosionData
- dteflt:
(real) Time period for the low pass filter
- dtmin:
(real) Minimum time step size at failure
- effeps:
(real) Maximum effective strain at failure
- engcrt:
(real) Critical energy for nonlocal failure criterion
- epssh:
(real) Shear strain at failure
- epsthin:
(real) Thinning strain at failure for shells
- excl:
(real) The exclusion number
- failtm:
(real) Failure time
- idam:
(integer) Flag for damage model
- impulse:
(real) Stress impulse for failure
- lceps12:
(integer) Load curve ID defining in-plane shear strain limit vs elem size
- lceps13:
(integer) Load curve ID defining through-thickness shear strain limit vs elem size
- lcepsmx:
(integer) Load curve ID defining in-plane major strain limit vs elem size
- lcfld:
(integer) Curve (negative) or table (positive) ID: Forming limit diagram
- lcregd:
(integer) Curve ID: Element-size dependent fading exponent
- mneps:
(real) Minimum principal strain at failure
- mnpres:
(real) Pressure at failure
- mxeps:
(real/integer) Principal strain at failure (curve ID if negative)
- mxpres:
(real) Maximum pressure at failure
- mxtmp:
(real) Maximum temperature at failure
- ncs:
(real) Number of failure conditions to satisfy before failure occurs
- nsff:
(real) Number of explicit time step cycles for stress fade-out used in the LCFLD criterion
- numfip:
(real) Number of failed integration points prior to element deletion
- radcrt:
(real) Critical radius for nonlocal failure criterion
- sigp1:
(real) Principal stress at failure
- sigth:
(real) Threshold stress
- sigvm:
(real/integer) Equivalent stress at failure (curve ID if negative)
- voleps:
(real) Volumetric strain at failure
- volfrac:
(real) The volume fraction required to fail before the element is deleted
- Returns:
No return value
- Return type:
None
Example
To set the value of EXCL Erosion for material m to be 1.25:
data = m.GetAddErosionData() data["excl"] = 1.25 m.SetAddErosionData(data)
- Material.SetFlag(flag)¶
Sets a flag on the material
- Parameters:
flag (Flag) – Flag to set on the material
- Returns:
No return value
- Return type:
None
Example
To set flag f for material m:
m.SetFlag(f)
- Material.SetPropertyByIndex(index, value)¶
Sets the value of property at index index for this
Material
object
- Parameters:
index (integer) – The index of the property value to set. (the number of properties can be found from
properties
) Note that indices start at 0. There is no link between indices and rows/columns so adjacent fields on a line for a material may not have adjacent indicesvalue (integer/float for numeric properties, string for character properties) – The value of the property to set
- Returns:
No return value
- Return type:
None
Example
To set the property at index 2, for material m to be 1.234:
m.SetPropertyByIndex(2, 1.234)
- Material.SetPropertyByName(acronym, value)¶
Sets the value of property string acronym for this
Material
object
- Parameters:
acronym (string) – The acronym of the property value to set
value (integer/float for numeric properties, string for character properties) – The value of the property to set
- Returns:
No return value
- Return type:
None
Example
To set the value of RO for material m to be 7.89e-9:
m.SetPropertyByName("RO", 7.89e-9)
- Material.SetPropertyByRowCol(row, col, value)¶
Sets the value of the property for row and col for this
Material
object.**Note that rows and columns start at 0**
- Parameters:
row (integer) – The row of the property value to set
col (integer) – The column of the property value to set
value (integer/float for numeric properties, string for character properties) – The value of the property to set
- Returns:
No return value
- Return type:
None
Example
To set the value of the property at row 0, column 1 for material m to be 7.89e-9:
m.SetPropertyByRowCol(0, 1, 7.89e-9)
- Material.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the material. The material will be sketched until you either call
Material.Unsketch()
,Material.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the material is sketched. If omitted redraw is true. If you want to sketch several materials and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To sketch material m:
m.Sketch()
- Material.Unblank()¶
Unblanks the material
- Returns:
No return value
- Return type:
None
Example
To unblank material m:
m.Unblank()
- Material.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the material
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the material is unsketched. If omitted redraw is true. If you want to unsketch several materials and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch material m:
m.Unsketch()
- Material.ViewParameters()¶
Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with ‘method chaining’ (see the example below) to make sure a property argument is correct
- Returns:
Material object
- Return type:
dict
Example
To check if Material property m.example is a parameter by using the
Material.GetParameter()
method:if m.ViewParameters().GetParameter(m.example): do_something..
- Material.Xrefs()¶
Returns the cross references for this material
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for material m:
xrefs = m.Xrefs()
- Material.YieldStress()¶
Get Yield stress for the material
- Returns:
float
- Return type:
float
Example
To get Yield stress for material m:
yield = m.YieldStress()
- Material.YoungsModulus()¶
Get Youngs modulus for the material
- Returns:
float
- Return type:
float
Example
To get Youngs modulus for material m:
e = m.YoungsModulus()