Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
PrivateVariableScalar.inst.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/* PrivateVariableScalarT.inst.h (C) 2000-2025 */
9/* */
10/* Factorization of scalar mesh variable. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/PrivateVariableScalar.h"
15#include "arcane/core/IMesh.h"
16#include "arcane/core/ItemGroup.h"
17#include "arcane/core/Variable.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28template <class DataType>
31: MeshVariableRef(vbi)
32, m_private_part(PrivatePartType::getReference(vbi, vi))
33, m_memory_trace(nullptr)
34{
35}
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40template <class DataType>
43: MeshVariableRef(var)
44, m_private_part(PrivatePartType::getReference(var))
45, m_memory_trace(nullptr)
46{
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52template <class DataType>
54PrivateVariableScalarT(const PrivateVariableScalarT& rhs)
55: MeshVariableRef(rhs)
56, m_private_part(rhs.m_private_part)
57, m_memory_trace(rhs.m_memory_trace)
58{
59 if (m_private_part)
61}
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66template <class DataType>
69{
70}
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75template <class DataType> void
78{
80 m_private_part = rhs.m_private_part;
81 if (m_private_part)
82 updateFromInternal();
83}
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88template <class DataType> void
91{
92 arcaneCheckNull(m_private_part);
93
94 m_view.setArray(m_private_part->valueView());
95 m_memory_trace = m_private_part->memoryAccessTrace();
96#ifdef ARCANE_TRACE
97 m_access_infos = m_private_part->memoryAccessInfos();
98 m_trace_infos = m_private_part->traceInfos();
99#endif
101
102 //cout << "** UPDATE FROM INTERNAL name=" << name()
103 // << " this=" << this
104 // << '\n';
105 //cout.flush();
106
107 _executeUpdateFunctors();
108}
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
113template <class DataType> ItemGroup
115itemGroup() const
116{
117 return m_private_part->itemGroup();
118}
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123} // End namespace Arcane
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
Interface of a variable.
Definition IVariable.h:40
Mesh entity group.
Definition ItemGroup.h:51
Base class for a variable on mesh entities.
MeshVariableRef(const VariableBuildInfo &vb)
Constructs a reference linked to the module.
Class for factoring scalar variables on mesh entities.
void updateFromInternal()
Updates from the internal part.
PrivateVariableScalarT(const VariableBuildInfo &vb, const VariableInfo &vi)
Constructs a reference linked to the module.
Parameters necessary for building a variable.
Information characterizing a variable.
virtual void updateFromInternal()
Updates from the internal part.
VariableRef & operator=(const VariableRef &from)
Copy assignment operator.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --