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

Method computeFluidSources

src/IB/IBHierarchyIntegrator.cpp:499–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497/////////////////////////////// PROTECTED ////////////////////////////////////
498
499void
500IBHierarchyIntegrator::computeFluidSources(const int data_idx, const double data_time)
501{
502 bool deallocate = false;
503 for (int ln = 0; ln <= d_hierarchy->getFinestLevelNumber(); ++ln)
504 {
505 Pointer<PatchLevel<NDIM>> level = d_hierarchy->getPatchLevel(ln);
506 if (!level->checkAllocated(d_q_idx))
507 {
508 level->allocatePatchData(d_q_idx, data_time);
509 deallocate = true;
510 }
511 }
512
513 if (d_enable_logging)
514 plog << d_object_name << "::integrateHierarchy(): computing Lagrangian fluid source strength\n";
515 d_ib_method_ops->computeLagrangianFluidSource(data_time);
516 if (d_enable_logging)
517 plog << d_object_name
518 << "::integrateHierarchy(): spreading Lagrangian fluid source "
519 "strength to the Eulerian grid\n";
520
521 d_hier_pressure_data_ops->setToScalar(d_q_idx, 0.0, false);
522 // NOTE: This does not correctly treat the case in which the structure
523 // is close to the physical boundary.
524 d_ib_method_ops->spreadFluidSource(d_q_idx, nullptr, getProlongRefineSchedules(d_object_name + "::q"), data_time);
525 d_hier_cc_data_ops->copyData(data_idx, d_q_idx);
526
527 if (deallocate)
528 {
529 for (int ln = 0; ln <= d_hierarchy->getFinestLevelNumber(); ++ln)
530 {
531 Pointer<PatchLevel<NDIM>> level = d_hierarchy->getPatchLevel(ln);
532 level->deallocatePatchData(d_q_idx);
533 }
534 }
535}
536
537void
538IBHierarchyIntegrator::regridHierarchyBeginSpecialized()

Callers 1

Calls 6

getPatchLevelMethod · 0.80
allocatePatchDataMethod · 0.80
deallocatePatchDataMethod · 0.80
getFinestLevelNumberMethod · 0.45
spreadFluidSourceMethod · 0.45

Tested by

no test coverage detected