ComputeMeanThermalExpansionFunctionEigenstrain computes a temperature derivative of alpha. However, we can easily end up at a non-differentiable point in the thermal expansion function, for example a node of a PiecewiseLinear function, which is guaranteed to be reached if force_step_every_function_point = true in IterationAdaptiveDT.
Currently this predictable gives nan filled tensors that can break the simulation with errors like
*** ERROR ***
In computing the eigenvalues and eigenvectors for the symmetric rank-2 tensor (nan,nan,nan,nan,nan,nan,nan,nan,nan), the PETSC LAPACK syev routine returned error code 2
Design
I suggest adding a fallback branch where finite differencing is used to obtain the temperature derivative.
Reason
ComputeMeanThermalExpansionFunctionEigenstrain
computes a temperature derivative of alpha. However, we can easily end up at a non-differentiable point in the thermal expansion function, for example a node of aPiecewiseLinear
function, which is guaranteed to be reached ifforce_step_every_function_point = true
inIterationAdaptiveDT
. Currently this predictable givesnan
filled tensors that can break the simulation with errors likeDesign
I suggest adding a fallback branch where finite differencing is used to obtain the temperature derivative.
Impact
Improved robustness.