/* SPDX-FileCopyrightText: Copyright (c) 2021-2023, the adamantine authors. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef EXPERIMENTAL_DATA_UTILS_HH #define EXPERIMENTAL_DATA_UTILS_HH #include #include #include #include namespace adamantine { /** * Structure to encapsulate a point cloud and the values associated to each * point. */ template struct PointsValues { std::vector> points; std::vector values; }; /** * Read the experimental data (IR point cloud) and return a vector of * PointsValues. The size of the vector is equal to the number of frames. */ template std::vector> read_experimental_data_point_cloud( MPI_Comm const &communicator, boost::property_tree::ptree const &experiment_database); /** * Get the pair of vectors that map the DOF indices to the * support points. */ template std::pair, std::vector>> get_dof_to_support_mapping(dealii::DoFHandler const &dof_handler); /** * Get the pair of vectors that map the experimental observation indices to the * dof indices. */ template std::pair, std::vector> get_expt_to_dof_mapping(PointsValues const &points_values, dealii::DoFHandler const &dof_handler); /** * Fill the @p temperature Vector given @p points_values. */ template void set_with_experimental_data( MPI_Comm const &communicator, PointsValues const &points_values, std::pair, std::vector> &expt_to_dof_mapping, dealii::LinearAlgebra::distributed::Vector &temperature, bool verbose_output); /** * Parse the log file that maps experimental frames to their times. * The log file has a headerless CSV format with the frame index (int) as the * first entry per line followed by the timestamp for each camera. For now we * assume that the first frame for each camera is synced so that we can * re-reference the times to a fixed offset from the first frame time. The * function returns a vector containing the frame timings for each camera, i.e. * the first index is the camera index and the second is the frame index. The * frame indices in the output are such that the 'first frame' listed in the * input file is index 0. */ std::vector> read_frame_timestamps(boost::property_tree::ptree const &experiment_database); } // namespace adamantine #endif