Chapter 7: Customizing LS-DYNA using ACT

LS-DYNA can be customized with ACT (Ansys Customization Toolkit). You can create interactions between user-defined extensions and the LS-DYNA system. You can create objects or features for custom preprocessing in the context of Ansys Mechanical. Custom postprocessing is not supported.

This section assumes some degree of familiarity with ACT. Other Ansys guides provide related information:

An example of how to set up custom preprocessing is described here.

The following is an example from an XML file that sets up Rigid Bodies and Flexible Bodies categories in the Data panel, each with a Geometry field. The resulting load and Details panel are shown.

<simdata context="Mechanical">
    <load name="Forming" version="1" caption="Forming Contact" icon="contact" issupport="false" isload="true" color="#0000FF">
      <attributes custom_dyna="Yes"/>
      <propertygroup name="Rigid Bodies"  caption="Rigid Bodies">
        <property name="Geometry" control="scoping">
          <attributes>
            <selection_filter>body</selection_filter>
          </attributes>
        </property>
      </propertygroup>

      <propertygroup name="Flexible Bodies"  caption="Flexible Bodies">
        <property name="Geometry" control="scoping">
          <attributes>
            <selection_filter>body</selection_filter>
          </attributes>
        </property>
      </propertygroup>	  
      <callbacks>
        <getcommands location="pre" >writeSnippet</getcommands>
      </callbacks>
      
    </load>
  </simdata>

To enable a custom load for LS-DYNA usage, define the attribute custom_dyna for the load, and set its value to yes. Additionally, if the load needs to write information to the solver input file, the callback getcommands must be implemented. The getcommands element specifies the name of the IronPython function called when Mechanical writes the solver input file.

<getcommands location = [string] order = [integer]>-->
[function(solver,solverdata,stream)]</getcommands>

The solverdata is a helper structure. It helps integrate user extensions with LS-DYNA, particularly when the solver commands generated by the extension add entities that have identifiers, like nodes, elements or components. Through the solverdata structure, ACT provides an efficient method to manage the newly created IDs of these entities with the existing IDs previously generated by LS-DYNA. It also enables reuse of internally implemented keywords like materials or elements.


Note:   The syntax shown for the methods is C#.


The following table and sections describe the available solverdata methods.

Table 7.1: Solverdata Methods

CreateMaterialCreateMaterial

Two different methods available to create materials for LS-DYNA.

CreateNewElement

Method to create an element keyword.

GetNewPartId

Method to get an unused part identifier.

LSDynaSolverExtension.KeyWords.Part.Part CreateNewPartMethod to create a new part keyword.
CreateSection

Method to create a new section keyword.

GetComponent

Method to get the LS-DYNA equivalent of a mechanical Named Selection.

GetContactId

Method to get the solver contact identifier of the contact object.

GetContactTargetId

Method to get the solver contact identifier of the contact target object.

GetCoordinateSystemSolverId

Method to get the solver coordinate system identifier.

GetEndTime

Method to get the simulation end time.

GetMaterialSolverId

Method to get the material identifier of a body.

GetNamedSelectionLSDYNAId

Method to get the solver named selection identifier.

GetNewContact

Method to get an empty contact keyword.

GetNewCurveId

Method to get an unused curve identifier.

GetNewElementId

Method to get an unused element identifier.

GetNewElementType

Method to get an unused part identifier.

GetNewNodeId

Method to get an unused node identifier.

GetNewVectorId

Method to get an unused vector identifier.

GetRemotePointNodeIdMethod to get the master node identifier for a remote point.
GetSolverUnitSystemMethod to get the solver unit system.
ContainsDynamicRelaxationMethod to determine if dynamic relaxation is used in the model.
CurrentStepMethod to get the current step.
MaxElementIdMethod to get the maximum element identifier.
MaxElementTypeMethod to get the maximum part identifier.
MaxNodeIdMethod to get the maximum node identifier.