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

Method initializeLevelData

ibtk/src/lagrangian/LDataManager.cpp:2024–2337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2022} // updateNodeCountData
2023
2024void
2025LDataManager::initializeLevelData(const Pointer<BasePatchHierarchy<NDIM>> hierarchy,
2026 const int level_number,
2027 const double init_data_time,
2028 const bool can_be_refined,
2029 const bool initial_time,
2030 const Pointer<BasePatchLevel<NDIM>> old_level,
2031 const bool allocate_data)
2032{
2033 IBTK_TIMER_START(t_initialize_level_data);
2034
2035#if !defined(NDEBUG)
2036 TBOX_ASSERT(hierarchy);
2037 TBOX_ASSERT((level_number >= 0) && (level_number <= hierarchy->getFinestLevelNumber()));
2038 if (old_level)
2039 {
2040 TBOX_ASSERT(level_number == old_level->getLevelNumber());
2041 }
2042 TBOX_ASSERT(hierarchy->getPatchLevel(level_number));
2043#endif
2044
2045 Pointer<PatchLevel<NDIM>> level = hierarchy->getPatchLevel(level_number);
2046
2047#if !defined(NDEBUG)
2048 // Check for overlapping boxes on this level.
2049 //
2050 // (This is potentially fairly expensive and hence is only done when
2051 // assertion checking is active.)
2052 BoxList<NDIM> boxes(level->getBoxes());
2053
2054 std::vector<bool> patch_overlaps(boxes.getNumberOfItems());
2055 std::vector<bool>::size_type j, k;
2056
2057 for (k = 0; k < patch_overlaps.size(); ++k)
2058 {
2059 patch_overlaps[k] = false;
2060 }
2061 k = 0;
2062 while (!boxes.isEmpty())
2063 {
2064 j = k + 1;
2065 Box<NDIM> tryme = boxes.getFirstItem();
2066 boxes.removeFirstItem();
2067
2068 for (BoxList<NDIM>::Iterator ib(boxes); ib; ib++)
2069 {
2070 if (tryme.intersects(ib()))
2071 {
2072 patch_overlaps[k] = true;
2073 patch_overlaps[j] = true;
2074 }
2075 ++j;
2076 }
2077 ++k;
2078 }
2079
2080 for (k = 0; k < patch_overlaps.size(); ++k)
2081 {

Callers

nothing calls this directly

Calls 15

sumReductionFunction · 0.85
getPatchLevelMethod · 0.80
isEmptyMethod · 0.80
intersectsMethod · 0.80
allocatePatchDataMethod · 0.80
setTimeMethod · 0.80
fillDataMethod · 0.80
deallocatePatchDataMethod · 0.80
getVecMethod · 0.80
cacheLocalIndicesMethod · 0.80
getLagrangianIndexMethod · 0.80
getLocalPETScIndexMethod · 0.80

Tested by

no test coverage detected