Arcane  4.2.3.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
FullItemInfo.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/* FullItemInfo.h (C) 2000-2026 */
9/* */
10/* Information de sérialisation d'une maille. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_FULLCELLINFO_H
13#define ARCANE_MESH_FULLCELLINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/mesh/MeshGlobal.h"
18
19#include "arcane/utils/CheckedConvert.h"
20
21#include "arcane/core/ItemTypeMng.h"
23#include "arcane/core/ItemTypeId.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane::mesh
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
38{
39 public:
40 enum
41 { // parent info
42 PI_Node = 1 << 1,
43 PI_Edge = 1 << 2,
44 PI_Face = 1 << 3,
45 PI_Cell = 1 << 4
46 };
47
48 public:
54 FullCellInfo(Int64ConstArrayView cells_infos, Integer cell_index,
55 ItemTypeMng* itm, Integer parent_info,
56 bool has_edge, bool has_amr, bool with_flags=false);
57
58 public:
59
60 ItemTypeInfo* typeInfo() const { return m_type; }
61 Integer typeId() const { return CheckedConvert::toInteger(m_infos[0]); }
62 ItemTypeId itemTypeId() const { return ItemTypeId(CheckedConvert::toInt16(m_infos[0])); }
63 Int64 uniqueId() const { return m_infos[1]; }
64 Int32 owner() const { return CheckedConvert::toInt32(m_infos[2]); }
65 Integer nbNode() const { return m_nb_node; }
66 Integer nbEdge() const { return m_nb_edge; }
67 Integer nbFace() const { return m_nb_face; }
68 Int64 faceUniqueId(Integer index) const { return m_infos[m_first_face + (index*2)]; }
69 Int32 faceOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[m_first_face + (index*2) + 1]); }
70 Int64 edgeUniqueId(Integer index) const { return m_infos[m_first_edge + (index*2)]; }
71 Int32 edgeOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[m_first_edge + (index*2) + 1]); }
72 Int64 nodeUniqueId(Integer index) const { return m_infos[3 + (index*2)]; }
73 Int32 nodeOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[3 + (index*2) + 1]); }
74 Integer memoryUsed() const { return m_memory_used; }
75 bool hasParentNode() const { return (m_parent_info & PI_Node); }
76 Int64 parentNodeUniqueId(Integer index) const { return m_infos[m_first_parent_node + index]; }
77 bool hasParentEdge() const { return (m_parent_info & PI_Edge); }
78 Int64 parentEdgeUniqueId(Integer index) const { return m_infos[m_first_parent_edge + (index*2)]; }
79 Int64 parentEdgeTypeId(Integer index) const { return m_infos[m_first_parent_edge + (index*2) + 1]; }
80 bool hasParentFace() const { return (m_parent_info & PI_Face); }
81 Int64 parentFaceUniqueId(Integer index) const { return m_infos[m_first_parent_face + (index*2)]; }
82 Int64 parentFaceTypeId(Integer index) const { return m_infos[m_first_parent_face + (index*2) + 1]; }
83 bool hasParentCell() const { return (m_parent_info & PI_Cell); }
84 Int64 parentCellUniqueId() const { return m_infos[m_first_parent_cell]; }
85 Int64 parentCellTypeId() const { return m_infos[m_first_parent_cell + 1]; }
87 Integer level() const { return CheckedConvert::toInteger(m_infos[m_first_hParent_cell]); }
88 Int64 hParentCellUniqueId() const { return m_infos[m_first_hParent_cell + 1]; }
89 Integer whichChildAmI () const { return CheckedConvert::toInteger(m_infos[m_first_hParent_cell + 2]); }
90 Int32 flags() const { return CheckedConvert::toInt32(m_with_flags?m_infos[m_first_hParent_cell + 3]:0) ; }
91
92 friend inline std::ostream& operator<<(std::ostream& o,const FullCellInfo& i)
93 {
94 i.print(o);
95 return o;
96 }
97
98 public:
99
100 void print(std::ostream& o) const;
101
102 public:
103
105
106 ARCCORE_DEPRECATED_2020("Use dump() overload with buffer")
107 static Integer memoryUsed(ItemTypeInfo* it, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
108 ARCCORE_DEPRECATED_2020("Use dump() overload with buffer")
109 static void dump(ItemInternal* cell, ISerializer* buf, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
110
111 static void dump(Cell cell, Array<Int64>& buf, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
112 static Integer parentInfo(IMesh* mesh);
113
114 protected:
115
116 void _setInternalInfos();
117
118 public:
119
120 Int64ConstArrayView m_infos;
121
122 private:
123
124 Integer m_nb_node;
125 Integer m_nb_edge;
126 Integer m_nb_face;
127
128 public:
129
130 Integer m_first_edge;
131 Integer m_first_face;
132 Integer m_memory_used;
133 ItemTypeInfo* m_type;
134 Integer m_first_parent_node;
135 Integer m_first_parent_edge;
136 Integer m_first_parent_face;
137 Integer m_first_parent_cell;
138 Integer m_parent_info;
139 bool m_has_edge;
142 bool m_has_amr;
143 bool m_with_flags;
144};
145
146/*---------------------------------------------------------------------------*/
147/*---------------------------------------------------------------------------*/
148
149} // End namespace Arcane::mesh
150
151/*---------------------------------------------------------------------------*/
152/*---------------------------------------------------------------------------*/
153
154#endif
Déclarations de types sur les entités.
Type d'une entité (Item).
Definition ItemTypeId.h:32
Infos sur un type d'entité du maillage.
Gestionnaire des types d'entités d'un maillage.
Definition ItemTypeMng.h:64
Integer level() const
AMR.
FullCellInfo(Int64ConstArrayView cells_infos, Integer cell_index, ItemTypeMng *itm, Integer parent_info, bool has_edge, bool has_amr, bool with_flags=false)
Référence les infos d'une maille.
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
Definition UtilsTypes.h:478
@ Cell
Le maillage est AMR par maille.
Definition MeshKind.h:52
std::int32_t Int32
Type entier signé sur 32 bits.