Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
internal/MeshComponentPartData.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/* MeshComponentPartData.h (C) 2000-2024 */
9/* */
10/* Data separated into pure and impure parts of a constituent. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_MESHCOMPONENTPARTDATA_H
13#define ARCANE_MATERIALS_INTERNAL_MESHCOMPONENTPARTDATA_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/UniqueArray.h"
19#include "arcane/utils/FixedArray.h"
20
21#include "arcane/core/materials/MatVarIndex.h"
22#include "arcane/core/materials/ComponentItemInternal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::Materials
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
39class MeshComponentPartData
40: public TraceAccessor
41{
42 public:
43
44 MeshComponentPartData(IMeshComponent* component, const String& debug_name);
45
46 public:
47
48 Int32 impureVarIdx() const { return m_impure_var_idx; }
49
50 IMeshComponent* component() const { return m_component; }
51
52 void checkValid();
53
56
59
62
63 /*
64 * \brief Functor to recalculate the pure and impure parts following a modification.
65 *
66 * If this functor is not set, then the instance must be updated manually
67 * via the call to _setFromMatVarIndexes(). \a func must remain valid
68 * during the entire lifetime of this instance
69 */
70 void setRecomputeFunctor(IFunctor* func) { m_compute_functor = func; }
71
72 void setNeedRecompute() { m_is_need_recompute = true; }
73
74 public:
75
76 void _setConstituentListView(const ConstituentItemLocalIdListView& v);
77 void _setFromMatVarIndexes(ConstArrayView<MatVarIndex> matvar_indexes, RunQueue& queue);
78 void _setFromMatVarIndexes(ConstArrayView<MatVarIndex> globals,
80
81 private:
82
85
88
91
94
97
98 IFunctor* m_compute_functor = nullptr;
99 bool m_is_need_recompute = false;
100
101 public:
102
103 // This function is private but must be made public to compile with CUDA.
105
106 private:
107
108 void _checkNeedRecompute();
109};
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114} // End namespace Arcane::Materials
115
116/*---------------------------------------------------------------------------*/
117/*---------------------------------------------------------------------------*/
118
119#endif
Constant view of an array of type T.
View of a ConstituentItemLocalIdList instance.
Interface of a component (material or environment) of a mesh.
FixedArray< UniqueArray< Int32 >, 2 > m_items_internal_indexes
List of indices in m_items_internal for each material cell.
ComponentPurePartItemVectorView pureView()
View of the pure part.
ConstituentItemLocalIdListView m_constituent_list_view
List of ComponentItems for this constituent.
Int32 m_impure_var_idx
Index of the constituent for accessing partial values.
FixedArray< UniqueArray< Int32 >, 2 > m_value_indexes
List of valueIndex() for each part.
void _notifyValueIndexesChanged(RunQueue *queue)
Notification of changes to m_values_indexes.
ComponentImpurePartItemVectorView impureView()
View of the impure part.
IMeshComponent * m_component
Constituent manager.
ComponentPartItemVectorView partView(eMatPart part)
View of the part.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Always enables tracing in Arcane parts concerning materials.
eMatPart
Part of a component.
std::int32_t Int32
Signed integer type of 32 bits.