Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::VariableRefArray2T< T > Class Template Reference

Two-dimensional array variable. More...

#include <arcane/core/VariableRefArray2.h>

Inheritance diagram for Arcane::VariableRefArray2T< T >:
Collaboration diagram for Arcane::VariableRefArray2T< T >:

Public Types

typedef T DataType
typedef Array2< T > ValueType
typedef ConstArrayView< T > ConstReturnReferenceType
typedef ArrayView< T > ReturnReferenceType
typedef DataType ElementType
 Type of the variable elements.
typedef VariableRef BaseClass
 Type of the base class.
typedef Array2< DataType > ContainerType
 Type of the class managing the variable value.
typedef Array2View< DataType > ArrayBase
 Type of the array used to access the variable.
typedef Array2VariableT< DataType > PrivatePartType
typedef VariableRefArray2T< DataType > ThatClass

Public Member Functions

 VariableRefArray2T (const VariableBuildInfo &vb)
 Constructs a reference to a 2D array variable specified in vb.
 VariableRefArray2T (const VariableRefArray2T< DataType > &rhs)
 Constructs a reference from rhs.
 VariableRefArray2T (IVariable *var)
 Constructs a reference from var.
void operator= (const VariableRefArray2T< DataType > &rhs)
 Copy assignment operator.
virtual ~VariableRefArray2T ()
 Frees resources.
virtual void resize (Integer new_size)
 Reallocates the number of elements in the first dimension of the array.
void resize (Integer dim1_size, Integer dim2_size)
 Reallocates the number of elements in the array.
void fill (const DataType &value)
 Fills the variable with the value value.
void refersTo (const VariableRefArray2T< DataType > &rhs)
 Positions the instance reference to the variable rhs.
virtual bool isArrayVariable () const
virtual Integer arraySize () const
 If the variable is an array, returns its dimension, otherwise returns 0.
Integer size () const
virtual void updateFromInternal ()
 Updates from the internal part.
ContainerTypeinternalContainer ()
 Returns the container of the variable's values.
IArray2DataInternalT< T > * _internalTrueData ()
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.
Public Member Functions inherited from Arcane::Array2View< T >
constexpr Array2View (T *ptr, Integer dim1_size, Integer dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
constexpr Array2View ()
 Creates an empty 2D view.
constexpr Integer dim1Size () const
 Number of elements in the first dimension.
constexpr Integer dim2Size () const
 Number of elements in the second dimension.
constexpr Integer totalNbElement () const
 Total number of elements.
constexpr ArrayView< T > operator[] (Integer i)
constexpr ConstArrayView< T > operator[] (Integer i) const
constexpr T item (Integer i, Integer j) const
 Value of element [i][j].
constexpr T setItem (Integer i, Integer j, const T &value)
 Positions element [i][j] to value.
constexpr const T operator() (Integer i, Integer j) const
 Value of element [i][j].
constexpr T & operator() (Integer i, Integer j)
 Value of element [i][j].
constexpr T * unguardedBasePointer ()
 Pointer to the allocated memory.
constexpr T * data ()
 Pointer to the allocated memory.
constexpr Array2View (T *ptr, Integer dim1_size, Integer dim2_size)
 Creates a 2D view of dimension [dim1_size][dim2_size].
constexpr Array2View ()
 Creates an empty 2D view.
constexpr Integer dim1Size () const
 Number of elements in the first dimension.
constexpr Integer dim2Size () const
 Number of elements in the second dimension.
constexpr Integer totalNbElement () const
 Total number of elements.
constexpr ArrayView< T > operator[] (Integer i)
constexpr ConstArrayView< T > operator[] (Integer i) const
constexpr T item (Integer i, Integer j) const
 Value of element [i][j].
constexpr T setItem (Integer i, Integer j, const T &value)
 Positions element [i][j] to value.
constexpr const T operator() (Integer i, Integer j) const
 Value of element [i][j].
constexpr T & operator() (Integer i, Integer j)
 Value of element [i][j].
constexpr T * unguardedBasePointer ()
 Pointer to the allocated memory.
constexpr T * data ()
 Pointer to the allocated memory.

Static Public Member Functions

static VariableTypeInfo _internalVariableTypeInfo ()
static VariableInfo _internalVariableInfo (const VariableBuildInfo &vbi)
static void setTraceCreation (bool v)
static bool hasTraceCreation ()

Static Private Member Functions

static VariableRef_autoCreate (const VariableBuildInfo &vb)

Private Attributes

PrivatePartType * m_private_part

Static Private Attributes

static VariableFactoryRegisterer m_auto_registerer

Additional Inherited Members

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)
bool m_has_trace = false

Detailed Description

template<typename T>
class Arcane::VariableRefArray2T< T >

Two-dimensional array variable.

This variable manages classic 2D arrays.

Definition at line 35 of file VariableRefArray2.h.

Member Typedef Documentation

◆ ArrayBase

template<typename T>
typedef Array2View<DataType> Arcane::VariableRefArray2T< T >::ArrayBase

Type of the array used to access the variable.

Definition at line 53 of file VariableRefArray2.h.

◆ BaseClass

template<typename T>
typedef VariableRef Arcane::VariableRefArray2T< T >::BaseClass

Type of the base class.

Definition at line 49 of file VariableRefArray2.h.

◆ ConstReturnReferenceType

template<typename T>
typedef ConstArrayView<T> Arcane::VariableRefArray2T< T >::ConstReturnReferenceType

Definition at line 43 of file VariableRefArray2.h.

◆ ContainerType

template<typename T>
typedef Array2<DataType> Arcane::VariableRefArray2T< T >::ContainerType

Type of the class managing the variable value.

Definition at line 51 of file VariableRefArray2.h.

◆ DataType

template<typename T>
typedef T Arcane::VariableRefArray2T< T >::DataType

Definition at line 41 of file VariableRefArray2.h.

◆ ElementType

template<typename T>
typedef DataType Arcane::VariableRefArray2T< T >::ElementType

Type of the variable elements.

Definition at line 47 of file VariableRefArray2.h.

◆ PrivatePartType

template<typename T>
typedef Array2VariableT<DataType> Arcane::VariableRefArray2T< T >::PrivatePartType

Definition at line 55 of file VariableRefArray2.h.

◆ ReturnReferenceType

template<typename T>
typedef ArrayView<T> Arcane::VariableRefArray2T< T >::ReturnReferenceType

Definition at line 44 of file VariableRefArray2.h.

◆ ThatClass

template<typename T>
typedef VariableRefArray2T<DataType> Arcane::VariableRefArray2T< T >::ThatClass

Definition at line 57 of file VariableRefArray2.h.

◆ ValueType

template<typename T>
typedef Array2<T> Arcane::VariableRefArray2T< T >::ValueType

Definition at line 42 of file VariableRefArray2.h.

Constructor & Destructor Documentation

◆ VariableRefArray2T() [1/3]

template<typename DataType>
Arcane::VariableRefArray2T< DataType >::VariableRefArray2T ( const VariableBuildInfo & vb)

Constructs a reference to a 2D array variable specified in vb.

Definition at line 75 of file VariableRefArray2.cc.

References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().

Referenced by operator=(), refersTo(), and VariableRefArray2T().

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

◆ VariableRefArray2T() [2/3]

template<class DataType>
Arcane::VariableRefArray2T< DataType >::VariableRefArray2T ( const VariableRefArray2T< DataType > & rhs)

Constructs a reference from rhs.

Definition at line 87 of file VariableRefArray2.cc.

References Arcane::Array2View< T >::Array2View(), updateFromInternal(), Arcane::VariableRef::VariableRef(), and VariableRefArray2T().

Here is the call graph for this function:

◆ VariableRefArray2T() [3/3]

template<class DataType>
Arcane::VariableRefArray2T< DataType >::VariableRefArray2T ( IVariable * var)
explicit

Constructs a reference from var.

Definition at line 99 of file VariableRefArray2.cc.

References Arcane::VariableRef::_internalInit(), and Arcane::VariableRef::VariableRef().

Here is the call graph for this function:

◆ ~VariableRefArray2T()

template<typename DataType>
Arcane::VariableRefArray2T< DataType >::~VariableRefArray2T ( )
virtual

Frees resources.

Definition at line 122 of file VariableRefArray2.cc.

Member Function Documentation

◆ _autoCreate()

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

Definition at line 65 of file VariableRefArray2.cc.

