Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshExchanger.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/* MeshExchanger.h (C) 2000-2024 */
9/* */
10/* Handling of a mesh exchange between sub-domains. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_MESHEXCHANGER_H
13#define ARCANE_MESH_MESHEXCHANGER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/List.h"
19#include "arcane/core/IMeshExchanger.h"
20#include "arcane/core/ParallelExchangerOptions.h"
21#include "arcane/core/IMesh.h"
22
23#include <map>
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30class ITimeStats;
31}
32
33namespace Arcane::mesh
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
41class ARCANE_MESH_EXPORT MeshExchanger
42: public TraceAccessor
43, public IMeshExchanger
44{
45 private:
46
47 typedef std::map<IItemFamily*, IItemFamilyExchanger*> ItemFamilyExchangerMap;
48
49 public:
50
51 MeshExchanger(IMesh* mesh, ITimeStats* stats);
52 ~MeshExchanger();
53
54 public:
55
56 bool computeExchangeInfos() override;
57 void processExchange() override;
58 void removeNeededItems() override;
59 void allocateReceivedItems() override;
60 void updateItemGroups() override;
61 void updateVariables() override;
62 void finalizeExchange() override;
63 IPrimaryMesh* mesh() const override;
64 void build();
66 ePhase phase() const override { return m_phase; }
67
68 protected:
69
70 void _setNextPhase(ePhase next_phase);
71
72 private:
73
74 IMesh* m_mesh;
75 List<IItemFamilyExchanger*> m_family_exchangers;
76 ItemFamilyExchangerMap m_family_exchanger_map;
77 ITimeStats* m_time_stats;
78 ePhase m_phase;
79 ParallelExchangerOptions m_exchanger_option;
80
81 void _checkPhase(ePhase wanted_phase);
82 void _buildWithItemFamilyNetwork();
83 void _addItemFamilyExchanger(IItemFamily* family);
84};
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89} // End namespace Arcane::mesh
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94#endif
Exchange of entities and their characteristics for a given family.
Interface of an entity family.
Definition IItemFamily.h:83
Management of a mesh exchange between subdomains.
ePhase
Indicates the different phases of the exchange.
Interface managing execution time statistics.
Definition ITimeStats.h:44
Implementation of a collection of elements in vector form.
Options for IParallelMng::processExchange().
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
void updateVariables() override
Update of variables.
void processExchange() override
Performs the exchange of information between subdomains.
IItemFamilyExchanger * findExchanger(IItemFamily *family) override
Exchanger associated with the family. Throws an exception if not found.
void finalizeExchange() override
Finalizes the exchanges.
void allocateReceivedItems() override
Allocates the entities received from other subdomains.
ePhase phase() const override
Phase of the exchange we are currently in.
bool computeExchangeInfos() override
Calculates the information to send/receive from other subdomains.
void updateItemGroups() override
Update of entity groups.
void removeNeededItems() override
Deletes from this subdomain the entities that should no longer be there following the exchange.
IPrimaryMesh * mesh() const override
Mesh associated with this exchanger.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --