Arcane  v3.14.10.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-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/* MeshExchangeMng.cc (C) 2000-2016 */
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/ISubDomain.h"
18
19#include "arcane/mesh/MeshExchangeMng.h"
20#include "arcane/mesh/MeshExchanger.h"
21#include "arcane/mesh/DynamicMesh.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26ARCANE_BEGIN_NAMESPACE
27ARCANE_MESH_BEGIN_NAMESPACE
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35MeshExchangeMng::
36MeshExchangeMng(DynamicMesh* mesh)
37: TraceAccessor(mesh->traceMng())
38, m_mesh(mesh)
39, m_exchanger(nullptr)
40{
41}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
46MeshExchangeMng::
47~MeshExchangeMng()
48{
49}
50
51/*---------------------------------------------------------------------------*/
52/*---------------------------------------------------------------------------*/
53
54IMeshExchanger* MeshExchangeMng::
55beginExchange()
56{
57 if (m_exchanger)
58 ARCANE_FATAL("Already in an exchange");
59 IMeshExchanger* ex = _createExchanger();
60 m_exchanger = ex;
61 return m_exchanger;
62}
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67IMeshExchanger* MeshExchangeMng::
68_createExchanger()
69{
70 MeshExchanger* ex = new MeshExchanger(m_mesh,m_mesh->subDomain()->timeStats());
71 ex->build();
72 return ex;
73}
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78void MeshExchangeMng::
79endExchange()
80{
81 if (!m_exchanger)
82 ARCANE_FATAL("Can not call endExchange() without calling beginExchange() before");
83 delete m_exchanger;
84 m_exchanger = nullptr;
85}
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90IPrimaryMesh* MeshExchangeMng::
91mesh() const
92{
93 return m_mesh;
94}
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99ARCANE_MESH_END_NAMESPACE
100ARCANE_END_NAMESPACE
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
#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:120