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 
14 #include <set>
15 #include <map>
16 #include <memory>
17 
18 // Forward declarations
19 class MooseMesh;
20 
21 namespace libMesh
22 {
23 class Elem;
24 class PointLocatorBase;
25 class Point;
26 }
27 
35 {
36 public:
38  virtual ~DiracKernelInfo();
39 
40 public:
46  void addPoint(const Elem * elem, Point p);
47 
51  void clearPoints();
52 
56  bool hasPoint(const Elem * elem, Point p);
57 
61  std::set<const Elem *> & getElements() { return _elements; }
62 
63  typedef std::map<const Elem *, std::pair<std::vector<Point>, std::vector<unsigned int>>>
65 
70 
75  void updatePointLocator(const MooseMesh & mesh);
76 
81  const Elem * findPoint(Point p, const MooseMesh & mesh);
82 
83 protected:
87  bool pointsFuzzyEqual(const Point &, const Point &);
88 
90  std::set<const Elem *> _elements;
91 
94 
99  std::unique_ptr<PointLocatorBase> _point_locator;
100 
103 };
104 
DiracKernelInfo::findPoint
const Elem * findPoint(Point p, const MooseMesh &mesh)
Used by client DiracKernel classes to determine the Elem in which the Point p resides.
Definition: DiracKernelInfo.C:111
DiracKernelInfo::~DiracKernelInfo
virtual ~DiracKernelInfo()
Definition: DiracKernelInfo.C:24
libMesh
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Definition: AddPeriodicBCAction.h:16
Moose.h
DiracKernelInfo::pointsFuzzyEqual
bool pointsFuzzyEqual(const Point &, const Point &)
Check if two points are equal with respect to a tolerance.
Definition: DiracKernelInfo.C:149
DiracKernelInfo::updatePointLocator
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
Definition: DiracKernelInfo.C:71
DiracKernelInfo::_point_locator
std::unique_ptr< PointLocatorBase > _point_locator
The DiracKernelInfo object manages a PointLocator object which is used by all DiracKernels to find Po...
Definition: DiracKernelInfo.h:99
DiracKernelInfo::_elements
std::set< const Elem * > _elements
The list of elements that need distributions.
Definition: DiracKernelInfo.h:90
DiracKernelInfo::_point_equal_distance_sq
const Real _point_equal_distance_sq
threshold distance squared below which two points are considered identical
Definition: DiracKernelInfo.h:102
DiracKernelInfo::addPoint
void addPoint(const Elem *elem, Point p)
Adds a point source.
Definition: DiracKernelInfo.C:27
DiracKernelInfo::clearPoints
void clearPoints()
Remove all of the current points and elements.
Definition: DiracKernelInfo.C:51
DiracKernelInfo::_points
MultiPointMap _points
The list of physical xyz Points that need to be evaluated in each element.
Definition: DiracKernelInfo.h:93
DiracKernelInfo::DiracKernelInfo
DiracKernelInfo()
Definition: DiracKernelInfo.C:19
DiracKernelInfo::getElements
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
Definition: DiracKernelInfo.h:61
DiracKernelInfo::MultiPointMap
std::map< const Elem *, std::pair< std::vector< Point >, std::vector< unsigned int > > > MultiPointMap
Definition: DiracKernelInfo.h:64
MooseMesh
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
DiracKernelInfo::getPoints
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
Definition: DiracKernelInfo.h:69
DiracKernelInfo::hasPoint
bool hasPoint(const Elem *elem, Point p)
Return true if we have Point 'p' in Element 'elem'.
Definition: DiracKernelInfo.C:58
DiracKernelInfo
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
Definition: DiracKernelInfo.h:34