https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DerivativeFunctionMaterialBase.h
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#pragma once
11
13
14#define usingDerivativeFunctionMaterialBaseMembers(T) \
15 usingFunctionMaterialBaseMembers(T); \
16 using DerivativeFunctionMaterialBaseTempl<T>::computeF; \
17 using DerivativeFunctionMaterialBaseTempl<T>::computeDF; \
18 using DerivativeFunctionMaterialBaseTempl<T>::computeD2F; \
19 using DerivativeFunctionMaterialBaseTempl<T>::computeD3F; \
20 using DerivativeFunctionMaterialBaseTempl<T>::_third_derivatives; \
21 using DerivativeFunctionMaterialBaseTempl<T>::_prop_dF; \
22 using DerivativeFunctionMaterialBaseTempl<T>::_prop_d2F; \
23 using DerivativeFunctionMaterialBaseTempl<T>::_prop_d3F
24
40template <bool is_ad = false>
42{
43public:
45
47
48protected:
50
51 void computeProperties() override;
52
56 void initialSetup() override;
57
61 virtual GenericReal<is_ad> computeF() { return 0.0; }
62
70 virtual GenericReal<is_ad> computeDF(unsigned int arg)
71 {
72 libmesh_ignore(arg);
73 return 0.0;
74 }
75
84 virtual GenericReal<is_ad> computeD2F(unsigned int arg1, unsigned int arg2)
85 {
86 libmesh_ignore(arg1);
87 libmesh_ignore(arg2);
88 return 0.0;
89 }
90
97 virtual GenericReal<is_ad> computeD3F(unsigned int, unsigned int, unsigned int) { return 0.0; }
98
101
103 std::vector<GenericMaterialProperty<Real, is_ad> *> _prop_dF;
104
106 std::vector<std::vector<GenericMaterialProperty<Real, is_ad> *>> _prop_d2F;
107
109 std::vector<std::vector<std::vector<GenericMaterialProperty<Real, is_ad> *>>> _prop_d3F;
110};
111
DerivativeFunctionMaterialBaseTempl< true > ADDerivativeFunctionMaterialBase
DerivativeFunctionMaterialBaseTempl< false > DerivativeFunctionMaterialBase
Moose::GenericType< Real, is_ad > GenericReal
Definition MooseTypes.h:698
Material base class to compute a function and its derivatives.
std::vector< std::vector< std::vector< GenericMaterialProperty< Real, is_ad > * > > > _prop_d3F
Material properties to store the third derivatives.
virtual GenericReal< is_ad > computeF()
Override this method to provide the free energy function.
static InputParameters validParams()
bool _third_derivatives
Calculate (and allocate memory for) the third derivatives of the free energy.
DerivativeFunctionMaterialBaseTempl(const InputParameters &parameters)
virtual GenericReal< is_ad > computeDF(unsigned int arg)
Override this method for calculating the first derivatives.
std::vector< std::vector< GenericMaterialProperty< Real, is_ad > * > > _prop_d2F
Material properties to store the second derivatives.
void initialSetup() override
Check if we got the right number of components in the 'coupled_variables' vector.
virtual GenericReal< is_ad > computeD2F(unsigned int arg1, unsigned int arg2)
Override this method to calculate the second derivatives.
void computeProperties() override
Performs the quadrature point loop, calling computeQpProperties.
std::vector< GenericMaterialProperty< Real, is_ad > * > _prop_dF
Material properties to store the derivatives of f with respect to arg[i].
virtual GenericReal< is_ad > computeD3F(unsigned int, unsigned int, unsigned int)
Override this method to calculate the third derivatives.
Material base class, central to all Materials that provide a Function as a material property value.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131