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 "MFEMNLDiffusionKernel.h" 13 : #include "MFEMProblem.h" 14 : #include "NLDiffusionIntegrator.h" 15 : 16 : registerMooseObject("MooseApp", MFEMNLDiffusionKernel); 17 : 18 : InputParameters 19 2126 : MFEMNLDiffusionKernel::validParams() 20 : { 21 2126 : InputParameters params = MFEMKernel::validParams(); 22 4252 : params.addClassDescription("Adds the domain integrator to an MFEM problem for the nonlinear form " 23 : "$(k(u) \\vec\\nabla u, \\vec\\nabla v)_\\Omega " 24 : "arising from the weak form of the non-linear operator " 25 : "$- \\vec\\nabla \\cdot (k(u) \\vec\\nabla u)$."); 26 8504 : params.addParam<MFEMScalarCoefficientName>( 27 : "k_coefficient", "1.", "Name of property for nonlinear diffusivity coefficient k(u)."); 28 6378 : params.addParam<MFEMScalarCoefficientName>( 29 : "dk_du_coefficient", 30 : "0.", 31 : "Name of property partial derivative of diffusivity coefficient k(u) with respect to the " 32 : "trial variable u."); 33 2126 : return params; 34 0 : } 35 : 36 14 : MFEMNLDiffusionKernel::MFEMNLDiffusionKernel(const InputParameters & parameters) 37 : : MFEMKernel(parameters), 38 14 : _k_coef(getScalarCoefficient("k_coefficient")), 39 28 : _dk_du_coef(getScalarCoefficient("dk_du_coefficient")), 40 28 : _trial_var(*getMFEMProblem().getGridFunction(getTrialVariableName())) 41 : { 42 14 : } 43 : 44 : mfem::NonlinearFormIntegrator * 45 308 : MFEMNLDiffusionKernel::createNLIntegrator() 46 : { 47 308 : return new Moose::MFEM::NLDiffusionIntegrator(_k_coef, _dk_du_coef, &_trial_var); 48 : } 49 : 50 : #endif