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 21 : PFCRFFKernelAction::validParams() 19 : { 20 21 : InputParameters params = HHPFCRFFSplitKernelAction::validParams(); 21 42 : params.addParam<Real>("a", 1.0, "Parameter in the Taylor series expansion"); 22 42 : params.addParam<Real>("b", 1.0, "Parameter in the Taylor series expansion"); 23 42 : params.addParam<Real>("c", 1.0, "Parameter in the Taylor series expansion"); 24 21 : return params; 25 0 : } 26 : 27 21 : PFCRFFKernelAction::PFCRFFKernelAction(const InputParameters & params) 28 21 : : HHPFCRFFSplitKernelAction(params) 29 : { 30 21 : } 31 : 32 : void 33 21 : PFCRFFKernelAction::act() 34 : { 35 : // Create the two kernels required for the n_variable, starting with the time derivative 36 21 : InputParameters poly_params = _factory.getValidParams("TimeDerivative"); 37 42 : poly_params.set<NonlinearVariableName>("variable") = _n_name; 38 42 : poly_params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh"); 39 42 : _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 21 : std::vector<VariableName> real_v(_num_L); 43 126 : for (unsigned int l = 0; l < _num_L; ++l) 44 315 : real_v[l] = _L_name_base + Moose::stringify(l) + "_real"; 45 : 46 : // CHPFCRFF kernel 47 42 : poly_params = _factory.getValidParams("CHPFCRFF"); 48 42 : poly_params.set<NonlinearVariableName>("variable") = _n_name; 49 42 : poly_params.set<std::vector<VariableName>>("v") = real_v; 50 21 : poly_params.applyParameters(parameters()); 51 42 : _problem->addKernel("CHPFCRFF", "CH_bulk_n", poly_params); 52 : 53 : // Loop over the L_variables 54 21 : HHPFCRFFSplitKernelAction::act(); 55 21 : }