-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28298 from roystgnr/XYZDelaunay
XYZDelaunayMeshGenerator
- Loading branch information
Showing
16 changed files
with
947 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
framework/doc/content/source/meshgenerators/XYZDelaunayGenerator.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# XYZDelaunayGenerator | ||
|
||
!syntax description /Mesh/XYZDelaunayGenerator | ||
|
||
An input mesh will be used to define the outer boundary of a | ||
generated tetrahedral output mesh. Additional interior vertices can | ||
be automatically generated by specifying a desired tetrahedral volume. | ||
Additional interior boundary "holes" can be specified by the mesh | ||
generators specified in the [!param](/Mesh/XYZDelaunayGenerator/holes) | ||
vector parameter. | ||
|
||
Each input mesh, as specified in the | ||
[!param](/Mesh/XYZDelaunayGenerator/boundary) parameter and optionally | ||
in the [!param](/Mesh/XYZDelaunayGenerator/holes) parameter, | ||
can define a closed manifold of boundary triangles either by including | ||
Tri3 elements for each triangle or by including volume elements whose | ||
external faces comprise the boundary manifold. | ||
|
||
If multiple disconnected manifolds exist in a boundary mesh, only the | ||
manifold enclosing the rest of the mesh is considered to be "the" | ||
boundary. Input meshes which are not connected, which therefore have | ||
multiple outer boundary manifolds, are not yet supported. | ||
|
||
Nodes internal to the boundary mesh are currently ignored. Future | ||
expansions of this class may allow such nodes to be retained as nodes | ||
in the output tetrahedralization. | ||
|
||
Using stitching options, meshes used as "holes" can subsequently be | ||
stitched into those portions of the output mesh. | ||
|
||
Interior vertices can be adjusted after mesh generation using the | ||
[!param](/Mesh/XYZDelaunayGenerator/smooth_triangulation) parameter, | ||
to produce a more "smooth" mesh, but currently the only mesh smoother | ||
option is a simple Laplacian smoother; this can have unwanted | ||
side-effects on meshes with concave boundaries or poor nodal valences, | ||
and so it is disabled by default for robustness. | ||
|
||
The elements generated by `XYZDelaunayGenerator` can be refined according | ||
to a given uniform element volume specified as | ||
[!param](/Mesh/XYZDelaunayGenerator/desired_volume). | ||
This refinement is currently controlled by the third-party Netgen | ||
code. | ||
|
||
!syntax parameters /Mesh/XYZDelaunayGenerator | ||
|
||
!syntax inputs /Mesh/XYZDelaunayGenerator | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "MeshGenerator.h" | ||
|
||
/** | ||
* Generates a tetrahedral mesh, based on an input mesh defining the | ||
* outer boundary and an optional set of input meshes defining inner | ||
* hole boundaries. | ||
*/ | ||
class XYZDelaunayGenerator : public MeshGenerator | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
XYZDelaunayGenerator(const InputParameters & parameters); | ||
|
||
std::unique_ptr<MeshBase> generate() override; | ||
|
||
protected: | ||
/// Input mesh defining the boundary to triangulate within | ||
std::unique_ptr<MeshBase> & _bdy_ptr; | ||
|
||
/// Desired volume of output tetrahedra | ||
const Real _desired_volume; | ||
|
||
/// What subdomain_id to set on the generated tetrahedra | ||
SubdomainID _output_subdomain_id; | ||
|
||
/// Whether to do Laplacian mesh smoothing on the generated triangles | ||
const bool _smooth_tri; | ||
|
||
/// Holds pointers to the pointers to input meshes defining holes | ||
const std::vector<std::unique_ptr<MeshBase> *> _hole_ptrs; | ||
|
||
/// Whether to stitch to the mesh defining each hole | ||
const std::vector<bool> _stitch_holes; | ||
|
||
/// Type of algorithm used to find matching nodes (binary or exhaustive) | ||
const MooseEnum _algorithm; | ||
|
||
/// Whether mesh stitching should have verbose output | ||
const bool _verbose_stitching; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.