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 "ADKernelSUPG.h" 11 : #include "MathUtils.h" 12 : #include "Assembly.h" 13 : 14 : // libmesh includes 15 : #include "libmesh/threads.h" 16 : 17 : template <typename T> 18 : InputParameters 19 0 : ADKernelSUPGTempl<T>::validParams() 20 : { 21 0 : InputParameters params = ADKernelStabilizedTempl<T>::validParams(); 22 0 : params.addParam<MaterialPropertyName>( 23 : "tau_name", "tau", "The name of the stabilization parameter tau."); 24 0 : params.addCoupledVar("velocity", "The velocity variable."); 25 0 : params.addParam<MaterialPropertyName>("material_velocity", 26 : "A material property describing the velocity"); 27 0 : return params; 28 0 : } 29 : 30 : template <typename T> 31 0 : ADKernelSUPGTempl<T>::ADKernelSUPGTempl(const InputParameters & parameters) 32 : : ADKernelStabilizedTempl<T>(parameters), 33 0 : _tau(this->template getADMaterialProperty<Real>("tau_name")), 34 0 : _velocity( 35 0 : this->isParamValid("velocity") 36 0 : ? this->adCoupledVectorValue("velocity") 37 0 : : this->template getADMaterialProperty<RealVectorValue>("material_velocity").get()) 38 : { 39 0 : } 40 : 41 : template <typename T> 42 : ADRealVectorValue 43 0 : ADKernelSUPGTempl<T>::computeQpStabilization() 44 : { 45 0 : return _velocity[_qp] * _tau[_qp]; 46 : } 47 : 48 : template class ADKernelSUPGTempl<Real>; 49 : template class ADKernelSUPGTempl<RealVectorValue>;