| 1966 | } // resetLagrangianSourceFunction |
| 1967 | |
| 1968 | void |
| 1969 | IBMethod::updateIBInstrumentationData(const int timestep_num, const double data_time) |
| 1970 | { |
| 1971 | if (!d_instrument_panel->isInstrumented()) return; |
| 1972 | |
| 1973 | const int coarsest_ln = 0; |
| 1974 | const int finest_ln = d_hierarchy->getFinestLevelNumber(); |
| 1975 | |
| 1976 | // Compute the positions of the flow meter nets. |
| 1977 | d_instrument_panel->initializeHierarchyDependentData(d_hierarchy, d_l_data_manager, timestep_num, data_time); |
| 1978 | |
| 1979 | // Compute the flow rates and pressures. |
| 1980 | VariableDatabase<NDIM>* var_db = VariableDatabase<NDIM>::getDatabase(); |
| 1981 | const int u_scratch_idx = |
| 1982 | var_db->mapVariableAndContextToIndex(d_ib_solver->getVelocityVariable(), d_ib_solver->getScratchContext()); |
| 1983 | const int p_scratch_idx = |
| 1984 | var_db->mapVariableAndContextToIndex(d_ib_solver->getPressureVariable(), d_ib_solver->getScratchContext()); |
| 1985 | |
| 1986 | std::vector<bool> deallocate_u_scratch_data(finest_ln + 1, false); |
| 1987 | std::vector<bool> deallocate_p_scratch_data(finest_ln + 1, false); |
| 1988 | for (int ln = coarsest_ln; ln <= finest_ln; ++ln) |
| 1989 | { |
| 1990 | Pointer<PatchLevel<NDIM>> level = d_hierarchy->getPatchLevel(ln); |
| 1991 | if (!level->checkAllocated(u_scratch_idx)) |
| 1992 | { |
| 1993 | deallocate_u_scratch_data[ln] = true; |
| 1994 | level->allocatePatchData(u_scratch_idx, data_time); |
| 1995 | } |
| 1996 | if (!level->checkAllocated(p_scratch_idx)) |
| 1997 | { |
| 1998 | deallocate_p_scratch_data[ln] = true; |
| 1999 | level->allocatePatchData(p_scratch_idx, data_time); |
| 2000 | } |
| 2001 | getGhostfillRefineSchedules(d_ib_solver->getName() + "::INSTRUMENTATION_DATA_FILL")[ln]->fillData(data_time); |
| 2002 | } |
| 2003 | |
| 2004 | d_instrument_panel->readInstrumentData( |
| 2005 | u_scratch_idx, p_scratch_idx, d_hierarchy, d_l_data_manager, timestep_num, data_time); |
| 2006 | |
| 2007 | for (int ln = coarsest_ln; ln <= finest_ln; ++ln) |
| 2008 | { |
| 2009 | Pointer<PatchLevel<NDIM>> level = d_hierarchy->getPatchLevel(ln); |
| 2010 | if (deallocate_u_scratch_data[ln]) level->deallocatePatchData(u_scratch_idx); |
| 2011 | if (deallocate_p_scratch_data[ln]) level->deallocatePatchData(p_scratch_idx); |
| 2012 | } |
| 2013 | return; |
| 2014 | } // updateIBInstrumentationData |
| 2015 | |
| 2016 | void |
| 2017 | IBMethod::getFromInput(Pointer<Database> db, bool is_from_restart) |
nothing calls this directly
no test coverage detected