14#include "arcane/core/MeshVariableArrayRef.h"
16#include "arcane/utils/ValueConvert.h"
17#include "arcane/utils/FatalErrorException.h"
19#include "arcane/core/ItemGroup.h"
20#include "arcane/core/VariableDataTypeTraits.h"
21#include "arcane/core/VariableTypeInfo.h"
22#include "arcane/core/VariableBuildInfo.h"
23#include "arcane/core/VariableInfo.h"
24#include "arcane/core/VariableFactoryRegisterer.h"
25#include "arcane/core/internal/IDataInternal.h"
40 eDataType dt = VariableDataTypeTraitsT<DataType>::type();
53 return VariableInfo(vbi.name(), vbi.itemFamilyName(), vbi.itemGroupName(), vbi.meshName(), vti, sti);
59template <
class DataType>
62: PrivateVariableArrayT<DataType>(vb, _internalVariableInfo(vb, ik))
65 this->_internalInit();
66 if (this->m_private_part->isPartial())
67 ARCANE_FATAL(
"Can not assign a partial variable to a full variable");
76: PrivateVariableArrayT<DataType>(var)
78 this->_internalInit();
79 if (this->m_private_part->isPartial())
80 ARCANE_FATAL(
"Can not assign a partial variable to a full variable");
88: PrivateVariableArrayT<DataType>(rhs)
90 if (this->m_private_part)
102 BaseClass::operator=(rhs);
103 if (this->m_private_part) {
104 this->m_private_part = rhs.m_private_part;
129 eDataType dt = VariableDataTypeTraitsT<DataType>::type();
136template <
typename ItemType,
typename DataType> VariableInfo
137MeshVariableArrayRefT<ItemType, DataType>::
138_internalVariableInfo(
const VariableBuildInfo& vbi)
140 VariableTypeInfo vti = _internalVariableTypeInfo();
141 DataStorageTypeInfo sti = vti._internalDefaultDataStorage();
142 return VariableInfo(vbi.name(), vbi.itemFamilyName(), vbi.itemGroupName(), vbi.meshName(), vti, sti);
148template <
class ItemType,
class DataType>
VariableRef*
153 return new ThatClass(vb);
159template <
class ItemType,
class DataType>
174template <
class ItemType,
class DataType>
189template <
class ItemType,
class DataType>
204template <
class ItemType,
class DataType>
217template <
class ItemType,
class DataType>
218typename Arcane::MeshVariableArrayRefT<ItemType, DataType>::GroupType
222 return GroupType(this->m_private_part->itemGroup());
228template <
class DataType>
230fill(
const DataType& v)
232 this->
fill(v, this->itemGroup());
238template <
class DataType>
250template <
typename DataType>
254 this->
copy(v, this->itemGroup());
260template <
typename DataType>
272template <
typename DataTypeT>
void
280 impl::copyContiguousData(this->m_private_part->data(), v.m_private_part->
data(), *queue);
286template <
typename DataTypeT>
void
294 impl::fillContiguousData(this->m_private_part->data(), v, *queue);
308template <
class ItemType,
class DataTypeT>
void
312 this->m_private_part->swapValues(*(rhs.m_private_part));
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Execution queue for an accelerator.
IData * data() override
Data associated with the variable.
Type information for a data container.
Characteristics of mesh elements.
static eItemKind kind()
Entity kind.
Array variable on a mesh entity type.
void copy(const ItemVariableArrayRefT< DataType > &v)
Copies the values of v into this variable.
ItemVariableArrayRefT(const VariableBuildInfo &b, eItemKind ik)
Constructs a reference to the variable specified in vb.
ConstArrayType operator[](ItemLocalId item) const
Read-only value of entity item.
ItemVariableArrayRefT< DataType > & operator=(const ItemVariableArrayRefT< DataType > &rhs)
Positions the instance reference to the variable rhs.
void fill(const DataType &value)
Fills the variable with the value value.
Array variable on a mesh entity type.
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.
void refersTo(const MeshVariableArrayRefT< ItemType, DataType > &rhs)
Positions the instance reference to the variable rhs.
MeshVariableArrayRefT(const VariableBuildInfo &b)
Constructs a reference to the variable specified in vb.
void updateFromInternal()
Parameters necessary for building a variable.
Variable factory registrar.
Information characterizing a variable.
Information characterizing the type of a variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eItemKind
Mesh entity type.