Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::mesh::MeshRefinement Class Reference

Implementation of unstructured mesh refinement adaptation algorithms. More...

#include <arcane/mesh/MeshRefinement.h>

Inheritance diagram for Arcane::mesh::MeshRefinement:
Collaboration diagram for Arcane::mesh::MeshRefinement:

Public Member Functions

 MeshRefinement (DynamicMesh *mesh)
 ~MeshRefinement ()
void clear ()
void init ()
void update ()
bool needUpdate () const
void invalidate ()
void initMeshContainingBox ()
void flagItems (const Int32Array &flag_per_cell, const Integer max_level=-1)
virtual void flagCellToRefine (Int32ConstArrayView cells_lids)
 Passing the error committed by the cell to the refinement flag.
virtual void flagCellToCoarsen (Int32ConstArrayView cells_lids)
bool refineAndCoarsenItems (const bool maintain_level_one=true)
bool coarsenItems (const bool maintain_level_one=true)
bool coarsenItemsV2 (bool update_parent_flag)
 Method allowing the removal of cells marked with the flag "II_Coarsen".
bool refineItems (const bool maintain_level_one=true)
void uniformlyRefine (Integer n=1)
void uniformlyCoarsen (Integer n=1)
IntegermaxLevel ()
const IMeshgetMesh () const
 Constant reference to the mesh.
IMeshgetMesh ()
 Reference to the mesh.
void registerCallBack (IAMRTransportFunctor *f)
void unRegisterCallBack (IAMRTransportFunctor *f)
Int64 findOrAddNodeUid (const Real3 &p, const Real &tol)
Int64 findOrAddFaceUid (const Real3 &face_center, const Real &tol, bool &is_added)
Int64 getFirstChildNewUid ()
void _update (ArrayView< ItemInternal * > cells_to_refine)
void _update (ArrayView< Int64 > cells_to_refine)
void _invalidate (ArrayView< ItemInternal * > cells_to_coarsen)
void _updateMaxUid (ArrayView< ItemInternal * > cells_to_refine)
template<int typeID>
const ItemRefinementPatternT< typeID > & getRefinementPattern () const
void populateBackFrontCellsFromChildrenFaces (Cell parent_cell)
void populateBackFrontCellsFromParentFaces (Cell parent_cell)
template<>
const ItemRefinementPatternT< IT_Quad4 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_Tetraedron4 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_Pyramid5 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_Pentaedron6 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_Hexaedron8 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_HemiHexa7 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_HemiHexa6 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_HemiHexa5 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_AntiWedgeLeft6 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_AntiWedgeRight6 > & getRefinementPattern () const
template<>
const ItemRefinementPatternT< IT_DiTetra5 > & getRefinementPattern () const
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Member Functions

 MeshRefinement (const MeshRefinement &)
MeshRefinementoperator= (const MeshRefinement &)
bool _checkLevelOne (bool arcane_assert_yes=false)
bool _checkUnflagged (bool arcane_assert_yes=false)
bool & coarsenByParents ()
unsigned char & faceLevelMismatchLimit ()
bool _contract ()
void _interpolateData (const Int64Array &cells_to_refine)
 Interpolation of data on the child cells.
void _upscaleData (Array< ItemInternal * > &parent_cells)
 Upscaling of data on the parent cells.
bool _coarsenItems ()
bool _refineItems (Int64Array &cells_to_refine)
void _updateItemOwner (Int32ArrayView cell_to_remove)
void _updateItemOwner2 ()
bool _removeGhostChildren ()
void _updateLocalityMap ()
void _updateLocalityMap2 ()
void _cleanRefinementFlags ()
bool _makeCoarseningCompatible (const bool)
bool _makeRefinementCompatible (const bool)
bool _makeFlagParallelConsistent ()
bool _makeFlagParallelConsistent2 ()
template<int typeID>
void _populateBackFrontCellsFromParentFaces (Cell parent_cell)
template<int typeID>
void _populateBackFrontCellsFromChildrenFaces (Face face, Cell parent_cell, Cell neighbor_cell)
void _checkOwner (const String &msg)

Private Attributes

