Contact class

The Contact class gives you access to define contact cards in PRIMER. More...

The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:

Class functions

Member functions

Contact constants

Name Description
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

Constants for Contact _OFFSET types

Name Description
Contact.BEAM_OFFSET Adds _BEAM_OFFSET option
Contact.CONSTR_OFFSET Adds _CONSTRAINED_OFFSET option
Contact.NO_OFFSET No offset option added.
Contact.SIMPLE_OFFSET Adds _OFFSET option

Constants for Contact penetration check_mode types

Name Description
Contact.MPP_METHOD Launches the penetration edit panel with the MPP methodology turned on
Contact.SMP_METHOD Launches the penetration edit panel with the SMP methodology turned on

Constants for Contact penetration contact_penchk_dup_shells types

Name Description
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.

Contact properties

Name Type Description
bt real Contact birth time
check_mode integer Checking mode on the pen check edit panel. (Can be Contact.MPP_METHOD, Contact.MPP_METHOD or Contact.SMP_METHOD)
cid integer Contact number (identical to label.
colour Colour The colour of the contact
contact_penchk_dup_shells integer Shell treatment on the pen check edit panel. (Can be Contact.SHELL_AUTO, Contact.SHELL_AUTO or Contact.SHELL_THIN or Contact.SHELL_THICK)
dc real Exponential decay coeff
dt real Contact death time
exists (read only) logical true if contact exists, false if referred to but not defined.
fd real Dynamic coeff of friction
fs real Static coeff of friction
fsf real Coulomb friction scale factor
heading string Contact heading
id logical true if _ID option is set, false if not
include integer The Include file number that the contact is in.
label integer Contact number.
model (read only) integer The Model number that the contact is in.
mortar logical _MORTAR keyword option - true if set, false if not.
offset_flag integer _OFFSET option. (Can be Contact.NO_OFFSET, Contact.SIMPLE_OFFSET, Contact.CONSTR_OFFSET or Contact.BEAM_OFFSET)
penchk integer Penetration search flag
saboxid integer Surface A box id
sapr integer Surface A side printout flag
sast real Optional surface A side shell thickness
sbboxid integer Surface B box id
sbpr integer Surface B side printout flag
sbst real Optional surface B side shell thickness
sfsa real Scale factor on surface A penalty stiffness
sfsat real Scale factor on true surface A shell thickness
sfsb real Scale factor on surface B penalty stiffness
sfsbt real Scale factor on true surface B shell thickness
surfa integer Surface A set id
surfatyp integer Surface A set type
surfb integer Surface B set id
surfbtyp integer Surface B set type
type string Contact type ("AUTOMATIC_GENERAL", "SINGLE_SURFACE" etc).
vc real Coeff for viscous friction
vdc real Visous damping coefficient
vsf real Viscous friction scale factor

Properties for COMPOSITE/LUBRICATION options

Name Type Description
cideta integer Curve ID for the viscosity
cidmu integer Curve ID for the coefficient of friction
d_comp real Composite film thickness
srmodel integer Model for shear response
tfail real Tensile traction for failure

Properties for CONSTRAINT options

Name Type Description
kpf real Kinematic partition factor

Properties for CONTRACTION_JOINT options

Name Type Description
alpha real Key amplitude parameter A
beta real Key amplitude parameter B
mtcj integer The method option for the gap function
tsvx real X component of the free sliding direction T
tsvy real Y component of the free sliding direction T
tsvz real Z component of the free sliding direction T

Properties for DRAWBEAD options

Name Type Description
dbdth real Draw bead depth
dbpid integer optional Part ID
dfscl real Scale factor on lcidrf
eloff integer optional element id offset
ending real Parameter to define the length of the bead
epm real Maximum strain the blank will experience when it passes the bead
epscale real Scale factor to weaken the stress-strain curve
lceps integer Loadcurve ID for plastic strain vs. parametric coord
lceps2 integer Loadcurve ID for plastic strain vs. parametric coord (elements moved > offset)
lcidnf integer Loadcurve ID for Normal force per unit length
lcidrf integer Loadcurve ID for Force due to bending per unit length
numint integer #int points along drawbead
offset real distance offset
tscale integer

Properties for ERODING options

Name Type Description
erosop integer Erosion/interior node option
iadj integer Adjacent matl treatment for solids
isym integer Symmetry plane option

Properties for INTERFERENCE options

Name Type Description
lcid1 integer Loadcurve ID for Dyn rel stiffness
lcid2 integer Loadcurve ID for Transient stiffness

Properties for RIGID options

Name Type Description
fcm integer Force calculation method
lcid integer Loadcurve ID for Force vs penetration curve
us real Optional unloading stiffness

Properties for THERMAL options

Name Type Description
a integer Loadcurve ID for a
algo integer contact algorithm
b integer Loadcurve ID for b
bc_flg integer boundary condition flag
c integer Loadcurve ID for c
d integer Loadcurve ID for d
formula integer formula id
frad real Radiation conductance across gap
ftosa real Fraction of sliding friction energy partitioned to surface A
h0 real Heat transfer coefficient
k real Conductivity of gap fluid
lcfdt integer Loadcurve ID for dynamic friction vs. temp
lcfst integer Loadcurve ID for static friction vs. temp
lch integer Loadcurve ID for lch
lmax real Max size for thermal contact
lmin real Critical gap size
thermal logical If _THERMAL option is set. Can be true or false

Properties for TIEBREAK options

Name Type Description
cn real Normal stiffness
ct2cn real Ratio of tangential stiffness to normal stiffness
eraten real Normal energy release rate used in damage calculation
erates real Shear energy release rate used in damage calculation
mes real Shear force exponent
nen real Normal force exponent
nfls real Normal failure stress
option integer Response option
param real Critical distance
sfls real Shear failure stress
tblcid integer Loadcurve ID for stress vs gap post failure
thkoff integer flag for thickness offset

Properties for TIEBREAK_USER options

Name Type Description
cn real Normal stiffness
ct2cn real Ratio of tangential to normal stiff
nhv integer Number of history variables
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.
option integer User tiebreak type
up1 real User parameter
up10 real User parameter
up11 real User parameter
up12 real User parameter
up13 real User parameter
up14 real User parameter
up15 real User parameter
up16 real User parameter
up2 real User parameter
up3 real User parameter
up4 real User parameter
up5 real User parameter
up6 real User parameter
up7 real User parameter
up8 real User parameter
up9 real User parameter

Properties for TIED_WELD options

Name Type Description
close real Surface closeness parameter
hclose real Thermal contact conductivity
nmhis integer Number of material history variables
nmtwh integer Number of surface B tied weld history variables
nstwh integer Number of surface A tied weld history variables
ntprm integer Number of user tied weld parameters
temp real Minimum temperature required.
time real Minimum time required

Properties for _MPP option

Name Type Description
bucket integer Bucket sorting frequency
chksegs integer Special check for inverted elements
cparm8 integer Exclude beam to beam contact flag
grpable integer Experimental contact algorithm
inititer integer Number of iterations for initial penetration checking
lcbucket integer Bucket sorting frequency loadcurve ID
mpp logical true if _MPP option is set, false if not
ns2track integer Number of segments to track per surface A node
parmax real The parametric extension distance for contact segments
pensf real Ignore penetration scale factor

Properties for optional card A

Name Type Description
bsort integer Loadcurve for #cycles between bucket sorts
depth integer Loadcurve for search depth in automatic contact
frcfrq integer #cycles between penalty force updates
lcidab integer Loadcurve ID for airbag thickness vs time
maxpar real Max parametric coord overlap
sbopt real segment based contact option
sofscl real Soft constraint scale factor
soft integer Soft constraint flag

Properties for optional card B

Name Type Description
i2d3d integer Segment searching option
isym integer Symmetry plane option
penmax real Max pen distance for "old" types 3, 5, 10
shlthk integer Thickness consideration flag
sldstf real Optional solid stiffness
sldthk real Optional solid thickness
snlog integer Shooting node logic flag
thkopt integer Thickness option for "old" types 3, 5, 10

Properties for optional card C

Name Type Description
cid_rcf integer Coordinate system ID to output rcforc force resultants and ncforc data in a local system
dprfac real Depth of penetration reduction factor
dtstif real Timestep used in stiffness calc
edgek real Scale factor for penalty stiffness of edge-to-edge contact
flangl real Angle tolerance in radians for feature lines option in smooth contact
igap integer Implicit convergence flag
ignore integer Ignore initial pens in automatic types

Properties for optional card D

Name Type Description
dnlscl real Distance for nonlinear force scaling
dtpchk real Time interval between penetration reports
fnlscl real Scale factor for nonlinear force scaling
q2tri integer Split quads into 2 trias
sfnbr real Scale factor for neighbour segment contact
shledg integer Edge shape for shells when measuring penetration
tcso integer Segment treatment only flag
tiedid integer Incremental displacement update for tied contacts

Properties for optional card E

Name Type Description
cparm8smp integer Spotweld beam flag for SMP
fricsf real Scale factor for frictional stiffness
ftorq integer Beam torsional force computation flag
icor integer coefficient of restitution expressed as a percentage
ipback integer Create backup penalty tied contact
region integer Region to limit contact volume
sharec integer Shared constraint flag
srnde integer Flag for non-extended exterior shell edges

Properties for optional card F

Name Type Description
dbinr integer 2dbinr - Flag to include 2d belt elements in contact (note properties cannot start with a number, so 2 has been removed).
fstol real Tolerance for determining flat segments.
ignroff integer Flag to ignore the thickness offset for shells in the calculation of the shell contact penetration depth.
pstiff integer Flag to choose the method for calculating the penalty stiffness
ssftyp integer Flag to determine how the SSF option on *PART_CONTACT behaves when SOFT = 2 on optional card A
swtpr integer Flag to use tapered shell contact segments adjacent to segments that are thinned by the SPOTHIN option on *CONTROL_CONTACT
tetfac real Scale factor for the computed volume of tetrahedral solid elements for the mass calculation in SOFT = 2 contact..

Properties for optional card G

Name Type Description
shloff real Flag affecting the location of the contact surfaces.

Detailed Description

The Contact class allows you to create, modify, edit and contact cards. See the documentation below for more details.

Constructor

new Contact(Model[Model], type[string], id (optional)[integer], heading (optional)[string])

Description

Create a new Contact object.

Arguments

  • Model (Model)

    Model that Contact will be created in

  • type (string)

    Type of contact

  • id (optional) (integer)

    Contact number

  • heading (optional) (string)

    Title for the Contact

    Returns

    Contact object

    Return type

    Contact

    Example

    To create a new AUTOMATIC_GENERIC contact n model m with label 10 and title "Test contact"

    var c = new Contact(m, "AUTOMATIC_GENERAL", 10, "Test contact");

    Details of functions

    AssociateComment(Comment[Comment])

    Description

    Associates a comment with a contact.

    Arguments

  • Comment (Comment)

    Comment that will be attached to the contact

    Returns

    No return value

    Example

    To associate comment c to the contact c:

    c.AssociateComment(c);


    Blank()

    Description

    Blanks the contact

    Arguments

    No arguments

    Returns

    No return value

    Example

    To blank contact c:

    c.Blank();


    BlankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the contacts in the model.

    Arguments

  • Model (Model)

    Model that all contacts will be blanked in

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the contacts in model m:

    Contact.BlankAll(m);


    BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the flagged contacts in the model.

    Arguments

  • Model (Model)

    Model that all the flagged contacts will be blanked in

  • flag (Flag)

    Flag set on the contacts that you want to blank

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the contacts in model m flagged with f:

    Contact.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the contact is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if contact c is blanked:

    if (c.Blanked() ) do_something...


    Browse(modal (optional)[boolean])

    Description

    Starts an edit panel in Browse mode.

    Arguments

  • modal (optional) (boolean)

    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

    Example

    To Browse contact c:

    c.Browse();


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the contact.

    Arguments

  • flag (Flag)

    Flag to clear on the contact

    Returns

    No return value

    Example

    To clear flag f for contact c:

    c.ClearFlag(f);


    Constrained(connection (optional)[boolean])

    Description

    see if tied/spotweld contact uses constrained formulation

    Arguments

  • connection (optional) (boolean)

    if true will only consider contacts used for PRIMER connections. The default is false.

    Returns

    logical

    Return type

    Boolean

    Example

    To see if contact is of type tied and constrained

    c.Constrained();


    Copy(range (optional)[boolean])

    Description

    Copies the contact. The target include of the copied contact can be set using Options.copy_target_include.

    Arguments

  • range (optional) (boolean)

    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:

    var z = c.Copy();


    Create(Model[Model], modal (optional)[boolean]) [static]

    Description

    Starts an interactive editing panel to create a contact

    Arguments

  • Model (Model)

    Model that the contact will be created in.

  • modal (optional) (boolean)

    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 null if not made).

    Return type

    Contact

    Example

    To start creating a contact in model m:

    var c = Contact.Create(m);


    DetachComment(Comment[Comment])

    Description

    Detaches a comment from a contact.

    Arguments

  • Comment (Comment)

    Comment that will be detached from the contact

    Returns

    No return value

    Example

    To detach comment c from the contact c:

    c.DetachComment(c);


    Edit(modal (optional)[boolean])

    Description

    Starts an interactive editing panel.

    Arguments

  • modal (optional) (boolean)

    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

    Example

    To Edit contact c:

    c.Edit();


    Error(message[string], details (optional)[string])

    Description

    Adds an error for contact. For more details on checking see the Check class.

    Arguments

  • message (string)

    The error message to give

  • details (optional) (string)

    An optional detailed error message

    Returns

    No return value

    Example

    To add an error message "My custom error" for contact c:

    c.Error("My custom error");


    ExtractColour()

    Description

    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 contact colour property will return the value Colour.PART instead of the actual colour. This method will return the actual colour which is used for drawing the contact.

    Arguments

    No arguments

    Returns

    colour value (integer)

    Return type

    Number

    Example

    To return the colour used for drawing contact c:

    var colour = c.ExtractColour();


    FindInteractions()   [deprecated]

    This function is deprecated in version 11.0. It is only provided to keep old scripts working. We strongly advise against using it in new scripts. Support may be removed in future versions.

    Description

    Use Contact.Interactions() instead.

    Arguments

    No arguments

    Returns

    No return value


    First(Model[Model]) [static]

    Description

    Returns the first contact in the model.

    Arguments

  • Model (Model)

    Model to get first contact in

    Returns

    Contact object (or null if there are no contacts in the model).

    Return type

    Contact

    Example

    To get the first contact in model m:

    var c = Contact.First(m);


    FirstFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the first free contact label in the model. Also see Contact.LastFreeLabel(), Contact.NextFreeLabel() and Model.FirstFreeItemLabel().

    Arguments

  • Model (Model)

    Model to get first free contact label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels).

    Returns

    Contact label.

    Return type

    Number

    Example

    To get the first free contact label in model m:

    var label = Contact.FirstFreeLabel(m);


    FlagAll(Model[Model], flag[Flag]) [static]

    Description

    Flags all of the contacts in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all contacts will be flagged in

  • flag (Flag)

    Flag to set on the contacts

    Returns

    No return value

    Example

    To flag all of the contacts with flag f in model m:

    Contact.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the contact is flagged or not.

    Arguments

  • flag (Flag)

    Flag 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...


    ForEach(Model[Model], func[function], extra (optional)[any]) [static]

    Description

    Calls a function for each contact in the model.
    Note that ForEach has been designed to make looping over contacts as fast as possible and so has some limitations.
    Firstly, a single temporary Contact object is created and on each function call it is updated with the current contact data. This means that you should not try to store the Contact object for later use (e.g. in an array) as it is temporary.
    Secondly, you cannot create new contacts inside a ForEach loop.

    Arguments

  • Model (Model)

    Model that all contacts are in

  • func (function)

    Function to call for each contact

  • extra (optional) (any)

    An optional extra object/array/string etc that will appended to arguments when calling the function

    Returns

    No return value

    Example

    To call function test for all of the contacts in model m:

    Contact.ForEach(m, test);
    function test(c)
    {
    // c is Contact object
    }

    To call function test for all of the contacts in model m with optional object:

    var data = { x:0, y:0 };
    Contact.ForEach(m, test, data);
    function test(c, extra)
    {
    // c is Contact object
    // extra is data
    }


    GetAll(Model[Model], property (optional)[string]) [static]

    Description

    Returns an array of Contact objects or properties for all of the contacts in a model in PRIMER. If the optional property argument is not given then an array of Contact objects is returned. If the property argument is given, that property value for each contact is returned in the array instead of a Contact object

    Arguments

  • Model (Model)

    Model to get contacts from

  • property (optional) (string)

    Name for property to get for all contacts in the model

    Returns

    Array of Contact objects or properties

    Return type

    Array

    Example

    To make an array of Contact objects for all of the contacts in model m:

    var a = Contact.GetAll(m);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for each contact in model m:

    var a = Contact.GetAll(m, 'foo');


    GetComments()

    Description

    Extracts the comments associated to a contact.

    Arguments

    No arguments

    Returns

    Array of Comment objects (or null if there are no comments associated to the node).

    Return type

    Array

    Example

    To get the array of comments associated to the contact c:

    var comm_array = c.GetComments();


    GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]

    Description

    Returns an array of Contact objects for all of the flagged contacts in a model in PRIMER If the optional property argument is not given then an array of Contact objects is returned. If the property argument is given, then that property value for each contact is returned in the array instead of a Contact object

    Arguments

  • Model (Model)

    Model to get contacts from

  • flag (Flag)

    Flag set on the contacts that you want to retrieve

  • property (optional) (string)

    Name for property to get for all flagged contacts in the model

    Returns

    Array of Contact objects or properties

    Return type

    Array

    Example

    To make an array of Contact objects for all of the contacts in model m flagged with f:

    var c = Contact.GetFlagged(m, f);

    To return an array containing the value of property 'foo' (for example 'x' for a node) for all of the contacts in model m flagged with f:

    var a = Contact.GetFlagged(m, f, 'foo');


    GetFromID(Model[Model], number[integer]) [static]

    Description

    Returns the Contact object for a contact ID.

    Arguments

  • Model (Model)

    Model to find the contact in

  • number (integer)

    number of the contact you want the Contact object for

    Returns

    Contact object (or null if contact does not exist).

    Return type

    Contact

    Example

    To get the Contact object for contact 100 in model m

    var c = Contact.GetFromID(m, 100);


    GetParameter(prop[string])

    Description

    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 the Contact.ViewParameters() method and 'method chaining' (see the examples below).

    Arguments

  • prop (string)

    contact property to get parameter for

    Returns

    Parameter object if property is a parameter, null if not.

    Return type

    Parameter

    Example

    To check if Contact property c.example is a parameter:

    Options.property_parameter_names = true;
    if (c.GetParameter(c.example) ) do_something...
    Options.property_parameter_names = false;

    To check if Contact property c.example is a parameter by using the GetParameter method:

    if (c.ViewParameters().GetParameter(c.example) ) do_something...


    Interactions(type (optional)[constant])

    Description

    Returns an array 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).

    Arguments

  • type (optional) (constant)

    What type of interactions to return. Can be bitwise code of Contact.PENETRATIONS to return penetrations and Contact.CROSSED_EDGES to return crossed edges. If omitted penetrations will be returned.

    Returns

    Array of objects with the following properties:

    Name Type Description
    end Array 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 reference segment (for Contact.PENETRATIONS)
    n2 Node object Node 2 of reference segment (for Contact.PENETRATIONS)
    n3 Node object Node 3 of reference segment (for Contact.PENETRATIONS)
    n4 Node object Node 4 of reference 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 Array 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 or Contact.CROSSED_EDGES.

    Return type

    object

    Example

    To get the penetration interactions for contact c:

    var interactions = c.Interactions();
    for(i=0; i<interactions.length; i++)
    {
        var type  = interactions[i].type;	// Will be Contact.PENETRATIONS
        var node  = interactions[i].node;
        var shell = interactions[i].shell;
        var n1    = interactions[i].n1;
        var n2    = interactions[i].n2;
        var n3    = interactions[i].n3;
        var n4    = interactions[i].n4;
        var s     = interactions[i].s;
        var t     = interactions[i].t;
        var ex    = interactions[i].ex;
        var ey    = interactions[i].ey;
        var ez    = interactions[i].ez;
        var pen   = interactions[i].pen;
        var thick = interactions[i].thick;
        var rthick = interactions[i].rthick;
        var qthick = interactions[i].qthick;
    
        if(shell != undefined)
                ... process shell ...
    }
    

    To get the penetration and crossed edge interactions for contact c:

    var interactions = c.Interactions(Contact.PENETRATIONS|Contact.CROSSED_EDGES);
    for(i=0; i<interactions.length; i++)
    {
        if (interactions[i].type == Contact.PENETRATIONS)
        {
            var node  = interactions[i].node;
            ...
        }
        else if (interactions[i].type == Contact.CROSSED_EDGES)
        {
            var start = interactions[i].start;
            ...
        }
    }
    


    Keyword()

    Description

    Returns the keyword for this Contact (*BOUNDARY_PRESCRIBED_MOTION_xxxx). Note that a carriage return is not added. See also Contact.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for Contact c:

    var key = c.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the Contact. Note that a carriage return is not added. See also Contact.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for Contact c:

    var cards = c.KeywordCards();


    Last(Model[Model]) [static]

    Description

    Returns the last contact in the model.

    Arguments

  • Model (Model)

    Model to get last contact in

    Returns

    Contact object (or null if there are no contacts in the model).

    Return type

    Contact

    Example

    To get the last contact in model m:

    var c = Contact.Last(m);


    LastFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the last free contact label in the model. Also see Contact.FirstFreeLabel(), Contact.NextFreeLabel() and see Model.LastFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get last free contact label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used.

    Returns

    Contact label.

    Return type

    Number

    Example

    To get the last free contact label in model m:

    var label = Contact.LastFreeLabel(m);


    Next()

    Description

    Returns the next contact in the model.

    Arguments

    No arguments

    Returns

    Contact object (or null if there are no more contacts in the model).

    Return type

    Contact

    Example

    To get the contact in model m after contact c:

    var c = c.Next();


    NextFreeLabel(Model[Model], layer (optional)[Include number]) [static]

    Description

    Returns the next free (highest+1) contact label in the model. Also see Contact.FirstFreeLabel(), Contact.LastFreeLabel() and Model.NextFreeItemLabel()

    Arguments

  • Model (Model)

    Model to get next free contact label in

  • layer (optional) (Include number)

    Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels).

    Returns

    Contact label.

    Return type

    Number

    Example

    To get the next free contact label in model m:

    var label = Contact.NextFreeLabel(m);


    PenCheck(flag[Flag], eflag[integer])

    Description

    Flags nodes that penetrate (or tie) in contact

    Arguments

  • 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

    Number

    Example

    To set flag f on tracked nodes of Contact c which tie to elements flagged with f:

    c.PenCheck(f, f);


    PenCheckEdit(modal (optional)[boolean], check_mode (optional)[constant], mpp_threshold (optional)[real], report_crossed_3d_elems (optional)[boolean], contact_penchk_dup_shells (optional)[constant])

    Description

    launches the interactive edit panel for penetration check on the con

    Arguments

  • modal (optional) (boolean)

    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 (optional) (constant)

    Check mode. Can be Model.MPP_MODE or Model.SMP_MODE. Default is set to the oa pref contact_check_mode

  • mpp_threshold (optional) (real)

    Can set the MPP threshold, by default this is set to the oa pref contact_mpp_penetration_threshold

  • report_crossed_3d_elems (optional) (boolean)

    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 (optional) (constant)

    Duplicate shell treatment Can be Model.SHELL_AUTO, Model.SHELL_THICK or Model.SHELL_THIN. Default is set to the oa pref contact_penchk_dup_shells

    Returns

    No return value

    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,Contact.MPP_METHOD,1.123,true,Contact.SHELL_THIN);


    Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]

    Description

    Allows the user to pick a contact.

    Arguments

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only contacts from that model can be picked. If the argument is a Flag then only contacts that are flagged with limit can be selected. If omitted, or null, any contacts from any model can be selected. from any model.

  • modal (optional) (boolean)

    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 (optional) (string)

    By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.

    Returns

    Contact object (or null if not picked)

    Return type

    Contact

    Example

    To pick a contact from model m giving the prompt 'Pick contact from screen':

    var c = Contact.Pick('Pick contact from screen', m);


    Previous()

    Description

    Returns the previous contact in the model.

    Arguments

    No arguments

    Returns

    Contact object (or null if there are no more contacts in the model).

    Return type

    Contact

    Example

    To get the contact in model m before contact c:

    var c = c.Previous();


    RenumberAll(Model[Model], start[integer]) [static]

    Description

    Renumbers all of the contacts in the model.

    Arguments

  • Model (Model)

    Model that all contacts will be renumbered in

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the contacts in model m, from 1000000:

    Contact.RenumberAll(m, 1000000);


    RenumberFlagged(Model[Model], flag[Flag], start[integer]) [static]

    Description

    Renumbers all of the flagged contacts in the model.

    Arguments

  • Model (Model)

    Model that all the flagged contacts will be renumbered in

  • flag (Flag)

    Flag set on the contacts that you want to renumber

  • start (integer)

    Start point for renumbering

    Returns

    No return value

    Example

    To renumber all of the contacts in model m flagged with f, from 1000000:

    Contact.RenumberFlagged(m, f, 1000000);


    Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]

    Description

    Allows the user to select contacts using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting contacts

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    If the argument is a Model then only contacts from that model can be selected. If the argument is a Flag then only contacts that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any contacts can be selected. from any model.

  • modal (optional) (boolean)

    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 null if menu cancelled

    Return type

    Number

    Example

    To select contacts from model m, flagging those selected with flag f, giving the prompt 'Select contacts':

    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':

    Contact.Select(f, 'Select contacts', l);


    SetFlag(flag[Flag])

    Description

    Sets a flag on the contact.

    Arguments

  • flag (Flag)

    Flag to set on the contact

    Returns

    No return value

    Example

    To set flag f for contact c:

    c.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

    Sketches the contact. The contact will be sketched until you either call Contact.Unsketch(), Contact.UnsketchAll(), Model.UnsketchAll(), or delete the model

    Arguments

  • redraw (optional) (boolean)

    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

    Example

    To sketch contact c:

    c.Sketch();


    SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    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

    Arguments

  • Model (Model)

    Model that all the flagged contacts will be sketched in

  • flag (Flag)

    Flag set on the contacts that you want to sketch

  • redraw (optional) (boolean)

    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

    Example

    To sketch all contacts flagged with flag in model m:

    Contact.SketchFlagged(m, flag);


    StatusCheck()

    Description

    Checks sliding contact for crossed edges and penetrations

    Arguments

    No arguments

    Returns

    An array 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

    Array

    Example

    To check Contact c:

    var status = c.StatusCheck(); ncrossed = status[0]; npens = status[1]


    Total(Model[Model], exists (optional)[boolean]) [static]

    Description

    Returns the total number of contacts in the model.

    Arguments

  • Model (Model)

    Model to get total for

  • exists (optional) (boolean)

    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

    Number

    Example

    To get the total number of contacts in model m:

    var total = Contact.Total(m);


    Unblank()

    Description

    Unblanks the contact

    Arguments

    No arguments

    Returns

    No return value

    Example

    To unblank contact c:

    c.Unblank();


    UnblankAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the contacts in the model.

    Arguments

  • Model (Model)

    Model that all contacts will be unblanked in

  • redraw (optional) (boolean)

    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

    Example

    To unblank all of the contacts in model m:

    Contact.UnblankAll(m);


    UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the flagged contacts in the model.

    Arguments

  • Model (Model)

    Model that the flagged contacts will be unblanked in

  • flag (Flag)

    Flag set on the contacts that you want to unblank

  • redraw (optional) (boolean)

    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

    Example

    To unblank all of the contacts in model m flagged with f:

    Contact.UnblankFlagged(m, f);


    UnflagAll(Model[Model], flag[Flag]) [static]

    Description

    Unsets a defined flag on all of the contacts in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all contacts will be unset in

  • flag (Flag)

    Flag to unset on the contacts

    Returns

    No return value

    Example

    To unset the flag f on all the contacts in model m:

    Contact.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the contact.

    Arguments

  • redraw (optional) (boolean)

    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

    Example

    To unsketch contact c:

    c.Unsketch();


    UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unsketches all contacts.

    Arguments

  • Model (Model)

    Model that all contacts will be unblanked in

  • redraw (optional) (boolean)

    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

    Example

    To unsketch all contacts in model m:

    Contact.UnsketchAll(m);


    UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]

    Description

    Unsketches all flagged contacts in the model.

    Arguments

  • Model (Model)

    Model that all contacts will be unsketched in

  • flag (Flag)

    Flag set on the contacts that you want to unsketch

  • redraw (optional) (boolean)

    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

    Example

    To unsketch all contacts flagged with flag in model m:

    Contact.UnsketchAll(m, flag);


    ViewParameters()

    Description

    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.

    Arguments

    No arguments

    Returns

    Contact object.

    Return type

    Contact

    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...


    Warning(message[string], details (optional)[string])

    Description

    Adds a warning for contact. For more details on checking see the Check class.

    Arguments

  • message (string)

    The warning message to give

  • details (optional) (string)

    An optional detailed warning message

    Returns

    No return value

    Example

    To add a warning message "My custom warning" for contact c:

    c.Warning("My custom warning");


    Xrefs()

    Description

    Returns the cross references for this contact.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for contact c:

    var xrefs = c.Xrefs();


    toString()

    Description

    Creates a string containing the Contact data in keyword format. Note that this contains the keyword header and the keyword cards. See also Contact.Keyword() and Contact.KeywordCards().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for Contact c in keyword format

    var data = c.toString();