MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / save_derivs

Method save_derivs

src/solver/solver.cxx:1269–1297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1267}
1268
1269void 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
1299void Solver::set_id(BoutReal* udata) { loop_vars(udata, SOLVER_VAR_OP::SET_ID); }
1300

Callers

nothing calls this directly

Calls 4

toStringFunction · 0.50
toCovariantMethod · 0.45
toContravariantMethod · 0.45
getLocationMethod · 0.45

Tested by

no test coverage detected