#include <WallVTKWriter.h>
◆ WallVTKWriter() [1/2]
WallVTKWriter::WallVTKWriter |
( |
WallHandler & |
wallHandler | ) |
|
|
inlineexplicit |
Non-default constructor; sets the handler and fileCounter
BaseVTKWriter(WallHandler &handler)
Definition: BaseVTKWriter.h:44
◆ WallVTKWriter() [2/2]
◆ getName()
std::string WallVTKWriter::getName |
( |
| ) |
const |
|
inline |
the name of the class in the restart file
63 {
return "WallVTKWriter"; }
◆ getVTKData()
extracts vtk data from the wallHandler and stores it in a VTKContainer
37 vtk.
points.reserve(capacityTriangleStrips);
48 capacityPoints = vtk.
points.size();
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
WallHandler & handler_
particle handler from which the particles should be written
Definition: BaseVTKWriter.h:72
std::vector< std::vector< double > > triangleStrips
Definition: BaseWall.h:40
std::vector< Vec3D > points
Definition: BaseWall.h:39
References BaseHandler< T >::getSize(), BaseVTKWriter< WallHandler >::handler_, VTKContainer::points, and VTKContainer::triangleStrips.
Referenced by writeVTK().
◆ getWriteWallSurfaceAreaVTK()
bool WallVTKWriter::getWriteWallSurfaceAreaVTK |
( |
| ) |
const |
◆ setWriteWallSurfaceAreaVTK()
void WallVTKWriter::setWriteWallSurfaceAreaVTK |
( |
bool |
writeWallSurfaceAreaVTK | ) |
|
◆ write()
void WallVTKWriter::write |
( |
std::fstream & |
file, |
|
|
std::string |
name, |
|
|
std::function< double(BaseWall *)> |
f |
|
) |
| const |
|
protected |
◆ writeVTK()
void WallVTKWriter::writeVTK |
( |
| ) |
const |
|
overridevirtual |
writes a vtk file
Implements BaseVTKWriter< WallHandler >.
59 file <<
"<Piece NumberOfPoints=\"" << vtk.
points.size()
64 file <<
"</Points>\n";
72 file <<
"<CellData>\n";
74 file <<
"</CellData>\n"
76 <<
"</UnstructuredGrid>\n"
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
std::fstream makeVTKFileWithHeader() const
Definition: BaseVTKWriter.h:80
void writeVTKCells(std::fstream &file, VTKContainer &vtk) const
Definition: WallVTKWriter.cc:101
void getVTKData(VTKContainer &vtk) const
Definition: WallVTKWriter.cc:30
void writeVTKCellData(std::fstream &file, VTKContainer &vtk) const
Definition: WallVTKWriter.cc:136
void writeVTKPoints(std::fstream &file, VTKContainer &vtk) const
Definition: WallVTKWriter.cc:91
Definition: BaseWall.h:38
References getVTKData(), BaseVTKWriter< WallHandler >::makeVTKFileWithHeader(), VTKContainer::points, PROCESSOR_ID, VTKContainer::triangleStrips, writeVTKCellData(), writeVTKCells(), and writeVTKPoints().
Referenced by DPMBase::writeVTKFiles().
◆ writeVTKCellData()
void WallVTKWriter::writeVTKCellData |
( |
std::fstream & |
file, |
|
|
VTKContainer & |
vtk |
|
) |
| const |
|
protected |
writes the cell data to the vtu file (i.e. surface area)
void writeVTKSurfaceArea(std::fstream &file, VTKContainer &vtk) const
Calculates and writes the surface areas of the cells to the vtu file.
Definition: WallVTKWriter.cc:151
References writeVTKSurfaceArea(), and writeWallSurfaceAreaVTK_.
Referenced by writeVTK().
◆ writeVTKCells()
void WallVTKWriter::writeVTKCells |
( |
std::fstream & |
file, |
|
|
VTKContainer & |
vtk |
|
) |
| const |
|
protected |
writes the cell data to the vtu file (i.e. the faces of the mesh displayed in paraview)
103 file <<
" <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">\n";
107 for (
const double&
i : c) file <<
i <<
' ';
110 file <<
" </DataArray>\n";
111 file <<
" <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">\n";
116 file <<
'\t' << count <<
'\n';
118 file <<
" </DataArray>\n";
119 file <<
" <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">\n";
122 if (c.front() == c.back())
133 file <<
" </DataArray>\n";
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
References constants::i, and VTKContainer::triangleStrips.
Referenced by writeVTK().
◆ writeVTKPoints()
void WallVTKWriter::writeVTKPoints |
( |
std::fstream & |
file, |
|
|
VTKContainer & |
vtk |
|
) |
| const |
|
protected |
writes the point data to the vtu file (i.e. the vertices of the mesh displayed in paraview)
93 file <<
" <DataArray type=\"Float32\" Name=\"Position\" NumberOfComponents=\"3\" format=\"ascii\">\n";
96 file <<
'\t' << p <<
'\n';
98 file <<
" </DataArray>\n";
References VTKContainer::points.
Referenced by writeVTK().
◆ writeVTKSurfaceArea()
void WallVTKWriter::writeVTKSurfaceArea |
( |
std::fstream & |
file, |
|
|
VTKContainer & |
vtk |
|
) |
| const |
|
protected |
Calculates and writes the surface areas of the cells to the vtu file.
The calculation is based on the rendered VTKContainer and it takes time. This functionality is diasabled by default and can be enabled using WallHandler::setWriteWallSurfaceAreaVTK().
- Parameters
-
[in] | file | Output filestream |
[in] | vtk | Rendered VTKContainer |
- Todo:
- gmb This only needs to be calculated if the mesh changes.
- Todo:
- gmb Check if it always true.
152 file <<
" <DataArray type=\"Float32\" Name=\"SurfaceArea\" format=\"ascii\">\n";
158 for(
size_t i = 1;
i < strip.size() - 1;
i++){
159 size_t i1 =
static_cast<size_t>(strip.at(
i-1));
160 size_t i2 =
static_cast<size_t>(strip.at(
i));
161 size_t i3 =
static_cast<size_t>(strip.at(
i+1));
167 if(strip.front() == strip.back() &&
i == strip.size() - 2){
179 area += triangleArea;
181 file <<
'\t' << area <<
'\n';
184 file <<
" </DataArray>\n";
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
References Vec3D::cross(), Vec3D::getLength(), constants::i, VTKContainer::points, and VTKContainer::triangleStrips.
Referenced by writeVTKCellData().
◆ writeWallSurfaceAreaVTK_
bool WallVTKWriter::writeWallSurfaceAreaVTK_ { false } |
|
protected |
The documentation for this class was generated from the following files: