Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
GeomShapeMng.cc
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/* GeomShapeMng.cc (C) 2000-2026 */
9/* */
10/* Class managing the GeomShapes of a mesh. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/IMesh.h"
15
16#include "arcane/geometry/GeomShapeMng.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane::geometric
22{
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
27GeomShapeMng(IMesh* mesh, const String& cell_shape_name)
28: m_name(cell_shape_name)
29, m_cell_shape_nodes(VariableBuildInfo(mesh, cell_shape_name, IVariable::PNoDump))
30, m_cell_shape_faces(VariableBuildInfo(mesh, cell_shape_name + "Face", IVariable::PNoDump))
31, m_cell_shape_centers(VariableBuildInfo(mesh, cell_shape_name + "Center", IVariable::PNoDump))
32{
33}
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
40: m_name("GenericElement")
41, m_cell_shape_nodes(VariableBuildInfo(mesh, "GenericElement", IVariable::PNoDump))
42, m_cell_shape_faces(VariableBuildInfo(mesh, "GenericElementFace", IVariable::PNoDump))
43, m_cell_shape_centers(VariableBuildInfo(mesh, "GenericElementCenter", IVariable::PNoDump))
44{
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
51GeomShapeMng(const GeomShapeMng& rhs)
52: m_name(rhs.m_name)
53, m_cell_shape_nodes(rhs.m_cell_shape_nodes)
54, m_cell_shape_faces(rhs.m_cell_shape_faces)
55, m_cell_shape_centers(rhs.m_cell_shape_centers)
56{
57}
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
67{
68 IMesh* mesh = m_cell_shape_nodes.variable()->meshHandle().mesh();
69 //TODO: we must use the globalConnectivity() of IItemFamily
70 // but for now this is not calculated correctly
71 // during init.
72 if (mesh->dimension() == 2) {
73 // In 2D, we do not have cells containing more nodes than quads
74 m_cell_shape_nodes.resize(4);
75 //TODO: Check if this is necessary.
76 m_cell_shape_faces.resize(4);
77 }
78 else {
79 m_cell_shape_nodes.resize(ItemStaticInfo::MAX_CELL_NODE);
80 m_cell_shape_faces.resize(ItemStaticInfo::MAX_CELL_FACE);
81 }
82}
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87} // namespace Arcane::geometric
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
Interface of a variable.
Definition IVariable.h:40
static const Integer MAX_CELL_FACE
Maximum number of faces per cell.
static const Integer MAX_CELL_NODE
Maximum number of nodes per cell.
Parameters necessary for building a variable.
GeomShapeMng(IMesh *mesh, const String &name)
Initializes for the mesh mesh with the name name.
void initialize()
Initializes the instance.