Skip to content

Commit a7b9cfb

Browse files
committed
add the ghost functor directly inside prepare_for_use()/find_neighbors()
1 parent 6708c6d commit a7b9cfb

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/mesh/unstructured_mesh.C

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
#include "libmesh/periodic_boundaries.h"
5252
#include "libmesh/periodic_boundary.h"
5353

54+
#include <libmesh/disconnected_neighbor_coupling.h>
55+
5456
namespace {
5557

5658
using namespace libMesh;
@@ -1033,6 +1035,9 @@ void UnstructuredMesh::find_neighbors (const bool reset_remote_elements,
10331035
}
10341036
}
10351037
}
1038+
1039+
// Ghost the disconnected elements
1040+
this->add_ghosting_functor(std::make_unique<DisconnectedNeighborCoupling>(*this));
10361041
}
10371042
#endif // LIBMESH_ENABLE_PERIODIC
10381043

tests/systems/disconnected_neighbor_test.C

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include "test_comm.h"
1616
#include "libmesh_cppunit.h"
1717

18-
#include <libmesh/disconnected_neighbor_coupling.h>
19-
20-
2118
using namespace libMesh;
2219

2320
static const Real b = 1.0;
@@ -267,9 +264,6 @@ private:
267264
// assertions later may fail.
268265
mesh.allow_renumbering(false);
269266

270-
// Ghost the disconnected elements
271-
mesh.add_ghosting_functor(std::make_unique<DisconnectedNeighborCoupling>(mesh));
272-
273267
mesh.prepare_for_use();
274268

275269
// Check elem 0 (the left element)
@@ -504,9 +498,6 @@ private:
504498
// And, in `prepare_for_use()`, libMesh will set up the disconnected neighbor relationships.
505499
mesh.add_disconnected_boundaries(interface_left_id, interface_right_id, RealVectorValue(0.0, 0.0, 0.0));
506500

507-
// Ghost the disconnected elements
508-
mesh.add_ghosting_functor(std::make_unique<DisconnectedNeighborCoupling>(mesh));
509-
510501
mesh.prepare_for_use();
511502
}
512503
};

0 commit comments

Comments
 (0)