Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
InterfaceImpl.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/* InterfaceImpl.cc (C) 2000-2024 */
9/* */
10/* Implémentation des interfaces. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13/*
14 * Sous Windows, il faut inclure les interfaces pour que leurs symboles
15 * soient disponibles (sous linux aussi si on utilise gcc avec les infos
16 * de visibilités).
17 */
18
19#include "arcane/core/IVariableSynchronizerMng.h"
20
21#include "arcane/utils/String.h"
22#include "arcane/utils/ArgumentException.h"
23#include "arcane/utils/FatalErrorException.h"
24#include "arcane/utils/PlatformUtils.h"
25
26#include "arcane/core/IArcaneMain.h"
27#include "arcane/core/IServiceInfo.h"
29#include "arcane/core/IBase.h"
30#include "arcane/core/IBackwardMng.h"
31#include "arcane/core/ICaseFunction.h"
32#include "arcane/core/ICaseMng.h"
33#include "arcane/core/ICaseMeshReader.h"
34#include "arcane/core/ICaseMeshService.h"
35#include "arcane/core/ICaseMeshMasterService.h"
36#include "arcane/core/IModuleMng.h"
37#include "arcane/core/IServiceMng.h"
38#include "arcane/core/ICodeService.h"
39#include "arcane/core/ISubDomain.h"
40#include "arcane/core/IServiceInfo.h"
41#include "arcane/core/IService.h"
42#include "arcane/core/IApplication.h"
43#include "arcane/core/IMainFactory.h"
44#include "arcane/core/IMeshBuilder.h"
45#include "arcane/core/IMeshCompactMng.h"
46#include "arcane/core/IMeshExchangeMng.h"
47#include "arcane/core/IMeshCompacter.h"
48#include "arcane/core/IMeshExchanger.h"
49#include "arcane/core/IMeshFactory.h"
50#include "arcane/core/IMeshFactoryMng.h"
51#include "arcane/core/IMeshMng.h"
52#include "arcane/core/IMeshPartitioner.h"
53#include "arcane/core/IGridMeshPartitioner.h"
54#include "arcane/core/IDataStorageFactory.h"
55#include "arcane/core/IDirectExecution.h"
56#include "arcane/core/IDirectSubDomainExecuteFunctor.h"
57#include "arcane/core/ISerializer.h"
58#include "arcane/core/IDeflateService.h"
59#include "arcane/core/IPrimaryMesh.h"
61#include "arcane/core/IIndexedIncrementalItemConnectivity.h"
62#include "arcane/core/IIndexedIncrementalItemConnectivityMng.h"
63#include "arcane/core/IIncrementalItemConnectivity.h"
64#include "arcane/core/IItemConnectivityAccessor.h"
65#include "arcane/core/IItemConnectivityInfo.h"
66#include "arcane/core/IItemConnectivity.h"
67#include "arcane/core/IItemConnectivityMng.h"
68#include "arcane/core/IItemConnectivitySynchronizer.h"
69#include "arcane/core/ItemFamilyCompactInfos.h"
70#include "arcane/core/IItemFamily.h"
71#include "arcane/core/IItemFamilyCompactPolicy.h"
72#include "arcane/core/IItemFamilySerializer.h"
73#include "arcane/core/IItemFamilySerializeStep.h"
74#include "arcane/core/IItemFamilyExchanger.h"
75#include "arcane/core/IItemFamilyModifier.h"
76#include "arcane/core/IItemFamilyPolicyMng.h"
77#include "arcane/core/IItemFamilyTopologyModifier.h"
78#include "arcane/core/IDoFFamily.h"
79#include "arcane/core/IParticleFamily.h"
80#include "arcane/core/ItemFamilySerializeArgs.h"
81#include "arcane/core/ITimeStats.h"
82#include "arcane/core/ITimerMng.h"
83#include "arcane/core/ITimeLoopMng.h"
84#include "arcane/core/IEntryPoint.h"
85#include "arcane/core/ICaseOptions.h"
86#include "arcane/core/ICaseFunctionProvider.h"
87#include "arcane/core/IVariableSynchronizerMng.h"
88#include "arcane/core/Configuration.h"
89#include "arcane/core/ConnectivityItemVector.h"
90#include "arcane/core/IVariableFilter.h"
91#include "arcane/core/IAsyncParticleExchanger.h"
92#include "arcane/core/IParticleExchanger.h"
93#include "arcane/core/IParallelExchanger.h"
94#include "arcane/core/ITimeHistoryCurveWriter.h"
95#include "arcane/core/IItemOperationByBasicType.h"
96#include "arcane/core/IVariableSynchronizer.h"
97#include "arcane/core/IVariableUtilities.h"
98#include "arcane/core/IPhysicalUnitSystemService.h"
99#include "arcane/core/IPhysicalUnitSystem.h"
100#include "arcane/core/IPhysicalUnitConverter.h"
101#include "arcane/core/IPhysicalUnit.h"
102#include "arcane/core/IStandardFunction.h"
103#include "arcane/core/CaseFunction2.h"
104#include "arcane/core/IServiceAndModuleFactoryMng.h"
105#include "arcane/core/IGhostLayerMng.h"
106#include "arcane/core/IMeshUniqueIdMng.h"
107#include "arcane/core/VariableStatusChangedEventArgs.h"
108#include "arcane/core/MeshPartInfo.h"
109#include "arcane/core/IGraph2.h"
110#include "arcane/core/IGraphModifier2.h"
111#include "arcane/core/IRandomNumberGenerator.h"
112#include "arcane/core/ISimpleTableComparator.h"
113#include "arcane/core/ISimpleTableInternalComparator.h"
114#include "arcane/core/ISimpleTableInternalMng.h"
115#include "arcane/core/ISimpleTableOutput.h"
116#include "arcane/core/ISimpleTableReaderWriter.h"
117#include "arcane/core/ISimpleTableWriterHelper.h"
118#include "arcane/core/IPostProcessorWriter.h"
119#include "arcane/core/IMeshModifier.h"
120#include "arcane/core/MeshEvents.h"
121#include "arcane/core/IExternalPlugin.h"
122#include "arcane/core/IMeshSubdivider.h"
123
124#include "arcane/core/IMeshInitialAllocator.h"
125#include "arcane/core/internal/IItemFamilyInternal.h"
126#include "arcane/core/internal/IMeshInternal.h"
127#include "arcane/core/internal/IVariableInternal.h"
128#include "arcane/core/internal/IMeshModifierInternal.h"
129#include "arcane/core/internal/IVariableMngInternal.h"
130#include "arcane/core/internal/IVariableSynchronizerMngInternal.h"
131#include "arcane/core/internal/IIncrementalItemConnectivityInternal.h"
132#include "arcane/core/internal/IPolyhedralMeshModifier.h"
133
134/*---------------------------------------------------------------------------*/
135/*---------------------------------------------------------------------------*/
136
137namespace Arcane
138{
139
140/*---------------------------------------------------------------------------*/
141/*---------------------------------------------------------------------------*/
142
143IArcaneMain* IArcaneMain::global_arcane_main = 0;
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
150{
151 return global_arcane_main;
152}
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
158setArcaneMain(IArcaneMain* arcane_main)
159{
160 global_arcane_main = arcane_main;
161}
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
165
166extern "C++" String
167arcaneNamespaceURI()
168{
169 return String("http://www.cea.fr/arcane/1.0");
170}
171
172/*---------------------------------------------------------------------------*/
173/*---------------------------------------------------------------------------*/
174
175/*---------------------------------------------------------------------------*/
176/*---------------------------------------------------------------------------*/
177
180{
181 return compress(values.smallView(),compressed_values);
182}
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
189{
190 return decompress(compressed_values.smallView(),values.smallView());
191}
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
198{
199 IPrimaryMesh* primary_mesh = this->mesh()->toPrimaryMesh();
200 ARCANE_CHECK_POINTER(primary_mesh);
201 return primary_mesh;
202}
203
204/*---------------------------------------------------------------------------*/
205/*---------------------------------------------------------------------------*/
206
207ItemInternal* IItemFamilyModifier::
208allocOne(Int64 uid,ItemTypeInfo* type, mesh::MeshInfos& mesh_info)
209{
210 return ItemCompatibility::_itemInternal(allocOne(uid,type->itemTypeId(),mesh_info));
211}
212
213/*---------------------------------------------------------------------------*/
214/*---------------------------------------------------------------------------*/
215
216ItemInternal* IItemFamilyModifier::
217findOrAllocOne(Int64 uid,ItemTypeInfo* type, mesh::MeshInfos& mesh_info, bool& is_alloc)
218{
219 return ItemCompatibility::_itemInternal(findOrAllocOne(uid,type->itemTypeId(),mesh_info,is_alloc));
220}
221
222/*---------------------------------------------------------------------------*/
223/*---------------------------------------------------------------------------*/
224
230
231/*---------------------------------------------------------------------------*/
232/*---------------------------------------------------------------------------*/
233
240
241/*---------------------------------------------------------------------------*/
242/*---------------------------------------------------------------------------*/
243
251
252/*---------------------------------------------------------------------------*/
253/*---------------------------------------------------------------------------*/
254
256setMesh([[maybe_unused]] IMesh* mesh)
257{
258 // Utiliser variable d'environnement.
259 if (platform::getEnvironmentVariable("ARCANE_ALLOW_POSTPROCESSOR_SETMESH")=="1")
260 return;
261 ARCANE_FATAL("This call is deprecated and does not do anything."
262 " You can temporarely disable this exception if you set the environment"
263 " variable ARCANE_ALLOW_POSTPROCESSOR_SETMESH to '1'");
264}
265
266/*---------------------------------------------------------------------------*/
267/*---------------------------------------------------------------------------*/
268
271{
272 addCells(args.nbCell(),args.cellInfos(),args.cellLocalIds());
273}
274
277{
278 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
279}
280
281/*---------------------------------------------------------------------------*/
282/*---------------------------------------------------------------------------*/
283
286{
287 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
288}
289
292{
293 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
294}
295
298{
299 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
300}
301
307
308/*---------------------------------------------------------------------------*/
309/*---------------------------------------------------------------------------*/
310
311} // End namespace Arcane
312
313/*---------------------------------------------------------------------------*/
314/*---------------------------------------------------------------------------*/
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
#define ARCANE_THROW(exception_class,...)
Macro pour envoyer une exception avec formattage.
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Déclarations de types sur les entités.
Tableau d'items de types quelconques.
Interface de la classe de gestion du code.
Definition IArcaneMain.h:54
static IArcaneMain * arcaneMain()
static void setArcaneMain(IArcaneMain *arcane_main)
virtual void compress(ByteConstArrayView values, ByteArray &compressed_values)=0
Compresse les données values et les stocke dans compressed_values.
virtual void decompress(ByteConstArrayView compressed_values, ByteArrayView values)=0
Décompresse les données compressed_values et les stocke dans values.
virtual void removeConnectedItems(ItemLocalId source_item)=0
Supprime toute les entités connectées à source_item.
virtual void addConnectedItem(ItemLocalId source_item, ItemLocalId target_local_id)=0
Ajoute l'entité de localId() target_local_id à la connectivité de source_item.
virtual void setConnectedItems(ItemLocalId source_item, Int32ConstArrayView target_local_ids)
Alloue et positionne les entités connectées à source_item.
virtual void reserveMemoryForNbSourceItems(Int32 n, bool pre_alloc_connectivity)
Réserve la mémoire pour n entités sources.
virtual void _internalNotifySourceItemsAdded(Int32ConstArrayView items)
Notifie la connectivité que les entités items ont été ajoutées à la famille source.
virtual void notifySourceItemAdded(ItemLocalId item)=0
Notifie la connectivité qu'une entité a été ajoutée à la famille source.
virtual void synchronize(VariableCollection variables)=0
Synchronise les variables variables.
virtual void addFaces(Integer nb_face, Int64ConstArrayView face_infos, Int32ArrayView face_lids=Int32ArrayView())=0
Ajoute des faces.
virtual void addCells(Integer nb_cell, Int64ConstArrayView cell_infos, Int32ArrayView cells_lid=Int32ArrayView())=0
Ajoute des mailles.
virtual IMesh * mesh() const =0
Maillage associé au partitionneur.
virtual IPrimaryMesh * primaryMesh() override
Maillage associé
virtual void setMesh(IMesh *mesh)
Positionne le maillage.
virtual void synchronize(IVariable *var)=0
Synchronise la variable var en mode bloquant.
Interface d'une variable.
Definition IVariable.h:54
virtual void synchronize()=0
Synchronise la variable.
Structure interne d'une entité de maillage.
Index d'un Item dans une variable.
Definition ItemLocalId.h:40
Infos sur un type d'entité du maillage.
ItemTypeId itemTypeId() const
Numéro du type.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Arguments pour IMeshModifier::addCells().
Arguments pour IMeshModifier::addFaces().
Collection de variables.
Classe factorisant des informations sur le maillage.
Definition MeshInfos.h:36
Vue constante d'un tableau de type T.
Exception lorsqu'une fonction n'est pas implémentée.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-