Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshMaterialVariablePrivate.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/* MeshMaterialVariablePrivate.h (C) 2000-2024 */
9/* */
10/* Private section of a variable on a mesh material. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATERIALS_INTERNAL_MESHMATERIALVARIABLEPRIVATE_H
13#define ARCANE_MATERIALS_INTERNAL_MESHMATERIALVARIABLEPRIVATE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Array.h"
18#include "arcane/utils/ScopedPtr.h"
19
20#include "arcane/core/VariableDependInfo.h"
21#include "arcane/core/materials/internal/IMeshMaterialVariableInternal.h"
22
23#include "arcane/materials/MeshMaterialVariableDependInfo.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30class IObserver;
31}
32
33namespace Arcane::Materials
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
43class MeshMaterialVariablePrivate
45{
46 public:
47
48 MeshMaterialVariablePrivate(const MaterialVariableBuildInfo& v, MatVarSpace mvs,
49 MeshMaterialVariable* variable);
50 ~MeshMaterialVariablePrivate();
51
52 public:
53
54 MatVarSpace space() const { return m_var_space; }
55 bool hasRecursiveDepend() const { return m_has_recursive_depend; }
56 const String& name() const { return m_name; }
57 IMeshMaterialMng* materialMng() const { return m_material_mng; }
58 IMeshMaterialVariableInternal* _internalApi() { return this; }
59
60 public:
61
62 Int32 dataTypeSize() const override;
64 Span<std::byte> bytes, RunQueue* queue) const override;
65
67 Span<const std::byte> bytes, RunQueue* queue) override;
68
70
71 void saveData(IMeshComponent* component, IData* data) override;
72
73 void restoreData(IMeshComponent* component, IData* data, Integer data_index,
74 Int32ConstArrayView ids, bool allow_null_id) override;
75
77
79
81 {
82 return m_refs.view();
83 }
84 void syncReferences(bool check_resize) override;
86
87 public:
88
89 Int32 m_nb_reference = 0;
90 MeshMaterialVariableRef* m_first_reference = nullptr;
91
92 private:
93
95 IMeshMaterialMng* m_material_mng = nullptr;
96
97 public:
98
106
107 bool m_keep_on_change = true;
108 IObserver* m_global_variable_changed_observer = nullptr;
109
112
115
118
121
122 private:
123
124 bool m_has_recursive_depend = true;
126 MeshMaterialVariable* m_variable = nullptr;
127};
128
129/*---------------------------------------------------------------------------*/
130/*---------------------------------------------------------------------------*/
131
132} // namespace Arcane::Materials
133
134/*---------------------------------------------------------------------------*/
135/*---------------------------------------------------------------------------*/
136
137#endif
Constant view of an array of type T.
Interface of a data item.
Definition IData.h:34
Arguments for methods copying between partial and global values.
Interface of a component (material or environment) of a mesh.
Interface for the material and environment manager of a mesh.
Arcane internal API for 'IMeshMaterialVariable'.
Arguments for methods copying between partial and global values.
UniqueArray< VariableRef * > m_refs
Stores references to array variables used to store values per material. A reference must be kept to p...
void restoreData(IMeshComponent *component, IData *data, Integer data_index, Int32ConstArrayView ids, bool allow_null_id) override
void copyBetweenPartialAndGlobal(const CopyBetweenPartialAndGlobalArgs &args) override
UniqueArray< VariableDependInfo > m_depends
List of dependencies for this variable.
UniqueArray< Int64 > m_modified_times
Tag of the last modification per material.
void copyToBuffer(SmallSpan< const MatVarIndex > matvar_indexes, Span< std::byte > bytes, RunQueue *queue) const override
Copies the variable values into a buffer.
ScopedPtrT< IMeshMaterialVariableComputeFunction > m_compute_function
Calculation function.
ConstArrayView< VariableRef * > variableReferenceList() const override
List of 'VariableRef' associated with this variable.
UniqueArray< MeshMaterialVariableDependInfo > m_mat_depends
List of dependencies for this variable.
Ref< IData > internalCreateSaveDataRef(Integer nb_value) override
void copyFromBuffer(SmallSpan< const MatVarIndex > matvar_indexes, Span< const std::byte > bytes, RunQueue *queue) override
Copies the variable values from a buffer.
void syncReferences(bool check_resize) override
Synchronizes references.
Int32 dataTypeSize() const override
Byte size to save a variable value.
void resizeForIndexer(ResizeVariableIndexerArgs &args) override
Resizes the partial value associated with index index.
void initializeNewItemsWithZero(InitializeWithZeroArgs &args) override
Initialize the values of new components with zero.
void saveData(IMeshComponent *component, IData *data) override
Base class for material variables.
Arguments for methods copying between partial and global values.
Reference to an instance.
Encapsulation of an automatically destructing pointer.
Definition ScopedPtr.h:44
View of an array of elements of type T.
Definition Span.h:805
View of an array of elements of type T.
Definition Span.h:635
1D data vector with value semantics (STL style).
Always enables tracing in Arcane parts concerning materials.
MatVarSpace
Definition space for a material variable.
@ MaterialAndEnvironment
Variable having values on environments and materials.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
std::int32_t Int32
Signed integer type of 32 bits.