Arcane  v3.15.0.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/IMeshUtilities.h"
54#include "arcane/core/IGridMeshPartitioner.h"
55#include "arcane/core/IDataStorageFactory.h"
56#include "arcane/core/IDirectExecution.h"
57#include "arcane/core/IDirectSubDomainExecuteFunctor.h"
58#include "arcane/core/ISerializer.h"
59#include "arcane/core/IDeflateService.h"
60#include "arcane/core/IPrimaryMesh.h"
62#include "arcane/core/IIndexedIncrementalItemConnectivity.h"
63#include "arcane/core/IIndexedIncrementalItemConnectivityMng.h"
64#include "arcane/core/IIncrementalItemConnectivity.h"
65#include "arcane/core/IItemConnectivityAccessor.h"
66#include "arcane/core/IItemConnectivityInfo.h"
67#include "arcane/core/IItemConnectivity.h"
68#include "arcane/core/IItemConnectivityMng.h"
69#include "arcane/core/IItemConnectivitySynchronizer.h"
70#include "arcane/core/ItemFamilyCompactInfos.h"
71#include "arcane/core/IItemFamily.h"
72#include "arcane/core/IItemFamilyCompactPolicy.h"
73#include "arcane/core/IItemFamilySerializer.h"
74#include "arcane/core/IItemFamilySerializeStep.h"
75#include "arcane/core/IItemFamilyExchanger.h"
76#include "arcane/core/IItemFamilyModifier.h"
77#include "arcane/core/IItemFamilyPolicyMng.h"
78#include "arcane/core/IItemFamilyTopologyModifier.h"
79#include "arcane/core/IDoFFamily.h"
80#include "arcane/core/IParticleFamily.h"
81#include "arcane/core/ItemFamilySerializeArgs.h"
82#include "arcane/core/ITimeStats.h"
83#include "arcane/core/ITimerMng.h"
84#include "arcane/core/ITimeLoopMng.h"
85#include "arcane/core/IEntryPoint.h"
86#include "arcane/core/ICaseOptions.h"
87#include "arcane/core/ICaseFunctionProvider.h"
88#include "arcane/core/IVariableSynchronizerMng.h"
89#include "arcane/core/Configuration.h"
90#include "arcane/core/ConnectivityItemVector.h"
91#include "arcane/core/IVariableFilter.h"
92#include "arcane/core/IAsyncParticleExchanger.h"
93#include "arcane/core/IParticleExchanger.h"
94#include "arcane/core/IParallelExchanger.h"
95#include "arcane/core/ITimeHistoryCurveWriter.h"
96#include "arcane/core/IItemOperationByBasicType.h"
97#include "arcane/core/IVariableSynchronizer.h"
98#include "arcane/core/IVariableUtilities.h"
99#include "arcane/core/IPhysicalUnitSystemService.h"
100#include "arcane/core/IPhysicalUnitSystem.h"
101#include "arcane/core/IPhysicalUnitConverter.h"
102#include "arcane/core/IPhysicalUnit.h"
103#include "arcane/core/IStandardFunction.h"
104#include "arcane/core/ItemPairGroup.h"
105#include "arcane/core/CaseFunction2.h"
106#include "arcane/core/IServiceAndModuleFactoryMng.h"
107#include "arcane/core/IGhostLayerMng.h"
108#include "arcane/core/IMeshUniqueIdMng.h"
109#include "arcane/core/VariableStatusChangedEventArgs.h"
110#include "arcane/core/MeshPartInfo.h"
111#include "arcane/core/IGraph2.h"
112#include "arcane/core/IGraphModifier2.h"
113#include "arcane/core/IRandomNumberGenerator.h"
114#include "arcane/core/ISimpleTableComparator.h"
115#include "arcane/core/ISimpleTableInternalComparator.h"
116#include "arcane/core/ISimpleTableInternalMng.h"
117#include "arcane/core/ISimpleTableOutput.h"
118#include "arcane/core/ISimpleTableReaderWriter.h"
119#include "arcane/core/ISimpleTableWriterHelper.h"
120#include "arcane/core/IPostProcessorWriter.h"
121#include "arcane/core/IMeshModifier.h"
122#include "arcane/core/MeshEvents.h"
123#include "arcane/core/IExternalPlugin.h"
124#include "arcane/core/IMeshSubdivider.h"
125
126#include "arcane/core/IMeshInitialAllocator.h"
127#include "arcane/core/internal/IItemFamilyInternal.h"
128#include "arcane/core/internal/IMeshInternal.h"
129#include "arcane/core/internal/IVariableInternal.h"
130#include "arcane/core/internal/IMeshModifierInternal.h"
131#include "arcane/core/internal/IVariableMngInternal.h"
132#include "arcane/core/internal/IVariableSynchronizerMngInternal.h"
133#include "arcane/core/internal/IIncrementalItemConnectivityInternal.h"
134#include "arcane/core/internal/IPolyhedralMeshModifier.h"
135
136/*---------------------------------------------------------------------------*/
137/*---------------------------------------------------------------------------*/
138
139namespace Arcane
140{
141
142/*---------------------------------------------------------------------------*/
143/*---------------------------------------------------------------------------*/
144
145IArcaneMain* IArcaneMain::global_arcane_main = 0;
146
147/*---------------------------------------------------------------------------*/
148/*---------------------------------------------------------------------------*/
149
152{
153 return global_arcane_main;
154}
155
156/*---------------------------------------------------------------------------*/
157/*---------------------------------------------------------------------------*/
158
160setArcaneMain(IArcaneMain* arcane_main)
161{
162 global_arcane_main = arcane_main;
163}
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168extern "C++" String
169arcaneNamespaceURI()
170{
171 return String("http://www.cea.fr/arcane/1.0");
172}
173
174/*---------------------------------------------------------------------------*/
175/*---------------------------------------------------------------------------*/
176
177/*---------------------------------------------------------------------------*/
178/*---------------------------------------------------------------------------*/
179
182{
183 return compress(values.smallView(),compressed_values);
184}
185
186/*---------------------------------------------------------------------------*/
187/*---------------------------------------------------------------------------*/
188
191{
192 return decompress(compressed_values.smallView(),values.smallView());
193}
194
195/*---------------------------------------------------------------------------*/
196/*---------------------------------------------------------------------------*/
197
200{
201 IPrimaryMesh* primary_mesh = this->mesh()->toPrimaryMesh();
202 ARCANE_CHECK_POINTER(primary_mesh);
203 return primary_mesh;
204}
205
206/*---------------------------------------------------------------------------*/
207/*---------------------------------------------------------------------------*/
208
209ItemInternal* IItemFamilyModifier::
210allocOne(Int64 uid,ItemTypeInfo* type, mesh::MeshInfos& mesh_info)
211{
212 return ItemCompatibility::_itemInternal(allocOne(uid,type->itemTypeId(),mesh_info));
213}
214
215/*---------------------------------------------------------------------------*/
216/*---------------------------------------------------------------------------*/
217
218ItemInternal* IItemFamilyModifier::
219findOrAllocOne(Int64 uid,ItemTypeInfo* type, mesh::MeshInfos& mesh_info, bool& is_alloc)
220{
221 return ItemCompatibility::_itemInternal(findOrAllocOne(uid,type->itemTypeId(),mesh_info,is_alloc));
222}
223
224/*---------------------------------------------------------------------------*/
225/*---------------------------------------------------------------------------*/
226
232
233/*---------------------------------------------------------------------------*/
234/*---------------------------------------------------------------------------*/
235
242
243/*---------------------------------------------------------------------------*/
244/*---------------------------------------------------------------------------*/
245
253
254/*---------------------------------------------------------------------------*/
255/*---------------------------------------------------------------------------*/
256
258setMesh([[maybe_unused]] IMesh* mesh)
259{
260 // Utiliser variable d'environnement.
261 if (platform::getEnvironmentVariable("ARCANE_ALLOW_POSTPROCESSOR_SETMESH")=="1")
262 return;
263 ARCANE_FATAL("This call is deprecated and does not do anything."
264 " You can temporarely disable this exception if you set the environment"
265 " variable ARCANE_ALLOW_POSTPROCESSOR_SETMESH to '1'");
266}
267
268/*---------------------------------------------------------------------------*/
269/*---------------------------------------------------------------------------*/
270
273{
274 addCells(args.nbCell(),args.cellInfos(),args.cellLocalIds());
275}
276
279{
280 addFaces(args.nbFace(),args.faceInfos(),args.faceLocalIds());
281}
282
283/*---------------------------------------------------------------------------*/
284/*---------------------------------------------------------------------------*/
285
288{
289 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
290}
291
294{
295 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
296}
297
300{
301 ARCANE_THROW(NotImplementedException,"synchronize() with specific local ids");
302}
303
309
310/*---------------------------------------------------------------------------*/
311/*---------------------------------------------------------------------------*/
312
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
321
330
331/*---------------------------------------------------------------------------*/
332/*---------------------------------------------------------------------------*/
333
334} // End namespace Arcane
335
336/*---------------------------------------------------------------------------*/
337/*---------------------------------------------------------------------------*/
#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 ItemPairGroup findAdjencyItems(const ItemGroup &group, const ItemGroup &sub_group, eItemKind link_kind, Integer nb_layer)=0
Cherche une liste d'adjacence.
virtual ItemPairGroup findAdjacencyItems(const ItemGroup &group, const ItemGroup &sub_group, eItemKind link_kind, Integer nb_layer)
Cherche une liste d'adjacence.
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 computeAdjency(ItemPairGroup adjacency_array, eItemKind link_kind, Integer nb_layer)=0
Calcul des adjacences, rangées dans adjacency_array.
virtual void computeAdjacency(const ItemPairGroup &adjacency_array, eItemKind link_kind, Integer nb_layer)
Calcul des adjacences, rangées dans adjacency_array.
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.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
Structure interne d'une entité de maillage.
Index d'un Item dans une variable.
Definition ItemLocalId.h:40
Tableau de listes d'entités.
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:149
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 -*-
eItemKind
Genre d'entité de maillage.