www.mooseframework.org
DerivativeFunctionMaterialBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
12 #include "FunctionMaterialBase.h"
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 
40 template <bool is_ad = false>
42 {
43 public:
45 
47 
48 protected:
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 
virtual GenericReal< is_ad > computeDF(unsigned int arg)
Override this method for calculating the first derivatives.
Material base class, central to all Materials that provide a Function as a material property value...
virtual GenericReal< is_ad > computeF()
Override this method to provide the free energy function.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual GenericReal< is_ad > computeD3F(unsigned int, unsigned int, unsigned int)
Override this method to calculate the third derivatives.
DerivativeFunctionMaterialBaseTempl(const InputParameters &parameters)
std::vector< std::vector< GenericMaterialProperty< Real, is_ad > * > > _prop_d2F
Material properties to store the second derivatives.
void libmesh_ignore(const Args &...)
virtual GenericReal< is_ad > computeD2F(unsigned int arg1, unsigned int arg2)
Override this method to calculate the second derivatives.
DerivativeFunctionMaterialBaseTempl< true > ADDerivativeFunctionMaterialBase
void initialSetup() override
Check if we got the right number of components in the &#39;coupled_variables&#39; vector. ...
bool _third_derivatives
Calculate (and allocate memory for) the third derivatives of the free energy.
const InputParameters & parameters() const
Get the parameters of the object.
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.
void computeProperties() override
Performs the quadrature point loop, calling computeQpProperties.
typename Moose::GenericType< Real, is_ad > GenericReal
Definition: MooseTypes.h:559
DerivativeFunctionMaterialBaseTempl< false > DerivativeFunctionMaterialBase
std::vector< GenericMaterialProperty< Real, is_ad > * > _prop_dF
Material properties to store the derivatives of f with respect to arg[i].