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

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

#include <arcane/core/MeshVariableScalarRef.h>

Public Types

typedef DataTypeT DataType
typedef ItemTypeT ItemType
typedef UniqueArray< DataTypeT > ValueType
typedef const DataTypeT & ConstReturnReferenceType
typedef DataTypeT & ReturnReferenceType
Public Types inherited from Arcane::ItemVariableScalarRefT< DataTypeT >
typedef DataTypeT DataType
typedef UniqueArray< DataTypeT > ValueType
typedef const DataTypeT & ConstReturnReferenceType
typedef DataTypeT & ReturnReferenceType
typedef ArrayView< DataTypeT > ArrayBase
typedef PrivateVariableScalarT< DataTypeT > BaseClass
typedef BaseClass::PrivatePartType PrivatePartType
typedef BaseClass::DataTypeReturnReference DataTypeReturnReference

Public Member Functions

 MeshVariableScalarRefT (const VariableBuildInfo &vb)
 Constructs a reference to the variable specified in vb.
 MeshVariableScalarRefT (IVariable *var)
 Constructs a reference from var.
 MeshVariableScalarRefT (const MeshVariableScalarRefT< ItemType, DataTypeT > &rhs)
 Constructs a reference from rhs.
void refersTo (const MeshVariableScalarRefT< ItemType, DataTypeT > &rhs)
 Positions the instance reference to the variable rhs.
ThatClass & operator= (const ThatClass &rhs)=delete
void fill (const DataTypeT &value)
void fill (const DataTypeT &value, RunQueue *queue)
void fill (const DataTypeT &value, const GroupType &group)
void swapValues (MeshVariableScalarRefT< ItemType, DataType > &rhs)
 Swaps the values of the variable rhs with those of the instance.
GroupType itemGroup () const
 Group associated with the quantity.
void setIsSynchronized ()
void setIsSynchronized (const GroupType &group)
const DataTypeT & operator[] (ItemLocalIdType i) const
 Read-only value of entity item.
DataTypeReturnReference operator[] (ItemLocalIdType i)
 Read/write value of entity item.
const DataTypeT & operator() (ItemLocalIdType i) const
 Read-only value of entity item.
DataTypeReturnReference operator() (ItemLocalIdType i)
 Read/write value of entity item.
DataTypeT & getReference (ItemLocalIdType item)
 Read/write value of entity item.
const DataTypeT & item (ItemLocalIdType i) const
void setItem (ItemLocalIdType i, const DataTypeT &v)
Public Member Functions inherited from Arcane::ItemVariableScalarRefT< DataTypeT >
 ItemVariableScalarRefT (const VariableBuildInfo &b, eItemKind ik)
 Constructs a reference to the variable specified in vb.
 ItemVariableScalarRefT (IVariable *var)
 Constructs a reference from var.
 ItemVariableScalarRefT (const ItemVariableScalarRefT< DataTypeT > &rhs)
 Constructs a reference from rhs.
void add (const ItemVariableScalarRefT< DataTypeT > &v)
void sub (const ItemVariableScalarRefT< DataTypeT > &v)
void mult (const ItemVariableScalarRefT< DataTypeT > &v)
void mult (const DataTypeT &v)
void copy (const ItemVariableScalarRefT< DataTypeT > &v)
void power (const DataTypeT &v)
void add (const ItemVariableScalarRefT< DataTypeT > &v, const ItemGroup &group)
void sub (const ItemVariableScalarRefT< DataTypeT > &v, const ItemGroup &group)
void mult (const ItemVariableScalarRefT< DataTypeT > &v, const ItemGroup &group)
void mult (const DataTypeT &v, const ItemGroup &group)
void power (const DataTypeT &v, const ItemGroup &group)
void copy (const ItemVariableScalarRefT< DataTypeT > &v, const ItemGroup &group)
 Copies the values of v into this variable for the entities in group.
void fill (const DataTypeT &value)
void fill (const DataTypeT &value, const ItemGroup &group)
void copy (const ItemVariableScalarRefT< DataTypeT > &v, RunQueue *queue)
 Copies the values of v into this variable via the queue.
void fill (const DataTypeT &value, RunQueue *queue)
 Fills the instance values with value via the queue.
const DataType & operator[] (ItemLocalId item) const
 Read-only value of entity item.
DataTypeReturnReference operator[] (ItemLocalId item)
 Read/write value of entity item.
const DataType & operator() (ItemLocalId item) const
 Read-only value of entity item.
DataTypeReturnReference operator() (ItemLocalId item)
 Read/write value of entity item.
Public Member Functions inherited from Arcane::PrivateVariableScalarT< DataTypeT >
ArrayView< DataTypeT > asArray ()
ConstArrayView< DataTypeT > asArray () const
Integer arraySize () const
 If the variable is an array, returns its dimension, otherwise returns 0.
void updateFromInternal ()
 Updates from the internal part.
