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 "KokkosCopyValueAux.h" 11 : 12 187985 : registerKokkosAuxKernel("MooseApp", KokkosCopyValueAux); 13 : 14 : InputParameters 15 9448 : KokkosCopyValueAux::validParams() 16 : { 17 9448 : InputParameters params = AuxKernel::validParams(); 18 18896 : params.addClassDescription("Returns the specified variable as an auxiliary variable with a " 19 : "simple copy of the variable values."); 20 37792 : params.addRequiredCoupledVar("source", "Variable to take the value of."); 21 37792 : MooseEnum stateEnum("CURRENT=0 OLD=1 OLDER=2", "CURRENT"); 22 28344 : params.addParam<MooseEnum>( 23 : "state", 24 : stateEnum, 25 : "This parameter specifies the state being copied. CURRENT=0 OLD=1 OLDER=2. Copying an older " 26 : "state allows access to previous solution information if necessary."); 27 18896 : return params; 28 9448 : } 29 : 30 108 : KokkosCopyValueAux::KokkosCopyValueAux(const InputParameters & parameters) 31 : : AuxKernel(parameters), 32 36 : _state(getParam<MooseEnum>("state")), 33 108 : _v(_state == 0 ? kokkosCoupledDofValue("source") 34 18 : : _state == 1 ? kokkosCoupledDofValueOld("source") 35 : : kokkosCoupledDofValueOlder("source")), 36 108 : _source_variable(*getVar("source", 0)) 37 : { 38 48 : if (_var.feType().family != _source_variable.feType().family) 39 0 : paramError("variable", 40 0 : "Source (" + Moose::stringify(_source_variable.feType().family) + ") and target (" + 41 0 : Moose::stringify(_var.feType().family) + 42 : ") variable have different families. You may use a ProjectionAux " 43 : "instead of the CopyValueAux"); 44 48 : if (_var.feType().order != _source_variable.feType().order) 45 0 : paramError("variable", 46 0 : "Source (" + Moose::stringify(_source_variable.feType().order) + ") and target (" + 47 0 : Moose::stringify(_var.feType().order) + 48 : ") variable are of different orders. You may use a ProjectionAux " 49 : "instead of the CopyValueAux"); 50 48 : }