Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CartesianMeshCoarsening.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/* CartesianMeshCoarsening.h (C) 2000-2024 */
9/* */
10/* Coarsening of a Cartesian mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_CARTESIANMESHCOARSENING_H
13#define ARCANE_CARTESIANMESH_CARTESIANMESHCOARSENING_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array2.h"
19
21#include "arcane/core/ICartesianMeshGenerationInfo.h"
22
23#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
78class ARCANE_CARTESIANMESH_EXPORT CartesianMeshCoarsening
79: public TraceAccessor
80{
81 friend CartesianMeshImpl;
82
83 private:
84
85 ARCANE_DEPRECATED_REASON("Y2024: Use Arcane::CartesianMeshUtils::createCartesianMeshCoarsening2() instead")
86 explicit CartesianMeshCoarsening(ICartesianMesh* m);
87
88 public:
89
95 void createCoarseCells();
96
105 {
106 return m_refined_cells[index];
107 }
108
113 ConstArrayView<Int32> coarseCells() const { return m_coarse_cells; }
114
120 void removeRefinedCells();
121
122 private:
123
124 ICartesianMesh* m_cartesian_mesh = nullptr;
125 Int32 m_verbosity_level = false;
126 UniqueArray2<Int32> m_refined_cells;
127 UniqueArray<Int32> m_coarse_cells;
128 bool m_is_create_coarse_called = false;
129 bool m_is_remove_refined_called = false;
130 Int64 m_first_own_cell_unique_id_offset = NULL_ITEM_UNIQUE_ID;
131
132 private:
133
134 Int64 _getMaxUniqueId(const ItemGroup& group);
135 void _recomputeMeshGenerationInfo();
136};
137
138/*---------------------------------------------------------------------------*/
139/*---------------------------------------------------------------------------*/
140
141} // End namespace Arcane
142
143/*---------------------------------------------------------------------------*/
144/*---------------------------------------------------------------------------*/
145
146#endif
Declarations of types on entities.
void createCoarseCells()
Coarsens the initial mesh by 2.
ConstArrayView< Int32 > refinedCells(Int32 index) const
List of localIds() of refined cells for the parent cell at index index.
ConstArrayView< Int32 > coarseCells() const
List of localIds() of coarse cells.
Constant view of an array of type T.
Mesh entity group.
Definition ItemGroup.h:51
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
2D data vector with value semantics (STL style).
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.