Oasys.PRIMER.StressBeam class

Constants

Coordinate system for stresses

StressBeam.GLOBAL_CSYS

Stress components are defined in the global coordinate system

StressBeam.LOCAL_CSYS

Stress components are defined in the local beam system

Number of Axes

StressBeam.NAXES_0

Number of variables giving beam local axes is zero

StressBeam.NAXES_12

Number of variables giving beam local axes is 12

Types of Rule

StressBeam.RULE_GUASS_QUADRATURE_NPTS_1

Type of Rule is 1 x 1 Gauss quadrature. Rule value is 1. Also sets npts to 1

StressBeam.RULE_GUASS_QUADRATURE_NPTS_16

Type of Rule is 4 x 4 Gauss quadrature. Rule value is 5. Also sets npts to 16

StressBeam.RULE_GUASS_QUADRATURE_NPTS_4

Type of Rule is 2 x 2 Gauss quadrature. Rule value is 2. Also sets npts to 4

StressBeam.RULE_GUASS_QUADRATURE_NPTS_9

Type of Rule is 3 x 3 Gauss quadrature. Rule value is 3. Also sets npts to 9

StressBeam.RULE_LOBATTO_QUADRATURE_NPTS_9

Type of Rule is 3 x 3 Lobatto quadrature. Rule value is 4. Also sets npts to 9

Properties

property StressBeam.eid: integer

Beam Element ID

property StressBeam.exists(read only): boolean

true if stress_beam exists, false if referred to but not defined

property StressBeam.include: integer

The Include file number that the initial stress beam is in

property StressBeam.large: boolean

true if large format, false otherwise

property StressBeam.local: constant

Coordinate system for stresses. Valid values are: StressBeam.GLOBAL_CSYS or StressBeam.LOCAL_CSYS

property StressBeam.model(read only): integer

The Model number that the initial stress beam is in

property StressBeam.naxes: constant

Number of variables giving beam local axes. Valid values are: StressBeam.NAXES_0 or StressBeam.NAXES_12

property StressBeam.nhisv: integer

Number of additional history variables (only used if large is TRUE)

property StressBeam.npts: integer

Number of integration points. The property value is set automatically if the rule is NOT set to a IntegrationBeam label

property StressBeam.rule: integer

Integration rule type number. Valid values are: StressBeam.RULE_GUASS_QUADRATURE_NPTS_1, StressBeam.RULE_GUASS_QUADRATURE_NPTS_4, StressBeam.RULE_GUASS_QUADRATURE_NPTS_9, StressBeam.RULE_LOBATTO_QUADRATURE_NPTS_9, StressBeam.RULE_GUASS_QUADRATURE_NPTS_16 or a IntegrationBeam label as a negative value

Constructor

classmethod StressBeam(model, eid, rule, large=Oasys.gRPC.defaultArg, nhisv=Oasys.gRPC.defaultArg, local=Oasys.gRPC.defaultArg, naxes=Oasys.gRPC.defaultArg)

Create a new StressBeam object

Parameters:
Returns:

StressBeam object

Return type:

dict

Example

To create a new stress_beam in model m, for beam element id 100 with 4 number of integration points and number of history variables as 4:

s = Oasys.PRIMER.StressBeam(m, 100, StressBeam.RULE_GUASS_QUADRATURE_NPTS_4, True, 4)

Static methods

classmethod StressBeam.First(model)

Returns the first initial stress beam in the model

Parameters:

model (Model) – Model to get first initial stress beam in

Returns:

StressBeam object (or None if there are no initial stress beams in the model)

Return type:

StressBeam

Example

To get the first initial stress beam in model m:

isb = Oasys.PRIMER.StressBeam.First(m)
classmethod StressBeam.FlagAll(model, flag)

Flags all of the initial stress beams in the model with a defined flag

Parameters:
  • model (Model) – Model that all initial stress beams will be flagged in

  • flag (Flag) – Flag to set on the initial stress beams

Returns:

No return value

Return type:

None

Example

To flag all of the initial stress beams with flag f in model m:

Oasys.PRIMER.StressBeam.FlagAll(m, f)
classmethod StressBeam.GetAll(model)

Returns a list of StressBeam objects for all of the initial stress beams in a model in PRIMER

Parameters:

model (Model) – Model to get initial stress beams from

Returns:

List of StressBeam objects

Return type:

list

Example

To make a list of StressBeam objects for all of the initial stress beams in model m

isb = Oasys.PRIMER.StressBeam.GetAll(m)
classmethod StressBeam.GetFlagged(model, flag)

Returns a list of StressBeam objects for all of the flagged initial stress beams in a model in PRIMER

Parameters:
  • model (Model) – Model to get initial stress beams from

  • flag (Flag) – Flag set on the initial stress beams that you want to retrieve

Returns:

List of StressBeam objects

Return type:

list

Example

To make a list of StressBeam objects for all of the initial stress beams in model m flagged with f

