14#include "arcane/utils/ScopedPtr.h"
15#include "arcane/utils/ValueChecker.h"
17#include "arcane/BasicUnitTest.h"
18#include "arcane/ItemPrinter.h"
19#include "arcane/IMesh.h"
21#include "arcane/geometric/GeomShapeMng.h"
22#include "arcane/geometric/BarycentricGeomShapeComputer.h"
24#include "arcane/tests/ArcaneTestGlobal.h"
26#include "arcane/tests/GeometricUnitTest_axl.h"
37using namespace Arcane;
44class GeometricUnitTest
45:
public ArcaneGeometricUnitTestObject
54 virtual void initializeTest();
55 virtual void executeTest();
59 geometric::GeomShapeMng m_shape_mng;
63 void _checkCoords(
const CellGroup& cells);
44class GeometricUnitTest {
…};
76: ArcaneGeometricUnitTestObject(sb)
77, m_shape_mng(sb.
mesh())
92void GeometricUnitTest::
96 geometric::GeomShapeView shape_view;
99 m_shape_mng.initShape(shape_view,*icell);
103 for(
Integer z=0; z<nb_node; ++z )
104 if (node_coords[cell.
node(z)] != shape_view.
node(z))
105 throw FatalErrorException(A_FUNCINFO,
"Invalid node coordinates for GeomShape");
112void GeometricUnitTest::
115 ValueChecker vc(A_FUNCINFO);
121 geometric::BarycentricGeomShapeComputer::computeAll(m_shape_mng.mutableShapeView(cell), node_coords, cell);
123 _checkCoords(allCells());
126 geometric::BarycentricGeomShapeComputer::computeAll(m_shape_mng, node_coords, allCells());
127 _checkCoords(allCells());
129 geometric::GeomShapeView shape_view;
132 m_shape_mng.initShape(shape_view, *icell);
133 Cell shape_cell = shape_view.
cell();
136 if (shape_cell != cell)
139 if (cell.
type() == IT_Hexaedron8) {
140 geometric::Hexaedron8Element hex_element(node_coords, cell);
141 for (
int z = 0; z < 8; ++z) {
142 vc.areEqual(hex_element[z], node_coords[cell.
node(z)],
"Node");
144 Real3 to_add(1.0, 2.0, 3.0);
145 geometric::Hexaedron8ElementView view1(hex_element.view());
146 for (
int z = 0; z < 8; ++z) {
147 view1.setValue(z, view1[z] + to_add);
149 for (
int z = 0; z < 8; ++z) {
150 vc.areEqual(hex_element[z], node_coords[cell.
node(z)] + to_add,
"Node2");
159void GeometricUnitTest::
162 m_shape_mng.initialize();
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Service de test de la géométrie.
String typeName() const
Nom du type.
Node node(Int32 i) const
i-ème noeud de l'entité
Int32 nbNode() const
Nombre de noeuds de l'entité
const ItemTypeInfo * typeInfo() const
Infos sur le type de l'entité.
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
Int16 type() const
Type de l'entité
Structure contenant les informations pour créer un service.
const Real3 node(Integer i) const
Position du ième noeud de la forme.
Cell cell() const
Maille associée (null si aucune)
ItemGroupT< Cell > CellGroup
Groupe de mailles.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
Int32 Integer
Type représentant un entier.