Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
NodeFamily.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/* NodeFamily.h (C) 2000-2024 */
9/* */
10/* Famille de noeuds. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_NODEFAMILY_H
13#define ARCANE_MESH_NODEFAMILY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IItemFamilyModifier.h"
18
19#include "arcane/mesh/ItemFamily.h"
20#include "arcane/mesh/MeshInfos.h"
21#include "arcane/mesh/ItemInternalConnectivityIndex.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane::mesh
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
34class ARCANE_MESH_EXPORT NodeFamily
35: public ItemFamily
37{
38 class ItemCompare2;
39 class ItemCompare3;
40 class TopologyModifier;
41
47
48 public:
49
50 NodeFamily(IMesh* mesh,const String& name);
51 virtual ~NodeFamily(); //<! Libère les ressources
52
53 public:
54
55 void build() override;
56 void computeSynchronizeInfos() override;
57 void _endAllocate() override;
58
59 public:
60
61 void preAllocate(Integer nb_item);
62
63 public:
64
65 /*---------------------------------------------------------------------------*/
66 /*---------------------------------------------------------------------------*/
75 // IItemFamilyModifier interface
77 {
78 ARCANE_ASSERT((type_id == IT_Vertex),("Creating node with a type not equal to IT_Vertex"));
79 ARCANE_UNUSED(type_id);
80 ++mesh_info.nbNode();
81 return allocOne(uid);
82 }
83
84 ItemInternal* allocOne(Int64 uid)
85 {
86 ItemInternal* item = _allocOne(uid);
87 m_item_internal_list->nodes = _itemsInternal();
88 _allocateInfos(item,uid,m_node_type);
89 return item;
90 }
91
92 // IItemFamilyModifier interface
93 Item findOrAllocOne(Int64 uid,ItemTypeId type_id,MeshInfos& mesh_info, bool& is_alloc) override
94 {
95 ARCANE_ASSERT((type_id == IT_Vertex),("Creating node with a type not equal to IT_Vertex"));
96 ARCANE_UNUSED(type_id);
97 auto node = findOrAllocOne(uid,is_alloc);
98 if (is_alloc)
99 ++mesh_info.nbNode();
100 return node;
101 }
102
103 ItemInternal* findOrAllocOne(Int64 uid,bool& is_alloc)
104 {
105 ItemInternal* item = _findOrAllocOne(uid,is_alloc);
106 if (is_alloc){
107 m_item_internal_list->nodes = _itemsInternal();
108 _allocateInfos(item,uid,m_node_type);
109 }
110 return item;
111 }
112
113 // IItemFamilyModifier interface
114 IItemFamily* family() override {return this;}
115
116 void replaceEdge(ItemLocalId node,Integer index,ItemLocalId edge);
117 void replaceFace(ItemLocalId node,Integer index,ItemLocalId face);
118 void replaceCell(ItemLocalId node,Integer index,ItemLocalId cell);
119
120 void addCellToNode(Node node,Cell new_cell);
121 void addFaceToNode(Node node,Face new_face);
122 void addEdgeToNode(Node node,Edge new_edge);
123 void removeEdgeFromNode(ItemLocalId node,ItemLocalId edge_to_remove);
124 void removeFaceFromNode(ItemLocalId node,ItemLocalId face_to_remove);
125 void removeCellFromNode(Node node,ItemLocalId cell_to_remove_lid);
127 void removeNodeIfNotConnected(Node node);
128
129 VariableNodeReal3& nodesCoordinates()
130 {
131 ARCANE_ASSERT((m_nodes_coords),("NodeFamily::nodesCoordinates is available only on primary meshes"));
132 return *m_nodes_coords;
133 }
134
136
137 void setConnectivity(const Integer c);
138
139 void sortInternalReferences();
140
141 void notifyItemsUniqueIdChanged() override;
142
143 void _addChildNodeToNode(Node parent_node, Node child_node);
144 void _addParentNodeToNode(Node parent_node, Node child_node);
145
146 private:
147
148 ItemTypeInfo* m_node_type = nullptr;
149 Integer m_edge_prealloc = 0;
150 Integer m_face_prealloc = 0;
151 Integer m_cell_prealloc = 0;
152 Integer m_mesh_connectivity = 0;
153 bool m_no_face_connectivity = false;
154 VariableNodeReal3* m_nodes_coords = nullptr;
155 EdgeConnectivity* m_edge_connectivity = nullptr;
156 FaceConnectivity* m_face_connectivity = nullptr;
157 CellConnectivity* m_cell_connectivity = nullptr;
158 HParentConnectivity* m_hparent_connectivity = nullptr;
159 HChildConnectivity* m_hchild_connectivity = nullptr;
160
161 FaceFamily* m_face_family = nullptr;
163 bool m_is_sort_connected_faces_and_edges = false;
164
165 private:
166
167 inline void _removeNode(Node node);
168 void _sortConnectedItems(IItemFamily* family, IncrementalItemConnectivity* connectivity);
169};
170
171/*---------------------------------------------------------------------------*/
172/*---------------------------------------------------------------------------*/
173
174} // End namespace Arcane::mesh
175
176/*---------------------------------------------------------------------------*/
177/*---------------------------------------------------------------------------*/
178
179#endif
180
Interface de modification d'une famille.
Interface d'une famille d'entités.
Structure interne d'une entité de maillage.
Type d'une entité (Item).
Definition ItemTypeId.h:32
Infos sur un type d'entité du maillage.
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
Noeud d'un maillage.
Definition Dom.h:204
Famille de faces.
Definition FaceFamily.h:53
Connectivité incrémentale item->item[].
Famille d'entités.
Definition ItemFamily.h:76
Classe factorisant des informations sur le maillage.
Definition MeshInfos.h:36
Famille de noeuds.
Definition NodeFamily.h:37
Item allocOne(Int64 uid, ItemTypeId type_id, MeshInfos &mesh_info) override
Alloue une face de numéro unique uid et de type type.
Definition NodeFamily.h:76
Chaîne de caractères unicode.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.