LCOV - code coverage report
Current view: top level - src/kernels - CHMath.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 13 15 86.7 %
Date: 2025-09-04 07:55: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             : #include "CHMath.h"
      11             : 
      12             : registerMooseObject("PhaseFieldApp", CHMath);
      13             : 
      14             : InputParameters
      15         188 : CHMath::validParams()
      16             : {
      17         188 :   InputParameters params = CHBulk<Real>::validParams();
      18         188 :   params.addClassDescription(
      19             :       "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
      20         188 :   return params;
      21           0 : }
      22             : 
      23          99 : CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
      24             : 
      25             : RealGradient // Use This an example of the the function should look like
      26   101161168 : CHMath::computeGradDFDCons(PFFunctionType type)
      27             : {
      28   101161168 :   switch (type)
      29             :   {
      30    52493264 :     case Residual:
      31    52493264 :       return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
      32             : 
      33    48667904 :     case Jacobian:
      34    48667904 :       return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
      35    48667904 :              3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
      36    48667904 :              _grad_phi[_j][_qp]; // return Jacobian value
      37             :   }
      38             : 
      39           0 :   mooseError("Invalid type passed in");
      40             : }

Generated by: LCOV version 1.14