Arcane  v3.15.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshExchangeMng.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* MeshExchangeMng.cc (C) 2000-2024 */
9/* */
10/* Gestionnaire des échanges de maillages entre sous-domaines. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/FatalErrorException.h"
15#include "arcane/utils/TraceInfo.h"
16
17#include "arcane/core/ISubDomain.h"
18
19#include "arcane/mesh/MeshExchangeMng.h"
20#include "arcane/mesh/MeshExchanger.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25ARCANE_BEGIN_NAMESPACE
26ARCANE_MESH_BEGIN_NAMESPACE
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34MeshExchangeMng::
35MeshExchangeMng(IMesh* mesh)
36: TraceAccessor(mesh->traceMng())
37, m_mesh(mesh)
38, m_exchanger(nullptr)
39{
40}
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45MeshExchangeMng::
46~MeshExchangeMng()
47{
48}
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53IMeshExchanger* MeshExchangeMng::
54beginExchange()
55{
56 if (m_exchanger)
57 ARCANE_FATAL("Already in an exchange");
58 IMeshExchanger* ex = _createExchanger();
59 m_exchanger = ex;
60 return m_exchanger;
61}
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66IMeshExchanger* MeshExchangeMng::
67_createExchanger()
68{
69 MeshExchanger* ex = new MeshExchanger(m_mesh,m_mesh->subDomain()->timeStats());
70 ex->build();
71 return ex;
72}
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77void MeshExchangeMng::
78endExchange()
79{
80 if (!m_exchanger)
81 ARCANE_FATAL("Can not call endExchange() without calling beginExchange() before");
82 delete m_exchanger;
83 m_exchanger = nullptr;
84}
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89IPrimaryMesh* MeshExchangeMng::
90mesh() const
91{
92 return m_mesh->toPrimaryMesh();
93}
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98ARCANE_MESH_END_NAMESPACE
99ARCANE_END_NAMESPACE
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Gestion d'un échange de maillage entre sous-domaines.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:149