LCOV - code coverage report
Current view: top level - src/kernels - CHMath.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #32971 (54bef8) with base c6cf66 Lines: 13 15 86.7 %
Date: 2026-05-29 20:38:39 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         140 : CHMath::validParams()
      16             : {
      17         140 :   InputParameters params = CHBulk<Real>::validParams();
      18         140 :   params.addClassDescription(
      19             :       "Simple demonstration Cahn-Hilliard Kernel using an algebraic double-well potential");
      20         140 :   return params;
      21           0 : }
      22             : 
      23          75 : CHMath::CHMath(const InputParameters & parameters) : CHBulk<Real>(parameters) {}
      24             : 
      25             : RealGradient // Use This an example of the the function should look like
      26    84921168 : CHMath::computeGradDFDCons(PFFunctionType type)
      27             : {
      28    84921168 :   switch (type)
      29             :   {
      30    44064336 :     case Residual:
      31    44064336 :       return 3 * _u[_qp] * _u[_qp] * _grad_u[_qp] - _grad_u[_qp]; // return Residual value
      32             : 
      33    40856832 :     case Jacobian:
      34    40856832 :       return 6 * _u[_qp] * _phi[_j][_qp] * _grad_u[_qp] +
      35    40856832 :              3 * _u[_qp] * _u[_qp] * _grad_phi[_j][_qp] -
      36    40856832 :              _grad_phi[_j][_qp]; // return Jacobian value
      37             :   }
      38             : 
      39           0 :   mooseError("Invalid type passed in");
      40             : }

Generated by: LCOV version 1.14