◆ _internalTrueData()

template<typename T>
IArray2DataInternalT< T > * Arcane::VariableRefArray2T< T >::_internalTrueData ( )

Definition at line 192 of file VariableRefArray2.cc.

References ARCANE_FATAL, Arcane::VariableRef::name(), Arcane::IVariable::PPrivate, and Arcane::VariableRef::property().

Referenced by internalContainer().

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

◆ _internalVariableInfo()

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

Definition at line 53 of file VariableRefArray2.cc.

◆ _internalVariableTypeInfo()

template<typename DataType>
VariableTypeInfo Arcane::VariableRefArray2T< DataType >::_internalVariableTypeInfo ( )
static

Definition at line 43 of file VariableRefArray2.cc.

◆ arraySize()

template<typename T>
virtual Integer Arcane::VariableRefArray2T< T >::arraySize ( ) const
inlinevirtual

If the variable is an array, returns its dimension, otherwise returns 0.

Reimplemented from Arcane::VariableRef.

Definition at line 103 of file VariableRefArray2.h.

◆ fill()

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

Fills the variable with the value value.

Definition at line 163 of file VariableRefArray2.cc.

◆ internalContainer()

template<typename T>
auto Arcane::VariableRefArray2T< T >::internalContainer ( )

Returns the container of the variable's values.

Calling this method is only possible for private variables (PPrivate property).

Definition at line 182 of file VariableRefArray2.cc.

References _internalTrueData().

Here is the call graph for this function:

◆ isArrayVariable()

template<typename T>
virtual bool Arcane::VariableRefArray2T< T >::isArrayVariable ( ) const
inlinevirtual

Definition at line 102 of file VariableRefArray2.h.

◆ operator=()

template<class DataType>
void Arcane::VariableRefArray2T< DataType >::operator= ( const VariableRefArray2T< DataType > & rhs)

Copy assignment operator.

Deprecated
Use refersTo() instead.

Definition at line 111 of file VariableRefArray2.cc.

References Arcane::VariableRef::operator=(), updateFromInternal(), and VariableRefArray2T().

Here is the call graph for this function:

◆ refersTo()

template<class DataType>
void Arcane::VariableRefArray2T< DataType >::refersTo ( const VariableRefArray2T< DataType > & rhs)

Positions the instance reference to the variable rhs.

Definition at line 131 of file VariableRefArray2.cc.

References Arcane::VariableRef::operator=(), updateFromInternal(), and VariableRefArray2T().

Here is the call graph for this function:

◆ resize() [1/2]

template<typename DataType>
void Arcane::VariableRefArray2T< DataType >::resize ( Integer dim1_size,
Integer dim2_size )

Reallocates the number of elements in the array.

Reallocates the array with dim1_size as the size of the first dimension and dim2_size as the size of the second.

Warning
reallocation does not preserve previous values.

Definition at line 153 of file VariableRefArray2.cc.

◆ resize() [2/2]

template<typename DataType>
void Arcane::VariableRefArray2T< DataType >::resize ( Integer new_size)
virtual

Reallocates the number of elements in the first dimension of the array.

The number of elements in the second dimension is set to zero.

Warning
reallocation does not preserve previous values.

Definition at line 143 of file VariableRefArray2.cc.

◆ size()

template<typename T>
Integer Arcane::VariableRefArray2T< T >::size ( ) const
inline

Definition at line 104 of file VariableRefArray2.h.

◆ updateFromInternal()

template<typename DataType>
void Arcane::VariableRefArray2T< DataType >::updateFromInternal ( )
virtual

Updates from the internal part.

Reimplemented from Arcane::VariableRef.

Definition at line 172 of file VariableRefArray2.cc.

References Arcane::VariableRef::updateFromInternal().

Referenced by operator=(), refersTo(), and VariableRefArray2T().

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

Member Data Documentation

◆ m_auto_registerer

template<typename T>
VariableFactoryRegisterer Arcane::VariableRefArray2T< T >::m_auto_registerer
staticprivate

Definition at line 131 of file VariableRefArray2.h.

◆ m_private_part

template<typename T>
PrivatePartType* Arcane::VariableRefArray2T< T >::m_private_part
private

Definition at line 127 of file VariableRefArray2.h.


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