https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DiracKernelInfo.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#include "Moose.h"
13#include "MooseTypes.h"
14#include "MooseEnum.h"
15
16#include <set>
17#include <map>
18#include <memory>
19
20// Forward declarations
21class MooseMesh;
22class MooseBase;
23
24namespace libMesh
25{
26class Elem;
27class PointLocatorBase;
28class Point;
29}
30
38{
39public:
41 virtual ~DiracKernelInfo();
42
43public:
50 void addPoint(const Elem * elem, const Point & p, const Real & value = 1);
51
55 void clearPoints();
56
60 bool hasPoint(const Elem * elem, const Point & p);
61
65 std::set<const Elem *> & getElements() { return _elements; }
66
67 typedef std::map<const Elem *, std::pair<std::vector<Point>, std::vector<Real>>> MultiPointMap;
68
73
78 void updatePointLocator(const MooseMesh & mesh);
79
81 CreateMooseEnumClass(PointNotFoundBehavior, ERROR, WARNING, IGNORE);
82
92 const Elem * findPoint(const Point & p,
93 const MooseMesh & mesh,
94 const std::set<SubdomainID> & blocks,
95 const PointNotFoundBehavior point_not_found_behavior,
96 const MooseBase & consumer);
97
98protected:
102 bool pointsFuzzyEqual(const Point &, const Point &);
103
105 std::set<const Elem *> _elements;
106
109
114 std::unique_ptr<libMesh::PointLocatorBase> _point_locator;
115
118};
char ** blocks
The DiracKernelInfo object is a place where all the Dirac points added by different DiracKernels are ...
bool hasPoint(const Elem *elem, const Point &p)
Return true if we have Point 'p' in Element 'elem'.
CreateMooseEnumClass(PointNotFoundBehavior, ERROR, WARNING, IGNORE)
Point-not-found behavior.
const Real _point_equal_distance_sq
threshold distance squared below which two points are considered identical
MultiPointMap _points
The list of physical xyz Points that need to be evaluated in each element.
virtual ~DiracKernelInfo()
void clearPoints()
Remove all of the current points and elements.
std::unique_ptr< libMesh::PointLocatorBase > _point_locator
The DiracKernelInfo object manages a PointLocator object which is used by all DiracKernels to find Po...
std::map< const Elem *, std::pair< std::vector< Point >, std::vector< Real > > > MultiPointMap
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
void addPoint(const Elem *elem, const Point &p, const Real &value=1)
Adds a point source.
const Elem * findPoint(const Point &p, const MooseMesh &mesh, const std::set< SubdomainID > &blocks, const PointNotFoundBehavior point_not_found_behavior, const MooseBase &consumer)
Used by client DiracKernel classes to determine the Elem in which the Point p resides.
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
std::set< const Elem * > _elements
The list of elements that need distributions.
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
bool pointsFuzzyEqual(const Point &, const Point &)
Check if two points are equal with respect to a tolerance.
Base class for everything in MOOSE with a name and a type.
Definition MooseBase.h:50
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...