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

Method readInstrumentData

src/IB/IBInstrumentPanel.cpp:916–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

914} // initializeHierarchyDependentData
915
916void
917IBInstrumentPanel::readInstrumentData(const int U_data_idx,
918 const int P_data_idx,
919 const Pointer<PatchHierarchy<NDIM>> hierarchy,
920 LDataManager* const l_data_manager,
921 const int timestep_num,
922 const double data_time)
923{
924 if (d_num_meters == 0) return;
925
926 IBAMR_TIMER_START(t_read_instrument_data);
927
928 const int coarsest_ln = 0;
929 const int finest_ln = hierarchy->getFinestLevelNumber();
930
931 // Ensure we are collecting data at the
932 if (timestep_num != d_instrument_read_timestep_num)
933 {
934 TBOX_ERROR(d_object_name << "::readInstrumentData():\n"
935 << " time step number: " << timestep_num
936 << " is != instrumentation time step number: " << d_instrument_read_timestep_num
937 << std::endl);
938 }
939
940 if (!IBTK::rel_equal_eps(data_time, d_instrument_read_time))
941 {
942 TBOX_ERROR(d_object_name << "::readInstrumentData():\n"
943 << " data read time: " << data_time
944 << " is != instrumentation data read time: " << d_instrument_read_time << std::endl);
945 }
946
947 // Reset the instrument values.
948 std::fill(d_flow_values.begin(), d_flow_values.end(), 0.0);
949 std::fill(d_mean_pres_values.begin(), d_mean_pres_values.end(), 0.0);
950 std::fill(d_point_pres_values.begin(), d_point_pres_values.end(), 0.0);
951 std::vector<double> A(d_num_meters, 0.0);
952
953 // Compute the local contributions to the flux of U through the flow meter,
954 // the average value of P in the flow meter, and the pointwise value of P at
955 // the centroid of the meter.
956 for (int ln = coarsest_ln; ln <= finest_ln; ++ln)
957 {
958 Pointer<PatchLevel<NDIM>> level = hierarchy->getPatchLevel(ln);
959 for (PatchLevel<NDIM>::Iterator p(level); p; p++)
960 {
961 Pointer<Patch<NDIM>> patch = level->getPatch(p());
962 const Box<NDIM>& patch_box = patch->getBox();
963 const hier::Index<NDIM>& patch_lower = patch_box.lower();
964 const hier::Index<NDIM>& patch_upper = patch_box.upper();
965
966 const Pointer<CartesianPatchGeometry<NDIM>> pgeom = patch->getPatchGeometry();
967 const double* const x_lower = pgeom->getXLower();
968 const double* const x_upper = pgeom->getXUpper();
969 const double* const dx = pgeom->getDx();
970
971 Pointer<CellData<NDIM, double>> U_cc_data = patch->getPatchData(U_data_idx);
972 Pointer<SideData<NDIM, double>> U_sc_data = patch->getPatchData(U_data_idx);
973 Pointer<CellData<NDIM, double>> P_cc_data = patch->getPatchData(P_data_idx);

Callers 2

mainFunction · 0.45

Calls 15

rel_equal_epsFunction · 0.85
fillFunction · 0.85
linear_interpFunction · 0.85
sumReductionFunction · 0.85
compute_flow_correctionFunction · 0.85
getPatchLevelMethod · 0.80
getLDataMethod · 0.80
getVecMethod · 0.80
getLMeshMethod · 0.80
getLocalPETScIndexMethod · 0.80
getFinestLevelNumberMethod · 0.45

Tested by

no test coverage detected