Oasys.D3PLOT.Contact class¶
Constants¶
Properties¶
- property Contact.aNodes: integer¶
Total number of nodes on the SURFA side of the contact
- property Contact.aSegments: integer¶
Total number of segments on the SURFA side of the contact
- property Contact.bNodes: integer¶
Total number of nodes on the SURFB side of the contact
- property Contact.bSegments: integer¶
Total number of segments on the SURFB side of the contact
- property Contact.data: float | array¶
Component data for a contact passed as an argument to
GetMultipleData
. Note that data will only exist for the instance of the contact passed toGetMultipleData
. i.e. it is a local property stored on the specific instance. It is not stored in the D3PLOT database
- property Contact.include: integer¶
The include file number in the model that the contact is in
- property Contact.index: integer¶
The internal index for the contact in D3PLOT
- property Contact.label: integer¶
The LS-DYNA label for the contact
- property Contact.name: string¶
The name of the contact type
- property Contact.title: string¶
The title of the contact
- property Contact.type: constant¶
The type for the contact (will be
Type.CONTACT
)
Static methods¶
- classmethod Contact.BlankAll(window, model)¶
Blanks all of the contacts in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the contacts inmodel (Model) –
Model
that all the contacts will be blanked in- Returns:
No return value
- Return type:
None
Example
To blank all of the contacts in model m, in graphics window gw:
Oasys.D3PLOT.Contact.BlankAll(gw, m)
- classmethod Contact.BlankFlagged(window, model, flag)¶
Blanks all of the contacts in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the contacts inmodel (Model) –
Model
that the flagged contacts will be blanked inflag (Flag) – Flag (see
AllocateFlag
) set on the contacts to blank- Returns:
No return value
- Return type:
None
Example
To blank all of the contacts flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Contact.BlankFlagged(gw, m, f)
- classmethod Contact.First(model)¶
Returns the first contact in the model (or None if there are no contacts in the model)
- Parameters:
model (Model) –
Model
to get first contact in- Returns:
Contact object
- Return type:
Contact
Example
To get the first contact in model m:
c = Oasys.D3PLOT.Contact.First(m)
- classmethod Contact.FlagAll(model, flag)¶
Flags all of the contacts in the model with a defined flag
- Parameters:
model (Model) –
Model
that all the contacts will be flagged inflag (Flag) – Flag (see
AllocateFlag
) to set on the contacts- Returns:
No return value
- Return type:
None
Example
To flag all of the contacts with flag f in model m:
Oasys.D3PLOT.Contact.FlagAll(m, f)
- classmethod Contact.GetAll(model)¶
Gets all of the contacts in the model
- Parameters:
model (Model) –
Model
that all the contacts are in- Returns:
List of
Contact
objects- Return type:
list
Example
To get all of the contacts in model m:
c = Oasys.D3PLOT.Contact.GetAll(m)
- classmethod Contact.GetFlagged(model, flag)¶
Gets all of the contacts in the model flagged with a defined flag
- Parameters:
model (Model) –
Model
that the flagged contacts are inflag (Flag) – Flag (see
AllocateFlag
) set on the contacts to get- Returns:
List of
Contact
objects- Return type:
list
Example
To get all of the contacts flagged with flag f in model m:
Oasys.D3PLOT.Contact.GetFlagged(m, f)
- classmethod Contact.GetFromID(model, label)¶
Returns the Contact object for contact in model with label (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get contact inlabel (integer) – The LS-DYNA label for the contact in the model
- Returns:
Contact object
- Return type:
Contact
Example
To get the contact in model m with label 1000:
c = Oasys.D3PLOT.Contact.GetFromID(m, 1000)
- classmethod Contact.GetFromIndex(model, index)¶
Returns the Contact object for contact in model with index (or None if it does not exist)
- Parameters:
model (Model) –
Model
to get contact inindex (integer) – The D3PLOT internal index in the model for contact
- Returns:
Contact object
- Return type:
Contact
Example
To get the contact in model m at index 50:
c = Oasys.D3PLOT.Contact.GetFromIndex(m, 50)
- classmethod Contact.GetMultipleData(component, items, options=Oasys.gRPC.defaultArg)¶
Returns the value for a data component for multiple contacts. For each contact a local property called data will be created containing a number if a scalar component, or a list if a vector or tensor component (or None if the value cannot be calculated). The data is also returned as an object.
Also seeGetData
- Parameters:
component (constant) – Component constant to get data for
items (list) – List of
Contact
objects to get the data for. All of the contacts must be in the same modeloptions (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- extra:
(integer) The extra data component number if component
Component.SOX
for solids,Component.BMX
for beams orComponent.SHX
for shells and thick shells- ip:
(integer) Integration point number to get the data at (ip >= 1 or one of the constants
Constant.TOP
,Constant.MIDDLE
orConstant.BOTTOM
)- op:
(integer) On plane integration point number for shells and thick shells (op >= 1 [default])
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
. This is only necessary for directional components (eg X stress) and then only when something other than the defaultConstant.GLOBAL
coordinate system is to be used- user:
(integer) The user-defined component number if component
Component.UNOS
,Component.UNOV
,Component.USSS
,Component.USST
,Component.UBMS
orComponent.UBMV
- Returns:
Dictionary containing the data. A property is created in the dictionary for each contact with the label. The value of the property is a number if a scalar component or an array if a vector or tensor component (or None if the value cannot be calculated)
- Return type:
dictionary
Example
To calculate a component for contacts in list items and use the data property (note that in the example, the argument extra is optional):
Oasys.D3PLOT.Contact.GetMultipleData(component, items, {"extra": 1}) for item in items: if item.data != None: do_something..To calculate a component for contacts in list items and use the return value (note that in the example, the argument extra is optional):
data = Oasys.D3PLOT.Contact.GetMultipleData(component, items, {"extra": 1}) for d in data: Oasys.D3PLOT.Message("Label is {}".format(d)) if data[d] != None: do_something..
- classmethod Contact.Last(model)¶
Returns the last contact in the model (or None if there are no contacts in the model)
- Parameters:
model (Model) –
Model
to get last contact in- Returns:
Contact object
- Return type:
Contact
Example
To get the last contact in model m:
c = Oasys.D3PLOT.Contact.Last(m)
- classmethod Contact.Pick()¶
Allows the user to pick a contact from the screen
- Returns:
Contact object or None if cancelled
- Return type:
Contact
Example
To pick a contact:
c = Oasys.D3PLOT.Contact.Pick()
- classmethod Contact.Select(flag)¶
Selects contacts using an object menu
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to use when selecting contacts- Returns:
The number of contacts selected or None if menu cancelled
- Return type:
integer
Example
To select contacts, flagging those selected with flag f:
total = Oasys.D3PLOT.Contact.Select(f)
- classmethod Contact.Total(model)¶
Returns the total number of contacts in the model
- Parameters:
model (Model) –
Model
to get total in- Returns:
The number of contacts
- Return type:
integer
Example
To get the number of contacts in model m:
total = Oasys.D3PLOT.Contact.Total(m)
- classmethod Contact.UnblankAll(window, model)¶
Unblanks all of the contacts in the model
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the contacts inmodel (Model) –
Model
that all the contacts will be unblanked in- Returns:
No return value
- Return type:
None
Example
To unblank all of the contacts in model m, in graphics window gw:
Oasys.D3PLOT.Contact.UnblankAll(gw, m)
- classmethod Contact.UnblankFlagged(window, model, flag)¶
Unblanks all of the contacts in the model flagged with a defined flag
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the contacts inmodel (Model) –
Model
that the flagged contacts will be unblanked inflag (Flag) – Flag (see
AllocateFlag
) set on the contacts to unblank- Returns:
No return value
- Return type:
None
Example
To unblank all of the contacts flagged with flag f in model m, in graphics window gw:
Oasys.D3PLOT.Contact.UnblankFlagged(gw, m, f)
- classmethod Contact.UnflagAll(model, flag)¶
Unsets a defined flag on all of the contacts in the model
- Parameters:
model (Model) –
Model
that the defined flag for all contacts will be unset inflag (Flag) – Flag (see
AllocateFlag
) to unset on the contacts- Returns:
No return value
- Return type:
None
Example
To unset flag f on all of the contacts in model m:
Oasys.D3PLOT.Contact.UnflagAll(m, f)
Instance methods¶
- Contact.Blank(window)¶
Blanks the contact in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to blank the contact in- Returns:
No return value
- Return type:
None
Example
To blank contact c in graphics window g:
c.Blank(g)
- Contact.Blanked(window)¶
Checks if the contact is blanked in a graphics window or not
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) in which to check if the contact is blanked- Returns:
True if blanked, False if not
- Return type:
boolean
Example
To check if contact c is blanked in graphics window g:
if c.Blanked(g): do_something..
- Contact.ClearFlag(flag)¶
Clears a flag on a contact
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to clear on the contact- Returns:
No return value
- Return type:
None
Example
To clear flag f on contact c:
c.ClearFlag()
- Contact.Flagged(flag)¶
Checks if the contact is flagged or not
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to test on the contact- Returns:
True if flagged, False if not
- Return type:
boolean
Example
To check if contact c has flag f set on it:
if c.Flagged(f): do_something..
- Contact.GetData(component, options=Oasys.gRPC.defaultArg)¶
Returns the value for a data component.
Also seeGetMultipleData
- Parameters:
component (constant) – Component constant to get data for
options (dict) –
Optional. Dictionary containing options for getting data. Can be any of:
- extra:
(integer) The extra data component number if component
Component.SOX
for solids,Component.BMX
for beams orComponent.SHX
for shells and thick shells- ip:
(integer) Integration point number to get the data at (ip >= 1 or one of the constants
Constant.TOP
,Constant.MIDDLE
orConstant.BOTTOM
). If the integration point is not defined it will use the integration point defined on the current GUI “data” panel, which defaults to the middle surface for shells, thick shells, and solids, and Mag All for beams, but may vary if changed by an interactive user. If consistent output from a script is required, independent of any prior interactive activity, an explicit integration point or surface should be defined- op:
(integer) On plane integration point number for shells and thick shells (op >= 1 [default])
- referenceFrame:
(constant) The frame of reference to return values in. Either
Constant.GLOBAL
(default),Constant.LOCAL
,Constant.CYLINDRICAL
,Constant.USER_DEFINED
orConstant.MATERIAL
. This is only necessary for directional components (eg X stress) and then only when something other than the defaultConstant.GLOBAL
coordinate system is to be used- user:
(integer) The user-defined component number if component
Component.UNOS
,Component.UNOV
,Component.USSS
,Component.USST
,Component.UBMS
orComponent.UBMV
- Returns:
Number if a scalar component, array if a vector or tensor component (or None if the value cannot be calculated because it’s not available in the model).<br> If requesting an invalid component it will throw an error (e.g. Component.AREA of a node).
- Return type:
float|array
Example
To calculate a component and check it has been calculated (note that in the example, the argument extra is optional):
value = c.GetData(component, {"extra": 1}) if value != None: do_something..
- Contact.GetNode(side, index)¶
Gets a node for a contact
- Parameters:
side (constant) – The side of the contact to get the node for. Either
Contact.SURFA
orContact.SURFB
index (integer) – index of the node to get.
0 <= index <aNodes
for side SURFA
0 <= index <bNodes
for side SURFB- Returns:
Node object
- Return type:
Node
Example
To get the 10th node on SURFB side of contact c in D3PLOT
node = c.GetNode(Oasys.D3PLOT.Contact.SURFB, 9)
- Contact.GetSegment(side, index)¶
Gets a segment for a contact
- Parameters:
side (constant) – The side of the contact to get the segment for. Either
Contact.SURFA
orContact.SURFB
index (integer) – index of the segment to get.
0 <= index <aSegments
for side SURFA
0 <= index <bSegments
for side SURFB- Returns:
Segment object
- Return type:
Segment
Example
To get the 10th segment on SURFB side of contact c in D3PLOT
segm = c.GetSegment(Oasys.D3PLOT.Contact.SURFB, 9)
- Contact.Next()¶
Returns the next contact in the model (or None if there is not one)
- Returns:
Contact object
- Return type:
Contact
Example
To get the next contact after contact c:
c = c.Next()
- Contact.Previous()¶
Returns the previous contact in the model (or None if there is not one)
- Returns:
Contact object
- Return type:
Contact
Example
To get the previous contact before contact c:
c = c.Previous()
- Contact.SetFlag(flag)¶
Sets a flag on a contact
- Parameters:
flag (Flag) – Flag (see
AllocateFlag
) to set on the contact- Returns:
No return value
- Return type:
None
Example
To set flag f on contact c:
c.SetFlag(f)
- Contact.Unblank(window)¶
Unblanks the contact in a graphics window
- Parameters:
window (GraphicsWindow) –
GraphicsWindow
) to unblank the contact in- Returns:
No return value
- Return type:
None
Example
To unblank contact c in graphics window g:
c.Unblank(g)