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