MGIS 3.1.0
Loading...
Searching...
No Matches
MaterialStateManager.hxx File Reference
#include <map>
#include <utility>
#include <concepts>
#include <type_traits>
#include <span>
#include <memory>
#include <string>
#include <vector>
#include <variant>
#include <optional>
#include <functional>
#include <string_view>
#include "MGIS/Config.hxx"
#include "MGIS/Context.hxx"
#include "MGIS/StorageMode.hxx"

Classes

struct  mgis::behaviour::MaterialStateManagerInitializer
 a structure in charge of holding information on how a material state manager shall be initialized. It may contain pointers to externally allocated data, that won't be handled by the final state manager. If a pointer is not initialized, the material state manager will allocate and handle memory internally. More...
struct  mgis::behaviour::MaterialStateManager
 structure in charge of handling the state of a material in an optimized way. Here, the "material" is defined by a behaviour and a number of integration points. More...
struct  mgis::behaviour::MaterialStateManager::MutableFieldHolder
 a structure defining a mutable field holder More...
struct  mgis::behaviour::MaterialStateManager::FieldHolder

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.

Functions

MGIS_EXPORT void mgis::behaviour::setMaterialProperty (MaterialStateManager &, std::string_view, const real, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE)
 set the given material property
MGIS_EXPORT void mgis::behaviour::setMaterialProperty (MaterialStateManager &, std::string_view, std::span< mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={})
 set the given material property
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty (Context &, MaterialStateManager &, std::string_view, const real, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE) MGIS_NOEXCEPT
 set the given material property
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty (Context &, MaterialStateManager &, std::string_view, std::span< mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={}) MGIS_NOEXCEPT
 set the given material property from a modifiable memory region
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty (Context &, MaterialStateManager &, std::string_view, std::span< const mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={}) MGIS_NOEXCEPT
 set the given material property from an immutable memory region
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::unsetMaterialProperty (Context &, MaterialStateManager &, std::string_view) MGIS_NOEXCEPT
 remove the field holder associated with the given material property, if defined
MGIS_EXPORT bool mgis::behaviour::isMaterialPropertyDefined (const MaterialStateManager &, std::string_view)
MGIS_EXPORT bool mgis::behaviour::isMaterialPropertyUniform (const MaterialStateManager &, std::string_view)
 check if the given material property is uniform
MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isMaterialPropertyUniform (Context &, const MaterialStateManager &, std::string_view) MGIS_NOEXCEPT
 check if the given material property is uniform
MGIS_EXPORT void mgis::behaviour::setMassDensity (MaterialStateManager &, const real, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE) MGIS_NOEXCEPT
 set the mass density
MGIS_EXPORT void mgis::behaviour::setMassDensity (MaterialStateManager &, std::span< mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={})
 set the mass density
MGIS_EXPORT bool mgis::behaviour::isMassDensityDefined (const MaterialStateManager &) MGIS_NOEXCEPT
MGIS_EXPORT bool mgis::behaviour::isMassDensityUniform (const MaterialStateManager &)
MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isMassDensityUniform (Context &, const MaterialStateManager &) MGIS_NOEXCEPT
MGIS_EXPORT void mgis::behaviour::setExternalStateVariable (MaterialStateManager &, std::string_view, const real, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE)
 set the given external state variable
MGIS_EXPORT void mgis::behaviour::setExternalStateVariable (MaterialStateManager &, std::string_view, std::span< mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={})
 set the given external state variable
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable (Context &, MaterialStateManager &, std::string_view, const real, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE) MGIS_NOEXCEPT
 set the given external state variable
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable (Context &, MaterialStateManager &, std::string_view, std::span< mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={}) MGIS_NOEXCEPT
 set the given external state variable
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable (Context &, MaterialStateManager &, std::string_view, std::span< const mgis::real >, const MaterialStateManager::StorageMode=MaterialStateManager::LOCAL_STORAGE, const MaterialStateManager::UpdatePolicy=MaterialStateManager::UPDATE, std::function< void()>={}) MGIS_NOEXCEPT
 set the given external state variable from a non-modifiable memory region
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::unsetExternalStateVariable (Context &, MaterialStateManager &, std::string_view) MGIS_NOEXCEPT
 remove the field holder associated with the given external state variable, if defined
