https://mooseframework.inl.gov
CutMeshByLevelSetGeneratorBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "MeshGenerator.h"
12 
13 #include "FunctionParserUtils.h"
14 
21 {
22 public:
24 
26 
27  std::unique_ptr<MeshBase> generate() override;
28 
30  enum class PointLevelSetRelationIndex : short int
31  {
33  level_set_in_side = -1,
34  on_level_set = 0
35  };
36 
37 protected:
39  const MeshGeneratorName _input_name;
43  const BoundaryName _cut_face_name;
45  std::unique_ptr<MeshBase> & _input;
48 
55 
63  Point pointPairLevelSetInterception(const Point & point1, const Point & point2);
64 
75  void tet4ElemCutter(ReplicatedMesh & mesh,
76  const std::vector<libMesh::BoundaryInfo::BCTuple> & bdry_side_list,
77  const dof_id_type elem_id,
78  const subdomain_id_type & block_id_to_remove,
79  std::vector<const Node *> & new_on_plane_nodes);
80 
90  const Node * nonDuplicateNodeCreator(ReplicatedMesh & mesh,
91  std::vector<const Node *> & new_on_plane_nodes,
92  const Point & new_point) const;
93 
99  Real levelSetEvaluator(const Point & point);
100 };
std::unique_ptr< MeshBase > & _input
Reference to input mesh pointer.
std::shared_ptr< SymFunction > SymFunctionPtr
Shorthand for an smart pointer to an autodiff function parser object.
This CutMeshByLevelSetGeneratorBase object is designed to be the base class of mesh generator that cu...
SymFunctionPtr _func_level_set
function parser object describing the level set
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
PointLevelSetRelationIndex pointLevelSetRelation(const Point &point)
Evaluate whether a point is on the level set, inside or outside the level set.
const BoundaryName _cut_face_name
The boundary name of the surface generated by the cut.
Real levelSetEvaluator(const Point &point)
Evaluate the level set function at a given point.
int8_t boundary_id_type
PointLevelSetRelationIndex
An enum class for style of input polygon size.
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
Point pointPairLevelSetInterception(const Point &point1, const Point &point2)
Calculate the intersection point of a level set and a line segment defined by two points separated by...
const Node * nonDuplicateNodeCreator(ReplicatedMesh &mesh, std::vector< const Node *> &new_on_plane_nodes, const Point &new_point) const
Check if a position on a plane has already been used as a node in the mesh.
CutMeshByLevelSetGeneratorBase(const InputParameters &parameters)
boundary_id_type _cut_face_id
The boundary id of the surface generated by the cut.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void tet4ElemCutter(ReplicatedMesh &mesh, const std::vector< libMesh::BoundaryInfo::BCTuple > &bdry_side_list, const dof_id_type elem_id, const subdomain_id_type &block_id_to_remove, std::vector< const Node *> &new_on_plane_nodes)
For a TET4 elements crossed by the level set, keep the part of the element on the retaining side of t...
const InputParameters & parameters() const
Get the parameters of the object.
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
void ErrorVector unsigned int
const MeshGeneratorName _input_name
Name of the input mesh.
uint8_t dof_id_type