https://mooseframework.inl.gov
ADConstantMaterial.C
Go to the documentation of this file.
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 "ADConstantMaterial.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", ADConstantMaterial);
13 
16 {
18  params.addParam<Real>("value", 0., "Constant value being assigned into the property");
19  params.addRequiredParam<std::string>("property_name", "The property name to declare");
20  params.addClassDescription("Defines a constant AD material property");
21  return params;
22 }
23 
25  : Material(parameters),
26  _value(getParam<Real>("value")),
27  _property_name(getParam<std::string>("property_name")),
28  _property(declareADProperty<Real>(_property_name))
29 {
30 }
31 
32 void
34 {
35  _property[_qp] = _value;
36 }
ADConstantMaterial(const InputParameters &parameters)
registerMooseObject("ThermalHydraulicsApp", ADConstantMaterial)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Constant material with zero-valued derivatives.
void addRequiredParam(const std::string &name, const std::string &doc_string)
ADMaterialProperty< Real > & _property
unsigned int _qp
virtual void computeQpProperties()
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()