MGIS_EXPORT bool mgis::behaviour::isExternalStateVariableDefined (const MaterialStateManager &, std::string_view)
MGIS_EXPORT bool mgis::behaviour::isExternalStateVariableUniform (const MaterialStateManager &, std::string_view)
MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isExternalStateVariableUniform (Context &, const MaterialStateManager &, std::string_view) MGIS_NOEXCEPT
MGIS_EXPORT void mgis::behaviour::updateValues (MaterialStateManager &, const MaterialStateManager &)
 update the values of a state from another state
MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::updateValues (Context &, MaterialStateManager &, const MaterialStateManager &) MGIS_NOEXCEPT
 update the values of a state from another state
MGIS_EXPORT void mgis::behaviour::extractInternalStateVariable (std::span< mgis::real >, const mgis::behaviour::MaterialStateManager &, const std::string_view)
 extract an internal state variable

Detailed Description

Author
Thomas Helfer
Date
05/08/2018

Function Documentation

◆ extractInternalStateVariable()

MGIS_EXPORT void mgis::behaviour::extractInternalStateVariable ( std::span< mgis::real > ,
const mgis::behaviour::MaterialStateManager & ,
const std::string_view  )

extract an internal state variable

Parameters
[out]obuffer in which the values of the given internal state variable is stored
[in]smaterial state manager
[in]nname of the internal state variables
Note
the output buffer must be allocated properly

◆ isExternalStateVariableDefined()

MGIS_EXPORT bool mgis::behaviour::isExternalStateVariableDefined ( const MaterialStateManager & ,
std::string_view  )
Returns
true if the given external state variable is defined.
Parameters
[in]mmaterial state manager
[in]nname

◆ isExternalStateVariableUniform() [1/2]

MGIS_EXPORT bool mgis::behaviour::isExternalStateVariableUniform ( const MaterialStateManager & ,
std::string_view  )
Returns
true if the given external state variable is uniform.
Parameters
[in]mmaterial state manager
[in]nname

◆ isExternalStateVariableUniform() [2/2]

MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isExternalStateVariableUniform ( Context & ,
const MaterialStateManager & ,
std::string_view  )
Returns
true if the given external state variable is uniform.
Parameters
[in,out]ctxexecution context
[in]mmaterial state manager
[in]nname

◆ isMassDensityDefined()

MGIS_EXPORT bool mgis::behaviour::isMassDensityDefined ( const MaterialStateManager & )
Returns
true if the given external state variable is defined.
Parameters
[out]mmaterial state manager

◆ isMassDensityUniform() [1/2]

MGIS_EXPORT bool mgis::behaviour::isMassDensityUniform ( const MaterialStateManager & )
Returns
true if the mass density is uniform
Parameters
[in]mmaterial state manager

◆ isMassDensityUniform() [2/2]

MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isMassDensityUniform ( Context & ,
const MaterialStateManager &  )
Returns
true if the mass density is uniform
Parameters
[in,out]ctxexecution context
[in]mmaterial state manager

◆ isMaterialPropertyDefined()

MGIS_EXPORT bool mgis::behaviour::isMaterialPropertyDefined ( const MaterialStateManager & ,
std::string_view  )
Returns
true if the given external state variable is defined.
Parameters
[in]mmaterial state manager
[in]nname

◆ isMaterialPropertyUniform() [1/2]

MGIS_EXPORT bool mgis::behaviour::isMaterialPropertyUniform ( const MaterialStateManager & ,
std::string_view  )

check if the given material property is uniform

Parameters
[in]mmaterial state manager
[in]nname

◆ isMaterialPropertyUniform() [2/2]

MGIS_EXPORT MGIS_NODISCARD std::optional< bool > mgis::behaviour::isMaterialPropertyUniform ( Context & ,
const MaterialStateManager & ,
std::string_view  )

check if the given material property is uniform

Parameters
[in,out]ctxexecution context
[in]mmaterial state manager
[in]nname

