#include <VTKData.h>
◆ VTKData()
◆ ~VTKData()
◆ addToConnectivity()
void VTKData::addToConnectivity |
( |
const std::vector< size_t > & |
indices | ) |
|
Adds a vector of indices to the connectivity vector.
- Parameters
-
indices | Vector of indices to be added |
std::vector< std::vector< size_t > > connectivity_
Definition: Kernel/VTKWriter/VTKData.h:107
References connectivity_.
Referenced by writeVTKDataFromVtkContainer().
◆ addToPointData()
void VTKData::addToPointData |
( |
const std::string & |
key, |
|
|
Mdouble |
value |
|
) |
| |
Adds a value to the pointData values vector corresponding to the given key.
- Parameters
-
key | To which pointData values vector to add |
value | Value to be added |
std::unordered_map< std::string, std::vector< Mdouble > > pointData_
Definition: Kernel/VTKWriter/VTKData.h:102
squared absolute value
Definition: GlobalFunctions.h:87
References pointData_, and Eigen::value.
◆ addToPoints()
void VTKData::addToPoints |
( |
Vec3D |
point | ) |
|
◆ addToTypes()
void VTKData::addToTypes |
( |
int |
type | ) |
|
◆ getConnectivity()
std::vector< std::vector< size_t > > VTKData::getConnectivity |
( |
| ) |
const |
◆ getPointData()
std::unordered_map< std::string, std::vector< Mdouble > > VTKData::getPointData |
( |
| ) |
const |
- Returns
- Map of pointData, each having a key and a vector of values
References pointData_.
◆ getPoints()
std::vector< Vec3D > VTKData::getPoints |
( |
| ) |
const |
- Returns
- Vector of points
References points_.
◆ getTypes()
std::vector< int > VTKData::getTypes |
( |
| ) |
const |
- Returns
- Vector of types
References types_.
◆ makeVTKFileWithHeader()
std::fstream VTKData::makeVTKFileWithHeader |
( |
std::string & |
fileName | ) |
const |
|
private |
110 file <<
"<?xml version=\"1.0\"?>\n";
112 file <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
113 file <<
"<UnstructuredGrid>\n";
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::ofstream out("Result.txt")
References UniformPSDSelfTest::fileName, logger, out(), and WARN.
Referenced by writeVTKData().
◆ reserveCells()
Reserves additional memory for connectivity and types vectors.
- Parameters
-
n | Number of new cells to reserve memory for |
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
References connectivity_, n, and types_.
◆ reservePoints()
void VTKData::reservePoints |
( |
unsigned int |
n, |
|
|
const std::vector< std::string > & |
keys = {} |
|
) |
| |
Reserves additional memory for the points vector and optionally for the values vectors of the pointData.
- Parameters
-
n | Number of new points to reserve memory for |
keys | Keys for pointData values vectors to reserve memory for |
49 unsigned int nt =
points_.size() +
n;
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
References n, pointData_, points_, and oomph::Global_string_for_annotation::string().
◆ writeConnectivity()
void VTKData::writeConnectivity |
( |
std::fstream & |
file | ) |
const |
|
private |
162 file <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
167 for (
const int i : vec)
174 file <<
" </DataArray>\n";
int i
Definition: BiCGSTAB_step_by_step.cpp:9
References connectivity_, and i.
Referenced by writeVTKData().
◆ writeOffsets()
void VTKData::writeOffsets |
( |
std::fstream & |
file | ) |
const |
|
private |
179 file <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
181 unsigned int offset = 0;
184 offset += vec.size();
185 file <<
"\t" << offset <<
"\n";
188 file <<
" </DataArray>\n";
References connectivity_.
Referenced by writeVTKData().
◆ writePointData()
void VTKData::writePointData |
( |
std::fstream & |
file | ) |
const |
|
private |
133 file <<
"<PointData Vectors=\"vector\">\n";
138 const std::vector<Mdouble>& values = da.second;
140 unsigned int numberOfComponents =
points_.size() / values.size();
141 file <<
" <DataArray type=\"Float32\" Name=\"" <<
name <<
"\" NumberOfComponents=\"" << numberOfComponents <<
"\" format=\"ascii\">\n";
144 while (
i < values.size())
147 for (
int j = 0;
j < numberOfComponents;
j++)
149 file << values[
i++] <<
" ";
154 file <<
" </DataArray>\n";
157 file <<
"</PointData>\n";
string name
Definition: plotDoE.py:33
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
References i, j, plotDoE::name, pointData_, points_, and oomph::Global_string_for_annotation::string().
Referenced by writeVTKData().
◆ writePoints()
void VTKData::writePoints |
( |
std::fstream & |
file | ) |
const |
|
private |
119 file <<
"<Points>\n";
120 file <<
" <DataArray type=\"Float32\" Name=\"Position\" NumberOfComponents=\"3\" format=\"ascii\">\n";
124 file <<
"\t" <<
p <<
"\n";
127 file <<
" </DataArray>\n";
128 file <<
"</Points>\n";
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: Kernel/Math/Vector.h:30
References p, and points_.
Referenced by writeVTKData().
◆ writeTypes()
void VTKData::writeTypes |
( |
std::fstream & |
file | ) |
const |
|
private |
193 file <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
197 file <<
"\t" <<
i <<
"\n";
200 file <<
" </DataArray>\n";
References i, and types_.
Referenced by writeVTKData().
◆ writeVTKData()
void VTKData::writeVTKData |
( |
std::string |
fileName | ) |
const |
Writes the data to a file with the given file name.
- Parameters
-
fileName | Full filename, e.g. Example.vtu |
78 file <<
"</UnstructuredGrid>\n";
79 file <<
"</VTKFile>\n";
void writePoints(std::fstream &file) const
Definition: VTKData.cc:117
void writeConnectivity(std::fstream &file) const
Definition: VTKData.cc:160
void writePointData(std::fstream &file) const
Definition: VTKData.cc:131
void writeOffsets(std::fstream &file) const
Definition: VTKData.cc:177
std::fstream makeVTKFileWithHeader(std::string &fileName) const
Definition: VTKData.cc:99
void writeTypes(std::fstream &file) const
Definition: VTKData.cc:191
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189
References connectivity_, UniformPSDSelfTest::fileName, makeVTKFileWithHeader(), points_, oomph::StringConversion::to_string(), writeConnectivity(), writeOffsets(), writePointData(), writePoints(), and writeTypes().
Referenced by WallDetailsVTKWriter::writeVTK(), and writeVTKDataFromVtkContainer().
◆ writeVTKDataFromVtkContainer()
void VTKData::writeVTKDataFromVtkContainer |
( |
std::string |
fileName, |
|
|
const std::vector< Vec3D > & |
points, |
|
|
const std::vector< std::vector< double >> & |
triangleStrips |
|
) |
| |
86 for (
auto&
p : points)
88 for (
auto&
c : triangleStrips)
90 std::vector<size_t> cell;
92 cell.push_back(
static_cast<size_t>(cc));
void addToTypes(int type)
Adds a type to the types vector.
Definition: VTKData.cc:22
void writeVTKData(std::string fileName) const
Writes the data to a file with the given file name.
Definition: VTKData.cc:62
void addToPoints(Vec3D point)
Adds a point to the points vector.
Definition: VTKData.cc:7
void addToConnectivity(const std::vector< size_t > &indices)
Adds a vector of indices to the connectivity vector.
Definition: VTKData.cc:17
int c
Definition: calibrate.py:100
References addToConnectivity(), addToPoints(), addToTypes(), calibrate::c, UniformPSDSelfTest::fileName, p, and writeVTKData().
◆ connectivity_
std::vector<std::vector<size_t> > VTKData::connectivity_ |
|
private |
◆ pointData_
std::unordered_map<std::string, std::vector<Mdouble> > VTKData::pointData_ |
|
private |
◆ points_
std::vector<Vec3D> VTKData::points_ |
|
private |
◆ types_
std::vector<int> VTKData::types_ |
|
private |
The documentation for this class was generated from the following files: