Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshCompacter.h
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/* MeshCompacter.h (C) 2000-2016 */
9/* */
10/* Management of mesh family compaction. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_MESHCOMPACTER_H
13#define ARCANE_MESH_MESHCOMPACTER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/List.h"
19#include "arcane/core/IMeshCompacter.h"
20#include "arcane/mesh/MeshGlobal.h"
21
22#include <map>
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29class ITimeStats;
31} // namespace Arcane
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36namespace Arcane::mesh
37{
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42class DynamicMesh;
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
53class ARCANE_MESH_EXPORT MeshCompacter
54: public TraceAccessor
55, public IMeshCompacter
56{
57 friend class MeshCompactMng;
58
59 private:
60
61 typedef std::map<IItemFamily*, ItemFamilyCompactInfos*> ItemFamilyCompactInfosMap;
62
63 private:
64
65 MeshCompacter(IMesh* mesh, ITimeStats* stats);
66 MeshCompacter(IItemFamily* family, ITimeStats* stats);
67 ~MeshCompacter();
68
69 private:
70
71 void build();
72
73 public:
74
75 IMesh* mesh() const override;
76 void doAllActions() override;
77 void beginCompact() override;
78 void compactVariablesAndGroups() override;
79 void updateInternalReferences() override;
80 void endCompact() override;
81 void finalizeCompact() override;
82 const ItemFamilyCompactInfos* findCompactInfos(IItemFamily* family) const override;
83 ePhase phase() const override { return m_phase; }
84 bool isSorted() const override { return m_is_sorted; }
85 ItemFamilyCollection families() const override;
86
87 public:
88
89 void setSorted(bool v) override;
90 void _setCompactVariablesAndGroups(bool v) override;
91
92 private:
93
94 IMesh* m_mesh;
95 ItemFamilyCompactInfosMap m_family_compact_infos_map;
96 ITimeStats* m_time_stats;
97 ePhase m_phase;
98 bool m_is_sorted;
99 bool m_is_compact_variables_and_groups;
100 List<IItemFamily*> m_item_families;
101
102 private:
103
104 void _checkPhase(ePhase wanted_phase);
105 void _addFamily(IItemFamily* family);
106};
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
110
111} // namespace Arcane::mesh
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
115
116#endif
Interface of an entity family.
Definition IItemFamily.h:83
Management of mesh family compaction.
ePhase
Indicates the different phases of compaction.
Interface managing execution time statistics.
Definition ITimeStats.h:44
Information to manage the compaction of entities of a family.
Implementation of a collection of elements in vector form.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Implementation of a mesh.
Definition DynamicMesh.h:98
const ItemFamilyCompactInfos * findCompactInfos(IItemFamily *family) const override
Compaction information for the family family.
void doAllActions() override
Executes all compaction actions successively.
IMesh * mesh() const override
Mesh associated with this compacter.
bool isSorted() const override
Indicates whether it wishes to sort the entities in addition to compacting them.
ePhase phase() const override
The exchange phase in which we are located.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< IItemFamily * > ItemFamilyCollection
Collection of item families.