◆ setExternalStateVariable() [1/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable ( Context & ,
MaterialStateManager & ,
std::string_view ,
const real ,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE )

set the given external state variable

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalue
[in]pupdate policy

◆ setExternalStateVariable() [2/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable ( Context & ,
MaterialStateManager & ,
std::string_view ,
std::span< const mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given external state variable from a non-modifiable memory region

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
Note
the UpdatePolicy can be set to UPDATE in case of local storage, i.e. the UpdatePolicy must be set to NOUPDATE in case of external storage
Parameters
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setExternalStateVariable() [3/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setExternalStateVariable ( Context & ,
MaterialStateManager & ,
std::string_view ,
std::span< mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given external state variable

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setExternalStateVariable() [4/5]

MGIS_EXPORT void mgis::behaviour::setExternalStateVariable ( MaterialStateManager & ,
std::string_view ,
const real ,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE )

set the given external state variable

Parameters
[out]mmaterial state manager
[in]nname
[in]vvalue
[in]pupdate policy

◆ setExternalStateVariable() [5/5]

MGIS_EXPORT void mgis::behaviour::setExternalStateVariable ( MaterialStateManager & ,
std::string_view ,
std::span< mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given external state variable

Parameters
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setMassDensity() [1/2]

MGIS_EXPORT void mgis::behaviour::setMassDensity ( MaterialStateManager & ,
const real ,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE )

set the mass density

Parameters
[out]mmaterial state manager
[in]vvalue
[in]pupdate policy

◆ setMassDensity() [2/2]

MGIS_EXPORT void mgis::behaviour::setMassDensity ( MaterialStateManager & ,
std::span< mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the mass density

Parameters
[in]mmaterial state manager
[in]vvalues
[in]sstorage mode
[in]pupdate policy
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setMaterialProperty() [1/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty ( Context & ,
MaterialStateManager & ,
std::string_view ,
const real ,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE )

set the given material property

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalue
[in]pupdate policy

◆ setMaterialProperty() [2/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty ( Context & ,
MaterialStateManager & ,
std::string_view ,
std::span< const mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given material property from an immutable memory region

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
Note
the UpdatePolicy can be set to UPDATE in case of local storage, i.e. the UpdatePolicy must be set to NOUPDATE in case of external storage
Parameters
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setMaterialProperty() [3/5]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::setMaterialProperty ( Context & ,
MaterialStateManager & ,
std::string_view ,
std::span< mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given material property from a modifiable memory region

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ setMaterialProperty() [4/5]

MGIS_EXPORT void mgis::behaviour::setMaterialProperty ( MaterialStateManager & ,
std::string_view ,
const real ,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE )

set the given material property

Parameters
[out]mmaterial state manager
[in]nname
[in]vvalue
[in]pupdate policy

◆ setMaterialProperty() [5/5]

MGIS_EXPORT void mgis::behaviour::setMaterialProperty ( MaterialStateManager & ,
std::string_view ,
std::span< mgis::real > ,
const MaterialStateManager::StorageMode = MaterialStateManager::LOCAL_STORAGE,
const MaterialStateManager::UpdatePolicy = MaterialStateManager::UPDATE,
std::function< void()> = {} )

set the given material property

Parameters
[out]mmaterial state manager
[in]nname
[in]vvalues
[in]sstorage mode
[in]pupdate policy
[in]hclean-up hook, called once when the given values are no longer referenced (at once in case of local storage or of failure). The hook must not throw.

◆ unsetExternalStateVariable()

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::unsetExternalStateVariable ( Context & ,
MaterialStateManager & ,
std::string_view  )

remove the field holder associated with the given external state variable, if defined

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname

◆ unsetMaterialProperty()

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::unsetMaterialProperty ( Context & ,
MaterialStateManager & ,
std::string_view  )

remove the field holder associated with the given material property, if defined

Parameters
[in,out]ctxexecution context
[out]mmaterial state manager
[in]nname

◆ updateValues() [1/2]

MGIS_EXPORT MGIS_NODISCARD bool mgis::behaviour::updateValues ( Context & ,
MaterialStateManager & ,
const MaterialStateManager &  )

update the values of a state from another state

Parameters
[out]ooutput state
[out]iinput state

◆ updateValues() [2/2]

MGIS_EXPORT void mgis::behaviour::updateValues ( MaterialStateManager & ,
const MaterialStateManager &  )

update the values of a state from another state

Parameters
[out]ooutput state
[out]iinput state