#include <SpatialGridPlotFile.hpp>
Public Member Functions | |
SpatialGridPlotFile (const SimulationItem *item, string filename) | |
void | writeCircle (double radius) |
void | writeCircle (double radius, double z) |
void | writeCube (double x1, double y1, double z1, double x2, double y2, double z2) |
void | writeLine (double beg1, double beg2, double end1, double end2) |
void | writeLine (double x1, double y1, double z1, double x2, double y2, double z2) |
void | writeMeridionalHalfCircle (double radius, double phi) |
void | writePolyhedron (const vector< double > &coords, const vector< int > &indices) |
void | writeRectangle (double min1, double min2, double max1, double max2) |
Additional Inherited Members | |
![]() | |
TextOutFile (const SimulationItem *item, string filename, string description) | |
~TextOutFile () | |
void | addColumn (string quantityDescription, string unitDescription=string(), char format='e', int precision=9) |
void | close () |
void | writeLine (string line) |
template<typename... Values, typename = std::enable_if_t<CompileTimeUtils::isNumericArgList<Values...>()>> | |
void | writeRow (Values... values) |
void | writeRow (vector< double > values) |
![]() | |
std::ofstream | _out |
Units * | _units |
This class inherits from the TextOutFile class and is specifically used to write geometric information about a spatial grid to a data file in a text format that can be easily plotted. There are two format variations for 2D and 3D information, respectively. The 2D format describes the intersection of a spatial grid with one of the coordinate planes. The 3D format fully describes all or part of the spatial cells in the grid. Each line in the file contains two (2D) or three (3D) coordinates seperated by whitespace, or is empty. Consecutive nonempty lines represent a sequence of "lineto" commands; an empty line marks a "moveto" command.
SpatialGridPlotFile::SpatialGridPlotFile | ( | const SimulationItem * | item, |
string | filename | ||
) |
The constructor creates the output file with the specified name and sets the appropriate precision for the numerical values in the text file.
void SpatialGridPlotFile::writeCircle | ( | double | radius | ) |
This function outputs a number of 2D line segments describing a circle with the specified radius, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writeCircle | ( | double | radius, |
double | z | ||
) |
This function outputs a number of 3D line segments describing a circle with the specified radius at the specified height, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writeCube | ( | double | x1, |
double | y1, | ||
double | z1, | ||
double | x2, | ||
double | y2, | ||
double | z2 | ||
) |
This function outputs 3D line segments describing the specified cuboid, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writeLine | ( | double | beg1, |
double | beg2, | ||
double | end1, | ||
double | end2 | ||
) |
This function outputs the specified 2D line segment, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writeLine | ( | double | x1, |
double | y1, | ||
double | z1, | ||
double | x2, | ||
double | y2, | ||
double | z2 | ||
) |
This function outputs the specified 3D line segment, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writeMeridionalHalfCircle | ( | double | radius, |
double | phi | ||
) |
This function outputs a number of 3D line segments describing half a circle with the specified radius in the meridional plane with the specified angle, using the Units object specified in the constructor to convert the coordinates to output units.
void SpatialGridPlotFile::writePolyhedron | ( | const vector< double > & | coords, |
const vector< int > & | indices | ||
) |
This function outputs 3D line segments describing the specified polyhedron, using the Units object specified in the constructor to convert the coordinates to output units. Assuming the polyhedron has
The second vector contains the vertex indices for all polyhedron faces. Each vertex index is a number in the range
void SpatialGridPlotFile::writeRectangle | ( | double | min1, |
double | min2, | ||
double | max1, | ||
double | max2 | ||
) |
This function outputs the 2D line segments describing the specified rectangle, using the Units object specified in the constructor to convert the coordinates to output units.