Materials > Working with External Materials > Using External Materials in Physics Interfaces

Using External Materials in Physics Interfaces
In order for a physics interface to make use of external materials, it must contain one or more features that provide input quantity definitions and make use of returned output quantities in equations and postprocessing expressions. Such features are currently available in the Solid Mechanics; Magnetic Fields; and Magnetic Fields, No Currents interfaces.
External Material Interface Types
Given that a physics feature requires certain output quantities and defines certain input quantities, there are many possible ways to set up a call to an external function, including declarations of material properties and states. The required interface specification, or interface type, is contained in an external material socket, which does a number of different things:
It is not necessary for a socket to define all output quantities required by a physics feature. The socket and external library may compute only some quantities, while others are left to be specified by property groups under the External Material feature. For example, the built-in General stress-strain relation socket only returns second Piola-Kirchhoff stress as output, while the physics features using this interface type also may require the material density. The density must instead be specified as an expression in the Basic property group.
It is also possible to set the Interface type to None to select no socket and instead set up the relation between input and output quantities as expressions directly in an external material feature. This behavior is intended mostly for testing and debugging of multiphysics models.
Solver Iterations and State Updates
This section describes quantities as being evaluated either at the current step or at the previous converged step. This is related to the iteration pattern of the solvers. The external material functionality is primarily intended for modeling materials with some kind of memory or path dependence (for example, inelastic solid materials or materials exhibiting electromagnetic hysteresis). This means that simulations must be performed in steps over an interval of time or some parameter (which can often be interpreted as a pseudo-time).
Whether a time-dependent or parametric solver is used, taking a step forward requires solving a nonlinear problem, which is typically an iterative procedure. In order for the convergence to be efficient, the modified Newton solver used needs correct Jacobian information (the Jacobian is sometimes called the tangential stiffness matrix), which must be provided by the external material functions in the form of partial derivatives of output argument components with respect to input argument components. When the nonlinear iteration converges, the solution for that time step or parameter step is stored, and the solver moves on to the next step.
The external material functions are typically called in each iteration in the inner nonlinear loop. Arguments that are evaluated at the current step are reevaluated at each inner iteration, while arguments defined at the previous converged step retain the value they had when the previous nonlinear iteration converged; that is, the value that was last stored. State variable arguments are passed to the external material function with the same previous converged values in each inner nonlinear iteration. The external material function is expected to overwrite this previous value with a new value corresponding to the current iteration, but this value will only be stored and the states updated when the inner nonlinear iteration converges.