LCOV - code coverage report
Current view: top level - src/kernels - LevelSetGradientRegularizationReinitialization.C (source / functions) Hit Total Coverage
Test: idaholab/malamute: 0e4c8a Lines: 15 16 93.8 %
Date: 2025-08-02 07:01:39 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************************/
       2             : /*                        DO NOT MODIFY THIS HEADER                         */
       3             : /*                                                                          */
       4             : /* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
       5             : /*                                                                          */
       6             : /*           Copyright 2021 - 2024, Battelle Energy Alliance, LLC           */
       7             : /*                           ALL RIGHTS RESERVED                            */
       8             : /****************************************************************************/
       9             : 
      10             : #include "LevelSetGradientRegularizationReinitialization.h"
      11             : 
      12             : registerMooseObject("MalamuteApp", LevelSetGradientRegularizationReinitialization);
      13             : 
      14             : InputParameters
      15           6 : LevelSetGradientRegularizationReinitialization::validParams()
      16             : {
      17           6 :   InputParameters params = ADKernelGrad::validParams();
      18           6 :   params.addClassDescription("The re-initialization equation that uses regularized gradient.");
      19          12 :   params.addRequiredCoupledVar("level_set_gradient",
      20             :                                "Regularized gradient of the level set variable");
      21          12 :   params.addRequiredParam<Real>(
      22             :       "epsilon", "The epsilon coefficient to be used in the reinitialization calculation.");
      23           6 :   return params;
      24           0 : }
      25             : 
      26           3 : LevelSetGradientRegularizationReinitialization::LevelSetGradientRegularizationReinitialization(
      27           3 :     const InputParameters & parameters)
      28             :   : ADKernelGrad(parameters),
      29           3 :     _grad_c(coupledVectorValue("level_set_gradient")),
      30           9 :     _epsilon(getParam<Real>("epsilon"))
      31             : {
      32           3 : }
      33             : 
      34             : ADRealVectorValue
      35     1220000 : LevelSetGradientRegularizationReinitialization::precomputeQpResidual()
      36             : {
      37     1220000 :   Real s = (_grad_c[_qp] + RealVectorValue(libMesh::TOLERANCE)).norm();
      38             :   RealVectorValue n_hat = _grad_c[_qp] / s;
      39     2440000 :   ADRealVectorValue f = _u[_qp] * (1 - _u[_qp]) * n_hat;
      40             : 
      41     2440000 :   return (-f + _epsilon * _grad_u[_qp]);
      42             : }

Generated by: LCOV version 1.14