@@ -54,6 +54,7 @@ class MeshPolyhedralTestModule : public ArcaneMeshPolyhedralTestObject
54
54
_testEnumerationAndConnectivities (mesh ());
55
55
_testVariables (mesh ());
56
56
_testGroups (mesh ());
57
+ _testMeshUtilities (mesh ());
57
58
}
58
59
else
59
60
info () << " No Mesh" ;
@@ -69,6 +70,7 @@ class MeshPolyhedralTestModule : public ArcaneMeshPolyhedralTestObject
69
70
void _testGroups (IMesh* mesh);
70
71
void _testDimensions (IMesh* mesh);
71
72
void _testCoordinates (IMesh* mesh);
73
+ void _testMeshUtilities (IMesh* mesh);
72
74
void _buildGroup (IItemFamily* family, String const & group_name);
73
75
void _checkBoundaryFaceGroup (IMesh* mesh, String const & boundary_face_group_name) const ;
74
76
void _checkInternalFaceGroup (IMesh* mesh, String const & internal_face_group_name) const ;
@@ -384,6 +386,9 @@ _testGroups(IMesh* mesh)
384
386
}
385
387
ValueChecker vc{ A_FUNCINFO };
386
388
auto nb_internal_group = 19 ;
389
+ if (subDomain ()->parallelMng ()->isParallel ()) {
390
+ nb_internal_group = 23 ;
391
+ }
387
392
auto nb_group = nb_internal_group + options ()->nbMeshGroup ;
388
393
vc.areEqual (nb_group, mesh->groups ().count (), " check number of groups in the mesh" );
389
394
@@ -435,6 +440,41 @@ _testCoordinates(Arcane::IMesh* mesh)
435
440
/* ---------------------------------------------------------------------------*/
436
441
/* ---------------------------------------------------------------------------*/
437
442
443
+ void MeshPolyhedralTestModule::
444
+ _testMeshUtilities (Arcane::IMesh* mesh)
445
+ {
446
+ auto * mesh_utilities = mesh->utilities ();
447
+ ARCANE_CHECK_POINTER (mesh_utilities);
448
+ // Test change owner from cells
449
+ // wip test in sequential: virtually change all cell owners to 1 and check all items have 1 as owner
450
+ auto & cell_owners = mesh->cellFamily ()->itemsNewOwner ();
451
+ auto & face_owners = mesh->faceFamily ()->itemsNewOwner ();
452
+ auto & edge_owners = mesh->edgeFamily ()->itemsNewOwner ();
453
+ auto & node_owners = mesh->nodeFamily ()->itemsNewOwner ();
454
+ ENUMERATE_ (Cell,icell,allCells ()) {
455
+ cell_owners[icell] = 1 ;
456
+ info () << " Cell uid " << icell->uniqueId () << " cell_owner[icell] " << cell_owners[icell];
457
+ info () << " Cell uid " << icell->uniqueId () << " has owner " << icell->owner ();
458
+ }
459
+ mesh_utilities->changeOwnersFromCells ();
460
+ bool has_error = false ;
461
+ ENUMERATE_ (Face,iface,allFaces ()) {
462
+ has_error |= face_owners[iface] != 1 ;
463
+ }
464
+ ENUMERATE_ (Node,inode,allNodes ()) {
465
+ has_error |= node_owners[inode] != 1 ;
466
+ }
467
+ ENUMERATE_ (Edge,iedge,allEdges ()) {
468
+ has_error |= edge_owners[iedge] != 1 ;
469
+ }
470
+ if (has_error) {
471
+ ARCANE_FATAL (" changeOwnerFromCells does not work with PolyhedralMesh" );
472
+ }
473
+ }
474
+
475
+ /* ---------------------------------------------------------------------------*/
476
+ /* ---------------------------------------------------------------------------*/
477
+
438
478
void MeshPolyhedralTestModule::
439
479
_buildGroup (IItemFamily* family, String const & group_name)
440
480
{
0 commit comments