Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT > Class Template Reference

Array variable on a mesh entity type. More...

#include <arcane/core/MeshVariableArrayRef.h>

Inheritance diagram for Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >:
Collaboration diagram for Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >:

Public Types

typedef DataTypeT DataType
typedef ItemTypeT ItemType
typedef UniqueArray2< DataType > ValueType
typedef ConstArrayView< DataType > ConstReturnReferenceType
typedef ArrayView< DataType > ReturnReferenceType
Public Types inherited from Arcane::ItemVariableArrayRefT< DataTypeT >
typedef DataTypeT DataType
typedef UniqueArray2< DataType > ValueType
typedef ConstArrayView< DataType > ConstReturnReferenceType
typedef ArrayView< DataType > ReturnReferenceType

Public Member Functions

 MeshVariableArrayRefT (const VariableBuildInfo &b)
 Constructs a reference to the variable specified in vb.
 MeshVariableArrayRefT (IVariable *var)
 Constructs a reference from var.
 MeshVariableArrayRefT (const MeshVariableArrayRefT< ItemType, DataType > &rhs)
 Constructs a reference from rhs.
void refersTo (const MeshVariableArrayRefT< ItemType, DataType > &rhs)
 Positions the instance reference to the variable rhs.
ThatClass & operator= (const ThatClass &rhs)=delete
ConstArrayType operator[] (ItemLocalIdType item) const
 Read-only value of entity item.
ArrayType operator[] (ItemLocalIdType item)
 Modifiable value of entity item.
const DataType operator() (ItemLocalIdType item, Int32 i) const
 Read-only value of the i-th value of entity item.
DataType & operator() (ItemLocalIdType item, Int32 i)
 Modifiable value of the i-th value of entity item.
GroupType itemGroup () const
 Group associated with the quantity.
void swapValues (MeshVariableArrayRefT< ItemType, DataType > &rhs)
 Swaps the values of the variable rhs with those of the instance.
Public Member Functions inherited from Arcane::ItemVariableArrayRefT< DataTypeT >
 ItemVariableArrayRefT (const VariableBuildInfo &b, eItemKind ik)
 Constructs a reference to the variable specified in vb.
 ItemVariableArrayRefT (IVariable *var)
 Constructs a reference from var.
 ItemVariableArrayRefT (const ItemVariableArrayRefT< DataType > &rhs)
 Constructs a reference from rhs.
ConstArrayType operator[] (ItemLocalId item) const
 Read-only value of entity item.
ArrayType operator[] (ItemLocalId item)
 Modifiable value of entity item.
const DataType operator() (ItemLocalId item, Int32 i) const
 Read-only value of the i-th value of entity item.
DataType & operator() (ItemLocalId item, Int32 i)
 Modifiable value of the i-th value of entity item.
void copy (const ItemVariableArrayRefT< DataType > &v)
 Copies the values of v into this variable.
void copy (const ItemVariableArrayRefT< DataType > &v, const ItemGroup &group)
 Copies the values of v for the group group into this variable.
void copy (const ItemVariableArrayRefT< DataType > &v, RunQueue *queue)
 Copies the values of v into this variable via the queue queue.
void fill (const DataType &value)
 Fills the variable with the value value.
void fill (const DataType &value, const ItemGroup &group)
 Fills the variable with the value value for the entities in group group.
void fill (const DataType &value, RunQueue *queue)
 Fills the variable with the value value via the queue queue.
Public Member Functions inherited from Arcane::PrivateVariableArrayT< DataTypeT >
Array2View< DataTypeT > asArray ()
Integer totalNbElement () const
Integer arraySize () const
 If the variable is an array, returns its dimension, otherwise returns 0.
bool isArrayVariable () const
void updateFromInternal ()
 Updates from the internal part.
ItemGroup itemGroup () const
void resize (Int32 dim2_size)
void resizeAndReshape (const ArrayShape &shape)
SmallSpan2< DataTypeT > _internalSpan ()
SmallSpan2< const DataTypeT > _internalConstSpan () const
Public Member Functions inherited from Arcane::MeshVariableRef
 MeshVariableRef (const VariableBuildInfo &vb)
 Constructs a reference linked to the module.
void synchronize ()
void synchronize (Int32ConstArrayView local_ids)
Public Member Functions inherited from Arcane::VariableRef
virtual ~VariableRef ()
 Releases resources.
ISubDomainsubDomain () const
 Sub-domain associated with the variable (TODO deprecate end of 2023).
IVariableMngvariableMng () const
 Variable manager associated with the variable.
String name () const
 Variable name.
virtual eDataType dataType () const
 Variable type (Real, Integer, ...).
virtual void print (std::ostream &o) const
 Prints the variable value.
