Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
PrivateVariableArray.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/* PrivateVariableArray.inst.h (C) 2000-2025 */
9/* */
10/* Mesh variable array factorization. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/PrivateVariableArray.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>
32, m_private_part(PrivatePartType::getReference(vb, vi))
33{
34}
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39template <class DataType>
40PrivateVariableArrayT<DataType>::
41PrivateVariableArrayT(IVariable* var)
42: MeshVariableRef(var)
43, m_private_part(PrivatePartType::getReference(var))
44{
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50template <class DataType>
51PrivateVariableArrayT<DataType>::
52PrivateVariableArrayT(const PrivateVariableArrayT& rhs)
53: MeshVariableRef(rhs)
54, m_private_part(rhs.m_private_part)
55{
56 if (m_private_part)
57 updateFromInternal();
58}
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
63template <class DataType> void
64PrivateVariableArrayT<DataType>::
65operator=(const PrivateVariableArrayT& rhs)
66{
67 if (this != &rhs) {
69 m_private_part = rhs.m_private_part;
70 if (m_private_part)
72 }
73}
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78template <class DataType> void
79PrivateVariableArrayT<DataType>::
80updateFromInternal()
81{
82 ARCANE_CHECK_POINTER(m_private_part);
83 m_view = m_private_part->valueView();
85 _executeUpdateFunctors();
86}
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
90
91template <class DataType> void
93resize(Integer dim2_size)
94{
95 ARCANE_CHECK_POINTER(m_private_part);
96 m_private_part->directResize(m_private_part->valueView().dim1Size(), dim2_size);
97 updateFromInternal();
98}
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103template <class DataType> void
104PrivateVariableArrayT<DataType>::
105resizeAndReshape(const ArrayShape& shape)
106{
107 m_private_part->directResizeAndReshape(shape);
108 updateFromInternal();
109}
110
111/*---------------------------------------------------------------------------*/
112/*---------------------------------------------------------------------------*/
113
114template <class DataType> ItemGroup
115PrivateVariableArrayT<DataType>::
116itemGroup() const
117{
118 return m_private_part->itemGroup();
119}
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124} // End namespace Arcane
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
Base class for a variable on mesh entities.
Class for factoring scalar variables on mesh entities.
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 --
Int32 Integer
Type representing an integer.