micromechanical (C++)
Loading...
Searching...
No Matches
micromechanical::core::MicromechanicalBase< T > Struct Template Referenceabstract

Base class for micromechanical models. More...

#include <micromechanical.hpp>

Inheritance diagram for micromechanical::core::MicromechanicalBase< T >:

Public Member Functions

 MicromechanicalBase (ContactLawBase< T > *contact, const std::map< std::string, T > &props={}, T npv=1e9, T radius=0.65e-3)
 constructor
 
 MicromechanicalBase (ContactLawType type, const std::map< std::string, T > &props={}, T npv=1e9, T radius=0.65e-3)
 constructor
 
 MicromechanicalBase (const std::string &path, const std::map< std::string, T > &props={}, T npv=1e9, T radius=0.65e-3)
 constructor
 
 MicromechanicalBase ()=default
 default constructor
 
virtual ~MicromechanicalBase ()=default
 destructor
 
void setContactLaw (ContactLawType type, const std::map< std::string, T > &props={})
 Set the contact law if it is not set in the constructor.
 
void setContactLaw (const std::string &path, const std::map< std::string, T > &props={})
 Set the contact law if it is not set in the constructor.
 
void setContactLaw (ContactLawBase< T > *contact)
 Set the contact law if it is not set in the constructor.
 
std::vector< StateVariable< T > > run ()
 Run the micromechanical model.
 
void umat (const T *dstran, T *stress, T *statev, T *ddsdde=nullptr, const bool initialize=false, const bool normalize_ddsdde=true)
 ABAQUS UMAT interface.
 
void vumat (const int nBlock, const T *strainInc, const T *stressOld, T *stressNew, const T *stateOld, T *stateNew, const bool initialize=false)
 ABAQUS VUMAT interface.
 

Public Attributes

std::shared_ptr< ContactLawBase< T > > contact
 contact law
 
std::shared_ptr< Integration< T > > integration
 gauss integration points
 
std::shared_ptr< Load< T > > load
 load
 
std::shared_ptr< DebugVariable< T > > debugVariable = std::shared_ptr<DebugVariable<T>>(nullptr)
 debug variable
 
std::string name = "Undefined"
 name of the model
 
std::vector< StateVariable< T > > stateVars = {}
 state variables of the current run
 
std::shared_ptr< Options< T > > options = std::shared_ptr<Options<T>>(nullptr)
 options for the micromechanical model
 
int _phase = 0
 index of the phase
 
int _step = 0
 current step
 
int _mixedLoad = 0
 number of mixed load steps
 
int _integration = 0
 number of integration steps
 

Protected Member Functions

int nstatev () const
 
StateVariable< T > initialize ()
 Initialize the state variables.
 
virtual void postInitialize (StateVariable< T > &sv)
 Post-initialize the state variables.
 
void postProcess (StateVariable< T > &sv)
 Post-process the state variables.
 
void resetCustomStateVariables (StateVariable< T > &sv0, StateVariable< T > &sv)
 Reset the custom state variables to zeros existing in the current state variables but not in the initial state variables.
 
virtual Eigen::Matrix< T, 6, 1 > increment (const Eigen::Matrix< T, 6, 1 > &dx, Eigen::Matrix< T, 6, 1 > x, const Eigen::Matrix< T, 6, 6 > &S, const Eigen::Matrix< T, 6, 6 > &E, const Eigen::Matrix< T, 6, 6 > &G, const StateVariable< T > &sv0, StateVariable< T > &sv)=0
 Compute one increment.
 
void fabricEvolution (const StateVariable< T > &sv0, StateVariable< T > &sv)
 Compute the fabric evolution.
 
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > stiffness (const StateVariable< T > &sv0, const StateVariable< T > &sv, const Eigen::Matrix< T, Eigen::Dynamic, 1 > kn=Eigen::Matrix< T, Eigen::Dynamic, 1 >::Zero(0, 1), const Eigen::Matrix< T, Eigen::Dynamic, 1 > ks=Eigen::Matrix< T, Eigen::Dynamic, 1 >::Zero(0, 1), bool original=false)=0
 Compute the stiffness matrix.
 
virtual void macroMicroIntegrate (const Eigen::Matrix< T, 6, 6 > &K, const Eigen::Matrix< T, 6, 1 > &dsig, const Eigen::Matrix< T, 6, 1 > &deps, const StateVariable< T > &sv0, StateVariable< T > &sv)=0
 Integrate the macro-micro relation.
 
