https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MaterialPropertyValueTempl< is_ad > Class Template Reference

#include <MaterialPropertyValue.h>

Inheritance diagram for MaterialPropertyValueTempl< is_ad >:
[legend]

Public Member Functions

 MaterialPropertyValueTempl (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual GenericReal< is_ad > precomputeQpResidual ()
 
virtual Real precomputeQpJacobian ()
 
template<>
Real precomputeQpResidual ()
 
template<>
ADReal precomputeQpResidual ()
 
template<>
Real precomputeQpJacobian ()
 
template<>
Real precomputeQpJacobian ()
 

Protected Attributes

const Real _kernel_sign
 
const GenericMaterialProperty< Real, is_ad > & _prop
 

Detailed Description

template<bool is_ad>
class MaterialPropertyValueTempl< is_ad >

Definition at line 20 of file MaterialPropertyValue.h.

Constructor & Destructor Documentation

◆ MaterialPropertyValueTempl()

template<bool is_ad>
MaterialPropertyValueTempl< is_ad >::MaterialPropertyValueTempl ( const InputParameters parameters)

Definition at line 30 of file MaterialPropertyValue.C.

31  : KernelValueParent<is_ad>(parameters),
32  _kernel_sign(this->template getParam<bool>("positive") ? 1.0 : -1.0),
33  _prop(this->template getGenericMaterialProperty<Real, is_ad>("prop_name"))
34 {
35 }
typename std::conditional< is_ad, ADKernelValue, KernelValue >::type KernelValueParent
const GenericMaterialProperty< Real, is_ad > & _prop

Member Function Documentation

◆ precomputeQpJacobian() [1/3]

template<bool is_ad>
virtual Real MaterialPropertyValueTempl< is_ad >::precomputeQpJacobian ( )
protectedvirtual

◆ precomputeQpJacobian() [2/3]

template<>
Real MaterialPropertyValueTempl< false >::precomputeQpJacobian ( )
protected

Definition at line 53 of file MaterialPropertyValue.C.

54 {
55  return -_kernel_sign * _phi[_j][_qp];
56 }

◆ precomputeQpJacobian() [3/3]

template<>
Real MaterialPropertyValueTempl< true >::precomputeQpJacobian ( )
protected

Definition at line 60 of file MaterialPropertyValue.C.

61 {
62  mooseError("This should never get called");
63 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ precomputeQpResidual() [1/3]

template<bool is_ad>
virtual GenericReal<is_ad> MaterialPropertyValueTempl< is_ad >::precomputeQpResidual ( )
protectedvirtual

◆ precomputeQpResidual() [2/3]

template<>
Real MaterialPropertyValueTempl< false >::precomputeQpResidual ( )
protected

Definition at line 39 of file MaterialPropertyValue.C.

40 {
41  return _kernel_sign * (_prop[_qp] - _u[_qp]);
42 }
const GenericMaterialProperty< Real, is_ad > & _prop

◆ precomputeQpResidual() [3/3]

template<>
ADReal MaterialPropertyValueTempl< true >::precomputeQpResidual ( )
protected

Definition at line 46 of file MaterialPropertyValue.C.

47 {
48  return _kernel_sign * (_prop[_qp] - _u[_qp]);
49 }
const GenericMaterialProperty< Real, is_ad > & _prop

◆ validParams()

template<bool is_ad>
InputParameters MaterialPropertyValueTempl< is_ad >::validParams ( )
static

Definition at line 17 of file MaterialPropertyValue.C.

18 {
20  params.addClassDescription(
21  "Residual term (u - prop) to set variable u equal to a given material property prop");
22  params.addRequiredParam<MaterialPropertyName>(
23  "prop_name", "Name of material property to be used in the kernel");
24  params.addParam<bool>(
25  "positive", true, "If the kernel is positive, this is true, if negative, it is false");
26  return params;
27 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...

Member Data Documentation

◆ _kernel_sign

template<bool is_ad>
const Real MaterialPropertyValueTempl< is_ad >::_kernel_sign
protected

Definition at line 31 of file MaterialPropertyValue.h.

◆ _prop

template<bool is_ad>
const GenericMaterialProperty<Real, is_ad>& MaterialPropertyValueTempl< is_ad >::_prop
protected

Definition at line 32 of file MaterialPropertyValue.h.


The documentation for this class was generated from the following files: