Arcane  4.1.15.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents > Class Template Reference

Class managing a multi-dimensional NumMatrix type variable on a mesh entity. More...

#include <arcane/core/MeshMDVariableRef.h>

Inheritance diagram for Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >:
Collaboration diagram for Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >:

Public Types

using DataType = DataType_
using NumMatrixType = NumMatrix<DataType, Row, Column>
using ItemLocalIdType = typename ItemType::LocalIdType
using ReferenceType = DataViewGetterSetter<NumMatrixType>
using ConstReferenceType = DataViewGetter<NumMatrixType>
using MDSpanType = MDSpan<NumMatrixType, AddedFirstExtentsType, RightLayout>
Public Types inherited from Arcane::MeshMDVariableRefBaseT< ItemType, DataType_, Extents::template AddedFirstLastLastExtentsType< DynExtent, Row, Column > >
using UnderlyingVariableType
using MDSpanType
using ItemLocalIdType
using FullExtentsType

Public Member Functions

 MeshMatrixMDVariableRefT (const VariableBuildInfo &b)
void reshape (std::array< Int32, Extents::nb_dynamic > dims)
 Changes the data shape.
Operations for variable of dimension MDDim0
ReferenceType operator() (ItemLocalIdType id)
ConstReferenceType operator() (ItemLocalIdType id) const
 Read-only view of the matrix for item id.
DataType & operator() (ItemLocalIdType id, Int32 i, Int32 j)
 Mutable view of the element (i,j) of the matrix for item id.
DataType operator() (ItemLocalIdType id, Int32 i, Int32 j) const
 Read-only view of the element (i,j) of the matrix for item id.
Operations for variable of dimension MDDim1
ReferenceType operator() (ItemLocalIdType id, Int32 index)
ConstReferenceType operator() (ItemLocalIdType id, Int32 index) const
 Read-only view of the matrix of index index for item id.
DataType & operator() (ItemLocalIdType id, Int32 index, Int32 i, Int32 j)
 Mutable view of the element (i,j) of the matrix for item id and index index.
DataType operator() (ItemLocalIdType id, Int32 index, Int32 i, Int32 j) const
 Read-only view of the element (i,j) of the matrix for item id and index index.
Public Member Functions inherited from Arcane::MeshMDVariableRefBaseT< ItemType, DataType_, Extents::template AddedFirstLastLastExtentsType< DynExtent, Row, Column > >
 MeshMDVariableRefBaseT (const VariableBuildInfo &b)
UnderlyingVariableType & underlyingVariable ()
 Associated underlying variable.
ArrayShape fullShape () const
 Full shape (static + dynamic) of the variable.
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.
virtual Integer arraySize () const
 If the variable is an array, returns its dimension, otherwise returns 0.
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 Attributes

static constexpr int nb_dynamic = Extents::nb_dynamic

Protected Member Functions

void updateFromInternal () override
 Updates from the internal part.
Protected Member Functions inherited from Arcane::MeshMDVariableRefBaseT< ItemType, DataType_, Extents::template AddedFirstLastLastExtentsType< DynExtent, Row, Column > >
void updateFromInternal () override
 Updates from the internal part.
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)

Private Types

using BasicType = typename DataTypeTraitsT<DataType>::BasicType
using AddedFirstLastLastExtentsType = typename Extents::template AddedFirstLastLastExtentsType<DynExtent, Row, Column>
using AddedFirstExtentsType = typename Extents::template AddedFirstExtentsType<DynExtent>
using BaseClass = MeshMDVariableRefBaseT<ItemType, DataType, AddedFirstLastLastExtentsType>

Private Attributes

MDSpanType m_matrix_mdspan

Additional Inherited Members

static void setTraceCreation (bool v)
static bool hasTraceCreation ()
Protected Attributes inherited from Arcane::MeshMDVariableRefBaseT< ItemType, DataType_, Extents::template AddedFirstLastLastExtentsType< DynExtent, Row, Column > >
Arcane::Impl::MeshMDVariableRefWrapperT< ItemType, DataType_ > m_underlying_var
MDSpanType m_mdspan
bool m_has_trace = false

Detailed Description

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
class Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >

Class managing a multi-dimensional NumMatrix type variable on a mesh entity.

The dimension of the matrix is fixed and is given by (Row,Column).

Warning
You need to call the method reshape() before using this kind of variables.

For more information, see arcanedoc_core_types_axl_md_variable_use.

Definition at line 361 of file MeshMDVariableRef.h.

Member Typedef Documentation

◆ AddedFirstExtentsType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::AddedFirstExtentsType = typename Extents::template AddedFirstExtentsType<DynExtent>
private

