PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
vtkParticleWriter.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#ifndef RW_VTK_PARTICLE_WRITER_H
12#define RW_VTK_PARTICLE_WRITER_H
13
14#include <vtkSmartPointer.h>
15#include <vtkUnstructuredGrid.h>
16#include <vtkXMLUnstructuredGridWriter.h>
17
18// forward declaration
19namespace model {
20class ModelData;
21}
22
23namespace rw {
24
25namespace writer {
26
29
30public:
40 explicit VtkParticleWriter(const std::string &filename, const std::string
41 &compress_type = "");
42
54 const std::vector<std::string> &tags);
55
62 const std::vector<std::string> &tags);
63
72 const std::vector<size_t> *processed_nodes,
73 const std::vector <
74 std::pair<size_t, size_t>> *processed_elems);
75
81
88 void addTimeStep(const double &timestep);
89
93 void close();
94
95private:
97 vtkSmartPointer<vtkXMLUnstructuredGridWriter> d_writer_p;
98
100 vtkSmartPointer<vtkUnstructuredGrid> d_grid_p;
101
103 std::string d_compressType;
104};
105
106} // namespace writer
107
108} // namespace rw
109
110#endif // RW_VTK_PARTICLE_WRITER_H
A class to store model data.
Definition modelData.h:47
A vtk writer for simple point data and complex fem mesh data.
void appendNodes(const model::ModelData *model, const std::vector< std::string > &tags)
Writes the nodes to the file.
vtkSmartPointer< vtkXMLUnstructuredGridWriter > d_writer_p
XML unstructured grid writer.
void appendStrainStress(const model::ModelData *model)
Writes strain/stress.
vtkSmartPointer< vtkUnstructuredGrid > d_grid_p
Unstructured grid.
void appendMesh(const model::ModelData *model, const std::vector< std::string > &tags)
Writes the nodes to the file.
std::string d_compressType
compression_type Specify the compressor (if any)
void addTimeStep(const double &timestep)
Writes the time step to the file.
void appendContactData(const model::ModelData *model, const std::vector< size_t > *processed_nodes, const std::vector< std::pair< size_t, size_t > > *processed_elems)
Prepares contact data that is set of nodes in contact and line-element connecting two contacting node...
void close()
Closes the file and store it to the hard disk.
Collection of methods and database related to reading and writing.