Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MeshArea.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/* MeshArea.h (C) 2000-2016 */
9/* */
10/* Accès aux informations d'un maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14
15#include "arcane/utils/ArcanePrecomp.h"
16
17#include "arcane/utils/FatalErrorException.h"
18
19#include "arcane/MeshArea.h"
20#include "arcane/IMesh.h"
21#include "arcane/ISubDomain.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26ARCANE_BEGIN_NAMESPACE
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31MeshArea::
32MeshArea(IMesh* mesh)
33: m_mesh(mesh)
34, m_sub_domain(mesh->subDomain())
35, m_trace_mng(m_sub_domain->traceMng())
36{
37}
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42MeshArea::
43~MeshArea()
44{
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50ISubDomain* MeshArea::
51subDomain()
52{
53 return m_sub_domain;
54}
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
59ITraceMng* MeshArea::
60traceMng()
61{
62 return m_trace_mng;
63}
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
67
68IMesh* MeshArea::
69mesh()
70{
71 return m_mesh;
72}
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77void MeshArea::
78setArea(const NodeGroup& nodes,const CellGroup& cells)
79{
80 m_all_nodes = nodes;
81 m_all_cells = cells;
82}
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87Integer MeshArea::nbNode() { return m_all_nodes.size(); }
88Integer MeshArea::nbEdge() { return m_all_edges.size(); }
89Integer MeshArea::nbFace() { return m_all_faces.size(); }
90Integer MeshArea::nbCell() { return m_all_cells.size(); }
91Integer MeshArea::nbItem(eItemKind ik)
92{
93 switch(ik){
94 case IK_Node: return nbNode();
95 case IK_Edge: return nbEdge();
96 case IK_Face: return nbFace();
97 case IK_Cell: return nbCell();
98 case IK_Particle:
99 case IK_DoF:
100 case IK_Unknown:
101 break;
102 }
103 throw FatalErrorException(A_FUNCINFO,"invalid argument");
104}
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109NodeGroup MeshArea::allNodes() { return m_all_nodes; }
110EdgeGroup MeshArea::allEdges() { return m_all_edges; }
111FaceGroup MeshArea::allFaces() { return m_all_faces; }
112CellGroup MeshArea::allCells() { return m_all_cells; }
113ItemGroup MeshArea::allItems(eItemKind ik)
114{
115 switch(ik){
116 case IK_Node: return allNodes();
117 case IK_Edge: return allEdges();
118 case IK_Face: return allFaces();
119 case IK_Cell: return allCells();
120 case IK_Particle:
121 case IK_DoF:
122 case IK_Unknown:
123 break;
124 }
125 throw FatalErrorException(A_FUNCINFO,"invalid argument");
126}
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
131NodeGroup MeshArea::ownNodes() { return m_all_nodes.own(); }
132EdgeGroup MeshArea::ownEdges() { return m_all_edges.own(); }
133FaceGroup MeshArea::ownFaces() { return m_all_faces.own(); }
134CellGroup MeshArea::ownCells() { return m_all_cells.own(); }
135ItemGroup MeshArea::ownItems(eItemKind ik)
136{
137 switch(ik){
138 case IK_Node: return ownNodes();
139 case IK_Edge: return ownEdges();
140 case IK_Face: return ownFaces();
141 case IK_Cell: return ownCells();
142 case IK_Particle:
143 case IK_DoF:
144 case IK_Unknown:
145 break;
146 }
147 throw FatalErrorException(A_FUNCINFO,"invalid argument");
148}
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153ARCANE_END_NAMESPACE
154
155/*---------------------------------------------------------------------------*/
156/*---------------------------------------------------------------------------*/
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Exception lorsqu'une erreur fatale est survenue.
Interface du gestionnaire de traces.
eItemKind
Genre d'entité de maillage.
@ IK_Particle
Entité de maillage de genre particule.
@ IK_Node
Entité de maillage de genre noeud.
@ IK_Cell
Entité de maillage de genre maille.
@ IK_Unknown
Entité de maillage de genre inconnu ou non initialisé
@ IK_Face
Entité de maillage de genre face.
@ IK_DoF
Entité de maillage de genre degre de liberte.
@ IK_Edge
Entité de maillage de genre arête.