Flow123d
JS_before_hm-2198-g122e1f2e2
|
Go to the documentation of this file.
8 #ifndef SRC_IO_OBSERVE_HH_
9 #define SRC_IO_OBSERVE_HH_
31 namespace Input {
namespace Type {
class Record; } }
78 <<
"Failed to find the element containing the initial observe point.\n");
84 <<
"Failed to find any element in the search radius of the observe point " << EI_PointName::qval
86 <<
"The closest element has index " << EI_ClosestEle::ref(*this).element_idx_ <<
", its distance is " << EI_ClosestEle::ref(*this).distance_ <<
".\n"
87 <<
"Solution: check the position of the observe point, possibly increase the maximal snapping distance "
88 <<
"(keys: observe_points:search_radius, mesh:global_snap_radius)"<<
"\n");
90 <<
"Failed to find any element in the search radius of the observe point" << EI_PointName::qval
91 <<
" inside the snap region: " << EI_RegionName::qval <<
".\n"
92 <<
"The observe point coordinates are " <<
field_value_to_yaml(EI_Point::ref(*
this)) <<
".\n"
93 <<
"The closest element (outside the snap region) has index " << EI_ClosestEle::ref(*this).element_idx_
94 <<
", its distance is " << EI_ClosestEle::ref(*this).distance_ <<
".\n"
95 <<
"Solution: check the position/region of the observe point, possibly increase the maximal snapping distance "
96 <<
"(keys: observe_points:search_radius, mesh:global_snap_radius)"<<
"\n");
153 void output(ostream &out,
unsigned int indent_spaces,
unsigned int precision);
212 unsigned int precision,
const std::shared_ptr<TimeUnitConversion>& time_unit_conv);
264 template <
typename T>
const Distribution * point_ds() const
Template Iter serves as general template for internal iterators.
unsigned int precision_
Precision of float output.
bool operator==(const ObservePointAccessor &other)
Comparison of accessors.
std::map< string, OutputDataPtr > OutputDataFieldMap
ObservePointAccessor()
Default invalid accessor.
LongIdx local_idx_
Local index on actual process of the observe point.
Distribution * point_ds_
Parallel distribution of observe points.
Support classes for parallel programing.
const ObservePoint observe_point() const
Return ElementAccessor to element of loc_ele_idx_.
Range< ObservePointAccessor > local_range() const
Returns local range of observe points.
std::vector< double > observe_values_time_
Common evaluation time of the fields for single time frame.
unsigned int global_idx() const
Return global index to point.
const std::vector< unsigned int > & observed_elements() const
arma::vec3 global_coords() const
Helper class storing unit conversion coefficient and functionality for conversion of units.
bool have_observe_element()
static const Input::Type::Record & get_input_type()
void inc()
Iterates to next local point.
void flush_values()
Effectively writes the data into the observe stream.
Point accessor allow iterate over local Observe points.
TYPEDEF_ERR_INFO(EI_RegionName, std::string)
std::shared_ptr< ElementDataCacheBase > OutputDataPtr
unsigned int proc_
Actual process of the observe point.
void output(ostream &out, unsigned int indent_spaces, unsigned int precision)
DECLARE_INPUT_EXCEPTION(ExcNoInitialPoint,<< "Failed to find the element containing the initial observe point.\n")
Observe(string observe_name, Mesh &mesh, Input::Array in_array, unsigned int precision, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
std::ofstream observe_file_
Output file stream.
unsigned int element_idx() const
unsigned int loc_point_idx_
Index into Observe::point_4_loc_ array.
bool is_valid() const
Check validity of accessor (see default constructor)
void output_time_frame(bool flush)
std::vector< unsigned int > observed_element_indices_
Elements of the o_points.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
const std::vector< ObservePoint > & points() const
~Observe()
Destructor, must close the file.
ObservePointAccessor(const Observe *observe, unsigned int loc_idx)
ElementDataCache< T > & prepare_compute_data(std::string field_name, double field_time, unsigned int n_rows, unsigned int n_cols)
arma::vec local_coords_
Local (barycentric) coordinates on the element.
const Observe * observe_
Pointer to the Observe owning the point.
static const unsigned int max_observe_value_time
Maximal size of observe values times vector.
unsigned int loc_point_time_index() const
Return local index in data cache (combination of local point index and index of stored time)
OutputDataFieldMap observe_field_values_
Stored field values.
unsigned int local_idx() const
Return local index to point.
ObservePointData point_projection(unsigned int i_elm, ElementAccessor< 3 > elm)
Project point to given element by dimension of this element.
ObservePointData observe_data_
Helper object stored projection data.
ObservePointData()
Constructor.
std::vector< LongIdx > point_4_loc_
Index set assigning to local point index its global index.
std::string observe_name_
unsigned int element_idx_
Final element of the observe point. The index in the mesh.
double max_search_radius_
std::shared_ptr< TimeUnitConversion > time_unit_conversion_
Time unit conversion object.
unsigned int observe_time_idx_
Index of actual (last) time in observe_values_time_ vector.
std::vector< ObservePoint > points_
Full information about observe points.
LongIdx global_idx_
Global index of the observe point.
arma::vec3 global_coords_
Global coordinates of the observation point.
Input::Record in_rec_
Index in the input array.
void find_observe_point(Mesh &mesh)
std::string name_
Observation point name.
arma::vec3 input_point_
Input coordinates of the initial position of the observation point.
Implementation of range helper class.