MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / postprocessIntegrateHierarchy

Method postprocessIntegrateHierarchy

src/IB/IBExplicitHierarchyIntegrator.cpp:382–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380} // integrateHierarchy
381
382void
383IBExplicitHierarchyIntegrator::postprocessIntegrateHierarchy(const double current_time,
384 const double new_time,
385 const bool skip_synchronize_new_state_data,
386 const int num_cycles)
387{
388 auto ops = HierarchyDataOpsManager<NDIM>::getManager()->getOperationsDouble(d_u_var, d_hierarchy, true);
389
390 auto velocity_ghost_update = [&](const std::vector<int>& indices)
391 {
392 using ITC = IBTK::HierarchyGhostCellInterpolation::InterpolationTransactionComponent;
393 std::vector<ITC> ghostfills;
394 ghostfills.reserve(indices.size());
395 for (const int& idx : indices)
396 {
397 ghostfills.emplace_back(idx,
398 "CONSERVATIVE_LINEAR_REFINE",
399 /*use_cf_bdry_interpolation*/ true,
400 "CONSERVATIVE_COARSEN",
401 "LINEAR",
402 false,
403 d_ins_hier_integrator->getVelocityBoundaryConditions());
404 }
405 HierarchyGhostCellInterpolation ghost_fill_op;
406 ghost_fill_op.initializeOperatorState(ghostfills, d_hierarchy);
407 ghost_fill_op.fillData(current_time);
408 };
409
410 // Update the marker points, should they exist:
411 if (d_markers && !d_marker_velocities_set)
412 {
413 VariableDatabase<NDIM>* var_db = VariableDatabase<NDIM>::getDatabase();
414 const int u_current_idx = var_db->mapVariableAndContextToIndex(d_ins_hier_integrator->getVelocityVariable(),
415 d_ins_hier_integrator->getCurrentContext());
416 // Clear any ghost data outside the domain:
417#ifndef NDEBUG
418 ops->setToScalar(d_u_idx, std::numeric_limits<double>::quiet_NaN(), false);
419#endif
420 ops->copyData(d_u_idx, u_current_idx);
421 velocity_ghost_update({ d_u_idx });
422 d_markers->setVelocities(d_u_idx, d_marker_kernel);
423 d_marker_velocities_set = true;
424 }
425
426 // The last thing we need to do (before we really postprocess) is update the structure velocity:
427 VariableDatabase<NDIM>* var_db = VariableDatabase<NDIM>::getDatabase();
428 const int u_current_idx = var_db->mapVariableAndContextToIndex(d_ins_hier_integrator->getVelocityVariable(),
429 d_ins_hier_integrator->getCurrentContext());
430 const int u_new_idx = var_db->mapVariableAndContextToIndex(d_ins_hier_integrator->getVelocityVariable(),
431 d_ins_hier_integrator->getNewContext());
432 if (!is_bdf_time_stepping_type(d_time_stepping_type))
433 {
434#ifndef NDEBUG
435 ops->setToScalar(d_u_idx, std::numeric_limits<double>::quiet_NaN(), false);
436#endif
437 ops->copyData(d_u_idx, u_new_idx);
438 if (d_enable_logging)
439 plog << d_object_name

Callers

nothing calls this directly

Calls 15

fillDataMethod · 0.80
getCurrentContextMethod · 0.80
setVelocitiesMethod · 0.80
getNewContextMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
getVelocityVariableMethod · 0.45
setPatchDataIndexMethod · 0.45
setHomogeneousBcMethod · 0.45
interpolateVelocityMethod · 0.45

Tested by

no test coverage detected