LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use correct primal values in the sensitivity calls

jamiebramwell opened this issue · comments

As written, the sensitivity calculation calls in the HeatTransfer and SolidMechanics modules will not use the correct primal field values (e.g. temperature) during the backward adjoint pass. See

std::array<std::function<decltype((*residual_)(DifferentiateWRT<0>{}, temperature_, temperature_rate_,
shape_displacement_, *parameters_[parameter_indices].state...))()>,
sizeof...(parameter_indices)>
d_residual_d_ = {[&]() {
return (*residual_)(DifferentiateWRT<NUM_STATE_VARS + parameter_indices>{}, temperature_, temperature_rate_,
shape_displacement_, *parameters_[parameter_indices].state...);
}...};
.

We should check that the correct time is used as well. Ideally, we should write tests that fail before patching the bugs.