Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
PrivateVariableArrayT.H
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* PrivateVariableArrayT.H (C) 2000-2020 */
9/* */
10/* Factorisation de variable array du maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/PrivateVariableArray.h"
15#include "arcane/IMesh.h"
16#include "arcane/ItemGroup.h"
17#include "arcane/Variable.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28template<class DataType>
29PrivateVariableArrayT<DataType>::
30PrivateVariableArrayT(const VariableBuildInfo& vb, const VariableInfo& vi)
31: MeshVariableRef(vb)
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/*---------------------------------------------------------------------------*/
62
63template<class DataType> void
66{
67 if (this != &rhs) {
68 VariableRef::operator=(rhs);
69 m_private_part = rhs.m_private_part;
70 if (m_private_part)
71 updateFromInternal();
72 }
73}
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78template<class DataType> void
81{
82 ARCANE_CHECK_POINTER(m_private_part);
83 m_view = m_private_part->valueView();
84 MeshVariableRef::updateFromInternal();
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 retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Classe de factorisation des variables scalaires sur des entités du maillage.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-