https://mooseframework.inl.gov
SBMSurfaceMeshBuilder.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 
12 #include "GeneralUserObject.h"
13 #include "libmesh/mesh.h"
14 #include "KDTree.h"
15 #include "SBMBndElementBase.h"
16 
18 {
19 public:
22 
23  virtual void initialSetup() override;
24  virtual void initialize() override {}
25  virtual void execute() override {}
26  virtual void finalize() override {}
27 
33  KDTree & getKDTree() const;
34 
37  bool hasKDTree() const { return _kd_tree != nullptr; }
38 
40  const std::vector<std::unique_ptr<SBMBndElementBase>> & getBoundaryElements() const;
41 
43  const std::vector<Point> & getCentroids() const;
44 
58  bool checkWatertightness() const;
59 
60 protected:
64  std::unique_ptr<MeshBase> _mesh;
65 
67  std::unique_ptr<KDTree> _kd_tree;
68 
70  std::vector<std::unique_ptr<SBMBndElementBase>> _boundary_elements;
71 
73  std::vector<Point> _centroids;
74 
76  const int _leaf_max_size;
77 
79  const std::string _bnd_mesh_name;
80 
83 
85  const bool _build_kd_tree;
86 
87 private:
89  const unsigned int _dim_embedding_mesh;
90 };
std::vector< Point > _centroids
The centroids of the elements in the boundary mesh are stored in a vector of Points. The sequence is the same as in _boundary_elements.
virtual void initialSetup() override
virtual void finalize() override
const InputParameters & parameters() const
SBMSurfaceMeshBuilder(const InputParameters &parameters)
bool checkWatertightness() const
Checks whether the boundary mesh is "closed" – i.e.
bool hasKDTree() const
Whether this builder has a KDTree available.
const std::string _bnd_mesh_name
The name of a mesh saved via MeshGenerator save_mesh_as parameter.
KDTree & getKDTree() const
Returns a mutable reference because KDTree::neighborSearch is non-const (nanoflann&#39;s knnSearch thread...
std::vector< std::unique_ptr< SBMBndElementBase > > _boundary_elements
The boundary elements are stored in a vector of unique pointers to SBMBndElementBase.
const std::vector< Point > & getCentroids() const
Get the centroids of the boundary elements.
const std::vector< std::unique_ptr< SBMBndElementBase > > & getBoundaryElements() const
Get the SBM boundary elements.
virtual void initialize() override
const int _leaf_max_size
Configures KDTree leaf node size for performance tuning.
virtual void execute() override
const unsigned int _dim_embedding_mesh
The dimension of the embedding mesh (2D or 3D).
const bool _build_kd_tree
whether we want to build a kd-tree or not
std::unique_ptr< MeshBase > _mesh
Holds the mesh to ensure boundary element pointers remain valid.
std::unique_ptr< KDTree > _kd_tree
The KDTree is constructed using the centroids of the elements in the boundary mesh.
const bool _check_watertightness
The flag to check the watertightness of the mesh.
static InputParameters validParams()