LCOV - code coverage report
Current view: top level - src/kernels - KKSACBulkBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #32971 (54bef8) with base c6cf66 Lines: 25 26 96.2 %
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 "KKSACBulkBase.h"
      11             : 
      12             : InputParameters
      13         263 : KKSACBulkBase::validParams()
      14             : {
      15         263 :   InputParameters params = ACBulk<Real>::validParams();
      16         263 :   params.addClassDescription("KKS model kernel for the Bulk Allen-Cahn. This operates on the order "
      17             :                              "parameter 'eta' as the non-linear variable");
      18         526 :   params.addRequiredParam<MaterialPropertyName>(
      19             :       "fa_name",
      20             :       "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
      21         526 :   params.addParam<MaterialPropertyName>(
      22             :       "h_name", "h", "Base name for the switching function h(eta)");
      23         263 :   return params;
      24           0 : }
      25             : 
      26         141 : KKSACBulkBase::KKSACBulkBase(const InputParameters & parameters)
      27             :   : ACBulk<Real>(parameters),
      28             :     // number of coupled variables (ca, args_a[])
      29         141 :     _eta_name(_var.name()),
      30         282 :     _prop_Fa(getMaterialProperty<Real>("fa_name")),
      31         141 :     _prop_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
      32         141 :     _prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
      33         282 :     _prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
      34             : {
      35             :   // reserve space for derivatives
      36         141 :   _derivatives_Fa.resize(_n_args);
      37         141 :   _derivatives_Fb.resize(_n_args);
      38         141 :   _grad_args.resize(_n_args);
      39             : 
      40             :   // Iterate over all coupled variables
      41         451 :   for (unsigned int i = 0; i < _n_args; ++i)
      42             :   {
      43             :     // get the first derivatives of Fa and Fb material property
      44         310 :     _derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", i);
      45         310 :     _derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", i);
      46             : 
      47             :     // get the gradient
      48         310 :     _grad_args[i] = &(_coupled_standard_moose_vars[i]->gradSln());
      49             :   }
      50         141 : }
      51             : 
      52             : void
      53          92 : KKSACBulkBase::initialSetup()
      54             : {
      55          92 :   ACBulk<Real>::initialSetup();
      56         276 :   validateNonlinearCoupling<Real>("fa_name");
      57         184 :   validateNonlinearCoupling<Real>("fb_name");
      58          92 : }

Generated by: LCOV version 1.14