ItemGroup itemGroup () const
SmallSpan< DataTypeT > _internalSpan ()
SmallSpan< const DataTypeT > _internalSpan () const
SmallSpan< 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)
void setNextReference (VariableRef *v)

Static Public Member Functions

static VariableTypeInfo _internalVariableTypeInfo ()
static VariableInfo _internalVariableInfo (const VariableBuildInfo &vbi)
Static Public Member Functions inherited from Arcane::ItemVariableScalarRefT< 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 ItemType::LocalIdType ItemLocalIdType
typedef ItemVariableScalarRefT< DataTypeT > BaseClass
typedef ItemTraitsT< ItemType >::ItemGroupType GroupType
typedef MeshVariableScalarRefT< ItemType, DataTypeT > ThatClass
typedef BaseClass::DataTypeReturnReference DataTypeReturnReference
Protected Types inherited from Arcane::PrivateVariableScalarT< DataTypeT >
typedef DataTypeT & DataTypeReturnReference
typedef VariableArrayT< DataTypeT > PrivatePartType

Protected Member Functions

 MeshVariableScalarRefT ()
 Default constructor.
ThatClass & _Internal ()
Protected Member Functions inherited from Arcane::ItemVariableScalarRefT< DataTypeT >
void operator= (const ItemVariableScalarRefT< DataTypeT > &rhs)
 Positions the instance reference to the variable rhs.
 ItemVariableScalarRefT ()
 Default constructor.
Protected Member Functions inherited from Arcane::PrivateVariableScalarT< DataTypeT >
 PrivateVariableScalarT (const VariableBuildInfo &vb, const VariableInfo &vi)
 Constructs a reference linked to the module.
 PrivateVariableScalarT (const PrivateVariableScalarT &rhs)
 PrivateVariableScalarT (IVariable *var)
void operator= (const PrivateVariableScalarT &rhs)
void _internalInit ()
const DataTypeT & _value (Integer local_id) const
DataTypeReturnReference _value (Integer local_id)
const DataTypeT & _putValue (Integer index, const DataTypeT &v)
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)

Additional Inherited Members

Protected Attributes inherited from Arcane::PrivateVariableScalarT< DataTypeT >
PrivatePartType * m_private_part
ArrayView< DataTypeT > m_view
IMemoryAccessTracem_memory_trace
bool m_has_trace = false

Detailed Description

template<typename ItemTypeT, typename DataTypeT>
class Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >

Scalar variable on a mesh entity type.

Definition at line 216 of file MeshVariableScalarRef.h.

Member Typedef Documentation

◆ BaseClass

template<typename ItemTypeT, typename DataTypeT>
typedef ItemVariableScalarRefT<DataTypeT> Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::BaseClass
protected

Definition at line 230 of file MeshVariableScalarRef.h.

◆ ConstReturnReferenceType

template<typename ItemTypeT, typename DataTypeT>
typedef const DataTypeT& Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ConstReturnReferenceType

Definition at line 224 of file MeshVariableScalarRef.h.

◆ DataType

template<typename ItemTypeT, typename DataTypeT>
typedef DataTypeT Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::DataType

Definition at line 221 of file MeshVariableScalarRef.h.

◆ DataTypeReturnReference

template<typename ItemTypeT, typename DataTypeT>
typedef BaseClass::DataTypeReturnReference Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::DataTypeReturnReference
protected

Definition at line 234 of file MeshVariableScalarRef.h.

◆ GroupType

template<typename ItemTypeT, typename DataTypeT>
typedef ItemTraitsT<ItemType>::ItemGroupType Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::GroupType
protected

Definition at line 232 of file MeshVariableScalarRef.h.

◆ ItemLocalIdType

template<typename ItemTypeT, typename DataTypeT>
typedef ItemType::LocalIdType Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ItemLocalIdType
protected

Definition at line 229 of file MeshVariableScalarRef.h.

◆ ItemType

template<typename ItemTypeT, typename DataTypeT>
typedef ItemTypeT Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ItemType

Definition at line 222 of file MeshVariableScalarRef.h.

◆ ReturnReferenceType

template<typename ItemTypeT, typename DataTypeT>
typedef DataTypeT& Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ReturnReferenceType

Definition at line 225 of file MeshVariableScalarRef.h.

◆ ThatClass

template<typename ItemTypeT, typename DataTypeT>
typedef MeshVariableScalarRefT<ItemType, DataTypeT> Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ThatClass
protected

Definition at line 233 of file MeshVariableScalarRef.h.

◆ ValueType

template<typename ItemTypeT, typename DataTypeT>
typedef UniqueArray<DataTypeT> Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::ValueType

Definition at line 223 of file MeshVariableScalarRef.h.

Constructor & Destructor Documentation

◆ MeshVariableScalarRefT() [1/4]

template<class ItemType, class DataTypeT>
Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::MeshVariableScalarRefT ( const VariableBuildInfo & vb)

Constructs a reference to the variable specified in vb.

Definition at line 210 of file MeshVariableScalarRef.inst.h.

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

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

