Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
HoneyCombMeshGenerator.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/* HoneyCombMeshGenerator.h (C) 2000-2022 */
9/* */
10/* Hexagonal mesh generation service. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_HONEYCOMBMESHGENERATOR_H
13#define ARCANE_STD_HONEYCOMBMESHGENERATOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Real2.h"
19#include "arcane/utils/UniqueArray.h"
20
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32class HoneyComb2DMeshGenerator
33: public TraceAccessor
34{
35 public:
36
38 class CellLineInfo;
39
40 public:
41
42 explicit HoneyComb2DMeshGenerator(IPrimaryMesh* mesh);
43
44 public:
45
46 void generateMesh(Real2 origin, Real pitch, Integer nb_ring);
47
48 private:
49
50 IPrimaryMesh* m_mesh = nullptr;
51 Real m_pitch = 0.0;
52 Integer m_nb_ring = 0;
53 Real2 m_origin;
54
55 private:
56
57 void _buildCells();
58 void _buildCells2();
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64class HoneyComb3DMeshGenerator
65: public TraceAccessor
66{
67 public:
68
70 class CellLineInfo;
71
72 public:
73
74 explicit HoneyComb3DMeshGenerator(IPrimaryMesh* mesh);
75
76 public:
77
78 void generateMesh(Real2 origin, Real pitch, Integer nb_ring, ConstArrayView<Real> heights);
79
80 private:
81
82 IPrimaryMesh* m_mesh = nullptr;
83 Real m_pitch = 0.0;
84 Integer m_nb_ring = 0;
85 Real2 m_origin;
86 UniqueArray<Real> m_heights;
87
88 private:
89
90 void _buildCellNodes(Real x, Real y, Real z, ArrayView<Real3> coords);
91 void _buildCells();
92 void _buildCells2();
93};
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98} // End namespace Arcane
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103#endif
Declarations of Arcane's general types.
Modifiable view of an array of type T.
Constant view of an array of type T.
Class managing a 2-dimensional real vector.
Definition Real2.h:122
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
1D data vector with value semantics (STL style).
-- 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.