www.mooseframework.org
DiracKernelInfo.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 #include "Moose.h"
13 #include "MooseTypes.h"
14 
15 #include <set>
16 #include <map>
17 #include <memory>
18 
19 // Forward declarations
20 class MooseMesh;
21 
22 namespace libMesh
23 {
24 class Elem;
25 class PointLocatorBase;
26 class Point;
27 }
28 
36 {
37 public:
39  virtual ~DiracKernelInfo();
40 
41 public:
47  void addPoint(const Elem * elem, const Point & p);
48 
52  void clearPoints();
53 
57  bool hasPoint(const Elem * elem, const Point & p);
58 
62  std::set<const Elem *> & getElements() { return _elements; }
63 
64  typedef std::map<const Elem *, std::pair<std::vector<Point>, std::vector<unsigned int>>>
66 
71 
76  void updatePointLocator(const MooseMesh & mesh);
77 
82  const Elem *
83  findPoint(const Point & p, const MooseMesh & mesh, const std::set<SubdomainID> & blocks);
84 
85 protected:
89  bool pointsFuzzyEqual(const Point &, const Point &);
90 
92  std::set<const Elem *> _elements;
93 
96 
101  std::unique_ptr<PointLocatorBase> _point_locator;
102 
105 };
bool hasPoint(const Elem *elem, const Point &p)
Return true if we have Point &#39;p&#39; in Element &#39;elem&#39;.
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
const Elem * findPoint(const Point &p, const MooseMesh &mesh, const std::set< SubdomainID > &blocks)
Used by client DiracKernel classes to determine the Elem in which the Point p resides.
std::set< const Elem * > _elements
The list of elements that need distributions.
MultiPointMap _points
The list of physical xyz Points that need to be evaluated in each element.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void addPoint(const Elem *elem, const Point &p)
Adds a point source.
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
void clearPoints()
Remove all of the current points and elements.
std::unique_ptr< PointLocatorBase > _point_locator
The DiracKernelInfo object manages a PointLocator object which is used by all DiracKernels to find Po...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _point_equal_distance_sq
threshold distance squared below which two points are considered identical
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
std::map< const Elem *, std::pair< std::vector< Point >, std::vector< unsigned int > > > MultiPointMap
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
virtual ~DiracKernelInfo()
bool pointsFuzzyEqual(const Point &, const Point &)
Check if two points are equal with respect to a tolerance.