Flow123d  3.9.0-9663d1cde
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ObservePoint Class Reference

#include <observe.hh>

Collaboration diagram for ObservePoint:
Collaboration graph
[legend]

Public Member Functions

 DECLARE_INPUT_EXCEPTION (ExcNoInitialPoint,<< "Failed to find the element containing the initial observe point.\n")
 
 TYPEDEF_ERR_INFO (EI_RegionName, std::string)
 
 TYPEDEF_ERR_INFO (EI_PointName, std::string)
 
 TYPEDEF_ERR_INFO (EI_Point, arma::vec3)
 
 TYPEDEF_ERR_INFO (EI_ClosestEle, ObservePointData)
 
 DECLARE_INPUT_EXCEPTION (ExcNoObserveElementCandidates,<< "Failed to find any element in the search radius of the observe point "<< EI_PointName::qval<< " with given coordinates "<< field_value_to_yaml(EI_Point::ref(*this))<< ".\n"<< "The closest element has index "<< EI_ClosestEle::ref(*this).element_idx_<< ", its distance is "<< EI_ClosestEle::ref(*this).distance_<< ".\n"<< "Solution: check the position of the observe point, possibly increase the maximal snapping distance "<< "(keys: observe_points:search_radius, mesh:global_snap_radius)"<< "\n")
 
 DECLARE_INPUT_EXCEPTION (ExcNoObserveElement,<< "Failed to find any element in the search radius of the observe point"<< EI_PointName::qval<< " inside the snap region: "<< EI_RegionName::qval<< ".\n"<< "The observe point coordinates are "<< field_value_to_yaml(EI_Point::ref(*this))<< ".\n"<< "The closest element (outside the snap region) has index "<< EI_ClosestEle::ref(*this).element_idx_<< ", its distance is "<< EI_ClosestEle::ref(*this).distance_<< ".\n"<< "Solution: check the position/region of the observe point, possibly increase the maximal snapping distance "<< "(keys: observe_points:search_radius, mesh:global_snap_radius)"<< "\n")
 
unsigned int element_idx () const
 
arma::vec3 global_coords () const
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 

Protected Member Functions

 ObservePoint ()
 
 ObservePoint (Input::Record in_rec, Mesh &mesh, unsigned int point_idx)
 
bool have_observe_element ()
 
void snap (Mesh &mesh)
 
void find_observe_point (Mesh &mesh)
 
void output (ostream &out, unsigned int indent_spaces, unsigned int precision)
 
ObservePointData point_projection (unsigned int i_elm, ElementAccessor< 3 > elm)
 Project point to given element by dimension of this element. More...
 

Protected Attributes

Input::Record in_rec_
 Index in the input array. More...
 
std::string name_
 Observation point name. More...
 
unsigned int snap_dim_
 
string snap_region_name_
 
double max_search_radius_
 
arma::vec3 input_point_
 Input coordinates of the initial position of the observation point. More...
 
ObservePointData observe_data_
 Helper object stored projection data. More...
 

Friends

class Observe
 Only Observe should use this class directly. More...
 

Detailed Description

Class representing single observe point, used internally by the class Observe. Members: input_pos_, snap_dim_, snap_region_name_ are set in constructor. Should be checked before passed in. Members: element_idx_, global_coords_, local_coords_ are derived, set in Observe::find_observe_points.

Definition at line 75 of file observe.hh.

Constructor & Destructor Documentation

◆ ObservePoint() [1/2]

ObservePoint::ObservePoint ( )
protected

Default constructor just for testing.

Definition at line 138 of file observe.cc.

◆ ObservePoint() [2/2]

ObservePoint::ObservePoint ( Input::Record  in_rec,
Mesh mesh,
unsigned int  point_idx 
)
protected

Constructor. Read from input.

Definition at line 142 of file observe.cc.

Member Function Documentation

◆ DECLARE_INPUT_EXCEPTION() [1/3]

ObservePoint::DECLARE_INPUT_EXCEPTION ( ExcNoInitialPoint  ,
<< "Failed to find the element containing the initial observe point.\n"   
)

◆ DECLARE_INPUT_EXCEPTION() [2/3]

ObservePoint::DECLARE_INPUT_EXCEPTION ( ExcNoObserveElement  ,
<< "Failed to find any element in the search radius of the observe point"<< EI_PointName::qval<< " inside the snap region: "<< EI_RegionName::qval<< ".\n"<< "The observe point coordinates are "<< field_value_to_yaml(EI_Point::ref(*this))<< ".\n"<< "The closest element (outside the snap region) has index "<< EI_ClosestEle::ref *this.element_idx_<< "  ,
its distance is "<< EI_ClosestEle::ref*this.distance_<< ".\n"<< "Solution:check the position/region of the observe  point,
possibly increase the maximal snapping distance "<< "(keys:observe_points:search_radius, mesh:global_snap_radius)"<< "\n"   
)

