Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshVisitor.cc
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/* MeshUtils.cc (C) 2000-2023 */
9/* */
10/* Visiteurs divers sur les entités du maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/Enumerator.h"
15#include "arcane/utils/Collection.h"
16
17#include "arcane/IItemFamily.h"
18#include "arcane/IMesh.h"
19#include "arcane/ItemGroup.h"
20#include "arcane/MeshUtils.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31void MeshUtils::
32visitGroups(IItemFamily* family, IFunctorWithArgumentT<ItemGroup&>* functor)
33{
34 for (ItemGroupCollection::Enumerator i(family->groups()); ++i;) {
35 ItemGroup& group = *i;
36 functor->executeFunctor(group);
37 }
38}
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
43void MeshUtils::
44visitGroups(IMesh* mesh, IFunctorWithArgumentT<ItemGroup&>* functor)
45{
46 for (IItemFamilyCollection::Enumerator ifamily(mesh->itemFamilies()); ++ifamily;) {
47 IItemFamily* family = *ifamily;
48 for (ItemGroupCollection::Enumerator i(family->groups()); ++i;) {
49 ItemGroup& group = *i;
50 functor->executeFunctor(group);
51 }
52 }
53}
54
55static void test_compile()
56{
57 IItemFamily* f = nullptr;
58 auto xx = [](const ItemGroup& x) { std::cout << "name=" << x.name(); };
59 MeshUtils::visitGroups(f, xx);
60}
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65} // namespace Arcane
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
Interface d'une famille d'entités.
virtual ItemGroupCollection groups() const =0
Liste des groupes de cette famille.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
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 -*-