Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemRefinement.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* ItemRefinement.cc (C) 2000-2023 */
9/* */
10/* list of methods for manipulating an AMR mesh. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/mesh/ItemRefinement.h"
15
17#include "arcane/utils/Real3.h"
18#include "arcane/utils/ArgumentException.h"
19
20#include "arcane/core/IParallelMng.h"
21
22#include "arcane/core/IMesh.h"
23#include "arcane/core/IMeshModifier.h"
24#include "arcane/core/IItemFamily.h"
25#include "arcane/core/Item.h"
26#include "arcane/core/ItemRefinementPattern.h"
27#include "arcane/core/VariableTypes.h"
28#include "arcane/core/GeometricUtilities.h"
29#include "arcane/core/ItemPrinter.h"
30#include "arcane/core/SharedVariable.h"
31#include "arcane/core/ItemVector.h"
32
33#include <vector>
34#include "arcane/mesh/MeshRefinement.h"
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39namespace Arcane::mesh
40{
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44// \brief only compile these functions if the user requests AMR support
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50const Real ItemRefinement::TOLERENCE = 10.0e-6;
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54// It seems that the calculation of 'cell_hmin' is slightly different (at the level
55// of the epsilon machine) depending on the decomposition and the number of sub-domains.
56// We therefore indicate that the variable 'AMRCellHMin' is dependent on the number
57// of sub-domains to avoid false positives in bit-by-bit comparisons.
58
59// Mesh refinement methods
63, m_mesh(mesh)
64, m_cell_hmin(VariableBuildInfo(mesh, "AMRCellHMin", IVariable::PSubDomainDepend))
65, m_orig_nodes_coords(mesh->nodesCoordinates())
66, m_refine_factor(2)
67, m_nb_cell_to_add(0)
68, m_nb_face_to_add(0)
69, m_nb_node_to_add(0)
70{
71}
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
77{
78 //delete m_irp;
79}
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84Real3 ItemRefinement::
85faceCenter(ItemInternal* iface, SharedVariableNodeReal3& nodes_coords) const
86{
87 Face face(iface);
88 Real3 pfc = Real3::null();
89 for (Node node : face.nodes()) {
90 pfc += nodes_coords[node];
91 }
92 pfc /= static_cast<Real>(face.nbNode());
93 return pfc;
94}
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99void ItemRefinement::
100initHMin()
101{
102 ENUMERATE_CELL (item, m_mesh->allCells()) {
103 Real h_min = 1.e30;
104 for (Integer i = 0; i < item->nbNode(); i++)
105 for (Integer j = i + 1; j < item->nbNode(); j++) {
106 Real3 diff = (m_orig_nodes_coords[item->node(i)] - m_orig_nodes_coords[item->node(j)]);
107 h_min = std::min(h_min, diff.normL2());
108 }
109 m_cell_hmin[item] = h_min;
110 }
111}
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
115
116void ItemRefinement::
117updateChildHMin(ArrayView<ItemInternal*> refine_cells)
118{
119 for (Integer k = 0; k < refine_cells.size(); k++) {
120 Cell parent = refine_cells[k];
121 for (UInt32 i = 0, nc = parent.nbHChildren(); i < nc; i++) {
122 Cell item = parent.hChild(i);
123 Real h_min = 1.e30;
124 for (Integer i = 0; i < item.nbNode(); i++)
125 for (Integer j = i + 1; j < item.nbNode(); j++) {
126 Real3 diff = (m_orig_nodes_coords[item.node(i)] - m_orig_nodes_coords[item.node(j)]);
127 h_min = std::min(h_min, diff.normL2());
128 }
129 m_cell_hmin[item] = h_min;
130 }
131 }
132}
133
134/*---------------------------------------------------------------------------*/
135/*---------------------------------------------------------------------------*/
136
137Real ItemRefinement::
138hmin(Cell item) const
139{
140 Real h_min = 1.e30;
141 for (Integer i = 0; i < item.nbNode(); i++)
142 for (Integer j = i + 1; j < item.nbNode(); j++) {
143 Real3 diff = (m_orig_nodes_coords[item.node(i)] - m_orig_nodes_coords[item.node(j)]);
144 h_min = std::min(h_min, diff.normL2());
145 }
146
147 return h_min;
148}
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153template <int typeID> void ItemRefinement::
154refineOneCell(Cell item, MeshRefinement& mesh_refinement)
155{
156 ItemTypeMng* itm = m_mesh->itemTypeMng();
157 const Int32 nb_hChildren = itm->nbHChildrenByItemType(item.type());
158 const Int32 nb_nodes = item.nbNode();
159 ARCANE_ASSERT((item.itemBase().flags() & ItemFlags::II_Refine), ("Item is not flagged for refinement"));
160 ARCANE_ASSERT((item.isActive()), ("Refine non-active item is forbidden!"));
161
162 debug(Trace::High) << "[refineOneCell] nb_hChildren=" << nb_hChildren;
163 debug(Trace::High) << "[refineOneCell] nb_nodes=" << nb_nodes;
165
166 bool has_hChildren = item.hasHChildren();
167 debug(Trace::Highest) << "[refineOneCell] has_hChildren=" << has_hChildren;
168
169 m_nb_cell_to_add = 0;
170 m_nb_face_to_add = 0;
171 m_nb_node_to_add = 0;
172
173 if (!has_hChildren) {
174 // Creation of children
175 computeHChildren<typeID>(item, mesh_refinement);
176 debug() << "[ItemRefinement::refineOneCell] " << m_nb_cell_to_add << " new cells, "
177 << m_nb_node_to_add << " new nodes & " << m_nb_face_to_add << " faces";
178
179 // Created the nodes and set their coordinates
180 {
181 m_nodes_lid.resize(m_nb_node_to_add);
182 m_mesh->modifier()->addNodes(m_nodes_unique_id, m_nodes_lid);
183 m_mesh->nodeFamily()->endUpdate();
184 NodeInfoListView nodes(m_mesh->nodeFamily());
185 for (Integer i = 0; i < m_nb_node_to_add; ++i) {
186 m_orig_nodes_coords[nodes[m_nodes_lid[i]]] = m_nodes_to_create_coords[i];
187 }
188 }
189
190 // Created the faces
191 {
192 m_faces_lid.resize(m_nb_face_to_add);
193 m_mesh->modifier()->addFaces(m_nb_face_to_add, m_faces_infos, m_faces_lid);
194 }
195
196 // Created the cells
197 {
198 m_cells_lid.resize(m_nb_cell_to_add);
199 m_mesh->modifier()->addHChildrenCells(item, m_nb_cell_to_add, m_cells_infos, m_cells_lid);
201 ItemInfoListView cells(m_mesh->cellFamily());
202 for (Integer i = 0; i < m_nb_cell_to_add; ++i) {
203 Item child = cells[m_cells_lid[i]];
205 }
206 }
207 }
208 else {
209 for (Integer c = 0; c < nb_hChildren; c++) {
210 Cell child = item.hChild(c);
211 //debug() << "[refineOneCell] child #"<<child->localId();
212 ARCANE_ASSERT((child.isSubactive()), ("child must be a sub active item!"));
213 Integer f = child.mutableItemBase().flags();
215 f &= ~ItemFlags::II_Inactive;
216 child.mutableItemBase().setFlags(f);
217 }
218 }
219
220 // Now, unset the refinement flag of the item
221 //debug(Trace::High) << "[refineOneCell] and we flush the flag";
222 Integer f = item.itemBase().flags();
223 f &= ~ItemFlags::II_Refine;
226 item.mutableItemBase().setFlags(f);
227#if defined(ARCANE_DEBUG_ASSERT)
228 for (Integer c = 0; c < nb_hChildren; c++) {
229 Cell hParent = item.hChild(c).hParent();
230 //debug() << "[refineOneCell] child #"<<c;
231 ARCANE_ASSERT((hParent == item), ("parent-child relationship is not consistent"));
232 ARCANE_ASSERT((item.hChild(c).isActive()), ("children must be active"));
233 }
234 ARCANE_ASSERT((item.isAncestor()), ("current item must be an ancestor!"));
235#endif
236}
237
238/*---------------------------------------------------------------------------*/
239/*---------------------------------------------------------------------------*/
241template <int typeID> void ItemRefinement::
243{
246
247 ARCANE_ASSERT((item.itemBase().flags() & ItemFlags::II_CoarsenInactive), ("Item is not for coarsening!"));
248 ARCANE_ASSERT((!item.isActive()), ("Item is active!"));
249 //debug(Trace::High) << "[coarsenOneCell] "<<item_internal->uniqueId();
250 // ATT: We do not delete the children until contraction via MeshRefinement::contract()
251 // re-calculating hanging nodes
252 IParallelMng* pm = m_mesh->parallelMng();
253 const Integer sid = pm->commRank();
254 computeOrigNodesCoords<typeID>(item, rp, sid);
255
256 for (Integer c = 0; c < item.nbHChildren(); c++) {
257 Cell mychild = item.hChild(c);
258 //debug(Trace::High) << "\t[coarsenOneCell] child #"<<c << ' ' << mychild->uniqueId() << " " << mychild->owner();
259
260 if (mychild.owner() != sid)
261 continue;
262 Integer f = mychild.itemBase().flags();
263 ARCANE_ASSERT((f & ItemFlags::II_Coarsen), ("Item is not flagged for coarsening"));
264 f &= ~ItemFlags::II_Coarsen;
266 // f |= ItemFlags::II_NeedRemove; // TODO activate the removal flag
267 mychild.mutableItemBase().setFlags(f);
268 }
269 Integer f = item.itemBase().flags();
270 f &= ~ItemFlags::II_Inactive; // TODO verify if this condition is needed
271 f &= ~ItemFlags::II_CoarsenInactive;
273 //debug(Trace::High) << "[coarsenOneCell] item_internal->flags()="<<f;
274 item.mutableItemBase().setFlags(f);
275
276 ARCANE_ASSERT((item.isActive()), ("item must be active!"));
277 //debug() << "[coarsenOneCell] done";
278}
279
280/*---------------------------------------------------------------------------*/
281/*---------------------------------------------------------------------------*/
282
283template <int typeID> void ItemRefinement::
284computeHChildren(Cell item, MeshRefinement& mesh_refinement)
285{
286 debug(Trace::High) << "[refineOneCell] Computing new coordinates";
287
288 const ItemRefinementPatternT<typeID>& rp = mesh_refinement.getRefinementPattern<typeID>();
289 const Int32 nb_hChildren = rp.getNbHChildren();
290
291 m_p.resize(nb_hChildren);
292 m_nodes_uid.resize(nb_hChildren);
293
294 const Int32 nb_nodes = item.nbNode();
295 m_coord.resize(nb_nodes);
296 for (Integer i = 0; i < nb_nodes; ++i)
297 m_coord[i] = m_orig_nodes_coords[item.node(i)];
298
299 const Integer head_size = 2;
300 m_cells_infos.clear();
301 m_cells_infos.reserve(nb_hChildren * (head_size + nb_nodes));
302 debug(Trace::High) << "[refineOneCell] cells_infos reserved size is " << (nb_hChildren * (head_size + nb_nodes));
303
304 Int64 first_cell_uid = mesh_refinement.getFirstChildNewUid();
305 debug(Trace::Highest) << "[refineOneCell] first_cell_uid=" << first_cell_uid;
306
307 m_faces_infos.clear();
308 m_faces_infos.reserve(m_nb_face_to_add * ((m_mesh->dimension() == 3) ? 6 : (m_mesh->dimension() == 2) ? 4
309 : -1));
310
311 const Real tol = m_cell_hmin[item] * TOLERENCE;
312
313 typedef std::set<Int64> NodesSet;
314 NodesSet nodes_set;
315 Integer nb_cnodes_max_total = 0;
316
317 ItemTypeMng* itm = m_mesh->itemTypeMng();
318 for (Integer c = 0; c < nb_hChildren; c++) {
319 const Integer c_type_id = rp.hChildrenTypeId(c);
320 ItemTypeInfo* c_type = itm->typeFromId(c_type_id);
321
322 const Integer nb_cnodes = c_type->nbLocalNode();
323 nb_cnodes_max_total += nb_cnodes;
324 m_p[c].resize(nb_cnodes);
325 m_nodes_uid[c].resize(nb_cnodes);
326
327 for (Integer nc = 0; nc < nb_cnodes; nc++) {
328 // initialization
329 m_p[c][nc] = Real3::null();
330 m_nodes_uid[c][nc] = NULL_ITEM_ID;
331
332 for (Integer n = 0; n < nb_nodes; n++) {
333 // The value from the refinement matrix
334 const Real em_val = rp.refine_matrix(c, nc, n);
335
336 if (em_val != 0.) {
337 m_p[c][nc] += m_coord[n] * em_val;
338
339 //we were able to find the node, in this case we
340 //will not need to search for it or create it later.
341 if (em_val == 1.) {
342 m_nodes_uid[c][nc] = item.node(n).uniqueId().asInt64();
343 nodes_set.insert(m_nodes_uid[c][nc]);
344 }
345 }
346 }
347
348 // assignment of nodes to children
349 if (m_nodes_uid[c][nc] == NULL_ITEM_ID) {
350 m_nodes_uid[c][nc] = mesh_refinement.findOrAddNodeUid(m_p[c][nc], tol);
351 debug(Trace::Highest) << "\t[refineOneCell] assigning node " << nc << " to l'uid:" << m_nodes_uid[c][nc];
352 }
353 m_nb_node_to_add = m_nb_node_to_add + 1;
354 }
355
356 // Creating cells
357
358 // Info for creating cells
359 // per cell: 1 for its unique id,
360 // 1 for its type,
361 // nb_nodes for the uids of its nodes
362
363 Int64 cell_unique_id = first_cell_uid + c;
364 debug(Trace::Highest) << "[refineOneCell] CELL TYPE:" << c_type_id << ", uid=" << cell_unique_id;
365
366 m_cells_infos.add(c_type_id);
367 m_cells_infos.add(cell_unique_id);
368 for (Integer nc = 0; nc < nb_cnodes; nc++)
369 m_cells_infos.add(m_nodes_uid[c][nc]);
370 m_nb_cell_to_add = m_nb_cell_to_add + 1;
371
372 // Creating faces
373
374 // Info for creating faces
375 // per face: 1 for its unique id,
376 // 1 for its type,
377 // nb_nodes for its nodes
378
379 const Integer nb_cface = c_type->nbLocalFace();
380 debug(Trace::High) << "[refineOneCell] nb faces à créer:" << nb_cface;
381
382 for (Integer f = 0; f < nb_cface; f++) {
383 const Integer nb_node_face = c_type->localFace(f).nbNode();
384 m_face.resize(nb_node_face);
385 Real3 pfc = Real3::null();
386 for (Integer nc = 0; nc < nb_node_face; nc++) {
387 const Integer node_face_rank = c_type->localFace(f).node(nc);
388 m_face[nc] = m_nodes_uid[c][node_face_rank];
389 pfc += m_p[c][node_face_rank];
390 }
391 pfc /= static_cast<Real>(nb_node_face);
392
393 bool is_added = false;
394 Int64 new_face_uid = mesh_refinement.findOrAddFaceUid(pfc, tol, is_added);
395 debug(Trace::Highest) << "\t[refineOneCell] FACE TYPE:" << c_type->localFace(f).typeId();
396 if (is_added) {
397 m_faces_infos.add(c_type->localFace(f).typeId());
398 m_faces_infos.add(new_face_uid);
399 for (Integer nc = 0; nc < nb_node_face; nc++)
400 m_faces_infos.add(m_face[nc]);
401 m_nb_face_to_add = m_nb_face_to_add + 1;
402 }
403 }
404 }
405
406 m_nodes_to_create_coords.clear();
407 m_nodes_to_create_coords.reserve(nb_cnodes_max_total);
408 m_nodes_unique_id.clear();
409 m_nodes_unique_id.reserve(nb_cnodes_max_total);
410
411 Integer node_local_id = 0;
412 debug(Trace::High) << "[refineOneCell] Create nodes and set their coordinates";
413 for (Integer c = 0; c < nb_hChildren; c++) {
414 const Integer c_type_id = rp.hChildrenTypeId(c);
415 ItemTypeInfo* c_type = itm->typeFromId(c_type_id);
416
417 const Int32 nb_cnodes = c_type->nbLocalNode();
418 for (Integer nc = 0; nc < nb_cnodes; nc++) {
419 const Int64 uid = m_nodes_uid[c][nc];
420 if (nodes_set.find(uid) != nodes_set.end())
421 continue;
422 else {
423 nodes_set.insert(uid);
424 m_nodes_to_create_coords.add(m_p[c][nc]);
425 m_nodes_unique_id.add(uid);
426 ++node_local_id;
427 }
428 }
429 }
430 m_nb_node_to_add = node_local_id;
431}
432
433/*---------------------------------------------------------------------------*/
434/*---------------------------------------------------------------------------*/
435
436template <int typeID> void ItemRefinement::
437computeOrigNodesCoords(Cell item, const ItemRefinementPatternT<typeID>& rp, const Integer sid)
438{
439 const Integer nb_nodes = item.nbNode();
440 m_coord.resize(nb_nodes);
441 for (Integer i = 0; i < nb_nodes; ++i)
442 m_coord[i] = m_orig_nodes_coords[item.node(i)];
443
444 for (Integer c = 0; c < item.nbHChildren(); c++) {
445 //debug() << "[coarsenOneCell] child #"<<c;
446 Cell mychild = item.hChild(c);
447 if (mychild.owner() != sid)
448 continue;
449 for (Integer nc = 0; nc < mychild.nbNode(); nc++) {
450 //debug() << "\t[coarsenOneCell] node #"<<nc;
451 Real3 new_pos = Real3::null();
452 bool calculated_new_pos = false;
453
454 for (Integer n = 0; n < nb_nodes; n++) {
455 //debug() << "\t\t[coarsenOneCell] pos #"<<n;
456 // The value from the refinement matrix
457 const Real em_val = rp.refine_matrix(c, nc, n);
458
459 // The node position is somewhere between the existing vertices
460 if ((em_val != 0.) && (em_val != 1.)) {
461 new_pos += em_val * m_coord[n];
462 calculated_new_pos = true;
463 }
464 }
465
466 if (calculated_new_pos)
467 //Move the existing node back to its original position
468 m_orig_nodes_coords[mychild.node(nc)] = new_pos;
469 }
470 }
471}
472
473/*---------------------------------------------------------------------------*/
474/*---------------------------------------------------------------------------*/
475
476#define ARCANE_INSTANTIATE(typeID) \
477 template void ItemRefinement::refineOneCell<typeID>(Cell item_internal, MeshRefinement & mesh_refinement); \
478 template void ItemRefinement::coarsenOneCell<typeID>(Cell item_internal, const ItemRefinementPatternT<typeID>& rp); \
479 template void ItemRefinement::computeHChildren<typeID>(Cell item, MeshRefinement & mesh_refinement); \
480 template void ItemRefinement::computeOrigNodesCoords<typeID>(Cell item, const ItemRefinementPatternT<typeID>& rp, const Integer sid)
481
482ARCANE_INSTANTIATE(IT_Quad4);
483ARCANE_INSTANTIATE(IT_Tetraedron4);
484ARCANE_INSTANTIATE(IT_Pyramid5);
485ARCANE_INSTANTIATE(IT_Pentaedron6);
486ARCANE_INSTANTIATE(IT_Hexaedron8);
487ARCANE_INSTANTIATE(IT_HemiHexa7);
488ARCANE_INSTANTIATE(IT_HemiHexa6);
489ARCANE_INSTANTIATE(IT_HemiHexa5);
490ARCANE_INSTANTIATE(IT_AntiWedgeLeft6);
491ARCANE_INSTANTIATE(IT_AntiWedgeRight6);
492ARCANE_INSTANTIATE(IT_DiTetra5);
493
494/*---------------------------------------------------------------------------*/
495/*---------------------------------------------------------------------------*/
496
497} // End namespace Arcane::mesh
498
499/*---------------------------------------------------------------------------*/
500/*---------------------------------------------------------------------------*/
#define ENUMERATE_CELL(name, group)
Generic enumerator for a cell group.
Declarations of types used in Arcane.
void resize(Int64 s)
Changes the number of elements in the array to s.
void clear()
Removes the elements from the array.
void reserve(Int64 new_capacity)
Reserves memory for new_capacity elements.
Cell of a mesh.
Definition Item.h:1300
Int32 nbHChildren() const
Number of children for AMR.
Definition Item.h:1438
bool isAncestor() const
Definition Item.h:1460
Cell hChild(Int32 i) const
i-th AMR child
Definition Item.h:1441
bool hasHChildren() const
Definition Item.h:1466
bool isActive() const
Definition Item.h:1451
Cell hParent() const
Definition Item.h:1432
Face of a cell.
Definition Item.h:1032
virtual Integer dimension()=0
Mesh dimension (1D, 2D, or 3D).
virtual CellGroup allCells()=0
Group of all cells.
virtual ItemTypeMng * itemTypeMng() const =0
Associated entity type manager.
Interface of the parallelism manager for a subdomain.
virtual Int32 commRank() const =0
Rank of this instance in the communicator.
Interface of a variable.
Definition IVariable.h:40
Int32 flags() const
Flags of the entity.
Flags for entity characteristics.
Definition ItemFlags.h:39
@ II_Inactive
The entity is inactive //COARSEN_INACTIVE,.
Definition ItemFlags.h:80
@ II_Refine
The entity is marked for refinement.
Definition ItemFlags.h:77
@ II_JustAdded
The entity has just been added.
Definition ItemFlags.h:62
@ II_JustRefined
The entity has just been refined.
Definition ItemFlags.h:78
@ II_CoarsenInactive
The entity is inactive and has children tagged for coarsening.
Definition ItemFlags.h:81
@ II_Coarsen
The entity is marked for coarsening.
Definition ItemFlags.h:75
@ II_JustCoarsened
The entity has just been coarsened.
Definition ItemFlags.h:79
View of a list to obtain information about entities.
Internal structure of a mesh entity.
Integer node(Integer i) const
Local index in the cell of the i-th node of the face.
Integer typeId() const
Type of the face entity.
Integer nbNode() const
Number of nodes of the face.
Info on a mesh entity type.
LocalFace localFace(Integer id) const
Local connectivity of the i-th face of the cell.
Integer nbLocalNode() const
Number of nodes of the entity.
Integer nbLocalFace() const
Number of faces of the entity.
Mesh entity type manager.
Definition ItemTypeMng.h:66
static Int32 nbHChildrenByItemType(Integer type)
AMR.
ItemTypeInfo * typeFromId(Integer id) const
Type corresponding to the number id.
Node node(Int32 i) const
i-th node of the entity
Definition Item.h:840
Int32 nbNode() const
Number of nodes of the entity.
Definition Item.h:837
Base class for a mesh element.
Definition Item.h:84
impl::MutableItemBase mutableItemBase() const
Mutable internal part of the entity.
Definition Item.h:394
Int32 owner() const
Owner subdomain number of the entity.
Definition Item.h:252
ItemUniqueId uniqueId() const
Unique identifier across all domains.
Definition Item.h:239
impl::ItemBase itemBase() const
Internal part of the entity.
Definition Item.h:383
Int16 type() const
Entity type.
Definition Item.h:255
void setFlags(Int32 f)
Sets the entity flags.
void addFlags(Int32 added_flags)
Adds the flags added_flags to those of the entity.
View of node information.
Node of a mesh.
Definition Item.h:598
Class managing a 3-dimensional real vector.
Definition Real3.h:132
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flow for a debug message.
ITraceMng * traceMng() const
Trace manager.
Parameters necessary for building a variable.
static const Real TOLERENCE
AMR.
void refineOneCell(Cell item, MeshRefinement &mesh_refinement)
void coarsenOneCell(Cell item, const ItemRefinementPatternT< typeID > &rp)
Implementation of unstructured mesh refinement adaptation algorithms.
Int64 findOrAddFaceUid(const Real3 &face_center, const Real &tol, bool &is_added)
const ItemRefinementPatternT< typeID > & getRefinementPattern() const
Int64 findOrAddNodeUid(const Real3 &p, const Real &tol)
std::uint32_t UInt32
Unsigned integer type of 32 bits.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Quantity at the node of coordinate type.
double Real
Type representing a real number.
@ Cell
The mesh is AMR by cell.
Definition MeshKind.h:53
std::int32_t Int32
Signed integer type of 32 bits.