Interface for the material and environment manager of a mesh. More...
#include <arcane/core/materials/IMeshMaterialMng.h>
Classes | |
| class | IFactory |
Public Member Functions | |
| virtual IMesh * | mesh ()=0 |
| Associated mesh. | |
| virtual ITraceMng * | traceMng ()=0 |
| Trace manager. | |
| virtual MeshMaterialInfo * | registerMaterialInfo (const String &name)=0 |
| Registers the material info with name name. | |
| virtual IMeshEnvironment * | createEnvironment (const MeshEnvironmentBuildInfo &infos)=0 |
| Creates an environment with the info infos. | |
| virtual IMeshBlock * | createBlock (const MeshBlockBuildInfo &infos)=0 |
| Creates a block. | |
| virtual void | addEnvironmentToBlock (IMeshBlock *block, IMeshEnvironment *env)=0 |
| Adds an environment to an existing block. | |
| virtual void | removeEnvironmentToBlock (IMeshBlock *block, IMeshEnvironment *env)=0 |
| Removes an environment from an existing block. | |
| virtual void | endCreate (bool is_continue=false)=0 |
| Indicates that environment creation is finished. | |
| virtual void | recreateFromDump ()=0 |
| Recreates the material and environment info from the dump info. | |
| virtual void | setKeepValuesAfterChange (bool v)=0 |
| Sets the saving of values between two modifications of the materials. | |
| virtual bool | isKeepValuesAfterChange () const =0 |
| Indicates if variable values are preserved between modifications. | |
| virtual void | setDataInitialisationWithZero (bool v)=0 |
| Indicates how to initialize new values in material and environment cells. | |
| virtual bool | isDataInitialisationWithZero () const =0 |
| Indicates how to initialize new values in material and environment cells. | |
| virtual void | setMeshModificationNotified (bool v)=0 |
| Indicates if environments and materials follow changes in the mesh topology. | |
| virtual bool | isMeshModificationNotified () const =0 |
| Indicates if environments and materials follow changes in the mesh topology. | |
| virtual void | setModificationFlags (int v)=0 |
| Sets the flags to parameterize material/environment modifications. | |
| virtual int | modificationFlags () const =0 |
| Flags to parameterize modifications. | |
| virtual void | setAllocateScalarEnvironmentVariableAsMaterial (bool v)=0 |
| Sets the option indicating whether scalar variables of environments are allocated on materials. | |
| virtual bool | isAllocateScalarEnvironmentVariableAsMaterial () const =0 |
| Indicates if environment scalar variables are allocated on materials. | |
| virtual String | name () const =0 |
| Manager name. | |
| virtual void | setDataCompressorServiceName (const String &name)=0 |
| Name of the service used to compress data during forceRecompute(). | |
| virtual String | dataCompressorServiceName () const =0 |
| Virtual name of the service used to compress data. | |
| virtual ConstArrayView< IMeshMaterial * > | materials () const =0 |
| List of materials. | |
| virtual MeshComponentList | materialsAsComponents () const =0 |
| List of materials viewed as components. | |
| virtual ConstArrayView< IMeshEnvironment * > | environments () const =0 |
| List of environments. | |
| virtual MeshComponentList | environmentsAsComponents () const =0 |
| List of environments viewed as components. | |
| virtual MeshComponentList | components () const =0 |
| List of all components. | |
| virtual ConstArrayView< IMeshBlock * > | blocks () const =0 |
| List of blocks. | |
| virtual IMeshEnvironment * | findEnvironment (const String &name, bool throw_exception=true)=0 |
| Returns the environment with name name. | |
| virtual IMeshBlock * | findBlock (const String &name, bool throw_exception=true)=0 |
| Returns the block with name name. | |
| virtual void | fillWithUsedVariables (Array< IMeshMaterialVariable * > &variables)=0 |
| Fills the array variables with the list of used material variables. | |
| virtual IMeshMaterialVariable * | findVariable (const String &name)=0 |
| Variable with name name or nullptr if none of this name exists. | |
| virtual IMeshMaterialVariable * | checkVariable (IVariable *global_var)=0 |
| Material variable associated with the global variable global_var (nullptr if none). | |
| virtual void | dumpInfos (std::ostream &o)=0 |
| Writes the material and environment info to the stream o. | |
| virtual void | dumpCellInfos (Cell cell, std::ostream &o)=0 |
| Writes the cell info cell to the stream o. | |
| virtual void | checkValid ()=0 |
| Checks the validity of internal structures. | |
| virtual AllEnvCellVectorView | view (const CellGroup &cells)=0 |
| View of environment cells corresponding to the group cells. | |
| virtual AllEnvCellVectorView | view (CellVectorView cells)=0 |
| View of environment cells corresponding to the group cells. | |
| virtual AllEnvCellVectorView | view (SmallSpan< const Int32 > cell_local_id)=0 |
| View of environment cells corresponding to local cell IDs cells_local_id. | |
| virtual CellToAllEnvCellConverter | cellToAllEnvCellConverter ()=0 |
| Creates an instance to convert from 'Cell' to 'AllEnvCell'. | |
| virtual void | forceRecompute ()=0 |
| Forces the recalculation of material information. | |
| virtual Mutex * | variableLock ()=0 |
| Lock used for multi-threading. | |
| virtual bool | synchronizeMaterialsInCells ()=0 |
| Synchronizes material cells. | |
| virtual void | checkMaterialsInCells (Integer max_print=10)=0 |
| Checks that material cells are consistent between subdomains. | |
| virtual void | visitVariables (IFunctorWithArgumentT< IMeshMaterialVariable * > *functor)=0 |
| Applies the functor functor to all material variables. | |
| virtual Int64 | timestamp () const =0 |
| Counter for the number of modifications of the material list and environments. | |
| virtual void | setSynchronizeVariableVersion (Integer version)=0 |
| Sets the version of the implementation for synchronizing material variables. | |
| virtual Integer | synchronizeVariableVersion () const =0 |
| Version of the implementation for synchronizing material variables. | |
| virtual bool | isInMeshMaterialExchange () const =0 |
| True if a mesh exchange with material management is underway. | |
| virtual IMeshMaterialVariableFactoryMng * | variableFactoryMng () const =0 |
| Interface of the variable factory. | |
| virtual void | enableCellToAllEnvCellForRunCommand (bool is_enable, bool force_create=false)=0 |
| Activates or deactivates the construction and update of the table of "connectivity" CellLocalId -> AllEnvCell for RUNCOMMAND. | |
| virtual bool | isCellToAllEnvCellForRunCommand () const =0 |
| virtual void | setUseMaterialValueWhenRemovingPartialValue (bool v)=0 |
| Indicates whether the material or environment value is used when transforming a cell from a partial cell to a pure cell. | |
| virtual bool | isUseMaterialValueWhenRemovingPartialValue () const =0 |
| virtual IMeshMaterialMngInternal * | _internalApi () const =0 |
| Internal API for Arcane. | |
| virtual IMeshMaterialVariableSynchronizer * | _allCellsMatEnvSynchronizer ()=0 |
| Synchronizer for material and environment variables on all cells. | |
| virtual IMeshMaterialVariableSynchronizer * | _allCellsEnvOnlySynchronizer ()=0 |
| Synchronizer for environment-only variables on all cells. | |
Static Public Member Functions | |
| static IMeshMaterialMng * | getReference (const MeshHandleOrMesh &mesh_handle, bool create=true) |
| Retrieves or creates the reference associated with mesh. | |
| static Ref< IMeshMaterialMng > | getTrueReference (const MeshHandle &mesh_handle, bool create=true) |
| Retrieves or creates the reference associated with mesh. | |
Static Private Member Functions | |
| static void | _internalSetFactory (IFactory *f) |
Friends | |
| class | MeshMaterialMngFactory |
Interface for the material and environment manager of a mesh.
This interface manages the different components (IMeshComponent) multi-materials of a mesh, as well as their associated variables. These components can be either materials (IMeshMaterial), or environments (IMeshEnvironment). It is possible to retrieve the list of materials via materials() and the list of environments via environments(). It is also possible to retrieve one of these two lists in the form
The current implementation only manages materials and environments on the cells.
Once this instance is created, via getReference(), the first thing to do is register the list of materials via registerMaterialInfo(). It is then possible to create each environment by indicating the list of materials that compose it via createEnvironment(). Once this is finished, you must call endCreate() to finish initialization. The list of materials and environments cannot be modified except during initialization. It must not change afterward.
Any modification of the cell list of an environment or a material must be done via an instance of MeshMaterialModifier.
Definition at line 57 of file core/materials/IMeshMaterialMng.h.
|
pure virtual |
Synchronizer for environment-only variables on all cells.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Synchronizer for material and environment variables on all cells.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Internal API for Arcane.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::ItemMaterialVariableBase< Traits >::buildFromManager(), and Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference().
|
staticprivate |
Definition at line 39 of file IMeshMaterialMng.cc.
|
pure virtual |
Adds an environment to an existing block.
Adds the environment env to the block block.
The modification of a block can only take place during initialization, (i.e., before calling endCreate()).
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
List of blocks.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Creates an instance to convert from 'Cell' to 'AllEnvCell'.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Checks that material cells are consistent between subdomains.
This method allows checking that all ghost cells of our subdomain have the same list of materials as the associated owned cells.
In case of an error, the list of inconsistent cells is displayed and a FatalErrorException is raised.
max_print indicates the maximum number of errors to display in case of an error. If it is negative, all cells are displayed.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Checks the validity of internal structures.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Material variable associated with the global variable global_var (nullptr if none).
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference().
|
pure virtual |
List of all components.
This list is the concatenation of environmentsAsComponents() and materialsAsComponents(). It is only valid once endCreate() has been called.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Creates a block.
Creates a block with the info infos.
The creation of a block can only take place during initialization, (i.e., before calling endCreate()), but after the creation of environments.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Creates an environment with the info infos.
The creation of an environment can only take place during initialization. The materials constituting the environment must have previously been registered via registerMaterialInfo(). A material can belong to several environments.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Virtual name of the service used to compress data.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Writes the cell info cell to the stream o.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Writes the material and environment info to the stream o.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Activates or deactivates the construction and update of the table of "connectivity" CellLocalId -> AllEnvCell for RUNCOMMAND.
It can also be activated by the environment variable ARCANE_ALLENVCELL_FOR_RUNCOMMAND. Optionally, the table can be forced to be created, which can be useful during a late call of this method compared to ForceRecompute()
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Indicates that environment creation is finished.
The instance is not usable until this method has been called.
If is_continue is true, it rebuilds for each material and environment the list of their cells from the recovery information.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
List of environments.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
List of environments viewed as components.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::ItemMaterialVariableBase< Traits >::fillPartialValuesWithSuperValues().
|
pure virtual |
Fills the array variables with the list of used material variables.
The array variables is cleared before the call.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Returns the block with name name.
If no block with this name exists, returns null if throw_exception is false and throws an exception if throw_exception is true.
Implemented in Arcane::Materials::MeshMaterialMng.
References name().
|
pure virtual |
Returns the environment with name name.
If no environment with this name exists, returns null if throw_exception is false and throws an exception if throw_exception is true.
Implemented in Arcane::Materials::MeshMaterialMng.
References name().
|
pure virtual |
Variable with name name or nullptr if none of this name exists.
Implemented in Arcane::Materials::MeshMaterialMng.
References name().
|
pure virtual |
Forces the recalculation of material information.
This method allows forcing the recalculation of information on cells mixed, for example, following a mesh change. This is a temporary method that will eventually be removed. Mixed values are invalidated after calling this method.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::CartesianMeshAMRPatchMng::coarsen(), and Arcane::mesh::MeshRefinement::coarsenItemsV2().
|
static |
Retrieves or creates the reference associated with mesh.
If no material manager is associated with mesh, it will be created when this method is called if create is true. If create is false, no manager is associated with the mesh, a null pointer is returned. The returned instance remains valid as long as the mesh mesh exists.
Definition at line 65 of file IMeshMaterialMng.cc.
References getTrueReference(), and Arcane::MeshHandleOrMesh::handle().
Referenced by Arcane::CartesianMeshAMRPatchMng::coarsen(), Arcane::mesh::MeshRefinement::coarsenItemsV2(), Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference(), and Arcane::Materials::MeshMaterialVariableBuildTraits< TrueType >::getVariableReference().
|
static |
Retrieves or creates the reference associated with mesh.
If no material manager is associated with mesh, it will be created when this method is called if create is true. If create is false, no manager is associated with the mesh, a null pointer is returned. The returned instance remains valid as long as the mesh mesh exists.
Definition at line 48 of file IMeshMaterialMng.cc.
References ARCANE_FATAL, and Arcane::MeshHandle::isNull().
Referenced by getReference().
|
pure virtual |
Indicates if environment scalar variables are allocated on materials.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference().
|
pure virtual |
Indicates how to initialize new values in material and environment cells.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
True if a mesh exchange with material management is underway.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Indicates if variable values are preserved between modifications.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Indicates if environments and materials follow changes in the mesh topology.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
List of materials.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
List of materials viewed as components.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::ItemMaterialVariableBase< Traits >::fillPartialValuesWithSuperValues().
|
pure virtual |
Associated mesh.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Flags to parameterize modifications.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Manager name.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by findBlock(), findEnvironment(), findVariable(), registerMaterialInfo(), and setDataCompressorServiceName().
|
pure virtual |
Recreates the material and environment info from the dump info.
This method replaces endCreate() and can only be used during recovery and during initialization.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Registers the material info with name name.
This operation only registers the information of a material. This information is then used when creating the environment via createEnvironment().
Implemented in Arcane::Materials::MeshMaterialMng.
References name().
|
pure virtual |
Removes an environment from an existing block.
Removes the environment env from the block block.
The modification of a block can only take place during initialization, (i.e., before calling endCreate()).
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Sets the option indicating whether scalar variables of environments are allocated on materials.
If active, then environment scalar variables are still allocated on materials. This allows declaring the same variable both as a material variable and an environment variable (e.g., MaterialVariableCellReal and EnvironmentVariableCellReal).
By default, this option is not active.
This method must be enabled before calling endCreate() to be taken into account.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Name of the service used to compress data during forceRecompute().
If null (the default), no compression is performed.
Implemented in Arcane::Materials::MeshMaterialMng.
References name().
|
pure virtual |
Indicates how to initialize new values in material and environment cells.
If true, the new values are initialized to zero or the null vector following the data type. If false, initialization is done with the global value.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Sets the saving of values between two modifications of the materials.
If active, the values of partial variables are preserved between two modifications of the material list.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Indicates if environments and materials follow changes in the mesh topology.
This method must be called before any material creation.
If v is false, environments and materials are not notified of changes in the mesh topology. In this case, all associated data is invalidated.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Sets the flags to parameterize material/environment modifications.
The possible flags are a combination of eModificationFlags.
For example:
This method must be enabled before calling endCreate() to be taken into account.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Sets the version of the implementation for synchronizing material variables.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Indicates whether the material or environment value is used when transforming a cell from a partial cell to a pure cell.
When transitioning from a partial cell to a pure cell, the partial value must be copied into the global value. By default, the behavior is not the same depending on whether optimizations are active or not (
If this property is true, it allows using the material value in all cases.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Synchronizes material cells.
This method allows synchronizing between subdomains the cells of each material. It is collective
During this call, the subdomain owning N cells sends to the subdomains that possess these N cells as ghost cells the list of materials it possesses. These latter subdomains update this list by adding or removing the necessary materials.
After this call, it is guaranteed that the ghost cells of a subdomain have the same list of materials and environments as the cells of the subdomain that owns these cells. It is possible, in particular, to synchronize variables via MeshMaterialVariableRef::synchronize().
Returns true if the materials of this subdomain have been modified following the synchronization, false otherwise.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Version of the implementation for synchronizing material variables.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Counter for the number of modifications of the material list and environments.
This counter increases every time materials are added or removed. The increment is not necessarily constant.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Trace manager.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Interface of the variable factory.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::MeshMaterialVariableBuildTraits< TrueType >::getVariableReference().
|
pure virtual |
Lock used for multi-threading.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference().
|
pure virtual |
View of environment cells corresponding to the group cells.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
View of environment cells corresponding to the group cells.
Implemented in Arcane::Materials::MeshMaterialMng.
Referenced by Arcane::Materials::ItemMaterialVariableScalar< DataType >::dumpValues().
|
pure virtual |
View of environment cells corresponding to local cell IDs cells_local_id.
Implemented in Arcane::Materials::MeshMaterialMng.
|
pure virtual |
Applies the functor functor to all material variables.
Implemented in Arcane::Materials::MeshMaterialMng.
|
friend |
Definition at line 59 of file core/materials/IMeshMaterialMng.h.