Arcane  v4.1.5.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
IndexedItemConnectivityView.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/* IndexedItemConnectivityView.cc (C) 2000-2026 */
9/* */
10/* Vues sur les connectivités utilisant des index. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/IndexedItemConnectivityView.h"
15
16#include "arcane/core/ItemGroup.h"
17#include "arcane/core/IItemFamily.h"
18#include "arcane/core/IParticleFamily.h"
19#include "arcane/core/internal/IItemFamilyInternal.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29// Fonction utilisée pour tester la compilation avec accès aux connectivités
30
31extern "C++" void
32_internalItemTestCompile()
33{
34 IndexedCellNodeConnectivityView cell_node;
35 IndexedCellEdgeConnectivityView cell_edge;
36 IndexedCellFaceConnectivityView cell_face;
37 IndexedCellCellConnectivityView cell_cell;
38 IndexedCellDoFConnectivityView cell_dof;
39
40 IndexedFaceNodeConnectivityView face_node;
41 IndexedFaceEdgeConnectivityView face_edge;
42 IndexedFaceFaceConnectivityView face_face;
43 IndexedFaceCellConnectivityView face_cell;
44 IndexedFaceDoFConnectivityView face_dof;
45
46 IndexedEdgeNodeConnectivityView edge_node;
47 IndexedEdgeEdgeConnectivityView edge_edge;
48 IndexedEdgeFaceConnectivityView edge_face;
49 IndexedEdgeCellConnectivityView edge_cell;
50 IndexedEdgeDoFConnectivityView edge_dof;
51
52 IndexedNodeNodeConnectivityView node_node;
53 IndexedNodeEdgeConnectivityView node_edge;
54 IndexedNodeFaceConnectivityView node_face;
55 IndexedNodeCellConnectivityView node_cell;
56 IndexedNodeDoFConnectivityView node_dof;
57
58 IndexedDoFNodeConnectivityView dof_node;
59 IndexedDoFEdgeConnectivityView dof_edge;
60 IndexedDoFFaceConnectivityView dof_face;
61 IndexedDoFCellConnectivityView dof_cell;
62 IndexedDoFDoFConnectivityView dof_dof;
63
64 ItemGroup items;
65 Int64 total = 0;
66
67 ENUMERATE_ (Node, inode, items) {
68 Node xnode = *inode;
69 for (NodeLocalId node : node_node.nodes(xnode)) {
70 total += node.localId();
71 }
72 for (EdgeLocalId edge : node_edge.edges(xnode)) {
73 total += edge.localId();
74 }
75 for (FaceLocalId face : node_face.faces(xnode)) {
76 total += face.localId();
77 }
78 for (CellLocalId cell : node_cell.cells(xnode)) {
79 total += cell.localId();
80 }
81 for (DoFLocalId dof : node_dof.dofs(xnode)) {
82 total += dof.localId();
83 }
84 }
85
86 ENUMERATE_ (Cell, icell, items) {
87 Cell xcell = *icell;
88 for (NodeLocalId node : cell_node.nodes(xcell)) {
89 total += node.localId();
90 }
91 for (EdgeLocalId edge : cell_edge.edges(xcell)) {
92 total += edge.localId();
93 }
94 for (FaceLocalId face : cell_face.faces(xcell)) {
95 total += face.localId();
96 }
97 for (CellLocalId cell : cell_cell.cells(xcell)) {
98 total += cell.localId();
99 }
100 for (DoFLocalId dof : cell_dof.dofs(xcell)) {
101 total += dof.localId();
102 }
103 }
104
105 ENUMERATE_ (Edge, iedge, items) {
106 Edge xedge = *iedge;
107 for (NodeLocalId node : edge_node.nodes(xedge)) {
108 total += node.localId();
109 }
110 for (EdgeLocalId edge : edge_edge.edges(xedge)) {
111 total += edge.localId();
112 }
113 for (FaceLocalId face : edge_face.faces(xedge)) {
114 total += face.localId();
115 }
116 for (CellLocalId cell : edge_cell.cells(xedge)) {
117 total += cell.localId();
118 }
119 for (DoFLocalId dof : edge_dof.dofs(xedge)) {
120 total += dof.localId();
121 }
122 }
123
124 ENUMERATE_ (Face, iface, items) {
125 Face xface = *iface;
126 for (NodeLocalId node : face_node.nodes(xface)) {
127 total += node.localId();
128 }
129 for (EdgeLocalId edge : face_edge.edges(xface)) {
130 total += edge.localId();
131 }
132 for (FaceLocalId face : face_face.faces(xface)) {
133 total += face.localId();
134 }
135 for (CellLocalId cell : face_cell.cells(xface)) {
136 total += cell.localId();
137 }
138 for (DoFLocalId dof : face_dof.dofs(xface)) {
139 total += dof.localId();
140 }
141 }
142
143 ENUMERATE_ (DoF, idof, items) {
144 DoF xdof = *idof;
145 for (NodeLocalId node : dof_node.nodes(xdof)) {
146 total += node.localId();
147 }
148 for (EdgeLocalId edge : dof_edge.edges(xdof)) {
149 total += edge.localId();
150 }
151 for (FaceLocalId face : dof_face.faces(xdof)) {
152 total += face.localId();
153 }
154 for (CellLocalId cell : dof_cell.cells(xdof)) {
155 total += cell.localId();
156 }
157 for (DoFLocalId dof : dof_dof.dofs(xdof)) {
158 total += dof.localId();
159 }
160 }
161
162 std::cout << "TOTAL=" << total << "\n";
163}
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168IndexedParticleCellConnectivityView::
169IndexedParticleCellConnectivityView(IParticleFamily* pf)
170: IndexedParticleCellConnectivityView(pf->itemFamily())
171{
172}
173
174/*---------------------------------------------------------------------------*/
175/*---------------------------------------------------------------------------*/
176
177IndexedParticleCellConnectivityView::
178IndexedParticleCellConnectivityView(IItemFamily* family)
179{
180 ItemInternalConnectivityList* clist = family->_internalApi()->unstructuredItemInternalConnectivityList();
181 m_container_view = clist->containerView(IK_Cell);
182}
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
187} // namespace Arcane
188
189/*---------------------------------------------------------------------------*/
190/*---------------------------------------------------------------------------*/
#define ENUMERATE_(type, name, group)
Enumérateur générique d'un groupe d'entité
Maille d'un maillage.
Definition Item.h:1214
classe degré de liberté.
Definition Item.h:1532
Arête d'une maille.
Definition Item.h:826
Face d'une maille.
Definition Item.h:964
Interface d'une famille de particules.
Vue sur une connectivité Particle->Cell.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Noeud d'un maillage.
Definition Item.h:582
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.