LCOV - code coverage report
Current view: top level - src/materials - ADMathFreeEnergy.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 17 18 94.4 %
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 "ADMathFreeEnergy.h"
      11             : 
      12             : registerMooseObject("PhaseFieldApp", ADMathFreeEnergy);
      13             : 
      14             : InputParameters
      15          66 : ADMathFreeEnergy::validParams()
      16             : {
      17          66 :   InputParameters params = Material::validParams();
      18          66 :   params.addClassDescription("Material that implements the math free energy and its derivatives: "
      19             :                              "\n$F = 1/4(1 + c)^2(1 - c)^2$");
      20         132 :   params.addParam<MaterialPropertyName>("f_name", "F", "function property name");
      21         132 :   params.addRequiredCoupledVar("c", "Concentration variable");
      22          66 :   return params;
      23           0 : }
      24             : 
      25          51 : ADMathFreeEnergy::ADMathFreeEnergy(const InputParameters & parameters)
      26             :   : Material(parameters),
      27          51 :     _c(adCoupledValue("c")),
      28          51 :     _f_name(getParam<MaterialPropertyName>("f_name")),
      29          51 :     _prop_F(declareADProperty<Real>(_f_name)),
      30          51 :     _prop_dFdc(
      31         102 :         declareADProperty<Real>(derivativePropertyNameFirst(_f_name, this->coupledName("c", 0))))
      32             : {
      33          51 : }
      34             : 
      35             : void
      36     2410800 : ADMathFreeEnergy::computeQpProperties()
      37             : {
      38    14464800 :   _prop_F[_qp] = 1.0 / 4.0 * (1.0 + _c[_qp]) * (1.0 + _c[_qp]) * (1.0 - _c[_qp]) * (1.0 - _c[_qp]);
      39     7232400 :   _prop_dFdc[_qp] = _c[_qp] * (_c[_qp] * _c[_qp] - 1.0);
      40     2410800 : }

Generated by: LCOV version 1.14