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