8 #ifndef SRC_IO_OBSERVE_HH_ 9 #define SRC_IO_OBSERVE_HH_ 11 #include <boost/exception/info.hpp> 26 namespace Input {
namespace Type {
class Record; } }
39 : distance_(numeric_limits<double>::infinity()) {};
65 <<
"Failed to find the element containing the initial observe point.\n");
71 <<
"Failed to find any element in the search radius of the observe point " << EI_PointName::qval
73 <<
"The closest element has index " << EI_ClosestEle::ref(*this).element_idx_ <<
", its distance is " << EI_ClosestEle::ref(*this).distance_ <<
".\n" 74 <<
"Solution: check the position of the observe point, possibly increase the maximal snapping distance " 75 <<
"(keys: observe_points:search_radius, mesh:global_snap_radius)"<<
"\n");
77 <<
"Failed to find any element in the search radius of the observe point" << EI_PointName::qval
78 <<
" inside the snap region: " << EI_RegionName::qval <<
".\n" 79 <<
"The observe point coordinates are " <<
field_value_to_yaml(EI_Point::ref(*
this)) <<
".\n" 80 <<
"The closest element (outside the snap region) has index " << EI_ClosestEle::ref(*this).element_idx_
81 <<
", its distance is " << EI_ClosestEle::ref(*this).distance_ <<
".\n" 82 <<
"Solution: check the position/region of the observe point, possibly increase the maximal snapping distance " 83 <<
"(keys: observe_points:search_radius, mesh:global_snap_radius)"<<
"\n");
91 {
return observe_data_.element_idx_; }
97 {
return observe_data_.global_coords_; }
113 bool have_observe_element();
119 void snap(
Mesh &mesh);
134 void find_observe_point(
Mesh &mesh);
140 void output(ostream &out,
unsigned int indent_spaces,
unsigned int precision);
209 {
return observed_element_indices_;}
214 void output_header();
219 void output_time_frame(
double time);
239 template <
typename T>
240 ElementDataCache<T> & prepare_compute_data(std::string field_name,
double field_time,
unsigned int n_rows,
unsigned int n_cols);
274 bool no_fields_warning=
false;
std::vector< ObservePoint > points_
Full information about observe points.
double max_search_radius_
OutputDataFieldMap observe_field_values_
Stored field values.
std::ofstream observe_file_
Output file stream.
arma::vec3 input_point_
Input coordinates of the initial position of the observation point.
const std::vector< ObservePoint > & points() const
ObservePointData()
Constructor.
unsigned int element_idx_
Final element of the observe point. The index in the mesh.
std::string time_unit_str_
String representation of the time unit.
std::string observe_name_
arma::vec local_coords_
Local (barycentric) coordinates on the element.
Input::Record in_rec_
Index in the input array.
unsigned int element_idx() const
arma::vec3 global_coords_
Global coordinates of the observation point.
unsigned int precision_
Precision of float output.
std::string name_
Observation point name.
std::vector< unsigned int > observed_element_indices_
Elements of the o_points.
double observe_values_time_
Common evaluation time of the fields for single time frame.
const std::vector< unsigned int > & observed_elements() const
ObservePointData observe_data_
Helper object stored projection data.
double time_unit_seconds_
Time unit in seconds.
std::map< string, OutputDataPtr > OutputDataFieldMap
std::shared_ptr< ElementDataCacheBase > OutputDataPtr
arma::vec3 global_coords() const