33 #ifndef __H__UG__LIB_DISC__IO__VTKOUTPUT__
34 #define __H__UG__LIB_DISC__IO__VTKOUTPUT__
57 template <
typename TElem>
64 template <
typename TElem>
67 if(si < 0)
return provider.template begin<TElem>();
68 else return provider.template begin<TElem>(si);
71 template <
typename TElem>
74 if(si < 0)
return provider.template end<TElem>();
75 else return provider.template end<TElem>(si);
86 template <
typename TElem>
93 template <
typename TElem>
97 if(si < 0)
return provider.
multi_grid()->template begin<TElem>(lev);
98 else return provider.template begin<TElem>(si, lev);
101 template <
typename TElem>
105 if(si < 0)
return provider.
multi_grid()->template end<TElem>(lev);
106 else return provider.template end<TElem>(si, lev);
185 void select(
const char* fctName,
const char*
name);
186 void select(
const std::vector<std::string>& vFct,
const char*
name);
284 template <
typename TFunction>
285 void print(
const char* filename, TFunction& u,
287 bool makeConsistent);
290 template <
typename TFunction>
291 void print(
const char* filename, TFunction& u,
294 return print(filename, u, step, time,
true);
305 template <
typename TFunction>
306 void print(
const char* filename, TFunction& u,
309 print(filename, u, -1, 0.0, makeConsistent);
313 template <
typename TFunction>
314 void print(
const char* filename, TFunction& u)
316 return print(filename, u,
true);
344 template <
typename TFunction>
346 int si,
int step,
number time,
347 bool makeConsistent);
350 template <
typename TFunction>
352 int si,
int step = -1,
number time = 0.0)
375 template <
typename TFunction>
378 bool makeConsistent =
true);
398 template <
typename TFunction>
400 const char* ssNames,
int step = -1,
number time = 0.0,
401 bool makeConsistent =
true);
404 template <
typename TFunction>
408 return print_subsets(filename, u, ssNames, step, time,
true);
420 template <
typename TFunction>
424 print_subsets(filename, u, ssNames, -1, 0.0, makeConsistent);
428 template <
typename TFunction>
441 template <
typename TFunction>
451 template <
typename TFunction>
462 template <
typename TFunction>
476 template <
typename T>
479 int& numVert,
int& numElem,
int& numConn);
497 template <
typename TElem,
typename T>
500 int& numVert,
int& numElem,
int& numConn);
502 template <
typename T>
508 const int dim,
const int numVert,
const int numElem,
const int numConn);
510 template <
typename T>
542 template <
typename T>
561 template <
typename TElem,
typename T>
566 Grid& grid,
const T& iterContainer,
const int si,
int& n);
578 template <
typename T>
583 const int dim,
const int numElem,
const int numConn);
594 template <
typename TElem,
typename T>
598 Grid& grid,
const T& iterContainer,
const int si);
600 template <
typename T>
605 const int dim,
const int numConn);
615 template <
typename TElem,
typename T>
619 template <
typename T>
622 const int dim,
const int numElem);
632 template <
typename TElem,
typename T>
636 template <
typename T>
639 const int dim,
const int numElem);
650 template <
typename TElem,
typename T>
654 template <
typename T>
676 template <
typename TElem,
typename T>
680 template <
typename T>
696 template <
typename TFunction>
718 template <
typename TElem,
typename TFunction>
720 const std::vector<size_t>& vFct,
721 Grid& grid,
const int si);
736 template <
typename TFunction>
738 const std::vector<size_t>& vFct,
739 const std::string&
name,
740 Grid& grid,
const int si,
const int dim,
756 template <
typename TFunction>
758 const std::vector<size_t>& vFct,
759 const std::string&
name,
765 template <
typename TElem,
typename TFunction,
typename TData>
769 Grid& grid,
const int si);
771 template <
typename TFunction,
typename TData>
775 const std::string&
name,
780 template <
typename TFunction>
799 template <
typename TElem,
typename TFunction>
801 const std::vector<size_t>& vFct,
802 Grid& grid,
const int si);
817 template <
typename TFunction>
819 const std::vector<size_t>& vFct,
820 const std::string&
name,
826 template <
typename TElem,
typename TFunction,
typename TData>
829 Grid& grid,
const int si);
831 template <
typename TFunction,
typename TData>
835 const std::string&
name,
840 template <
typename TFunction>
849 template <
typename TFunction>
850 void write_pvtu(TFunction& u,
const std::string& filename,
851 int si,
int step,
number time);
856 int step = -1,
number time = 0.0);
859 static void vtu_filename(std::string& nameOut, std::string nameIn,
860 int rank,
int si,
int maxSi,
int step);
863 static void pvtu_filename(std::string& nameOut, std::string nameIn,
864 int si,
int maxSi,
int step);
867 static void pvd_filename(std::string& nameOut, std::string nameIn);
924 typedef typename std::map<std::string,
930 typedef typename std::map<std::string,
936 typedef typename std::map<std::string,
942 typedef typename std::map<std::string,
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:108
File writer allowing selective base64 encoding of arbitrary data.
Definition: base64_file_writer.h:75
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
a mathematical Vector with N entries.
Definition: math_vector.h:97
Handles subsets on a per level basis.
Definition: subset_handler_multi_grid.h:60
MultiGrid * multi_grid()
Definition: subset_handler_multi_grid.h:73
uint num_levels() const
returns the number of levels
Definition: subset_handler_multi_grid.h:80
Group of subsets.
Definition: subset_group.h:51
Type based UserData.
Definition: user_data.h:143
output writer to the VTK file format
Definition: vtkoutput.h:150
void print(const char *filename, TFunction &u, bool makeConsistent)
Definition: vtkoutput.h:306
void count_sizes(Grid &grid, const T &iterContainer, const int si, int &numVert, int &numElem, int &numConn)
Definition: vtkoutput_impl.h:655
void select(const char *fctName, const char *name)
selects a value of a grid function value to be written
Definition: vtkoutput.cpp:440
void write_nodal_data_elementwise(VTKFileWriter &File, TFunction &u, number time, SmartPtr< UserData< TData, TDim > > spData, Grid &grid, const int si)
Definition: vtkoutput_impl.h:1441
std::map< std::string, SmartPtr< UserData< MathVector< TDim >, TDim > > >::iterator VectorDataIterator
Definition: vtkoutput.h:937
void write_time_processwise_pvd(const char *filename, TFunction &u)
Definition: vtkoutput_impl.h:2536
void print_subset(const char *filename, TFunction &u, int si, int step=-1, number time=0.0)
Definition: vtkoutput.h:351
void write_cell_values(VTKFileWriter &File, TFunction &u, const std::vector< size_t > &vFct, const std::string &name, Grid &grid, const SubsetGroup &ssGrp, const int dim, const int numElem)
Definition: vtkoutput_impl.h:2069
std::map< std::string, std::vector< std::string > >::iterator ComponentsIterator
Definition: vtkoutput.h:925
void write_item_to_file(VTKFileWriter &File, float data)
writes data to stream
Definition: vtkoutput_impl.h:87
void write_pvtu(TFunction &u, const std::string &filename, int si, int step, number time)
writes a grouping *.pvtu file
Definition: vtkoutput_impl.h:2230
void write_nodal_values_elementwise(VTKFileWriter &File, TFunction &u, const std::vector< size_t > &vFct, Grid &grid, const int si)
Definition: vtkoutput_impl.h:1593
void set_write_subset_indices(bool b)
Definition: vtkoutput.h:882
void write_nodal_values_piece(VTKFileWriter &File, TFunction &u, number time, Grid &grid, const SubsetGroup &ssGrp, const int dim, const int numVert)
Definition: vtkoutput_impl.h:1710
void write_cell_offsets(VTKFileWriter &File, const T &iterContainer, const int si, int &n)
Definition: vtkoutput_impl.h:1059
void write_time_pvd(const char *filename, TFunction &u)
Definition: vtkoutput_impl.h:2441
bool m_bSelectAll
scheduled components to be printed
Definition: vtkoutput.h:918
std::map< std::string, SmartPtr< UserData< MathMatrix< TDim, TDim >, TDim > > > m_vMatrixElemData
Definition: vtkoutput.h:941
std::map< std::string, SmartPtr< UserData< number, TDim > > > m_vScalarElemData
Definition: vtkoutput.h:929
void write_cell_subsets(VTKFileWriter &File, const T &iterContainer, const int si, MGSubsetHandler &sh)
Definition: vtkoutput_impl.h:1277
std::map< std::string, std::vector< std::string > > m_vSymbFctElem
Definition: vtkoutput.h:923
bool vtk_name_used(const char *name) const
returns true if name for vtk-component is already used
Definition: vtkoutput.cpp:665
void clear_selection()
clears the selected output
Definition: vtkoutput.h:153
void write_grid_piece(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, const Grid::VertexAttachmentAccessor< Attachment< MathVector< TDim > > > &aaPos, Grid &grid, const T &iterContainer, SubsetGroup &ssGrp, int dim)
Definition: vtkoutput_impl.h:563
void write_cell_values_piece(VTKFileWriter &File, TFunction &u, number time, Grid &grid, const SubsetGroup &ssGrp, const int dim, const int numElem)
Definition: vtkoutput_impl.h:2110
void write_item_to_file(VTKFileWriter &File, double data)
writes data to stream
Definition: vtkoutput.h:904
void write_cell_values_elementwise(VTKFileWriter &File, TFunction &u, const std::vector< size_t > &vFct, Grid &grid, const int si)
Definition: vtkoutput_impl.h:1973
void select_all(bool bAll)
schedules that all components of the passed discrete functions will be written to file
Definition: vtkoutput.h:166
void print_subsets(const char *filename, TFunction &u, const SubsetGroup &ssGrp, int step=-1, number time=0.0, bool makeConsistent=true)
Definition: vtkoutput_impl.h:382
void write_nodal_data(VTKFileWriter &File, TFunction &u, number time, SmartPtr< UserData< TData, TDim > > spData, const int numCmp, const std::string &name, Grid &grid, const SubsetGroup &ssGrp, const int dim, const int numVert)
Definition: vtkoutput_impl.h:1536
void count_piece_sizes(Grid &grid, const T &iterContainer, const SubsetGroup &ssGrp, const int dim, int &numVert, int &numElem, int &numConn)
Definition: vtkoutput_impl.h:713
void set_write_proc_ranks(bool b)
Definition: vtkoutput.h:884
void write_comment_printf(FILE *File)
Definition: vtkoutput.cpp:193
std::map< std::string, std::vector< std::string > > m_vSymbFctNodal
Definition: vtkoutput.h:922
void print_subsets(const char *filename, TFunction &u, const char *ssNames, bool makeConsistent)
Definition: vtkoutput.h:421
std::map< std::string, SmartPtr< UserData< number, TDim > > > m_vScalarNodalData
scheduled scalar data to be printed
Definition: vtkoutput.h:928
std::map< std::string, SmartPtr< UserData< MathMatrix< TDim, TDim >, TDim > > > m_vMatrixNodalData
scheduled vector data to be printed
Definition: vtkoutput.h:940
std::map< std::string, SmartPtr< UserData< MathVector< TDim >, TDim > > > m_vVectorNodalData
scheduled vector data to be printed
Definition: vtkoutput.h:934
static void write_subset_pvd(int numSubset, const std::string &filename, int step=-1, number time=0.0)
writes a grouping *.pvd file, grouping all data from different subsets
Definition: vtkoutput.cpp:307
void select_element(const char *fctName, const char *name)
selects a element value of a grid function value to be written
Definition: vtkoutput.cpp:607
void print(const char *filename, TFunction &u)
Definition: vtkoutput.h:314
VTKOutput()
default constructor
Definition: vtkoutput.h:875
void write_cell_data_elementwise(VTKFileWriter &File, TFunction &u, number time, SmartPtr< UserData< TData, TDim > > spData, Grid &grid, const int si)
Definition: vtkoutput_impl.h:1831
void clear_data_selection()
clears the selected output
Definition: vtkoutput.h:156
void set_binary(bool b)
should values be printed in binary (base64 encoded way ) or plain ascii
Definition: vtkoutput.h:878
void set_write_grid(bool b)
Definition: vtkoutput.h:880
static void pvd_filename(std::string &nameOut, std::string nameIn)
creates the needed pvd file name
Definition: vtkoutput.cpp:280
void write_time_pvd_subset(const char *filename, TFunction &u, int si)
Definition: vtkoutput_impl.h:2611
static void pvd_time_filename(std::string &nameOut, std::string nameIn, int step)
creates the needed pvd file name to group the time steps
Definition: vtkoutput.cpp:292
void write_nodal_values(VTKFileWriter &File, TFunction &u, const std::vector< size_t > &vFct, const std::string &name, Grid &grid, const int si, const int dim, const int numVert)
static void write_empty_grid_piece(VTKFileWriter &File, bool binary=true)
Definition: vtkoutput.cpp:136
std::map< std::string, std::vector< std::string > > m_vSymbFct
Definition: vtkoutput.h:921
std::map< std::string, std::vector< number > > m_mTimestep
map storing the time points
Definition: vtkoutput.h:946
static void pvtu_filename(std::string &nameOut, std::string nameIn, int si, int maxSi, int step)
create the needed pvtu file name
Definition: vtkoutput.cpp:259
void set_user_defined_comment(const char *comment)
Definition: vtkoutput.h:522
void write_cell_connectivity(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, Grid &grid, const T &iterContainer, const int si)
Definition: vtkoutput_impl.h:920
void print_subset(const char *filename, TFunction &u, int si, int step, number time, bool makeConsistent)
Definition: vtkoutput_impl.h:247
void print_subsets(const char *filename, TFunction &u, const char *ssNames)
Definition: vtkoutput.h:429
bool m_bWriteProcRanks
Definition: vtkoutput.h:952
void select_nodal(const char *fctName, const char *name)
selects a nodal value of a grid function value to be written
Definition: vtkoutput.cpp:515
std::map< std::string, SmartPtr< UserData< MathMatrix< TDim, TDim >, TDim > > >::iterator MatrixDataIterator
Definition: vtkoutput.h:943
bool m_bWriteGrid
Definition: vtkoutput.h:948
void print(const char *filename, TFunction &u, int step, number time, bool makeConsistent)
Definition: vtkoutput_impl.h:184
bool m_bBinary
print values in binary (base64 encoded way) or plain ascii
Definition: vtkoutput.h:920
void print(const char *filename, TFunction &u, int step, number time)
Definition: vtkoutput.h:291
void write_points_elementwise(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, const Grid::VertexAttachmentAccessor< Attachment< MathVector< TDim > > > &aaPos, Grid &grid, const T &iterContainer, const int si, int &n)
Definition: vtkoutput_impl.h:760
void print_subsets(const char *filename, TFunction &u, const char *ssNames, int step, number time)
Definition: vtkoutput.h:405
void write_points(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, const Grid::VertexAttachmentAccessor< Attachment< MathVector< TDim > > > &aaPos, Grid &grid, const T &iterContainer, const SubsetGroup &ssGrp, const int dim, const int numVert)
Definition: vtkoutput_impl.h:811
static void vtu_filename(std::string &nameOut, std::string nameIn, int rank, int si, int maxSi, int step)
creates the needed vtu file name
Definition: vtkoutput.cpp:232
std::map< std::string, SmartPtr< UserData< MathVector< TDim >, TDim > > > m_vVectorElemData
Definition: vtkoutput.h:935
void write_cells(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, Grid &grid, const T &iterContainer, const SubsetGroup &ssGrp, const int dim, const int numElem, const int numConn)
Definition: vtkoutput_impl.h:888
void write_cell_subset_names(VTKFileWriter &File, MGSubsetHandler &sh)
Definition: vtkoutput_impl.h:872
std::string m_sComment
Definition: vtkoutput.h:949
void write_cell_proc_ranks(VTKFileWriter &File, const T &iterContainer, const int si, MGSubsetHandler &sh)
Definition: vtkoutput_impl.h:1359
bool m_bWriteSubsetIndices
Definition: vtkoutput.h:951
void write_cell_data(VTKFileWriter &File, TFunction &u, number time, SmartPtr< UserData< TData, TDim > > spData, const int numCmp, const std::string &name, Grid &grid, const SubsetGroup &ssGrp, const int dim, const int numElem)
Definition: vtkoutput_impl.h:1927
void write_points_cells_piece(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, const Grid::VertexAttachmentAccessor< Attachment< MathVector< TDim > > > &aaPos, Grid &grid, const T &iterContainer, const SubsetGroup &ssGrp, const int dim, const int numVert, const int numElem, const int numConn)
Definition: vtkoutput_impl.h:538
void write_comment(VTKFileWriter &File)
Definition: vtkoutput.cpp:179
std::map< std::string, SmartPtr< UserData< number, TDim > > >::iterator ScalarDataIterator
Definition: vtkoutput.h:931
VTKFileWriter & write_asc_float(VTKFileWriter &File, float data)
prints ascii representation of a float in the Float32 format (a protection against the denormalized f...
Definition: vtkoutput_impl.h:69
void write_grid_solution_piece(VTKFileWriter &File, Grid::VertexAttachmentAccessor< Attachment< int > > &aaVrtIndex, Grid &grid, TFunction &u, number time, const SubsetGroup &ssGrp, const int dim)
Definition: vtkoutput_impl.h:600
void write_cell_types(VTKFileWriter &File, const T &iterContainer, const int si)
Definition: vtkoutput_impl.h:1163
double number
Definition: types.h:124
Base64FileWriter VTKFileWriter
Definition: vtkoutput.h:52
Definition: vtkoutput.h:59
T::template traits< TElem >::const_iterator const_iterator
Definition: vtkoutput.h:61
T::template traits< TElem >::iterator iterator
Definition: vtkoutput.h:60
T::template traits< TElem >::const_iterator const_iterator
Definition: vtkoutput.h:90
T::template traits< TElem >::iterator iterator
Definition: vtkoutput.h:89
MGSubsetHandler T
Definition: vtkoutput.h:83
static traits< TElem >::const_iterator begin(const T &provider, int si)
Definition: vtkoutput.h:94
static traits< TElem >::const_iterator end(const T &provider, int si)
Definition: vtkoutput.h:102
Definition: vtkoutput.h:56
static traits< TElem >::const_iterator begin(const T &provider, int si)
Definition: vtkoutput.h:65
static traits< TElem >::const_iterator end(const T &provider, int si)
Definition: vtkoutput.h:72