https://mooseframework.inl.gov
MFEMSamplerBase.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 #ifdef MOOSE_MFEM_ENABLED
11 
12 #pragma once
13 
15 
23 {
24 public:
26 
28  void initialSetup() override;
29 
30  void initialize() override {}
31 
33  void finalize() override;
34 
35 protected:
37  enum class PointLocationCode : unsigned int
38  {
39  INTERNAL = 0,
40  BORDER = 1,
41  NOT_FOUND = 2,
42  };
43 
45  const std::vector<Point> & points,
46  mfem::ParMesh & mesh);
47 
49  virtual void finalizeValues() = 0;
50 
52  const std::vector<Point> _query_points;
54  mfem::ParMesh & _mesh;
56  mfem::FindPointsGSLIB _finder;
58  mfem::Ordering::Type _points_ordering;
60  mfem::Vector _points;
62  std::vector<std::reference_wrapper<VectorPostprocessorValue>> _declared_points;
63 };
64 
65 #endif // MOOSE_MFEM_ENABLED
mfem::Ordering::Type _points_ordering
Ordering used to store the point coordinates in the MFEM vector.
virtual void finalizeValues()=0
Copies interpolated values into the subclass VPP vectors.
MFEMSamplerBase(const InputParameters &parameters, const std::vector< Point > &points, mfem::ParMesh &mesh)
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void finalize() override
Outputs coordinates then delegates value output to finalizeValues().
void initialSetup() override
Checks that all query points were found.
Abstract base class for sampling MFEM quantities at points.
mfem::ParMesh & _mesh
MFEM mesh on which the sampled quantity is defined.
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_points
Declared VPP output vectors for spatial coordinates ("x_0", "x_1", ...).
mfem::FindPointsGSLIB _finder
GSLIB point finder used to locate and interpolate the query points.
PointLocationCode
Classification returned by GSLIB for a query point&#39;s location.
static InputParameters validParams()
void initialize() override
Perform any pre-execution setup for this object.
mfem::Vector _points
MFEM vector containing the query-point coordinates.
const std::vector< Point > _query_points
Original query points used for point-location diagnostics.
void ErrorVector unsigned int