12#ifndef ARCANE_MESH_MESHREFINEMENT_H
13#define ARCANE_MESH_MESHREFINEMENT_H
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/PerfCounterMng.h"
19#include "arcane/utils/AMRCallBackMng.h"
21#include "arcane/core/ItemRefinementPattern.h"
23#include "arcane/mesh/MeshGlobal.h"
24#include "arcane/mesh/MapCoordToUid.h"
25#include "arcane/mesh/DynamicMeshKindInfos.h"
59#ifdef ACTIVATE_PERF_COUNTER
82 static const std::string m_names[NbCounters];
115 bool needUpdate()
const
117 return m_need_update;
121 m_need_update =
true;
123 void initMeshContainingBox();
164 bool coarsenItems(
const bool maintain_level_one =
true);
188 bool refineItems(
const bool maintain_level_one =
true);
248 void populateBackFrontCellsFromParentFaces(
Cell parent_cell);
328 void _updateItemOwner2();
330 bool _removeGhostChildren();
338 void _updateLocalityMap2();
360 bool _makeFlagParallelConsistent2();
365 template <
int typeID>
367 template <
int typeID>
368 void _populateBackFrontCellsFromChildrenFaces(
Face face,
Cell parent_cell,
371 void _checkOwner(
const String& msg);
412 Byte m_face_level_mismatch_limit;
414 Int64 m_max_node_uid;
415 Int64 m_next_node_uid;
417 Int64 m_max_cell_uid;
418 Int64 m_next_cell_uid;
420 Int64 m_max_face_uid;
421 Int64 m_next_face_uid;
429 const TetraRefinementPattern2Hex_2Penta_2Py_2Tetra m_tetra_refinement_pattern;
430 const PyramidRefinementPattern4Hex_4Py m_pyramid_refinement_pattern;
431 const PrismRefinementPattern4Hex_4Pr m_prism_refinement_pattern;
432 const HexRefinementPattern8Hex m_hex_refinement_pattern;
433 const HemiHex7RefinementPattern6Hex_2HHex7 m_hemihexa7_refinement_pattern;
434 const HemiHex6RefinementPattern4Hex_4HHex7 m_hemihexa6_refinement_pattern;
435 const HemiHex5RefinementPattern2Hex_4Penta_2HHex5 m_hemihexa5_refinement_pattern;
436 const AntiWedgeLeft6RefinementPattern4Hex_4HHex7 m_antiwedgeleft6_refinement_pattern;
437 const AntiWedgeRight6RefinementPattern4Hex_4HHex7 m_antiwedgeright6_refinement_pattern;
438 const DiTetra5RefinementPattern2Hex_6HHex7 m_ditetra5_refinement_pattern;
443#ifdef ACTIVATE_PERF_COUNTER
444 PerfCounterMng<PerfCounter> m_perf_counter;
471 return m_face_level_mismatch_limit;
486 return m_tetra_refinement_pattern;
489inline const ItemRefinementPatternT<IT_Pyramid5>&
492 return m_pyramid_refinement_pattern;
495inline const ItemRefinementPatternT<IT_Pentaedron6>&
498 return m_prism_refinement_pattern;
501inline const ItemRefinementPatternT<IT_Hexaedron8>&
504 return m_hex_refinement_pattern;
507inline const ItemRefinementPatternT<IT_HemiHexa7>&
510 return m_hemihexa7_refinement_pattern;
513inline const ItemRefinementPatternT<IT_HemiHexa6>&
516 return m_hemihexa6_refinement_pattern;
519inline const ItemRefinementPatternT<IT_HemiHexa5>&
522 return m_hemihexa5_refinement_pattern;
525inline const ItemRefinementPatternT<IT_AntiWedgeLeft6>&
528 return m_antiwedgeleft6_refinement_pattern;
531inline const ItemRefinementPatternT<IT_AntiWedgeRight6>&
534 return m_antiwedgeright6_refinement_pattern;
537inline const ItemRefinementPatternT<IT_DiTetra5>&
540 return m_ditetra5_refinement_pattern;
Modifiable view of an array of type T.
Base class for 1D data vectors.
Interface of a functor with argument.
Class managing a 3-dimensional real vector.
Unicode character string.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Implementation of a mesh.
bool _checkUnflagged(bool arcane_assert_yes=false)
MeshRefinement(DynamicMesh *mesh)
bool m_coarsen_by_parents
AMRCallBackMng * m_call_back_mng
void populateBackFrontCellsFromChildrenFaces(Cell parent_cell)
const Quad4RefinementPattern4Quad m_quad4_refinement_pattern
bool coarsenItemsV2(bool update_parent_flag)
Method allowing the removal of cells marked with the flag "II_Coarsen".
bool refineAndCoarsenItems(const bool maintain_level_one=true)
bool refineItems(const bool maintain_level_one=true)
void flagItems(const Int32Array &flag_per_cell, const Integer max_level=-1)
unsigned char & faceLevelMismatchLimit()
const IMesh * getMesh() const
Constant reference to the mesh.
bool & coarsenByParents()
void uniformlyCoarsen(Integer n=1)
Int64 findOrAddFaceUid(const Real3 &face_center, const Real &tol, bool &is_added)
MapCoordToUid::Box m_mesh_containing_box
ParallelAMRConsistency * m_parallel_amr_consistency
bool _makeCoarseningCompatible(const bool)
void _updateLocalityMap()
Int64 getFirstChildNewUid()
const ItemRefinementPatternT< typeID > & getRefinementPattern() const
bool _makeRefinementCompatible(const bool)
void _upscaleData(Array< ItemInternal * > &parent_cells)
Upscaling of data on the parent cells.
ItemRefinement * m_item_refinement
bool _makeFlagParallelConsistent()
Int64 findOrAddNodeUid(const Real3 &p, const Real &tol)
bool _checkLevelOne(bool arcane_assert_yes=false)
void uniformlyRefine(Integer n=1)
void _cleanRefinementFlags()
bool coarsenItems(const bool maintain_level_one=true)
void _populateBackFrontCellsFromParentFaces(Cell parent_cell)
void _interpolateData(const Int64Array &cells_to_refine)
Interpolation of data on the child cells.
virtual void flagCellToRefine(Int32ConstArrayView cells_lids)
Passing the error committed by the cell to the refinement flag.
bool _refineItems(Int64Array &cells_to_refine)
MeshVariableScalarRefT< Node, Int32 > VariableNodeInt32
Quantity at the node of 32-bit integer type.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Array< Int64 > Int64Array
Dynamic one-dimensional array of 64-bit integers.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
double Real
Type representing a real number.
unsigned char Byte
Type of a byte.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.