https://mooseframework.inl.gov
MFEMDivAux.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 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 set an L2 auxvariable to be the divergence of an H(div) vector variable.
20 */
21 class MFEMDivAux : public MFEMAuxKernel
22 {
23 public:
25 
27 
28  virtual ~MFEMDivAux() = default;
29 
30  // Computes the auxvariable.
31  virtual void execute() override;
32 
33 protected:
34  // Name of source MFEMVariable to take the divergence of.
35  const VariableName _source_var_name;
36  // Reference to source gridfunction.
37  const mfem::ParGridFunction & _source_var;
38  // Scalar factor to multiply the result by.
39  const mfem::real_t _scale_factor;
40  // Divergence operator
41  mfem::common::ParDiscreteDivOperator _div;
42 };
43 
44 #endif
static InputParameters validParams()
Definition: MFEMDivAux.C:21
mfem::common::ParDiscreteDivOperator _div
Definition: MFEMDivAux.h:41
MFEMDivAux(const InputParameters &parameters)
Definition: MFEMDivAux.C:33
virtual void execute() override
Execute method.
Definition: MFEMDivAux.C:46
const VariableName _source_var_name
Definition: MFEMDivAux.h:35
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const mfem::real_t _scale_factor
Definition: MFEMDivAux.h:39
virtual ~MFEMDivAux()=default
const mfem::ParGridFunction & _source_var
Definition: MFEMDivAux.h:37
const InputParameters & parameters() const
Get the parameters of the object.