void contactIntegrates (const Eigen::Matrix< T, Eigen::Dynamic, 3 > &dforce, const Eigen::Matrix< T, Eigen::Dynamic, 3 > &ddisp, const StateVariable< T > &sv0, StateVariable< T > &sv)
 Integrate all the contact laws with cache.
 
virtual void contactIntegrate (int idx, const Eigen::Matrix< T, 3, 1 > &dforce, const Eigen::Matrix< T, 3, 1 > &ddisp, const StateVariable< T > &sv0, StateVariable< T > &sv) const =0
 Integrate the contact law.
 
virtual Eigen::Matrix< T, Eigen::Dynamic, 3 > localizeStress (const Eigen::Matrix< T, 6, 1 > &sig, const StateVariable< T > &sv0, StateVariable< T > &sv)
 localize the marcro stress to micro contact force
 
virtual Eigen::Matrix< T, Eigen::Dynamic, 3 > localizeStrain (const Eigen::Matrix< T, 6, 1 > &eps, const StateVariable< T > &sv0, StateVariable< T > &sv)
 localize the marcro strain to micro contact displacement
 
virtual Eigen::Matrix< T, 6, 1 > averageStress (const Eigen::Matrix< T, Eigen::Dynamic, 3 > force, const StateVariable< T > &sv0, StateVariable< T > &sv)
 Average the micro contact force to macro stress.
 
virtual Eigen::Matrix< T, 6, 1 > averageStrain (const Eigen::Matrix< T, Eigen::Dynamic, 3 > disp, const StateVariable< T > &sv0, StateVariable< T > &sv)
 Average the micro contact displacement to macro strain.
 

Detailed Description

template<typename T>
struct micromechanical::core::MicromechanicalBase< T >

Base class for micromechanical models.

Constructor & Destructor Documentation

◆ MicromechanicalBase() [1/4]

template<typename T>
micromechanical::core::MicromechanicalBase< T >::MicromechanicalBase ( ContactLawBase< T > * contact,
const std::map< std::string, T > & props = {},
T npv = 1e9,
T radius = 0.65e-3 )
inlineexplicit

constructor

Parameters
contactcontact law
propsmaterial properties
npvnumber of integration points
radiusradius of the particle

◆ MicromechanicalBase() [2/4]

template<typename T>
micromechanical::core::MicromechanicalBase< T >::MicromechanicalBase ( ContactLawType type,
const std::map< std::string, T > & props = {},
T npv = 1e9,
T radius = 0.65e-3 )
inlineexplicit

constructor

Parameters
typecontact law type
propsmaterial properties
npvnumber of integration points
radiusradius of the particle

◆ MicromechanicalBase() [3/4]

template<typename T>
micromechanical::core::MicromechanicalBase< T >::MicromechanicalBase ( const std::string & path,
const std::map< std::string, T > & props = {},
T npv = 1e9,
T radius = 0.65e-3 )
inlineexplicit

constructor

Parameters
pathpath to the contact law plugin
propsmaterial properties
npvnumber of integration points
radiusradius of the particle

◆ MicromechanicalBase() [4/4]

template<typename T>
micromechanical::core::MicromechanicalBase< T >::MicromechanicalBase ( )
default

default constructor

◆ ~MicromechanicalBase()

template<typename T>
virtual micromechanical::core::MicromechanicalBase< T >::~MicromechanicalBase ( )
virtualdefault

destructor

Member Function Documentation

◆ averageStrain()

template<typename T>
virtual Eigen::Matrix< T, 6, 1 > micromechanical::core::MicromechanicalBase< T >::averageStrain ( const Eigen::Matrix< T, Eigen::Dynamic, 3 > disp,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotectedvirtual

Average the micro contact displacement to macro strain.

Parameters
dispmicro contact displacement
sv0initial state variable
svstate variable
Returns
macro strain

Reimplemented in micromechanical::core::BestFitAveraging< T >.

◆ averageStress()

template<typename T>
virtual Eigen::Matrix< T, 6, 1 > micromechanical::core::MicromechanicalBase< T >::averageStress ( const Eigen::Matrix< T, Eigen::Dynamic, 3 > force,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotectedvirtual

Average the micro contact force to macro stress.

Parameters
forcemicro contact force
sv0initial state variable
svstate variable
Returns
macro stress

Reimplemented in micromechanical::core::LoveWeberAveraging< T >.

◆ contactIntegrate()

template<typename T>
virtual void micromechanical::core::MicromechanicalBase< T >::contactIntegrate ( int idx,
const Eigen::Matrix< T, 3, 1 > & dforce,
const Eigen::Matrix< T, 3, 1 > & ddisp,
const StateVariable< T > & sv0,
StateVariable< T > & sv ) const
protectedpure virtual

Integrate the contact law.

Parameters
idxindex of the integration point
dforceforce increment
ddispdisplacement increment
sv0initial state variable
svstate variable

Implemented in micromechanical::ChangHicher< T >.

◆ contactIntegrates()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::contactIntegrates ( const Eigen::Matrix< T, Eigen::Dynamic, 3 > & dforce,
const Eigen::Matrix< T, Eigen::Dynamic, 3 > & ddisp,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotected

Integrate all the contact laws with cache.

Parameters
dforceforce increment
ddispdisplacement increment
sv0initial state variable
svstate variable

Referenced by micromechanical::ChangHicher< T >::macroMicroIntegrate().

Here is the caller graph for this function:

◆ fabricEvolution()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::fabricEvolution ( const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotected

Compute the fabric evolution.

Parameters
sv0state variables at the beginning of the increment
svstate variables at the end of the increment

Referenced by micromechanical::core::MixedLoadControl< T >::increment().

Here is the caller graph for this function:

◆ increment()

template<typename T>
virtual Eigen::Matrix< T, 6, 1 > micromechanical::core::MicromechanicalBase< T >::increment ( const Eigen::Matrix< T, 6, 1 > & dx,
Eigen::Matrix< T, 6, 1 > x,
const Eigen::Matrix< T, 6, 6 > & S,
const Eigen::Matrix< T, 6, 6 > & E,
const Eigen::Matrix< T, 6, 6 > & G,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
protectedpure virtual

Compute one increment.

Parameters
dxmixed stress/strain increment, pure strain in finite element analysis
xmixed stress/strain
Sstress control matrix
Estrain control matrix
Gignored control matrix
sv0state variables at the beginning of the increment
svstate variables at the end of the increment
Returns
stress

Implemented in micromechanical::core::MixedLoadControl< T >.

◆ initialize()

template<typename T>
StateVariable< T > micromechanical::core::MicromechanicalBase< T >::initialize ( )
inlineprotected

Initialize the state variables.

Returns
a StateVariable object with initialized state variables

◆ localizeStrain()

template<typename T>
virtual Eigen::Matrix< T, Eigen::Dynamic, 3 > micromechanical::core::MicromechanicalBase< T >::localizeStrain ( const Eigen::Matrix< T, 6, 1 > & eps,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotectedvirtual

localize the marcro strain to micro contact displacement

Parameters
epsmacro strain
sv0initial state variable
svstate variable
Returns
micro contact displacement

Reimplemented in micromechanical::core::KinematicHypothesisLocalization< T >.

◆ localizeStress()

template<typename T>
virtual Eigen::Matrix< T, Eigen::Dynamic, 3 > micromechanical::core::MicromechanicalBase< T >::localizeStress ( const Eigen::Matrix< T, 6, 1 > & sig,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotectedvirtual

localize the marcro stress to micro contact force

Parameters
sigmacro stress
sv0initial state variable
svstate variable
Returns
micro contact force

Reimplemented in micromechanical::core::StaticHypothesisLocalization< T >.

◆ macroMicroIntegrate()

template<typename T>
virtual void micromechanical::core::MicromechanicalBase< T >::macroMicroIntegrate ( const Eigen::Matrix< T, 6, 6 > & K,
const Eigen::Matrix< T, 6, 1 > & dsig,
const Eigen::Matrix< T, 6, 1 > & deps,
const StateVariable< T > & sv0,
StateVariable< T > & sv )
protectedpure virtual

Integrate the macro-micro relation.

Parameters
Kstiffness matrix
dsigstress increment
depsstrain increment
sv0initial state variable
svstate variable

Implemented in micromechanical::ChangHicher< T >.

Referenced by micromechanical::core::MixedLoadControl< T >::increment().

Here is the caller graph for this function:

◆ nstatev()

template<typename T>
int micromechanical::core::MicromechanicalBase< T >::nstatev ( ) const
inlineprotected

◆ postInitialize()

template<typename T>
virtual void micromechanical::core::MicromechanicalBase< T >::postInitialize ( StateVariable< T > & sv)
inlineprotectedvirtual

Post-initialize the state variables.

Parameters
svstate variables

◆ postProcess()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::postProcess ( StateVariable< T > & sv)
inlineprotected

Post-process the state variables.

Parameters
svstate variables

◆ resetCustomStateVariables()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::resetCustomStateVariables ( StateVariable< T > & sv0,
StateVariable< T > & sv )
inlineprotected

Reset the custom state variables to zeros existing in the current state variables but not in the initial state variables.

Parameters
sv0initial state variables
svcurrent state variables

◆ run()

template<typename T>
std::vector< StateVariable< T > > micromechanical::core::MicromechanicalBase< T >::run ( )
inline

Run the micromechanical model.

Returns
a list of state variables

◆ setContactLaw() [1/3]

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::setContactLaw ( const std::string & path,
const std::map< std::string, T > & props = {} )
inline

Set the contact law if it is not set in the constructor.

Parameters
pathpath to the contact law plugin
propsmaterial properties

◆ setContactLaw() [2/3]

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::setContactLaw ( ContactLawBase< T > * contact)
inline

Set the contact law if it is not set in the constructor.

Parameters
contactcontact law

◆ setContactLaw() [3/3]

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::setContactLaw ( ContactLawType type,
const std::map< std::string, T > & props = {} )
inline

Set the contact law if it is not set in the constructor.

Parameters
typecontact law type
propsmaterial properties

◆ stiffness()

template<typename T>
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > micromechanical::core::MicromechanicalBase< T >::stiffness ( const StateVariable< T > & sv0,
const StateVariable< T > & sv,
const Eigen::Matrix< T, Eigen::Dynamic, 1 > kn = Eigen::Matrix< T, Eigen::Dynamic, 1 >::Zero(0, 1),
const Eigen::Matrix< T, Eigen::Dynamic, 1 > ks = Eigen::Matrix< T, Eigen::Dynamic, 1 >::Zero(0, 1),
bool original = false )
protectedpure virtual

Compute the stiffness matrix.

Parameters
sv0initial state variable
svstate variable
kncontact normal stiffness
kscontact shear stiffness
originalreturn the original 9x9 stiffness matrix
Returns
stiffness matrix

Implemented in micromechanical::ChangHicher< T >.

Referenced by micromechanical::core::MixedLoadControl< T >::linearize().

Here is the caller graph for this function:

◆ umat()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::umat ( const T * dstran,
T * stress,
T * statev,
T * ddsdde = nullptr,
const bool initialize = false,
const bool normalize_ddsdde = true )
inline

ABAQUS UMAT interface.

Parameters
dstranstrain increment
stressstress
statevstate variables
ddsddestiffness matrix
initializewhether to initialize the static variables
normalize_ddsddewhether to normalize the stiffness matrix, since the strain increment from ABAQUS is engineering strain which is twice of the tensorial shear strain
Note
The shear strain component in UMAT is engineering strain which is twice of the tensorial shear strain
The Jacobian matrix ddsdde can be nullptr for compatible with ABAQUS VUMAT interface
The engineering shear strain is twice of the tensorial shear strain in UMAT, thus the stiffness matrix should be converted to the stiffness matrix corresponding to engineering shear strain.

◆ vumat()

template<typename T>
void micromechanical::core::MicromechanicalBase< T >::vumat ( const int nBlock,
const T * strainInc,
const T * stressOld,
T * stressNew,
const T * stateOld,
T * stateNew,
const bool initialize = false )
inline

ABAQUS VUMAT interface.

Parameters
nBlocknumber of blocks
strainIncstrain increment, read only
stressOldold stress, read only
stressNewnew stress
stateOldold state variables, read only
stateNewnew state variables
initializewhether to initialize the static variables
Note
Since the component order in Abaqus Explicit is different from Abaqus Standard, the shear stress components 5/6 should be swapped, see Convention Used for Stress and Strain Components.
The shear strain in UMAT is engineering strain which is twice of the tensorial shear strain in VUMAT, thus the tensorial shear strain should be converted to engineering shear strain when passing to the umat method, see Component Ordering in Tensors.

Member Data Documentation

◆ _integration

template<typename T>
int micromechanical::core::MicromechanicalBase< T >::_integration = 0

number of integration steps

Referenced by micromechanical::ChangHicher< T >::macroMicroIntegrate().

◆ _mixedLoad

◆ _phase

◆ _step

◆ contact

◆ debugVariable

template<typename T>
std::shared_ptr<DebugVariable<T> > micromechanical::core::MicromechanicalBase< T >::debugVariable = std::shared_ptr<DebugVariable<T>>(nullptr)

◆ integration

◆ load

◆ name

template<typename T>
std::string micromechanical::core::MicromechanicalBase< T >::name = "Undefined"

name of the model

◆ options

◆ stateVars

template<typename T>
std::vector<StateVariable<T> > micromechanical::core::MicromechanicalBase< T >::stateVars = {}

state variables of the current run


The documentation for this struct was generated from the following file: