Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::Materials::CellMaterialVariableScalarRef< DataType_ > Class Template Reference

Scalar variable on the cells of a mesh material. More...

#include <arcane/core/materials/MeshMaterialVariableRef.h>

Public Types

using DataType = DataType_
using PrivatePartType = IScalarMeshMaterialVariable<Cell, DataType>
using ItemType = Cell
using GlobalVariableRefType = MeshVariableScalarRefT<ItemType, DataType>
using ThatClass = CellMaterialVariableScalarRef<DataType>

Public Member Functions

 CellMaterialVariableScalarRef (const VariableBuildInfo &vb)
 Constructs a reference to the variable specified in vb.
 CellMaterialVariableScalarRef (const MaterialVariableBuildInfo &vb)
 Constructs a reference to the variable specified in vb.
 CellMaterialVariableScalarRef (IMeshMaterialVariable *var)
 Constructs a reference to the variable var.
 CellMaterialVariableScalarRef (const ThatClass &rhs)
ThatClass & operator= (const ThatClass &rhs)=delete
 Copy assignment operator (deleted).
 CellMaterialVariableScalarRef ()=delete
 Default constructor (deleted).
virtual void refersTo (const ThatClass &rhs)
 Positions the instance reference to the variable rhs.
void updateFromInternal () override
DataType operator[] (ComponentItemLocalId mc) const
 Partial value of the variable for the material cell mc.
DataType & operator[] (ComponentItemLocalId mc)
 Partial value of the variable for the material cell mc.
DataType operator[] (CellComponentCellEnumerator mc) const
 Partial value of the variable for the iterator mc.
DataType & operator[] (CellComponentCellEnumerator mc)
 Partial value of the variable for the iterator mc.
DataType operator[] (CellLocalId c) const
 Global value of the variable for the cell c.
DataType & operator[] (CellLocalId c)
 Global value of the variable for the cell c.
DataType operator[] (PureMatVarIndex mvi) const
 Value of the variable for the material cell mvi.
DataType & operator[] (PureMatVarIndex mvi)
 Value of the variable for the material cell mvi.
DataType matValue (AllEnvCell c, Int32 mat_id) const
 Value of the variable for the material with index mat_id of the cell, or 0 if absent from the cell.
DataType envValue (AllEnvCell c, Int32 env_id) const
 Value of the variable for the environment with index env_id of the cell, or 0 if absent from the cell.
void fillFromArray (IMeshMaterial *mat, ConstArrayView< DataType > values)
 Fills the variable values for a material.
void fillFromArray (IMeshMaterial *mat, ConstArrayView< DataType > values, Int32ConstArrayView indexes)
 Fills the variable values for a material.
void fillToArray (IMeshMaterial *mat, ArrayView< DataType > values)
 Fills an array from the variable values for a material.
void fillToArray (IMeshMaterial *mat, ArrayView< DataType > values, Int32ConstArrayView indexes)
 Fills an array from the variable values for a material.
void fillToArray (IMeshMaterial *mat, Array< DataType > &values)
 Fills an array from the variable values for a material.
void fillToArray (IMeshMaterial *mat, Array< DataType > &values, Int32ConstArrayView indexes)
 Fills an array from the variable values for a material.
void fill (const DataType &value)
 Fills the partial and global values of the variable with the value value.
void fillPartialValues (const DataType &value)
 Fills the partial values of the variable with the value value.
GlobalVariableRefType & globalVariable ()
 Global variable associated with this material variable.
const GlobalVariableRefType & globalVariable () const
 Global variable associated with this material variable.
ArrayView< DataType > * _internalValue () const
Public Member Functions inherited from Arcane::Materials::MeshMaterialVariableRef
MeshMaterialVariableRef * previousReference ()
 Previous reference (or null) on variable().
MeshMaterialVariableRef * nextReference ()
 Next reference (or null) on variable().
void setPreviousReference (MeshMaterialVariableRef *v)
void setNextReference (MeshMaterialVariableRef *v)
void registerVariable ()
 Registers the variable (internal).
