Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshCompactMng.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* MeshCompactMng.cc (C) 2000-2020 */
9/* */
10/* Gestionnaire des compactages de familles d'un maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/mesh/MeshCompactMng.h"
15
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/utils/TraceInfo.h"
18
19#include "arcane/IParallelMng.h"
20
21#include "arcane/mesh/MeshCompacter.h"
22#include "arcane/mesh/DynamicMesh.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::mesh
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36MeshCompactMng::
37MeshCompactMng(IMesh* mesh)
38: TraceAccessor(mesh->traceMng())
39, m_mesh(mesh)
40, m_compacter(nullptr)
41{
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47MeshCompactMng::
48~MeshCompactMng()
49{
50}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55IMeshCompacter* MeshCompactMng::
56beginCompact()
57{
58 if (m_compacter)
59 ARCANE_FATAL("Already compacting");
60 MeshCompacter* c = new MeshCompacter(m_mesh,m_mesh->parallelMng()->timeStats());
61 return _setCompacter(c);
62}
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67IMeshCompacter* MeshCompactMng::
68beginCompact(IItemFamily* family)
69{
70 if (m_compacter)
71 ARCANE_FATAL("Already compacting");
72 MeshCompacter* c = new MeshCompacter(family,m_mesh->parallelMng()->timeStats());
73 return _setCompacter(c);
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79void MeshCompactMng::
80endCompact()
81{
82 if (!m_compacter)
83 ARCANE_FATAL("Can not call endCompact() without calling beginCompact() before");
84 delete m_compacter;
85 m_compacter = nullptr;
86}
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91IMesh* MeshCompactMng::
92mesh() const
93{
94 return m_mesh;
95}
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100MeshCompacter* MeshCompactMng::
101_setCompacter(MeshCompacter* c)
102{
103 m_compacter = c;
104 c->build();
105 return c;
106}
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
110
111} // End namespace Arcane::mesh
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Interface d'une famille d'entités.
Gestion d'un compactage de familles du maillage.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Gestion d'un compactage de familles du maillage..