Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
CartesianMeshPatchListView.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* CartesianMeshPatchListView.h (C) 2000-2023 */
9/* */
10/* Vue sur une liste de patchs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_CARTESIANMESPATCHLISTVIEW_H
13#define ARCANE_CARTESIANMESH_CARTESIANMESPATCHLISTVIEW_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include "arcane/cartesianmesh/CartesianPatch.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
31class ARCANE_CARTESIANMESH_EXPORT CartesianMeshPatchListView
32{
33 friend CartesianMeshImpl;
34
35 public:
36
39 {};
40
43 {
45
46 public:
47
48 typedef std::forward_iterator_tag iterator_category;
50 typedef Int32 size_type;
51
52 public:
53
54 Iterator() = default;
55
56 public:
57
58 CartesianPatch operator*() const { return CartesianPatch(m_patches[m_index]); }
59 Iterator& operator++()
60 {
61 ++m_index;
62 return (*this);
63 }
64 friend bool operator==(const Iterator& a, const Iterator& b)
65 {
66 return (a.m_patches.data() + a.m_index) == (b.m_patches.data() + b.m_index);
67 }
68 friend bool operator!=(const Iterator& a, const Iterator& b)
69 {
70 return !(operator==(a, b));
71 }
72 friend bool operator==(const Iterator& a, const Sentinel&)
73 {
74 return a.m_patches.size() != a.m_index;
75 }
76 friend bool operator!=(const Iterator& a, const Sentinel& b)
77 {
78 return !(operator==(a, b));
79 }
80
81 private:
82
84 : m_index(index)
85 , m_patches(v)
86 {}
87
88 private:
89
90 Int32 m_index = 0;
92 };
93
94 public:
95
97
98 private:
99
100 // Constructeur pour 'CartesiaMeshImpl'
102 : m_patches(v)
103 {}
104
105 public:
106
107 Iterator begin() const { return Iterator(m_patches, 0); }
108 Sentinel end() const { return {}; }
109 Iterator endIterator() const { return Iterator(m_patches, m_patches.size()); }
110 Int32 size() const { return m_patches.size(); }
111
112 private:
113
114 ConstArrayView<ICartesianMeshPatch*> m_patches;
115};
116
117/*---------------------------------------------------------------------------*/
118/*---------------------------------------------------------------------------*/
119
120} // End namespace Arcane
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125#endif
126
Déclarations des types généraux de Arcane.
Infos spécifiques à un maillage cartésien.
Sentinelle pour l'itération pour une liste de patchs.
Patch AMR d'un maillage cartésien.
Interface d'un patch AMR d'un maillage cartésien.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-