isb = Oasys.PRIMER.StressBeam.GetFlagged(m, f)
classmethod StressBeam.GetFromID(model, number)

Returns the StressBeam object for a initial stress beam ID

Parameters:
  • model (Model) – Model to find the initial stress beam in

  • number (integer) – number of the initial stress beam you want the StressBeam object for

Returns:

StressBeam object (or None if initial stress beam does not exist)

Return type:

StressBeam

Example

To get the StressBeam object for initial stress beam 100 in model m

isb = Oasys.PRIMER.StressBeam.GetFromID(m, 100)
classmethod StressBeam.Last(model)

Returns the last initial stress beam in the model

Parameters:

model (Model) – Model to get last initial stress beam in

Returns:

StressBeam object (or None if there are no initial stress beams in the model)

Return type:

StressBeam

Example

To get the last initial stress beam in model m:

isb = Oasys.PRIMER.StressBeam.Last(m)
classmethod StressBeam.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)

Allows the user to pick a initial stress beam

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 beams from that model can be picked. If the argument is a Flag then only initial stress beams that are flagged with limit can be selected. If omitted, or None, any initial stress beams from any model can be selected. from any model

  • modal (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:

StressBeam object (or None if not picked)

Return type:

dict

Example

To pick a initial stress beam from model m giving the prompt ‘Pick initial stress beam from screen’:

isb = Oasys.PRIMER.StressBeam.Pick('Pick initial stress beam from screen', m)
classmethod StressBeam.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select initial stress beams using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting initial stress beams

  • 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 beams from that model can be selected. If the argument is a Flag then only initial stress beams that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial stress beams can be selected. from any model

  • modal (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 beams selected or None if menu cancelled

Return type:

int

Example

To select initial stress beams from model m, flagging those selected with flag f, giving the prompt ‘Select initial stress beams’:

Oasys.PRIMER.StressBeam.Select(f, 'Select initial stress beams', m)

To select initial stress beams, flagging those selected with flag f but limiting selection to initial stress beams flagged with flag l, giving the prompt ‘Select initial stress beams’:

Oasys.PRIMER.StressBeam.Select(f, 'Select initial stress beams', l)
classmethod StressBeam.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Sketches all of the flagged initial stress beams in the model. The initial stress beams will be sketched until you either call StressBeam.Unsketch(), StressBeam.UnsketchFlagged(), Model.UnsketchAll(), or delete the model

Parameters:
  • model (Model) – Model that all the flagged initial stress beams will be sketched in

  • flag (Flag) – Flag set on the initial stress beams that you want to sketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the initial stress beams are sketched. If omitted redraw is true. If you want to sketch flagged initial stress beams 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 beams flagged with flag in model m:

Oasys.PRIMER.StressBeam.SketchFlagged(m, flag)
classmethod StressBeam.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of initial stress beams in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. true if only existing initial stress beams should be counted. If false or omitted referenced but undefined initial stress beams will also be included in the total

Returns:

number of initial stress beams

Return type:

int

Example

To get the total number of initial stress beams in model m:

total = Oasys.PRIMER.StressBeam.Total(m)
classmethod StressBeam.UnflagAll(model, flag)

Unsets a defined flag on all of the initial stress beams in the model

Parameters:
  • model (Model) – Model that the defined flag for all initial stress beams will be unset in

  • flag (Flag) – Flag to unset on the initial stress beams

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the initial stress beams in model m:

Oasys.PRIMER.StressBeam.UnflagAll(m, f)
classmethod StressBeam.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)

Unsketches all initial stress beams

Parameters:
  • model (Model) – Model that all initial stress beams will be unblanked in

  • redraw (boolean) – Optional. If model should be redrawn or not after the initial stress beams 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 beams in model m:

Oasys.PRIMER.StressBeam.UnsketchAll(m)
classmethod StressBeam.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)

Unsketches all flagged initial stress beams in the model

Parameters:
  • model (Model) – Model that all initial stress beams will be unsketched in

  • flag (Flag) – Flag set on the initial stress beams that you want to unsketch

  • redraw (boolean) – Optional. If model should be redrawn or not after the initial stress beams 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 beams flagged with flag in model m:

Oasys.PRIMER.StressBeam.UnsketchAll(m, flag)

Instance methods

StressBeam.AssociateComment(comment)

Associates a comment with a initial stress beam

Parameters:

comment (Comment) – Comment that will be attached to the initial stress beam

Returns:

No return value

Return type:

None

Example

To associate comment c to the initial stress beam isb:

isb.AssociateComment(c)
StressBeam.ClearFlag(flag)

Clears a flag on the initial stress beam

Parameters:

flag (Flag) – Flag to clear on the initial stress beam

Returns:

No return value

Return type:

None

Example

To clear flag f for initial stress beam isb:

isb.ClearFlag(f)
StressBeam.Copy(range=Oasys.gRPC.defaultArg)

Copies the initial stress beam. The target include of the copied initial stress beam 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:

