www.mooseframework.org
GeometricSearchData.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 & master,
45  const BoundaryName & slave,
46  Order order = FIRST);
47  PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName & master,
48  const BoundaryName & slave,
49  Order order = FIRST);
50 
51  NearestNodeLocator & getNearestNodeLocator(const BoundaryName & master,
52  const BoundaryName & slave);
53  NearestNodeLocator & getNearestNodeLocator(const unsigned int master_id,
54  const unsigned int slave_id);
55 
56  NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName & master,
57  const BoundaryName & slave);
58  NearestNodeLocator & getQuadratureNearestNodeLocator(const unsigned int master_id,
59  const unsigned int slave_id);
60 
61  void addElementPairLocator(const unsigned int & interface_id,
62  std::shared_ptr<ElementPairLocator> epl);
63 
68 
72  void reinit();
73 
78 
84  Real maxPatchPercentage();
85 
90  void updateGhostedElems();
91 
92  // protected:
95  std::map<std::pair<unsigned int, unsigned int>, PenetrationLocator *> _penetration_locators;
96  std::map<std::pair<unsigned int, unsigned int>, NearestNodeLocator *> _nearest_node_locators;
97  std::map<unsigned int, std::shared_ptr<ElementPairLocator>> _element_pair_locators;
98 
99 protected:
101  std::set<unsigned int> _quadrature_boundaries;
102 
104  std::map<unsigned int, unsigned int> _slave_to_qslave;
105 
106 private:
114  void generateQuadratureNodes(unsigned int slave_id, unsigned int qslave_id);
115 
119  void updateQuadratureNodes(unsigned int slave_id);
120 
124  void reinitQuadratureNodes(unsigned int slave_id);
125 
129  bool _first;
130 };
131 
std::set< unsigned int > _quadrature_boundaries
These are real boundaries that have quadrature nodes on them.
bool _first
Denotes whether this is the first time the geometric search objects have been updated.
PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName &master, const BoundaryName &slave, Order order=FIRST)
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around...
PenetrationLocator & getPenetrationLocator(const BoundaryName &master, const BoundaryName &slave, Order order=FIRST)
void addElementPairLocator(const unsigned int &interface_id, std::shared_ptr< ElementPairLocator > epl)
void updateQuadratureNodes(unsigned int slave_id)
Update the positions of the quadrature nodes.
std::map< unsigned int, unsigned int > _slave_to_qslave
A mapping of the real boundary id to the slave boundary ids.
void updateGhostedElems()
Updates the list of ghosted elements at the start of each time step for the nonlinear iteration patch...
NearestNodeLocator & getNearestNodeLocator(const BoundaryName &master, const BoundaryName &slave)
Real maxPatchPercentage()
Maximum percentage through the search patch that any NearestNodeLocator had to look.
NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName &master, const BoundaryName &slave)
void reinitQuadratureNodes(unsigned int slave_id)
Completely redo quadrature nodes.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
std::map< unsigned int, std::shared_ptr< ElementPairLocator > > _element_pair_locators
void reinit()
Completely redo all geometric search objects.
This is the ElementPairLocator class.
GeometricSearchType
Used to select groups of geometric search objects to update.
std::map< std::pair< unsigned int, unsigned int >, PenetrationLocator * > _penetration_locators
MatType type
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
std::map< std::pair< unsigned int, unsigned int >, NearestNodeLocator * > _nearest_node_locators
void update(GeometricSearchType type=ALL)
Update all of the search objects.
void clearNearestNodeLocators()
Clear out the Penetration Locators so they will redo the search.
void generateQuadratureNodes(unsigned int slave_id, unsigned int qslave_id)
Add Quadrature Nodes to the Mesh in support of Quadrature based penetration location and nearest node...
GeometricSearchData(SubProblem &subproblem, MooseMesh &mesh)