14#include "arcane/core/materials/IMeshMaterialVariable.h"
16#include "arcane/utils/FatalErrorException.h"
18#include "arcane/core/materials/IScalarMeshMaterialVariable.h"
19#include "arcane/core/materials/IArrayMeshMaterialVariable.h"
20#include "arcane/core/materials/MaterialVariableTypeInfo.h"
21#include "arcane/core/materials/MaterialVariableBuildInfo.h"
22#include "arcane/core/materials/IMeshMaterialMng.h"
23#include "arcane/core/materials/IMeshMaterialVariableFactoryMng.h"
25#include "arcane/core/VariableDataTypeTraits.h"
26#include "arcane/core/IVariable.h"
41 using ItemType =
typename TrueType::ItemTypeType;
42 using DataType =
typename TrueType::DataTypeType;
43 int dim = TrueType::dimension();
45 eDataType dt = VariableDataTypeTraitsT<DataType>::type();
58template <
typename TrueType> TrueType*
77 auto* true_var =
dynamic_cast<TrueType*
>(var);
91template <
typename TrueType>
TrueType*
96 auto* true_var =
dynamic_cast<TrueType*
>(var);
105#define ARCANE_INSTANTIATE_MAT(type) \
106 template class ARCANE_TEMPLATE_EXPORT MeshMaterialVariableBuildTraits<IScalarMeshMaterialVariable<Cell, type>>; \
107 template class ARCANE_TEMPLATE_EXPORT MeshMaterialVariableBuildTraits<IArrayMeshMaterialVariable<Cell, type>>
109ARCANE_INSTANTIATE_MAT(
Byte);
110ARCANE_INSTANTIATE_MAT(
Int8);
111ARCANE_INSTANTIATE_MAT(
Int16);
112ARCANE_INSTANTIATE_MAT(
Int32);
113ARCANE_INSTANTIATE_MAT(
Int64);
115ARCANE_INSTANTIATE_MAT(
Float16);
116ARCANE_INSTANTIATE_MAT(
Float32);
117ARCANE_INSTANTIATE_MAT(
Real);
118ARCANE_INSTANTIATE_MAT(
Real2);
119ARCANE_INSTANTIATE_MAT(
Real3);
120ARCANE_INSTANTIATE_MAT(
Real2x2);
121ARCANE_INSTANTIATE_MAT(
Real3x3);
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Half-precision floating-point type.
virtual String fullName() const =0
Full variable name (with family prefix).
static eItemKind kind()
Entity kind.
Interface for the material and environment manager of a mesh.
virtual IMeshMaterialVariableFactoryMng * variableFactoryMng() const =0
Interface of the variable factory.
static IMeshMaterialMng * getReference(const MeshHandleOrMesh &mesh_handle, bool create=true)
Retrieves or creates the reference associated with mesh.
virtual IMeshMaterialVariable * createVariable(const String &storage_type, const MaterialVariableBuildInfo &build_info)=0
Creates a material variable.
Interface of a material variable on a mesh.
virtual IVariable * globalVariable() const =0
Associated global variable on the mesh.
Information characterizing the type of a material variable.
String fullName() const
Full name of the variable type.
static TrueType * getVariableReference(const MaterialVariableBuildInfo &v, MatVarSpace mvs)
Returns a variable associated with a constituent.
bool isNull() const
Indicates if the handle is null (it does not reference any existing mesh or not).
Class managing a 2-dimensional real vector.
Class managing a 2x2 matrix of reals.
Class managing a 3-dimensional real vector.
Class managing a 3x3 real matrix.
Always enables tracing in Arcane parts concerning materials.
MatVarSpace
Definition space for a material variable.
std::int8_t Int8
Signed integer type of 8 bits.
std::int64_t Int64
Signed integer type of 64 bits.
eItemKind
Mesh entity type.
std::int16_t Int16
Signed integer type of 16 bits.
double Real
Type representing a real number.
unsigned char Byte
Type of a byte.
float Float32
IEEE-753 single-precision floating-point type.
std::int32_t Int32
Signed integer type of 32 bits.