LCOV - code coverage report
Current view: top level - src/mfem/kernels - MFEMNLCurlCurlKernel.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: fa5e60 Lines: 16 17 94.1 %
Date: 2026-06-24 08:03:36 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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 "MFEMNLCurlCurlKernel.h"
      13             : #include "MFEMProblem.h"
      14             : #include "NLCurlCurlIntegrator.h"
      15             : 
      16             : registerMooseObject("MooseApp", MFEMNLCurlCurlKernel);
      17             : 
      18             : InputParameters
      19        2110 : MFEMNLCurlCurlKernel::validParams()
      20             : {
      21        2110 :   InputParameters params = MFEMKernel::validParams();
      22        4220 :   params.addClassDescription(
      23             :       "Adds the domain integrator to an MFEM problem for the nonlinear form "
      24             :       "$(k(|\\vec \\nabla \\times \\vec u|) \\vec \\nabla \\times \\vec u, \\vec \\nabla \\times "
      25             :       "\\vec v)_\\Omega$ "
      26             :       "arising from the weak form of the non-linear operator "
      27             :       "$\\vec \\nabla \\times (k(|\\vec \\nabla \\times \\vec u|) \\vec \\nabla \\times \\vec "
      28             :       "u)$.");
      29        8440 :   params.addParam<MFEMScalarCoefficientName>(
      30             :       "k_coefficient",
      31             :       "1.",
      32             :       "Name of the nonlinear coefficient $k(|\\vec\\nabla \\times \\vec u|)$.");
      33        8440 :   params.addParam<MFEMScalarCoefficientName>(
      34             :       "curlu_dk_dcurlu_coefficient",
      35             :       "0.",
      36             :       "Name of the coefficient representing "
      37             :       "$|\\vec \\nabla \\times \\vec u| \\partial k(|\\nabla "
      38             :       "\\times \\vec u|)/\\partial |\\nabla \\times \\vec u|$");
      39        4220 :   params.addParam<mfem::real_t>(
      40             :       "curlu_zero_tol",
      41        4220 :       1e-32,
      42             :       "Tolerance used for normalizing the curl vector when forming the Jacobian.");
      43        2110 :   return params;
      44           0 : }
      45             : 
      46           6 : MFEMNLCurlCurlKernel::MFEMNLCurlCurlKernel(const InputParameters & parameters)
      47             :   : MFEMKernel(parameters),
      48           6 :     _k_coef(getScalarCoefficient("k_coefficient")),
      49          12 :     _curlu_dk_dcurlu_coef(getScalarCoefficient("curlu_dk_dcurlu_coefficient")),
      50           6 :     _curlu_vec_coef(getVectorCoefficientByName(getTrialVariableName() + "_curl")),
      51          18 :     _curlu_zero_tol(getParam<mfem::real_t>("curlu_zero_tol"))
      52             : {
      53           6 : }
      54             : 
      55             : mfem::NonlinearFormIntegrator *
      56          24 : MFEMNLCurlCurlKernel::createNLIntegrator()
      57             : {
      58             :   return new Moose::MFEM::NLCurlCurlIntegrator(
      59          24 :       _k_coef, _curlu_dk_dcurlu_coef, _curlu_vec_coef, _curlu_zero_tol);
      60             : }
      61             : 
      62             : #endif

Generated by: LCOV version 1.14