Line data Source code
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: 24 : static InputParameters validParams(); 25 : 26 : MFEMSumAux(const InputParameters & parameters); 27 : 28 50 : 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 std::vector<VariableName> & _var_names; 36 : // Scalar factors to multiply the input variables by. 37 : const std::vector<mfem::real_t> _scale_factors; 38 : /// Pointers to input variable gridfunctions. 39 : std::vector<const mfem::ParGridFunction *> _summed_vars; 40 : }; 41 : 42 : #endif