| 1267 | } |
| 1268 | |
| 1269 | void Solver::save_derivs(BoutReal* dudata) { |
| 1270 | // Make sure vectors in correct basis |
| 1271 | for (const auto& v : v2d) { |
| 1272 | if (v.covariant) { |
| 1273 | v.F_var->toCovariant(); |
| 1274 | } else { |
| 1275 | v.F_var->toContravariant(); |
| 1276 | } |
| 1277 | } |
| 1278 | for (const auto& v : v3d) { |
| 1279 | if (v.covariant) { |
| 1280 | v.F_var->toCovariant(); |
| 1281 | } else { |
| 1282 | v.F_var->toContravariant(); |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | // Make sure 3D fields are at the correct cell location |
| 1287 | for (const auto& f : f3d) { |
| 1288 | if (f.var->getLocation() != (f.F_var)->getLocation()) { |
| 1289 | throw BoutException(_("Time derivative at wrong location - Field is at {:s}, " |
| 1290 | "derivative is at {:s} for field '{:s}'\n"), |
| 1291 | toString(f.var->getLocation()), |
| 1292 | toString(f.F_var->getLocation()), f.name); |
| 1293 | } |
| 1294 | } |
| 1295 | |
| 1296 | loop_vars(dudata, SOLVER_VAR_OP::SAVE_DERIVS); |
| 1297 | } |
| 1298 | |
| 1299 | void Solver::set_id(BoutReal* udata) { loop_vars(udata, SOLVER_VAR_OP::SET_ID); } |
| 1300 |
nothing calls this directly
no test coverage detected