https://mooseframework.inl.gov
MFEMSumAux.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 #include "libmesh/ignore_warnings.h"
14 #include "mfem/miniapps/common/pfem_extras.hpp"
15 #include "libmesh/restore_warnings.h"
16 #include "MFEMAuxKernel.h"
17 
18 /*
19  * Class to scale and sum two MFEM variables, and store the result in a third variable.
20  */
21 class MFEMSumAux : public MFEMAuxKernel
22 {
23 public:
25 
27 
28  virtual ~MFEMSumAux() = default;
29 
30  // Computes the auxvariable.
31  virtual void execute() override;
32 
33 protected:
34  // Names of input MFEMVariables to sum.
35  const VariableName & _v1_var_name;
36  const VariableName & _v2_var_name;
37  // Reference to input variable gridfunctions.
38  const mfem::ParGridFunction & _v1_var;
39  const mfem::ParGridFunction & _v2_var;
40  // Scalar factors to multiply the input variables by.
41  const mfem::real_t _lambda1;
42  const mfem::real_t _lambda2;
43 };
44 
45 #endif
const mfem::real_t _lambda2
Definition: MFEMSumAux.h:42
const VariableName & _v2_var_name
Definition: MFEMSumAux.h:36
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MFEMSumAux(const InputParameters &parameters)
Definition: MFEMSumAux.C:33
virtual void execute() override
Execute method.
Definition: MFEMSumAux.C:45
Class to construct an auxiliary solver used to update an auxvariable.
Definition: MFEMAuxKernel.h:20
const mfem::real_t _lambda1
Definition: MFEMSumAux.h:41
const VariableName & _v1_var_name
Definition: MFEMSumAux.h:35
virtual ~MFEMSumAux()=default
const mfem::ParGridFunction & _v1_var
Definition: MFEMSumAux.h:38
static InputParameters validParams()
Definition: MFEMSumAux.C:18
const mfem::ParGridFunction & _v2_var
Definition: MFEMSumAux.h:39