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

Public Types

using TraitsType = Traits
using ValueType = typename Traits::ValueType
using DataType = typename Traits::ValueType
using ThatClass = ItemMaterialVariableBase<Traits>
using SubViewType = typename Traits::SubViewType
using SubConstViewType = typename Traits::SubConstViewType
using SubInputViewType = typename Traits::SubInputViewType
using ContainerSpanType = typename Traits::ContainerSpanType
using ContainerViewType = typename Traits::ContainerViewType
using ContainerConstViewType = typename Traits::ContainerConstViewType
using PrivatePartType = typename Traits::PrivatePartType
using ValueDataType = typename Traits::ValueDataType
using ContainerType = typename Traits::ContainerType
using UniqueContainerType = typename Traits::UniqueContainerType
using VariableRefType = typename Traits::VariableRefType

Public Member Functions

ARCANE_MATERIALS_EXPORT ItemMaterialVariableBase (const MaterialVariableBuildInfo &v, PrivatePartType *global_var, VariableRef *global_var_ref, MatVarSpace mvs)
ARCANE_MATERIALS_EXPORT void syncReferences () override
 Synchronizes references.
ARCANE_MATERIALS_EXPORT IVariableglobalVariable () const override
 Associated global variable on the mesh.
ARCANE_MATERIALS_EXPORT void buildFromManager (bool is_continue) override
ARCANE_MATERIALS_EXPORT Ref< IData_internalCreateSaveDataRef (Integer nb_value) override
ARCANE_MATERIALS_EXPORT void _saveData (IMeshComponent *env, IData *data) override
ARCANE_MATERIALS_EXPORT void _restoreData (IMeshComponent *component, IData *data, Integer data_index, Int32ConstArrayView ids, bool allow_null_id) override
ARCANE_MATERIALS_EXPORT void _copyBetweenPartialAndGlobal (const CopyBetweenPartialAndGlobalArgs &args) override
ARCANE_MATERIALS_EXPORT void _initializeNewItemsWithZero (InitializeWithZeroArgs &args) override
ARCANE_MATERIALS_EXPORT void fillPartialValuesWithGlobalValues () override
 Fills partial values with the value of the associated global cell.
ARCANE_MATERIALS_EXPORT void fillPartialValuesWithSuperValues (Int32 level) override
 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()).
void setValue (MatVarIndex mvi, SubInputViewType v)
void setFillValue (MatVarIndex mvi, const DataType &v)
SubConstViewType value (MatVarIndex mvi) const
Public Member Functions inherited from Arcane::Materials::MeshMaterialVariable
 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).
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
virtual Int32 dataTypeSize () const =0
void incrementReference ()
Public Member Functions inherited from Arcane::Materials::IMeshMaterialVariable
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 serialize (ISerializer *sbuffer, Int32ConstArrayView ids)=0
 Serializes the variable for local ID entities ids.

Protected Member Functions

void _syncFromGlobalVariable ()
PrivatePartType * _trueGlobalVariable ()
void _init (ArrayView< PrivatePartType * > vars)
ARCANE_MATERIALS_EXPORT void _fillPartialValuesWithSuperValues (MeshComponentList components)
ARCANE_MATERIALS_EXPORT void _syncReferences (bool check_resize) override
ARCANE_MATERIALS_EXPORT void _resizeForIndexer (ResizeVariableIndexerArgs &args) override
ARCANE_MATERIALS_EXPORT void _copyHostViewsToViews (RunQueue *queue)
void _setView (Int32 index)
 Positions the views from the container.
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)

Protected Attributes

PrivatePartType * m_global_variable = nullptr
VariableRefm_global_variable_ref = nullptr
UniqueArray< PrivatePartType * > m_vars
 Variables for different materials.
UniqueArray< ContainerViewType > m_device_views
 List of views visible only from the accelerator.
UniqueArray< ContainerViewType > m_host_views
 List of views visible only from the host.
MeshMaterialVariablePrivate * m_p = nullptr
UniqueArray< Span< std::byte > > m_views_as_bytes

Additional Inherited Members

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

template<typename Traits>
class Arcane::Materials::ItemMaterialVariableBase< Traits >

Definition at line 283 of file MeshMaterialVariable.h.

Member Typedef Documentation

