Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::IMeshCompacter Class Referenceabstract

Management of mesh family compaction. More...

#include <arcane/core/IMeshCompacter.h>

Public Types

enum class  ePhase {
  Init = 0 , BeginCompact , CompactVariableAndGroups , UpdateInternalReferences ,
  EndCompact , Finalize , Ended
}
 Indicates the different phases of compaction. More...

Public Member Functions

virtual ~IMeshCompacter ()=default
 Frees resources.
virtual void doAllActions ()=0
 Executes all compaction actions successively.
virtual void beginCompact ()=0
virtual void compactVariablesAndGroups ()=0
virtual void updateInternalReferences ()=0
virtual void endCompact ()=0
virtual void finalizeCompact ()=0
virtual IMeshmesh () const =0
 Mesh associated with this compacter.
virtual const ItemFamilyCompactInfosfindCompactInfos (IItemFamily *family) const =0
 Compaction information for the family family.
virtual ePhase phase () const =0
 The exchange phase in which we are located.
virtual void setSorted (bool v)=0
 Indicates whether entities should be sorted during compaction.
virtual bool isSorted () const =0
 Indicates whether it wishes to sort the entities in addition to compacting them.
virtual ItemFamilyCollection families () const =0
 Families whose entities are compacted.
virtual void _setCompactVariablesAndGroups (bool v)=0

Detailed Description

Management of mesh family compaction.

Instances of this class are created via the manager IMeshCompactMng. Only one compaction can take place at a time.

By compaction, we mean any modification of the local numbering of entities within a family. Therefore, gaps may remain in the numbering after calling a compaction (even if this is not the case in the implementations available in Arcane).

Compaction concerns either all families of a mesh, or a single family. The families() method allows returning the list of compacted families.

Even if a family is not directly compacted, it participates in certain compaction operations because it may reference compacted entities.

The different operations of a compaction are as follows:

  1. beginCompact(): calculation of the new local numbering of entities in the compacted families. After calling this method, it is possible to call findCompactInfos() to obtain the correspondences between new and old local numbers for a family.
  2. compactVariablesAndGroups(): updating the groups and variables of the compacted families based on this new numbering.
  3. updateInternalReferences(): updating references to entities. This concerns all families, not just the compacted ones.
  4. endCompact(): finalizes the family compaction. After calling this method, it is no longer possible to retrieve the correspondence information via findCompactInfos().
  5. finalizeCompact(): notification to all families that the compaction is finished. This allows, for example, cleaning up or updating certain information.

The doAllActions() method allows performing all these phases at once. This is the recommended method for performing a compaction. The following code shows how to perform a compaction on all families:

IMeshCompactMng* compact_mng = mesh()->_compactMng();
IMeshCompacter* compacter = compact_mng->beginCompact();
try{
compacter->doAllActions();
}
catch(...){
compact_mng->endCompact();
throw;
}
compact_mng->endCompact();
Interface for managing the compaction of mesh families.
virtual void endCompact()=0
Signals that the compaction is finished.
virtual IMeshCompacter * beginCompact()=0
Starts a compaction on all families of the mesh.
Management of mesh family compaction.
virtual IMesh * mesh() const =0
Mesh associated with this compacter.
virtual void doAllActions()=0
Executes all compaction actions successively.

Definition at line 83 of file IMeshCompacter.h.

Member Enumeration Documentation

◆ ePhase

enum class Arcane::IMeshCompacter::ePhase
strong

Indicates the different phases of compaction.

Definition at line 88 of file IMeshCompacter.h.

Member Function Documentation

◆ findCompactInfos()

virtual const ItemFamilyCompactInfos * Arcane::IMeshCompacter::findCompactInfos ( IItemFamily * family) const
pure virtual

Compaction information for the family family.

The returned pointer may be null if the specified family is not part of the compacted families.

◆ setSorted()

virtual void Arcane::IMeshCompacter::setSorted ( bool v)
pure virtual

Indicates whether entities should be sorted during compaction.

Precondition
phase()==ePhase::Init.

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