Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshComponentData.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/* MeshComponentData.h (C) 2000-2025 */
9/* */
10/* Data of a constituent (material or medium) of a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_MESHCOMPONENTDATA_H
13#define ARCANE_MATERIALS_MESHCOMPONENTDATA_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/Functor.h"
19
20#include "arcane/core/ItemGroup.h"
21#include "arcane/core/materials/MatItem.h"
22#include "arcane/core/materials/internal/ConstituentItemLocalIdList.h"
23
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::Materials
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
36class MeshEnvironment;
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
52class MeshComponentData
53: public TraceAccessor
54{
55 friend class MeshEnvironment;
56 friend class MeshMaterial;
57 friend class AllEnvData;
58
59 public:
60
61 MeshComponentData(IMeshComponent* component, const String& name,
62 Int16 component_id, ComponentItemSharedInfo* shared_info,
63 bool create_indexer);
64 ~MeshComponentData() override;
65
66 public:
67
68 const String& name() const { return m_name; }
69
70 MeshMaterialVariableIndexer* variableIndexer() const
71 {
72 return m_variable_indexer;
73 }
74
75 ConstituentItemLocalIdListView constituentItemListView() const
76 {
77 return m_constituent_local_id_list.view();
78 }
79
80 private:
81
84 {
85 return m_constituent_local_id_list.itemBase(index);
86 }
87
88 void _setConstituentItem(Int32 index, ConstituentItemIndex id)
89 {
90 return m_constituent_local_id_list.setConstituentItem(index, id);
91 }
92
93 void checkValid();
94
95 public:
96
97 const ItemGroup& items() const
98 {
99 return m_items;
100 }
101
102 Int16 componentId() const
103 {
104 return m_component_id;
105 }
106
107 void setSpecificExecutionPolicy(Accelerator::eExecutionPolicy policy)
108 {
110 }
111
112 Accelerator::eExecutionPolicy specificExecutionPolicy() const
113 {
115 }
116
117 private:
118
119 void _resizeItemsInternal(Int32 nb_item);
120 void _setVariableIndexer(MeshMaterialVariableIndexer* indexer);
121 void _setItems(const ItemGroup& group);
123 void _rebuildPartData(RunQueue& queue);
124 void _buildPartData();
125 MeshComponentPartData* _partData() const { return m_part_data; }
126
127 private:
128
131
137
140
143
145 bool m_is_indexer_owner = false;
146
149
152
153 MeshComponentPartData* m_part_data = nullptr;
154 FunctorT<MeshComponentData> m_recompute_part_data_functor;
155
158
159 private:
160
161 void _setPartInfo();
162 void _rebuildPartDataDirect();
163};
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168} // namespace Arcane::Materials
169
170/*---------------------------------------------------------------------------*/
171/*---------------------------------------------------------------------------*/
172
173#endif
Functor associated with a method of a class T.
Mesh entity group.
Definition ItemGroup.h:51
Index of a constituent entity in the list of constituent entities.
View of a ConstituentItemLocalIdList instance.
List of local indices for 'ComponentItemInternal'.
Interface of a component (material or environment) of a mesh.
Interface for the material and environment manager of a mesh.
View over a vector of entities of a material.
Accelerator::eExecutionPolicy m_specific_execution_policy
Specific execution policy.
IMeshComponent * m_component
Constituent whose data is managed.
void _changeLocalIdsForInternalList(Int32ConstArrayView old_to_new_ids)
Updates the constituent's m_items_internal after a change in local numbering.
String m_name
Name of the constituent.
MeshMaterialVariableIndexer * m_variable_indexer
Info for indexing partial variables.
matimpl::ConstituentItemBase _itemBase(Int32 index) const
Returns an instance of the index-th entity in the list.
bool m_is_indexer_owner
Indicates if we own the indexer (in this case, it will be destroyed with the instance).
ConstituentItemLocalIdList m_constituent_local_id_list
List of ConstituentItemIndex for this constituent.
Int16 m_component_id
Constituent index (in the list of constituents of this type).
ItemGroup m_items
List of entities of this constituent.
Data of a part (pure or partial) of a constituent.
General information about a constituent entity.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
eExecutionPolicy
Execution policy for a Runner.
Always enables tracing in Arcane parts concerning materials.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
std::int16_t Int16
Signed integer type of 16 bits.
std::int32_t Int32
Signed integer type of 32 bits.