◆ ContainerConstViewType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ContainerConstViewType = typename Traits::ContainerConstViewType

Definition at line 298 of file MeshMaterialVariable.h.

◆ ContainerSpanType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ContainerSpanType = typename Traits::ContainerSpanType

Definition at line 296 of file MeshMaterialVariable.h.

◆ ContainerType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ContainerType = typename Traits::ContainerType

Definition at line 301 of file MeshMaterialVariable.h.

◆ ContainerViewType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ContainerViewType = typename Traits::ContainerViewType

Definition at line 297 of file MeshMaterialVariable.h.

◆ DataType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::DataType = typename Traits::ValueType

Definition at line 290 of file MeshMaterialVariable.h.

◆ PrivatePartType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::PrivatePartType = typename Traits::PrivatePartType

Definition at line 299 of file MeshMaterialVariable.h.

◆ SubConstViewType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::SubConstViewType = typename Traits::SubConstViewType

Definition at line 294 of file MeshMaterialVariable.h.

◆ SubInputViewType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::SubInputViewType = typename Traits::SubInputViewType

Definition at line 295 of file MeshMaterialVariable.h.

◆ SubViewType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::SubViewType = typename Traits::SubViewType

Definition at line 293 of file MeshMaterialVariable.h.

◆ ThatClass

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ThatClass = ItemMaterialVariableBase<Traits>

Definition at line 291 of file MeshMaterialVariable.h.

◆ TraitsType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::TraitsType = Traits

Definition at line 288 of file MeshMaterialVariable.h.

◆ UniqueContainerType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::UniqueContainerType = typename Traits::UniqueContainerType

Definition at line 302 of file MeshMaterialVariable.h.

◆ ValueDataType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ValueDataType = typename Traits::ValueDataType

Definition at line 300 of file MeshMaterialVariable.h.

◆ ValueType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::ValueType = typename Traits::ValueType

Definition at line 289 of file MeshMaterialVariable.h.

◆ VariableRefType

template<typename Traits>
using Arcane::Materials::ItemMaterialVariableBase< Traits >::VariableRefType = typename Traits::VariableRefType

Definition at line 303 of file MeshMaterialVariable.h.

Constructor & Destructor Documentation

◆ ItemMaterialVariableBase()

template<typename Traits>
Arcane::Materials::ItemMaterialVariableBase< Traits >::ItemMaterialVariableBase ( const MaterialVariableBuildInfo & v,
PrivatePartType * global_var,
VariableRef * global_var_ref,
MatVarSpace mvs )

Definition at line 65 of file ItemMaterialVariableBaseT.H.

◆ ~ItemMaterialVariableBase()

template<typename Traits>
Arcane::Materials::ItemMaterialVariableBase< Traits >::~ItemMaterialVariableBase ( )
override

Definition at line 82 of file ItemMaterialVariableBaseT.H.

Member Function Documentation

◆ _copyBetweenPartialAndGlobal()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_copyBetweenPartialAndGlobal ( const CopyBetweenPartialAndGlobalArgs & args)
overridevirtual

◆ _copyHostViewsToViews()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_copyHostViewsToViews ( RunQueue * queue)
protected

Definition at line 407 of file ItemMaterialVariableBaseT.H.

◆ _fillPartialValuesWithSuperValues()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_fillPartialValuesWithSuperValues ( MeshComponentList components)
protected

Definition at line 532 of file ItemMaterialVariableBaseT.H.

◆ _init()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_init ( ArrayView< PrivatePartType * > vars)
protected

Definition at line 108 of file ItemMaterialVariableBaseT.H.

◆ _initializeNewItemsWithZero()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_initializeNewItemsWithZero ( InitializeWithZeroArgs & args)
overridevirtual

◆ _internalCreateSaveDataRef()

template<typename Traits>
Ref< IData > Arcane::Materials::ItemMaterialVariableBase< Traits >::_internalCreateSaveDataRef ( Integer nb_value)
overridevirtual

◆ _resizeForIndexer()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_resizeForIndexer ( ResizeVariableIndexerArgs & args)
overrideprotectedvirtual

◆ _restoreData()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_restoreData ( IMeshComponent * component,
IData * data,
Integer data_index,
Int32ConstArrayView ids,
bool allow_null_id )
overridevirtual

