LCOV - code coverage report
Current view: top level - src/materials - MathEBFreeEnergy.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 11 12 91.7 %
Date: 2025-09-04 07:55:36 Functions: 2 2 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 "MathEBFreeEnergy.h"
      11             : 
      12             : registerMooseObject("PhaseFieldApp", MathEBFreeEnergy);
      13             : 
      14             : InputParameters
      15         328 : MathEBFreeEnergy::validParams()
      16             : {
      17         328 :   InputParameters params = DerivativeParsedMaterialHelper::validParams();
      18         328 :   params.addClassDescription("Material that implements the math free energy using the expression "
      19             :                              "builder and automatic differentiation");
      20         656 :   params.addRequiredCoupledVar("c", "Concentration variable");
      21         328 :   return params;
      22           0 : }
      23             : 
      24         252 : MathEBFreeEnergy::MathEBFreeEnergy(const InputParameters & parameters)
      25         504 :   : DerivativeParsedMaterialHelper(parameters), _c("c")
      26             : {
      27         252 :   EBFunction free_energy;
      28             :   // Definition of the free energy for the expression builder
      29         252 :   free_energy(_c) = 1.0 / 4.0 * (1.0 + _c) * (1.0 + _c) * (1.0 - _c) * (1.0 - _c);
      30             : 
      31             :   // Parse function for automatic differentiation
      32         252 :   functionParse(free_energy);
      33         252 : }

Generated by: LCOV version 1.14