https://mooseframework.inl.gov
GeometricSearchData.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 // MOOSE includes
13 #include "MooseTypes.h"
14 
15 // libMesh includes
16 #include "libmesh/enum_order.h"
17 
18 // C++ includes
19 #include <map>
20 
21 // Forward Declarations
22 class MooseMesh;
23 class SubProblem;
24 class PenetrationLocator;
25 class NearestNodeLocator;
26 class ElementPairLocator;
27 
29 {
30 public:
33  {
34  ALL,
39  };
40 
41  GeometricSearchData(SubProblem & subproblem, MooseMesh & mesh);
42  virtual ~GeometricSearchData();
43 
44  PenetrationLocator & getPenetrationLocator(const BoundaryName & primary,
45  const BoundaryName & secondary,
47  PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName & primary,
48  const BoundaryName & secondary,
50 
51  NearestNodeLocator & getNearestNodeLocator(const BoundaryName & primary,
52  const BoundaryName & secondary);
54  const BoundaryID secondary_id);
55 
56  NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName & primary,
57  const BoundaryName & secondary);
59  const BoundaryID secondary_id);
60 
61  const std::map<std::pair<BoundaryID, BoundaryID>, PenetrationLocator *> &
63  {
64  return _penetration_locators;
65  }
66 
67  void addElementPairLocator(BoundaryID interface_id, std::shared_ptr<ElementPairLocator> epl);
68 
69  void setSearchUsingPointLocator(bool state);
70 
74  void update(GeometricSearchType type = ALL);
75 
79  void reinit();
80 
85 
92 
97  void updateGhostedElems();
98 
99  // protected:
102  std::map<std::pair<BoundaryID, BoundaryID>, PenetrationLocator *> _penetration_locators;
103  std::map<std::pair<BoundaryID, BoundaryID>, NearestNodeLocator *> _nearest_node_locators;
104  std::map<BoundaryID, std::shared_ptr<ElementPairLocator>> _element_pair_locators;
105 
106 protected:
108  std::set<BoundaryID> _quadrature_boundaries;
109 
111  std::map<BoundaryID, BoundaryID> _secondary_to_qsecondary;
112 
113 private:
123  void generateQuadratureNodes(const BoundaryID secondary_id,
124  const BoundaryID qsecondary_id,
125  bool reiniting = false);
126 
130  void updateQuadratureNodes(const BoundaryID secondary_id);
131 
135  void reinitQuadratureNodes(const BoundaryID secondary_id);
136 
140  bool _first;
141 
148 };
std::map< std::pair< BoundaryID, BoundaryID >, PenetrationLocator * > _penetration_locators
bool _first
Denotes whether this is the first time the geometric search objects have been updated.
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...
std::set< BoundaryID > _quadrature_boundaries
These are real boundaries that have quadrature nodes on them.
void updateGhostedElems()
Updates the list of ghosted elements at the start of each time step for the nonlinear iteration patch...
Real maxPatchPercentage()
Maximum percentage through the search patch that any NearestNodeLocator had to look.
std::map< std::pair< BoundaryID, BoundaryID >, NearestNodeLocator * > _nearest_node_locators
void reinitQuadratureNodes(const BoundaryID secondary_id)
Completely redo quadrature nodes.
bool _search_using_point_locator
Denotes whether the PenetrationLocator objects should use a point locator rather than cheaper node-to...
void addElementPairLocator(BoundaryID interface_id, std::shared_ptr< ElementPairLocator > epl)
std::map< BoundaryID, BoundaryID > _secondary_to_qsecondary
A mapping of the real boundary id to the secondary boundary ids.
boundary_id_type BoundaryID
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:92
NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
void reinit()
Completely redo all geometric search objects.
This is the ElementPairLocator class.
std::map< BoundaryID, std::shared_ptr< ElementPairLocator > > _element_pair_locators
GeometricSearchType
Used to select groups of geometric search objects to update.
void setSearchUsingPointLocator(bool state)
void updateQuadratureNodes(const BoundaryID secondary_id)
Update the positions of the quadrature nodes.
PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
const std::map< std::pair< BoundaryID, BoundaryID >, PenetrationLocator * > & getPenetrationLocators() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
void update(GeometricSearchType type=ALL)
Update all of the search objects.
void clearNearestNodeLocators()
Clear out the Penetration Locators so they will redo the search.
PenetrationLocator & getPenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
void generateQuadratureNodes(const BoundaryID secondary_id, const BoundaryID qsecondary_id, bool reiniting=false)
Add Quadrature Nodes to the Mesh in support of Quadrature based penetration location and nearest node...
GeometricSearchData(SubProblem &subproblem, MooseMesh &mesh)