Arcane  v4.1.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
ItemAllocationInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* ItemAllocationInfo (C) 2000-2025 */
9/* */
10/* AllocationInfo for mesh using eItemAllocationInfo mode */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_ITEMALLOCATIONINFO_H
13#define ARCANE_ITEMALLOCATIONINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/utils/UniqueArray.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30{
31 public:
32
34 {
35 String name;
36 eItemKind item_kind;
37 String connectivity_name;
38 Int32ConstSmallSpan nb_connected_items_per_item;
39 Int64ConstSmallSpan connected_items_uids;
40 // If ItemAllocation has to own the data use the followings.
41 // In this case, Store a view in the corresponding spans using method updateViewsFromInternalData().
42 Int32UniqueArray _nb_connected_items_per_item_data;
43 Int64UniqueArray _connected_items_uids_data;
44
45 void updateViewsFromInternalData()
46 {
47 nb_connected_items_per_item = _nb_connected_items_per_item_data.constSmallSpan();
48 connected_items_uids = _connected_items_uids_data.constSmallSpan();
49 }
50 };
51
53 {
54 String name;
55 eItemKind item_kind;
56 Int64ConstSmallSpan item_uids;
57 UniqueArray<ConnectedFamilyInfo> connected_family_infos;
58 Real3ConstSmallSpan item_coordinates; // if needed
59 String item_coordinates_variable_name; // if needed
60 Int32UniqueArray item_owners; // if needed
61 // If ItemAllocation has to own the data use the followings.
62 // In this case, Store a view in the corresponding spans using method updateViewsFromInternalData().
63 Int64UniqueArray _item_uids_data;
64 Real3UniqueArray _item_coordinates_data;
65
66 void updateViewsFromInternalData()
67 {
68 item_uids = _item_uids_data.constSmallSpan();
69 item_coordinates = _item_coordinates_data.constSmallSpan();
70 for (auto& connected_family_info : connected_family_infos) {
71 connected_family_info.updateViewsFromInternalData();
72 }
73 }
74
75 void clear()
76 {
77 name = String{};
78 item_kind = IK_Unknown;
79 item_uids = Int64ConstSmallSpan{};
80 connected_family_infos.clear();
81 item_coordinates = Real3ConstSmallSpan{};
82 item_coordinates_variable_name = String{};
83 _item_uids_data.clear();
84 _item_coordinates_data.clear();
85 item_owners.clear();
86 }
87 };
88 UniqueArray<FamilyInfo> family_infos;
89
90 // To use if ItemAllocationInfo has to own the data. The views will point to the stored data
91 void updateViewsFromInternalData()
92 {
93 for (auto& family_info : family_infos) {
94 family_info.updateViewsFromInternalData();
95 }
96 }
97
98 void clear()
99 {
100 family_infos.clear();
101 }
102};
103
104} // End namespace Arcane
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109#endif //ARCANE_ITEMALLOCATIONINFO_H
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
Déclarations des types généraux de Arcane.
void clear()
Supprime les éléments du tableau.
Chaîne de caractères unicode.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
UniqueArray< Int64 > Int64UniqueArray
Tableau dynamique à une dimension d'entiers 64 bits.
Definition UtilsTypes.h:355
UniqueArray< Real3 > Real3UniqueArray
Tableau dynamique à une dimension de vecteurs de rang 3.
Definition UtilsTypes.h:379
SmallSpan< const Real3 > Real3ConstSmallSpan
Vue en lecture seule d'un tableau à une dimension de Real3.
Definition UtilsTypes.h:648
UniqueArray< Int32 > Int32UniqueArray
Tableau dynamique à une dimension d'entiers 32 bits.
Definition UtilsTypes.h:357
eItemKind
Genre d'entité de maillage.
@ IK_Unknown
Entité de maillage de genre inconnu ou non initialisé
SmallSpan< const Int64 > Int64ConstSmallSpan
Vue en lecture seule d'un tableau à une dimension d'entiers 64 bits.
Definition UtilsTypes.h:632
SmallSpan< const Int32 > Int32ConstSmallSpan
Vue en lecture seule d'un tableau à une dimension d'entiers 32 bits.
Definition UtilsTypes.h:634