Arcane  v3.16.6.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemPairGroup.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* ItemPairGroup.cc (C) 2000-2025 */
9/* */
10/* Tableau de listes d'entités. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/IFunctor.h"
15#include "arcane/utils/NotImplementedException.h"
16
17#include "arcane/core/ItemPairGroup.h"
18#include "arcane/core/IItemFamily.h"
19#include "arcane/core/ItemGroup.h"
20#include "arcane/core/ItemPairEnumerator.h"
21#include "arcane/core/ItemPairGroupBuilder.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
136: public IFunctor
137{
138 public:
139 CustomFunctorWrapper(ItemPairGroupImpl* g,ItemPairGroup::CustomFunctor* f)
140 : m_group(g), m_functor(f){}
141 ~CustomFunctorWrapper()
142 {
143 delete m_functor;
144 }
145 public:
146 void executeFunctor() override
147 {
148 ItemPairGroup pair_group(m_group);
149 ItemPairGroupBuilder builder(pair_group);
150 m_functor->executeFunctor(builder);
151 }
152 public:
153
154 ItemPairGroupImpl* m_group = nullptr;
155 ItemPairGroup::CustomFunctor* m_functor = nullptr;
156};
157
158/*---------------------------------------------------------------------------*/
159/*---------------------------------------------------------------------------*/
160
162ItemPairGroup(const ItemGroup& group,const ItemGroup& sub_item_group,
163 eItemKind link_kind)
164: m_impl(nullptr)
165{
166 IItemFamily* item_family = group.itemFamily();
167 ItemPairGroup v = item_family->findAdjacencyItems(group, sub_item_group, link_kind, 1);
168 m_impl = v.internal();
169}
170
171/*---------------------------------------------------------------------------*/
172/*---------------------------------------------------------------------------*/
173
175ItemPairGroup(const ItemGroup& group,const ItemGroup& sub_item_group,
176 CustomFunctor* functor)
177: m_impl(nullptr)
178{
179 ARCANE_CHECK_POINTER(functor);
180 m_impl = new ItemPairGroupImpl(group,sub_item_group);
181 IFunctor* f = new CustomFunctorWrapper(m_impl.get(),functor);
182 m_impl->setComputeFunctor(f);
183 m_impl->invalidate(true);
184}
185
186/*---------------------------------------------------------------------------*/
187/*---------------------------------------------------------------------------*/
188
194
195/*---------------------------------------------------------------------------*/
196/*---------------------------------------------------------------------------*/
197
200: m_impl(ItemPairGroupImpl::checkSharedNull())
201{
202}
203
204/*---------------------------------------------------------------------------*/
205/*---------------------------------------------------------------------------*/
206
207ItemPairEnumerator ItemPairGroup::
208enumerator() const
209{
210 return ItemPairEnumerator(*this);
211}
212
213/*---------------------------------------------------------------------------*/
214/*---------------------------------------------------------------------------*/
215
216}
217
218/*---------------------------------------------------------------------------*/
219/*---------------------------------------------------------------------------*/
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
Interface d'une famille d'entités.
Definition IItemFamily.h:84
virtual ItemPairGroup findAdjacencyItems(const ItemGroup &group, const ItemGroup &sub_group, eItemKind link_kind, Integer nb_layer)
Cherche une liste d'adjacence.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
IItemFamily * itemFamily() const
Famille d'entité à laquelle appartient ce groupe (0 pour le group nul)
Definition ItemGroup.h:123
Enumérateur sur un tableau de tableaux d'entités du maillage.
Construction des listes des entités des ItemPairGroup.
Implémentation d'un tableau de listes d'entités.
Wrapper sur un fonctor ItemPairGroup::CustomFunctor.
void executeFunctor() override
Exécute la méthode associé
IFunctorWithArgumentT< ItemPairGroupBuilder & > CustomFunctor
Functor pour un calcul personnalisé des connectivités.
ItemPairGroup()
Construit un tableau vide.
AutoRefT< ItemPairGroupImpl > m_impl
Représentation interne du groupe.
ItemPairGroupImpl * internal() const
Retourne l'implémentation du groupe.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
eItemKind
Genre d'entité de maillage.