StressBeam object

Return type:

StressBeam

Example

To copy initial stress beam isb into initial stress beam z:

z = isb.Copy()
StressBeam.DetachComment(comment)

Detaches a comment from a initial stress beam

Parameters:

comment (Comment) – Comment that will be detached from the initial stress beam

Returns:

No return value

Return type:

None

Example

To detach comment c from the initial stress beam isb:

isb.DetachComment(c)
StressBeam.Flagged(flag)

Checks if the initial stress beam is flagged or not

Parameters:

flag (Flag) – Flag to test on the initial stress beam

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if initial stress beam isb has flag f set on it:

if isb.Flagged(f):
    do_something..
StressBeam.GetComments()

Extracts the comments associated to a initial stress beam

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 beam isb:

comm_list = isb.GetComments()
StressBeam.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 if large is TRUE. There are npts 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 beam isb:

data = isb.GetIntegrationPoint(2)
StressBeam.GetLocalAxesValues()

Returns the 12 axes values as a list. The axes values are valid only if the naxes is set to StressBeam.NAXES_12

Returns:

A list containing the axes values

Return type:

list

Example

To get the data for the axes values for initial stress beam isb:

data = isb.GetLocalAxesValues()
StressBeam.GetParameter(prop)

Checks if a StressBeam 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 the StressBeam.ViewParameters() method and ‘method chaining’ (see the examples below)

Parameters:

prop (string) – initial stress beam property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if StressBeam property isb.example is a parameter:

Oasys.PRIMER.Options.property_parameter_names = True
if isb.GetParameter(isb.example):
    do_something...
Oasys.PRIMER.Options.property_parameter_names = False

To check if StressBeam property isb.example is a parameter by using the GetParameter method:

if isb.ViewParameters().GetParameter(isb.example):
    do_something..
StressBeam.Keyword()

Returns the keyword for this initial stress beam (*INITIAL_STRESS_BEAM). Note that a carriage return is not added. See also StressBeam.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for stress_beam i:

key = i.Keyword()
StressBeam.KeywordCards()

Returns the keyword cards for the initial stress beam. Note that a carriage return is not added. See also StressBeam.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for stress_beam i:

cards = i.KeywordCards()
StressBeam.Next()

Returns the next initial stress beam in the model

Returns:

StressBeam object (or None if there are no more initial stress beams in the model)

Return type:

StressBeam

Example

To get the initial stress beam in model m after initial stress beam isb:

isb = isb.Next()
StressBeam.Previous()

Returns the previous initial stress beam in the model

Returns:

StressBeam object (or None if there are no more initial stress beams in the model)

Return type:

StressBeam

Example

To get the initial stress beam in model m before initial stress beam isb:

isb = isb.Previous()
StressBeam.SetFlag(flag)

Sets a flag on the initial stress beam

Parameters:

flag (Flag) – Flag to set on the initial stress beam

Returns:

No return value

Return type:

None

Example

To set flag f for initial stress beam isb:

isb.SetFlag(f)
StressBeam.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 if large is TRUE. There are npts integration points

Parameters:
  • index (integer) – Index you want the integration point data for. Note that indices start at 0

  • data (List of data) – List containing the integration point data. The list length should be 7 if large is FALSE. The array length should be (7 + nhisv) if large is TRUE

Returns:

No return value

Return type:

None

Example

To set the 3rd integration point data for initial stress beam isb to the values in list adata:

isb.SetIntegrationPoint(2, adata)
StressBeam.SetLocalAxesValues(data)

Sets the 12 axes values as a list. The axes values are set only if the naxes is set to StressBeam.NAXES_12

Parameters:

data (List of data) – List containing the axes values data. The list length should be 12

Returns:

No return value

Return type:

None

Example

To set the data for the axes values for initial stress beam isb:

data = isb.SetLocalAxesValues(data)
StressBeam.Sketch(redraw=Oasys.gRPC.defaultArg)

Sketches the initial stress beam. The initial stress beam will be sketched until you either call StressBeam.Unsketch(), StressBeam.UnsketchAll(), Model.UnsketchAll(), or delete the model

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the initial stress beam is sketched. If omitted redraw is true. If you want to sketch several initial stress beams 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 beam isb:

isb.Sketch()
StressBeam.Unsketch(redraw=Oasys.gRPC.defaultArg)

Unsketches the initial stress beam

Parameters:

redraw (boolean) – Optional. If model should be redrawn or not after the initial stress beam is unsketched. If omitted redraw is true. If you want to unsketch several initial stress beams 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 beam isb:

isb.Unsketch()
StressBeam.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:

StressBeam object

Return type:

dict

Example

To check if StressBeam property isb.example is a parameter by using the StressBeam.GetParameter() method:

if isb.ViewParameters().GetParameter(isb.example):
    do_something..
StressBeam.Xrefs()

Returns the cross references for this initial stress beam

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for initial stress beam isb:

xrefs = isb.Xrefs()