Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AMRPatchPositionSignature.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/* AMRPatchPositionSignature.h (C) 2000-2026 */
9/* */
10/* Calculation of patch position signatures. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_INTERNAL_AMRPATCHPOSITIONSIGNATURE_H
13#define ARCANE_CARTESIANMESH_INTERNAL_AMRPATCHPOSITIONSIGNATURE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
18
19#include "arcane/utils/UniqueArray.h"
20
21#include "arcane/cartesianmesh/AMRPatchPosition.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
41class AMRPatchPositionSignature
42{
43 public:
44
45 AMRPatchPositionSignature();
46 AMRPatchPositionSignature(const AMRPatchPosition& patch, ICartesianMesh* cmesh);
47 AMRPatchPositionSignature(const AMRPatchPositionSignature&) = default;
48 ~AMRPatchPositionSignature() = default;
49
50 private:
51
52 AMRPatchPositionSignature(const AMRPatchPosition& patch, ICartesianMesh* cmesh, Int32 nb_cut);
53
54 public:
55
56 AMRPatchPositionSignature& operator=(const AMRPatchPositionSignature&) = default;
57
58 public:
59
66 void compress();
67
73 void fillSig();
74
78 bool isValid() const;
79
84 bool canBeCut() const;
85
90 void compute();
91
95 Real efficacity() const;
96
104 std::pair<AMRPatchPositionSignature, AMRPatchPositionSignature> cut(Integer dim, CartCoord cut_point) const;
105
110
115
120
124 AMRPatchPosition patch() const;
125
126 ICartesianMesh* mesh() const;
127
131 bool stopCut() const;
132
136 void setStopCut(bool stop_cut);
137
141 bool isComputed() const;
142
143 private:
144
145 bool m_is_null;
146 AMRPatchPosition m_patch;
147 ICartesianMesh* m_mesh;
148 Int32 m_nb_cut;
149 bool m_stop_cut;
150
152
153 bool m_have_cells;
154 bool m_is_computed;
155
159};
160
161/*---------------------------------------------------------------------------*/
162/*---------------------------------------------------------------------------*/
163
164} // End namespace Arcane
165
166/*---------------------------------------------------------------------------*/
167/*---------------------------------------------------------------------------*/
168
169#endif
ConstArrayView< CartCoord > sigX() const
Method for retrieving the X signature.
bool stopCut() const
Method for determining if the patch can still be cut.
bool isValid() const
Method for determining if the signatures are valid.
ConstArrayView< CartCoord > sigZ() const
Method for retrieving the Z signature.
void compress()
Method for removing zeros at the beginning and end of the signatures.
Real efficacity() const
Method to determine the patch's efficiency.
std::pair< AMRPatchPositionSignature, AMRPatchPositionSignature > cut(Integer dim, CartCoord cut_point) const
Method for cutting the patch. The patch is not modified.
void setStopCut(bool stop_cut)
Method for defining whether the patch can still be cut.
AMRPatchPosition patch() const
Method for retrieving a copy of the patch.
void compute()
Method for calculating the signatures of a patch. This method must be called after construction.
bool isComputed() const
Method for determining whether the compute() method has already been called.
bool canBeCut() const
Method for determining if the patch can be cut into two via the cut() method.
void fillSig()
Method for calculating the signatures.
ConstArrayView< CartCoord > sigY() const
Method for retrieving the Y signature.
Class allowing the definition of a patch position in the Cartesian mesh.
Constant view of an array of type T.
Interface for Cartesian mesh numbering manager.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 CartCoord
Represents a coordinate of an element in the Cartesian grid (in X or Y or Z).
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.
std::int32_t Int32
Signed integer type of 32 bits.