virtual IModulemodule () const
 Module associated with the variable (or nullptr, if none).
virtual int property () const
 Variable properties.
virtual int referenceProperty () const
 Reference properties (internal).
virtual void setProperty (int property)
 Sets the property property.
virtual void unsetProperty (int property)
 Unsets the property property.
virtual void registerVariable ()
 Registers the variable (internal).
virtual void unregisterVariable ()
 Unregisters the variable (internal).
IVariablevariable () const
 Associated variable.
virtual Integer checkIfSync (int max_print=0)
 Checks if the variable is synchronized.
virtual Integer checkIfSameOnAllReplica (int max_print=0)
 Checks if the variable has the same values on all replicas.
void setUsed (bool v)
bool isUsed () const
virtual void internalSetUsed (bool)
const StringassignmentStackTrace () const
 Call stack at the time of assigning this instance.
void addTag (const String &tagname, const String &tagvalue)
 Adds the tag tagname with the value tagvalue.
void removeTag (const String &tagname)
 Removes the tag tagname.
bool hasTag (const String &tagname) const
 true if the variable has the tag tagname
String tagValue (const String &tagname) const
 Value of the tag tagname. The string is null if the tag does not exist.
void update ()
 Recalculates the variable if necessary.
void setUpToDate ()
 Indicates that the variable has just been updated.
Int64 modifiedTime ()
 Time when the variable was updated.
void addDependCurrentTime (const VariableRef &var)
 Adds var to the dependency list at the current time.
void addDependCurrentTime (const VariableRef &var, const TraceInfo &tinfo)
 Adds var to the dependency list at the current time with trace info tinfo.
void addDependPreviousTime (const VariableRef &var)
 Adds var to the dependency list at the previous time.
void addDependPreviousTime (const VariableRef &var, const TraceInfo &tinfo)
 Adds var to the dependency list at the previous time with trace info tinfo.
void removeDepend (const VariableRef &var)
 Removes var from the dependency list.
template<typename ClassType>
void setComputeFunction (ClassType *instance, void(ClassType::*func)())
 Sets the variable's recalculation function.
template<typename ClassType>
void setComputeFunction (ClassType *instance, void(ClassType::*func)(), const TraceInfo &tinfo)
 Sets the variable's recalculation function.
VariableRefpreviousReference ()
 Previous reference (or null) to variable().
VariableRefnextReference ()
 Next reference (or null) to variable().
void setPreviousReference (VariableRef *v)
 Sets the previous reference.
void setNextReference (VariableRef *v)
 Sets the next reference.

Static Public Member Functions

static VariableTypeInfo _internalVariableTypeInfo ()
static VariableInfo _internalVariableInfo (const VariableBuildInfo &vbi)
Static Public Member Functions inherited from Arcane::ItemVariableArrayRefT< DataTypeT >
static VariableInfo _internalVariableInfo (const VariableBuildInfo &vbi, eItemKind ik)
static VariableTypeInfo _internalVariableTypeInfo (eItemKind ik)
static void setTraceCreation (bool v)
static bool hasTraceCreation ()

Protected Types

typedef MeshVariableRef BaseClass
typedef Array2View< DataType > ArrayBase
typedef ArrayView< DataType > ArrayType
typedef ConstArrayView< DataType > ConstArrayType
typedef Array2VariableT< DataType > PrivatePartType
typedef ItemTraitsT< ItemType >::ItemGroupType GroupType
typedef ItemTypeT::LocalIdType ItemLocalIdType
typedef MeshVariableArrayRefT< ItemType, DataType > ThatClass
Protected Types inherited from Arcane::ItemVariableArrayRefT< DataTypeT >
typedef PrivateVariableArrayT< DataType > BaseClass
typedef BaseClass::PrivatePartType PrivatePartType
typedef ArrayView< DataType > ArrayType
typedef ConstArrayView< DataType > ConstArrayType
Protected Types inherited from Arcane::PrivateVariableArrayT< DataTypeT >
typedef DataTypeT & DataTypeReturnReference
typedef Array2VariableT< DataTypeT > PrivatePartType

Static Private Member Functions

static VariableRef_autoCreate (const VariableBuildInfo &vb)

Static Private Attributes

static VariableFactoryRegisterer m_auto_registerer

Additional Inherited Members

Protected Member Functions inherited from Arcane::ItemVariableArrayRefT< DataTypeT >
ItemVariableArrayRefT< DataType > & operator= (const ItemVariableArrayRefT< DataType > &rhs)
 Positions the instance reference to the variable rhs.
Protected Member Functions inherited from Arcane::PrivateVariableArrayT< DataTypeT >
 PrivateVariableArrayT (const VariableBuildInfo &vb, const VariableInfo &vi)
