Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MeshVariableRef.cc
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/* MeshVariable.cc (C) 2000-2024 */
9/* */
10/* Mesh variable. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/MeshVariableRef.h"
15#include "arcane/core/ItemGroup.h"
16#include "arcane/core/IMesh.h"
17#include "arcane/core/MeshHandle.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
30: VariableRef(var)
31{
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37MeshVariableRef::
38MeshVariableRef(const VariableBuildInfo& vbi)
39: VariableRef(vbi)
40{
41}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
48: VariableRef(rhs)
49{
50}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55void MeshVariableRef::
56operator=(const MeshVariableRef& rhs)
57{
59}
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64void MeshVariableRef::
65_internalInit(IVariable* var)
66{
68 MeshHandle mh = var->meshHandle();
69 if (mh.hasMesh()) {
70 IMesh* mesh = mh.mesh();
71 bool auto_init = mesh->isAllocated();
72 if (auto_init) {
73 setUsed(true);
74 }
75 }
76}
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81void MeshVariableRef::
82synchronize()
83{
85}
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90void MeshVariableRef::
91synchronize(Int32ConstArrayView local_ids)
92{
93 variable()->synchronize(local_ids);
94}
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99} // End namespace Arcane
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
Interface of a variable.
Definition IVariable.h:40
virtual void synchronize()=0
Synchronizes the variable.
Base class for a variable on mesh entities.
MeshVariableRef(const VariableBuildInfo &vb)
Constructs a reference linked to the module.
Parameters necessary for building a variable.
Reference to a variable.
Definition VariableRef.h:56
VariableRef(const VariableBuildInfo &vbi)
Constructs a reference to a variable with the infos vbi.
VariableRef & operator=(const VariableRef &from)
Copy assignment operator.
IVariable * variable() const
Associated variable.
void _internalInit(IVariable *)
Internal initialization of the variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482