Skip to content

Commit 1ad8ef8

Browse files
committed
Add translations customization for disconnected neighbor
1 parent db91a1f commit 1ad8ef8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

include/mesh/mesh_base.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#include <string>
3737
#include <memory>
3838

39+
#include "libmesh/vector_value.h"
40+
3941
// periodic boundary condition support
4042
// Use forward declarations inside the libMesh namespace
4143
namespace libMesh
@@ -1833,7 +1835,8 @@ class MeshBase : public ParallelObject
18331835
* Register a pair of boundaries as disconnected boundaries.
18341836
*/
18351837
void add_disconnected_boundaries(const boundary_id_type b1,
1836-
const boundary_id_type b2);
1838+
const boundary_id_type b2,
1839+
const RealVectorValue & translation);
18371840

18381841
PeriodicBoundaries * get_disconnected_boundaries();
18391842

src/mesh/mesh_base.C

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,15 +1962,16 @@ void MeshBase::detect_interior_parents()
19621962
* Register a pair of boundaries as disconnected boundaries.
19631963
*/
19641964
void MeshBase::add_disconnected_boundaries(const boundary_id_type b1,
1965-
const boundary_id_type b2)
1965+
const boundary_id_type b2,
1966+
const RealVectorValue & translation)
19661967
{
19671968
// Lazily allocate the container the first time it’s needed
19681969
if (!_disconnected_boundary_pairs)
19691970
_disconnected_boundary_pairs = std::make_unique<PeriodicBoundaries>();
19701971

19711972
// Create forward and inverse boundary mappings
1972-
PeriodicBoundary forward(RealVectorValue(0., 0., 0.));
1973-
PeriodicBoundary inverse(RealVectorValue(0., 0., 0.));
1973+
PeriodicBoundary forward(translation);
1974+
PeriodicBoundary inverse(translation * -1.0);
19741975

19751976
forward.myboundary = b1;
19761977
forward.pairedboundary = b2;

src/mesh/unstructured_mesh.C

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -998,16 +998,14 @@ void UnstructuredMesh::find_neighbors (const bool reset_remote_elements,
998998
}
999999

10001000
#ifdef LIBMESH_ENABLE_PERIODIC
1001+
// Get the disconnected boundaries object (from periodic BCs)
10011002
auto * db = this->get_disconnected_boundaries();
10021003

10031004
if (db)
10041005
{
10051006
// Obtain a point locator
10061007
std::unique_ptr<PointLocatorBase> point_locator = this->sub_point_locator();
10071008

1008-
// Get the disconnected boundaries object (from periodic BCs)
1009-
auto * db = this->get_disconnected_boundaries();
1010-
10111009
for (const auto & element : this->element_ptr_range())
10121010
{
10131011
for (auto ms : element->side_index_range())

0 commit comments

Comments
 (0)