MarmotFiniteStrainMechanicsCore

template<int nDim>
struct AlgorithmicModuli

Algorithmic tangent moduli of a material.

Contains the algorithmic tangent moduli \(\frac{\partial \boldsymbol{\tau}}{\partial \boldsymbol{F}}\) with respect to the deformation gradient \(\boldsymbol{F}\).

Template Parameters:

nDim – Number of spatial dimensions (2 or 3).

Public Members

Fastor::Tensor<double, nDim, nDim, nDim, nDim> dTau_dF

tangent operator w.r.t. deformation gradient

template<int nDim>
struct ConstitutiveResponse

Constitutive response of a material at given state.

Contains stress, density and elastic energy density.

Template Parameters:

nDim – Number of spatial dimensions (2 or 3).

Public Functions

inline ConstitutiveResponse()

Default constructor. Initializes stress to zero, energy and dissipation to zero, and stateVars to nullptr.

inline ConstitutiveResponse(const Fastor::Tensor<double, nDim, nDim> &tau_, double elasticEnergyDensity_, double dissipation_, double *stateVars_)

Constructor for initializing the constitutive response.

Parameters:
  • tau_ – Kirchhoff stress tensor.

  • elasticEnergyDensity_ – Elastic energy density.

  • dissipation_ – Dissipation per unit volume.

  • stateVars_ – Pointer to state variables.

Public Members

Fastor::Tensor<double, nDim, nDim> tau

Kirchhoff stress.

double elasticEnergyDensity

elastic energy per unit volume

double dissipation

dissipation per unit volume

double *stateVars

pointer to state variables

template<int nDim>
struct ConstitutiveResponseAD

Constitutive response of a material at given state.

Contains stress, density and elastic energy density.

Template Parameters:

nDim – Number of spatial dimensions (2 or 3).

Public Functions

inline ConstitutiveResponseAD()

Default constructor. Initializes stress to zero, energy and dissipation to zero, and stateVars to nullptr.

inline ConstitutiveResponseAD(const ConstitutiveResponse<nDim> &response)

Constructor for initializing the AD constitutive response.

Parameters:

responseConstitutiveResponse instance to initialize from.

Public Members

Fastor::Tensor<autodiff::dual, nDim, nDim> tau

Kirchhoff stress.

double elasticEnergyDensity

elastic energy per unit volume

double dissipation

dissipation per unit volume (for inelastic materials)

double *stateVars

pointer to state variables

template<int nDim>
struct Deformation

Represents the deformation state of a material.

This struct holds the deformation gradient \(\boldsymbol{F}\) which describes the local deformation of a material.

Public Members

Fastor::Tensor<double, nDim, nDim> F

deformation gradient

template<int nDim>
struct DeformationAD

Represents the deformation state of a material.

This struct holds the deformation gradient \(\boldsymbol{F}\) which describes the local deformation of a material.

Public Members

Fastor::Tensor<autodiff::dual, nDim, nDim> F

deformation gradient

struct HistoryEntry

Struct to record the history of the simulation.

Each entry contains time, stress, deformation, and state variables.

Public Functions

inline void print() const

Print the history entry to the console.

inline HistoryEntry(double time, const FastorStandardTensors::Tensor33d &stress, const FastorStandardTensors::Tensor33d &F, const FastorStandardTensors::Tensor3333d &dTau_dF, const Eigen::VectorXd &stateVars)

Constructor for HistoryEntry.

Parameters:
  • time – Time at the history entry

  • stress – Stress tensor at the history entry

  • F – Deformation gradient at the history entry

  • dTau_dF – Material tangent at the history entry

  • stateVars – State variables at the history entry

inline HistoryEntry()

Public Members

double time

Time at the history entry.

FastorStandardTensors::Tensor33d stress

Stress at the history entry.

FastorStandardTensors::Tensor33d F

deformation gradient at the history entry

FastorStandardTensors::Tensor3333d dTau_dF

Material tangent at the history entry.

Eigen::VectorXd stateVars

State variables at the history entry.

struct Increment

Struct to define a loading increment.

Each increment contains displacement gradient and stress increments, control flags, time information, and iteration limits.

Public Members

FastorStandardTensors::Tensor9d gradUIncrement

Target displacement gradient increment for the step.

FastorStandardTensors::Tensor9d stressIncrement

Target Kirchhoff stress increment for the step.

FastorStandardTensors::Tensor9t<bool> isGradUComponentControlled

Flags to indicate which displecement gradient components are controlled

FastorStandardTensors::Tensor9t<bool> isStressComponentControlled

Flags to indicate which stress components are controlled.

double timeOld

Old time at the beginning of the increment.

double dT

Time step size for the increment.

class MarmotMaterialFiniteStrain

Inheritance diagram for MarmotMaterialFiniteStrain:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >" tooltip="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >"]
    "1" [label="MarmotMaterialFiniteStrain" tooltip="MarmotMaterialFiniteStrain" fillcolor="#BFBFBF"]
    "3" [label="MarmotMaterialFiniteStrainAD" tooltip="MarmotMaterialFiniteStrainAD"]
    "2" -> "1" [dir=forward tooltip="public-inheritance"]
    "3" -> "1" [dir=forward tooltip="public-inheritance"]
}

Abstract base class for mechanical materials in the finite strain regime.

Derived classes implement computeStress() to provide the constitutive response (Kirchhoff stress, density, elastic energy density) and the algorithmic tangent.

Subclassed by Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >, MarmotMaterialFiniteStrainAD

Public Functions

inline MarmotMaterialFiniteStrain(const double *matProperties_, int nMaterialProperties_, int materialNumber_)

Construct a MarmotMaterialFiniteStrain.

Parameters:
  • matProperties_[in] Pointer to the array of material property values.

  • nMaterialProperties_[in] Number of material property values.

  • materialNumber_[in] Unique identifier for this material instance.

virtual ~MarmotMaterialFiniteStrain() = default

Default destructor.

