Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MeshAccessor.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* Accès aux informations d'un maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/FatalErrorException.h"
15
16#include "arcane/MeshAccessor.h"
17#include "arcane/ISubDomain.h"
18#include "arcane/IMesh.h"
19#include "arcane/IMeshSubMeshTransition.h"
20#include "arcane/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
54Integer MeshAccessor::nbCell() const { return mesh()->nbCell(); }
55Integer MeshAccessor::nbFace() const { return mesh()->nbFace(); }
56Integer MeshAccessor::nbEdge() const { return mesh()->nbEdge(); }
57Integer MeshAccessor::nbNode() const { return mesh()->nbNode(); }
58VariableNodeReal3& MeshAccessor::nodesCoordinates() const
59{
60 return mesh()->toPrimaryMesh()->nodesCoordinates();
61}
62NodeGroup MeshAccessor::allNodes() const { return mesh()->allNodes(); }
63EdgeGroup MeshAccessor::allEdges() const { return mesh()->allEdges(); }
64FaceGroup MeshAccessor::allFaces() const { return mesh()->allFaces(); }
65CellGroup MeshAccessor::allCells() const { return mesh()->allCells(); }
66FaceGroup MeshAccessor::outerFaces() const { return mesh()->outerFaces(); }
67NodeGroup MeshAccessor::ownNodes() const { return mesh()->ownNodes(); }
68CellGroup MeshAccessor::ownCells() const { return mesh()->ownCells(); }
69FaceGroup MeshAccessor::ownFaces() const { return mesh()->ownFaces(); }
70EdgeGroup MeshAccessor::ownEdges() const { return mesh()->ownEdges(); }
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75} // End namespace Arcane
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-