Arcane  v3.16.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
CartesianMeshTestUtils.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* CartesianMeshTestUtils.cc (C) 2000-2023 */
9/* */
10/* Fonctions utilitaires pour les tests de 'CartesianMesh'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CEA_TESTS_CARTESIANMESHTESTUTILS_H
13#define ARCANE_CEA_TESTS_CARTESIANMESHTESTUTILS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/ArcaneTypes.h"
19#include "arcane/VariableTypes.h"
20
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28class ICartesianMesh;
29}
30
31namespace ArcaneTest
32{
33using namespace Arcane;
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
40class CartesianMeshTestUtils
41: public TraceAccessor
42{
43 public:
44
45 explicit CartesianMeshTestUtils(ICartesianMesh* cm, Accelerator::IAcceleratorMng* am);
46 ~CartesianMeshTestUtils();
47
48 public:
49
50 void testAll(bool is_amr);
51
52 public:
53
54 void checkSameId(Face item, FaceLocalId local_id) { _checkSameId(item, local_id); }
55 void checkSameId(Cell item, CellLocalId local_id) { _checkSameId(item, local_id); }
56 void checkSameId(Node item,NodeLocalId local_id) { _checkSameId(item,local_id); }
57 void setNbPrint(Int32 v) { m_nb_print = v; }
58
59 private:
60
61 ICartesianMesh* m_cartesian_mesh = nullptr;
62 IMesh* m_mesh = nullptr;
63 Accelerator::IAcceleratorMng* m_accelerator_mng = nullptr;
64 VariableCellReal3 m_cell_center;
65 VariableFaceReal3 m_face_center;
66 VariableNodeReal m_node_density;
67 Int32 m_nb_print = 100;
68 bool m_is_amr = false;
69
70 private:
71
72 void _testDirCell();
73 void _testDirFace();
74 void _testDirFaceAccelerator();
75 void _testDirNode();
76 void _testDirCellNode();
77 void _testDirCellFace();
78 void _testDirFace(int idir);
79 void _testNodeToCellConnectivity2D();
80 void _testCellToNodeConnectivity2D();
81 void _testNodeToCellConnectivity3D();
82 void _testCellToNodeConnectivity3D();
83 void _computeCenters();
84 void _checkItemGroupIsSorted(const ItemGroup& group);
85
86 private:
87
88 void _sample(ICartesianMesh* cartesian_mesh);
89 void _checkSameId(FaceLocalId item, FaceLocalId local_id);
90 void _checkSameId(CellLocalId item, CellLocalId local_id);
91 void _checkSameId(NodeLocalId item, NodeLocalId local_id);
92 void _saveSVG();
93
94 public:
95
98 void _testDirFaceAccelerator(int idir);
99 void _testDirCellNodeAccelerator();
100 void _testDirNodeAccelerator();
101 void _testDirCellFaceAccelerator();
102 void _testNodeToCellConnectivity3DAccelerator();
103 void _testCellToNodeConnectivity3DAccelerator();
104 void _testConnectivityByDirection();
105 template<typename ItemType> void
106 _testConnectivityByDirectionHelper(const ItemGroup& group);
107};
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112} // End namespace ArcaneTest
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117#endif
118
void _sample(ICartesianMesh *cartesian_mesh)
void _testDirCellAccelerator()
Méthodes publiques car accessibles sur accélérateur.
Interface du gestionnaire des accélérateurs.
Maille d'un maillage.
Definition Item.h:1191
Face d'une maille.
Definition Item.h:944
Interface d'un maillage cartésien.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Noeud d'un maillage.
Definition Item.h:573
TraceAccessor(ITraceMng *m)
Construit un accesseur via le gestionnaire de trace m.
MeshVariableScalarRefT< Node, Real > VariableNodeReal
Grandeur au noeud de type réel.
MeshVariableScalarRefT< Cell, Real3 > VariableCellReal3
Grandeur au centre des mailles de type coordonnées.
MeshVariableScalarRefT< Face, Real3 > VariableFaceReal3
Grandeur aux faces de type coordonnées.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int32_t Int32
Type entier signé sur 32 bits.