#include <VTKData.h>
◆ VTKData()
◆ ~VTKData()
◆ addToConnectivity()
void VTKData::addToConnectivity |
( |
const std::vector< size_t > & |
indices | ) |
|
◆ addToPointData()
void VTKData::addToPointData |
( |
const std::string & |
key, |
|
|
Mdouble |
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 |
◆ getPoints()
std::vector< Vec3D > VTKData::getPoints |
( |
| ) |
const |
◆ getTypes()
std::vector< int > VTKData::getTypes |
( |
| ) |
const |
- Returns
- Vector of types
References types_.
◆ makeVTKFileWithHeader()
std::fstream VTKData::makeVTKFileWithHeader |
( |
std::string & |
fileName | ) |
const |
|
private |
124 file.open(fileName.c_str(), std::ios_base::out);
127 logger(
WARN,
"File % could not be opened", fileName);
131 file <<
"<?xml version=\"1.0\"?>\n";
133 file <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
134 file <<
"<UnstructuredGrid>\n";
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
References logger, and WARN.
Referenced by writeVTKData().
◆ reserveCells()
void VTKData::reserveCells |
( |
unsigned int |
n | ) |
|
◆ reservePoints()
void VTKData::reservePoints |
( |
unsigned int |
n, |
|
|
const std::vector< std::string > & |
keys = {} |
|
) |
| |
◆ writeConnectivity()
void VTKData::writeConnectivity |
( |
std::fstream & |
file | ) |
const |
|
private |
183 file <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
188 for (
const int i : vec)
195 file <<
" </DataArray>\n";
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
References connectivity_, and constants::i.
Referenced by writeVTKData().
◆ writeOffsets()
void VTKData::writeOffsets |
( |
std::fstream & |
file | ) |
const |
|
private |
200 file <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
202 unsigned int offset = 0;
205 offset += vec.size();
206 file <<
"\t" << offset <<
"\n";
209 file <<
" </DataArray>\n";
References connectivity_.
Referenced by writeVTKData().
◆ writePointData()
void VTKData::writePointData |
( |
std::fstream & |
file | ) |
const |
|
private |
154 file <<
"<PointData Vectors=\"vector\">\n";
158 const std::string&
name = da.first;
159 const std::vector<Mdouble>& values = da.second;
161 unsigned int numberOfComponents =
points_.size() / values.size();
162 file <<
" <DataArray type=\"Float32\" Name=\"" <<
name <<
"\" NumberOfComponents=\"" << numberOfComponents <<
"\" format=\"ascii\">\n";
165 while (
i < values.size())
168 for (
int j = 0; j < numberOfComponents; j++)
170 file << values[
i++] <<
" ";
175 file <<
" </DataArray>\n";
178 file <<
"</PointData>\n";
std::string name
Definition: MercuryProb.h:48
References constants::i, units::name, pointData_, and points_.
Referenced by writeVTKData().
◆ writePoints()
void VTKData::writePoints |
( |
std::fstream & |
file | ) |
const |
|
private |
140 file <<
"<Points>\n";
141 file <<
" <DataArray type=\"Float32\" Name=\"Position\" NumberOfComponents=\"3\" format=\"ascii\">\n";
145 file <<
"\t" << p <<
"\n";
148 file <<
" </DataArray>\n";
149 file <<
"</Points>\n";
References points_.
Referenced by writeVTKData().
◆ writeTypes()
void VTKData::writeTypes |
( |
std::fstream & |
file | ) |
const |
|
private |
214 file <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
218 file <<
"\t" <<
i <<
"\n";
221 file <<
" </DataArray>\n";
References constants::i, and types_.
Referenced by writeVTKData().
◆ writeVTKData()
void VTKData::writeVTKData |
( |
std::string |
fileName | ) |
const |
◆ writeVTKDataFromVtkContainer()
void VTKData::writeVTKDataFromVtkContainer |
( |
std::string |
fileName, |
|
|
const std::vector< Vec3D > & |
points, |
|
|
const std::vector< std::vector< double >> & |
triangleStrips |
|
) |
| |
107 for (
auto& p : points)
109 for (
auto& c : triangleStrips)
111 std::vector<size_t> cell;
113 cell.push_back(
static_cast<size_t>(cc));
void addToTypes(int type)
Adds a type to the types vector.
Definition: VTKData.cc:43
void writeVTKData(std::string fileName) const
Writes the data to a file with the given file name.
Definition: VTKData.cc:83
void addToPoints(Vec3D point)
Adds a point to the points vector.
Definition: VTKData.cc:28
void addToConnectivity(const std::vector< size_t > &indices)
Adds a vector of indices to the connectivity vector.
Definition: VTKData.cc:38
References addToConnectivity(), addToPoints(), addToTypes(), 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: