www.mooseframework.org
ComputeThermalExpansionEigenstrainBase.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 "ComputeEigenstrainBase.h"
14 #include "RankTwoTensorForward.h"
15 #include "ChainedReal.h"
16 
18 template <bool is_ad>
19 using ValueAndDerivative = typename std::conditional<is_ad, ADReal, ChainedReal>::type;
20 
25 template <bool is_ad>
27  : public DerivativeMaterialInterface<ComputeEigenstrainBaseTempl<is_ad>>
28 {
29 public:
31 
33 
35  virtual void subdomainSetup() final;
36 
38  virtual void computeProperties() final;
39 
40  virtual void computeQpEigenstrain() override;
41 
42 protected:
57 
63  const std::vector<ValueAndDerivative<is_ad>> & _temperature;
64 
67 
70 
71  // this temperature derivative property is onlycreated and set for is_ad == false
73 
75 
79 
80 private:
85  std::vector<ValueAndDerivative<is_ad>> _temperature_buffer;
86 
89 
92 };
93 
virtual void computeProperties() final
update _temperature_buffer
typename Moose::GenericType< VariableValue, is_ad > GenericVariableValue
MaterialProperty< Real > * _mean_thermal_expansion_coefficient
mean coefficient of thermal expansion (for output verification)
const GenericVariableValue< is_ad > & _temperature_prop
current temperature
ComputeThermalExpansionEigenstrainBaseTempl< true > ADComputeThermalExpansionEigenstrainBase
typename std::conditional< is_ad, ADReal, ChainedReal >::type ValueAndDerivative
Return type with a single derivative.
ComputeThermalExpansionEigenstrainBaseTempl(const InputParameters &parameters)
virtual ValueAndDerivative< is_ad > computeThermalStrain()=0
computeThermalStrain must be overridden in derived classes.
ComputeThermalExpansionEigenstrainBaseTempl< false > ComputeThermalExpansionEigenstrainBase
const VariableValue & _temperature_old
previous time step temperature
ComputeEigenstrainBase is the base class for eigenstrain tensors.
OutputTools< Real >::VariableValue VariableValue
ComputeThermalExpansionEigenstrainBase is a base class for all models that compute eigenstrains due t...
const std::vector< ValueAndDerivative< is_ad > > & _temperature
Temperature to use in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).
std::vector< ValueAndDerivative< is_ad > > _temperature_buffer
Temperature used in the eigenstrain calculation (current value if _use_old_temperature=false, old value if _use_old_temperature=true).
virtual void subdomainSetup() final
resize _temperature_buffer