Public Member Functions | Private Member Functions | Private Attributes | List of all members
oomph::LineVisualiser Class Reference

Class to aid visualisation of the values on a set of points. NOTE: in a distributed problem, output is only done on processor 0. More...

#include <line_visualiser.h>

Public Member Functions

 LineVisualiser (Mesh *mesh_pt, const Vector< Vector< double > > &coord_vec, const double &max_search_radius=DBL_MAX)
 Constructor: Pass pointer to mesh and coordinates of desired plot points: coord_vec[j][i] is the i-th coordinate of the j-th plot point. Optional final parameter specifies the maximum search radius in bin when locating the plot points. Defaults to DBL_MAX and will therefore keep searching through the entire bin structure if a point cannot be found. It's worth limiting this to the order of the size of a typical element in the mesh in parallel computations with fine meshes, otherwise the setup can take forever. More...
 
 LineVisualiser (Mesh *mesh_pt, const std::string file_name, const double &scale=1.0)
 Constructor reading centerline file. More...
 
 LineVisualiser (Mesh *mesh_pt, const double &max_search_radius, const std::string file_name, const double &scale=1.0)
 Constructor reading centerline file. More...
 
void output (std::ostream &outfile)
 Output function: output each plot point. NOTE: in a distributed problem, output is only done on processor 0. More...
 
void get_output_data (Vector< Vector< double > > &data)
 Output data function: store data associated with each plot point in data array. More...
 
void update_plot_points_coordinates (Vector< Vector< double > > &coord_vec)
 Update plot points coordinates (in preparation of remesh, say). More...
 

Private Member Functions

void setup_from_file (Mesh *mesh_pt, const std::string file_name, const double &scale)
 Helper function to setup from file. More...
 
void setup (Mesh *mesh_pt, const Vector< Vector< double > > &coord_vec)
 Helper function to setup the output structures. More...
 
void get_local_plot_points_coordinates (Vector< Vector< double > > &data)
 

Private Attributes

double Max_search_radius
 Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the point is found or until we've searched every single bin. Overwriting this means we won't search in bins whose closest vertex is at a distance greater than Max_search_radius from the point to be located. More...
 
OomphCommunicatorComm_pt
 Pointer to communicator – allows us to collect data on processor 0 if the mesh is distributed. More...
 
Vector< std::pair
< FiniteElement *, Vector
< double > > > 
Plot_point
 Vector of pairs containing points to finite elements and local coordinates. More...
 
unsigned Nplot_points
 Number of plot points. More...
 

Detailed Description

Class to aid visualisation of the values on a set of points. NOTE: in a distributed problem, output is only done on processor 0.

Definition at line 53 of file line_visualiser.h.

Constructor & Destructor Documentation

oomph::LineVisualiser::LineVisualiser ( Mesh mesh_pt,
const Vector< Vector< double > > &  coord_vec,
const double &  max_search_radius = DBL_MAX 
)
inline

Constructor: Pass pointer to mesh and coordinates of desired plot points: coord_vec[j][i] is the i-th coordinate of the j-th plot point. Optional final parameter specifies the maximum search radius in bin when locating the plot points. Defaults to DBL_MAX and will therefore keep searching through the entire bin structure if a point cannot be found. It's worth limiting this to the order of the size of a typical element in the mesh in parallel computations with fine meshes, otherwise the setup can take forever.

Definition at line 68 of file line_visualiser.h.

References setup().

oomph::LineVisualiser::LineVisualiser ( Mesh mesh_pt,
const std::string  file_name,
const double &  scale = 1.0 
)
inline

Constructor reading centerline file.

  • Open "file_name" and extract 3 first doubles of each line
  • Skip lines which does not begin with a number. Scaling factor allows points defined in input file to be scaled.

Definition at line 82 of file line_visualiser.h.

References setup_from_file().

oomph::LineVisualiser::LineVisualiser ( Mesh mesh_pt,
const double &  max_search_radius,
const std::string  file_name,
const double &  scale = 1.0 
)
inline

Constructor reading centerline file.

  • Open "file_name" and extract 3 first doubles of each line
  • Skip lines which does not begin with a number. Scaling factor allows points defined in input file to be scaled. Second parameter specifies the maximum search radius in bin when locating the plot points. It's worth setting this to the order of the size of a typical element in the mesh in parallel computations with fine meshes, otherwise the setup can take forever.

Definition at line 100 of file line_visualiser.h.

References setup_from_file().

Member Function Documentation

void oomph::LineVisualiser::get_local_plot_points_coordinates ( Vector< Vector< double > > &  data)
inlineprivate

Definition at line 759 of file line_visualiser.h.

References i, Nplot_points, and Plot_point.

Referenced by update_plot_points_coordinates().

void oomph::LineVisualiser::get_output_data ( Vector< Vector< double > > &  data)
inline

Output data function: store data associated with each plot point in data array.

Definition at line 141 of file line_visualiser.h.

References Comm_pt, i, Nplot_points, and Plot_point.

Referenced by output().

void oomph::LineVisualiser::output ( std::ostream &  outfile)
inline

Output function: output each plot point. NOTE: in a distributed problem, output is only done on processor 0.

Definition at line 114 of file line_visualiser.h.

References get_output_data(), i, and Nplot_points.

void oomph::LineVisualiser::setup ( Mesh mesh_pt,
const Vector< Vector< double > > &  coord_vec 
)
inlineprivate
void oomph::LineVisualiser::setup_from_file ( Mesh mesh_pt,
const std::string  file_name,
const double &  scale 
)
inlineprivate

Helper function to setup from file.

Definition at line 555 of file line_visualiser.h.

References i, oomph::oomph_info, setup(), and oomph::Global_string_for_annotation::string().

Referenced by LineVisualiser().

void oomph::LineVisualiser::update_plot_points_coordinates ( Vector< Vector< double > > &  coord_vec)
inline

Update plot points coordinates (in preparation of remesh, say).

Definition at line 351 of file line_visualiser.h.

References Comm_pt, get_local_plot_points_coordinates(), i, Nplot_points, and Plot_point.

Member Data Documentation

OomphCommunicator* oomph::LineVisualiser::Comm_pt
private

Pointer to communicator – allows us to collect data on processor 0 if the mesh is distributed.

Definition at line 552 of file line_visualiser.h.

Referenced by get_output_data(), setup(), and update_plot_points_coordinates().

double oomph::LineVisualiser::Max_search_radius
private

Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the point is found or until we've searched every single bin. Overwriting this means we won't search in bins whose closest vertex is at a distance greater than Max_search_radius from the point to be located.

Definition at line 548 of file line_visualiser.h.

Referenced by setup().

unsigned oomph::LineVisualiser::Nplot_points
private

Number of plot points.

Definition at line 786 of file line_visualiser.h.

Referenced by get_local_plot_points_coordinates(), get_output_data(), output(), setup(), and update_plot_points_coordinates().

Vector<std::pair<FiniteElement*,Vector<double> > > oomph::LineVisualiser::Plot_point
private

Vector of pairs containing points to finite elements and local coordinates.

Definition at line 783 of file line_visualiser.h.

Referenced by get_local_plot_points_coordinates(), get_output_data(), setup(), and update_plot_points_coordinates().


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