Permalink
Browse files

Merge pull request #12664 from leorachapuis/stitching_improvements

Add the algorithm parameter in StitchedMeshGenerator.
  • Loading branch information...
friedmud committed Jan 9, 2019
2 parents d1a862f + ce1298b commit 0ae60f0d0529cbe7ed3f67ca24e17d148850af79
@@ -12,6 +12,7 @@

#include "MeshGenerator.h"
#include "libmesh/replicated_mesh.h"
#include "MooseEnum.h"

// Forward declarations
class StitchedMeshGenerator;
@@ -44,6 +45,9 @@ class StitchedMeshGenerator : public MeshGenerator

/// The meshes to be stitched together.
std::vector<std::unique_ptr<ReplicatedMesh>> _meshes;

/// Type of algorithm used to find matching nodes (binary or exhaustive)
MooseEnum _algorithm;
};

#endif // STITCHEDMESHGENERATOR_H
@@ -22,11 +22,17 @@ validParams<StitchedMeshGenerator>()
{
InputParameters params = validParams<MeshGenerator>();

MooseEnum algorithm("BINARY EXHAUSTIVE", "BINARY");

params.addRequiredParam<std::vector<MeshGeneratorName>>("inputs", "The input MeshGenerators.");
params.addParam<bool>(
"clear_stitched_boundary_ids", true, "Whether or not to clear the stitchd boundary IDs");
params.addRequiredParam<std::vector<std::vector<std::string>>>(
"stitch_boundaries_pairs", "Pairs of boundaries to be stitched together");
params.addParam<MooseEnum>(
"algorithm",
algorithm,
"Control the use of binary search for the nodes of the stitched surfaces.");

return params;
}
@@ -36,7 +42,8 @@ StitchedMeshGenerator::StitchedMeshGenerator(const InputParameters & parameters)
_input_names(getParam<std::vector<MeshGeneratorName>>("inputs")),
_clear_stitched_boundary_ids(getParam<bool>("clear_stitched_boundary_ids")),
_stitch_boundaries_pairs(
getParam<std::vector<std::vector<std::string>>>("stitch_boundaries_pairs"))
getParam<std::vector<std::vector<std::string>>>("stitch_boundaries_pairs")),
_algorithm(parameters.get<MooseEnum>("algorithm"))
{
// Grab the input meshes
_mesh_ptrs.reserve(_input_names.size());
@@ -118,7 +125,15 @@ StitchedMeshGenerator::generate()
}
}

mesh->stitch_meshes(*_meshes[i], first, second, TOLERANCE, _clear_stitched_boundary_ids);
const bool use_binary_search = (_algorithm == "BINARY");

mesh->stitch_meshes(*_meshes[i],
first,
second,
TOLERANCE,
_clear_stitched_boundary_ids,
/*verbose = */ true,
use_binary_search);
}

return dynamic_pointer_cast<MeshBase>(mesh);

0 comments on commit 0ae60f0

Please sign in to comment.