diff --git a/framework/doc/content/source/meshgenerators/CutMeshByLevelSetGenerator.md b/framework/doc/content/source/meshgenerators/CutMeshByLevelSetGenerator.md index 80fc13e8133a..c03582361b76 100644 --- a/framework/doc/content/source/meshgenerators/CutMeshByLevelSetGenerator.md +++ b/framework/doc/content/source/meshgenerators/CutMeshByLevelSetGenerator.md @@ -1,4 +1,4 @@ -# CutMeshByPlaneGenerator +# CutMeshByLevelSetGenerator !syntax description /Mesh/CutMeshByLevelSetGenerator @@ -6,7 +6,7 @@ The `CutMeshByLevelSetGenerator` is an extended version of [`CutMeshByPlaneGenerator`](/CutMeshByPlaneGenerator.md). It is used to trim a 3D input mesh based on a given level set `f(x,y,z)`. The portion of the input mesh that is within the level set (i.e., `f(x,y,z)<=0`) is retained, while the portion of the input mesh that is outside the level set (i.e., `f(x,y,z)>0`) is discarded. The input mesh, given by [!param](/Mesh/CutMeshByLevelSetGenerator/input), must be 3D and contain only first-order elements. The level set is specified by [!param](/Mesh/CutMeshByLevelSetGenerator/level_set), which can be interpreted by `FParser` as a function of `x`, `y`, and `z` (i.e., `f(x,y,z)`). The mesh is then smoothed to avert a "zigzag" cut along element boundaries. -Using this mesh generator, a 3D structured mesh defined by a bounding box (e.g., generated by [`GeneratedMeshGenerator`](/GeneratedMeshGenerator.md)) can be subtracted into a 3D mesh with its shape define by a given level set. Such a 3D mesh could be further used as an input of [`XYZDelaunayGenerator`](/XYZDelaunayGenerator.md). +Using this mesh generator, a 3D structured mesh defined by a bounding box (e.g., generated by [`GeneratedMeshGenerator`](/GeneratedMeshGenerator.md)) can be subtracted into a 3D mesh with its shape define by a given level set. ## Methods diff --git a/framework/include/meshgenerators/CutMeshByLevelSetGeneratorBase.h b/framework/include/meshgenerators/CutMeshByLevelSetGeneratorBase.h index 5848cb324e0a..251be4bb09e3 100644 --- a/framework/include/meshgenerators/CutMeshByLevelSetGeneratorBase.h +++ b/framework/include/meshgenerators/CutMeshByLevelSetGeneratorBase.h @@ -47,7 +47,7 @@ class CutMeshByLevelSetGeneratorBase : public MeshGenerator, public FunctionPars SymFunctionPtr _func_level_set; /** - * Evaluate the whether a point is on the level set, inside or outside the level set. + * Evaluate whether a point is on the level set, inside or outside the level set. * @param point The point at which the level set function is to be evaluated * @return the relation of the point to the level set */ @@ -63,8 +63,8 @@ class CutMeshByLevelSetGeneratorBase : public MeshGenerator, public FunctionPars Point pointPairLevelSetInterception(const Point & point1, const Point & point2); /** - * For a TET4 elements crossed by the cutting plane, keep the part of the element on the retaining - * side of the plane using a number of TET4 elements. + * For a TET4 elements crossed by the level set, keep the part of the element on the retaining + * side of the level set using a number of TET4 elements. * @param mesh The mesh to be modified * @param bdry_side_list A list that contains the boundary information of the original mesh * @param elem_id The id of the element to be cut diff --git a/framework/src/meshgenerators/CutMeshByLevelSetGeneratorBase.C b/framework/src/meshgenerators/CutMeshByLevelSetGeneratorBase.C index afa965e73201..157c01a58ab5 100644 --- a/framework/src/meshgenerators/CutMeshByLevelSetGeneratorBase.C +++ b/framework/src/meshgenerators/CutMeshByLevelSetGeneratorBase.C @@ -37,7 +37,7 @@ CutMeshByLevelSetGeneratorBase::validParams() params.addClassDescription( "This CutMeshByLevelSetGeneratorBase object is designed to be the base class of mesh " - "generator that cuts a 3D mesh based on a analytic level set function. The level set " + "generator that cuts a 3D mesh based on an analytic level set function. The level set " "function could be provided explicitly or indirectly."); return params; @@ -189,6 +189,7 @@ CutMeshByLevelSetGeneratorBase::pointPairLevelSetInterception(const Point & poin Real dist = abs(dist1) + abs(dist2); Point mid_point; + // Bisection method to find midpoint while (MooseUtils::absoluteFuzzyGreaterThan(dist, 0.0)) { mid_point = 0.5 * (p1 + p2); diff --git a/framework/src/meshgenerators/CutMeshByPlaneGenerator.C b/framework/src/meshgenerators/CutMeshByPlaneGenerator.C index 282e5253d1c3..c0233bf1fe8d 100644 --- a/framework/src/meshgenerators/CutMeshByPlaneGenerator.C +++ b/framework/src/meshgenerators/CutMeshByPlaneGenerator.C @@ -40,7 +40,7 @@ CutMeshByPlaneGenerator::CutMeshByPlaneGenerator(const InputParameters & paramet _func_level_set = std::make_shared(); // set FParser internal feature flags setParserFeatureFlags(_func_level_set); - // The plance is (x - x0) * n_x + (y - y0) * n_y + (z - z0) * n_z = 0 + // The plane is (x - x0) * n_x + (y - y0) * n_y + (z - z0) * n_z = 0 std::stringstream level_set_ss; // Let's be conservative about precision here level_set_ss << std::fixed << std::setprecision(15) << _plane_normal(0) << "*(x-" diff --git a/test/tests/meshgenerators/cut_mesh_by_level_set_generator/tests b/test/tests/meshgenerators/cut_mesh_by_level_set_generator/tests index dfa1b8720e76..5bbd77b23c2a 100644 --- a/test/tests/meshgenerators/cut_mesh_by_level_set_generator/tests +++ b/test/tests/meshgenerators/cut_mesh_by_level_set_generator/tests @@ -18,7 +18,7 @@ csvdiff = 'cut_xyzd_out.csv' mesh_mode = 'REPLICATED' recover = false - detail ='cut a 3D mesh to generator a raw level set mesh that can be used for 3D delaunay mesh generation.' + detail ='cut a 3D mesh to generate a raw level set mesh that can be used for 3D Delaunay mesh generation.' [] [] # Does not need error tests as they have been covered by CutMeshByPlaneGenerator