Arcane  v3.16.3.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshMaterialTesterModule.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MeshMaterialTesterModule.h (C) 2000-2025 */
9/* */
10/* Module de test du gestionnaire des matériaux. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_TESTS_MESHMATERIALTESTERMODULE_H
13#define ARCANE_TESTS_MESHMATERIALTESTERMODULE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#define ARCANE_TRACE_ENUMERATOR
18
19#include "arcane/core/IUnitTest.h"
22
23#include "arcane/tests/IMaterialEquationOfState.h"
24#include "arcane/tests/MeshMaterialTester_axl.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace ArcaneTest
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35using namespace Arcane;
36using namespace Arcane::Materials;
37using namespace Arcane::Accelerator;
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
43{
44 public:
45
46 typedef CellMaterialVariableScalarRef<Byte> VariableByteType;
47 typedef CellMaterialVariableScalarRef<Real> VariableRealType;
48 typedef CellMaterialVariableScalarRef<Int64> VariableInt64Type;
49 typedef CellMaterialVariableScalarRef<Int32> VariableInt32Type;
50 typedef CellMaterialVariableScalarRef<Int16> VariableInt16Type;
51 typedef CellMaterialVariableScalarRef<Int8> VariableInt8Type;
52 typedef CellMaterialVariableScalarRef<BFloat16> VariableBFloat16Type;
53 typedef CellMaterialVariableScalarRef<Float16> VariableFloat16Type;
54 typedef CellMaterialVariableScalarRef<Float32> VariableFloat32Type;
55 typedef CellMaterialVariableScalarRef<Real3> VariableReal3Type;
56 typedef CellMaterialVariableScalarRef<Real3x3> VariableReal3x3Type;
57 typedef CellMaterialVariableScalarRef<Real2> VariableReal2Type;
58 typedef CellMaterialVariableScalarRef<Real2x2> VariableReal2x2Type;
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
66class MeshMaterialTesterModule
67: public ArcaneMeshMaterialTesterObject
68{
69 public:
70
71 explicit MeshMaterialTesterModule(const ModuleBuildInfo& mbi);
72 ~MeshMaterialTesterModule();
73
74 public:
75
76 static void staticInitialize(ISubDomain* sd);
77
78 public:
79
80 void buildInit() override;
81 void compute() override;
82 void startInit() override;
83 void continueInit() override;
84
85 private:
86
87 IMeshMaterialMng* m_material_mng = nullptr;
88 VariableCellReal m_density;
89 VariableCellReal m_pressure;
90 MaterialVariableCellReal m_mat_density2;
93 VariableCellInt32 m_present_material;
94 MaterialVariableCellInt32 m_mat_int32;
97 VariableScalarInt64 m_nb_starting_cell; //<! Nombre de mailles au démarrage
98 IMeshMaterial* m_mat1 = nullptr;
99 IMeshMaterial* m_mat2 = nullptr;
100 IMeshBlock* m_block1 = nullptr;
101 UniqueArray<VariableCellReal*> m_density_post_processing;
104 // Si non nul, indique qu'il faut vérifier les valeurs spectrales,
105 // car on a fait un re-partitionnement
106 Integer m_check_spectral_values_iteration = 0;
107
108 private:
109
110 void _computeDensity();
111 void _fillDensity(IMeshMaterial* mat, VariableCellReal& tmp_cell_mat_density,
112 VariableNodeReal& tmp_node_mat_density,
113 Int32Array& mat_to_add_array, Int32Array& mat_to_remove_array,
114 bool is_compute_mat);
115 void _copyPartialToGlobal(IMeshMaterial* mat, VariableCellReal& global_density,
116 MaterialVariableCellReal& partial_variable);
117 void _checkCreation();
118 void _checkCreation2(Integer a, Integer n);
119 void _checkTemporaryVectors(const CellGroup& test_group);
120 void _checkSubViews(const CellGroup& test_group);
121 void _dumpAverageValues();
122 void _dumpNoDumpRealValues();
123 void _checkRunQueues();
124
125 void _computeMaterialDepend(IMeshMaterial* mat);
126 void _setDependencies();
127 void _doDependencies();
128 Integer _checkParallelMatItem(MatItemVectorView view, MaterialVariableCellInt64& var);
130 Integer _fillTestVar(IMeshMaterial* mat, MaterialVariableCellInt64& var);
131 void _subViewFunctor(ComponentItemVectorView view);
132 void _checkEqual(Integer expected_value, Integer value);
133 template <typename ContainerType> void applyGeneric(const ContainerType& container, MaterialVariableCellReal& var, Real value);
134 void _checkFillArrayFromTo(IMeshMaterial* mat, MaterialVariableCellReal& var);
135 void _checkArrayVariableSynchronize();
136 void _setOrCheckSpectralValues(Int64 iteration, bool is_check);
137 template <typename VarType1, typename VarType2, typename VarType3> void
138 _setOrCheckSpectralValues2(VarType1& var_real, VarType2& var_int32,
139 VarType3& var_scalar_int32, Int64 iteration, bool is_check);
140 void _checkFillPartialValues();
141 void _doSimd();
142 template <typename VarType> void _checkFillPartialValuesHelper(VarType& mat_var);
143 template <typename VarType>
144 void _checkFillPartialValuesWithGlobal(const VarType& var_type, MeshComponentList components);
145 template <typename VarType> void
146 _checkFillPartialValuesWithSuper(const VarType& var_type, MeshComponentList components);
147 template <typename VarType> void
148 _fillVar(VarType& var_type, Real base_value);
149 template <typename VectorType> void
150 _checkVectorCopy(VectorType& var_type);
152 void _initUnitTest();
153 void _applyEos(bool is_init);
154 void _testDumpProperties();
155 void _checkNullComponentItem();
156};
157
158/*---------------------------------------------------------------------------*/
159/*---------------------------------------------------------------------------*/
160
161} // namespace ArcaneTest
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
165
166#endif
void _applyEos(bool is_init)
Appelle le service d'EOS s'il est disponible.
MaterialVariableCellReal m_mat_nodump_real
Variable pour tester la bonne prise en compte du PNoDump.
void _checkCreation()
Test la création à la volée des variables, avec multi-threading.
MaterialVariableCellReal m_mat_not_used_real
Variable pour tester la bonne prise en compte de setUsed(false)
void _fillDensity(IMeshMaterial *mat, VariableCellReal &tmp_cell_mat_density, VariableNodeReal &tmp_node_mat_density, Int32Array &mat_to_add_array, Int32Array &mat_to_remove_array, bool is_compute_mat)
void _testComponentPart(IMeshMaterial *mat, IMeshEnvironment *env)
Teste les itérateurs par partie.
IMeshPartitioner * m_mesh_partitioner
Partitioner en cas d'équilibrage. Est géré par une option du JDD.
Interface d'un partitionneur de maillage.
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
Variable scalaire sur les mailles d'un matériau du maillage. Pour l'instant, cette classe n'est insta...
Vue sur un vecteur sur les entités d'un composant.
Interface d'un bloc d'un maillage.
Interface du gestionnaire des matériaux et des milieux d'un maillage.
Interface d'un matériau d'un maillage.
Vue sur un vecteur sur les entités d'un matériau.
Informations pour construire un module.
Vecteur 1D de données avec sémantique par valeur (style STL).
ItemGroupT< Cell > CellGroup
Groupe de mailles.
Definition ItemTypes.h:183
MeshVariableScalarRefT< Cell, Real > VariableCellReal
Grandeur au centre des mailles de type réel.
MeshVariableScalarRefT< Node, Real > VariableNodeReal
Grandeur au noeud de type réel.
MeshVariableScalarRefT< Cell, Int32 > VariableCellInt32
Grandeur au centre des mailles de type entier 32 bits.
VariableRefScalarT< Int64 > VariableScalarInt64
Variable scalaire de type entier 64 bits.
Espace de nom pour l'utilisation des accélérateurs.
Active toujours les traces dans les parties Arcane concernant les matériaux.
ConstArrayView< IMeshComponent * > MeshComponentList
Liste de composants multi-matériaux du maillage.
CellMaterialVariableScalarRef< Int64 > MaterialVariableCellInt64
Variable matériau de type Int64
CellMaterialVariableScalarRef< Real > MaterialVariableCellReal
Variable matériau de type Real
CellMaterialVariableScalarRef< Int32 > MaterialVariableCellInt32
Variable matériau de type Int32
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
double Real
Type représentant un réel.
Array< Int32 > Int32Array
Tableau dynamique à une dimension d'entiers 32 bits.
Definition UtilsTypes.h:214