https://mooseframework.inl.gov
MFEMValueSamplerBase.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 
16 /*
17  * MFEM Postprocessor which samples values at points.
18  *
19  * Subclasses should override validParams and provide and use the constructor.
20  */
22 {
23 public:
25 
26  MFEMValueSamplerBase(const InputParameters & parameters, const std::vector<Point> & points);
27 
30  virtual void execute() override;
31 
34  virtual void finalize() override;
35 
36 private:
37  const VariableName & _var_name;
38  const mfem::GridFunction & _var;
39  mfem::ParMesh & _mesh;
40 
41  mfem::FindPointsGSLIB _finder;
42  mfem::Ordering::Type _points_ordering;
43  mfem::Vector _points;
44  mfem::Vector _interp_vals;
45 
46  // VectorPostprocessor declared values - the values written to these are output
47  std::vector<std::reference_wrapper<VectorPostprocessorValue>> _declared_points;
48  std::vector<std::reference_wrapper<VectorPostprocessorValue>> _declared_vals;
49 };
50 
51 #endif // MOOSE_MFEM_ENABLED
virtual void execute() override
Perform the interpolation in FindPointsGSLIB.
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...
virtual void finalize() override
Store the result of the interpolation.
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_vals
const mfem::GridFunction & _var
const VariableName & _var_name
mfem::FindPointsGSLIB _finder
mfem::Ordering::Type _points_ordering
static InputParameters validParams()
std::vector< std::reference_wrapper< VectorPostprocessorValue > > _declared_points
MFEMValueSamplerBase(const InputParameters &parameters, const std::vector< Point > &points)