Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ComponentItemInternalData.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/* ComponentItemInternalData.h (C) 2000-2024 */
9/* */
10/* Gestion des listes de 'ComponentItemInternal'. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_COMPONENTITEMINTERNALDATA_H
13#define ARCANE_MATERIALS_INTERNAL_COMPONENTITEMINTERNALDATA_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Array.h"
19#include "arcane/utils/NumArray.h"
20
22#include "arcane/core/materials/ComponentItemInternal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::Materials
28{
29class MeshMaterialMng;
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
39{
40 public:
41
43 {};
45 {
47
48 private:
49
51 : m_current_value(current_value)
52 , m_last_value(last_value)
53 {}
54
55 public:
56
57 ConstituentItemIndex operator*() const { return ConstituentItemIndex(m_current_value); }
58 void operator++() { ++m_current_value; }
59 bool operator==(const Sentinel&) const
60 {
61 return m_current_value == m_last_value;
62 }
63 bool operator!=(const Sentinel&) const
64 {
65 return m_current_value != m_last_value;
66 }
67
68 private:
69
70 Int32 m_current_value = 0;
71 Int32 m_last_value = 0;
72 };
73
74 public:
75
76 ARCCORE_HOST_DEVICE ConstituentItemIndex operator[](Int32 index) const
77 {
78 ARCANE_CHECK_AT(index, m_nb_value);
79 return ConstituentItemIndex(m_first_index + index);
80 }
81
82 public:
83
84 void setRange(Int32 first_index, Int32 nb_value)
85 {
86 m_first_index = first_index;
87 m_nb_value = nb_value;
88 }
89 Iterator begin() const
90 {
91 return Iterator(m_first_index, m_first_index + m_nb_value);
92 }
93 Sentinel end() const
94 {
95 return {};
96 }
97 Int32 size() const { return m_nb_value; }
98 ConstituentItemIndex firstValue() const { return ConstituentItemIndex(m_first_index); }
99
100 private:
101
102 Int32 m_first_index = -1;
103 Int32 m_nb_value = 0;
104};
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
116: public TraceAccessor
117{
118 public:
119
122 {
123 public:
124
126
127 public:
128
129 void resize(Int32 new_size, ComponentItemSharedInfo* shared_info, RunQueue& queue);
130 Int32 size() const { return m_size; }
131
132 private:
133
134 Int32 m_size = 0;
135 UniqueArray<ConstituentItemIndex> m_first_sub_constituent_item_id_list;
136 UniqueArray<ConstituentItemIndex> m_super_component_item_local_id_list;
137 UniqueArray<Int16> m_component_id_list;
138 UniqueArray<Int16> m_nb_sub_constituent_item_list;
139 UniqueArray<Int32> m_global_item_local_id_list;
140 UniqueArray<MatVarIndex> m_var_index_list;
141
142 private:
143
145 const String& base_name, const String& name);
146 };
147
148 public:
149
151
152 public:
153
155 void endCreate();
156
157 public:
158
161
163 ComponentItemSharedInfo* sharedInfo(Int16 level) { return &m_shared_infos[level]; }
164 ComponentItemSharedInfo* allEnvSharedInfo() { return sharedInfo(LEVEL_ALLENVIRONMENT); }
165 ComponentItemSharedInfo* envSharedInfo() { return sharedInfo(LEVEL_ENVIRONMENT); }
166 ComponentItemSharedInfo* matSharedInfo() { return sharedInfo(LEVEL_MATERIAL); }
167
168 private:
169
170 MeshMaterialMng* m_material_mng = nullptr;
171
174
175 ComponentItemInternalRange m_all_env_items_internal_range;
176 ComponentItemInternalRange m_env_items_internal_range;
177
178 Storage m_all_env_storage;
179 Storage m_env_storage;
180 Storage m_mat_storage;
181
182 private:
183
184 void _initSharedInfos();
185 static MemoryAllocationOptions _allocOptions();
186
187 public:
188
190 void _resetItemsInternal();
191};
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
196} // namespace Arcane::Materials
197
198/*---------------------------------------------------------------------------*/
199/*---------------------------------------------------------------------------*/
200
201#endif
File d'exécution pour un accélérateur.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Conteneur pour les informations de ComponentItemSharedInfo.
Gestion des listes de 'ComponentItemInternal'.
void endCreate()
Notification de la fin de création des milieux/matériaux.
void resizeComponentItemInternals(Int32 max_local_id, Int32 total_env_cell)
Redimensionne les structures allouant les 'ComponentItemInternal'.
void _resetItemsInternal()
Réinitialise les ComponentItemInternal associés aux EnvCell et AllEnvCell.
ComponentItemSharedInfo * sharedInfo(Int16 level)
Instance partagée associée au niveau level.
UniqueArray< ComponentItemSharedInfo > m_shared_infos
Liste des informations partagées.
Interval des identifiants des constituants dans la liste des ComponentItemInternal.
Informations partagées sur les 'ComponentItem'.
Index d'une entité constituant dans la liste des entités constituants.
Implémentation d'un gestion des matériaux.
Options pour configurer les allocations.
Chaîne de caractères unicode.
Active toujours les traces dans les parties Arcane concernant les matériaux.