https://mooseframework.inl.gov
Boundary2DDelaunayGenerator.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include "FunctionParserUtils.h"
14 
15 #include "libmesh/meshfree_interpolation.h"
16 
18  public FunctionParserUtils<false>
19 {
20 public:
22 
24 
25  virtual std::unique_ptr<MeshBase> generate() override;
26 
27 protected:
29  std::unique_ptr<MeshBase> & _input;
30 
32  const std::vector<BoundaryName> _boundary_names;
33 
35  const std::vector<std::vector<BoundaryName>> _hole_boundary_names;
36 
39 
42 
45 
48 
54  Point elemNormal(const Elem & elem);
55 
62  Point meshNormal2D(const MeshBase & mesh);
63 
72  Real meshNormalDeviation2D(const MeshBase & mesh, const Point & global_norm);
73 
79  Real levelSetEvaluator(const Point & point);
80 
85  void levelSetCorrection(Node & node);
86 
94  std::unique_ptr<MeshBase>
95  General2DDelaunay(std::unique_ptr<MeshBase> & mesh_2d,
96  std::vector<std::unique_ptr<MeshBase>> & hole_meshes_2d);
97 };
Boundary2DDelaunayGenerator(const InputParameters &parameters)
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
const std::vector< std::vector< BoundaryName > > _hole_boundary_names
The boundaries to be used as holes.
Base class for Delaunay mesh generators applied to a surface.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
BoundaryName _output_external_boundary_name
The name of the external boundary of the mesh to generate.
const unsigned int _max_level_set_correction_iterations
Maximum number of iterations to correct the nodes based on the level set function.
std::unique_ptr< MeshBase > & _input
The input mesh name.
virtual std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const Real _max_angle_deviation
Max angle deviation from the global average normal vector in the input mesh.
std::unique_ptr< MeshBase > General2DDelaunay(std::unique_ptr< MeshBase > &mesh_2d, std::vector< std::unique_ptr< MeshBase >> &hole_meshes_2d)
Generate a 2D mesh using Delaunay triangulation based on the input 2D boundary mesh and the 2D hole m...
Real levelSetEvaluator(const Point &point)
Evaluate the level set function at a given point.
SymFunctionPtr _func_level_set
function parser object describing the level set
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Point elemNormal(const Elem &elem)
Calculate the normal vector of a 2D element based the first three vertices.
Real meshNormalDeviation2D(const MeshBase &mesh, const Point &global_norm)
Calculate the maximum deviation of the normal vectors in a given mesh from a global average normal ve...
static InputParameters validParams()
Point meshNormal2D(const MeshBase &mesh)
Calculate the average normal vector of a 2D mesh based on the normal vectors of its elements using th...
void levelSetCorrection(Node &node)
Correct the position of a node based on the level set function.
const std::vector< BoundaryName > _boundary_names
The boundaries to be converted to a 2D mesh.