virtual void computeStress(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &tangents, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const = 0

Updates the material state.

Computes the Kirchhoff \(\boldsymbol{\tau}\) stress from the deformation gradient \(\boldsymbol{F}\) and the time increment \(\Delta t\). It further updates the mass density \(\rho\) and the elastic energy density. Additionally, computes the algorithmic tangent moduli \(\frac{\partial \boldsymbol{\tau}}{\partial \boldsymbol{F}}\).

Parameters:
inline virtual void computeStressExplicit(ConstitutiveResponse<3> &response, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const

Explicit version of computeStress for use in explicit time integration schemes.

Note

The default implementation calls computeStress and ignores the algorithmic tangent.

Note

Derived classes may override this method for efficiency reasons.

Parameters:
virtual void computeStress(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &tangents, const Deformation<3> &deformation, const TimeIncrement &timeIncrement, const std::tuple<double, double, double> &eigenDeformation) const

Computes the Kirchhoff stress given the deformation, time increment, and eigen deformation.

Parameters:
virtual void computePlaneStrain(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &algorithmicModuli, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const

Compute stress under plane strain conditions.

It uses the general 3D computeStress function for a plane strain Deformation. The algorithmic tangent is modified according to plane strain conditions.

Parameters:
inline virtual void computePlaneStrainExplicit(ConstitutiveResponse<3> &response, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const

Explicit version of computePlaneStrain for use in explicit time integration schemes.

Note

The default implementation calls computePlaneStrain and ignores the algorithmic tangent.

virtual void computePlaneStrain(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &algorithmicModuli, const Deformation<3> &deformation, const TimeIncrement &timeIncrement, const std::tuple<double, double, double> &eigenDeformation) const

Compute stress under plane strain conditions with eigen deformation.

It uses the general 3D computeStress function for a plane strain Deformation. The algorithmic tangent is modified according to plane strain conditions.

Parameters:
inline virtual void computePlaneStrainExplicit(ConstitutiveResponse<3> &response, const Deformation<3> &deformation, const TimeIncrement &timeIncrement, const std::tuple<double, double, double> &eigenDeformation) const

Explicit version of computePlaneStrain with eigen deformation for use in explicit time integration schemes.

Note

The default implementation calls computePlaneStrain and ignores the algorithmic tangent.

virtual void computePlaneStress(ConstitutiveResponse<2> &response, AlgorithmicModuli<2> &algorithmicModuli, const Deformation<2> &deformation, const TimeIncrement &timeIncrement) const

Compute stress under plane stress conditions.

It uses the general 3D computeStress function and iteratively finds the out-of-plane deformation. The algorithmic tangent is modified according to plane stress conditions.

Parameters:
inline virtual void computePlaneStressExplicit(ConstitutiveResponse<2> &response, const Deformation<2> &deformation, const TimeIncrement &timeIncrement) const

Explicit version of computePlaneStress for use in explicit time integration schemes.

Note

The default implementation calls computePlaneStress and ignores the algorithmic tangent.

std::tuple<double, double, double> findEigenDeformationForEigenStress(const std::tuple<double, double, double> &initialGuess, const std::tuple<double, double, double> &eigenStress, double *stateVars) const

Find the eigen deformation that corresponds to a given eigen stress.

This function iteratively finds the eigen deformation that corresponds to a given eigen stress. This is used e.g. for geostatic stress initialization.

Parameters:
  • initialGuess – Initial guess for the eigen deformation.

  • eigenStress – Target eigen stress.

  • stateVars – Pointer to the state variable array used during iteration.

Returns:

Eigen deformation that corresponds to the given eigen stress.

inline StateView getStateView(const std::string &stateName, double *stateVars) const

Get a view to the state variables.

Parameters:
  • stateName – Name of the state variable

  • stateVars – Pointer to the state variable array

Returns:

StatView to access the state variable

inline int getNumberOfRequiredStateVars() const

Get the total number of required state variables.

Returns:

Total number of required state variables

inline virtual void initializeYourself(double *stateVars, int nStateVars)

Initialize the state variables at a material point.

Note

The default implementation initializes all state variables to zero.

Parameters:
  • stateVars – Pointer to the state variable array

  • nStateVars – Number of state variables

inline virtual double getMaximumWaveSpeed(const double *stateVars, const Fastor::Tensor<double, 3, 3> &deformationGradient) const

Get the maximum wave speed of the material for a given deformation gradient.

The default implementation computes diagonal Voigt tangent entries by centered finite differences and returns sqrt(max(C_ii) / rho).

Parameters:
  • stateVars[in] Pointer to the state variable array

  • deformationGradient[in] Current deformation gradient used as perturbation reference

Returns:

Maximum wave speed

virtual double getDensity(const double *stateVars) const = 0

Get the mass density of the material.

Parameters:

stateVars[in] Pointer to the state variable array

Returns:

Mass density

Public Members

const int materialNumber

Unique identifier for this material instance.

MarmotStateLayoutDynamic stateLayout

Layout of the state variables.

Protected Attributes

const double *materialProperties

Pointer to the array of material property values.

const int nMaterialProperties

Number of material property values.

class MarmotMaterialFiniteStrainAD : public MarmotMaterialFiniteStrain

Inheritance diagram for MarmotMaterialFiniteStrainAD:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="MarmotMaterialFiniteStrain" tooltip="MarmotMaterialFiniteStrain"]
    "1" [label="MarmotMaterialFiniteStrainAD" tooltip="MarmotMaterialFiniteStrainAD" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for MarmotMaterialFiniteStrainAD:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="MarmotMaterialFiniteStrain" tooltip="MarmotMaterialFiniteStrain"]
    "1" [label="MarmotMaterialFiniteStrainAD" tooltip="MarmotMaterialFiniteStrainAD" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Base class for finite strain materials using automatic differentiation.

This class extends MarmotMaterialFiniteStrain by providing an interface for computing stresses and algorithmic tangent moduli using automatic differentiation. Derived material models implement computeStressAD() to supply the AD-based constitutive response.

Public Functions

inline MarmotMaterialFiniteStrainAD(const double *matProperties_, int nMaterialProperties_, int materialNumber_)

Construct a MarmotMaterialFiniteStrainAD.

Parameters:
  • matProperties_[in] Pointer to the array of material property values.

  • nMaterialProperties_[in] Number of material property values.

  • materialNumber_[in] Unique identifier for this material instance.

inline virtual void computeStress(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &tangents, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const override

Compute Kirchhoff stress and algorithmic tangent using automatic differentiation.

This method overrides MarmotMaterialFiniteStrain::computeStress() and provides a generic AD-based implementation for finite strain material models.

The child class must implement computeStressAD(), which evaluates the constitutive response (Kirchhoff stress and any state updates) for a dual-valued deformation gradient. This base implementation then uses Marmot::AutomaticDifferentiation::dF_dT() to:

  • compute the Kirchhoff stress \(\boldsymbol{\tau}\) for the given deformation, and

  • compute the consistent algorithmic tangent \(\partial \boldsymbol{\tau} / \partial \boldsymbol{F}\).

Note

Automatic differentiation requires multiple seeded evaluations of computeStressAD(). Therefore, the state variables are reset to their “old” values before each seeded call. Implementations of computeStressAD() must update state based only on primal values of the dual inputs and must not branch or accumulate history based on derivative components.

Parameters:
  • response[out] Constitutive response container (stress, density, energy, state variables).

  • tangents[out] Algorithmic moduli container; filled with \(\partial \tau / \partial F\).

  • deformation[in] Deformation state (deformation gradient \(\boldsymbol{F}\)).

  • timeIncrement[in] Time increment information for rate-/history-dependent models.

virtual void computeStressAD(ConstitutiveResponseAD<3> &response, const DeformationAD<3> &deformation, const TimeIncrement &timeIncrement) const = 0

Compute the constitutive response in automatic differentiation (AD) form.

This pure virtual function must be implemented by derived material models to compute the Kirchhoff stress tensor in response.tau for a given deformation in dual number form. The base class uses this AD formulation together with Marmot::AutomaticDifferentiation utilities to obtain algorithmic tangents by differentiating the stress with respect to the deformation gradient.

Implementations may update the provided state variables via response.stateVars according to the given time increment.

Parameters:
  • response[out] Constitutive response in AD form (3D), with response.tau to be filled with the computed Kirchhoff stress.

  • deformation[in] Deformation state in AD form (3D), providing the deformation gradient \(\boldsymbol{F}\) as dual numbers.

  • timeIncrement[in] Current time increment information for the constitutive update.

class MarmotMaterialFiniteStrainFactory

Factory class for creating finite-strain material instances.

This class provides a mechanism to register materials by their name, and to create material instances based on their properties. It allows for dynamic material creation without hardcoding specific material types.

Public Types

using materialFactoryFunction = std::function<MarmotMaterialFiniteStrain*(const double *materialProperties, int nMaterialProperties, int materialNumber)>

Factory function type: creates a MarmotMaterialFiniteStrain from properties and a material number.

Public Functions

MarmotMaterialFiniteStrainFactory() = delete

Public Static Functions

static MarmotMaterialFiniteStrain *createMaterial(const std::string &materialName, const double *materialProperties, int nMaterialProperties, int materialNumber)

Create a material instance based on its name and properties.

Parameters:
  • materialName[in] Registered name of the material type.

  • materialProperties[in] Array of material properties.

  • nMaterialProperties[in] Number of properties in the array.

  • materialNumber[in] Unique identifier for the material instance.

Returns:

Pointer to the created MarmotMaterialFiniteStrain instance.

template<class T>
static inline bool registerMaterial(const std::string &materialName)

Register a material type with its name.

Template Parameters:

T – Concrete material class to register; must be constructible from (const double* materialProperties, int nMaterialProperties, int materialNumber).

Parameters:

materialName[in] Registered name for the material type.

Returns:

True if registration was successful.

Private Types

using MaterialFactoryMap = std::unordered_map<std::string, materialFactoryFunction>

Private Static Functions

static MaterialFactoryMap &materialFactoryFunctionByName()
template<typename BaseMaterialType>
class MarmotMaterialFiniteStrainSubstepped : public MarmotMaterialFiniteStrain

Inheritance diagram for Marmot::Materials::MarmotMaterialFiniteStrainSubstepped:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >" tooltip="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >" fillcolor="#BFBFBF"]
    "2" [label="MarmotMaterialFiniteStrain" tooltip="MarmotMaterialFiniteStrain"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for Marmot::Materials::MarmotMaterialFiniteStrainSubstepped:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >" tooltip="Marmot::Materials::MarmotMaterialFiniteStrainSubstepped< BaseMaterialType >" fillcolor="#BFBFBF"]
    "2" [label="MarmotMaterialFiniteStrain" tooltip="MarmotMaterialFiniteStrain"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

A decorator that applies time substepping with analytical tangent accumulation.

Template Parameters:

BaseMaterialType – The concrete material class to wrap. Properties: [nSubsteps, Prop1, Prop2, …]

Public Functions

inline MarmotMaterialFiniteStrainSubstepped(const double *matProperties_, int nMaterialProperties_, int materialNumber_)

Construct a MarmotMaterialFiniteStrainSubstepped.

Parameters:
  • matProperties_[in] Pointer to the array of material property values. The first entry is interpreted as the number of sub-steps; the remaining entries are forwarded to the wrapped base material.

  • nMaterialProperties_[in] Total number of material property values (including nSubsteps).

  • materialNumber_[in] Unique identifier for this material instance.

virtual ~MarmotMaterialFiniteStrainSubstepped() = default
inline virtual double getDensity(const double *stateVars) const override

Get the mass density of the material.

Parameters:

stateVars[in] Pointer to the state variable array

Returns:

Mass density

inline void initializeStateLayout()

Initialize the state layout for substepping. The state variables are organized as follows:

  • “Substepping_F_n” (9 variables): Deformation gradient at the start of the global step (F_n).

  • ”materialstate” (baseMaterial->getNumberOfRequiredStateVars() variables): State variables required by the wrapped base material. The total number of state variables is the sum of the above. The layout is finalized at the end of this function.

inline virtual void initializeYourself(double *stateVars, int nStateVars) override

Initialize the state variables at a material point.

Note

The default implementation initializes all state variables to zero.

Parameters:
  • stateVars – Pointer to the state variable array

  • nStateVars – Number of state variables

inline virtual void computeStressWithSensitivities(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &tangents, StateSensitivities &sensitivities, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const

Extended stress update computing sensitivities for substepping.

  • The default implementation uses Forward Finite Differences.

Note

This function can be overridden in derived classes to provide analytical sensitivities.

Note

The base material’s computeStress function is called within this function.

Parameters:
  • response – Constitutive response to be computed.

  • tangents – Algorithmic moduli to be computed.

  • sensitivities – Sensitivity matrices to be computed.

  • deformation – Current deformation state.

  • timeIncrement – Time increment information.

inline virtual void computeStress(ConstitutiveResponse<3> &response, AlgorithmicModuli<3> &tangents, const Deformation<3> &deformation, const TimeIncrement &timeIncrement) const override

Compute stress with time substepping and analytical tangent accumulation.

The deformation increment is divided into nSubsteps sub-increments. For each sub-increment, the base material’s stress update is called, and the sensitivities are used to accumulate the overall tangent.

Parameters:
  • response – Constitutive response to be computed.

  • tangents – Algorithmic moduli to be computed.

  • deformation – Current deformation state.

  • timeIncrement – Time increment information.

Protected Attributes

std::unique_ptr<BaseMaterialType> baseMaterial

Wrapped base material instance.

int nSubsteps

Number of sub-steps for time substepping.

class MarmotMaterialPointSolverFiniteStrain

Solver for material point problems with finite strain materials.

This class implements a solver for material point problems using finite strain material models. It supports loading steps with controlled displacement gradient and stress components, adaptive time stepping, and history recording.

Public Functions

MarmotMaterialPointSolverFiniteStrain(const std::string &materialName, const double *materialProperties, const int nMaterialProperties, const SolverOptions &options)

Constructor for the MarmotMaterialPointSolverFiniteStrain class.

Parameters:
  • materialName – Name of the finite strain material model

  • materialProperties – Array of material properties

  • nMaterialProperties – Number of material properties

  • options – Solver options controlling nonlinear iteration settings

void addStep(const Step &step)

Add a loading step to the solver.

Parameters:

step – The Step to be added

inline std::vector<Step> getSteps() const

Get the list of added loading steps.

Returns:

A vector of Step containing the added steps

inline void clearSteps()

Clear all added loading steps.

void setInitialState(const FastorStandardTensors::Tensor33d &initialStress, const Eigen::VectorXd &initialStateVars)

Set the initial state of the material model.

Parameters:
  • initialStress – The initial stress in Voigt notation

  • initialStateVars – The initial state variables

inline int getNumberOfStateVariables() const

Get the number of state variables in the material model.

Returns:

The number of state variables

void resetToInitialState()

Reset the solver to the initial state.

This function resets the initial stress and state variables of the material model.

void solve()

Solve the material point problem for all added steps.

inline const std::vector<HistoryEntry> &getHistory() const

Get the recorded history of the simulation.

Returns:

A vector of HistoryEntry containing the recorded history

inline void clearHistory()

Clear the recorded history.

void printHistory()

Print the recorded history to the console.

void exportHistoryToCSV(const std::string &filename)

Export the recorded history to a CSV file.

Parameters:

filename – The name of the CSV file to export to

Private Functions

void solveStep(const Step &step)

Solve a single loading step.

This function iterates over the increments defined in the step, calling solveIncrement for each increment. It manages time stepping and ensures that the entire step is covered.

Parameters:

step – The Step to be solved

void solveIncrement(const Increment &increment)

Solve a single increment within a loading step.

This function implements a Newton-Raphson iterative solver to compute the stress and deformation state for the given increment. It updates the material state variables and records the history after convergence.

Parameters:

increment – The Increment to be solved

Throws:

std::runtime_error – if the solver does not converge

FastorStandardTensors::Tensor9d computeResidual(const FastorStandardTensors::Tensor9d &stressIncrement, const FastorStandardTensors::Tensor9d &target, const Increment &increment)

Compute the residual for the current increment.

This function calculates the residual vector based on the difference between the computed stress increment and the target increment, taking into account which components are controlled by strain or stress.

Parameters:
  • stressIncrement – The computed stress increment

  • target – The target (mixed) stress/strain increment

  • increment – The Increment containing control information

Returns:

The computed residual vector

void modifyTangent(FastorStandardTensors::Tensor99d &tangent, const Increment &increment)

Modify the material tangent matrix based on control type.

This function adjusts the tangent matrix to account for the components that are controlled by displacement gradient or stress, ensuring that the solver correctly handles mixed control scenarios. This is done by zeroing out rows corresponding to displacement gradient controlled components and setting their diagonal entries to one.

Parameters:
  • tangent – The material tangent matrix to be modified

  • increment – The Increment containing control information

Private Members

std::unique_ptr<MarmotMaterialFiniteStrain> material

The finite strain material model.

int nStateVars

Number of state variables in the material model.

Eigen::VectorXd stateVars

Current state variables.

Eigen::VectorXd _initialStateVars

Initial state variables.

Eigen::VectorXd stateVarsTemp

Temporary state variables for computations.

FastorStandardTensors::Tensor33d stress = FastorStandardTensors::Tensor33d(0.0)

The Kirchhoff stress.

FastorStandardTensors::Tensor33d _initialStress = FastorStandardTensors::Tensor33d(0.0)

The initial Kirchhoff stress.

FastorStandardTensors::Tensor33d gradU = FastorStandardTensors::Tensor33d(0.0)

The displacement gradient.

FastorStandardTensors::Tensor3333d dTau_dF = FastorStandardTensors::Tensor3333d(0.0)

The material tangent dTau/dF.

std::vector<Step> steps

List of loading steps.

std::vector<HistoryEntry> history = std::vector<HistoryEntry>()

History of the simulation.

const SolverOptions options

Solver options.

struct MaxwellProperties

Struct to hold properties of a generalized maxwell model.

Public Members

int nMaxwell

Number of maxwell elements.

std::vector<double> gamma

Weighting factors of maxwell elements.

double sumGamma

Sum of weighting factors.

std::vector<double> tau

Relaxation times of maxwell elements.

struct SolverOptions

Struct to define solver options.

Contains parameters for controlling the solver’s behavior.

Public Members

int maxIterations = 25

Maximum number of iterations per increment (default: 25)

double residualTolerance = 1e-10

Convergence tolerance (default: 1e-10)

double correctionTolerance = 1e-10

Correction tolerance (default: 1e-10)

struct StateSensitivities

Sensitivity matrices required for analytical substepping. All matrices represent derivatives of flattened arrays and are stored in Eigen’s column-major format.

Public Members

Eigen::MatrixXd dState_dF

Jacobian of State_new w.r.t Deformation Gradient F_new. Size: nStateVars x 9.

Eigen::MatrixXd dState_dStateOld

Jacobian of State_new w.r.t State_old. Size: nStateVars x nStateVars.

Eigen::MatrixXd dStress_dStateOld

Jacobian of Stress w.r.t State_old. Size: 9 x nStateVars.

struct Step

Struct to define a loading step.

Each step contains targets for displacement gradient and stress states, time information and time step control parameters.

Public Functions

inline void checkControl() const

Check that for each component, either deformation or stress is controlled.

Throws:

std::runtime_error – if the condition is not met

Public Members

FastorStandardTensors::Tensor33d gradUIncrementTarget

Target displacement gradient increment for the step.

FastorStandardTensors::Tensor33d stressIncrementTarget

Target Kirchhoff stress increment for the step.

FastorStandardTensors::Tensor33t<bool> isGradUComponentControlled

Flags to indicate which displacement gradient components are controlled

FastorStandardTensors::Tensor33t<bool> isStressComponentControlled

Flags to indicate which stress components are controlled.

double timeStart = 0.0

Start time of the step.

double timeEnd = 1.0

End time of the step.

double dTStart = 0.1

Initial time step size.

double dTMin = 1e-6

Minimum time step size.

double dTMax = 0.5

Maximum time step size.

int maxIncrements = 100

Maximum number of increments in the step.

struct TimeIncrement

Represents a time increment in a simulation.

This struct holds information about the current time and the time step size (dT).

Public Members

const double time

time at the beginning of the increment

const double dT

size of the time increment

namespace Fastor
namespace FastorIndices
namespace FastorStandardTensors
namespace Marmot
namespace ContinuumMechanics
namespace DeformationMeasures

Functions

template<typename T>
Tensor33t<T> rightCauchyGreen(const Tensor33t<T> &F)

Computes the right Cauchy-Green tensor \(\boldsymbol{C}\).

The right Cauchy-Green deformation tensor is defined as:

\[ \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \]
or in index notation:
\[ C_{IJ} = F_{iI} F_{iJ} \]

Template Parameters:

T – Scalar type (e.g., float, double, autodiff::dual)

Parameters:

F – Deformation gradient tensor

Returns:

The right Cauchy-Green tensor

template<typename T>
Tensor33t<T> leftCauchyGreen(const Tensor33t<T> &F)

Computes the left Cauchy-Green tensor \(\boldsymbol{b}\).

The left Cauchy-Green deformation tensor is defined as:

\[ \boldsymbol{b} = \boldsymbol{F} \boldsymbol{F}^T \]
or in index notation:
\[ b_{ij} = F_{iI} F_{jI} \]

Template Parameters:

T – Scalar type (e.g., float, double, autodiff::dual)

Parameters:

F – Deformation gradient tensor

Returns:

The left Cauchy-Green tensor b

namespace FirstOrderDerived

Functions

template<typename T>
std::pair<Tensor33t<T>, Tensor3333t<T>> rightCauchyGreen(const Tensor33t<T> &F)

Computes the right Cauchy-Green tensor \(\boldsymbol{C}\) and its derivative with respect to \(\boldsymbol{F}\).

The right Cauchy-Green deformation tensor is defined as:

\[ \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \]
or in index notation:
\[ C_{IJ} = F_{iI} F_{iJ} \]
The derivative of \(\boldsymbol{C}\) with respect to \(\boldsymbol{F}\) is given by:
\[ \frac{\partial C_{IJ}}{\partial F_{kK}} = \delta_{IK} F_{kJ} + F_{kI} \delta_{JK} \]

Template Parameters:

T – Scalar type (e.g., float, double, autodiff::dual)

Parameters:

F – Deformation gradient tensor

Returns:

A pair containing the right Cauchy-Green tensor C and its derivative with respect to F

template<typename T>
std::pair<Tensor33t<T>, Tensor3333t<T>> leftCauchyGreen(const Tensor33t<T> &F)

Computes the left Cauchy-Green tensor \(\boldsymbol{b}\) and its derivative with respect to \(\boldsymbol{F}\).

The left Cauchy-Green deformation tensor is defined as:

\[ \boldsymbol{b} = \boldsymbol{F} \boldsymbol{F}^T \]
or in index notation:
\[ b_{ij} = F_{iI} F_{jI} \]
The derivative of \(\boldsymbol{b}\) with respect to \(\boldsymbol{F}\) is given by:
\[ \frac{\partial b_{ij}}{\partial F_{kK}} = \delta_{ik} F_{jK} + F_{iK} \delta_{jk} \]

Template Parameters:

T – Scalar type (e.g., float, double, autodiff::dual)

Parameters:

F – Deformation gradient tensor

Returns:

A pair containing the left Cauchy-Green tensor b and its derivative with respect to F

template<int nDim>
std::pair<Fastor::Tensor<double, nDim>, Fastor::Tensor<double, nDim, nDim, nDim>> deformedNormalVectorFromUndeformedSurfaceVector(const Fastor::Tensor<double, nDim, nDim> &FInv, const Fastor::Tensor<double, nDim> &N_x_dA0)

Computes the deformed normal vector and its derivative with respect to the inverse deformation gradient.

The deformed normal vector is defined as:

\[ n_i = \frac{ F^{-1}_{Ii} N_{I} J dA_0 } { \| F^{-1}_{Ki} N_{K} J dA_0 \| } \]

Parameters:
  • FInv – Inverse of the deformation gradient tensor

  • N_x_dA0 – Undeformed normal vector scaled by undeformed area

Returns:

A pair containing the deformed normal vector and its derivative with respect to FInv

template<int nDim>
inline std::pair<Fastor::Tensor<double, nDim, nDim>, Fastor::Tensor<double, nDim, nDim, nDim, nDim>> deformedNormalProjectionTensor(const Fastor::Tensor<double, nDim, nDim> &FInv, const Fastor::Tensor<double, nDim> &N_x_dA0)

Computes the deformed normal projection tensor and its derivative with respect to the inverse deformation gradient.

The deformed normal projection tensor is defined as:

\[ N_{ij} = n_i n_j = \frac{ F^{-1}_{Ii} N_{I} J dA_0 \times F^{-1}_{Jj} N_{J} J dA_0} { \| F^{-1}_{Ki} N_{K} J dA_0 \|^2 } \]

Parameters:
  • FInv – Inverse of the deformation gradient tensor

  • N_x_dA0 – Undeformed normal vector scaled by undeformed area

Returns:

A pair containing the deformed normal projection tensor and its derivative with respect to FInv

template<int nDim>
inline std::pair<Fastor::Tensor<double, nDim, nDim>, Fastor::Tensor<double, nDim, nDim, nDim, nDim>> inverseDeformationGradient(const Fastor::Tensor<double, nDim, nDim> &F)

Computes the inverse of the deformation gradient and its derivative with respect to the deformation gradient.

The inverse of the deformation gradient is defined as:

\[ \boldsymbol{F}^{-1} \]
The derivative of \(\boldsymbol{F}^{-1}\) with respect to \(\boldsymbol{F}\) is given by:
\[ \frac{\partial F^{-1}_{iK}}{\partial F_{jL}} = - F^{-1}_{iL} F^{-1}_{jK} \]

Parameters:

F – Deformation gradient tensor

Returns:

A pair containing the inverse of the deformation gradient and its derivative with respect to F

namespace EnergyDensityFunctions

Functions

template<typename T>
T PenceGouPotentialA(const Tensor33t<T> &C, const double K, const double G)

Hyperelastic Energy Density Function Wa acc. Pence & Gou (2015), Eq. (2.11)

The energy density function \(W_a\) is given as

\[ W_a = \frac{G}{2} (I_1 - 3) + \left(\frac{K}{2} - \frac{G}{3}\right) (J - 1)^2 - G \ln(J) \]
where \( I_1 = \text{tr}(\boldsymbol{C}) \) is the first invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \( K, G \) are the bulk and shear modulus, respectively.

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • K – Bulk modulus

  • G – Shear modulus

Returns:

Energy density

template<typename T>
T PenceGouPotentialB(const Tensor33t<T> &C, const double K, const double G)

Hyperelastic Energy Density Function Wb acc. Pence & Gou (2015), Eq. (2.12)

The energy density function \(W_b\) is given as

\[ W_b = \frac{K}{8} \left(J - \frac{1}{J}\right)^2 + \frac{G}{2} \left(I_1 J^{-\frac{2}{3}} - 3\right) \]
where \( I_1 = \text{tr}(\boldsymbol{C}) \) is the first invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \( K, G \) are the bulk and shear modulus, respectively.

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • K – Bulk modulus

  • G – Shear modulus

Returns:

Energy density

template<typename T>
T PenceGouPotentialC(const Tensor33t<T> &C, const double K, const double G)

Hyperelastic Energy Density Function Wc acc. Pence & Gou (2015), Eq. (2.13)

The energy density function \(W_c\) is given as

\[ W_c = \frac{G}{2} (I_1 - 3) + \frac{3 G^2}{3 K - 2 G} \left(J^{\frac{2}{3} - \frac{K}{G}} - 1\right) \]
where \( I_1 = \text{tr}(\boldsymbol{C}) \) is the first invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \( K, G \) are the bulk and shear modulus, respectively.

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • K – Bulk modulus

  • G – Shear modulus

Returns:

Energy density

template<typename T>
T MooneyRivlinPotential(const Tensor33t<T> &C, const double C1, const double C2, const double D1)

Mooney-Rivlin Hyperelastic Energy Density Function The energy density function \(W_{MR}\) is given as.

\[ W_{MR} = C_1 (\bar{I}_1 - 3) + C_2 (\bar{I}_2 - 3) + \frac{1}{D_1} (J - 1)^2 \]
where \( \bar{I}_1 = I_1 J^{-\frac{2}{3}} \) and \( \bar{I}_2 = I_2 J^{-\frac{4}{3}} \) are the first and second invariant of the isochoric right Cauchy-Green tensor, respectively, \( I_1 = \text{tr}(\boldsymbol{C}) \) and \( I_2 = 0.5 (I_1^2 - \text{tr}(\boldsymbol{C}^2)) \) are the first and second invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \(C_1, C_2, D_1 \) are material parameters.

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • C1 – Mooney-Rivlin material parameter C1

  • C2 – Mooney-Rivlin material parameter C2

  • D1 – Mooney-Rivlin material parameter D1

Returns:

Energy density

template<typename T>
T YeohPotential(const Tensor33t<T> &C, const double C1, const double C2, const double C3, const double D1)

Yeoh hyperelastic energy density function.

The energy density function is given as

\[ W = C_1 (\bar{I}_1 - 3) + C_2 (\bar{I}_1 - 3)^2 + C_3 (\bar{I}_1 - 3)^3 + \frac{1}{D_1}\left( \frac{J^2 - 1}{2} - \ln J \right) \]
where \(\bar{I}_1 = I_1 J^{-2/3}\), \(I_1 = \mathrm{tr}(\boldsymbol{C})\), and \(J = \sqrt{\det(\boldsymbol{C})}\).

Template Parameters:

T – Scalar type, e.g. double, float, autodiff scalar.

Parameters:
  • C – Right Cauchy-Green tensor.

  • C1 – Yeoh material parameter.

  • C2 – Yeoh material parameter.

  • C3 – Yeoh material parameter.

  • D1 – Volumetric penalty parameter.

Returns:

Energy density.

template<typename T>
T standardNeoHooke(const Tensor33t<T> &C, const double K, const double G)

Standard compressible Neo-Hooke energy density function in terms of \(\boldsymbol{C}\).

Template Parameters:

T – Scalar type, e.g. double, float, autodiff scalar.

Parameters:
  • C – Right Cauchy-Green tensor.

  • K – Bulk modulus.

  • G – Shear modulus.

Returns:

Energy density.

namespace FirstOrderDerived

Functions

template<typename T>
std::tuple<T, Tensor33t<T>> PenceGouPotentialB(const Tensor33t<T> &C, const double K, const double G)

Hyperelastic Energy Density Function Wb acc. Pence & Gou (2015), Eq. (2.12) and its first derivative w.r.t. C.

The energy density function \(W_b\) is given as

\[ W_b = \frac{K}{8} \left(J - \frac{1}{J}\right)^2 + \frac{G}{2} \left(I_1 J^{-\frac{2}{3}} - 3\right) \]
where \( I_1 = \text{tr}(\boldsymbol{C}) \) is the first invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \( K, G \) are the bulk and shear modulus, respectively.

Additionally, the first derivative w.r.t. C is computed as

\[ \frac{\partial W_b}{\partial \boldsymbol{C}} = \frac{\partial W_b}{\partial J} \frac{\partial J}{\partial \boldsymbol{C}} + \frac{\partial W_b}{\partial I_1} \frac{\partial I_1}{\partial \boldsymbol{C}} \]
where
\[ \frac{\partial J}{\partial \boldsymbol{C}} = \frac{1}{2} J \boldsymbol{C}^{-1} \]
and
\[ \frac{\partial I_1}{\partial \boldsymbol{C}} = \boldsymbol{I} \]

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • K – Bulk modulus

  • G – Shear modulus

Returns:

A tuple containing energy density and its first derivative w.r.t. C

namespace SecondOrderDerived

Functions

template<typename T>
std::tuple<T, Tensor33t<T>, Tensor3333t<T>> PenceGouPotentialB(const Tensor33t<T> &C, const double K, const double G)

Hyperelastic Energy Density Function Wb acc. Pence & Gou (2015), Eq. (2.12) and its first and second derivative w.r.t. C.

The energy density function \(W_b\) is given as

\[ W_b = \frac{K}{8} \left(J - \frac{1}{J}\right)^2 + \frac{G}{2} \left(I_1 J^{-\frac{2}{3}} - 3\right) \]
where \( I_1 = \text{tr}(\boldsymbol{C}) \) is the first invariant of the right Cauchy-Green tensor \( \boldsymbol{C} = \boldsymbol{F}^T \boldsymbol{F} \), \( J = \sqrt{\det(\boldsymbol{C})} = \det(\boldsymbol{F}) \) is the determinant of the deformation gradient, and \( K, G \) are the bulk and shear modulus, respectively.

Additionally, the first and second derivative w.r.t. \(\boldsymbol{C}\), i.e.,

\[\frac{\partial W_b}{\partial \boldsymbol{C}} \quad \text{and} \quad \frac{\partial^2 W_b}{\partial \boldsymbol{C} \partial \boldsymbol{C}} \]
are computed.

Template Parameters:

T – Scalar type, e.g. double, float, etc.

Parameters:
  • C – Right Cauchy-Green tensor

  • K – Bulk modulus

  • G – Shear modulus

Returns:

A tuple containing energy density, its first and second derivative w.r.t. C

template<typename T>
std::tuple<T, FastorStandardTensors::Tensor33t<T>, FastorStandardTensors::Tensor3333t<T>> standardNeoHooke(const FastorStandardTensors::Tensor33t<T> &C, const double &K, const double &G)

Standard compressible Neo-Hooke energy density and first/second derivatives w.r.t. \(\boldsymbol{C}\).

Template Parameters:

T – Scalar type, e.g. double, float, autodiff scalar.

Parameters:
  • C – Right Cauchy-Green tensor.

  • K – Bulk modulus.

  • G – Shear modulus.

Returns:

Tuple of energy density, first derivative and second derivative w.r.t. \(\boldsymbol{C}\).

template<typename T>
std::tuple<T, FastorStandardTensors::Tensor33t<T>, FastorStandardTensors::Tensor3333t<T>> BiotNeoHooke(const FastorStandardTensors::Tensor33t<T> &U, const double &K, const double &G)

Isotropic Biot-Neo-Hooke energy density and derivatives w.r.t. right stretch \(\boldsymbol{U}\).

Internally evaluates the standard Neo-Hooke potential in terms of \(\boldsymbol{C}=\boldsymbol{U}\boldsymbol{U}\) and applies chain-rule transformations.

Template Parameters:

T – Scalar type, e.g. double, float, autodiff scalar.

Parameters:
  • U – Right stretch tensor.

  • K – Bulk modulus.

  • G – Shear modulus.

Returns:

Tuple of energy density, first derivative and second derivative w.r.t. \(\boldsymbol{U}\).

namespace ThirdOrderDerived

Functions

std::tuple<double, FastorStandardTensors::Tensor33d, FastorStandardTensors::Tensor3333d, FastorStandardTensors::Tensor333333d> standardNeoHooke(const FastorStandardTensors::Tensor33d &C, const double &K, const double &G)

Standard compressible Neo-Hooke energy density and first/second/third derivatives w.r.t. \(\boldsymbol{C}\).

Parameters:
  • C – Right Cauchy-Green tensor.

  • K – Bulk modulus.

  • G – Shear modulus.

Returns:

Tuple of energy density, first derivative, second derivative and third derivative.

namespace FiniteStrain
namespace Plasticity
namespace FlowIntegration

Functions

template<typename T>
Tensor33t<T> exponentialMap(const Tensor33t<T> &dGp)

Computes the incremental plastic deformation gradient from the plastic velocity gradient using the exponential map.

The exponential map is given by

\[ \Delta F_{\bar I J} = \exp\left(\Delta \lambda \frac{\partial g}{\partial M_{\bar K L}}\right)_{J \bar{I}} \]
where \( \Delta \lambda \frac{\partial g}{\partial M_{\bar K L}} \) is the incremental plastic velocity gradient.

Template Parameters:

T – Scalar type.

Parameters:

dGp – Incremental plastic velocity gradient.

Returns:

Incremental plastic deformation gradient.

namespace FirstOrderDerived

Functions

std::pair<Tensor33d, Tensor3333d> explicitIntegration(const Tensor33d &deltaGp)

Computes the incremental plastic deformation gradient from the plastic velocity gradient using a first order approximation. The first order approximation is given by

\[ \Delta F_{\bar I J} = \left( \delta_{\bar K L} + \Delta \lambda \frac{\partial f}{\partial M_{\bar K L}}\right)_{J \bar{I}} \]
where \( \Delta \lambda \frac{\partial f}{\partial M_{\bar K L}} \) is the incremental plastic velocity gradient.

Parameters:

deltaGp – Incremental plastic velocity gradient.

Returns:

A pair of the incremental plastic deformation gradient and its derivative w.r.t. the plastic velocity gradient.

std::pair<Tensor33d, Tensor3333d> exponentialMap(const Tensor33d &deltaGp)

Computes the incremental plastic deformation gradient from the plastic velocity gradient using the exponential map. The exponential map is given by

\[ \Delta F_{\bar I J} = \exp\left(\Delta \lambda \frac{\partial f}{\partial M_{\bar I J}}\right)_{J \bar{I}} \]
where \( \Delta \lambda \frac{\partial f}{\partial M_{\bar I J}} \) is the incremental plastic velocity gradient.

Parameters:

deltaGp – Incremental plastic velocity gradient.

Returns:

A pair of the incremental plastic deformation gradient and its derivative w.r.t. the plastic velocity gradient.

namespace Viscoelasticity

Functions

MaxwellProperties createMaxwellProperties(int nMaxwell, const double *gammaTauPairVector)
void evaluateGeneralizedMaxwellModel(FastorStandardTensors::Tensor33d &stress, FastorStandardTensors::Tensor3333d &tangent, const FastorStandardTensors::Tensor333333d &dTangent_dDeformation, const FastorStandardTensors::Tensor3333d &initialCompliance, const FastorStandardTensors::Tensor33d &dStress, const double dT, const MaxwellProperties &maxwellProperties, double *stateVars)

Evaluate generalized maxwell model contribution to stress and tangent.

This update function uses the approach in: Liu et al. 2021, A continuum and computational framework for viscoelastodynamics: I. Finite deformation linear models, Comput. Meth. Appl. Mech. Engrg. 385, 114059

Parameters:
  • stress[inout] Stress tensor to be updated (input is the instantaneous hyperelastic stress)

  • tangent[inout] Tangent tensor to be updated (input is the instantaneous hyperelasticelastic tangent)

  • dTangent_dDeformation[in] Derivative of tangent w.r.t. deformation

  • initialCompliance[in] Initial compliance tensor

  • dStress[in] Increment of the initial stress tensor

  • dT[in] Time increment

  • maxwellProperties[in] Properties of the generalized maxwell model

  • stateVars[inout] State variables array (size: nMaxwell * 9)

void evaluateGeneralizedMaxwellModel(FastorStandardTensors::Tensor33d &stress, FastorStandardTensors::Tensor3333d &tangent, const FastorStandardTensors::Tensor33d &dStress, const double dT, const MaxwellProperties &maxwellProperties, double *stateVars)

Evaluate generalized maxwell model contribution to stress and tangent.

This update correspond to the approach by Simo (1987) and is used in the implementation of the generalized maxwell model in the finite element code

Parameters:
  • stress[inout] Stress tensor to be updated (input is the instantaneous hyperelastic stress) tangent)

  • tangent[inout] Tangent tensor to be updated (input is the instantaneous hyperelasticelastic tangent)

  • dStress[in] Increment of the initial stress tensor

  • dT[in] Time increment

  • maxwellProperties[in] Properties of the generalized maxwell model

  • stateVars[inout] State variables array (size: nMaxwell * 9)

template<typename T = double>
void evaluateGeneralizedMaxwellModel(FastorStandardTensors::Tensor33t<T> &stress, const FastorStandardTensors::Tensor33t<T> &dStress, const double dT, const MaxwellProperties &maxwellProperties, double *stateVars)

Evaluate generalized maxwell model contribution to stress without tangent update.

This update correspond to the approach by Simo (1987) and is used in the implementation of the generalized maxwell model in the finite element code

Parameters:
  • stress[inout] Stress tensor to be updated (input is the instantaneous hyperelastic stress) tangent)

  • dStress[in] Increment of the initial stress tensor

  • dT[in] Time increment

  • maxwellProperties[in] Properties of the generalized maxwell model

  • stateVars[inout] State variables array (size: nMaxwell * 9)

template<typename T = double>
void evaluateGeneralizedMaxwellModel(FastorStandardTensors::Tensor33t<T> &stress, const FastorStandardTensors::Tensor3333t<T> &tangent, const FastorStandardTensors::Tensor3333t<T> &initialCompliance, const FastorStandardTensors::Tensor33t<T> &dStress, const double dT, const MaxwellProperties &maxwellProperties, double *stateVars)

Evaluate generalized maxwell model contribution to stress without tangent update.

This update function uses the approach in: Liu et al. 2021, A continuum and computational framework for viscoelastodynamics: I. Finite deformation linear models, Comput. Meth. Appl. Mech. Engrg. 385, 114059

Parameters:
  • stress[inout] Stress tensor to be updated (input is the instantaneous hyperelastic stress) tangent)

  • tangent[in] Tangent tensor to be used for stress update

  • initialCompliance[in] Initial compliance tensor

  • dStress[in] Increment of the initial stress tensor

  • dT[in] Time increment

  • maxwellProperties[in] Properties of the generalized maxwell model

  • stateVars[inout] State variables array (size: nMaxwell * 9)

namespace StressMeasures

Functions

template<typename T>
Tensor33t<T> KirchhoffStressFromPK2(const Tensor33t<T> &PK2, const Tensor33t<T> &F)

Computes the Kirchhoff stress from the 2nd Piola-Kirchhoff stress and the deformation gradient.

The Kirchhoff stress is computed as

\[ \boldsymbol{\tau} = \boldsymbol{F} \boldsymbol{S} \boldsymbol{F}^T \]
or in index notation
\[\tau_{ij} = F_{iI} S_{IJ} F_{jJ}. \]

Template Parameters:

T – Scalar type, e.g. double, float

Parameters:
  • PK2 – 2nd Piola-Kirchhoff stress

  • F – Deformation gradient

Returns:

Kirchhoff stress

namespace FirstOrderDerived

Functions

template<typename T>
std::tuple<Tensor33t<T>, Tensor3333t<T>, Tensor3333t<T>> KirchhoffStressFromPK2(const Tensor33t<T> &PK2, const Tensor33t<T> &F)

Computes the Kirchhoff stress from the 2nd Piola-Kirchhoff stress and the deformation gradient and the respective partial derivatives.

The Kirchoff stress is computed as

\[ \boldsymbol{\tau} = \boldsymbol{F} \boldsymbol{S} \boldsymbol{F}^T \]
or in index notation
\[\tau_{ij} = F_{iI} S_{IJ} F_{jJ}. \]
Additionally, the derivatives with respect to \( \boldsymbol{S} \) and \( \boldsymbol{F} \) are computed in index notation as
\[ \frac{\partial \tau_{ij}}{\partial S_{IJ}} = F_{iI} F_{jJ} \]
and
\[ \frac{\partial \tau_{ij}}{\partial F_{kL}} = \delta_{ik} S_{LJ} F_{jJ} + F_{iI} S_{IL} \delta_{jk} \]

Template Parameters:

T – Scalar type, e.g. double, float

Parameters:
  • PK2 – 2nd Piola-Kirchhoff stress

  • F – Deformation gradient

Returns:

A tuple containing Kirchhoff stress and its derivatives w.r.t \(\boldsymbol{S}\) and \(\boldsymbol{F}\)

namespace Materials
namespace Solvers
namespace MarmotLibrary
file MarmotDeformationMeasures.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include <Fastor/tensor_algebra/permute.h>

Include dependency graph for MarmotDeformationMeasures.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotDeformationMeasures.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotDeformationMeasures.h" fillcolor="#BFBFBF"]
    "3" [label="Fastor/tensor_algebra/permute.h" tooltip="Fastor/tensor_algebra/permute.h"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}
file MarmotEnergyDensityFunctions.h
#include “Marmot/MarmotFastorTensorBasics.h”

Include dependency graph for MarmotEnergyDensityFunctions.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotEnergyDensityFunctions.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotEnergyDensityFunctions.h" fillcolor="#BFBFBF"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "1" -> "2" [dir=forward tooltip="include"]
}
file MarmotFiniteStrainPlasticity.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include “Marmot/MarmotTensorExponential.h”

Include dependency graph for MarmotFiniteStrainPlasticity.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotFiniteStrainPlasticity.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotFiniteStrainPlasticity.h" fillcolor="#BFBFBF"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "3" [label="Marmot/MarmotTensorExponential.h" tooltip="Marmot/MarmotTensorExponential.h"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}

Helpers for integrating the plastic flow rule in finite-strain plasticity.

Provides exponential-map and first-order approximations for the incremental plastic deformation gradient together with their derivatives with respect to the plastic velocity gradient.

file MarmotFiniteStrainViscoelasticity.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include “Marmot/MarmotMath.h”

Include dependency graph for MarmotFiniteStrainViscoelasticity.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotFiniteStrainViscoelasticity.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotFiniteStrainViscoelasticity.h" fillcolor="#BFBFBF"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "3" [label="Marmot/MarmotMath.h" tooltip="Marmot/MarmotMath.h"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}
file MarmotMaterialFiniteStrain.h
#include “Marmot/MarmotStateHelpers.h”
#include <Fastor/tensor/Tensor.h>
#include <algorithm>
#include <cmath>
#include <vector>

Include dependency graph for MarmotMaterialFiniteStrain.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrain.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrain.h" fillcolor="#BFBFBF"]
    "3" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "2" [label="Marmot/MarmotStateHelpers.h" tooltip="Marmot/MarmotStateHelpers.h"]
    "4" [label="algorithm" tooltip="algorithm"]
    "5" [label="cmath" tooltip="cmath"]
    "6" [label="vector" tooltip="vector"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "5" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include MarmotMaterialFiniteStrain.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrain.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrain.h" fillcolor="#BFBFBF"]
    "2" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainAD.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainAD.h"]
    "3" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainFactory.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainFactory.h"]
    "4" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainSubstepped.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainSubstepped.h"]
    "5" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialPointSolverFiniteStrain.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialPointSolverFiniteStrain.h"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
}
file MarmotMaterialFiniteStrainAD.h
#include “Marmot/MarmotAutomaticDifferentiationForFastor.h”
#include “Marmot/MarmotFastorTensorBasics.h”
#include <Eigen/Core>
#include <functional>

Include dependency graph for MarmotMaterialFiniteStrainAD.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "4" [label="Marmot/MarmotMaterialFiniteStrain.h" tooltip="Marmot/MarmotMaterialFiniteStrain.h"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainAD.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainAD.h" fillcolor="#BFBFBF"]
    "10" [label="Eigen/Core" tooltip="Eigen/Core"]
    "6" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "2" [label="Marmot/MarmotAutomaticDifferentiationForFastor.h" tooltip="Marmot/MarmotAutomaticDifferentiationForFastor.h"]
    "3" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "5" [label="Marmot/MarmotStateHelpers.h" tooltip="Marmot/MarmotStateHelpers.h"]
    "7" [label="algorithm" tooltip="algorithm"]
    "8" [label="cmath" tooltip="cmath"]
    "11" [label="functional" tooltip="functional"]
    "9" [label="vector" tooltip="vector"]
    "4" -> "5" [dir=forward tooltip="include"]
    "4" -> "6" [dir=forward tooltip="include"]
    "4" -> "7" [dir=forward tooltip="include"]
    "4" -> "8" [dir=forward tooltip="include"]
    "4" -> "9" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "10" [dir=forward tooltip="include"]
    "1" -> "11" [dir=forward tooltip="include"]
}
file MarmotMaterialFiniteStrainFactory.h
#include <cassert>
#include <functional>
#include <string>
#include <unordered_map>

Include dependency graph for MarmotMaterialFiniteStrainFactory.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="Marmot/MarmotMaterialFiniteStrain.h" tooltip="Marmot/MarmotMaterialFiniteStrain.h"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainFactory.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainFactory.h" fillcolor="#BFBFBF"]
    "4" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "3" [label="Marmot/MarmotStateHelpers.h" tooltip="Marmot/MarmotStateHelpers.h"]
    "5" [label="algorithm" tooltip="algorithm"]
    "8" [label="cassert" tooltip="cassert"]
    "6" [label="cmath" tooltip="cmath"]
    "9" [label="functional" tooltip="functional"]
    "10" [label="string" tooltip="string"]
    "11" [label="unordered_map" tooltip="unordered_map"]
    "7" [label="vector" tooltip="vector"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "4" [dir=forward tooltip="include"]
    "2" -> "5" [dir=forward tooltip="include"]
    "2" -> "6" [dir=forward tooltip="include"]
    "2" -> "7" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
    "1" -> "9" [dir=forward tooltip="include"]
    "1" -> "10" [dir=forward tooltip="include"]
    "1" -> "11" [dir=forward tooltip="include"]
}
file MarmotMaterialFiniteStrainSubstepped.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include “Marmot/MarmotNumericalDifferentiation.h”
#include <cmath>
#include <cstring>
#include <memory>
#include <stdexcept>

Include dependency graph for MarmotMaterialFiniteStrainSubstepped.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="Marmot/MarmotMaterialFiniteStrain.h" tooltip="Marmot/MarmotMaterialFiniteStrain.h"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainSubstepped.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialFiniteStrainSubstepped.h" fillcolor="#BFBFBF"]
    "5" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "9" [label="Marmot/MarmotNumericalDifferentiation.h" tooltip="Marmot/MarmotNumericalDifferentiation.h"]
    "4" [label="Marmot/MarmotStateHelpers.h" tooltip="Marmot/MarmotStateHelpers.h"]
    "6" [label="algorithm" tooltip="algorithm"]
    "7" [label="cmath" tooltip="cmath"]
    "10" [label="cstring" tooltip="cstring"]
    "11" [label="memory" tooltip="memory"]
    "12" [label="stdexcept" tooltip="stdexcept"]
    "8" [label="vector" tooltip="vector"]
    "3" -> "4" [dir=forward tooltip="include"]
    "3" -> "5" [dir=forward tooltip="include"]
    "3" -> "6" [dir=forward tooltip="include"]
    "3" -> "7" [dir=forward tooltip="include"]
    "3" -> "8" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "9" [dir=forward tooltip="include"]
    "1" -> "7" [dir=forward tooltip="include"]
    "1" -> "10" [dir=forward tooltip="include"]
    "1" -> "11" [dir=forward tooltip="include"]
    "1" -> "12" [dir=forward tooltip="include"]
}
file MarmotMaterialPointSolverFiniteStrain.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include <iostream>
#include <string>
#include <utility>
#include <vector>

Include dependency graph for MarmotMaterialPointSolverFiniteStrain.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="Marmot/MarmotMaterialFiniteStrain.h" tooltip="Marmot/MarmotMaterialFiniteStrain.h"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialPointSolverFiniteStrain.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotMaterialPointSolverFiniteStrain.h" fillcolor="#BFBFBF"]
    "5" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "4" [label="Marmot/MarmotStateHelpers.h" tooltip="Marmot/MarmotStateHelpers.h"]
    "6" [label="algorithm" tooltip="algorithm"]
    "7" [label="cmath" tooltip="cmath"]
    "9" [label="iostream" tooltip="iostream"]
    "10" [label="string" tooltip="string"]
    "11" [label="utility" tooltip="utility"]
    "8" [label="vector" tooltip="vector"]
    "3" -> "4" [dir=forward tooltip="include"]
    "3" -> "5" [dir=forward tooltip="include"]
    "3" -> "6" [dir=forward tooltip="include"]
    "3" -> "7" [dir=forward tooltip="include"]
    "3" -> "8" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "9" [dir=forward tooltip="include"]
    "1" -> "10" [dir=forward tooltip="include"]
    "1" -> "11" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
}
file MarmotStressMeasures.h
#include “Marmot/MarmotFastorTensorBasics.h”
#include <Fastor/tensor/Tensor.h>

Include dependency graph for MarmotStressMeasures.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotStressMeasures.h" tooltip="/home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot/MarmotStressMeasures.h" fillcolor="#BFBFBF"]
    "3" [label="Fastor/tensor/Tensor.h" tooltip="Fastor/tensor/Tensor.h"]
    "2" [label="Marmot/MarmotFastorTensorBasics.h" tooltip="Marmot/MarmotFastorTensorBasics.h"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
}
dir /home/runner/work/Marmot/Marmot/modules/core
dir /home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include
dir /home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore/include/Marmot
dir /home/runner/work/Marmot/Marmot/modules/core/MarmotFiniteStrainMechanicsCore
dir /home/runner/work/Marmot/Marmot/modules