Definition at line 373 of file MeshMDVariableRef.h.

◆ AddedFirstLastLastExtentsType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::AddedFirstLastLastExtentsType = typename Extents::template AddedFirstLastLastExtentsType<DynExtent, Row, Column>
private

Definition at line 372 of file MeshMDVariableRef.h.

◆ BaseClass

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::BaseClass = MeshMDVariableRefBaseT<ItemType, DataType, AddedFirstLastLastExtentsType>
private

Definition at line 374 of file MeshMDVariableRef.h.

◆ BasicType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::BasicType = typename DataTypeTraitsT<DataType>::BasicType
private

Definition at line 371 of file MeshMDVariableRef.h.

◆ ConstReferenceType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::ConstReferenceType = DataViewGetter<NumMatrixType>

Definition at line 382 of file MeshMDVariableRef.h.

◆ DataType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::DataType = DataType_

Definition at line 366 of file MeshMDVariableRef.h.

◆ ItemLocalIdType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::ItemLocalIdType = typename ItemType::LocalIdType

Definition at line 380 of file MeshMDVariableRef.h.

◆ MDSpanType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::MDSpanType = MDSpan<NumMatrixType, AddedFirstExtentsType, RightLayout>

Definition at line 383 of file MeshMDVariableRef.h.

◆ NumMatrixType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::NumMatrixType = NumMatrix<DataType, Row, Column>

Definition at line 367 of file MeshMDVariableRef.h.

◆ ReferenceType

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
using Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::ReferenceType = DataViewGetterSetter<NumMatrixType>

Definition at line 381 of file MeshMDVariableRef.h.

Constructor & Destructor Documentation

◆ MeshMatrixMDVariableRefT()

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::MeshMatrixMDVariableRefT ( const VariableBuildInfo & b)
inlineexplicit

Definition at line 388 of file MeshMDVariableRef.h.

Member Function Documentation

◆ operator()() [1/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
ReferenceType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id)
inline

Mutable view of the matrix for item id

Definition at line 397 of file MeshMDVariableRef.h.

◆ operator()() [2/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
ConstReferenceType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id) const
inline

Read-only view of the matrix for item id.

Definition at line 403 of file MeshMDVariableRef.h.

◆ operator()() [3/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
DataType & Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 i,
Int32 j )
inline

Mutable view of the element (i,j) of the matrix for item id.

Definition at line 409 of file MeshMDVariableRef.h.

◆ operator()() [4/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
DataType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 i,
Int32 j ) const
inline

Read-only view of the element (i,j) of the matrix for item id.

Definition at line 415 of file MeshMDVariableRef.h.

◆ operator()() [5/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
ReferenceType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 index )
inline

Mutable view of the matrix of index index for item id

Definition at line 424 of file MeshMDVariableRef.h.

◆ operator()() [6/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
ConstReferenceType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 index ) const
inline

Read-only view of the matrix of index index for item id.

Definition at line 431 of file MeshMDVariableRef.h.

◆ operator()() [7/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
DataType & Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 index,
Int32 i,
Int32 j )
inline

Mutable view of the element (i,j) of the matrix for item id and index index.

Definition at line 438 of file MeshMDVariableRef.h.

◆ operator()() [8/8]

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
DataType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::operator() ( ItemLocalIdType id,
Int32 index,
Int32 i,
Int32 j ) const
inline

Read-only view of the element (i,j) of the matrix for item id and index index.

Definition at line 445 of file MeshMDVariableRef.h.

◆ reshape()

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
void Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::reshape ( std::array< Int32, Extents::nb_dynamic > dims)
inline

Changes the data shape.

The number of elements in dims must correspond to the number of dynamic values in Extents.

Definition at line 458 of file MeshMDVariableRef.h.

◆ updateFromInternal()

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
void Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::updateFromInternal ( )
inlineoverrideprotectedvirtual

Updates from the internal part.

Reimplemented from Arcane::VariableRef.

Definition at line 472 of file MeshMDVariableRef.h.

References Arcane::MeshMDVariableRefBaseT< ItemType, DataType, AddedFirstLastLastExtentsType >::updateFromInternal().

Here is the call graph for this function:

Member Data Documentation

◆ m_matrix_mdspan

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
MDSpanType Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::m_matrix_mdspan
private

Definition at line 486 of file MeshMDVariableRef.h.

◆ nb_dynamic

template<typename ItemType, typename DataType_, int Row, int Column, typename Extents>
int Arcane::MeshMatrixMDVariableRefT< ItemType, DataType_, Row, Column, Extents >::nb_dynamic = Extents::nb_dynamic
staticconstexpr

Definition at line 384 of file MeshMDVariableRef.h.


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