MGIS
Loading...
Searching...
No Matches
mgis::behaviour::MaterialDataManager Struct Reference

structure in charge of handling the data associated with a material in an optimized way. Here, the "material" is defined by a behaviour and a number of integration points. More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Behaviour/MaterialDataManager.hxx>

Inheritance diagram for mgis::behaviour::MaterialDataManager:
mgis::behaviour::MaterialFunctionManager< SpaceType > mgis::fenics::NonLinearMaterial

Public Member Functions

 MaterialDataManager (const Behaviour &, const size_type)
 main constructor
 
 MaterialDataManager (const Behaviour &, const size_type, const MaterialDataManagerInitializer &)
 main constructor
 
void setThreadSafe (const bool)
 set if the MaterialDataManager must take care of thread-safety. This flag is mostly used in members functions allocating memory.
 
void allocateArrayOfTangentOperatorBlocks ()
 allocate the memory associated with the tangent operator blocks if required.
 
void useExternalArrayOfTangentOperatorBlocks (std::span< real >)
 use an externally allocated memory to store the tangent operator blocks.
 
void releaseArrayOfTangentOperatorBlocks ()
 release the memory associated with the tangent operator blocks.
 
void allocateArrayOfSpeedOfSounds ()
 allocate the memory associated with the speed of sound if required.
 
void useExternalArrayOfSpeedOfSounds (std::span< real >)
 use an externally allocated memory to store the tangent operator blocks.
 
void releaseArrayOfSpeedOfSounds ()
 release the memory associated with the tangent operator blocks.
 
BehaviourIntegrationWorkSpacegetBehaviourIntegrationWorkSpace ()
 return a workspace associated with the given behaviour.
 
void releaseBehaviourIntegrationWorkspaces ()
 clear behaviour integration workspaces.
 
 ~MaterialDataManager ()
 destructor
 

Public Attributes

MaterialStateManager s0
 state at the beginning of the time step
 
MaterialStateManager s1
 state at the end of the time step
 
std::span< realK
 view of the stiffness matrices, if required.
 
real rdt = 1
 proposed time step increment increase factor
 
std::span< realspeed_of_sound
 view on the speed of sound.
 
const size_type n
 number of integration points
 
const size_type K_stride
 the size of the stiffness matrix for one integration point (the size of K is K_stride times the number of integration points)
 
const Behaviourb
 underlying behaviour
 

Detailed Description

structure in charge of handling the data associated with a material in an optimized way. Here, the "material" is defined by a behaviour and a number of integration points.

The following design choices were made:

  • The material properties and the external state variables are treated individually. They can be uniform or spatially variable.
  • The internal state variables are treated as a block.

Constructor & Destructor Documentation

◆ MaterialDataManager() [1/2]

mgis::behaviour::MaterialDataManager::MaterialDataManager ( const Behaviour ,
const size_type   
)

main constructor

Parameters
[in]behaviourbehaviour
[in]snumber of integration points

◆ MaterialDataManager() [2/2]

mgis::behaviour::MaterialDataManager::MaterialDataManager ( const Behaviour ,
const size_type  ,
const MaterialDataManagerInitializer  
)

main constructor

Parameters
[in]behaviourbehaviour
[in]snumber of integration points
[in]iinitializer

Member Function Documentation

◆ allocateArrayOfSpeedOfSounds()

void mgis::behaviour::MaterialDataManager::allocateArrayOfSpeedOfSounds ( )

allocate the memory associated with the speed of sound if required.

This method is useless if the memory associated with the speed of sound had previously been allocated or assigned to external memory (see the MaterialDataManagerInitializer structure).

Note
This method is thread-safe if the thread_safe is true. In this case, the memory allocation is guarded by a mutex. See the setThreadSafe method for details

◆ allocateArrayOfTangentOperatorBlocks()

void mgis::behaviour::MaterialDataManager::allocateArrayOfTangentOperatorBlocks ( )

allocate the memory associated with the tangent operator blocks if required.

This method is useless if the memory associated with the tangent operator blocks had previously been allocated or assigned to external memory (see the MaterialDataManagerInitializer structure).

Note
This method is thread-safe if the thread_safe is true. In this case, the memory allocation is guarded by a mutex. See the setThreadSafe method for details

◆ getBehaviourIntegrationWorkSpace()

BehaviourIntegrationWorkSpace & mgis::behaviour::MaterialDataManager::getBehaviourIntegrationWorkSpace ( )

return a workspace associated with the given behaviour.

Note
This method returns a object per thread if the thread_safe member is true.

◆ releaseArrayOfSpeedOfSounds()

void mgis::behaviour::MaterialDataManager::releaseArrayOfSpeedOfSounds ( )

release the memory associated with the tangent operator blocks.

If the memory associated with the tangent operator blocks was handled internally, this memory is freed. If an external memory buffer was used, reference to this buffer is removed.

◆ releaseArrayOfTangentOperatorBlocks()

void mgis::behaviour::MaterialDataManager::releaseArrayOfTangentOperatorBlocks ( )

release the memory associated with the tangent operator blocks.

If the memory associated with the tangent operator blocks was handled internally, this memory is freed. If an external memory buffer was used, reference to this buffer is removed.

◆ releaseBehaviourIntegrationWorkspaces()

void mgis::behaviour::MaterialDataManager::releaseBehaviourIntegrationWorkspaces ( )

clear behaviour integration workspaces.

Note
This is only interesting if you keep allocating different thread pools.

◆ setThreadSafe()

void mgis::behaviour::MaterialDataManager::setThreadSafe ( const bool  )

set if the MaterialDataManager must take care of thread-safety. This flag is mostly used in members functions allocating memory.

Parameters
[in]bvboolean

◆ useExternalArrayOfSpeedOfSounds()

void mgis::behaviour::MaterialDataManager::useExternalArrayOfSpeedOfSounds ( std::span< real )

use an externally allocated memory to store the tangent operator blocks.

Parameters
[in]mmemory view
Note
this method calls releaseArrayOfSpeedOfSounds before allocating the memory.

◆ useExternalArrayOfTangentOperatorBlocks()

void mgis::behaviour::MaterialDataManager::useExternalArrayOfTangentOperatorBlocks ( std::span< real )

use an externally allocated memory to store the tangent operator blocks.

Parameters
[in]mmemory view
Note
this method calls releaseArrayOfTangentOperatorBlocks before allocating the memory.

Member Data Documentation

◆ rdt

real mgis::behaviour::MaterialDataManager::rdt = 1

proposed time step increment increase factor

The calling solver shall set a suitable value on input depending on its policy before each call to integrate.

For instance, if the solver want to limit the increase to 20% at most, it shall set it to 1.2. But setting it to 1, the solver won't allow the behaviour to request an increase of the time step.


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