DynamicMeshm_mesh
FaceFamilym_face_family
bool m_need_update
MapCoordToUid::Box m_mesh_containing_box
NodeMapCoordToUid m_node_finder
FaceMapCoordToUid m_face_finder
ItemRefinementm_item_refinement
ParallelAMRConsistencym_parallel_amr_consistency
AMRCallBackMngm_call_back_mng
bool m_coarsen_by_parents
Integer m_max_level
Integer m_nb_cell_target
Byte m_face_level_mismatch_limit
Int64 m_max_node_uid
Int64 m_next_node_uid
Int64 m_max_cell_uid
Int64 m_next_cell_uid
Int64 m_max_face_uid
Int64 m_next_face_uid
Integer m_max_nb_hChildren
const Quad4RefinementPattern4Quad m_quad4_refinement_pattern
const TetraRefinementPattern2Hex_2Penta_2Py_2Tetra m_tetra_refinement_pattern
const PyramidRefinementPattern4Hex_4Py m_pyramid_refinement_pattern
const PrismRefinementPattern4Hex_4Pr m_prism_refinement_pattern
const HexRefinementPattern8Hex m_hex_refinement_pattern
const HemiHex7RefinementPattern6Hex_2HHex7 m_hemihexa7_refinement_pattern
const HemiHex6RefinementPattern4Hex_4HHex7 m_hemihexa6_refinement_pattern
const HemiHex5RefinementPattern2Hex_4Penta_2HHex5 m_hemihexa5_refinement_pattern
const AntiWedgeLeft6RefinementPattern4Hex_4HHex7 m_antiwedgeleft6_refinement_pattern
const AntiWedgeRight6RefinementPattern4Hex_4HHex7 m_antiwedgeright6_refinement_pattern
const DiTetra5RefinementPattern2Hex_6HHex7 m_ditetra5_refinement_pattern
VariableNodeInt32 m_node_owner_memory

Additional Inherited Members

Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Implementation of unstructured mesh refinement adaptation algorithms.

Definition at line 54 of file MeshRefinement.h.

Constructor & Destructor Documentation

◆ MeshRefinement()

Arcane::mesh::MeshRefinement::MeshRefinement ( DynamicMesh * mesh)

Constructor.

Definition at line 99 of file MeshRefinement.cc.

References ENUMERATE_NODE, m_call_back_mng, m_coarsen_by_parents, m_item_refinement, m_mesh, m_parallel_amr_consistency, Arcane::TraceAccessor::TraceAccessor(), and Arcane::TraceAccessor::traceMng().

Referenced by getMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MeshRefinement()

Arcane::mesh::MeshRefinement::~MeshRefinement ( )

Destructor.

Definition at line 136 of file MeshRefinement.cc.

References clear(), m_call_back_mng, m_item_refinement, and m_parallel_amr_consistency.

Here is the call graph for this function:

Member Function Documentation

◆ _checkLevelOne()

bool Arcane::mesh::MeshRefinement::_checkLevelOne ( bool arcane_assert_yes = false)
private

Returns true if and only if the mesh satisfies the level-one rule. Returns false otherwise. Stops execution if arcane_assert_yes is true and if the mesh does not satisfy the level-one rule

Definition at line 956 of file MeshRefinement.cc.

References ENUMERATE_CELL, Arcane::Cell::faces(), Arcane::Cell::isActive(), Arcane::Cell::level(), m_mesh, Arcane::Item::null(), Arcane::Item::owner(), and Arcane::MessagePassing::ReduceMax.

Referenced by coarsenItems(), refineAndCoarsenItems(), and refineItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _checkOwner()

void Arcane::mesh::MeshRefinement::_checkOwner ( const String & msg)
private

Definition at line 2383 of file MeshRefinement.cc.

◆ _checkUnflagged()

bool Arcane::mesh::MeshRefinement::_checkUnflagged ( bool arcane_assert_yes = false)
private

Returns true if and only if the mesh has no items flagged for coarsening or refinement Returns false otherwise Stops execution if arcane_assert_yes is true and if the mesh has flagged items

Definition at line 999 of file MeshRefinement.cc.

