Skip to content

Commit eeb0290

Browse files
Merge pull request #1826 from arcaneframework/dev/gg-add-support-to-set-face-uniqueid-numbering-in-caseoption
Add support to set face uniqueid numbering in ArcaneCaseMeshService.
2 parents 7c39c06 + d1bb1d3 commit eeb0290

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

arcane/src/arcane/impl/ArcaneCaseMeshService.axl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@
7676
</description>
7777
</simple>
7878

79+
<simple name="face-numbering-version"
80+
type="int32"
81+
optional = "true"
82+
>
83+
<description>
84+
Version du calcul des identifiants uniques des faces.
85+
86+
Cette option est interne à Arcane.
87+
</description>
88+
</simple>
89+
7990
<!-- Service spécifique de lecture de maillage -->
8091
<service-instance
8192
name = "specific-reader"

arcane/src/arcane/impl/ArcaneCaseMeshService.cc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "arcane/core/IGhostLayerMng.h"
3333
#include "arcane/core/MeshPartInfo.h"
3434
#include "arcane/core/IMeshSubdivider.h"
35+
#include "arcane/core/IMeshUniqueIdMng.h"
3536
#include "arcane/core/internal/StringVariableReplace.h"
3637

3738
#include "arcane/impl/ArcaneCaseMeshService_axl.h"
@@ -79,6 +80,7 @@ class ArcaneCaseMeshService
7980
void _doInitialPartition2(const String& name);
8081
void _setGhostLayerInfos();
8182
void _checkMeshCreationAndAllocation(bool is_check_allocated);
83+
void _setUniqueIdNumberingVersion();
8284
};
8385

8486
/*---------------------------------------------------------------------------*/
@@ -163,9 +165,9 @@ allocateMeshItems()
163165
ARCANE_CHECK_POINTER(m_mesh_builder);
164166

165167
_setGhostLayerInfos();
168+
_setUniqueIdNumberingVersion();
166169

167170
m_mesh_builder->allocateMeshItems(m_mesh);
168-
169171
}
170172

171173
/*---------------------------------------------------------------------------*/
@@ -381,13 +383,13 @@ _setGhostLayerInfos()
381383
// TODO Cela est fait pour rester compatible avec le mode historique mais
382384
// il faudrait pouvoir gérer cela autrement (via un service par exemple)
383385
Integer nb_ghost_layer = options()->nbGhostLayer();
384-
if (nb_ghost_layer>=0){
386+
if (nb_ghost_layer >= 0) {
385387
info() << "Set number of ghost layers to '" << nb_ghost_layer << "' from caseoption";
386388
gm->setNbGhostLayer(nb_ghost_layer);
387389
}
388390

389391
Integer builder_version = options()->ghostLayerBuilderVersion();
390-
if (builder_version>=0){
392+
if (builder_version >= 0) {
391393
info() << "Set ghostlayer builder version to '" << builder_version << "' from caseoption";
392394
gm->setBuilderVersion(builder_version);
393395
}
@@ -396,6 +398,23 @@ _setGhostLayerInfos()
396398
/*---------------------------------------------------------------------------*/
397399
/*---------------------------------------------------------------------------*/
398400

401+
void ArcaneCaseMeshService::
402+
_setUniqueIdNumberingVersion()
403+
{
404+
// NOTE: actuellement (12/2024) l'implémentation 'PolyedralMesh' lève une
405+
// exception si on appelle meshUniqueIdMng(). On ne le fait que si
406+
// l'option est présente.
407+
if (options()->faceNumberingVersion.isPresent()) {
408+
Int32 v = options()->faceNumberingVersion.value();
409+
info() << "Set face uniqueId numbering version to '" << v << "' from caseoption";
410+
IMeshUniqueIdMng* mum = m_mesh->meshUniqueIdMng();
411+
mum->setFaceBuilderVersion(v);
412+
}
413+
}
414+
415+
/*---------------------------------------------------------------------------*/
416+
/*---------------------------------------------------------------------------*/
417+
399418
ARCANE_REGISTER_SERVICE_ARCANECASEMESHSERVICE(ArcaneCaseMeshService,
400419
ArcaneCaseMeshService);
401420

arcane/tests/testHydro-3-checkpoint-meshservice.arc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<mesh>
1010
<filename internal-partition="true">sod.vtk</filename>
1111
<partitioner>MeshPartitionerTester</partitioner>
12+
<face-numbering-version>3</face-numbering-version>
1213
<initialization>
1314
<variable><name>Density</name><value>1.0</value><group>ZG</group></variable>
1415
<variable><name>Density</name><value>0.125</value><group>ZD</group></variable>

0 commit comments

Comments
 (0)