void operator= (const PrivateVariableArrayT &rhs)
void _internalInit ()
Protected Member Functions inherited from Arcane::MeshVariableRef
 MeshVariableRef (const MeshVariableRef &rhs)
 MeshVariableRef (IVariable *var)
void operator= (const MeshVariableRef &rhs)
void _internalInit (IVariable *)
Protected Member Functions inherited from Arcane::VariableRef
 VariableRef (const VariableBuildInfo &vbi)
 Constructs a reference to a variable with the infos vbi.
 VariableRef (const VariableRef &from)
 Copy constructor.
 VariableRef (IVariable *var)
 Constructs a reference to a variable var.
VariableRefoperator= (const VariableRef &from)
 Copy assignment operator.
 VariableRef ()
 Default constructor.
void _setComputeFunction (IVariableComputeFunction *v)
void _internalInit (IVariable *)
 Internal initialization of the variable.
IVariable_variable () const
 Referenced variable.
void _executeUpdateFunctors ()
void _internalAssignVariable (const VariableRef &var)
Protected Attributes inherited from Arcane::PrivateVariableArrayT< DataTypeT >
PrivatePartType * m_private_part
Array2View< DataTypeT > m_view
bool m_has_trace = false

Detailed Description

template<class ItemTypeT, class DataTypeT>
class Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >

Array variable on a mesh entity type.

Definition at line 116 of file MeshVariableArrayRef.h.

Member Typedef Documentation

◆ ArrayBase

template<class ItemTypeT, class DataTypeT>
typedef Array2View<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ArrayBase
protected

Definition at line 131 of file MeshVariableArrayRef.h.

◆ ArrayType

template<class ItemTypeT, class DataTypeT>
typedef ArrayView<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ArrayType
protected

Definition at line 133 of file MeshVariableArrayRef.h.

◆ BaseClass

template<class ItemTypeT, class DataTypeT>
typedef MeshVariableRef Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::BaseClass
protected

Definition at line 129 of file MeshVariableArrayRef.h.

◆ ConstArrayType

template<class ItemTypeT, class DataTypeT>
typedef ConstArrayView<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ConstArrayType
protected

Definition at line 134 of file MeshVariableArrayRef.h.

◆ ConstReturnReferenceType

template<class ItemTypeT, class DataTypeT>
typedef ConstArrayView<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ConstReturnReferenceType

Definition at line 124 of file MeshVariableArrayRef.h.

◆ DataType

template<class ItemTypeT, class DataTypeT>
typedef DataTypeT Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::DataType

Definition at line 121 of file MeshVariableArrayRef.h.

◆ GroupType

template<class ItemTypeT, class DataTypeT>
typedef ItemTraitsT<ItemType>::ItemGroupType Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::GroupType
protected

Definition at line 138 of file MeshVariableArrayRef.h.

◆ ItemLocalIdType

template<class ItemTypeT, class DataTypeT>
typedef ItemTypeT::LocalIdType Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ItemLocalIdType
protected

Definition at line 139 of file MeshVariableArrayRef.h.

◆ ItemType

template<class ItemTypeT, class DataTypeT>
typedef ItemTypeT Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ItemType

Definition at line 122 of file MeshVariableArrayRef.h.

◆ PrivatePartType

template<class ItemTypeT, class DataTypeT>
typedef Array2VariableT<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::PrivatePartType
protected

Definition at line 136 of file MeshVariableArrayRef.h.

◆ ReturnReferenceType

template<class ItemTypeT, class DataTypeT>
typedef ArrayView<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ReturnReferenceType

Definition at line 125 of file MeshVariableArrayRef.h.

◆ ThatClass

template<class ItemTypeT, class DataTypeT>
typedef MeshVariableArrayRefT<ItemType, DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ThatClass
protected

Definition at line 141 of file MeshVariableArrayRef.h.

◆ ValueType

template<class ItemTypeT, class DataTypeT>
typedef UniqueArray2<DataType> Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::ValueType

Definition at line 123 of file MeshVariableArrayRef.h.

Constructor & Destructor Documentation

◆ MeshVariableArrayRefT() [1/3]

template<class ItemType, class DataType>
Arcane::MeshVariableArrayRefT< ItemType, DataType >::MeshVariableArrayRefT ( const VariableBuildInfo & b)

Constructs a reference to the variable specified in vb.

Definition at line 160 of file MeshVariableArrayRef.inst.h.

References Arcane::ItemVariableArrayRefT< DataTypeT >::ItemVariableArrayRefT().

Referenced by MeshVariableArrayRefT(), refersTo(), and swapValues().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MeshVariableArrayRefT() [2/3]

