|
ESyS-Particle
2.3.4
|
#include "frame_vtk.h"#include "vec3.h"#include <vector>#include <string>#include <fstream>#include <algorithm>#include <iterator>#include <map>#include <utility>#include <sstream>#include <boost/filesystem.hpp>
Classes | |
| struct | nr_part |
| struct | r_part |
| struct | bond |
Functions | |
| template<typename T > | |
| void | write_bonds (ostream &vtkfile, map< int, T > &data_map, vector< bond > &bonds, map< int, int > &id2idx) |
| template<typename T > | |
| void | write_bonds_with_mesh (ostream &vtkfile, map< int, T > &data_map, vector< bond > &bonds, vector< bond > &mesh_bonds, map< int, int > &id2idx) |
| void | write_vtu_header (ofstream &vtkfile, int np, int nb) |
| void | write_vtu_footer (ofstream &vtkfile) |
| void | write_vtu_particle_data_end (ofstream &vtkfile) |
| void | write_vtu_rot_base_data (ofstream &vtkfile, map< int, r_part > &datamap, bool unwrap) |
| void | write_vtu_nr_base_data (ofstream &vtkfile, map< int, nr_part > &datamap, bool unwrap) |
| int | get_version (const string &infilename) |
| vector< string > | get_filenames (const string &infilename, int version, bool relpath=false) |
| void | do_single_frame_vtk (const string &infilename, const string &outfilename, int iframe, bool with_list, const string &listfilename, bool remove_xbonds, double bond_remove_dist) |
| void | do_single_frame_vtk_r (const string &infilename, const string &outfilename, int iframe, bool with_list, const string &listfilename, bool remove_xbonds, double bond_remove_dist, bool with_brklist, const string &brklistname, bool unwrap, bool relpath) |
| void | do_single_frame_vtk_single_r (const string &infilename, const string &outfilename, int iframe, int ptag, bool unwrap, bool remove_xbonds, double bond_remove_dist) |
| void | do_single_frame_sliced_vtk (const string &, const string &, int, bool, const string &, double, double) |
| void | do_single_frame_sliced_vtk_r (const string &infilename, const string &outfilename, int iframe, bool with_list, const string &listfilename, double slz_min, double slz_max) |
| void | writeMeshFile (const string &infilename, const string &outfilename, int snapNum) |
| void do_single_frame_sliced_vtk | ( | const string & | , |
| const string & | , | ||
| int | , | ||
| bool | , | ||
| const string & | , | ||
| double | , | ||
| double | |||
| ) |
| void do_single_frame_sliced_vtk_r | ( | const string & | infilename, |
| const string & | outfilename, | ||
| int | iframe, | ||
| bool | with_list, | ||
| const string & | listfilename, | ||
| double | slz_min, | ||
| double | slz_max | ||
| ) |
write a slice , doesn't write bonds
References r_part::angvel, r_part::force, get_filenames(), get_version(), esys::lsm::bpu::iter(), r_part::mass, r_part::pos, r_part::q1, r_part::q2, r_part::q3, r_part::q4, r_part::rad, r_part::tag, r_part::vel, and Vec3::Z().
Referenced by main().


| void do_single_frame_vtk | ( | const string & | infilename, |
| const string & | outfilename, | ||
| int | iframe, | ||
| bool | with_list, | ||
| const string & | listfilename, | ||
| bool | remove_xbonds, | ||
| double | bond_remove_dist | ||
| ) |
Read snapshot with non-rotational particles and write it to vtk unstructured grid (.vtu) file
| infilename | the name of the header file |
| outfilename | the "base" name of the output file |
| iframe | the frame number |
| with_list | |
| listfilename |
References nr_part::circ_shift, nr_part::force, get_filenames(), get_version(), nr_part::init_pos, esys::lsm::bpu::iter(), nr_part::mass, nr_part::pos, nr_part::proc_id, nr_part::rad, nr_part::tag, nr_part::vel, write_bonds(), write_vtu_footer(), write_vtu_header(), write_vtu_nr_base_data(), and write_vtu_particle_data_end().
Referenced by main().


| void do_single_frame_vtk_r | ( | const string & | infilename, |
| const string & | outfilename, | ||
| int | iframe, | ||
| bool | with_list, | ||
| const string & | listfilename, | ||
| bool | remove_xbonds, | ||
| double | bond_remove_dist, | ||
| bool | with_brklist, | ||
| const string & | brklistname, | ||
| bool | unwrap, | ||
| bool | relpath | ||
| ) |
Read snapshot with rotational particles and write it to vtk unstructured grid (.vtu) file
| infilename | the name of the header file |
| outfilename | the "base" name of the output file |
| iframe | the frame number |
| with_list | |
| listfilename | |
| remove_xbonds | if "true", bonds crossing a circular boundary are not written to the file |
| bond_remove_dist | distance threshold to detect if a bond is crossing a circular boundary |
| with_brklist | |
| brklistname | |
| unwrap | if "true", the model is unwrapped, i.e. movements across a circular boundary are taken into account |
| relpath | if "true" the filenames in the header file are taken to be relative to the path of the header |
References r_part::angvel, r_part::circ_shift, r_part::force, get_filenames(), get_version(), r_part::init_pos, esys::lsm::bpu::iter(), r_part::mass, r_part::pos, r_part::proc_id, r_part::q1, r_part::q2, r_part::q3, r_part::q4, r_part::rad, r_part::tag, r_part::vel, write_bonds(), write_bonds_with_mesh(), write_vtu_footer(), write_vtu_header(), write_vtu_particle_data_end(), and write_vtu_rot_base_data().
Referenced by main().