◆ MeshVariableScalarRefT() [2/4]

template<class ItemType, class DataTypeT>
Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::MeshVariableScalarRefT ( IVariable * var)
explicit

Constructs a reference from var.

Definition at line 220 of file MeshVariableScalarRef.inst.h.

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

◆ MeshVariableScalarRefT() [3/4]

template<class ItemType, class DataTypeT>
Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::MeshVariableScalarRefT ( const MeshVariableScalarRefT< ItemType, DataTypeT > & rhs)

Constructs a reference from rhs.

Definition at line 230 of file MeshVariableScalarRef.inst.h.

References Arcane::ItemVariableScalarRefT< DataTypeT >::ItemVariableScalarRefT(), and MeshVariableScalarRefT().

◆ MeshVariableScalarRefT() [4/4]

template<typename ItemTypeT, typename DataTypeT>
Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::MeshVariableScalarRefT ( )
inlineprotected

Default constructor.

Definition at line 258 of file MeshVariableScalarRef.h.

Member Function Documentation

◆ _Internal()

template<typename ItemTypeT, typename DataTypeT>
ThatClass & Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::_Internal ( )
inlineprotected

Definition at line 259 of file MeshVariableScalarRef.h.

◆ _internalVariableInfo()

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

Definition at line 180 of file MeshVariableScalarRef.inst.h.

◆ _internalVariableTypeInfo()

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

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

◆ fill() [1/3]

template<typename ItemTypeT, typename DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::fill ( const DataTypeT & value)
inline

Definition at line 263 of file MeshVariableScalarRef.h.

◆ fill() [2/3]

template<typename ItemTypeT, typename DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::fill ( const DataTypeT & value,
const GroupType & group )
inline

Definition at line 265 of file MeshVariableScalarRef.h.

◆ fill() [3/3]

template<typename ItemTypeT, typename DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::fill ( const DataTypeT & value,
RunQueue * queue )
inline

Definition at line 264 of file MeshVariableScalarRef.h.

◆ getReference()

template<typename ItemTypeT, typename DataTypeT>
DataTypeT & Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::getReference ( ItemLocalIdType item)
inline

Read/write value of entity item.

Definition at line 290 of file MeshVariableScalarRef.h.

◆ item()

template<typename ItemTypeT, typename DataTypeT>
const DataTypeT & Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::item ( ItemLocalIdType i) const
inline

Definition at line 295 of file MeshVariableScalarRef.h.

◆ itemGroup()

template<class ItemType, class DataTypeT>
Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::GroupType Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::itemGroup ( ) const

Group associated with the quantity.

Definition at line 256 of file MeshVariableScalarRef.inst.h.

◆ operator()() [1/2]

template<typename ItemTypeT, typename DataTypeT>
DataTypeReturnReference Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::operator() ( ItemLocalIdType i)
inline

Read/write value of entity item.

Definition at line 287 of file MeshVariableScalarRef.h.

◆ operator()() [2/2]

template<typename ItemTypeT, typename DataTypeT>
const DataTypeT & Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::operator() ( ItemLocalIdType i) const
inline

Read-only value of entity item.

Definition at line 284 of file MeshVariableScalarRef.h.

◆ operator[]() [1/2]

template<typename ItemTypeT, typename DataTypeT>
DataTypeReturnReference Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::operator[] ( ItemLocalIdType i)
inline

Read/write value of entity item.

Definition at line 281 of file MeshVariableScalarRef.h.

◆ operator[]() [2/2]

template<typename ItemTypeT, typename DataTypeT>
const DataTypeT & Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::operator[] ( ItemLocalIdType i) const
inline

Read-only value of entity item.

Definition at line 278 of file MeshVariableScalarRef.h.

◆ refersTo()

template<class ItemType, class DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::refersTo ( const MeshVariableScalarRefT< ItemType, DataTypeT > & rhs)

Positions the instance reference to the variable rhs.

Definition at line 245 of file MeshVariableScalarRef.inst.h.

References MeshVariableScalarRefT(), and Arcane::ItemVariableScalarRefT< DataTypeT >::operator=().

◆ setIsSynchronized() [1/2]

template<class ItemType, class DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::setIsSynchronized ( )

Definition at line 276 of file MeshVariableScalarRef.inst.h.

◆ setIsSynchronized() [2/2]

template<class ItemType, class DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::setIsSynchronized ( const GroupType & group)

Definition at line 266 of file MeshVariableScalarRef.inst.h.

◆ setItem()

template<typename ItemTypeT, typename DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemTypeT, DataTypeT >::setItem ( ItemLocalIdType i,
const DataTypeT & v )
inline

Definition at line 299 of file MeshVariableScalarRef.h.

◆ swapValues()

template<class ItemType, class DataTypeT>
void Arcane::MeshVariableScalarRefT< ItemType, DataTypeT >::swapValues ( MeshVariableScalarRefT< 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 is done 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 294 of file MeshVariableScalarRef.inst.h.

References MeshVariableScalarRefT().


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