template<class ItemType, class DataType>
Arcane::MeshVariableArrayRefT< ItemType, DataType >::MeshVariableArrayRefT ( IVariable * var)
explicit

Constructs a reference from var.

Definition at line 175 of file MeshVariableArrayRef.inst.h.

References Arcane::ItemVariableArrayRefT< DataTypeT >::ItemVariableArrayRefT().

Here is the call graph for this function:

◆ MeshVariableArrayRefT() [3/3]

template<class ItemType, class DataType>
Arcane::MeshVariableArrayRefT< ItemType, DataType >::MeshVariableArrayRefT ( const MeshVariableArrayRefT< ItemType, DataType > & rhs)

Constructs a reference from rhs.

Definition at line 190 of file MeshVariableArrayRef.inst.h.

References Arcane::ItemVariableArrayRefT< DataTypeT >::ItemVariableArrayRefT(), and MeshVariableArrayRefT().

Here is the call graph for this function:

Member Function Documentation

◆ _autoCreate()

template<class ItemType, class DataType>
VariableRef * Arcane::MeshVariableArrayRefT< ItemType, DataType >::_autoCreate ( const VariableBuildInfo & vb)
staticprivate

Definition at line 149 of file MeshVariableArrayRef.inst.h.

◆ _internalVariableInfo()

template<typename ItemType, typename DataType>
VariableInfo Arcane::MeshVariableArrayRefT< ItemType, DataType >::_internalVariableInfo ( const VariableBuildInfo & vbi)
static

Definition at line 137 of file MeshVariableArrayRef.inst.h.

◆ _internalVariableTypeInfo()

template<typename ItemType, typename DataType>
VariableTypeInfo Arcane::MeshVariableArrayRefT< ItemType, DataType >::_internalVariableTypeInfo ( )
static

Definition at line 125 of file MeshVariableArrayRef.inst.h.

◆ itemGroup()

template<class ItemType, class DataType>
Arcane::MeshVariableArrayRefT< ItemType, DataType >::GroupType Arcane::MeshVariableArrayRefT< ItemType, DataType >::itemGroup ( ) const

Group associated with the quantity.

Definition at line 219 of file MeshVariableArrayRef.inst.h.

◆ operator()() [1/2]

template<class ItemTypeT, class DataTypeT>
DataType & Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::operator() ( ItemLocalIdType item,
Int32 i )
inline

Modifiable value of the i-th value of entity item.

Definition at line 168 of file MeshVariableArrayRef.h.

◆ operator()() [2/2]

template<class ItemTypeT, class DataTypeT>
const DataType Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::operator() ( ItemLocalIdType item,
Int32 i ) const
inline

Read-only value of the i-th value of entity item.

Definition at line 165 of file MeshVariableArrayRef.h.

◆ operator[]() [1/2]

template<class ItemTypeT, class DataTypeT>
ArrayType Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::operator[] ( ItemLocalIdType item)
inline

Modifiable value of entity item.

Definition at line 162 of file MeshVariableArrayRef.h.

◆ operator[]() [2/2]

template<class ItemTypeT, class DataTypeT>
ConstArrayType Arcane::MeshVariableArrayRefT< ItemTypeT, DataTypeT >::operator[] ( ItemLocalIdType item) const
inline

Read-only value of entity item.

Definition at line 159 of file MeshVariableArrayRef.h.

◆ refersTo()

template<class ItemType, class DataType>
void Arcane::MeshVariableArrayRefT< ItemType, DataType >::refersTo ( const MeshVariableArrayRefT< ItemType, DataType > & rhs)

Positions the instance reference to the variable rhs.

Definition at line 205 of file MeshVariableArrayRef.inst.h.

References MeshVariableArrayRefT(), and Arcane::ItemVariableArrayRefT< DataTypeT >::operator=().

Here is the call graph for this function:

◆ swapValues()

template<class ItemType, class DataTypeT>
void Arcane::MeshVariableArrayRefT< ItemType, DataTypeT >::swapValues ( MeshVariableArrayRefT< ItemType, DataType > & rhs)

Swaps the values of the variable rhs with those of the instance.

This method is optimized to avoid copies, so the swap happens in constant time. The swapped variables must have the same mesh, the same family, and the same group. They must also be allocated (IVariable::setUsed()==true)

Definition at line 309 of file MeshVariableArrayRef.inst.h.

References MeshVariableArrayRefT().

Here is the call graph for this function:

Member Data Documentation

◆ m_auto_registerer

template<class ItemType, class DataType>
VariableFactoryRegisterer Arcane::MeshVariableArrayRefT< ItemType, DataType >::m_auto_registerer
staticprivate

Definition at line 183 of file MeshVariableArrayRef.h.


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