References ENUMERATE_CELL, Arcane::ItemBase::flags(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_Refine, Arcane::Item::itemBase(), m_mesh, and Arcane::MessagePassing::ReduceMax.

Here is the call graph for this function:

◆ _cleanRefinementFlags()

void Arcane::mesh::MeshRefinement::_cleanRefinementFlags ( )
private

Sets the refinement flag to II_DoNothing for every item in the mesh.

Definition at line 1781 of file MeshRefinement.cc.

References ENUMERATE_CELL, Arcane::ItemFlags::II_CoarsenInactive, Arcane::ItemFlags::II_DoNothing, Arcane::ItemFlags::II_Inactive, Arcane::ItemFlags::II_JustAdded, Arcane::ItemFlags::II_JustCoarsened, Arcane::ItemFlags::II_JustRefined, Arcane::Cell::isActive(), m_mesh, and Arcane::Item::mutableItemBase().

Referenced by coarsenItems(), coarsenItemsV2(), refineAndCoarsenItems(), refineItems(), uniformlyCoarsen(), and uniformlyRefine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _coarsenItems()

bool Arcane::mesh::MeshRefinement::_coarsenItems ( )
private

Coarsens the items requested by the user. The two methods _coarsenItems() and _refineItems() are not in the public interface of MeshRefinement. Because appropriate preparation (makeRefinementCompatible, makeCoarseningCompatible) is necessary to execute _coarsenItems().

It is possible that for a given set of flags there is no actual change when calling this function. Consequently, it returns true if the mesh has actually changed (in which case the data must be projected) false otherwise.

Definition at line 1565 of file MeshRefinement.cc.

References ARCANE_FATAL, Arcane::TraceAccessor::debug(), ENUMERATE_CELL, Arcane::ItemBase::flags(), getRefinementPattern(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_CoarsenInactive, Arcane::Cell::isActive(), Arcane::Item::itemBase(), Arcane::Cell::level(), m_item_refinement, m_mesh, Arcane::MessagePassing::ReduceMax, and Arcane::Item::type().

Referenced by coarsenItems(), refineAndCoarsenItems(), and uniformlyCoarsen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _contract()

bool Arcane::mesh::MeshRefinement::_contract ( )
private

Removes inactive children from the mesh Contracts an active item, i.e. deletes the pointers to each inactive child. This should only be called after variable restriction on the parents

Definition at line 1824 of file MeshRefinement.cc.

References _upscaleData(), Arcane::Array< T >::add(), Arcane::arcaneCheckArraySize(), Arcane::arcaneIsDebug(), Arcane::mesh::ItemInternalMap::eachItem(), Arcane::ItemBase::flags(), Arcane::ItemFlags::II_JustCoarsened, Arcane::ItemBase::isActive(), Arcane::ItemBase::isAncestor(), Arcane::ItemBase::isOwn(), Arcane::ItemBase::isSubactive(), Arcane::ItemBase::isSuppressed(), Arcane::ItemBase::localId(), m_mesh, Arcane::ItemBase::nbHChildren(), Arcane::ItemBase::nbHParent(), populateBackFrontCellsFromChildrenFaces(), and Arcane::AbstractArray< T >::size().

Referenced by coarsenItems(), and refineAndCoarsenItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _interpolateData()

void Arcane::mesh::MeshRefinement::_interpolateData ( const Int64Array & cells_to_refine)
private

Interpolation of data on the child cells.

Definition at line 1929 of file MeshRefinement.cc.

References Arcane::Array< T >::constView(), m_call_back_mng, m_mesh, Arcane::AbstractArray< T >::size(), and Arcane::Array< T >::view().

Referenced by refineAndCoarsenItems(), and refineItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _invalidate()

void Arcane::mesh::MeshRefinement::_invalidate ( ArrayView< ItemInternal * > cells_to_coarsen)

Definition at line 1977 of file MeshRefinement.cc.

◆ _makeCoarseningCompatible()

bool Arcane::mesh::MeshRefinement::_makeCoarseningCompatible ( const bool maintain_level_one)
private

Acts on the coarsening flags so that the level-one rule is satisfied.

Definition at line 1180 of file MeshRefinement.cc.

References Arcane::MutableItemBase::addFlags(), Arcane::TraceAccessor::debug(), ENUMERATE_CELL, Arcane::Cell::faces(), Arcane::ItemBase::flags(), Arcane::Cell::hasHChildren(), Arcane::Cell::hChild(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_CoarsenInactive, Arcane::ItemFlags::II_DoNothing, Arcane::ItemFlags::II_Inactive, Arcane::ItemFlags::II_Refine, Arcane::Cell::isActive(), Arcane::Cell::isAncestor(), Arcane::Item::itemBase(), Arcane::Cell::level(), m_mesh, Arcane::Item::mutableItemBase(), Arcane::Cell::nbHChildren(), Arcane::Item::owner(), Arcane::MessagePassing::ReduceMin, Arcane::MutableItemBase::setFlags(), and Arcane::TraceAccessor::warning().

Referenced by coarsenItems(), and refineAndCoarsenItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _makeFlagParallelConsistent()

bool Arcane::mesh::MeshRefinement::_makeFlagParallelConsistent ( )
private

Copies refinement flags onto boundary items from their owner processors. Returns true if a flag has changed.

Definition at line 1029 of file MeshRefinement.cc.

References Arcane::Array< T >::add(), Arcane::Cell, Arcane::TraceAccessor::debug(), ENUMERATE_CELL, Arcane::ItemBase::flags(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_JustCoarsened, Arcane::ItemFlags::II_JustRefined, Arcane::ItemFlags::II_Refine, Arcane::Item::isOwn(), Arcane::Item::itemBase(), m_mesh, Arcane::Item::mutableItemBase(), Arcane::MessagePassing::ReduceMin, Arcane::Array< T >::reserve(), Arcane::MutableItemBase::setFlags(), and Arcane::AbstractArray< T >::size().

Referenced by coarsenItems(), refineAndCoarsenItems(), and refineItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _makeFlagParallelConsistent2()

bool Arcane::mesh::MeshRefinement::_makeFlagParallelConsistent2 ( )
private

Definition at line 1114 of file MeshRefinement.cc.

◆ _makeRefinementCompatible()

bool Arcane::mesh::MeshRefinement::_makeRefinementCompatible ( const bool maintain_level_one)
private

Acts on the refinement flags so that the level-one rule is satisfied.

Definition at line 1416 of file MeshRefinement.cc.

References Arcane::MutableItemBase::addFlags(), Arcane::TraceAccessor::debug(), ENUMERATE_CELL, Arcane::Cell::faces(), Arcane::TraceAccessor::fatal(), Arcane::ItemBase::flags(), Arcane::Cell::hParent(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_DoNothing, Arcane::ItemFlags::II_Inactive, Arcane::ItemFlags::II_Refine, Arcane::ItemFlags::II_UserMark1, Arcane::Cell::isActive(), Arcane::Item::itemBase(), Arcane::Cell::level(), m_mesh, Arcane::Item::mutableItemBase(), Arcane::Cell::nbHParent(), Arcane::Item::owner(), Arcane::MessagePassing::ReduceMin, Arcane::MutableItemBase::setFlags(), and Arcane::TraceAccessor::warning().

Referenced by refineAndCoarsenItems(), and refineItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _populateBackFrontCellsFromChildrenFaces()

template<int typeID>
void Arcane::mesh::MeshRefinement::_populateBackFrontCellsFromChildrenFaces ( Face face,
Cell parent_cell,
Cell neighbor_cell )
private

Definition at line 2351 of file MeshRefinement.cc.

◆ _populateBackFrontCellsFromParentFaces()

template<int typeID>
void Arcane::mesh::MeshRefinement::_populateBackFrontCellsFromParentFaces ( Cell parent_cell)
private

Determination of non-conforming connections of refined cells

Definition at line 2255 of file MeshRefinement.cc.

References Arcane::Face::backCell(), Arcane::Cell::face(), Arcane::Face::frontCell(), getRefinementPattern(), Arcane::Cell::hChild(), Arcane::Item::isOwn(), Arcane::Face::nbCell(), Arcane::Cell::nbFace(), and Arcane::Cell::nbHChildren().

Here is the call graph for this function:

◆ _refineItems()

bool Arcane::mesh::MeshRefinement::_refineItems ( Int64Array & cells_to_refine)
private

Refines the items requested by the user.

It is possible that for a given set of flags there is no actual change when calling this function. Consequently, it returns true if the mesh has actually changed (in which case the data must be projected) false otherwise.

Definition at line 1666 of file MeshRefinement.cc.

References Arcane::Array< T >::add(), ARCANE_FATAL, Arcane::TraceAccessor::debug(), ENUMERATE_CELL, Arcane::ItemBase::flags(), Arcane::ItemFlags::II_Refine, Arcane::Item::itemBase(), m_item_refinement, m_mesh, m_parallel_amr_consistency, Arcane::MessagePassing::ReduceMax, Arcane::AbstractArray< T >::size(), Arcane::Item::type(), and Arcane::Item::uniqueId().

Referenced by refineAndCoarsenItems(), refineItems(), and uniformlyRefine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _removeGhostChildren()

bool Arcane::mesh::MeshRefinement::_removeGhostChildren ( )
private

Definition at line 2171 of file MeshRefinement.cc.

◆ _update() [1/2]

void Arcane::mesh::MeshRefinement::_update ( ArrayView< Int64 > cells_to_refine)

Definition at line 1945 of file MeshRefinement.cc.

◆ _update() [2/2]

void Arcane::mesh::MeshRefinement::_update ( ArrayView< ItemInternal * > cells_to_refine)

Definition at line 1965 of file MeshRefinement.cc.

◆ _updateItemOwner()

void Arcane::mesh::MeshRefinement::_updateItemOwner ( Int32ArrayView cell_to_remove)
private

Definition at line 1998 of file MeshRefinement.cc.

◆ _updateItemOwner2()

void Arcane::mesh::MeshRefinement::_updateItemOwner2 ( )
private

Definition at line 2102 of file MeshRefinement.cc.

◆ _updateLocalityMap()

void Arcane::mesh::MeshRefinement::_updateLocalityMap ( )
private

Updates m_nodes_finder and m_faces_finder

Definition at line 930 of file MeshRefinement.cc.

References Arcane::TraceAccessor::debug().

Here is the call graph for this function:

◆ _updateLocalityMap2()

void Arcane::mesh::MeshRefinement::_updateLocalityMap2 ( )
private

Definition at line 943 of file MeshRefinement.cc.

◆ _updateMaxUid()

void Arcane::mesh::MeshRefinement::_updateMaxUid ( ArrayView< ItemInternal * > cells_to_refine)

Definition at line 229 of file MeshRefinement.cc.

◆ _upscaleData()

void Arcane::mesh::MeshRefinement::_upscaleData ( Array< ItemInternal * > & parent_cells)
private

Upscaling of data on the parent cells.

Definition at line 1989 of file MeshRefinement.cc.

References m_call_back_mng.

Referenced by _contract().

Here is the caller graph for this function:

◆ clear()

void Arcane::mesh::MeshRefinement::clear ( )

Clears all currently stored data.

Definition at line 148 of file MeshRefinement.cc.

Referenced by ~MeshRefinement().

Here is the caller graph for this function:

◆ coarsenByParents()

bool & Arcane::mesh::MeshRefinement::coarsenByParents ( )
inlineprivate

If coarsen_by_parents is true, items with the same parent will be flagged for coarsening This should produce a coarsening closer to what was requested.

coarsen_by_parents is true by default.

Definition at line 453 of file MeshRefinement.h.

References m_coarsen_by_parents.

◆ coarsenItems()

bool Arcane::mesh::MeshRefinement::coarsenItems ( const bool maintain_level_one = true)

Coarsens only the items requested by the user. Some items may not be coarsened to satisfy the level-one rule. It is possible that for a given set of flags there is no actual change when calling this method. Consequently, it returns true if the mesh has actually changed (in which case the data must be projected) and false otherwise.

The argument maintain_level_one is deprecated; use face_level_mismatch_limit() instead.

Definition at line 494 of file MeshRefinement.cc.

References _checkLevelOne(), _cleanRefinementFlags(), _coarsenItems(), _contract(), _makeCoarseningCompatible(), _makeFlagParallelConsistent(), m_mesh, Arcane::MessagePassing::ReduceMax, Arcane::MessagePassing::ReduceMin, and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

◆ coarsenItemsV2()

bool Arcane::mesh::MeshRefinement::coarsenItemsV2 ( bool update_parent_flag)

Method allowing the removal of cells marked with the flag "II_Coarsen".

The owners of faces and nodes having marked cells and unmarked cells are likely to be updated.

Parameters
update_parent_flagIf true, the parent flags will be updated. This includes activating parent cells.
Returns
true if the mesh has changed.

Definition at line 560 of file MeshRefinement.cc.

References _cleanRefinementFlags(), Arcane::Array< T >::add(), Arcane::MutableItemBase::addFlags(), ARCANE_FATAL, Arcane::AbstractArray< T >::empty(), ENUMERATE_, Arcane::Cell::faces(), Arcane::ItemBase::flags(), Arcane::Materials::IMeshMaterialMng::forceRecompute(), Arcane::Materials::IMeshMaterialMng::getReference(), Arcane::Cell::hChild(), Arcane::Cell::hParent(), Arcane::ItemFlags::II_Coarsen, Arcane::ItemFlags::II_CoarsenInactive, Arcane::ItemFlags::II_Inactive, Arcane::ItemFlags::II_JustCoarsened, Arcane::Cell::level(), Arcane::Item::localId(), m_mesh, Arcane::Item::mutableItemBase(), Arcane::Cell::nbHChildren(), Arcane::ItemWithNodes::nodes(), Arcane::Item::null(), Arcane::Item::owner(), Arcane::MessagePassing::ReduceMax, Arcane::MutableItemBase::removeFlags(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ faceLevelMismatchLimit()

unsigned char & Arcane::mesh::MeshRefinement::faceLevelMismatchLimit ( )
inlineprivate

If Face_level_mismatch_limit is set to a non-zero value, then refinement and coarsening will produce meshes where the refinement level of two neighboring cells per face will not differ by more than this limit. If Face_level_mismatch_limit is 0, then level differences will be unlimited.

face_level_mismatch_limit is 1 by default. Currently, the only supported options are 0 and 1.

Definition at line 469 of file MeshRefinement.h.

◆ findOrAddFaceUid()

Int64 Arcane::mesh::MeshRefinement::findOrAddFaceUid ( const Real3 & face_center,
const Real & tol,
bool & is_added )

Adds a new uid associated with the face center face_center. if p already exists, the old uid is kept. The tolerance tol gives the search perimeter around face_center.

Definition at line 890 of file MeshRefinement.cc.

References m_mesh.

◆ findOrAddNodeUid()

Int64 Arcane::mesh::MeshRefinement::findOrAddNodeUid ( const Real3 & p,
const Real & tol )

Adds a new uid associated with point p. if p already exists, the old uid is kept. The tolerance tol gives the search perimeter around p.

Definition at line 869 of file MeshRefinement.cc.

References m_mesh.

◆ flagCellToCoarsen()

void Arcane::mesh::MeshRefinement::flagCellToCoarsen ( Int32ConstArrayView cells_lids)
virtual

Definition at line 339 of file MeshRefinement.cc.

◆ flagCellToRefine()

void Arcane::mesh::MeshRefinement::flagCellToRefine ( Int32ConstArrayView cells_lids)
virtual

Passing the error committed by the cell to the refinement flag.

This method could be implemented in different ways: 1- current implementation: the user performs the transformation themselves in this case, they modify the itemInternal object by setting the refinement flag 2- the user performs the transformation themselves but stores and returns an array of flags the MeshRefinement class, in this case, implement a setter from the returned array 3- to avoid copying the array of flags, implement the converter directly in meshRefinement and the user only provides the error array

Definition at line 325 of file MeshRefinement.cc.

References Arcane::MutableItemBase::addFlags(), Arcane::ItemFlags::II_Refine, m_mesh, Arcane::Item::mutableItemBase(), and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ flagItems()

void Arcane::mesh::MeshRefinement::flagItems ( const Int32Array & flag_per_cell,
const Integer max_level = -1 )

Flags items for refinement/coarsening

◆ getFirstChildNewUid()

Int64 Arcane::mesh::MeshRefinement::getFirstChildNewUid ( )

Generates a new uid for children.

Definition at line 915 of file MeshRefinement.cc.

References m_mesh.

◆ getMesh() [1/2]

IMesh * Arcane::mesh::MeshRefinement::getMesh ( )

Reference to the mesh.

Definition at line 2484 of file MeshRefinement.cc.

References m_mesh.

◆ getMesh() [2/2]

const IMesh * Arcane::mesh::MeshRefinement::getMesh ( ) const

Constant reference to the mesh.

Definition at line 2475 of file MeshRefinement.cc.

References getMesh(), m_mesh, and MeshRefinement().

Referenced by getMesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRefinementPattern() [1/12]

template<>
const ItemRefinementPatternT< IT_DiTetra5 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 537 of file MeshRefinement.h.

◆ getRefinementPattern() [2/12]

template<>
const ItemRefinementPatternT< IT_AntiWedgeRight6 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 531 of file MeshRefinement.h.

◆ getRefinementPattern() [3/12]

template<>
const ItemRefinementPatternT< IT_AntiWedgeLeft6 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 525 of file MeshRefinement.h.

◆ getRefinementPattern() [4/12]

template<>
const ItemRefinementPatternT< IT_HemiHexa5 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 519 of file MeshRefinement.h.

◆ getRefinementPattern() [5/12]

template<>
const ItemRefinementPatternT< IT_HemiHexa6 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 513 of file MeshRefinement.h.

◆ getRefinementPattern() [6/12]

template<>
const ItemRefinementPatternT< IT_HemiHexa7 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 507 of file MeshRefinement.h.

◆ getRefinementPattern() [7/12]

template<>
const ItemRefinementPatternT< IT_Hexaedron8 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 501 of file MeshRefinement.h.

◆ getRefinementPattern() [8/12]

template<>
const ItemRefinementPatternT< IT_Pentaedron6 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 495 of file MeshRefinement.h.

◆ getRefinementPattern() [9/12]

template<>
const ItemRefinementPatternT< IT_Pyramid5 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 489 of file MeshRefinement.h.

◆ getRefinementPattern() [10/12]

template<>
const ItemRefinementPatternT< IT_Tetraedron4 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 483 of file MeshRefinement.h.

◆ getRefinementPattern() [11/12]

template<>
const ItemRefinementPatternT< IT_Quad4 > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const
inline

Definition at line 477 of file MeshRefinement.h.

◆ getRefinementPattern() [12/12]

template<int typeID>
const ItemRefinementPatternT< typeID > & Arcane::mesh::MeshRefinement::getRefinementPattern ( ) const

Returns the refinement pattern associated with the cell type.

Referenced by _coarsenItems(), and _populateBackFrontCellsFromParentFaces().

Here is the caller graph for this function:

◆ init()

void Arcane::mesh::MeshRefinement::init ( )

Calculates the maximum UID.

Definition at line 159 of file MeshRefinement.cc.

References Arcane::IParallelMng::commRank(), Arcane::IParallelMng::commSize(), ENUMERATE_CELL, ENUMERATE_FACE, ENUMERATE_NODE, Arcane::TraceAccessor::info(), m_mesh, m_parallel_amr_consistency, Arcane::ItemTypeMng::nbHChildrenByItemType(), Arcane::IParallelMng::reduce(), Arcane::MessagePassing::ReduceMax, Arcane::Item::type(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ initMeshContainingBox()

void Arcane::mesh::MeshRefinement::initMeshContainingBox ( )

Definition at line 302 of file MeshRefinement.cc.

◆ invalidate()

void Arcane::mesh::MeshRefinement::invalidate ( )
inline

Definition at line 119 of file MeshRefinement.h.

◆ maxLevel()

Integer & Arcane::mesh::MeshRefinement::maxLevel ( )
inline

max_level is the highest refinement level an item can reach.

max_level is unlimited (-1) by default

Definition at line 461 of file MeshRefinement.h.

◆ needUpdate()

bool Arcane::mesh::MeshRefinement::needUpdate ( ) const
inline

Definition at line 115 of file MeshRefinement.h.

◆ populateBackFrontCellsFromChildrenFaces()

void Arcane::mesh::MeshRefinement::populateBackFrontCellsFromChildrenFaces ( Cell parent_cell)

Determination of non-conforming connections of refined cells.

Definition at line 2295 of file MeshRefinement.cc.

References ARCANE_FATAL, Arcane::Face::cell(), Arcane::Cell::face(), Arcane::Cell::isActive(), Arcane::Face::nbCell(), Arcane::Cell::nbFace(), and Arcane::Item::type().

Referenced by _contract().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateBackFrontCellsFromParentFaces()

void Arcane::mesh::MeshRefinement::populateBackFrontCellsFromParentFaces ( Cell parent_cell)

Definition at line 2211 of file MeshRefinement.cc.

◆ refineAndCoarsenItems()

bool Arcane::mesh::MeshRefinement::refineAndCoarsenItems ( const bool maintain_level_one = true)

Refines and coarsens the items requested by the user. It also refines/coarsens complementary items to satisfy the level-one rule. It is possible that for a given set of flags there is no actual change when calling this method. Consequently, it returns true if the mesh has actually changed (in which case the data must be projected) and false otherwise.

The argument maintain_level_one is deprecated; use face_level_mismatch_limit() instead.

Definition at line 352 of file MeshRefinement.cc.

References _checkLevelOne(), _cleanRefinementFlags(), _coarsenItems(), _contract(), _interpolateData(), _makeCoarseningCompatible(), _makeFlagParallelConsistent(), _makeRefinementCompatible(), _refineItems(), Arcane::TraceAccessor::fatal(), Arcane::TraceAccessor::info(), m_mesh, m_parallel_amr_consistency, Arcane::MessagePassing::ReduceMax, Arcane::MessagePassing::ReduceMin, and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

◆ refineItems()

bool Arcane::mesh::MeshRefinement::refineItems ( const bool maintain_level_one = true)

Refines only the items requested by the user. It is possible that for a given set of flags there is no actual change when calling this method. Consequently, it returns true if the mesh has actually changed (in which case the data must be projected) and false otherwise.

The argument maintain_level_one is deprecated; use face_level_mismatch_limit() instead.

Definition at line 730 of file MeshRefinement.cc.

References _checkLevelOne(), _cleanRefinementFlags(), _interpolateData(), _makeFlagParallelConsistent(), _makeRefinementCompatible(), _refineItems(), m_mesh, Arcane::MessagePassing::ReduceMax, Arcane::MessagePassing::ReduceMin, and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

◆ registerCallBack()

void Arcane::mesh::MeshRefinement::registerCallBack ( IAMRTransportFunctor * f)

Definition at line 1911 of file MeshRefinement.cc.

◆ uniformlyCoarsen()

void Arcane::mesh::MeshRefinement::uniformlyCoarsen ( Integer n = 1)

Uniformly coarsens the mesh n times.

Definition at line 837 of file MeshRefinement.cc.

References _cleanRefinementFlags(), _coarsenItems(), Arcane::MutableItemBase::addFlags(), ENUMERATE_CELL, Arcane::Cell::hParent(), Arcane::ItemFlags::II_CoarsenInactive, m_mesh, Arcane::Item::mutableItemBase(), Arcane::Cell::nbHParent(), and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

◆ uniformlyRefine()

void Arcane::mesh::MeshRefinement::uniformlyRefine ( Integer n = 1)

Uniformly refines the mesh n times.

Definition at line 806 of file MeshRefinement.cc.

References _cleanRefinementFlags(), _refineItems(), ENUMERATE_CELL, m_mesh, and Arcane::TraceAccessor::warning().

Here is the call graph for this function:

◆ unRegisterCallBack()

void Arcane::mesh::MeshRefinement::unRegisterCallBack ( IAMRTransportFunctor * f)

Definition at line 1920 of file MeshRefinement.cc.

◆ update()

void Arcane::mesh::MeshRefinement::update ( )

Definition at line 309 of file MeshRefinement.cc.

Member Data Documentation

◆ m_antiwedgeleft6_refinement_pattern

const AntiWedgeLeft6RefinementPattern4Hex_4HHex7 Arcane::mesh::MeshRefinement::m_antiwedgeleft6_refinement_pattern
private

Definition at line 436 of file MeshRefinement.h.

◆ m_antiwedgeright6_refinement_pattern

const AntiWedgeRight6RefinementPattern4Hex_4HHex7 Arcane::mesh::MeshRefinement::m_antiwedgeright6_refinement_pattern
private

Definition at line 437 of file MeshRefinement.h.

◆ m_call_back_mng

AMRCallBackMng* Arcane::mesh::MeshRefinement::m_call_back_mng
private

Manager of data transport functors between meshes

Definition at line 403 of file MeshRefinement.h.

Referenced by _interpolateData(), _upscaleData(), MeshRefinement(), and ~MeshRefinement().

◆ m_coarsen_by_parents

bool Arcane::mesh::MeshRefinement::m_coarsen_by_parents
private

Refinement parameters

Definition at line 409 of file MeshRefinement.h.

Referenced by coarsenByParents(), and MeshRefinement().

◆ m_ditetra5_refinement_pattern

const DiTetra5RefinementPattern2Hex_6HHex7 Arcane::mesh::MeshRefinement::m_ditetra5_refinement_pattern
private

Definition at line 438 of file MeshRefinement.h.

◆ m_face_family

FaceFamily* Arcane::mesh::MeshRefinement::m_face_family
private

Definition at line 379 of file MeshRefinement.h.

◆ m_face_finder

FaceMapCoordToUid Arcane::mesh::MeshRefinement::m_face_finder
private

Definition at line 388 of file MeshRefinement.h.

◆ m_face_level_mismatch_limit

Byte Arcane::mesh::MeshRefinement::m_face_level_mismatch_limit
private

Definition at line 412 of file MeshRefinement.h.

◆ m_hemihexa5_refinement_pattern

const HemiHex5RefinementPattern2Hex_4Penta_2HHex5 Arcane::mesh::MeshRefinement::m_hemihexa5_refinement_pattern
private

Definition at line 435 of file MeshRefinement.h.

◆ m_hemihexa6_refinement_pattern

const HemiHex6RefinementPattern4Hex_4HHex7 Arcane::mesh::MeshRefinement::m_hemihexa6_refinement_pattern
private

Definition at line 434 of file MeshRefinement.h.

◆ m_hemihexa7_refinement_pattern

const HemiHex7RefinementPattern6Hex_2HHex7 Arcane::mesh::MeshRefinement::m_hemihexa7_refinement_pattern
private

Definition at line 433 of file MeshRefinement.h.

◆ m_hex_refinement_pattern

const HexRefinementPattern8Hex Arcane::mesh::MeshRefinement::m_hex_refinement_pattern
private

Definition at line 432 of file MeshRefinement.h.

◆ m_item_refinement

ItemRefinement* Arcane::mesh::MeshRefinement::m_item_refinement
private

Reference to the item refiner

Definition at line 393 of file MeshRefinement.h.

Referenced by _coarsenItems(), _refineItems(), MeshRefinement(), and ~MeshRefinement().

◆ m_max_cell_uid

Int64 Arcane::mesh::MeshRefinement::m_max_cell_uid
private

Definition at line 417 of file MeshRefinement.h.

◆ m_max_face_uid

Int64 Arcane::mesh::MeshRefinement::m_max_face_uid
private

Definition at line 420 of file MeshRefinement.h.

◆ m_max_level

Integer Arcane::mesh::MeshRefinement::m_max_level
private

Definition at line 410 of file MeshRefinement.h.

◆ m_max_nb_hChildren

Integer Arcane::mesh::MeshRefinement::m_max_nb_hChildren
private

Definition at line 423 of file MeshRefinement.h.

◆ m_max_node_uid

Int64 Arcane::mesh::MeshRefinement::m_max_node_uid
private

Definition at line 414 of file MeshRefinement.h.

◆ m_mesh

◆ m_mesh_containing_box

MapCoordToUid::Box Arcane::mesh::MeshRefinement::m_mesh_containing_box
private

Quick search for nodes and faces based on their coordinates. For faces, the coordinates are those of the face center.

Definition at line 386 of file MeshRefinement.h.

◆ m_nb_cell_target

Integer Arcane::mesh::MeshRefinement::m_nb_cell_target
private

Definition at line 411 of file MeshRefinement.h.

◆ m_need_update

bool Arcane::mesh::MeshRefinement::m_need_update
private

Definition at line 380 of file MeshRefinement.h.

◆ m_next_cell_uid

Int64 Arcane::mesh::MeshRefinement::m_next_cell_uid
private

Definition at line 418 of file MeshRefinement.h.

◆ m_next_face_uid

Int64 Arcane::mesh::MeshRefinement::m_next_face_uid
private

Definition at line 421 of file MeshRefinement.h.

◆ m_next_node_uid

Int64 Arcane::mesh::MeshRefinement::m_next_node_uid
private

Definition at line 415 of file MeshRefinement.h.

◆ m_node_finder

NodeMapCoordToUid Arcane::mesh::MeshRefinement::m_node_finder
private

Definition at line 387 of file MeshRefinement.h.

◆ m_node_owner_memory

VariableNodeInt32 Arcane::mesh::MeshRefinement::m_node_owner_memory
private

Definition at line 441 of file MeshRefinement.h.

◆ m_parallel_amr_consistency

ParallelAMRConsistency* Arcane::mesh::MeshRefinement::m_parallel_amr_consistency
private

Ensures UID consistency in parallel

Definition at line 398 of file MeshRefinement.h.

Referenced by _refineItems(), init(), MeshRefinement(), refineAndCoarsenItems(), and ~MeshRefinement().

◆ m_prism_refinement_pattern

const PrismRefinementPattern4Hex_4Pr Arcane::mesh::MeshRefinement::m_prism_refinement_pattern
private

Definition at line 431 of file MeshRefinement.h.

◆ m_pyramid_refinement_pattern

const PyramidRefinementPattern4Hex_4Py Arcane::mesh::MeshRefinement::m_pyramid_refinement_pattern
private

Definition at line 430 of file MeshRefinement.h.

◆ m_quad4_refinement_pattern

const Quad4RefinementPattern4Quad Arcane::mesh::MeshRefinement::m_quad4_refinement_pattern
private

Refinement patterns

Definition at line 428 of file MeshRefinement.h.

◆ m_tetra_refinement_pattern

const TetraRefinementPattern2Hex_2Penta_2Py_2Tetra Arcane::mesh::MeshRefinement::m_tetra_refinement_pattern
private

Definition at line 429 of file MeshRefinement.h.


The documentation for this class was generated from the following files: