LCOV - code coverage report
Current view: top level - src/actions - PFCRFFKernelAction.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 24 25 96.0 %
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 "PFCRFFKernelAction.h"
      11             : #include "Factory.h"
      12             : #include "FEProblem.h"
      13             : #include "Conversion.h"
      14             : 
      15             : registerMooseAction("PhaseFieldApp", PFCRFFKernelAction, "add_kernel");
      16             : 
      17             : InputParameters
      18          33 : PFCRFFKernelAction::validParams()
      19             : {
      20          33 :   InputParameters params = HHPFCRFFSplitKernelAction::validParams();
      21          66 :   params.addParam<Real>("a", 1.0, "Parameter in the Taylor series expansion");
      22          66 :   params.addParam<Real>("b", 1.0, "Parameter in the Taylor series expansion");
      23          66 :   params.addParam<Real>("c", 1.0, "Parameter in the Taylor series expansion");
      24          33 :   return params;
      25           0 : }
      26             : 
      27          33 : PFCRFFKernelAction::PFCRFFKernelAction(const InputParameters & params)
      28          33 :   : HHPFCRFFSplitKernelAction(params)
      29             : {
      30          33 : }
      31             : 
      32             : void
      33          33 : PFCRFFKernelAction::act()
      34             : {
      35             :   // Create the two kernels required for the n_variable, starting with the time derivative
      36          33 :   InputParameters poly_params = _factory.getValidParams("TimeDerivative");
      37          66 :   poly_params.set<NonlinearVariableName>("variable") = _n_name;
      38          66 :   poly_params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
      39          66 :   _problem->addKernel("TimeDerivative", "IE_n", poly_params);
      40             : 
      41             :   // First, we have to create the vector containing the names of the real L variables
      42          33 :   std::vector<VariableName> real_v(_num_L);
      43         198 :   for (unsigned int l = 0; l < _num_L; ++l)
      44         495 :     real_v[l] = _L_name_base + Moose::stringify(l) + "_real";
      45             : 
      46             :   // CHPFCRFF kernel
      47          66 :   poly_params = _factory.getValidParams("CHPFCRFF");
      48          66 :   poly_params.set<NonlinearVariableName>("variable") = _n_name;
      49          66 :   poly_params.set<std::vector<VariableName>>("v") = real_v;
      50          33 :   poly_params.applyParameters(parameters());
      51          66 :   _problem->addKernel("CHPFCRFF", "CH_bulk_n", poly_params);
      52             : 
      53             :   // Loop over the L_variables
      54          33 :   HHPFCRFFSplitKernelAction::act();
      55          33 : }

Generated by: LCOV version 1.14