https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMVariableLineValueSampler.C
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
13
14#include "libmesh/point.h"
15#include "MooseError.h"
16#include "MFEMProblem.h"
17
18#include <vector>
19
21
24{
26
27 params.addClassDescription("Sample an MFEM variable along a specified line.");
28
29 // these should not be of type libmesh::Point - need mfem::Point parsing
30 params.addRequiredParam<Point>("start_point", "The beginning of the line");
31 params.addRequiredParam<Point>("end_point", "The ending of the line");
32
33 params.addRequiredRangeCheckedParam<unsigned int>(
34 "num_points", "num_points >= 2", "The number of points to sample along the line");
35
36 return params;
37}
38
41 parameters,
42 // can't call getParam as that requires initialized base class
43 // so calling parameters.get directly
44 Moose::MFEM::generateLinePoints(parameters.get<Point>("start_point"),
45 parameters.get<Point>("end_point"),
46 parameters.get<unsigned int>("num_points")))
47{
48}
49
50#endif // MOOSE_MFEM_ENABLED
registerMooseObject("MooseApp", MFEMVariableLineValueSampler)
void ErrorVector unsigned int
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
These methods add an range checked parameters.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Samples a real-valued MFEM variable at a set of points evenly distributed along a line.
MFEMVariableLineValueSampler(const InputParameters &parameters)
MFEM VectorPostprocessor base class for sampling a real-valued variable at a set of points.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...