◆ DECLARE_INPUT_EXCEPTION() [3/3]

ObservePoint::DECLARE_INPUT_EXCEPTION ( ExcNoObserveElementCandidates  ,
<< "Failed to find any element in the search radius of the observe point "<< EI_PointName::qval<< " with given coordinates "<< field_value_to_yaml(EI_Point::ref(*this))<< ".\n"<< "The closest element has index "<< EI_ClosestEle::ref *this.element_idx_<< "  ,
its distance is "<< EI_ClosestEle::ref*this.distance_<< ".\n"<< "Solution:check the position of the observe  point,
possibly increase the maximal snapping distance "<< "(keys:observe_points:search_radius, mesh:global_snap_radius)"<< "\n"   
)

◆ element_idx()

unsigned int ObservePoint::element_idx ( ) const
inline

Return index of observation point in the mesh.

Definition at line 103 of file observe.hh.

◆ find_observe_point()

void ObservePoint::find_observe_point ( Mesh mesh)
protected

Find the observe element and the definitive observe point.

Algorithm:

  1. find element containing the point (initial element)
  2. check initial element for region match possibly set it as (observe element)
  3. add neighbours into processing_list for the next level
  4. while we have no observe element: pass through the processing list of the current level
  5. if element match the region, project and clip the init point, update observe element.
  6. snapping on the observe element

Definition at line 198 of file observe.cc.

Here is the caller graph for this function:

◆ get_input_type()

const Input::Type::Record & ObservePoint::get_input_type ( )
static

Definition at line 107 of file observe.cc.

Here is the caller graph for this function:

◆ global_coords()

arma::vec3 ObservePoint::global_coords ( ) const
inline

Return global coordinates of the observation point.

Definition at line 109 of file observe.hh.

◆ have_observe_element()

bool ObservePoint::have_observe_element ( )
protected

Returns true if we have already found any observe element.

Definition at line 164 of file observe.cc.

Here is the caller graph for this function:

◆ output()

void ObservePoint::output ( ostream &  out,
unsigned int  indent_spaces,
unsigned int  precision 
)
protected

Output the observe point information into a YAML formated stream, indent by given number of spaces + "- ".

Definition at line 292 of file observe.cc.

◆ point_projection()

ObservePointData ObservePoint::point_projection ( unsigned int  i_elm,
ElementAccessor< 3 >  elm 
)
protected

Project point to given element by dimension of this element.

Definition at line 303 of file observe.cc.

Here is the caller graph for this function:

◆ snap()

void ObservePoint::snap ( Mesh mesh)
protected

Snap to the center of closest subelement with dimension snap_dim_. This makes final adjustment of global_coords_ and local_coords_.

Definition at line 170 of file observe.cc.

Here is the caller graph for this function:

◆ TYPEDEF_ERR_INFO() [1/4]

ObservePoint::TYPEDEF_ERR_INFO ( EI_ClosestEle  ,
ObservePointData   
)

◆ TYPEDEF_ERR_INFO() [2/4]

ObservePoint::TYPEDEF_ERR_INFO ( EI_Point  ,
arma::vec3   
)

◆ TYPEDEF_ERR_INFO() [3/4]

ObservePoint::TYPEDEF_ERR_INFO ( EI_PointName  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [4/4]

ObservePoint::TYPEDEF_ERR_INFO ( EI_RegionName  ,
std::string   
)

Friends And Related Function Documentation

◆ Observe

friend class Observe
friend

Only Observe should use this class directly.

Definition at line 187 of file observe.hh.

Member Data Documentation

◆ in_rec_

Input::Record ObservePoint::in_rec_
protected

Index in the input array.

Definition at line 159 of file observe.hh.

◆ input_point_

arma::vec3 ObservePoint::input_point_
protected

Input coordinates of the initial position of the observation point.

Definition at line 181 of file observe.hh.

◆ max_search_radius_

double ObservePoint::max_search_radius_
protected

Maximal distance of observe element from input point.

Definition at line 178 of file observe.hh.

◆ name_

std::string ObservePoint::name_
protected

Observation point name.

Definition at line 162 of file observe.hh.

◆ observe_data_

ObservePointData ObservePoint::observe_data_
protected

Helper object stored projection data.

Definition at line 184 of file observe.hh.

◆ snap_dim_

unsigned int ObservePoint::snap_dim_
protected

Snap to the center of the object of given dimension. Value 4 and greater means no snapping.

Definition at line 168 of file observe.hh.

◆ snap_region_name_

string ObservePoint::snap_region_name_
protected

Region of the snapping element.

Definition at line 173 of file observe.hh.


The documentation for this class was generated from the following files: