Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshAccessor.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/* MeshAccessor.h (C) 2000-2019 */
9/* */
10/* Access to mesh information. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/FatalErrorException.h"
15
16#include "arcane/core/MeshAccessor.h"
17#include "arcane/core/ISubDomain.h"
18#include "arcane/core/IMesh.h"
19#include "arcane/core/IMeshSubMeshTransition.h"
20#include "arcane/core/ItemGroup.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31MeshAccessor::
32MeshAccessor(ISubDomain* sd)
33: m_mesh_handle(sd->defaultMeshHandle())
34{
35}
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40MeshAccessor::
41MeshAccessor(IMesh* mesh)
42{
43 if (!mesh)
44 ARCANE_FATAL("Can not create MeshAccessor with null mesh. Use constructor with MeshHandle");
45 m_mesh_handle = mesh->handle();
46}
47
48MeshAccessor::
49MeshAccessor(const MeshHandle& mesh_handle)
50: m_mesh_handle(mesh_handle)
51{
52}
53
55{
56 return mesh()->nbCell();
57}
59{
60 return mesh()->nbFace();
61}
63{
64 return mesh()->nbEdge();
65}
67{
68 return mesh()->nbNode();
69}
71{
72 return mesh()->toPrimaryMesh()->nodesCoordinates();
73}
75{
76 return mesh()->allNodes();
77}
79{
80 return mesh()->allEdges();
81}
83{
84 return mesh()->allFaces();
85}
87{
88 return mesh()->allCells();
89}
91{
92 return mesh()->outerFaces();
93}
95{
96 return mesh()->ownNodes();
97}
99{
100 return mesh()->ownCells();
101}
103{
104 return mesh()->ownFaces();
105}
107{
108 return mesh()->ownEdges();
109}
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114} // End namespace Arcane
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Interface of the subdomain manager.
Definition ISubDomain.h:75
EdgeGroup allEdges() const
Returns the group containing all edges.
EdgeGroup ownEdges() const
Group containing all edges specific to this domain.
FaceGroup ownFaces() const
Group containing all faces specific to this domain.
CellGroup allCells() const
Returns the group containing all cells.
CellGroup ownCells() const
Returns the group containing all cells specific to this domain.
FaceGroup allFaces() const
Returns the group containing all faces.
Integer nbNode() const
Returns the number of nodes in the mesh.
NodeGroup ownNodes() const
Returns the group containing all nodes specific to this domain.
NodeGroup allNodes() const
Returns the group containing all nodes.
Integer nbEdge() const
Returns the number of edges in the mesh.
Integer nbCell() const
Returns the number of cells in the mesh.
Integer nbFace() const
Returns the number of faces in the mesh.
FaceGroup outerFaces() const
Returns the group containing all boundary faces.
VariableNodeReal3 & nodesCoordinates() const
Returns the coordinates of the mesh nodes.
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
ItemGroupT< Face > FaceGroup
Group of faces.
Definition ItemTypes.h:179
ItemGroupT< Edge > EdgeGroup
Group of edges.
Definition ItemTypes.h:174
ItemGroupT< Node > NodeGroup
Group of nodes.
Definition ItemTypes.h:168
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.