Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Materials::MeshMaterialVariable Class Referenceabstract

Public Member Functions

 MeshMaterialVariable (const MaterialVariableBuildInfo &v, MatVarSpace mvs)
String name () const override
 Name of the variable.
void addVariableRef (MeshMaterialVariableRef *var_ref) override
 Adds a reference to this variable.
void removeVariableRef (MeshMaterialVariableRef *var_ref) override
 Removes a reference to this variable.
MeshMaterialVariableReffirstReference () const override
IVariablematerialVariable (IMeshMaterial *mat) override
void setKeepOnChange (bool v) override
 Indicates whether the variable value should be kept after a change in the list of materials.
bool keepOnChange () const override
 Indicates whether the variable value should be kept after a change in the list of materials.
MatVarSpace space () const override
 Variable definition space (material+environment or environment only).
Dependency Management
void update (IMeshMaterial *mat) override
 Recalculates the variable for material mat if necessary.
void setUpToDate (IMeshMaterial *mat) override
 Indicates that the variable has just been updated.
Int64 modifiedTime (IMeshMaterial *mat) override
 Time when the variable was updated.
void addDepend (IMeshMaterialVariable *var) override
 Adds var to the dependency list.
void addDepend (IMeshMaterialVariable *var, const TraceInfo &tinfo) override
 Adds var to the dependency list with trace info tinfo.
void addDepend (IVariable *var) override
 Adds var to the dependency list.
void addDepend (IVariable *var, const TraceInfo &tinfo) override
 Adds var to the dependency list with trace info tinfo.
void removeDepend (IMeshMaterialVariable *var) override
 Removes var from the dependency list.
void removeDepend (IVariable *var) override
 Removes var from the dependency list.
void setComputeFunction (IMeshMaterialVariableComputeFunction *v) override
 Sets the variable's recalculation function.
IMeshMaterialVariableComputeFunctioncomputeFunction () override
 Function used to update the variable.
void dependInfos (Array< VariableDependInfo > &infos, Array< MeshMaterialVariableDependInfo > &mat_infos) override
 Dependency information.
IMeshMaterialVariableInternal * _internalApi () override
Public Member Functions inherited from Arcane::Materials::IMeshMaterialVariable
virtual IVariableglobalVariable () const =0
 Associated global variable on the mesh.
virtual void buildFromManager (bool is_continue)=0
virtual void syncReferences ()=0
 Synchronizes references.
virtual void synchronize ()=0
 Synchronizes the variable.
virtual void synchronize (MeshMaterialVariableSynchronizerList &sync_list)=0
virtual void dumpValues (std::ostream &ostr)=0
 Dumps the variable values to the stream ostr.
virtual void dumpValues (std::ostream &ostr, AllEnvCellVectorView view)=0
 Dumps the variable values for the view view to the stream ostr.
virtual void fillPartialValuesWithGlobalValues ()=0
 Fills partial values with the value of the associated global cell.
virtual void fillPartialValuesWithSuperValues (Int32 level)=0
 Fills partial values with the value of the super cell. If level equals LEVEL_MATERIAL, it copies material values with the middle one. If level equals LEVEL_ENVIRONMENT, it copies environment values with the global cell's. If level equals LEVEL_ALLENVIRONMENT, it fills all partial values with the global cell's value (this makes this method equivalent to fillGlobalValuesWithGlobalValues()).
virtual void serialize (ISerializer *sbuffer, Int32ConstArrayView ids)=0
 Serializes the variable for local ID entities ids.

Public functions reserved for Arcane to manage synchronizations

MeshMaterialVariablePrivate * m_p = nullptr
UniqueArray< Span< std::byte > > m_views_as_bytes
virtual Int32 dataTypeSize () const =0
void incrementReference ()
virtual void copyToBuffer (ConstArrayView< MatVarIndex > matvar_indexes, ByteArrayView bytes) const =0
virtual void copyFromBuffer (ConstArrayView< MatVarIndex > matvar_indexes, ByteConstArrayView bytes)=0
ITraceMng_traceMng () const
void _copyToBuffer (SmallSpan< const MatVarIndex > matvar_indexes, Span< std::byte > bytes, RunQueue *queue) const
void _copyFromBuffer (SmallSpan< const MatVarIndex > matvar_indexes, Span< const std::byte > bytes, RunQueue *queue)
virtual Ref< IData_internalCreateSaveDataRef (Integer nb_value)=0
virtual void _saveData (IMeshComponent *component, IData *data)=0
virtual void _restoreData (IMeshComponent *component, IData *data, Integer data_index, Int32ConstArrayView ids, bool allow_null_id)=0
virtual void _copyBetweenPartialAndGlobal (const CopyBetweenPartialAndGlobalArgs &args)=0
virtual void _initializeNewItemsWithZero (InitializeWithZeroArgs &args)=0
virtual void _syncReferences (bool update_views)=0
virtual void _resizeForIndexer (ResizeVariableIndexerArgs &args)=0
static void _genericCopyTo (Span< const std::byte > input, SmallSpan< const Int32 > input_indexes, Span< std::byte > output, SmallSpan< const Int32 > output_indexes, const RunQueue &queue, Int32 data_type_size)

