.. _contact-specific:

************************
Contact-Specific Outputs
************************

Contact variables can be output to provide information about enforcement of contact interactions. Currently, information on only one interaction at each node is provided. If a node has more than one interaction, the last one in its internal interaction list is reported.

Nodal contact variables that can be output are listed in :numref:`tab-output-variables-nodevarcontact`. Where applicable, names of the equivalent variables in JAS3D are given in parentheses at the end of the description. The variables can be output in history files or results files; see :numref:`output` for more information on outputting nodal variables. Note that currently the variables cannot be calculated at output time so the first time they are output a request is made to calculate them. This means that the first output step where they are to appear the data will be all zero. A work around for this is to have at least one output step in which these variables appear before their values are needed.

It is no longer required to specify ``COMPUTE CONTACT VARIABLES = ON`` in the input file. Now, Sierra/SM will determine if a contact variables is being requested for output and compute  that variable by default at every output time (unless it is an accumulated contact variable). If you would like to compute contact variables at every step (to be used in user output for example), specify ``COMPUTE CONTACT VARIABLES = EVERY_STEP``
 
|explicit| The contact variables that are accumulated every step and cannot only be computed at the output times are the following: ``CONTACT_ACCUMULATED_SLIP``, ``CONTACT_ACCUMULATED_SLIP_VECTOR``, ``CONTACT_FRICTIONAL_ENERGY``, and ``CONTACT_FRICTIONAL_ENERGY_DENSITY``. These variables will not be computed for implicit simulations.

.. _contact-specific-debug:

Contact Debugging
=================

.. code-block:: sierrainput

   BEGIN DEBUG
     VISUALIZE CONTACT FACETS = {OFF|ON}(OFF)
     OUTPUT CONTACT SURFACES AND CONSTRAINTS = {OFF|ON}(OFF)
     OUTPUT LEVEL = <integer>level(0)
     WRITE SALINAS MPCS TO <string>file AT TIME <real>time
   END

.. note::
    
    This option is available only for Dash contact.

The debug contact block enables additional information to be output by the code to help debug what may be going wrong with a contact problem.

The ``OUTPUT LEVEL`` command controls the amount of information written to the log file. At the default level of zero, only minimal information is included. At level 1 or greater, more information is printed to the log file such as the composition of the different contact surfaces and which friction model is being used for which surface pairing.

The ``VISUALIZE CONTACT FACETS`` command in the ``DEBUG`` command block can be used to plot the actual contact facets and lofted contact geometries that contact is being evaluated on. When this command is set to ``ON``, extra element blocks and node blocks will be added to the output mesh to represent the contact geometries. Note that use of this option will significantly increase the size of the results file and moderately increase the run time.  The naming convention used for these surfaces is to prepend the prefix ``CSURF_`` to the original contact surface name. For example, if a contact surface is produced by skinning ``block_1``, then a side set will be created with the name ``CSURF_block_1``. This is a Dash only option.

The ``OUTPUT CONTACT SURFACES AND CONSTRAINTS`` command block can be used to plot interactions into the mesh output file as sets of surfaces and nodes. Viewing the interactions can help debug contact problems. This feature only works with node_face contact interactions and only if the constraint can fit in the connectivity of a ten-noded tetrahedral element.

The ``WRITE SALINAS MPCS`` command can be used to write the contact constraints to a text file compatible with the Salinas input deck format. The constraints will be written to the specified file name ``file`` *once* at the first analysis time step after the specified target time ``time``. All contact constraints (tied, glued, frictionless, frictional, etc.) are output in Salinas format as tied MPCs. The ``WRITE SALINAS MPCS`` command can be specified multiple times to output constraints at various times to various separate files.
