Loading [MathJax]/extensions/tex2jax.js
Cardinal
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
NearestPointReceiver.h
Go to the documentation of this file.
1/********************************************************************/
2/* SOFTWARE COPYRIGHT NOTIFICATION */
3/* Cardinal */
4/* */
5/* (c) 2021 UChicago Argonne, LLC */
6/* ALL RIGHTS RESERVED */
7/* */
8/* Prepared by UChicago Argonne, LLC */
9/* Under Contract No. DE-AC02-06CH11357 */
10/* With the U. S. Department of Energy */
11/* */
12/* Prepared by Battelle Energy Alliance, LLC */
13/* Under Contract No. DE-AC07-05ID14517 */
14/* With the U. S. Department of Energy */
15/* */
16/* See LICENSE for full restrictions */
17/********************************************************************/
18
19#pragma once
20
21#include "GeneralUserObject.h"
22
23#include "libmesh/point.h"
24
29class NearestPointReceiver : public GeneralUserObject
30{
31public:
32 NearestPointReceiver(const InputParameters & parameters);
33 static InputParameters validParams();
34
35 virtual ~NearestPointReceiver();
36
37 virtual void initialize() override {}
38 virtual void execute() override;
39 virtual void finalize() override {}
40
41 virtual Real spatialValue(const Point & p) const override;
42
43 const std::vector<Point> & positions() { return _positions; }
44
45 void setValues(const std::vector<Real> & values);
46
47protected:
51 unsigned int nearestPosition(const Point & p) const;
52
53 const std::vector<Point> & _positions;
54
55 std::vector<Real> _data;
56};
Definition NearestPointReceiver.h:30
unsigned int nearestPosition(const Point &p) const
Definition NearestPointReceiver.C:79
virtual void execute() override
Definition NearestPointReceiver.C:57
const std::vector< Point > & _positions
Definition NearestPointReceiver.h:53
void setValues(const std::vector< Real > &values)
Definition NearestPointReceiver.C:70
std::vector< Real > _data
Definition NearestPointReceiver.h:55
virtual void finalize() override
Definition NearestPointReceiver.h:39
virtual void initialize() override
Definition NearestPointReceiver.h:37
virtual Real spatialValue(const Point &p) const override
Definition NearestPointReceiver.C:62
const std::vector< Point > & positions()
Definition NearestPointReceiver.h:43
static InputParameters validParams()
Definition NearestPointReceiver.C:24
virtual ~NearestPointReceiver()
Definition NearestPointReceiver.C:54