https://mooseframework.inl.gov
GeometricSearchInterface.C
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 
11 
12 // MOOSE includes
13 #include "GeometricSearchData.h"
14 #include "MooseObject.h"
15 #include "NearestNodeLocator.h"
16 #include "PenetrationLocator.h"
17 #include "SubProblem.h"
18 #include "SystemBase.h"
19 
22 {
24 
25  MooseEnum search_methods("nearest_node_connected_sides all_proximate_sides",
26  "nearest_node_connected_sides");
27 
28  params.addParam<MooseEnum>(
29  "search_method",
30  search_methods,
31  "Choice of search algorithm. All options begin by finding the nearest node in the "
32  "primary boundary to a query point in the secondary boundary. In the default "
33  "nearest_node_connected_sides algorithm, primary boundary elements are searched iff "
34  "that nearest node is one of their nodes. This is fast to determine via a "
35  "pregenerated node-to-elem map and is robust on conforming meshes. In the optional "
36  "all_proximate_sides algorithm, primary boundary elements are searched iff they touch "
37  "that nearest node, even if they are not topologically connected to it. This is "
38  "more CPU-intensive but is necessary for robustness on any boundary surfaces which "
39  "has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes "
40  "in adaptively h-refined meshes).");
41 
42  params.addParamNamesToGroup("search_method", "Advanced");
43 
44  return params;
45 }
46 
48  : _geometric_search_data(moose_object->parameters()
49  .getCheckedPointerParam<SubProblem *>("_subproblem")
50  ->geomSearchData()),
51  _requires_geometric_search(false)
52 {
53  if (moose_object->getParam<MooseEnum>("search_method") == "all_proximate_sides")
55 }
56 
57 #ifdef MOOSE_KOKKOS_ENABLED
60  : _geometric_search_data(object._geometric_search_data),
61  _requires_geometric_search(object._requires_geometric_search)
62 {
63 }
64 #endif
65 
68  const BoundaryName & secondary,
69  Order order)
70 {
72  return _geometric_search_data.getPenetrationLocator(primary, secondary, order);
73 }
74 
77  const BoundaryName & secondary,
78  Order order)
79 {
81  return _geometric_search_data.getQuadraturePenetrationLocator(primary, secondary, order);
82 }
83 
86  const BoundaryName & secondary)
87 {
89  return _geometric_search_data.getNearestNodeLocator(primary, secondary);
90 }
91 
94  const BoundaryName & secondary)
95 {
98 }
GeometricSearchInterface(const MooseObject *moose_object)
NearestNodeLocator & getNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
Retrieve the PenetrationLocator associated with the two sides.
Order
NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
Retrieve a Quadrature NearestNodeLocator associated with the two sides.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseBase.h:388
PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, Order order)
Retrieve the Quadrature PenetrationLocator associated with the two sides.
GeometricSearchData & _geometric_search_data
NearestNodeLocator & getNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()
bool _requires_geometric_search
Whether any of this interface&#39;s methods have been called, e.g.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:27
NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
void setSearchUsingPointLocator(bool state)
PenetrationLocator & getPenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, Order order)
Retrieve the PenetrationLocator associated with the two sides.
PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
static InputParameters validParams()
PenetrationLocator & getPenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...