https://mooseframework.inl.gov
Loading...
Searching...
No Matches
BoundaryShortestDistanceToSurface.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 "SideUserObject.h"
13
14#include <vector>
15
16class Function;
18
24{
25public:
26 using ElemSide = std::pair<dof_id_type, unsigned short int>;
27
30
31 virtual void initialSetup() override;
32 virtual void execute() override;
33 virtual void finalize() override;
34 virtual void initialize() override;
35 virtual void threadJoin(const UserObject & uo) override;
36
38 const RealVectorValue & surrogateDistance(const ElemSide & elem_side, unsigned int qp) const;
40 const RealVectorValue & trueNormal(const ElemSide & elem_side, unsigned int qp) const;
41
42protected:
44 std::vector<const Function *> _distance_functions;
45
47 std::map<ElemSide, std::vector<RealVectorValue>> _distance_vectors;
48
50 mutable std::map<ElemSide, std::vector<RealVectorValue>> _normal_vectors;
51
53 std::map<BoundaryID, unsigned int> _side_id_index;
54
56 const SBMInterfaceManager * _manager = nullptr;
57
59 std::map<BoundaryID, std::pair<SubdomainID, SubdomainID>> _boundary_subdomain_pairs;
60
61private:
63 std::vector<Real> _true_interface_measures;
64
66 std::map<ElemSide, unsigned int> _elem_side_to_bid;
67
70
73};
Computes and stores the distance vectors and true surface normals from surrogate boundary quadrature ...
std::pair< dof_id_type, unsigned short int > ElemSide
bool _suppress_distance_warning
Whether to suppress warnings about large distances.
const RealVectorValue & trueNormal(const ElemSide &elem_side, unsigned int qp) const
Provides query interfaces for normal vector.
std::map< BoundaryID, std::pair< SubdomainID, SubdomainID > > _boundary_subdomain_pairs
Ordered subdomain pair associated with each surrogate boundary.
std::map< BoundaryID, unsigned int > _side_id_index
Map from boundary ID to internal distance function index.
bool _debug_output
Whether to output debug information.
std::vector< const Function * > _distance_functions
Local distance functions when no external distance user object is supplied.
const SBMInterfaceManager * _manager
Optional manager supplying geometry for interfaces in a single surface mesh.
const RealVectorValue & surrogateDistance(const ElemSide &elem_side, unsigned int qp) const
Provides query interfaces for distance vector.
std::map< ElemSide, unsigned int > _elem_side_to_bid
Map from ElemSide to boundary ID index.
std::map< ElemSide, std::vector< RealVectorValue > > _distance_vectors
Distance vectors to the true interface at each quadrature point on an element side.
std::map< ElemSide, std::vector< RealVectorValue > > _normal_vectors
True interface normals at projected quadrature points on an element side.
std::vector< Real > _true_interface_measures
Signed true-interface measure integrated over each surrogate boundary.
virtual void threadJoin(const UserObject &uo) override
const InputParameters & parameters() const
Detects shared interfaces between subdomains in a single surface mesh containing the complete boundar...