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 : #include "MFEMMixedBilinearFormKernel.h" 13 : 14 : InputParameters 15 25926 : MFEMMixedBilinearFormKernel::validParams() 16 : { 17 25926 : InputParameters params = MFEMKernel::validParams(); 18 25926 : params.addClassDescription( 19 : "Base class for mixed bilinear form kernels, allowing different trial and test variables."); 20 25926 : params.addParam<VariableName>( 21 : "trial_variable", 22 : "The trial variable this kernel is acting on and which will be solved for. If empty " 23 : "(default), it will be the same as the test variable."); 24 77778 : params.addParam<bool>( 25 51852 : "transpose", false, "If true, adds the transpose of the integrator to the system instead."); 26 25926 : return params; 27 0 : } 28 : 29 18 : MFEMMixedBilinearFormKernel::MFEMMixedBilinearFormKernel(const InputParameters & parameters) 30 : : MFEMKernel(parameters), 31 18 : _trial_var_name(isParamValid("trial_variable") ? getParam<VariableName>("trial_variable") 32 : : _test_var_name), 33 36 : _transpose(getParam<bool>("transpose")) 34 : { 35 18 : } 36 : 37 : const VariableName & 38 33 : MFEMMixedBilinearFormKernel::getTrialVariableName() const 39 : { 40 33 : return _trial_var_name; 41 : } 42 : 43 : mfem::BilinearFormIntegrator * 44 18 : MFEMMixedBilinearFormKernel::createBFIntegrator() 45 : { 46 18 : return _transpose ? new mfem::TransposeIntegrator(createMBFIntegrator()) : createMBFIntegrator(); 47 : } 48 : #endif