https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MFEMVectorFEInnerProductIntegralPostprocessor.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{
23 "Calculates the integral of the inner product of two vector variables within a subdomain.");
24 params.addParam<MFEMScalarCoefficientName>(
25 "coefficient", "1.", "Name of optional scalar coefficient to scale integrand by.");
26 MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
27 params, "primal_variable", "Name of the first vector variable in the inner product.");
28 MFEMExecutedObject::addRequiredDependencyParam<VariableName>(
29 params, "dual_variable", "Name of the second vector variable in the inner product.");
30 return params;
31}
32
34 const InputParameters & parameters)
35 : MFEMPostprocessor(parameters),
37 parameters,
38 getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("primal_variable"))),
39 _primal_var(*getMFEMProblem().getGridFunction(getParam<VariableName>("primal_variable"))),
40 _scaled_dual_var_coef(getScalarCoefficient("coefficient"),
41 getVectorCoefficientByName(getParam<VariableName>("dual_variable"))),
42 _subdomain_integrator(_primal_var.ParFESpace())
43{
45 _subdomain_integrator.AddDomainIntegrator(
46 new mfem::VectorFEDomainLFIntegrator(_scaled_dual_var_coef), getSubdomainMarkers());
47 else
48 _subdomain_integrator.AddDomainIntegrator(
49 new mfem::VectorFEDomainLFIntegrator(_scaled_dual_var_coef));
50}
51
52void
58
64
65#endif
registerMooseObject("MooseApp", MFEMVectorFEInnerProductIntegralPostprocessor)
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
Base class for construction of an object that is restricted to a subset of subdomains of the problem ...
static InputParameters validParams()
bool isSubdomainRestricted()
Returns a bool indicating if the object is restricted to a subset of subdomains.
mfem::Array< int > & getSubdomainMarkers()
Postprocessor for MFEM results.
static InputParameters validParams()
Compute the integral of the innter product between two MFEM vector FE variables, scaled by an optiona...
virtual PostprocessorValue getValue() const override final
Return the last evaluated integral value.