VtkWriter.h 3.84 KB
 Peter Gottschling committed Feb 15, 2008 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ``````// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == == // == crystal growth group == // == == // == Stiftung caesar == // == Ludwig-Erhard-Allee 2 == // == 53175 Bonn == // == germany == // == == // ============================================================================ // == == // == http://www.caesar.de/cg/AMDiS == // == == // ============================================================================ /** \file VtkWriter.h */ #ifndef AMDIS_VTKWRITER_H #define AMDIS_VTKWRITER_H `````` Thomas Witkowski committed Apr 15, 2008 25 26 ``````#include `````` Thomas Witkowski committed Apr 16, 2008 27 ``````#include "BasisFunction.h" `````` Peter Gottschling committed Feb 15, 2008 28 29 30 31 32 33 34 ``````#include "DataCollector.h" namespace AMDiS { class VtkWriter { public: `````` Thomas Witkowski committed Apr 21, 2008 35 36 `````` VtkWriter(::std::vector *dc) : dc_(dc) `````` Thomas Witkowski committed Apr 15, 2008 37 `````` { `````` Thomas Witkowski committed Apr 16, 2008 38 39 `````` degree_ = (*dc_)[0]->getFeSpace()->getBasisFcts()->getDegree(); dim_ = (*dc_)[0]->getMesh()->getDim(); `````` Thomas Witkowski committed Apr 15, 2008 40 41 42 `````` }; `````` Thomas Witkowski committed Feb 25, 2008 43 44 45 `````` /** \brief * Writes a ParaView-VTK file. */ `````` Thomas Witkowski committed Apr 15, 2008 46 47 `````` int writeFile(const char *name); `````` Thomas Witkowski committed Feb 25, 2008 48 49 50 51 `````` /** \brief * Adds a new entry to a ParaView animation file. */ `````` Thomas Witkowski committed Apr 15, 2008 52 53 54 55 56 `````` int updateAnimationFile(::std::string valueFilename, ::std::vector< ::std::string > *paraViewAnimationFrames, const char *animationFilename); protected: /** \brief `````` Thomas Witkowski committed Apr 21, 2008 57 58 `````` * Writes all coordinates of vertices and interpolation points to an * output file. `````` Thomas Witkowski committed Apr 15, 2008 59 60 61 62 63 `````` */ void writeVertexCoords(::std::ofstream &file); /** \brief `````` Thomas Witkowski committed Apr 21, 2008 64 65 `````` * Writes all values of vertices and interpolation point to an output * file. `````` Thomas Witkowski committed Apr 15, 2008 66 67 68 69 70 `````` */ void writeVertexValues(::std::ofstream &file, int componentNo); /** \brief `````` Thomas Witkowski committed Apr 21, 2008 71 `````` * Writes the connectivity of all simplices to an output file. `````` Thomas Witkowski committed Apr 15, 2008 72 73 74 75 `````` */ void writeConnectivity(::std::ofstream &file); /** \brief `````` Thomas Witkowski committed Apr 21, 2008 76 77 `````` * Writes the connectivity for the case dim = 2 and degree = 2 to * an output file. `````` Thomas Witkowski committed Apr 15, 2008 78 79 80 81 `````` */ void writeConnectivity_dim2_degree2(::std::ofstream &file); `````` Thomas Witkowski committed Apr 18, 2008 82 `````` /** \brief `````` Thomas Witkowski committed Apr 21, 2008 83 84 `````` * Writes the connectivity for the case dim = 2 and degree = 3 to * an output file. `````` Thomas Witkowski committed Apr 18, 2008 85 86 87 88 89 `````` */ void writeConnectivity_dim2_degree3(::std::ofstream &file); /** \brief `````` Thomas Witkowski committed Apr 21, 2008 90 91 `````` * Writes the connectivity for the case dim = 2 and degree = 4 to * an output file. `````` Thomas Witkowski committed Apr 18, 2008 92 93 94 95 `````` */ void writeConnectivity_dim2_degree4(::std::ofstream &file); `````` Thomas Witkowski committed Apr 15, 2008 96 `````` /** \brief `````` Thomas Witkowski committed Apr 21, 2008 97 `````` * Writes a world coordinate to a given file. `````` Thomas Witkowski committed Apr 15, 2008 98 99 100 101 102 103 104 105 106 107 108 109 110 `````` */ inline void writeCoord(::std::ofstream &file, WorldVector coord) { for (int i = 0; i < Global::getGeo(WORLD); i++) { file << " " << ::std::scientific << coord[i]; } for (int i = Global::getGeo(WORLD); i < 3; i++) { file << " 0.0"; } file << ::std::endl; } private: /** `````` Thomas Witkowski committed Apr 21, 2008 111 `````` * List of DataCollectors, for each component of the problem one. `````` Thomas Witkowski committed Apr 15, 2008 112 113 114 115 116 `````` */ ::std::vector *dc_; /** \brief `````` Thomas Witkowski committed Apr 21, 2008 117 `````` * Degree of the basis function of the problem. `````` Thomas Witkowski committed Apr 16, 2008 118 119 120 121 122 `````` */ int degree_; /** \brief `````` Thomas Witkowski committed Apr 21, 2008 123 `````` * Dimension of the geometry. `````` Thomas Witkowski committed Apr 16, 2008 124 125 `````` */ int dim_; `````` Peter Gottschling committed Feb 15, 2008 126 127 128 129 `````` }; } #endif``````