| void do_single_frame_vtk_single_r | ( | const string & | infilename, |
| const string & | outfilename, | ||
| int | iframe, | ||
| int | ptag, | ||
| bool | unwrap, | ||
| bool | remove_xbonds, | ||
| double | bond_remove_dist | ||
| ) |
write particles of single tag from frame
| infilename | the input file name |
| outfilename | the output file name base |
| iframe | frame nr. |
| ptag | particle tag to write out |
| unwrap | unwrap x-circular boundaries |
References r_part::angvel, r_part::force, get_filenames(), get_version(), esys::lsm::bpu::iter(), r_part::mass, r_part::pos, r_part::q1, r_part::q2, r_part::q3, r_part::q4, r_part::rad, r_part::tag, r_part::vel, write_bonds(), write_vtu_footer(), write_vtu_header(), write_vtu_particle_data_end(), and write_vtu_rot_base_data().
Referenced by main().


| vector<string> get_filenames | ( | const string & | infilename, |
| int | version, | ||
| bool | relpath = false |
||
| ) |
Get data file names from the header file
| infilename | the file name of the header file (incl. the _0.txt part) |
| the | snapshot version |
| relpath |
References esys::lsm::bpu::iter().
Referenced by do_single_frame_sliced_vtk_r(), do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().


| int get_version | ( | const string & | infilename | ) |
Get snapshot version.
| infilename | the file name of the header file (incl. the _0.txt part) |
Referenced by do_single_frame_sliced_vtk_r(), do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().

| void write_bonds | ( | ostream & | vtkfile, |
| map< int, T > & | data_map, | ||
| vector< bond > & | bonds, | ||
| map< int, int > & | id2idx | ||
| ) |
Write bonds to vtk file.
| vtkfile | the output file stream |
| data_map | STL map containing particle data, particle ID as key. Used for bond strains. |
| bonds | bond data: particle ids and bond tag |
| id2idx | mapping between particle ID and index |
References esys::lsm::bpu::iter().
Referenced by do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().


| void write_bonds_with_mesh | ( | ostream & | vtkfile, |
| map< int, T > & | data_map, | ||
| vector< bond > & | bonds, | ||
| vector< bond > & | mesh_bonds, | ||
| map< int, int > & | id2idx | ||
| ) |
Write bonds to vtk file. Version with bonded mesh IG.
| vtkfile | the output file stream |
| data_map | STL map containing particle data, particle ID as key. Used for bond strains. |
| bonds | bond data: particle ids and bond tag |
| mesh_bonds | mesh bond data: particle ids and triangle id -> bond tag |
| id2idx | mapping between particle ID and index |
References esys::lsm::bpu::iter().
Referenced by do_single_frame_vtk_r().


| void write_vtu_footer | ( | ofstream & | vtkfile | ) |
write base vtu file footer
| vtkfile | the ofstream connected to the output file |
Referenced by do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().

| void write_vtu_header | ( | ofstream & | vtkfile, |
| int | np, | ||
| int | nb | ||
| ) |
write vtu file header
| vtkfile | the ofstream connected to the output file |
| np | nr. of particles |
| nb | nr. of bonds |
Referenced by do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().

| void write_vtu_nr_base_data | ( | ofstream & | vtkfile, |
| map< int, nr_part > & | datamap, | ||
| bool | unwrap | ||
| ) |
write base particle data to vtu file
| vtkfile | the ofstream connected to the output file |
| datamap | |
| unwrap |
References esys::lsm::bpu::iter().
Referenced by do_single_frame_vtk().


| void write_vtu_particle_data_end | ( | ofstream & | vtkfile | ) |
finalize particle data section in vtu file
| vtkfile | the ofstream connected to the output file |
Referenced by do_single_frame_vtk(), do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().

| void write_vtu_rot_base_data | ( | ofstream & | vtkfile, |
| map< int, r_part > & | datamap, | ||
| bool | unwrap | ||
| ) |
write base particle data to vtu file
| vtkfile | the ofstream connected to the output file |
| datamap | |
| unwrap |
References esys::lsm::bpu::iter().
Referenced by do_single_frame_vtk_r(), and do_single_frame_vtk_single_r().


| void writeMeshFile | ( | const string & | infilename, |
| const string & | outfilename, | ||
| int | snapNum | ||
| ) |