Arcane  v3.14.10.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-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/* FullItemInfo.h (C) 2000-2022 */
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/ItemTypeMng.h"
22#include "arcane/ItemTypes.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::mesh
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
37{
38 public:
39 enum
40 { // parent info
41 PI_Node = 1 << 1,
42 PI_Edge = 1 << 2,
43 PI_Face = 1 << 3,
44 PI_Cell = 1 << 4
45 };
46
47 public:
54 ItemTypeMng* itm, Integer parent_info,
55 bool has_edge, bool has_amr, bool with_flags=false);
56
57 public:
58
59 ItemTypeInfo* typeInfo() const { return m_type; }
60 Integer typeId() const { return CheckedConvert::toInteger(m_infos[0]); }
61 Int64 uniqueId() const { return m_infos[1]; }
62 Integer owner() const { return CheckedConvert::toInteger(m_infos[2]); }
63 Integer nbNode() const { return m_nb_node; }
64 Integer nbEdge() const { return m_nb_edge; }
65 Integer nbFace() const { return m_nb_face; }
66 Int64 faceUniqueId(Integer index) const { return m_infos[m_first_face + (index*2)]; }
67 Int32 faceOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[m_first_face + (index*2) + 1]); }
68 Int64 edgeUniqueId(Integer index) const { return m_infos[m_first_edge + (index*2)]; }
69 Int32 edgeOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[m_first_edge + (index*2) + 1]); }
70 Int64 nodeUniqueId(Integer index) const { return m_infos[3 + (index*2)]; }
71 Int32 nodeOwner(Integer index) const { return CheckedConvert::toInt32(m_infos[3 + (index*2) + 1]); }
72 Integer memoryUsed() const { return m_memory_used; }
73 bool hasParentNode() const { return (m_parent_info & PI_Node); }
74 Int64 parentNodeUniqueId(Integer index) const { return m_infos[m_first_parent_node + index]; }
75 bool hasParentEdge() const { return (m_parent_info & PI_Edge); }
76 Int64 parentEdgeUniqueId(Integer index) const { return m_infos[m_first_parent_edge + (index*2)]; }
77 Int64 parentEdgeTypeId(Integer index) const { return m_infos[m_first_parent_edge + (index*2) + 1]; }
78 bool hasParentFace() const { return (m_parent_info & PI_Face); }
79 Int64 parentFaceUniqueId(Integer index) const { return m_infos[m_first_parent_face + (index*2)]; }
80 Int64 parentFaceTypeId(Integer index) const { return m_infos[m_first_parent_face + (index*2) + 1]; }
81 bool hasParentCell() const { return (m_parent_info & PI_Cell); }
82 Int64 parentCellUniqueId() const { return m_infos[m_first_parent_cell]; }
83 Int64 parentCellTypeId() const { return m_infos[m_first_parent_cell + 1]; }
85 Integer level() const { return CheckedConvert::toInteger(m_infos[m_first_hParent_cell]); }
86 Int64 hParentCellUniqueId() const { return m_infos[m_first_hParent_cell + 1]; }
87 Integer whichChildAmI () const { return CheckedConvert::toInteger(m_infos[m_first_hParent_cell + 2]); }
88 Int32 flags() const { return CheckedConvert::toInt32(m_with_flags?m_infos[m_first_hParent_cell + 3]:0) ; }
89
90 friend inline std::ostream& operator<<(std::ostream& o,const FullCellInfo& i)
91 {
92 i.print(o);
93 return o;
94 }
95
96 public:
97
98 void print(std::ostream& o) const;
99
100 public:
101
103
104 ARCCORE_DEPRECATED_2020("Use dump() overload with buffer")
105 static Integer memoryUsed(ItemTypeInfo* it, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
106 ARCCORE_DEPRECATED_2020("Use dump() overload with buffer")
107 static void dump(ItemInternal* cell, ISerializer* buf, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
108
109 static void dump(Cell cell, Array<Int64>& buf, Integer parent_info, bool has_edge, bool has_amr,bool with_flags);
110 static Integer parentInfo(IMesh* mesh);
111
112 protected:
113
114 void _setInternalInfos();
115
116 public:
117
118 Int64ConstArrayView m_infos;
119
120 private:
121
122 Integer m_nb_node;
123 Integer m_nb_edge;
124 Integer m_nb_face;
125
126 public:
127
128 Integer m_first_edge;
129 Integer m_first_face;
130 Integer m_memory_used;
131 ItemTypeInfo* m_type;
132 Integer m_first_parent_node;
133 Integer m_first_parent_edge;
134 Integer m_first_parent_face;
135 Integer m_first_parent_cell;
136 Integer m_parent_info;
137 bool m_has_edge;
140 bool m_has_amr;
141 bool m_with_flags;
142};
143
144/*---------------------------------------------------------------------------*/
145/*---------------------------------------------------------------------------*/
146
147} // End namespace Arcane::mesh
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152#endif
Infos sur un type d'entité du maillage.
Gestionnaire des types d'entités de maillage.
Definition ItemTypeMng.h:66
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Infos pour créer/sérialiser une maille connaissant les uniqueId() et owner() de toutes ces sous-entit...
Integer level() const
AMR.
Vue constante d'un tableau de type T.
Integer toInteger(Real r)
Converti un Int64 en un Integer.
Int32 toInt32(Int64 v)
Converti un Int64 en un Int32.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
Definition UtilsTypes.h:638