void unregisterVariable ()
 Unregisters the variable (internal).
IMeshMaterialVariablematerialVariable () const
 Associated material variable.
void synchronize ()
 Synchronizes values between sub-domains.
void synchronize (MeshMaterialVariableSynchronizerList &sync_list)
 Adds this variable to the synchronization list sync_list.
MatVarSpace space () const
 Definition space of the variable (material+environment or environment only).
void fillPartialValuesWithSuperValues (Int32 level)
 Fills partial values with the super cell value. If level is LEVEL_MATERIAL, copies material values with those of the environment. If level is LEVEL_ENVIRONMENT, copies environment values with those of the global cell. If level is LEVEL_ALLENVIRONMENT, fills all partial values with those of the global cell (this makes this method equivalent to fillGlobalValuesWithGlobalValues().
String name () const
void setUpToDate ()
bool isUsed () const
void update ()
void addDependCurrentTime (const VariableRef &var)
void addDependCurrentTime (const VariableRef &var, const TraceInfo &tinfo)
void addDependCurrentTime (const MeshMaterialVariableRef &var)
void addDependPreviousTime (const MeshMaterialVariableRef &var)
void removeDepend (const MeshMaterialVariableRef &var)
template<typename ClassType>
void setComputeFunction (ClassType *instance, void(ClassType::*func)())
void setUpToDate (IMeshMaterial *)
 Functions to manage dependencies on the material part of the variable.
void update (IMeshMaterial *)
void addMaterialDepend (const VariableRef &var)
void addMaterialDepend (const VariableRef &var, const TraceInfo &tinfo)
void addMaterialDepend (const MeshMaterialVariableRef &var)
void addMaterialDepend (const MeshMaterialVariableRef &var, const TraceInfo &tinfo)
template<typename ClassType>
void setMaterialComputeFunction (ClassType *instance, void(ClassType::*func)(IMeshMaterial *))

Protected Member Functions

DataType operator[] (MatVarIndex mvi) const
DataType & operator[] (MatVarIndex mvi)
Protected Member Functions inherited from Arcane::Materials::MeshMaterialVariableRef
void _internalInit (IMeshMaterialVariable *mat_variable)
bool _isRegistered () const

Detailed Description

template<typename DataType_>
class Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >

Scalar variable on the cells of a mesh material.

For now, this class is only instantiated for cells

Definition at line 221 of file core/materials/MeshMaterialVariableRef.h.

Member Typedef Documentation

◆ DataType

template<typename DataType_>
using Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::DataType = DataType_

Definition at line 226 of file core/materials/MeshMaterialVariableRef.h.

◆ GlobalVariableRefType

template<typename DataType_>
using Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::GlobalVariableRefType = MeshVariableScalarRefT<ItemType, DataType>

Definition at line 229 of file core/materials/MeshMaterialVariableRef.h.

◆ ItemType

template<typename DataType_>
using Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::ItemType = Cell

Definition at line 228 of file core/materials/MeshMaterialVariableRef.h.

◆ PrivatePartType

template<typename DataType_>
using Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::PrivatePartType = IScalarMeshMaterialVariable<Cell, DataType>

Definition at line 227 of file core/materials/MeshMaterialVariableRef.h.

◆ ThatClass

template<typename DataType_>
using Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::ThatClass = CellMaterialVariableScalarRef<DataType>

Definition at line 230 of file core/materials/MeshMaterialVariableRef.h.

Constructor & Destructor Documentation

◆ CellMaterialVariableScalarRef() [1/3]

template<typename DataType>
Arcane::Materials::CellMaterialVariableScalarRef< DataType >::CellMaterialVariableScalarRef ( const VariableBuildInfo & vb)
explicit

Constructs a reference to the variable specified in vb.

Definition at line 248 of file MeshMaterialVariableRef.cc.

References CellMaterialVariableScalarRef().

Referenced by CellMaterialVariableScalarRef(), and refersTo().

◆ CellMaterialVariableScalarRef() [2/3]

template<typename DataType>
Arcane::Materials::CellMaterialVariableScalarRef< DataType >::CellMaterialVariableScalarRef ( const MaterialVariableBuildInfo & vb)
explicit

Constructs a reference to the variable specified in vb.

Definition at line 257 of file MeshMaterialVariableRef.cc.

◆ CellMaterialVariableScalarRef() [3/3]

template<typename DataType>
Arcane::Materials::CellMaterialVariableScalarRef< DataType >::CellMaterialVariableScalarRef ( IMeshMaterialVariable * var)
explicit

Constructs a reference to the variable var.

var must have the data type DataType and must be a scalar variable, otherwise an exception is raised.

Definition at line 282 of file MeshMaterialVariableRef.cc.

Member Function Documentation

◆ _internalValue()

template<typename DataType_>
ArrayView< DataType > * Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::_internalValue ( ) const
inline

Definition at line 369 of file core/materials/MeshMaterialVariableRef.h.

◆ envValue()

template<typename DataType>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType >::envValue ( AllEnvCell c,
Int32 env_id ) const

Value of the variable for the environment with index env_id of the cell, or 0 if absent from the cell.

Definition at line 363 of file MeshMaterialVariableRef.cc.

References ENUMERATE_CELL_ENVCELL, and Arcane::Materials::EnvCell::environmentId().

◆ fill()

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fill ( const DataType & value)

Fills the partial and global values of the variable with the value value.

Definition at line 502 of file MeshMaterialVariableRef.cc.

References fillPartialValues(), and globalVariable().

◆ fillFromArray() [1/2]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillFromArray ( IMeshMaterial * mat,
ConstArrayView< DataType > values )

Fills the variable values for a material.

This method performs the following operation:

Integer index=0;
ENUMERATE_MATCELL(imatcell,mat){
matvar[imatcell] = values[index];
++index;
}
#define ENUMERATE_MATCELL(iname, mat)
Macro to iterate over all MatCell cells of a material.
Int32 Integer
Type representing an integer.

Definition at line 391 of file MeshMaterialVariableRef.cc.

◆ fillFromArray() [2/2]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillFromArray ( IMeshMaterial * mat,
ConstArrayView< DataType > values,
Int32ConstArrayView indexes )

Fills the variable values for a material.

This method performs the following operation:

Integer index=0;
ENUMERATE_MATCELL(imatcell,mat){
matvar[imatcell] = values[index];
++index;
}

Definition at line 413 of file MeshMaterialVariableRef.cc.

◆ fillPartialValues()

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillPartialValues ( const DataType & value)

Fills the partial values of the variable with the value value.

Definition at line 516 of file MeshMaterialVariableRef.cc.

Referenced by fill().

◆ fillToArray() [1/4]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillToArray ( IMeshMaterial * mat,
Array< DataType > & values )

Fills an array from the variable values for a material.

The array values is resized if necessary.

Definition at line 472 of file MeshMaterialVariableRef.cc.

References Arcane::Materials::IMeshComponent::cells(), fillToArray(), Arcane::Array< T >::resize(), Arcane::ItemGroup::size(), and Arcane::Array< T >::view().

◆ fillToArray() [2/4]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillToArray ( IMeshMaterial * mat,
Array< DataType > & values,
Int32ConstArrayView indexes )

Fills an array from the variable values for a material.

The array values is resized if necessary.

Definition at line 488 of file MeshMaterialVariableRef.cc.

References Arcane::Materials::IMeshComponent::cells(), fillToArray(), Arcane::Array< T >::resize(), Arcane::ItemGroup::size(), and Arcane::Array< T >::view().

◆ fillToArray() [3/4]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillToArray ( IMeshMaterial * mat,
ArrayView< DataType > values )

Fills an array from the variable values for a material.

This method performs the following operation:

Integer index=0;
ENUMERATE_MATCELL(imatcell,mat){
values[index] = matvar[imatcell];
++index;
}

Definition at line 435 of file MeshMaterialVariableRef.cc.

Referenced by fillToArray(), and fillToArray().

◆ fillToArray() [4/4]

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::fillToArray ( IMeshMaterial * mat,
ArrayView< DataType > values,
Int32ConstArrayView indexes )

Fills an array from the variable values for a material.

This method performs the following operation:

Integer index=0;
ENUMERATE_MATCELL(imatcell,mat){
values[index] = matvar[imatcell];
++index;
}

Definition at line 457 of file MeshMaterialVariableRef.cc.

◆ globalVariable() [1/2]

template<typename DataType>
MeshVariableScalarRefT< Cell, DataType > & Arcane::Materials::CellMaterialVariableScalarRef< DataType >::globalVariable ( )

Global variable associated with this material variable.

Definition at line 529 of file MeshMaterialVariableRef.cc.

References ARCANE_FATAL.

Referenced by fill().

◆ globalVariable() [2/2]

template<typename DataType>
const MeshVariableScalarRefT< Cell, DataType > & Arcane::Materials::CellMaterialVariableScalarRef< DataType >::globalVariable ( ) const

Global variable associated with this material variable.

Definition at line 542 of file MeshMaterialVariableRef.cc.

References ARCANE_FATAL.

◆ matValue()

template<typename DataType>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType >::matValue ( AllEnvCell c,
Int32 mat_id ) const

Value of the variable for the material with index mat_id of the cell, or 0 if absent from the cell.

Definition at line 345 of file MeshMaterialVariableRef.cc.

References ENUMERATE_CELL_ENVCELL, ENUMERATE_CELL_MATCELL, and Arcane::Materials::MatCell::materialId().

◆ operator[]() [1/10]

template<typename DataType_>
DataType & Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( CellComponentCellEnumerator mc)
inline

Partial value of the variable for the iterator mc.

Definition at line 296 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [2/10]

template<typename DataType_>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( CellComponentCellEnumerator mc) const
inline

Partial value of the variable for the iterator mc.

Definition at line 290 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [3/10]

template<typename DataType_>
DataType & Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( CellLocalId c)
inline

Global value of the variable for the cell c.

Definition at line 308 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [4/10]

template<typename DataType_>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( CellLocalId c) const
inline

Global value of the variable for the cell c.

Definition at line 302 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [5/10]

template<typename DataType_>
DataType & Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( ComponentItemLocalId mc)
inline

Partial value of the variable for the material cell mc.

Definition at line 284 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [6/10]

template<typename DataType_>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( ComponentItemLocalId mc) const
inline

Partial value of the variable for the material cell mc.

Definition at line 278 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [7/10]

template<typename DataType_>
DataType & Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( MatVarIndex mvi)
inlineprotected

Definition at line 270 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [8/10]

template<typename DataType_>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( MatVarIndex mvi) const
inlineprotected

Definition at line 266 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [9/10]

template<typename DataType_>
DataType & Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( PureMatVarIndex mvi)
inline

Value of the variable for the material cell mvi.

Definition at line 320 of file core/materials/MeshMaterialVariableRef.h.

◆ operator[]() [10/10]

template<typename DataType_>
DataType Arcane::Materials::CellMaterialVariableScalarRef< DataType_ >::operator[] ( PureMatVarIndex mvi) const
inline

Value of the variable for the material cell mvi.

Definition at line 314 of file core/materials/MeshMaterialVariableRef.h.

◆ refersTo()

template<typename DataType_>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::refersTo ( const ThatClass & rhs)
virtual

Positions the instance reference to the variable rhs.

Definition at line 313 of file MeshMaterialVariableRef.cc.

References CellMaterialVariableScalarRef(), and Arcane::Materials::MeshMaterialVariableRef::unregisterVariable().

◆ updateFromInternal()

template<typename DataType>
void Arcane::Materials::CellMaterialVariableScalarRef< DataType >::updateFromInternal ( )
overridevirtual

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