19#include "libmesh/elem.h"
20#include "libmesh/node.h"
21#include "libmesh/int_range.h"
24 : _subproblem(subproblem), _mesh(
mesh), _first(true), _search_using_point_locator(false)
28 for (
const auto id : nodeset_ids)
29 if (nodeset_ids.find(-
id - 1) != nodeset_ids.end())
30 mooseError(
"Your mesh contains nodesets with negative IDs that interfere with QP nodeset IDs "
31 "potentially generated by the GeometricSearch system.");
165 const BoundaryName & secondary,
198 const BoundaryName & secondary,
208 const auto qsecondary_id = -secondary_id - 1;
236 const BoundaryName & secondary)
268 const BoundaryName & secondary)
284 const auto qsecondary_id = -secondary_id - 1;
307 for (
const auto & belem : range)
309 const Elem * elem = belem->_elem;
310 const auto side = belem->_side;
311 const auto boundary_id = belem->_bnd_id;
322 for (
const auto qp : index_range(points_face))
331 std::shared_ptr<ElementPairLocator> epl)
345 val->setUsePointLocator(state);
358 for (
const auto & belem : range)
360 const Elem * elem = belem->_elem;
361 const auto side = belem->_side;
362 const auto boundary_id = belem->_bnd_id;
373 for (
const auto qp : index_range(points_face))
boundary_id_type BoundaryID
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void reinit(const Elem *elem)
Reinitialize objects (JxW, q_points, ...) for an elements.
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
This is the ElementPairLocator class.
void reinit()
Completely redo all geometric search objects.
void restore()
Restore the PenetrationLocators' state captured by the most recent backup().
NearestNodeLocator & getNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
GeometricSearchType
Used to select groups of geometric search objects to update.
void addElementPairLocator(BoundaryID interface_id, std::shared_ptr< ElementPairLocator > epl)
bool _first
Denotes whether this is the first time the geometric search objects have been updated.
void reinitQuadratureNodes(const BoundaryID secondary_id)
Completely redo quadrature nodes.
std::map< std::pair< BoundaryID, BoundaryID >, NearestNodeLocator * > _nearest_node_locators
void clearNearestNodeLocators()
Clear out the Penetration Locators so they will redo the search.
std::map< BoundaryID, std::shared_ptr< ElementPairLocator > > _element_pair_locators
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...
std::map< std::pair< BoundaryID, BoundaryID >, PenetrationLocator * > _penetration_locators
bool _search_using_point_locator
Denotes whether the PenetrationLocator objects should use a point locator rather than cheaper node-to...
NearestNodeLocator & getQuadratureNearestNodeLocator(const BoundaryName &primary, const BoundaryName &secondary)
std::map< std::pair< BoundaryID, BoundaryID >, std::string > _penetration_locator_backups
Per-locator PenetrationLocator::backup() snapshots taken by backup(), keyed the same way as _penetrat...
void updateQuadratureNodes(const BoundaryID secondary_id)
Update the positions of the quadrature nodes.
GeometricSearchData(SubProblem &subproblem, MooseMesh &mesh)
void update(GeometricSearchType type=ALL)
Update all of the search objects.
virtual ~GeometricSearchData()
void backup()
Snapshot the PenetrationLocators' restartable state (the same state used for restart/recover),...
PenetrationLocator & getPenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
std::map< BoundaryID, BoundaryID > _secondary_to_qsecondary
A mapping of the real boundary id to the secondary boundary ids.
Real maxPatchPercentage()
Maximum percentage through the search patch that any NearestNodeLocator had to look.
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...
void setSearchUsingPointLocator(bool state)
PenetrationLocator & getQuadraturePenetrationLocator(const BoundaryName &primary, const BoundaryName &secondary, libMesh::Order order=libMesh::FIRST)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Node * getQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp)
Get a specified quadrature node.
void clearQuadratureNodes()
Clear out any existing quadrature nodes.
const std::set< BoundaryID > & meshNodesetIds() const
Returns a read-only reference to the set of nodesets currently present in the Mesh.
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
Get the associated BoundaryID for the boundary name.
Node * addQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp, BoundaryID bid, const Point &point)
Adds a fictitious "QuadratureNode".
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Finds the nearest node to each node in boundary1 to each node in boundary2 and the other way around.
Real _max_patch_percentage
void reinit()
Completely redo the search from scratch.
void findNodes()
This is the main method that is going to start the search.
void updateGhostedElems()
Updates the ghosted elements at the start of the time step for iteration patch update strategy.
void setUsePointLocator(bool state)
void reinit()
Completely redo the search from scratch.
Generic class for solving transient nonlinear problems.
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid)=0
virtual void addGhostedBoundary(BoundaryID boundary_id)=0
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
processor_id_type processor_id() const