Oasys.PRIMER.Contact class¶
Constants¶
- Contact.CROSSED_EDGES¶
Return crossed edges in
Contact.Interactions()
- Contact.MPP_MODE¶
MPP penetration check mode
- Contact.PENETRATIONS¶
Return penetrations in
Contact.Interactions()
- Contact.SMP_MODE¶
SMP penetration check mode
Contact _OFFSET types¶
Contact penetration check_mode types¶
Contact penetration contact_penchk_dup_shells types¶
- Contact.SHELL_AUTO¶
Launches the penetration edit panel with Automatic shell treatment of duplicate shells
- Contact.SHELL_THICK¶
Launches the penetration edit panel with the thickest always option for duplicate shells
- Contact.SHELL_THIN¶
Launches the penetration edit panel with the thinnest always option for duplicate shells
Properties¶
- property Contact.bt: float¶
Contact birth time
- property Contact.check_mode: integer¶
Checking mode on the pen check edit panel. (Can be
Contact.MPP_METHOD
,Contact.MPP_METHOD
orContact.SMP_METHOD
)
- property Contact.colour: Colour¶
The colour of the contact
- property Contact.contact_penchk_dup_shells: integer¶
Shell treatment on the pen check edit panel. (Can be
Contact.SHELL_AUTO
,Contact.SHELL_AUTO
orContact.SHELL_THIN
orContact.SHELL_THICK
)
- property Contact.dc: float¶
Exponential decay coeff
- property Contact.dt: float¶
Contact death time
- property Contact.exists(read only): boolean¶
true if contact exists, false if referred to but not defined
- property Contact.fd: float¶
Dynamic coeff of friction
- property Contact.fs: float¶
Static coeff of friction
- property Contact.fsf: float¶
Coulomb friction scale factor
- property Contact.id: boolean¶
true if _ID option is set, false if not
- property Contact.mortar: boolean¶
_MORTAR keyword option - true if set, false if not
- property Contact.offset_flag: integer¶
_OFFSET option. (Can be
Contact.NO_OFFSET
,Contact.SIMPLE_OFFSET
,Contact.CONSTR_OFFSET
orContact.BEAM_OFFSET
)
- property Contact.penchk: integer¶
Penetration search flag
- property Contact.saboxid: integer¶
Surface A box id
- property Contact.sapr: integer¶
Surface A side printout flag
- property Contact.sast: float¶
Optional surface A side shell thickness
- property Contact.sbboxid: integer¶
Surface B box id
- property Contact.sbpr: integer¶
Surface B side printout flag
- property Contact.sbst: float¶
Optional surface B side shell thickness
- property Contact.sfsa: float¶
Scale factor on surface A penalty stiffness
- property Contact.sfsat: float¶
Scale factor on true surface A shell thickness
- property Contact.sfsb: float¶
Scale factor on surface B penalty stiffness
- property Contact.sfsbt: float¶
Scale factor on true surface B shell thickness
- property Contact.surfa: integer¶
Surface A set id
- property Contact.surfatyp: integer¶
Surface A set type
- property Contact.surfb: integer¶
Surface B set id
- property Contact.surfbtyp: integer¶
Surface B set type
- property Contact.type: string¶
Contact type (“AUTOMATIC_GENERAL”, “SINGLE_SURFACE” etc)
- property Contact.vc: float¶
Coeff for viscous friction
- property Contact.vdc: float¶
Visous damping coefficient
- property Contact.vsf: float¶
Viscous friction scale factor
COMPOSITE/LUBRICATION options¶
- property Contact.cideta: integer¶
Curve ID for the viscosity
- property Contact.cidmu: integer¶
Curve ID for the coefficient of friction
- property Contact.d_comp: float¶
Composite film thickness
- property Contact.srmodel: integer¶
Model for shear response
- property Contact.tfail: float¶
Tensile traction for failure
CONSTRAINT options¶
- property Contact.kpf: float¶
Kinematic partition factor
CONTRACTION_JOINT options¶
- property Contact.alpha: float¶
Key amplitude parameter A
- property Contact.beta: float¶
Key amplitude parameter B
- property Contact.mtcj: integer¶
The method option for the gap function
- property Contact.tsvx: float¶
X component of the free sliding direction T
- property Contact.tsvy: float¶
Y component of the free sliding direction T
- property Contact.tsvz: float¶
Z component of the free sliding direction T
DRAWBEAD options¶
- property Contact.dbdth: float¶
Draw bead depth
- property Contact.dbpid: integer¶
optional Part ID
- property Contact.dfscl: float¶
Scale factor on lcidrf
- property Contact.eloff: integer¶
optional element id offset
- property Contact.ending: float¶
Parameter to define the length of the bead
- property Contact.epm: float¶
Maximum strain the blank will experience when it passes the bead
- property Contact.epscale: float¶
Scale factor to weaken the stress-strain curve
- property Contact.lceps: integer¶
Loadcurve ID for plastic strain vs. parametric coord
- property Contact.lceps2: integer¶
Loadcurve ID for plastic strain vs. parametric coord (elements moved > offset)
- property Contact.lcidnf: integer¶
Loadcurve ID for Normal force per unit length
- property Contact.lcidrf: integer¶
Loadcurve ID for Force due to bending per unit length
- property Contact.numint: integer¶
#int points along drawbead
- property Contact.offset_1: float¶
distance offset
- property Contact.tscale: integer¶
ERODING options¶
INTERFERENCE options¶
RIGID options¶
THERMAL options¶
- property Contact.a: integer¶
Loadcurve ID for a
- property Contact.algo: integer¶
contact algorithm
- property Contact.b: integer¶
Loadcurve ID for b
- property Contact.bc_flg: integer¶
boundary condition flag
- property Contact.c: integer¶
Loadcurve ID for c
- property Contact.d: integer¶
Loadcurve ID for d
- property Contact.formula: integer¶
formula id
- property Contact.frad: float¶
Radiation conductance across gap
- property Contact.ftosa: float¶
Fraction of sliding friction energy partitioned to surface A
- property Contact.h0: float¶
Heat transfer coefficient
- property Contact.k: float¶
Conductivity of gap fluid
- property Contact.lcfdt: integer¶
Loadcurve ID for dynamic friction vs. temp
- property Contact.lcfst: integer¶
Loadcurve ID for static friction vs. temp
- property Contact.lch: integer¶
Loadcurve ID for lch
- property Contact.lmax: float¶
Max size for thermal contact
- property Contact.lmin: float¶
Critical gap size
- property Contact.thermal: boolean¶
If _THERMAL option is set. Can be true or false
TIEBREAK options¶
- property Contact.cn: float¶
Normal stiffness
- property Contact.ct2cn: float¶
Ratio of tangential stiffness to normal stiffness
- property Contact.eraten: float¶
Normal energy release rate used in damage calculation
- property Contact.erates: float¶
Shear energy release rate used in damage calculation
- property Contact.mes: float¶
Shear force exponent
- property Contact.nen: float¶
Normal force exponent
- property Contact.nfls: float¶
Normal failure stress
- property Contact.option: integer¶
Response option
- property Contact.param: float¶
Critical distance
- property Contact.sfls: float¶
Shear failure stress
- property Contact.tblcid: integer¶
Loadcurve ID for stress vs gap post failure
- property Contact.thkoff: integer¶
flag for thickness offset
TIEBREAK_USER options¶
- property Contact.cn_1: float¶
Normal stiffness
- property Contact.ct2cn_1: float¶
Ratio of tangential to normal stiff
- property Contact.nhv: integer¶
Number of history variables
- property Contact.offset: integer¶
Flag for offset treatment. This is only valid for *CONTACT_AUTOMATIC(_ONE_WAY)_SURFACE_TO_SURFACE_TIEBREAK_USER and should not be confused with the ‘offset’ property for other contact types
- property Contact.option_1: integer¶
User tiebreak type
- property Contact.up1: float¶
User parameter
- property Contact.up10: float¶
User parameter
- property Contact.up11: float¶
User parameter
- property Contact.up12: float¶
User parameter
- property Contact.up13: float¶
User parameter
- property Contact.up14: float¶
User parameter
- property Contact.up15: float¶
User parameter
- property Contact.up16: float¶
User parameter
- property Contact.up2: float¶
User parameter
- property Contact.up3: float¶
User parameter
- property Contact.up4: float¶
User parameter
- property Contact.up5: float¶
User parameter
- property Contact.up6: float¶
User parameter
- property Contact.up7: float¶
User parameter
- property Contact.up8: float¶
User parameter
- property Contact.up9: float¶
User parameter
TIED_WELD options¶
- property Contact.close: float¶
Surface closeness parameter
- property Contact.hclose: float¶
Thermal contact conductivity
- property Contact.nmhis: integer¶
Number of material history variables
- property Contact.nmtwh: integer¶
Number of surface B tied weld history variables
- property Contact.nstwh: integer¶
Number of surface A tied weld history variables
- property Contact.ntprm: integer¶
Number of user tied weld parameters
- property Contact.temp: float¶
Minimum temperature required
- property Contact.time: float¶
Minimum time required
_MPP option¶
- property Contact.bucket: integer¶
Bucket sorting frequency
- property Contact.chksegs: integer¶
Special check for inverted elements
- property Contact.cparm8: integer¶
Exclude beam to beam contact flag
- property Contact.grpable: integer¶
Experimental contact algorithm
- property Contact.inititer: integer¶
Number of iterations for initial penetration checking
- property Contact.lcbucket: integer¶
Bucket sorting frequency loadcurve ID
- property Contact.mpp: boolean¶
true if _MPP option is set, false if not
- property Contact.ns2track: integer¶
Number of segments to track per surface A node
- property Contact.parmax: float¶
The parametric extension distance for contact segments
- property Contact.pensf: float¶
Ignore penetration scale factor
optional card A¶
- property Contact.bsort: integer¶
Loadcurve for #cycles between bucket sorts
- property Contact.depth: integer¶
Loadcurve for search depth in automatic contact
- property Contact.frcfrq: integer¶
#cycles between penalty force updates
- property Contact.lcidab: integer¶
Loadcurve ID for airbag thickness vs time
- property Contact.maxpar: float¶
Max parametric coord overlap
- property Contact.sbopt: float¶
segment based contact option
- property Contact.sofscl: float¶
Soft constraint scale factor
- property Contact.soft: integer¶
Soft constraint flag
optional card B¶
- property Contact.i2d3d: integer¶
Segment searching option
- property Contact.isym: integer¶
Symmetry plane option
- property Contact.penmax: float¶
Max pen distance for “old” types 3, 5, 10
- property Contact.shlthk: integer¶
Thickness consideration flag
- property Contact.sldstf: float¶
Optional solid stiffness
- property Contact.sldthk: float¶
Optional solid thickness
- property Contact.snlog: integer¶
Shooting node logic flag
- property Contact.thkopt: integer¶
Thickness option for “old” types 3, 5, 10
optional card C¶
- property Contact.cid_rcf: integer¶
Coordinate system ID
to output rcforc force resultants and ncforc data in a local system
- property Contact.dprfac: float¶
Depth of penetration reduction factor
- property Contact.dtstif: float¶
Timestep used in stiffness calc
- property Contact.flangl: float¶
Angle tolerance in radians for feature lines option in smooth contact
- property Contact.igap: integer¶
Implicit convergence flag
- property Contact.ignore: integer¶
Ignore initial pens in automatic types
optional card D¶
- property Contact.dnlscl: float¶
Distance for nonlinear force scaling
- property Contact.dtpchk: float¶
Time interval between penetration reports
- property Contact.fnlscl: float¶
Scale factor for nonlinear force scaling
- property Contact.q2tri: integer¶
Split quads into 2 trias
- property Contact.sfnbr: float¶
Scale factor for neighbour segment contact
- property Contact.shledg: integer¶
Edge shape for shells when measuring penetration
- property Contact.tcso: integer¶
Segment treatment only flag
- property Contact.tiedid: integer¶
Incremental displacement update for tied contacts
optional card E¶
- property Contact.cparm8smp: integer¶
Spotweld beam flag for SMP
- property Contact.fricsf: float¶
Scale factor for frictional stiffness
- property Contact.ftorq: integer¶
Beam torsional force computation flag
- property Contact.icor: integer¶
coefficient of restitution expressed as a percentage
- property Contact.ipback: integer¶
Create backup penalty tied contact
- property Contact.region: integer¶
Region to limit contact volume
Shared constraint flag
- property Contact.srnde: integer¶
Flag for non-extended exterior shell edges
optional card F¶
- property Contact.dbinr: integer¶
2dbinr - Flag to include 2d belt elements in contact (note properties cannot start with a number, so 2 has been removed)
- property Contact.fstol: float¶
Tolerance for determining flat segments
- property Contact.ignroff: integer¶
Flag to ignore the thickness offset for shells in the calculation of the shell contact penetration depth
- property Contact.pstiff: integer¶
Flag to choose the method for calculating the penalty stiffness
- property Contact.ssftyp: integer¶
Flag to determine how the SSF option on *PART_CONTACT behaves when SOFT = 2 on optional card A
- property Contact.swtpr: integer¶
Flag to use tapered shell contact segments adjacent to segments that are thinned by the SPOTHIN option on *CONTROL_CONTACT
- property Contact.tetfac: float¶
Scale factor for the computed volume of tetrahedral solid elements for the mass calculation in SOFT = 2 contact.
Constructor¶
- classmethod Contact(model, type, id=Oasys.gRPC.defaultArg, heading=Oasys.gRPC.defaultArg)¶
Create a new
Contact
object
- Parameters:
- Returns:
Contact object
- Return type:
dict
Example
To create a new AUTOMATIC_GENERIC contact n model m with label 10 and title “Test contact”
c = Oasys.PRIMER.Contact(m, "AUTOMATIC_GENERAL", 10, "Test contact")
Static methods¶
- classmethod Contact.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the contacts in the model
- Parameters:
model (Model) –
Model
that all contacts 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 contacts in model m:
Oasys.PRIMER.Contact.BlankAll(m)
- classmethod Contact.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged contacts in the model
- Parameters:
model (Model) –
Model
that all the flagged contacts will be blanked inflag (Flag) – Flag set on the contacts 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 contacts in model m flagged with f:
Oasys.PRIMER.Contact.BlankFlagged(m, f)
- classmethod Contact.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a contact
- Parameters:
model (Model) –
Model
that the contact 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:
Contact object (or None if not made)
- Return type:
dict
Example
To start creating a contact in model m:
c = Oasys.PRIMER.Contact.Create(m)
- classmethod Contact.First(model)¶
Returns the first contact in the model
- Parameters:
model (Model) –
Model
to get first contact in- Returns:
Contact object (or None if there are no contacts in the model)
- Return type:
Contact
Example
To get the first contact in model m:
c = Oasys.PRIMER.Contact.First(m)
- classmethod Contact.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free contact label in the model. Also see
Contact.LastFreeLabel()
,Contact.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
Contact label
- Return type:
int
Example
To get the first free contact label in model m:
label = Oasys.PRIMER.Contact.FirstFreeLabel(m)
- classmethod Contact.FlagAll(model, flag)¶
Flags all of the contacts in the model with a defined flag
- Parameters:
model (Model) –
Model
that all contacts will be flagged inflag (Flag) – Flag 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.PRIMER.Contact.FlagAll(m, f)
- classmethod Contact.GetAll(model)¶
Returns a list of Contact objects for all of the contacts in a model in PRIMER
- Parameters:
model (Model) –
Model
to get contacts from- Returns:
List of Contact objects
- Return type:
list
Example
To make a list of Contact objects for all of the contacts in model m
c = Oasys.PRIMER.Contact.GetAll(m)
- classmethod Contact.GetFlagged(model, flag)¶
Returns a list of Contact objects for all of the flagged contacts in a model in PRIMER
- Parameters:
model (Model) –
Model
to get contacts fromflag (Flag) – Flag set on the contacts that you want to retrieve
- Returns:
List of Contact objects
- Return type:
list
Example
To make a list of Contact objects for all of the contacts in model m flagged with f
c = Oasys.PRIMER.Contact.GetFlagged(m, f)
- classmethod Contact.GetFromID(model, number)¶
Returns the Contact object for a contact ID
- Parameters:
model (Model) –
Model
to find the contact innumber (integer) – number of the contact you want the Contact object for
- Returns:
Contact object (or None if contact does not exist)
- Return type:
Contact
Example
To get the Contact object for contact 100 in model m
c = Oasys.PRIMER.Contact.GetFromID(m, 100)
- classmethod Contact.Last(model)¶
Returns the last contact in the model
- Parameters:
model (Model) –
Model
to get last contact in- Returns:
Contact object (or None if there are no contacts in the model)
- Return type:
Contact
Example
To get the last contact in model m:
c = Oasys.PRIMER.Contact.Last(m)
- classmethod Contact.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free contact label in the model. Also see
Contact.FirstFreeLabel()
,Contact.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
Contact label
- Return type:
int
Example
To get the last free contact label in model m:
label = Oasys.PRIMER.Contact.LastFreeLabel(m)
- classmethod Contact.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) contact label in the model. Also see
Contact.FirstFreeLabel()
,Contact.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
Contact label
- Return type:
int
Example
To get the next free contact label in model m:
label = Oasys.PRIMER.Contact.NextFreeLabel(m)
- classmethod Contact.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a contact
- 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 contacts from that model can be picked. If the argument is aFlag
then only contacts that are flagged with limit can be selected. If omitted, or None, any contacts 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:
Contact object (or None if not picked)
- Return type:
dict
Example
To pick a contact from model m giving the prompt ‘Pick contact from screen’:
c = Oasys.PRIMER.Contact.Pick('Pick contact from screen', m)
- classmethod Contact.RenumberAll(model, start)¶
Renumbers all of the contacts in the model
- Parameters:
model (Model) –
Model
that all contacts will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the contacts in model m, from 1000000:
Oasys.PRIMER.Contact.RenumberAll(m, 1000000)
- classmethod Contact.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged contacts in the model
- Parameters:
model (Model) –
Model
that all the flagged contacts will be renumbered inflag (Flag) – Flag set on the contacts that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the contacts in model m flagged with f, from 1000000:
Oasys.PRIMER.Contact.RenumberFlagged(m, f, 1000000)
- classmethod Contact.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select contacts using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting contacts
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only contacts from that model can be selected. If the argument is aFlag
then only contacts that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any contacts 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 contacts selected or None if menu cancelled
- Return type:
int
Example
To select contacts from model m, flagging those selected with flag f, giving the prompt ‘Select contacts’:
Oasys.PRIMER.Contact.Select(f, 'Select contacts', m)To select contacts, flagging those selected with flag f but limiting selection to contacts flagged with flag l, giving the prompt ‘Select contacts’:
Oasys.PRIMER.Contact.Select(f, 'Select contacts', l)
- classmethod Contact.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged contacts in the model. The contacts will be sketched until you either call
Contact.Unsketch()
,Contact.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged contacts will be sketched inflag (Flag) – Flag set on the contacts that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the contacts are sketched. If omitted redraw is true. If you want to sketch flagged contacts 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 contacts flagged with flag in model m:
Oasys.PRIMER.Contact.SketchFlagged(m, flag)
- classmethod Contact.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of contacts in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing contacts should be counted. If false or omitted referenced but undefined contacts will also be included in the total
- Returns:
number of contacts
- Return type:
int
Example
To get the total number of contacts in model m:
total = Oasys.PRIMER.Contact.Total(m)
- classmethod Contact.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the contacts in the model
- Parameters:
model (Model) –
Model
that all contacts 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 contacts in model m:
Oasys.PRIMER.Contact.UnblankAll(m)
- classmethod Contact.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged contacts in the model
- Parameters:
model (Model) –
Model
that the flagged contacts will be unblanked inflag (Flag) – Flag set on the contacts 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 contacts in model m flagged with f:
Oasys.PRIMER.Contact.UnblankFlagged(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 to unset on the contacts
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the contacts in model m:
Oasys.PRIMER.Contact.UnflagAll(m, f)
- classmethod Contact.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all contacts
- Parameters:
model (Model) –
Model
that all contacts will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the contacts 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 contacts in model m:
Oasys.PRIMER.Contact.UnsketchAll(m)
- classmethod Contact.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged contacts in the model
- Parameters:
model (Model) –
Model
that all contacts will be unsketched inflag (Flag) – Flag set on the contacts that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the contacts 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 contacts flagged with flag in model m:
Oasys.PRIMER.Contact.UnsketchAll(m, flag)
Instance methods¶
- Contact.AssociateComment(comment)¶
Associates a comment with a contact
- Parameters:
comment (Comment) –
Comment
that will be attached to the contact- Returns:
No return value
- Return type:
None
Example
To associate comment c to the contact c:
c.AssociateComment(c)
- Contact.Blank()¶
Blanks the contact
- Returns:
No return value
- Return type:
None
Example
To blank contact c:
c.Blank()
- Contact.Blanked()¶
Checks if the contact is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if contact c is blanked:
if c.Blanked(): do_something..
- Contact.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 contact c:
c.Browse()
- Contact.ClearFlag(flag)¶
Clears a flag on the contact
- Parameters:
flag (Flag) – Flag to clear on the contact
- Returns:
No return value
- Return type:
None
Example
To clear flag f for contact c:
c.ClearFlag(f)
- Contact.Constrained(connection=Oasys.gRPC.defaultArg)¶
see if tied/spotweld contact uses constrained formulation
- Parameters:
connection (boolean) – Optional. if true will only consider contacts used for PRIMER connections. The default is false
- Returns:
logical
- Return type:
bool
Example
To see if contact is of type tied and constrained
c.Constrained()
- Contact.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the contact. The target include of the copied contact 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:
Contact object
- Return type:
Contact
Example
To copy contact c into contact z:
z = c.Copy()
- Contact.DetachComment(comment)¶
Detaches a comment from a contact
- Parameters:
comment (Comment) –
Comment
that will be detached from the contact- Returns:
No return value
- Return type:
None
Example
To detach comment c from the contact c:
c.DetachComment(c)
- Contact.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 contact c:
c.Edit()
- Contact.ExtractColour()¶
Extracts the actual colour used for contact.
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 contactcolour
property will return the valueColour.PART
instead of the actual colour. This method will return the actual colour which is used for drawing the contact
- Returns:
colour value (integer)
- Return type:
int
Example
To return the colour used for drawing contact c:
colour = c.ExtractColour()
- Contact.Flagged(flag)¶
Checks if the contact is flagged or not
- Parameters:
flag (Flag) – Flag to test on the contact
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if contact c has flag f set on it:
if c.Flagged(f): do_something..
- Contact.GetComments()¶
Extracts the comments associated to a contact
- 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 contact c:
comm_list = c.GetComments()
- Contact.GetParameter(prop)¶
Checks if a Contact 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 theContact.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – contact property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if Contact property c.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if c.GetParameter(c.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if Contact property c.example is a parameter by using the GetParameter method:
if c.ViewParameters().GetParameter(c.example): do_something..
- Contact.Interactions(type=Oasys.gRPC.defaultArg)¶
Returns a list of objects describing the interactions which can either be penetrations (tracked nodes that are tied to or penetrate elements in the contact) or crossed edges (contact segments that cross)
- Parameters:
type (constant) – Optional. What type of interactions to return. Can be bitwise code of
Contact.PENETRATIONS
to return penetrations andContact.CROSSED_EDGES
to return crossed edges. If omitted penetrations will be returned- Returns:
List of dicts with properties
- end:
(List of reals) End coordinate of intersection line (for
Contact.CROSSED_EDGES
)- ex:
(real) escape vector X component (for
Contact.PENETRATIONS
)- ey:
(real) escape vector Y component (for
Contact.PENETRATIONS
)- ez:
(real) escape vector Z component (for
Contact.PENETRATIONS
)- n1:
(Node object) Node 1 of master segment (for
Contact.PENETRATIONS
)- n2:
(Node object) Node 2 of master segment (for
Contact.PENETRATIONS
)- n3:
(Node object) Node 3 of master segment (for
Contact.PENETRATIONS
)- n4:
(Node object) Node 4 of master segment (for
Contact.PENETRATIONS
)- node:
(Node object) Penetrating node (for
Contact.PENETRATIONS
)- pen:
(real) Depth of penetration (for
Contact.PENETRATIONS
)- qthick:
(real) Remaining thickness ratio (for
Contact.PENETRATIONS
)- rthick:
(real) Remaining unpenetrated thickness (for
Contact.PENETRATIONS
)- s:
(real) s parametric coordinate of the tracked node projected onto the shell (for
Contact.PENETRATIONS
)- shell:
(Shell object) Penetrated shell (for
Contact.PENETRATIONS
)- shell1:
(Shell object) First segment if shell (for
Contact.CROSSED_EDGES
)- shell2:
(Shell object) Second segment if shell (for
Contact.CROSSED_EDGES
)- solid:
(Solid object) Penetrated solid (for
Contact.PENETRATIONS
)- solid1:
(Solid object) First segment if solid (for
Contact.CROSSED_EDGES
)- solid2:
(Solid object) Second segment if solid (for
Contact.CROSSED_EDGES
)- start:
(List of reals) Start coordinate of intersection line (for
Contact.CROSSED_EDGES
)- t:
(real) t parametric coordinate of the tracked node projected onto the shell (for
Contact.PENETRATIONS
)- thick:
(real) Thickness of contact segment, i.e. 0.5*(t1+t2) (for
Contact.PENETRATIONS
)- thickshell:
(Tshell object) Penetrated thick shell (for
Contact.PENETRATIONS
)- thickshell1:
(Tshell object) First segment if thick shell (for
Contact.CROSSED_EDGES
)- thickshell2:
(Tshell object) Second segment if thick shell (for
Contact.CROSSED_EDGES
)- type:
(integer) The interaction type. Either
Contact.PENETRATIONS
orContact.CROSSED_EDGES
- Return type:
list
Example
To get the penetration interactions for contact c:
for i in range(len(interactions)): type = interactions[i]["type"] #Will be Contact.PENETRATIONS node = interactions[i]["node"] shell = interactions[i]["shell"] n1 = interactions[i]["n1"] n2 = interactions[i]["n2"] n3 = interactions[i]["n3"] n4 = interactions[i]["n4"] s = interactions[i]["s"] t = interactions[i]["t"] ex = interactions[i]["ex"] ey = interactions[i]["ey"] ez = interactions[i]["ez"] pen = interactions[i]["pen"] thick = interactions[i]["thick"] rthick = interactions[i]["rthick"] qthick = interactions[i]["qthick"] #if(shell != None): #... process shell ...To get the penetration and crossed edge interactions for contact c:
interactions = c.Interactions(Oasys.PRIMER.Contact.PENETRATIONS|Oasys.PRIMER.Contact.CROSSED_EDGES) for i in range(len(interactions)): if (interactions[i]["type"] == Oasys.PRIMER.Contact.PENETRATIONS): node = interactions[i]["node"] #... elif(interactions[i]["type"] == Oasys.PRIMER.Contact.CROSSED_EDGES): start = interactions[i]["start"] #...
- Contact.Keyword()¶
Returns the keyword for this Contact (*BOUNDARY_PRESCRIBED_MOTION_xxxx). Note that a carriage return is not added. See also
Contact.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for Contact c:
key = c.Keyword()
- Contact.KeywordCards()¶
Returns the keyword cards for the Contact. Note that a carriage return is not added. See also
Contact.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for Contact c:
cards = c.KeywordCards()
- Contact.Next()¶
Returns the next contact in the model
- Returns:
Contact object (or None if there are no more contacts in the model)
- Return type:
Contact
Example
To get the contact in model m after contact c:
c = c.Next()
- Contact.PenCheck(flag, eflag)¶
Flags nodes that penetrate (or tie) in contact
- Parameters:
flag (Flag) – Flag to be set on penetrating (or tied) node
eflag (integer) – Optional flag for elements. If supplied, node will be flagged only if it penetrates (or ties to) an element that is flagged. Node and element flag may be the same
- Returns:
zero if contact successfully checked
- Return type:
int
Example
To set flag f on tracked nodes of Contact c which tie to elements flagged with f:
c.PenCheck(f, f)
- Contact.PenCheckEdit(modal=Oasys.gRPC.defaultArg, check_mode=Oasys.gRPC.defaultArg, mpp_threshold=Oasys.gRPC.defaultArg, report_crossed_3d_elems=Oasys.gRPC.defaultArg, contact_penchk_dup_shells=Oasys.gRPC.defaultArg)¶
launches the interactive edit panel for penetration check on the con
- 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
check_mode (constant) – Optional. Check mode. Can be
Model.MPP_MODE
orModel.SMP_MODE
. Default is set to the oa pref contact_check_modempp_threshold (real) – Optional. Can set the MPP threshold, by default this is set to the oa pref contact_mpp_penetration_threshold
report_crossed_3d_elems (boolean) – Optional. Can set the value of reporting crossed elements to TRUE or FALSE, by default this is set to the oa pref report_crossed_3d_elems
contact_penchk_dup_shells (constant) – Optional. Duplicate shell treatment Can be
Model.SHELL_AUTO
,Model.SHELL_THICK
orModel.SHELL_THIN
. Default is set to the oa pref contact_penchk_dup_shells- Returns:
No return value
- Return type:
None
Example
To launch an edit panel with modal set to TRUE, check_method set to MPP, mpp_threshold set to 1.123, report_crossed_3d_elems set to true and contact_penchk_dup_shells set to thinnest always:
c.PenCheckEdit(True,Oasys.PRIMER.Contact.MPP_METHOD,1.123,true,Oasys.PRIMER.Contact.SHELL_THIN)
- Contact.Previous()¶
Returns the previous contact in the model
- Returns:
Contact object (or None if there are no more contacts in the model)
- Return type:
Contact
Example
To get the contact in model m before contact c:
c = c.Previous()
- Contact.SetFlag(flag)¶
Sets a flag on the contact
- Parameters:
flag (Flag) – Flag to set on the contact
- Returns:
No return value
- Return type:
None
Example
To set flag f for contact c:
c.SetFlag(f)
- Contact.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the contact. The contact will be sketched until you either call
Contact.Unsketch()
,Contact.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the contact is sketched. If omitted redraw is true. If you want to sketch several contacts 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 contact c:
c.Sketch()
- Contact.StatusCheck()¶
Checks sliding contact for crossed edges and penetrations
- Returns:
A list containing count of crossed edges, count of penetrations (note if a node penetrates more than one segment, it is only reported once here)
- Return type:
list
Example
To check Contact c:
status = c.StatusCheck()
- Contact.Unblank()¶
Unblanks the contact
- Returns:
No return value
- Return type:
None
Example
To unblank contact c:
c.Unblank()
- Contact.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the contact
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the contact is unsketched. If omitted redraw is true. If you want to unsketch several contacts 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 contact c:
c.Unsketch()
- Contact.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:
Contact object
- Return type:
dict
Example
To check if Contact property c.example is a parameter by using the
Contact.GetParameter()
method:if c.ViewParameters().GetParameter(c.example): do_something..
- Contact.Xrefs()¶
Returns the cross references for this contact
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for contact c:
xrefs = c.Xrefs()