◆ _saveData()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_saveData ( IMeshComponent * env,
IData * data )
overridevirtual

◆ _setView()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_setView ( Int32 index)
inlineprotected

Positions the views from the container.

The accelerator view is not updated here but when calling _copyHostViewsToViews().

Definition at line 385 of file MeshMaterialVariable.h.

◆ _syncFromGlobalVariable()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_syncFromGlobalVariable ( )
protected

Definition at line 218 of file ItemMaterialVariableBaseT.H.

◆ _syncReferences()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::_syncReferences ( bool check_resize)
overrideprotectedvirtual

◆ _trueGlobalVariable()

template<typename Traits>
PrivatePartType * Arcane::Materials::ItemMaterialVariableBase< Traits >::_trueGlobalVariable ( )
inlineprotected

Definition at line 353 of file MeshMaterialVariable.h.

◆ buildFromManager()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::buildFromManager ( bool is_continue)
overridevirtual

◆ fillPartialValuesWithGlobalValues()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::fillPartialValuesWithGlobalValues ( )
overridevirtual

Fills partial values with the value of the associated global cell.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 501 of file ItemMaterialVariableBaseT.H.

References fillPartialValuesWithSuperValues().

◆ fillPartialValuesWithSuperValues()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::fillPartialValuesWithSuperValues ( Int32 level)
overridevirtual

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()).

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 511 of file ItemMaterialVariableBaseT.H.

References Arcane::Materials::IMeshMaterialMng::environmentsAsComponents(), and Arcane::Materials::IMeshMaterialMng::materialsAsComponents().

Referenced by fillPartialValuesWithGlobalValues().

◆ globalVariable()

template<typename Traits>
IVariable * Arcane::Materials::ItemMaterialVariableBase< Traits >::globalVariable ( ) const
overridevirtual

Associated global variable on the mesh.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 98 of file ItemMaterialVariableBaseT.H.

◆ setFillValue()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::setFillValue ( MatVarIndex mvi,
const DataType & v )
inline

Definition at line 340 of file MeshMaterialVariable.h.

◆ setValue()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::setValue ( MatVarIndex mvi,
SubInputViewType v )
inline

Definition at line 335 of file MeshMaterialVariable.h.

◆ syncReferences()

template<typename Traits>
void Arcane::Materials::ItemMaterialVariableBase< Traits >::syncReferences ( )
overridevirtual

Synchronizes references.

Synchronizes the values of references (VariableRef) to this variable with the current value of the variable. This method is called automatically when the number of elements of an array variable changes.

Implements Arcane::Materials::IMeshMaterialVariable.

Definition at line 249 of file ItemMaterialVariableBaseT.H.

◆ value()

template<typename Traits>
SubConstViewType Arcane::Materials::ItemMaterialVariableBase< Traits >::value ( MatVarIndex mvi) const
inline

Definition at line 345 of file MeshMaterialVariable.h.

Member Data Documentation

◆ m_device_views

template<typename Traits>
UniqueArray<ContainerViewType> Arcane::Materials::ItemMaterialVariableBase< Traits >::m_device_views
protected

List of views visible only from the accelerator.

Definition at line 373 of file MeshMaterialVariable.h.

◆ m_global_variable

template<typename Traits>
PrivatePartType* Arcane::Materials::ItemMaterialVariableBase< Traits >::m_global_variable = nullptr
protected

Definition at line 368 of file MeshMaterialVariable.h.

◆ m_global_variable_ref

template<typename Traits>
VariableRef* Arcane::Materials::ItemMaterialVariableBase< Traits >::m_global_variable_ref = nullptr
protected

Definition at line 369 of file MeshMaterialVariable.h.

◆ m_host_views

template<typename Traits>
UniqueArray<ContainerViewType> Arcane::Materials::ItemMaterialVariableBase< Traits >::m_host_views
protected

List of views visible only from the host.

Definition at line 375 of file MeshMaterialVariable.h.

◆ m_vars

template<typename Traits>
UniqueArray<PrivatePartType*> Arcane::Materials::ItemMaterialVariableBase< Traits >::m_vars
protected

Variables for different materials.

Definition at line 371 of file MeshMaterialVariable.h.


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