Detailed Description

Definition at line 69 of file MeshMaterialVariable.h.

Constructor & Destructor Documentation

◆ MeshMaterialVariable()

Arcane::Materials::MeshMaterialVariable::MeshMaterialVariable ( const MaterialVariableBuildInfo & v,
MatVarSpace mvs )

Definition at line 182 of file MeshMaterialVariable.cc.

◆ ~MeshMaterialVariable()

Arcane::Materials::MeshMaterialVariable::~MeshMaterialVariable ( )
override

Definition at line 192 of file MeshMaterialVariable.cc.

Member Function Documentation

◆ _copyFromBuffer()

void Arcane::Materials::MeshMaterialVariable::_copyFromBuffer ( SmallSpan< const MatVarIndex > matvar_indexes,
Span< const std::byte > bytes,
RunQueue * queue )
protected

Definition at line 500 of file MeshMaterialVariable.cc.

◆ _copyToBuffer()

void Arcane::Materials::MeshMaterialVariable::_copyToBuffer ( SmallSpan< const MatVarIndex > matvar_indexes,
Span< std::byte > bytes,
RunQueue * queue ) const
protected

Definition at line 485 of file MeshMaterialVariable.cc.

◆ _genericCopyTo()

void Arcane::Materials::MeshMaterialVariable::_genericCopyTo ( Span< const std::byte > input,
SmallSpan< const Int32 > input_indexes,
Span< std::byte > output,
SmallSpan< const Int32 > output_indexes,
const RunQueue & queue,
Int32 data_type_size )
static

Definition at line 515 of file MeshMaterialVariable.cc.

◆ _internalApi()

IMeshMaterialVariableInternal * Arcane::Materials::MeshMaterialVariable::_internalApi ( )
overridevirtual

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 546 of file MeshMaterialVariable.cc.

◆ _traceMng()

ITraceMng * Arcane::Materials::MeshMaterialVariable::_traceMng ( ) const
protected

Definition at line 451 of file MeshMaterialVariable.cc.

◆ addDepend() [1/4]

void Arcane::Materials::MeshMaterialVariable::addDepend ( IMeshMaterialVariable * var)
overridevirtual

Adds var to the dependency list.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 388 of file MeshMaterialVariable.cc.

◆ addDepend() [2/4]

void Arcane::Materials::MeshMaterialVariable::addDepend ( IMeshMaterialVariable * var,
const TraceInfo & tinfo )
overridevirtual

Adds var to the dependency list with trace info tinfo.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 394 of file MeshMaterialVariable.cc.

◆ addDepend() [3/4]

void Arcane::Materials::MeshMaterialVariable::addDepend ( IVariable * var)
overridevirtual

Adds var to the dependency list.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 407 of file MeshMaterialVariable.cc.

◆ addDepend() [4/4]

void Arcane::Materials::MeshMaterialVariable::addDepend ( IVariable * var,
const TraceInfo & tinfo )
overridevirtual

Adds var to the dependency list with trace info tinfo.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 413 of file MeshMaterialVariable.cc.

◆ addVariableRef()

void Arcane::Materials::MeshMaterialVariable::addVariableRef ( MeshMaterialVariableRef * var_ref)
overridevirtual

Adds a reference to this variable.

Precondition: var_ref must not already reference a variable.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 216 of file MeshMaterialVariable.cc.

References Arcane::Materials::MeshMaterialVariableRef::previousReference().

◆ computeFunction()

IMeshMaterialVariableComputeFunction * Arcane::Materials::MeshMaterialVariable::computeFunction ( )
overridevirtual

Function used to update the variable.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 432 of file MeshMaterialVariable.cc.

◆ dependInfos()

void Arcane::Materials::MeshMaterialVariable::dependInfos ( Array< VariableDependInfo > & infos,
Array< MeshMaterialVariableDependInfo > & mat_infos )
overridevirtual

Dependency information.

Fills the array infos with dependency information on global variables and the array mat_infos with those on material variables.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 438 of file MeshMaterialVariable.cc.

