Line data Source code
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 : // MOOSE includes 13 : #include "GeneralVectorPostprocessor.h" 14 : #include "CoupleableMooseVariableDependencyIntermediateInterface.h" 15 : #include "MooseVariableInterface.h" 16 : #include "SamplerBase.h" 17 : 18 : /** 19 : * Base class for sampling objects (variables, functors etc) at points 20 : */ 21 : class PointSamplerBase : public GeneralVectorPostprocessor, protected SamplerBase 22 : { 23 : public: 24 : static InputParameters validParams(); 25 : 26 : PointSamplerBase(const InputParameters & parameters); 27 : 28 719 : virtual ~PointSamplerBase() {} 29 : 30 : virtual void initialize(); 31 : virtual void finalize(); 32 : 33 : protected: 34 : /** 35 : * Find the local element that contains the point. This will attempt to use a cached element to 36 : * speed things up. 37 : * 38 : * @param p The point in physical space 39 : * @return The Elem containing the point or NULL if this processor doesn't contain an element that 40 : * contains this point. 41 : */ 42 : const Elem * getLocalElemContainingPoint(const Point & p); 43 : 44 : /// The Mesh we're using 45 : MooseMesh & _mesh; 46 : 47 : /// The points to evaluate at 48 : std::vector<Point> _points; 49 : 50 : /// The ID to use for each point (yes, this is Real on purpose) 51 : std::vector<Real> _ids; 52 : 53 : /// Vector of values per point 54 : std::vector<std::vector<Real>> _point_values; 55 : 56 : /// Whether or not the Point was found on this processor (short because bool and char don't work with MPI wrappers) 57 : std::vector<short> _found_points; 58 : 59 : /// Point locator 60 : std::unique_ptr<libMesh::PointLocatorBase> _pl; 61 : 62 : /// Postprocessor multiplying the variables 63 : const Real & _pp_value; 64 : 65 : /// Whether to return a warning if a discontinuous variable is sampled on a face 66 : const bool _warn_discontinuous_face_values; 67 : 68 : /// Whether values are requested for objects that are discontinuous on faces 69 : bool _discontinuous_at_faces; 70 : };