Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ItemConnectedEnumerator.h
Go to the documentation of this file.
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/* ItemConnectedEnumerator.h (C) 2000-2023 */
9/* */
10/* Enumerators for connected entities of the mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_ITEMCONNECTEDENUMERATOR_H
13#define ARCANE_ITEMCONNECTEDENUMERATOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/Item.h"
18#include "arcane/core/ItemConnectedEnumeratorBase.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Arcane
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
42class ItemConnectedEnumerator
43: public ItemConnectedEnumeratorBaseT<Item>
44{
45 friend class ItemGroup;
46 friend class ItemVector;
47 friend class ItemVectorView;
48 friend class ItemPairEnumerator;
49 template <int Extent> friend class ItemConnectedListView;
50 // NOTE: Normally, it would suffice to do this:
51 // template<class T> friend class ItemConnectedEnumeratorBase;
52 // but this does not work with GCC 8. So we do the specialization
53 // manually
54 friend class ItemConnectedEnumeratorBaseT<Item>;
55 friend class ItemConnectedEnumeratorBaseT<Node>;
56 friend class ItemConnectedEnumeratorBaseT<ItemWithNodes>;
57 friend class ItemConnectedEnumeratorBaseT<Edge>;
58 friend class ItemConnectedEnumeratorBaseT<Face>;
59 friend class ItemConnectedEnumeratorBaseT<Cell>;
60 friend class ItemConnectedEnumeratorBaseT<Particle>;
61 friend class ItemConnectedEnumeratorBaseT<DoF>;
62
63 public:
64
65 using BaseClass = ItemConnectedEnumeratorBaseT<Item>;
66
67 public:
68
69 ItemConnectedEnumerator() = default;
70
71 public:
72
73 ItemConnectedEnumerator(const impl::ItemIndexedListView<DynExtent>& rhs)
74 : BaseClass(rhs)
75 {}
76
77 template <int E> ItemConnectedEnumerator(const ItemConnectedListView<E>& rhs)
78 : BaseClass(ItemConnectedListViewT<Item, E>(rhs))
79 {}
80
81 protected:
82
83 ItemConnectedEnumerator(ItemSharedInfo* s, const Int32ConstArrayView& local_ids)
84 : BaseClass(s, local_ids)
85 {}
86
87 private:
88
89 ItemConnectedEnumerator(const Int32* local_ids, Int32 index, Int32 n, Item item_base)
90 : BaseClass(local_ids, index, n, item_base)
91 {}
92};
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
100template <typename ItemType>
101class ItemConnectedEnumeratorT
102: public ItemConnectedEnumeratorBaseT<ItemType>
103{
104 using BaseClass = ItemConnectedEnumeratorBaseT<ItemType>;
105
106 public:
107
108 ItemConnectedEnumeratorT() = default;
109 template <int E> ItemConnectedEnumeratorT(const ItemConnectedListView<E>& rhs)
110 : BaseClass(rhs)
111 {}
112 ItemConnectedEnumeratorT(const ItemConnectedListViewT<ItemType>& rhs)
113 : BaseClass(rhs)
114 {}
115
116 private:
117
118 ItemConnectedEnumeratorT(ItemSharedInfo* s, const Int32ConstArrayView& local_ids)
119 : BaseClass(s, local_ids)
120 {}
121};
122
123/*---------------------------------------------------------------------------*/
124/*---------------------------------------------------------------------------*/
125
147#ifdef ARCANE_USE_SPECIFIC_ITEMCONNECTED
148
149#define ENUMERATE_CONNECTED_(type, iterator_name, item, connectivity_func) \
150 for (::Arcane::ItemConnectedEnumeratorT<type> iterator_name((item).connectivity_func); iterator_name.hasNext(); ++iterator_name)
151
152#else
153
154#define ENUMERATE_CONNECTED_(type, iterator_name, item, connectivity_func) \
155 for (::Arcane::ItemEnumeratorT<type> iterator_name((item).connectivity_func); iterator_name.hasNext(); ++iterator_name)
156
157#endif
158
159/*---------------------------------------------------------------------------*/
160/*---------------------------------------------------------------------------*/
161
162} // namespace Arcane
163
164/*---------------------------------------------------------------------------*/
165/*---------------------------------------------------------------------------*/
166
167#endif
Cell of a mesh.
Definition Item.h:1300
degree of freedom class.
Definition Item.h:1649
Edge of a cell.
Definition Item.h:875
Face of a cell.
Definition Item.h:1032
constexpr Int32 index() const
Current index of the enumerator.
View of a list of entities connected to another.
View of a list of entities connected to another entity.
Internal shared structure of a mesh entity.
Mesh element based on nodes (Edge,Face,Cell).
Definition Item.h:773
Base class for a mesh element.
Definition Item.h:84
Node of a mesh.
Definition Item.h:598
Particle.
Definition Item.h:1529
Internal view of an array of entities.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
std::int32_t Int32
Signed integer type of 32 bits.