PeriDEM 0.3.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 - 2026 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 data {
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
53 void appendNodes(const data::ModelData *model,
54 const std::vector<std::string> &tags);
55
61 void appendMesh(const data::ModelData *model,
62 const std::vector<std::string> &tags);
63
72 const std::vector<std::string> &tags);
73
81 void appendContactData(const data::ModelData *model,
82 const std::vector<size_t> *processed_nodes,
83 const std::vector <
84 std::pair<size_t, size_t>> *processed_elems);
85
90 void appendStrainStress(const data::ModelData *model);
91
98 void addTimeStep(const double &timestep);
99
103 void close();
104
105private:
107 vtkSmartPointer<vtkXMLUnstructuredGridWriter> d_writer_p;
108
110 vtkSmartPointer<vtkUnstructuredGrid> d_grid_p;
111
113 std::string d_compressType;
114};
115
116} // namespace writer
117
118} // namespace rw
119
120#endif // RW_VTK_PARTICLE_WRITER_H
A class to store model data.
Definition modelData.h:50
A vtk writer for simple point data and complex fem mesh data.
void appendContactData(const data::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 appendStrainStress(const data::ModelData *model)
Writes strain/stress.
void appendNodes(const data::ModelData *model, const std::vector< std::string > &tags)
Writes the nodes to the file.
vtkSmartPointer< vtkXMLUnstructuredGridWriter > d_writer_p
XML unstructured grid writer.
void appendMesh(const data::ModelData *model, const std::vector< std::string > &tags)
Writes the nodes to the file.
vtkSmartPointer< vtkUnstructuredGrid > d_grid_p
Unstructured grid.
std::string d_compressType
compression_type Specify the compressor (if any)
void addTimeStep(const double &timestep)
Writes the time step to the file.
void appendMeshParallelPiece(const data::ModelData *model, const std::vector< std::string > &tags)
Write only this rank's mesh piece for parallel VTU output.
void close()
Closes the file and store it to the hard disk.
Definition contact.h:20
Collection of methods and database related to reading and writing.