Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMeshPartitioner.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/* IMeshPartitioner.h (C) 2000-2025 */
9/* */
10/* Interface of a mesh partitioner. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_IMESHPARTITIONER_H
13#define ARCANE_IMESHPARTITIONER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IMeshPartitionerBase.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Interface of a mesh partitioner.
30 *
31 * The partitioner reassigns entity owners.
32 * It does not directly perform entity exchange.
33 * The partitioner can use certain information such as
34 * timeRatio() or imbalance() to calculate an efficient partitioning.
35 */
36class ARCANE_CORE_EXPORT IMeshPartitioner
38{
39 public:
40
41 virtual void build() = 0;
42
43 public:
44
46
47 virtual void partitionMesh(bool initial_partition, Int32 nb_part) = 0;
48
49 //! Mesh associated with the partitioner
50 ARCCORE_DEPRECATED_2021("Use primaryMesh() instead")
51 virtual IMesh* mesh() const = 0;
52
53 //! Associated mesh
54 virtual IPrimaryMesh* primaryMesh() override;
55
56 public:
57
58 /*!{ \name compact
59 *
60 * Proportion of computation time of this subdomain compared to that
61 * of the subdomain that has the highest computation time.
62 */
63 //! Sets the proportion of computation time
64 //virtual void setTimeRatio(Real v) =0;
65 //! Proportion of computation time
66 //virtual Real timeRatio() const =0;
67 //@}
68
69 //! Computation time of the most heavily loaded subdomain
70 virtual ARCANE_DEPRECATED_116 void setMaximumComputationTime(Real v) = 0;
71 virtual ARCANE_DEPRECATED_116 Real maximumComputationTime() const = 0;
72
73 /*! \brief Computation time of this subdomain.
74 * The first element indicates the computation time of the subdomain
75 * corresponding to calculations whose cost is proportional to the cells.
76 * The following must be associated with a variable (to be done).
77 */
78 virtual ARCANE_DEPRECATED_116 void setComputationTimes(RealConstArrayView v) = 0;
79 virtual ARCANE_DEPRECATED_116 RealConstArrayView computationTimes() const = 0;
80
81 /*!@{ \name imbalance
82 *
83 * Computation time imbalance. It is calculated as follows
84 * imbalance = (max_computation_time - min_computation_time) / min_computation_time;
85 */
86 //! Sets the computation time imbalance
87 virtual void setImbalance(Real v) = 0;
88 //! Computation time imbalance
89 virtual Real imbalance() const = 0;
90 //@}
91
92 //! Sets the maximum allowed imbalance
93 virtual void setMaxImbalance(Real v) = 0;
94 //! Maximum allowed imbalance
95 virtual Real maxImbalance() const = 0;
96
97 //! Allows defining the weights of objects to be partitioned: ILoadBalanceMng must now be used.
98 virtual ARCANE_DEPRECATED_116 void setCellsWeight(ArrayView<float> weights, Integer nb_weight) = 0;
99 virtual ARCANE_DEPRECATED_116 ArrayView<float> cellsWeight() const = 0;
100
101 //! Changes the ILoadBalanceMng to use.
102 virtual void setILoadBalanceMng(ILoadBalanceMng* mng) = 0;
103 virtual ILoadBalanceMng* loadBalanceMng() const = 0;
104};
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109} // namespace Arcane
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114#endif
Modifiable view of an array of type T.
Interface for registering variables for load balancing.
Interface of a mesh partitioner.
virtual void partitionMesh(bool initial_partition)=0
Interface of a mesh partitioner.
virtual ARCANE_DEPRECATED_116 void setComputationTimes(RealConstArrayView v)=0
Computation time of this subdomain. The first element indicates the computation time of the subdomain...
virtual void setImbalance(Real v)=0
Sets the computation time imbalance.
virtual IMesh * mesh() const =0
Mesh associated with the partitioner.
virtual Real imbalance() const =0
Computation time imbalance.
virtual void setILoadBalanceMng(ILoadBalanceMng *mng)=0
Changes the ILoadBalanceMng to use.
virtual IPrimaryMesh * primaryMesh() override
Associated mesh.
virtual Real maxImbalance() const =0
Maximum allowed imbalance.
virtual ARCANE_DEPRECATED_116 void setCellsWeight(ArrayView< float > weights, Integer nb_weight)=0
Allows defining the weights of objects to be partitioned: ILoadBalanceMng must now be used.
virtual ARCANE_DEPRECATED_116 void setMaximumComputationTime(Real v)=0
Sets the proportion of computation time.
virtual void setMaxImbalance(Real v)=0
Sets the maximum allowed imbalance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488