Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
GeomShape.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/* GeomShape.h (C) 2000-2026 */
9/* */
10/* Geometric shape. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_GEOMETRIC_GEOMSHAPE_H
13#define ARCANE_GEOMETRIC_GEOMSHAPE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/geometry/GeomShapeView.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::geometric
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \ingroup ArcaneGeometric
30 * \brief Geometric shape.
31 *
32 * This class is only used to create a temporary geometric shape.
33 * For a geometric shape derived from a cell, you must go through the
34 * GeomShapeMng.
35 *
36 * An instance of this class allows storing the information
37 * necessary for a geometric shape.
38 *
39 * It is possible to directly initialize
40 * a geometric shape from a hexahedron (initFromHexaedron8())
41 * or a quadrangle (initFromQuad4()). These methods initialize the shape
42 * and return a view of it.
43 * \code
44 * GeomShape shape;
45 * HexaElement hexa;
46 * GeomShapeView shape_view = shape.initFromHexaedron8(hexa);
47 * \endcode
48 *
49 * \todo set up a specific initialization. For this, it will be necessary
50 * to use toMutableView() but it is also necessary to be able to specify the geomType().
51 */
52class ARCANE_GEOMETRY_EXPORT GeomShape
53{
54 // TEMPORARY: to be deleted when the initFromHexa() and initFromQuad()
55 // of GeomShapeView are deleted
56 friend class GeomShapeView;
57
58 public:
59
60 //! Modifiable view of this instance.
62 {
63 return GeomShapeMutableView((Real3*)m_node_ptr, (Real3*)m_face_ptr, (Real3*)&m_center);
64 }
65
66 //! Initializes the shape with a hexahedron \a hexa and returns a view of it.
67 Hexaedron8ShapeView initFromHexaedron8(Hexaedron8ElementConstView hexa);
68
69 //! Initializes the shape with a quadrangle \a quad and returns a view of it.
70 Quad4ShapeView initFromQuad4(Quad4ElementConstView quad);
71
72 protected:
73
74 void _setArray(GeomShapeView& shape)
75 {
76 shape._setArray((Real3*)m_node_ptr, (Real3*)m_face_ptr, (Real3*)&m_center);
77 }
78
79 private:
80
83 Real3POD m_center;
84};
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89} // namespace Arcane::geometric
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94#endif
static const Integer MAX_CELL_FACE
Maximum number of faces per cell.
static const Integer MAX_CELL_NODE
Maximum number of nodes per cell.
Class managing a 3-dimensional real vector.
Definition Real3.h:132
Constant view on a geometric shape GeomShape.
GeomShapeMutableView toMutableView()
Modifiable view of this instance.
Definition GeomShape.h:61
Constant view on geometric elements of type GeomType::Hexaedron8.
Specific view on geometric shapes of type GeomType::Hexaedron8.
Constant view on geometric elements of type GeomType::Quad4.
Specific view on geometric shapes of type GeomType::Quad4.