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

Method setDataOnPatchHierarchy

src/IB/IBEulerianSourceFunction.cpp:63–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61} // isTimeDependent
62
63void
64IBHierarchyIntegrator::IBEulerianSourceFunction::setDataOnPatchHierarchy(
65 const int data_idx,
66 SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM>> /*var*/,
67 SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM>> hierarchy,
68 const double data_time,
69 const bool initial_time,
70 const int coarsest_ln_in,
71 const int finest_ln_in)
72{
73 const int coarsest_ln = (coarsest_ln_in == IBTK::invalid_level_number ? 0 : coarsest_ln_in);
74 const int finest_ln =
75 (finest_ln_in == IBTK::invalid_level_number ? hierarchy->getFinestLevelNumber() : finest_ln_in);
76
77 for (int ln = coarsest_ln; ln <= finest_ln; ++ln)
78 {
79 Pointer<PatchLevel<NDIM>> level = hierarchy->getPatchLevel(ln);
80 TBOX_ASSERT(level->checkAllocated(data_idx));
81 }
82
83 HierarchyCellDataOpsReal<NDIM, double> hier_cc_ops(hierarchy, coarsest_ln, finest_ln);
84 hier_cc_ops.setToScalar(data_idx, 0.0, false);
85
86 // At the initial time the structures may not yet be set up, so we cannot
87 // call computeFluidSources()
88 if (initial_time) return;
89
90 d_ib_solver->computeFluidSources(data_idx, data_time);
91
92 return;
93}
94
95void
96IBHierarchyIntegrator::IBEulerianSourceFunction::setDataOnPatch(const int data_idx,

Callers

nothing calls this directly

Calls 3

getPatchLevelMethod · 0.80
computeFluidSourcesMethod · 0.80
getFinestLevelNumberMethod · 0.45

Tested by

no test coverage detected