https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
19public:
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
60protected:
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
87private:
89 const unsigned int _dim_embedding_mesh;
90};
const InputParameters & parameters() const
virtual void initialSetup() override
KDTree & getKDTree() const
Returns a mutable reference because KDTree::neighborSearch is non-const (nanoflann's knnSearch thread...
virtual void execute() override
const bool _check_watertightness
The flag to check the watertightness of the mesh.
virtual void finalize() override
virtual void initialize() override
const std::vector< std::unique_ptr< SBMBndElementBase > > & getBoundaryElements() const
Get the SBM boundary elements.
bool hasKDTree() const
Whether this builder has a KDTree available.
const bool _build_kd_tree
whether we want to build a kd-tree or not
std::vector< std::unique_ptr< SBMBndElementBase > > _boundary_elements
The boundary elements are stored in a vector of unique pointers to SBMBndElementBase.
std::unique_ptr< MeshBase > _mesh
Holds the mesh to ensure boundary element pointers remain valid.
const std::string _bnd_mesh_name
The name of a mesh saved via MeshGenerator save_mesh_as parameter.
std::vector< Point > _centroids
The centroids of the elements in the boundary mesh are stored in a vector of Points....
static InputParameters validParams()
bool checkWatertightness() const
Checks whether the boundary mesh is "closed" – i.e.
const unsigned int _dim_embedding_mesh
The dimension of the embedding mesh (2D or 3D).
std::unique_ptr< KDTree > _kd_tree
The KDTree is constructed using the centroids of the elements in the boundary mesh.
const std::vector< Point > & getCentroids() const
Get the centroids of the boundary elements.
const int _leaf_max_size
Configures KDTree leaf node size for performance tuning.