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 48 of file line_visualiser.h.

Constructor & Destructor Documentation

◆ LineVisualiser() [1/3]

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 60 of file line_visualiser.h.

References setup().

◆ LineVisualiser() [2/3]

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 75 of file line_visualiser.h.

References setup_from_file().

◆ LineVisualiser() [3/3]

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 93 of file line_visualiser.h.

References setup_from_file().

Member Function Documentation

◆ get_local_plot_points_coordinates()

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

Definition at line 801 of file line_visualiser.h.

References i, Nplot_points, and Plot_point.

Referenced by update_plot_points_coordinates().

◆ get_output_data()

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 134 of file line_visualiser.h.

References Comm_pt, i, Nplot_points, and Plot_point.

Referenced by output().

◆ 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 107 of file line_visualiser.h.

References get_output_data(), i, and Nplot_points.

◆ setup()

void oomph::LineVisualiser::setup ( Mesh mesh_pt,
const Vector< Vector< double >> &  coord_vec 
)
inlineprivate

◆ setup_from_file()

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 603 of file line_visualiser.h.

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

Referenced by LineVisualiser().

◆ update_plot_points_coordinates()

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 370 of file line_visualiser.h.

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

Member Data Documentation

◆ Comm_pt

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 600 of file line_visualiser.h.

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

◆ Max_search_radius

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 596 of file line_visualiser.h.

Referenced by setup().

◆ Nplot_points

unsigned oomph::LineVisualiser::Nplot_points
private

Number of plot points.

Definition at line 827 of file line_visualiser.h.

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

◆ Plot_point

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 824 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: