Oasys.PRIMER.StressSolid class¶
Constants¶
Properties¶
- property StressSolid.exists(read only): boolean¶
true if stress_solid exists, false if referred to but not defined
- property StressSolid.ialegp: integer¶
*ALE_MULTI-MATERIAL_GROUP or *ALE_STRUCTURED_MULTI-MATERIAL_GROUP id
- property StressSolid.iveflg: integer¶
Initial volume energy flag (only used if
large
is TRUE). Valid values are 0, 1 and 2 only
- property StressSolid.large: boolean¶
true if large format, false otherwise
- property StressSolid.model(read only): integer¶
The
Model
number that the initial stress solid is in
- property StressSolid.nhisv: integer¶
Number of additional history variables (only used if
large
is TRUE)
- property StressSolid.nint: integer¶
Number of integration points (should correspond to the solid element formulation). Valid values for hexadral solid elements are 1, 8 or 14. Valid values for tetrahedral elements are 1, 4 or 5. Valid values for pentraderal elements are 1 or 2
- property StressSolid.nthhsv: integer¶
Number of thermal history variables per thermal integration point (only used if
large
is TRUE)
- property StressSolid.nthint: integer¶
Number of thermal integration points (only used if
large
is TRUE)
- property StressSolid.type: constant¶
The Intial stress solid type. Can be
StressSolid.SOLID
orStressSolid.SET
Constructor¶
- classmethod StressSolid(model, type, eid, nint, nhisv, large, iveflg)¶
Create a new
StressSolid
object
- Parameters:
model (Model) –
Model
that stress_solid will be created intype (constant) – Specify the type of initial stress solid (Can be
StressSolid.SOLID
orStressSolid.SET
)eid (integer) –
Solid
Element ID or solid set IDnint (integer) – Number of integration points (should correspond to the solid element formulation). Valid values for hexadral solid elements are 1, 8 or 14. Valid values for tetrahedral elements are 1, 4 or 5. Valid values for pentraderal elements are 1 or 2
nhisv (integer) – Number of additional history variables (only used if
large
is TRUE)large (boolean) – true if large format, false otherwise
iveflg (integer) – Initial volume energy flag (only used if
large
is TRUE). Valid values are 0, 1 and 2 only- Returns:
StressSolid object
- Return type:
dict
Example
To create a new stress_solid in model m, of type SET with SOLID_SET id as 1, number of integration points as 3 and number of history variables as 4
s = Oasys.PRIMER.StressSolid(m, Oasys.PRIMER.StressSolid.SET, 1, 3, 4, True)
Static methods¶
- classmethod StressSolid.First(model)¶
Returns the first initial stress solid in the model
- Parameters:
model (Model) –
Model
to get first initial stress solid in- Returns:
StressSolid object (or None if there are no initial stress solids in the model)
- Return type:
StressSolid
Example
To get the first initial stress solid in model m:
iso = Oasys.PRIMER.StressSolid.First(m)
- classmethod StressSolid.FlagAll(model, flag)¶
Flags all of the initial stress solids in the model with a defined flag
- Parameters:
model (Model) –
Model
that all initial stress solids will be flagged inflag (Flag) – Flag to set on the initial stress solids
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial stress solids with flag f in model m:
Oasys.PRIMER.StressSolid.FlagAll(m, f)
- classmethod StressSolid.GetAll(model)¶
Returns a list of StressSolid objects for all of the initial stress solids in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial stress solids from- Returns:
List of StressSolid objects
- Return type:
list
Example
To make a list of StressSolid objects for all of the initial stress solids in model m
iso = Oasys.PRIMER.StressSolid.GetAll(m)
- classmethod StressSolid.GetFlagged(model, flag)¶
Returns a list of StressSolid objects for all of the flagged initial stress solids in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial stress solids fromflag (Flag) – Flag set on the initial stress solids that you want to retrieve
- Returns:
List of StressSolid objects
- Return type:
list
Example
To make a list of StressSolid objects for all of the initial stress solids in model m flagged with f
iso = Oasys.PRIMER.StressSolid.GetFlagged(m, f)
- classmethod StressSolid.GetFromID(model, number)¶
Returns the StressSolid object for a initial stress solid ID
- Parameters:
model (Model) –
Model
to find the initial stress solid innumber (integer) – number of the initial stress solid you want the StressSolid object for
- Returns:
StressSolid object (or None if initial stress solid does not exist)
- Return type:
StressSolid
Example
To get the StressSolid object for initial stress solid 100 in model m
iso = Oasys.PRIMER.StressSolid.GetFromID(m, 100)
- classmethod StressSolid.Last(model)¶
Returns the last initial stress solid in the model
- Parameters:
model (Model) –
Model
to get last initial stress solid in- Returns:
StressSolid object (or None if there are no initial stress solids in the model)
- Return type:
StressSolid
Example
To get the last initial stress solid in model m:
iso = Oasys.PRIMER.StressSolid.Last(m)
- classmethod StressSolid.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial stress solid
- 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 initial stress solids from that model can be picked. If the argument is aFlag
then only initial stress solids that are flagged with limit can be selected. If omitted, or None, any initial stress solids 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:
StressSolid object (or None if not picked)
- Return type:
dict
Example
To pick a initial stress solid from model m giving the prompt ‘Pick initial stress solid from screen’:
iso = Oasys.PRIMER.StressSolid.Pick('Pick initial stress solid from screen', m)
- classmethod StressSolid.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial stress solids using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial stress solids
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only initial stress solids from that model can be selected. If the argument is aFlag
then only initial stress solids that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial stress solids 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 initial stress solids selected or None if menu cancelled
- Return type:
int
Example
To select initial stress solids from model m, flagging those selected with flag f, giving the prompt ‘Select initial stress solids’:
Oasys.PRIMER.StressSolid.Select(f, 'Select initial stress solids', m)To select initial stress solids, flagging those selected with flag f but limiting selection to initial stress solids flagged with flag l, giving the prompt ‘Select initial stress solids’:
Oasys.PRIMER.StressSolid.Select(f, 'Select initial stress solids', l)
- classmethod StressSolid.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged initial stress solids in the model. The initial stress solids will be sketched until you either call
StressSolid.Unsketch()
,StressSolid.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged initial stress solids will be sketched inflag (Flag) – Flag set on the initial stress solids that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial stress solids are sketched. If omitted redraw is true. If you want to sketch flagged initial stress solids 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 initial stress solids flagged with flag in model m:
Oasys.PRIMER.StressSolid.SketchFlagged(m, flag)
- classmethod StressSolid.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial stress solids in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing initial stress solids should be counted. If false or omitted referenced but undefined initial stress solids will also be included in the total
- Returns:
number of initial stress solids
- Return type:
int
Example
To get the total number of initial stress solids in model m:
total = Oasys.PRIMER.StressSolid.Total(m)
- classmethod StressSolid.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial stress solids in the model
- Parameters:
model (Model) –
Model
that the defined flag for all initial stress solids will be unset inflag (Flag) – Flag to unset on the initial stress solids
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial stress solids in model m:
Oasys.PRIMER.StressSolid.UnflagAll(m, f)
- classmethod StressSolid.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial stress solids
- Parameters:
model (Model) –
Model
that all initial stress solids will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the initial stress solids 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 initial stress solids in model m:
Oasys.PRIMER.StressSolid.UnsketchAll(m)
- classmethod StressSolid.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial stress solids in the model
- Parameters:
model (Model) –
Model
that all initial stress solids will be unsketched inflag (Flag) – Flag set on the initial stress solids that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial stress solids 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 initial stress solids flagged with flag in model m:
Oasys.PRIMER.StressSolid.UnsketchAll(m, flag)
Instance methods¶
- StressSolid.AssociateComment(comment)¶
Associates a comment with a initial stress solid
- Parameters:
comment (Comment) –
Comment
that will be attached to the initial stress solid- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial stress solid iso:
iso.AssociateComment(c)
- StressSolid.ClearFlag(flag)¶
Clears a flag on the initial stress solid
- Parameters:
flag (Flag) – Flag to clear on the initial stress solid
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial stress solid iso:
iso.ClearFlag(f)
- StressSolid.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial stress solid. The target include of the copied initial stress solid 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:
StressSolid object
- Return type:
StressSolid
Example
To copy initial stress solid iso into initial stress solid z:
z = iso.Copy()
- StressSolid.DetachComment(comment)¶
Detaches a comment from a initial stress solid
- Parameters:
comment (Comment) –
Comment
that will be detached from the initial stress solid- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial stress solid iso:
iso.DetachComment(c)
- StressSolid.Flagged(flag)¶
Checks if the initial stress solid is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial stress solid
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial stress solid iso has flag f set on it:
if iso.Flagged(f): do_something..
- StressSolid.GetComments()¶
Extracts the comments associated to a initial stress solid
- 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 initial stress solid iso:
comm_list = iso.GetComments()
- StressSolid.GetIntegrationPoint(index)¶
Returns the data for a specific integration point as a list. For each integration point there will be 7 values if
large
is FALSE. For each integration point there will be (7 +nhisv
) values iflarge
is TRUE. There arenint
integration points
- Parameters:
index (integer) – Index you want the integration point data for. Note that indices start at 0
- Returns:
A list containing the integration point data
- Return type:
list
Example
To get the data for the 3rd integration point for initial stress solid iso:
data = iso.GetIntegrationPoint(2)
- StressSolid.GetParameter(prop)¶
Checks if a StressSolid 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 theStressSolid.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial stress solid property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if StressSolid property iso.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if iso.GetParameter(iso.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if StressSolid property iso.example is a parameter by using the GetParameter method:
if iso.ViewParameters().GetParameter(iso.example): do_something..
- StressSolid.GetThermalIntegrationPoint(index)¶
Returns the thermal data for a specific integration point as a list. For each integration point there will be
nthhsv
values. There arenthint
integration points
- Parameters:
index (integer) – Index you want the integration point data for. Note that indices start at 0
- Returns:
A list containing the integration point data
- Return type:
list
Example
To get the data for the 3rd thermal integration point for initial stress solid iso:
data = iso.GetThermalIntegrationPoint(2)
- StressSolid.Keyword()¶
Returns the keyword for this initial stress solid (*INITIAL_STRESS_SOLID). Note that a carriage return is not added. See also
StressSolid.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for stress_solid i:
key = i.Keyword()
- StressSolid.KeywordCards()¶
Returns the keyword cards for the initial stress solid. Note that a carriage return is not added. See also
StressSolid.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for stress_solid i:
cards = i.KeywordCards()
- StressSolid.Next()¶
Returns the next initial stress solid in the model
- Returns:
StressSolid object (or None if there are no more initial stress solids in the model)
- Return type:
StressSolid
Example
To get the initial stress solid in model m after initial stress solid iso:
iso = iso.Next()
- StressSolid.Previous()¶
Returns the previous initial stress solid in the model
- Returns:
StressSolid object (or None if there are no more initial stress solids in the model)
- Return type:
StressSolid
Example
To get the initial stress solid in model m before initial stress solid iso:
iso = iso.Previous()
- StressSolid.SetFlag(flag)¶
Sets a flag on the initial stress solid
- Parameters:
flag (Flag) – Flag to set on the initial stress solid
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial stress solid iso:
iso.SetFlag(f)
- StressSolid.SetIntegrationPoint(index, data)¶
Set the data for a specific integration point. For each integration point there will be 7 values if
large
is FALSE. For each integration point there will be (7 +nhisv
) values iflarge
is TRUE. There arenint
integration points
- Parameters:
- Returns:
No return value
- Return type:
None
Example
To set the 3rd integration point data for initial stress solid iso to the values in list adata:
iso.SetIntegrationPoint(2, adata)
- StressSolid.SetThermalIntegrationPoint(index, data)¶
Set the thermal data for a specific integration point. For each integration point there will be
nthhsv
values. There arenthint
thermal integration points
- Parameters:
index (integer) – Index you want the thermal integration point data for. Note that indices start at 0
data (List of data) – List containing the thermal integration point data. The list length should be
nthhsv
- Returns:
No return value
- Return type:
None
Example
To set the 3rd thermal integration point data for initial stress solid iso to the values in list adata:
iso.SetThermalIntegrationPoint(2, adata)
- StressSolid.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the initial stress solid. The initial stress solid will be sketched until you either call
StressSolid.Unsketch()
,StressSolid.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial stress solid is sketched. If omitted redraw is true. If you want to sketch several initial stress solids 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 initial stress solid iso:
iso.Sketch()
- StressSolid.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial stress solid
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial stress solid is unsketched. If omitted redraw is true. If you want to unsketch several initial stress solids 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 initial stress solid iso:
iso.Unsketch()
- StressSolid.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:
StressSolid object
- Return type:
dict
Example
To check if StressSolid property iso.example is a parameter by using the
StressSolid.GetParameter()
method:if iso.ViewParameters().GetParameter(iso.example): do_something..
- StressSolid.Xrefs()¶
Returns the cross references for this initial stress solid
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for initial stress solid iso:
xrefs = iso.Xrefs()