Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshCriteriaLoadBalanceMng.cc
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/* MeshCriteriaLoadBalanceMng.cc (C) 2000-2024 */
9/* */
10/* Mesh load balance criteria manager. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/MeshCriteriaLoadBalanceMng.h"
15#include "arcane/core/internal/ILoadBalanceMngInternal.h"
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20namespace Arcane
21{
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26/*!
27 * \brief Constructor
28 * \param sd The subdomain where the ILoadBalanceMng instance is located.
29 * \param mesh_handle The mesh on which the criteria will be defined.
30 */
33: m_internal(sd->loadBalanceMng()->_internalApi())
34, m_mesh_handle(mesh_handle)
35{
36}
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
42reset()
43{
44 m_internal->reset(m_mesh_handle.mesh());
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
52{
53 m_internal->addCriterion(count, m_mesh_handle.mesh());
54}
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
61{
62 m_internal->addCriterion(count, m_mesh_handle.mesh());
63}
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
69addMass(VariableCellInt32& count, const String& entity)
70{
71 m_internal->addMass(count, m_mesh_handle.mesh(), entity);
72}
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
78addCommCost(VariableFaceInt32& count, const String& entity)
79{
80 m_internal->addCommCost(count, m_mesh_handle.mesh(), entity);
81}
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
87setMassAsCriterion(bool active)
88{
89 m_internal->setMassAsCriterion(m_mesh_handle.mesh(), active);
90}
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
96setNbCellsAsCriterion(bool active)
97{
98 m_internal->setNbCellsAsCriterion(m_mesh_handle.mesh(), active);
99}
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
105setCellCommContrib(bool active)
106{
107 m_internal->setCellCommContrib(m_mesh_handle.mesh(), active);
108}
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
114setComputeComm(bool active)
115{
116 m_internal->setComputeComm(m_mesh_handle.mesh(), active);
117}
118
119/*---------------------------------------------------------------------------*/
120/*---------------------------------------------------------------------------*/
121
124{
125 return m_internal->nbCriteria(m_mesh_handle.mesh());
126}
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131} // namespace Arcane
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
Interface of the subdomain manager.
Definition ISubDomain.h:75
void setNbCellsAsCriterion(bool active) override
Method allowing to specify if the number of cells in a subdomain must be a criterion for load balance...
void addMass(VariableCellInt32 &count, const String &entity) override
Method allowing a criterion to be added for each cell.
Integer nbCriteria() override
Method allowing to retrieve the number of criteria already registered.
void addCommCost(VariableFaceInt32 &count, const String &entity) override
Method allowing a criterion to be added for each face.
MeshCriteriaLoadBalanceMng(ISubDomain *sd, const MeshHandle &mesh_handle)
Constructor.
void addCriterion(VariableCellInt32 &count) override
Method allowing a criterion to be added for each cell.
void setMassAsCriterion(bool active) override
Method allowing to specify if the data mass of each cell is a criterion for load balance.
void reset() override
Method allowing the criteria already added to be cleared.
void setCellCommContrib(bool active) override
Method allowing to specify if the mass of communications between cells must be a criterion for load b...
Handle on a mesh.
Definition MeshHandle.h:48
MeshVariableScalarRefT< Cell, Real > VariableCellReal
Real type quantity at cell center.
MeshVariableScalarRefT< Cell, Int32 > VariableCellInt32
Quantity at the cell center of 32-bit integer type.
MeshVariableScalarRefT< Face, Int32 > VariableFaceInt32
Quantity at the face of 32-bit integer type.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.