Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
EdgeFamily.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* EdgeFamily.h (C) 2000-2025 */
9/* */
10/* Edge family. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_EDGEFAMILY_H
13#define ARCANE_MESH_EDGEFAMILY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IItemFamilyModifier.h"
18
19#include "arcane/mesh/ItemFamily.h"
20#include "arcane/mesh/ItemInternalConnectivityIndex.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Arcane::mesh
26{
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
33class ARCANE_MESH_EXPORT EdgeFamily
34: public ItemFamily
36{
37 class TopologyModifier;
41
42 public:
43
44 EdgeFamily(IMesh* mesh, const String& name);
45 virtual ~EdgeFamily(); //<! Releases resources
46
47 public:
48
49 virtual void build() override;
50 virtual void preAllocate(Integer nb_item);
51 virtual void computeSynchronizeInfos() override;
52
53 public:
54
56 // IItemFamilyModifier interface
57 Item allocOne(Int64 uid, ItemTypeId type_id, MeshInfos& mesh_info) override;
58 Item findOrAllocOne(Int64 uid, ItemTypeId type_id, MeshInfos& mesh_info, bool& is_alloc) override;
59 IItemFamily* family() override { return this; }
60
62 ItemInternal* findOrAllocOne(Int64 uid, bool& is_alloc);
63
64 void replaceNode(ItemLocalId edge, Integer index, ItemLocalId node);
65
67 void addCellToEdge(Edge edge, Cell new_cell);
69 void addFaceToEdge(Edge edge, Face new_face);
71 void removeCellFromEdge(Edge edge, ItemLocalId cell_to_remove_lid);
73 void removeFaceFromEdge(ItemLocalId edge, ItemLocalId face_to_remove);
76
78
79 void setConnectivity(const Integer c);
80
81 void reorientEdgesIfNeeded();
82
83 protected:
84
85 ItemTypeInfo* m_edge_type = nullptr;
86 bool m_has_edge = false;
87 Integer m_node_prealloc = 0;
88 Integer m_face_prealloc = 0;
89 Integer m_cell_prealloc = 0;
90 Integer m_mesh_connectivity = 0;
91 NodeConnectivity* m_node_connectivity = nullptr;
92 FaceConnectivity* m_face_connectivity = nullptr;
93 CellConnectivity* m_cell_connectivity = nullptr;
94
95 private:
96
99
100 inline void _removeEdge(Edge edge);
101 inline void _createOne(ItemInternal* item, Int64 uid);
102};
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107} // End namespace Arcane::mesh
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112#endif
Cell of a mesh.
Definition Item.h:1300
Edge of a cell.
Definition Item.h:875
Face of a cell.
Definition Item.h:1032
Interface for modifying a family.
Interface of an entity family.
Definition IItemFamily.h:83
Internal structure of a mesh entity.
Index of an Item in a variable.
Definition ItemLocalId.h:42
Type of an entity (Item).
Definition ItemTypeId.h:33
Info on a mesh entity type.
Base class for a mesh element.
Definition Item.h:84
void removeCellFromEdge(Edge edge, ItemLocalId cell_to_remove_lid)
Removes a cell from an edge.
virtual void computeSynchronizeInfos() override
Constructs the structures necessary for synchronization.
void removeFaceFromEdge(ItemLocalId edge, ItemLocalId face_to_remove)
Removes a face from an edge.
Item findOrAllocOne(Int64 uid, ItemTypeId type_id, MeshInfos &mesh_info, bool &is_alloc) override
Retrieves or allocates a unique numbered edge uid and of type type.Generic item addition.
void setConnectivity(const Integer c)
Sets the active connectivity for the associated mesh.
NodeFamily * m_node_family
Node family associated with this family.
Definition EdgeFamily.h:98
void removeEdgeIfNotConnected(Edge edge)
Removes the edge if it is no longer connected.
void addFaceToEdge(Edge edge, Face new_face)
Adds a neighboring face to an edge.
void replaceNode(ItemLocalId edge, Integer index, ItemLocalId node)
Replaces the node at index index of the edge edge with * that of localId() node_lid.
Item allocOne(Int64 uid, ItemTypeId type_id, MeshInfos &mesh_info) override
Version called in generic item addition.
void addCellToEdge(Edge edge, Cell new_cell)
Adds a neighboring cell to an edge.
Selection between historical and on-demand connectivities.
IMesh * mesh() const override
Associated mesh.
String name() const override
Family name.
Definition ItemFamily.h:140
Class containing mesh information.
Definition MeshInfos.h:36
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.