CppNoddy  0.92
All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Modules Pages
TrackerFile.h
Go to the documentation of this file.
1/// \file TrackerFile.h
2/// A class that can be passed pointers to scalar/vector/mesh
3/// objects, then their contents are written to a file each
4/// time that the update method is called.
5
6#ifndef TRACKERFILE_H
7#define TRACKERFILE_H
8
9#include <fstream>
10#include <iostream>
11#include <string>
12
13#include <Types.h>
14#include <OneD_Node_Mesh.h>
15
16namespace CppNoddy {
18 public:
19
20 TrackerFile(int prec = 12);
21
22 TrackerFile(std::string filename, int prec = 12);
23
25
26 void precision(unsigned prec);
27
28 void push_ptr(double* scalar, std::string desc = "");
29
30 void push_ptr(D_complex* scalar, std::string desc = "");
31
32 void push_ptr(DenseVector<double>* ptr_to_vector, std::string desc = "");
33
34 void push_ptr(DenseVector<D_complex>* ptr_to_vector, std::string desc = "");
35
36 void push_ptr(OneD_Node_Mesh<double>* ptr_to_mesh, std::string desc = "");
37
38 void push_ptr(OneD_Node_Mesh<D_complex>* ptr_to_mesh, std::string desc = "");
39
40 void push_ptr(OneD_Node_Mesh<D_complex, D_complex>* ptr_to_mesh, std::string desc = "");
41
42 void newline();
43
44 void set_filename(std::string filename);
45
46 void header();
47
48 void update();
49
50 protected:
51
52 mutable std::ofstream m_dumpFile;
53
54 private:
55
56 /// private output method to write all scalar data to dumpfile
57 void dump_scalar_data();
58
59 /// a vector of description strings
60 std::vector< std::string > m_doubleDesc;
61 std::vector< std::string > m_doubleVectorDesc;
62 std::vector< std::string > m_complexVectorDesc;
63 std::vector< std::string > m_doubleMeshDesc;
64 std::vector< std::string > m_complexMeshDesc;
65 std::vector< std::string > m_complexComplexMeshDesc;
66 /// a vector of pointers to scalars
67 std::vector< double* > p_doubles;
68 /// a vector of pointers to double dense vectors
69 std::vector< DenseVector<double>* > p_doubleVectors;
70 /// a vector of pointers to complex dense vectors
71 std::vector< DenseVector<D_complex>* > p_complexVectors;
72 /// a vector of pointers to real 1D meshes
73 std::vector< OneD_Node_Mesh<double>* > p_doubleMesh;
74 /// a vector of pointers to complex 1D meshes
75 std::vector< OneD_Node_Mesh<D_complex>* > p_complexMesh;
76 /// a vector of pointers to complex-complex 1D meshes
77 std::vector< OneD_Node_Mesh<D_complex, D_complex>* > p_complexComplexMesh;
78
79 /// output precision
80 unsigned m_precision;
81
82 }
83 ; //end class
84} //end namepsace
85#endif
A specification for a one dimensional mesh object.
Some standard typedefs.
An DenseVector class – a dense vector object.
Definition: DenseVector.h:34
A one dimensional mesh utility object.
std::ofstream m_dumpFile
Definition: TrackerFile.h:52
void precision(unsigned prec)
Definition: TrackerFile.cpp:76
void push_ptr(double *scalar, std::string desc="")
Definition: TrackerFile.cpp:27
void set_filename(std::string filename)
Definition: TrackerFile.cpp:70
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
std::complex< double > D_complex
A complex double precision number using std::complex.
Definition: Types.h:98

© 2012

R.E. Hewitt