Arcane  v3.14.10.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-2022 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-2022 */
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/IMeshUtilities.h"
20#include "arcane/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 AdjencyType& 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:
78 ItemPairGroupImpl* array,ComputeFunctor func_ptr)
79 : m_ptr(ptr), m_array(array), m_func_ptr(func_ptr) {}
80 public:
81 virtual void executeFunctor()
82 {
83 (m_ptr->*m_func_ptr)(m_array);
84 }
85 private:
87 ItemPairGroupImpl* m_array;
88 ComputeFunctor m_func_ptr;
89 };
90
91 public:
92
95
96 public:
97
98 virtual void computeAdjency(ItemPairGroup adjency_array,eItemKind link_kind,
99 Integer nb_layer);
100
101
102 private:
103
104 std::map<AdjencyType,ComputeFunctor> m_compute_adjency_functions;
105
106 private:
107 void _addComputeAdjency(eItemKind ik,eItemKind sik,eItemKind lik,ComputeFunctor f);
108 void _computeCellCellNodeAdjency(ItemPairGroupImpl* array);
109 void _computeCellCellFaceAdjency(ItemPairGroupImpl* array);
110 void _computeNodeNodeCellAdjency(ItemPairGroupImpl* array);
111 void _computeFaceCellNodeAdjency(ItemPairGroupImpl* array);
112 void _computeFaceFaceNodeAdjency(ItemPairGroupImpl* array);
113 void _computeCellFaceFaceAdjency(ItemPairGroupImpl* array);
114 void _computeNodeNodeFaceAdjency(ItemPairGroupImpl* array);
115 void _computeNodeNodeEdgeAdjency(ItemPairGroupImpl* array);
116 void _computeFaceFaceEdgeAdjency(ItemPairGroupImpl* array);
117 void _computeFaceFaceCellAdjency(ItemPairGroupImpl* array);
118
119 using GetItemVectorViewFunctor = std::function<ItemConnectedListViewType(Item)>;
120 void _computeAdjency(ItemPairGroupImpl* array,GetItemVectorViewFunctor get_item_enumerator,
121 GetItemVectorViewFunctor get_sub_item_enumerator);
122};
123
124/*---------------------------------------------------------------------------*/
125/*---------------------------------------------------------------------------*/
126
127} // End namespace Arcane
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132#endif
virtual ~BasicItemPairGroupComputeFunctor()
Libère les ressources.
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:120
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é