Arcane
v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
VariableBuildInfo.cc
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
//-----------------------------------------------------------------------------
3
// Copyright 2000-2024 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
/* VariableBuildInfo.cc (C) 2000-2024 */
9
/* */
10
/* Informations pour construire une variable. */
11
/*---------------------------------------------------------------------------*/
12
/*---------------------------------------------------------------------------*/
13
14
#include "arcane/core/VariableBuildInfo.h"
15
16
#include "arcane/utils/Iostream.h"
17
18
#include "arcane/core/IModule.h"
19
#include "arcane/core/ISubDomain.h"
20
#include "arcane/core/IMesh.h"
21
#include "arcane/core/IItemFamily.h"
22
#include "arcane/core/IApplication.h"
23
#include "arcane/core/IDataFactoryMng.h"
24
#include "arcane/core/IVariableMng.h"
25
#include "arcane/core/internal/IVariableMngInternal.h"
26
27
/*---------------------------------------------------------------------------*/
28
/*---------------------------------------------------------------------------*/
29
30
namespace
Arcane
31
{
32
33
namespace
34
{
35
ISubDomain*
36
_getSubDomainDeprecated(
const
MeshHandle& handle)
37
{
38
return
handle.subDomain();
39
}
40
}
41
42
/*---------------------------------------------------------------------------*/
43
/*---------------------------------------------------------------------------*/
44
45
VariableBuildInfo::
46
VariableBuildInfo
(
IModule
* m,
const
String
& name,
int
property)
47
: m_sub_domain(m->subDomain())
48
, m_module(m)
49
, m_mesh_handle(m->defaultMeshHandle())
50
, m_name(name)
51
, m_property(property)
52
{
53
_init();
54
}
55
56
/*---------------------------------------------------------------------------*/
57
/*---------------------------------------------------------------------------*/
58
59
VariableBuildInfo::
60
VariableBuildInfo
(
ISubDomain
*
sd
,
const
String
& name,
int
property)
61
: m_sub_domain(
sd
)
62
, m_name(name)
63
, m_property(property)
64
{
65
_init();
66
}
67
68
/*---------------------------------------------------------------------------*/
69
/*---------------------------------------------------------------------------*/
70
71
VariableBuildInfo::
72
VariableBuildInfo
(
IVariableMng
*
variable_mng
,
const
String
& name,
int
property)
73
: m_sub_domain(
variable_mng
->_internalApi()->internalSubDomain())
74
, m_name(name)
75
, m_property(property)
76
{
77
_init();
78
}
79
80
/*---------------------------------------------------------------------------*/
81
/*---------------------------------------------------------------------------*/
82
83
VariableBuildInfo::
84
VariableBuildInfo
(
const
MeshHandle
&
mesh_handle
,
const
String
& name,
int
property)
85
: m_sub_domain(
_getSubDomainDeprecated
(
mesh_handle
))
86
, m_mesh_handle(
mesh_handle
)
87
, m_name(name)
88
, m_property(property)
89
{
90
_init();
91
}
92
93
/*---------------------------------------------------------------------------*/
94
/*---------------------------------------------------------------------------*/
95
96
VariableBuildInfo::
97
VariableBuildInfo
(
IMesh
* mesh,
const
String
& name,
int
property)
98
:
VariableBuildInfo
(mesh->handle(),name,property)
99
{
100
}
101
102
/*---------------------------------------------------------------------------*/
103
/*---------------------------------------------------------------------------*/
104
105
VariableBuildInfo::
106
VariableBuildInfo
(
IModule
* m,
const
String
& name,
107
const
String
&
item_family_name
,
int
property)
108
: m_sub_domain(m->subDomain())
109
, m_module(m)
110
, m_mesh_handle(m->defaultMeshHandle())
111
, m_name(name)
112
, m_item_family_name(
item_family_name
)
113
, m_property(property)
114
{
115
_init();
116
}
117
118
/*---------------------------------------------------------------------------*/
119
/*---------------------------------------------------------------------------*/
120
121
VariableBuildInfo::
122
VariableBuildInfo
(
const
MeshHandle
&
mesh_handle
,
const
String
& name,
123
const
String
&
item_family_name
,
int
property)
124
: m_sub_domain(
_getSubDomainDeprecated
(
mesh_handle
))
125
, m_mesh_handle(
mesh_handle
)
126
, m_name(name)
127
, m_item_family_name(
item_family_name
)
128
, m_property(property)
129
{
130
_init();
131
}
132
133
/*---------------------------------------------------------------------------*/
134
/*---------------------------------------------------------------------------*/
135
136
VariableBuildInfo::
137
VariableBuildInfo
(
IMesh
* mesh,
const
String
& name,
138
const
String
&
item_family_name
,
int
property)
139
:
VariableBuildInfo
(mesh->handle(),name,
item_family_name
,property)
140
{
141
}
142
143
/*---------------------------------------------------------------------------*/
144
/*---------------------------------------------------------------------------*/
145
146
VariableBuildInfo::
147
VariableBuildInfo
(
ISubDomain
*
sd
,
const
String
& name,
const
String
&
mesh_name
,
148
const
String
&
item_family_name
,
int
property)
149
: m_sub_domain(
sd
)
150
, m_name(name)
151
, m_item_family_name(
item_family_name
)
152
, m_mesh_name(
mesh_name
)
153
, m_property(property)
154
{
155
_init();
156
}
157
158
/*---------------------------------------------------------------------------*/
159
/*---------------------------------------------------------------------------*/
160
161
VariableBuildInfo::
162
VariableBuildInfo
(
IVariableMng
*
variable_mng
,
const
String
& name,
const
String
&
mesh_name
,
163
const
String
&
item_family_name
,
int
property)
164
: m_sub_domain(
variable_mng
->_internalApi()->internalSubDomain())
165
, m_name(name)
166
, m_item_family_name(
item_family_name
)
167
, m_mesh_name(
mesh_name
)
168
, m_property(property)
169
{
170
_init();
171
}
172
173
/*---------------------------------------------------------------------------*/
174
/*---------------------------------------------------------------------------*/
175
176
VariableBuildInfo::
177
VariableBuildInfo
(
IItemFamily
* family,
const
String
& name,
int
property)
178
: m_sub_domain(
_getSubDomainDeprecated
(family->mesh()->handle()))
179
, m_mesh_handle(family->mesh()->handle())
180
, m_name(name)
181
, m_item_family_name(family->name())
182
, m_property(property)
183
{
184
_init();
185
}
186
187
/*---------------------------------------------------------------------------*/
188
/*---------------------------------------------------------------------------*/
189
190
VariableBuildInfo::
191
VariableBuildInfo
(
IModule
* m,
const
String
& name,
192
const
String
&
item_family_name
,
193
const
String
&
item_group_name
,
int
property)
194
: m_sub_domain(m->subDomain())
195
, m_module(m)
196
, m_mesh_handle(m->defaultMesh()->handle())
197
, m_name(name)
198
, m_item_family_name(
item_family_name
)
199
, m_item_group_name(
item_group_name
)
200
, m_property(property)
201
{
202
_init();
203
}
204
205
/*---------------------------------------------------------------------------*/
206
/*---------------------------------------------------------------------------*/
207
208
VariableBuildInfo::
209
VariableBuildInfo
(
const
MeshHandle
&
mesh_handle
,
const
String
& name,
210
const
String
&
item_family_name
,
211
const
String
&
item_group_name
,
int
property)
212
: m_sub_domain(
_getSubDomainDeprecated
(
mesh_handle
))
213
, m_mesh_handle(
mesh_handle
)
214
, m_name(name)
215
, m_item_family_name(
item_family_name
)
216
, m_item_group_name(
item_group_name
)
217
, m_property(property)
218
{
219
_init();
220
}
221
222
/*---------------------------------------------------------------------------*/
223
/*---------------------------------------------------------------------------*/
224
225
VariableBuildInfo::
226
VariableBuildInfo
(
IMesh
* mesh,
const
String
& name,
227
const
String
&
item_family_name
,
228
const
String
&
item_group_name
,
int
property)
229
:
VariableBuildInfo
(mesh->handle(),name,
item_family_name
,
item_group_name
,property)
230
{
231
}
232
233
/*---------------------------------------------------------------------------*/
234
/*---------------------------------------------------------------------------*/
235
236
VariableBuildInfo::
237
VariableBuildInfo
(
ISubDomain
*
sd
,
const
String
& name,
238
const
String
&
mesh_name
,
239
const
String
&
item_family_name
,
240
const
String
&
item_group_name
,
int
property)
241
: m_sub_domain(
sd
)
242
, m_name(name)
243
, m_item_family_name(
item_family_name
)
244
, m_item_group_name(
item_group_name
)
245
, m_mesh_name(
mesh_name
)
246
, m_property(property)
247
{
248
_init();
249
}
250
251
/*---------------------------------------------------------------------------*/
252
/*---------------------------------------------------------------------------*/
253
254
VariableBuildInfo::
255
VariableBuildInfo
(
IVariableMng
*
variable_mng
,
const
String
& name,
256
const
String
&
mesh_name
,
257
const
String
&
item_family_name
,
258
const
String
&
item_group_name
,
int
property)
259
: m_sub_domain(
variable_mng
->_internalApi()->internalSubDomain())
260
, m_name(name)
261
, m_item_family_name(
item_family_name
)
262
, m_item_group_name(
item_group_name
)
263
, m_mesh_name(
mesh_name
)
264
, m_property(property)
265
{
266
_init();
267
}
268
269
/*---------------------------------------------------------------------------*/
270
/*---------------------------------------------------------------------------*/
271
272
VariableBuildInfo::
273
VariableBuildInfo
(
const
NullTag&)
274
: m_is_null(
true
)
275
{
276
_init();
277
}
278
279
/*---------------------------------------------------------------------------*/
280
/*---------------------------------------------------------------------------*/
281
282
void
VariableBuildInfo::
283
_init()
284
{
285
if
(!
m_mesh_handle
.
isNull
()){
286
m_mesh_name
=
m_mesh_handle
.meshName();
287
}
288
}
289
290
/*---------------------------------------------------------------------------*/
291
/*---------------------------------------------------------------------------*/
292
293
IVariableMng* VariableBuildInfo::
294
variableMng()
const
295
{
296
ARCANE_CHECK_POINTER
(
m_sub_domain
);
297
return
m_sub_domain
->
variableMng
();
298
}
299
300
/*---------------------------------------------------------------------------*/
301
/*---------------------------------------------------------------------------*/
302
303
IDataFactoryMng* VariableBuildInfo::
304
dataFactoryMng()
const
305
{
306
ARCANE_CHECK_POINTER
(
m_sub_domain
);
307
return
m_sub_domain
->
application
()->dataFactoryMng();
308
}
309
310
/*---------------------------------------------------------------------------*/
311
/*---------------------------------------------------------------------------*/
312
313
ITraceMng* VariableBuildInfo::
314
traceMng()
const
315
{
316
ARCANE_CHECK_POINTER
(
m_sub_domain
);
317
return
m_sub_domain
->
traceMng
();
318
}
319
320
/*---------------------------------------------------------------------------*/
321
/*---------------------------------------------------------------------------*/
322
323
}
// End namespace Arcane
324
325
/*---------------------------------------------------------------------------*/
326
/*---------------------------------------------------------------------------*/
ARCANE_CHECK_POINTER
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
Definition
ArcaneGlobal.h:868
Arcane::IBase::traceMng
virtual ITraceMng * traceMng() const =0
Gestionnaire de traces.
Arcane::IItemFamily
Interface d'une famille d'entités.
Definition
IItemFamily.h:111
Arcane::IMesh
Definition
IMesh.h:59
Arcane::IModule
Interface d'un module.
Definition
IModule.h:39
Arcane::ISubDomain
Interface du gestionnaire d'un sous-domaine.
Definition
ISubDomain.h:74
Arcane::ISubDomain::application
virtual IApplication * application()=0
Application.
Arcane::ISubDomain::variableMng
virtual IVariableMng * variableMng()=0
Retourne le gestionnaire de variables.
Arcane::IVariableMng
Interface du gestionnaire de variables.
Definition
IVariableMng.h:57
Arcane::LimaWrapper
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition
Lima.cc:120
Arcane::MeshHandle
Handle sur un maillage.
Definition
MeshHandle.h:47
Arcane::MeshHandle::isNull
bool isNull() const
Indique si le handle est nul (il ne référence aucun maillage existant ou non)
Definition
MeshHandle.h:162
Arcane::VariableBuildInfo
Paramètres nécessaires à la construction d'une variable.
Definition
VariableBuildInfo.h:43
Arcane::VariableBuildInfo::m_mesh_name
String m_mesh_name
Nom du maillage associé à la variable.
Definition
VariableBuildInfo.h:280
Arcane::VariableBuildInfo::VariableBuildInfo
VariableBuildInfo(IModule *m, const String &name, int property=0)
Construit un initialiseur pour une variable.
Definition
VariableBuildInfo.cc:46
Arcane::VariableBuildInfo::m_mesh_handle
MeshHandle m_mesh_handle
Handle sur le maillage.
Definition
VariableBuildInfo.h:276
Arcane::VariableBuildInfo::m_sub_domain
ISubDomain * m_sub_domain
Gestionnaire de sous-domaine.
Definition
VariableBuildInfo.h:274
Arccore::String
Chaîne de caractères unicode.
Definition
arccore/src/base/arccore/base/String.h:70
Arcane
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Definition
AcceleratorGlobal.h:36
arcane
core
VariableBuildInfo.cc
Généré le Lundi 18 Novembre 2024 03:01:06 pour Arcane par
1.9.8