Arcane  v3.15.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
BasicItemPairGroupComputeFunctor.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* BasicItemPairGroupComputeFunctor.h (C) 2000-2024 */
9/* */
10/* Fonctions utilitaires sur un maillage. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_BASICITEMPAIRGROUPCOMPUTEFUNCTOR_H
13#define ARCANE_MESH_BASICITEMPAIRGROUPCOMPUTEFUNCTOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/IFunctor.h"
19#include "arcane/core/IMeshUtilities.h"
20#include "arcane/core/Item.h"
21
22#include <map>
23#include <functional>
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34class ItemPairGroup;
35class ItemPairGroupImpl;
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
43: public TraceAccessor
44{
45 public:
46
48 {
50 : m_item_kind(IK_Unknown), m_sub_item_kind(IK_Unknown),
51 m_link_item_kind(IK_Unknown)
52 {
53 }
55 : m_item_kind(ik), m_sub_item_kind(sik), m_link_item_kind(lik)
56 {
57 }
58 eItemKind m_item_kind;
59 eItemKind m_sub_item_kind;
60 eItemKind m_link_item_kind;
61 bool operator<(const AdjacencyType& rhs) const
62 {
63 if (m_item_kind != rhs.m_item_kind)
64 return m_item_kind < rhs.m_item_kind;
65 if (m_sub_item_kind != rhs.m_sub_item_kind)
66 return m_sub_item_kind < rhs.m_sub_item_kind;
67 return m_link_item_kind < rhs.m_link_item_kind;
68 }
69 };
70
71 typedef void (BasicItemPairGroupComputeFunctor::*ComputeFunctor)(ItemPairGroupImpl* array);
72
74 : public IFunctor
75 {
76 public:
77
79 ItemPairGroupImpl* array, ComputeFunctor func_ptr)
80 : m_ptr(ptr), m_array(array), m_func_ptr(func_ptr) {}
81 public:
82
83 void executeFunctor() override
84 {
85 (m_ptr->*m_func_ptr)(m_array);
86 }
87 private:
89 ItemPairGroupImpl* m_array;
90 ComputeFunctor m_func_ptr;
91 };
92
93 public:
94
96
97 public:
98
99 virtual void computeAdjacency(ItemPairGroup adjacency_array, eItemKind link_kind,
100 Integer nb_layer);
101
102 private:
103
104 std::map<AdjacencyType, ComputeFunctor> m_compute_adjacency_functions;
105
106 private:
107
108 void _addComputeAdjacency(eItemKind ik, eItemKind sik, eItemKind lik, ComputeFunctor f);
109 void _computeCellCellNodeAdjacency(ItemPairGroupImpl* array);
110 void _computeCellCellFaceAdjacency(ItemPairGroupImpl* array);
111 void _computeNodeNodeCellAdjacency(ItemPairGroupImpl* array);
112 void _computeFaceCellNodeAdjacency(ItemPairGroupImpl* array);
113 void _computeFaceFaceNodeAdjacency(ItemPairGroupImpl* array);
114 void _computeCellFaceFaceAdjacency(ItemPairGroupImpl* array);
115 void _computeNodeNodeFaceAdjacency(ItemPairGroupImpl* array);
116 void _computeNodeNodeEdgeAdjacency(ItemPairGroupImpl* array);
117 void _computeFaceFaceEdgeAdjacency(ItemPairGroupImpl* array);
118 void _computeFaceFaceCellAdjacency(ItemPairGroupImpl* array);
119
120 using GetItemVectorViewFunctor = std::function<ItemConnectedListViewType(Item)>;
121 void _computeAdjacency(ItemPairGroupImpl* array, GetItemVectorViewFunctor get_item_enumerator,
122 GetItemVectorViewFunctor get_sub_item_enumerator);
123};
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128} // End namespace Arcane
129
130/*---------------------------------------------------------------------------*/
131/*---------------------------------------------------------------------------*/
132
133#endif
Implémentation d'un tableau de listes d'entités.
Tableau de listes d'entités.
Classe de base d'un élément de maillage.
Definition Item.h:83
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:149
Interface du gestionnaire de traces.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
ItemConnectedListView< DynExtent > ItemConnectedListViewType
Liste d'entités connectées.
Definition ItemTypes.h:347
eItemKind
Genre d'entité de maillage.
@ IK_Unknown
Entité de maillage de genre inconnu ou non initialisé