Skip to content

Commit a4d7f26

Browse files
committed
[arcane:cartesianmesh] Fix errors in connectivity computing
1 parent 38d9a2d commit a4d7f26

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

arcane/src/arcane/cartesianmesh/CartesianConnectivity.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ _computeInfos2D(ICartesianMesh* cmesh)
224224
Node node = cell.node(i);
225225
Integer pos = 0;
226226
for (; pos < nb_node_in_cell_max; ++pos) {
227-
if (cell.uniqueId() == av_nodes_in_cell[pos])
227+
if (node.uniqueId() == av_nodes_in_cell[pos])
228228
break;
229229
}
230230
if (pos == nb_node_in_cell_max)
@@ -416,7 +416,7 @@ _computeInfos3D(ICartesianMesh* cmesh)
416416
Node node = cell.node(i);
417417
Integer pos = 0;
418418
for (; pos < nb_node_in_cell_max; ++pos) {
419-
if (cell.uniqueId() == av_nodes_in_cell[pos])
419+
if (node.uniqueId() == av_nodes_in_cell[pos])
420420
break;
421421
}
422422
if (pos == nb_node_in_cell_max)

arcane/src/arcane/cartesianmesh/CartesianMesh.cc

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,9 @@ _computeDirectionsV2()
788788
_computeMeshDirectionV2(*patch.get(), MD_DirZ, m_patch_group.allCells(patch_index), m_patch_group.inPatchCells(patch_index), m_patch_group.overallCells(patch_index), patch_nodes);
789789
}
790790

791-
if (arcaneIsCheck())
792-
checkValid();
791+
// TODO : Voir pour modifier cette méthode.
792+
// if (arcaneIsCheck())
793+
// checkValid();
793794

794795
_saveInfosInProperties();
795796
}
@@ -834,35 +835,24 @@ _computeMeshDirectionV2(CartesianMeshPatch& cdi, eMeshDirection dir, CellGroup a
834835
// Positionne pour chaque maille les faces avant et après dans la direction.
835836
// On s'assure que ces entités sont dans le groupe des entités de la direction correspondante
836837
std::set<Int32> cells_set;
837-
ENUMERATE_CELL (icell, all_cells) {
838+
ENUMERATE_ (Cell, icell, all_cells) {
838839
cells_set.insert(icell.itemLocalId());
839840
}
840841

841842
// Calcule les mailles devant/derrière. En cas de patch AMR, il faut que ces deux mailles
842843
// soient de même niveau
843-
ENUMERATE_CELL (icell, all_cells) {
844+
ENUMERATE_ (Cell, icell, all_cells) {
844845
Cell cell = *icell;
845846
Int32 my_level = cell.level();
846847
Face next_face = cell.face(next_local_face);
847848
Cell next_cell = next_face.backCell() == cell ? next_face.frontCell() : next_face.backCell();
848-
if (cells_set.find(next_cell.localId()) == cells_set.end()) {
849-
if (next_cell.level() != my_level) {
850-
next_cell = Cell();
851-
}
852-
}
853-
else if (next_cell.level() != my_level) {
849+
if (!cells_set.contains(next_cell.localId()) || next_cell.level() != my_level) {
854850
next_cell = Cell();
855851
}
856852

857853
Face prev_face = cell.face(prev_local_face);
858854
Cell prev_cell = prev_face.backCell() == cell ? prev_face.frontCell() : prev_face.backCell();
859-
860-
if (cells_set.find(prev_cell.localId()) == cells_set.end()) {
861-
if (prev_cell.level() != my_level) {
862-
prev_cell = Cell();
863-
}
864-
}
865-
else if (prev_cell.level() != my_level) {
855+
if (!cells_set.contains(prev_cell.localId()) || prev_cell.level() != my_level) {
866856
prev_cell = Cell();
867857
}
868858

@@ -1227,7 +1217,6 @@ _applyCoarse(const AMRZonePosition& zone_position)
12271217
void CartesianMeshImpl::
12281218
checkValid() const
12291219
{
1230-
//return; // TODO : Modification des outers à prendre en compte.
12311220
info(4) << "Check valid CartesianMesh";
12321221
Integer nb_patch = nbPatch();
12331222
for( Integer i=0; i<nb_patch; ++i ){

0 commit comments

Comments
 (0)