https://mooseframework.inl.gov
MFEMVectorBoundaryFluxIntegralPostprocessor.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 #include "MFEMProblem.h"
14 
16 
19 {
22  params.addClassDescription(
23  "Calculates the integral of the flux of a vector variable across a boundary.");
24  params.addParam<MFEMScalarCoefficientName>(
25  "coefficient", "1.", "Name of optional scalar coefficient to scale integrand by.");
26  params.addRequiredParam<VariableName>("variable", "Name of the vector variable.");
27  return params;
28 }
29 
31  const InputParameters & parameters)
32  : MFEMPostprocessor(parameters),
34  parameters, getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("variable"))),
35  _var(*getMFEMProblem().getGridFunction(getParam<VariableName>("variable"))),
36  _scalar_coef(getScalarCoefficient("coefficient")),
37  _var_coef(&_var),
38  _rt_fec(_var.ParFESpace()->GetMaxElementOrder(), getMesh().Dimension()),
39  _rt_vector_fespace(const_cast<mfem::ParMesh *>(&getMesh()), &_rt_fec),
40  _rt_var(&_rt_vector_fespace),
41  _boundary_integrator(&_rt_vector_fespace)
42 {
43  _rt_var = 0;
44  _boundary_integrator.AddBoundaryIntegrator(
45  new mfem::VectorFEBoundaryFluxLFIntegrator(_scalar_coef), getBoundaryMarkers());
46 }
47 
48 void
50 {
51  _rt_var.ProjectBdrCoefficientNormal(_var_coef, getBoundaryMarkers());
52  _boundary_integrator.Assemble();
54 }
55 
58 {
59  return _integral;
60 }
61 
62 #endif
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
registerMooseObject("MooseApp", MFEMVectorBoundaryFluxIntegralPostprocessor)
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...
Postprocessor for MFEM results.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:230
mfem::Array< int > & getBoundaryMarkers()
virtual PostprocessorValue getValue() const override final
Return the last evaluated integral value.
Base class for construction of an object that is restricted to a subset of boundaries of the problem ...
static InputParameters validParams()
Compute the integral of the flux of an MFEM vector variable across a boundary, scaled by an optional ...
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...