References Arcane::Array< T >::add().

◆ firstReference()

MeshMaterialVariableRef * Arcane::Materials::MeshMaterialVariable::firstReference ( ) const
overridevirtual

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 281 of file MeshMaterialVariable.cc.

◆ incrementReference()

void Arcane::Materials::MeshMaterialVariable::incrementReference ( )

Definition at line 201 of file MeshMaterialVariable.cc.

◆ keepOnChange()

bool Arcane::Materials::MeshMaterialVariable::keepOnChange ( ) const
overridevirtual

Indicates whether the variable value should be kept after a change in the list of materials.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 318 of file MeshMaterialVariable.cc.

◆ materialVariable()

IVariable * Arcane::Materials::MeshMaterialVariable::materialVariable ( IMeshMaterial * mat)
overridevirtual

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 299 of file MeshMaterialVariable.cc.

◆ modifiedTime()

Int64 Arcane::Materials::MeshMaterialVariable::modifiedTime ( IMeshMaterial * mat)
overridevirtual

Time when the variable was updated.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 381 of file MeshMaterialVariable.cc.

References Arcane::Materials::IMeshComponent::id().

◆ name()

◆ removeDepend() [1/2]

void Arcane::Materials::MeshMaterialVariable::removeDepend ( IMeshMaterialVariable * var)
overridevirtual

Removes var from the dependency list.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 400 of file MeshMaterialVariable.cc.

◆ removeDepend() [2/2]

void Arcane::Materials::MeshMaterialVariable::removeDepend ( IVariable * var)
overridevirtual

Removes var from the dependency list.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 419 of file MeshMaterialVariable.cc.

◆ removeVariableRef()

void Arcane::Materials::MeshMaterialVariable::removeVariableRef ( MeshMaterialVariableRef * var_ref)
overridevirtual

Removes a reference to this variable.

Precondition: var_ref must reference this variable (a call to addVariableRef() must have been made on this variable).

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 237 of file MeshMaterialVariable.cc.

References ARCANE_FATAL, Arcane::Materials::MeshMaterialVariableRef::nextReference(), and Arcane::Materials::MeshMaterialVariableRef::previousReference().

◆ setComputeFunction()

void Arcane::Materials::MeshMaterialVariable::setComputeFunction ( IMeshMaterialVariableComputeFunction * v)
overridevirtual

Sets the variable's recalculation function.

If a recalculation function already existed, it is destroyed and replaced by this one.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 426 of file MeshMaterialVariable.cc.

◆ setKeepOnChange()

void Arcane::Materials::MeshMaterialVariable::setKeepOnChange ( bool v)
overridevirtual

Indicates whether the variable value should be kept after a change in the list of materials.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 309 of file MeshMaterialVariable.cc.

◆ setUpToDate()

void Arcane::Materials::MeshMaterialVariable::setUpToDate ( IMeshMaterial * mat)
overridevirtual

Indicates that the variable has just been updated.

For correct dependency management, this property must be called every time a variable has been updated.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 374 of file MeshMaterialVariable.cc.

References Arcane::Materials::IMeshComponent::id(), and Arcane::IVariable::incrementModifiedTime().

◆ space()

MatVarSpace Arcane::Materials::MeshMaterialVariable::space ( ) const
overridevirtual

◆ update()

void Arcane::Materials::MeshMaterialVariable::update ( IMeshMaterial * mat)
overridevirtual

Recalculates the variable for material mat if necessary.

Through the dependency mechanism, this operation is called recursively on all variables that the instance depends on. The recalculation function computeFunction() is then called if it turns out that one of the variables it depends on has been modified more recently.

Precondition: computeFunction() != 0

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 327 of file MeshMaterialVariable.cc.

References ARCANE_FATAL, Arcane::Materials::IMeshMaterialVariableComputeFunction::execute(), Arcane::Materials::IMeshComponent::id(), Arcane::IVariable::modifiedTime(), Arcane::Materials::IMeshMaterialVariable::modifiedTime(), name(), Arcane::IVariable::update(), Arcane::Materials::MeshMaterialVariableDependInfo::variable(), and Arcane::VariableDependInfo::variable().

Member Data Documentation

◆ m_p

MeshMaterialVariablePrivate* Arcane::Materials::MeshMaterialVariable::m_p = nullptr
protected

Definition at line 143 of file MeshMaterialVariable.h.

◆ m_views_as_bytes

UniqueArray<Span<std::byte> > Arcane::Materials::MeshMaterialVariable::m_views_as_bytes
protected

Definition at line 144 of file MeshMaterialVariable.h.


The documentation for this class was generated from the following files: