~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/io/Output.hh

  • Committer: logg
  • Date: 2002-09-13 12:55:37 UTC
  • Revision ID: devnull@localhost-20020913125537-gz6ry1id9xsvu6np
Tailorized "2002-09-13 07:55:37 by logg"
Initial revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// (c) 2002 Johan Hoffman & Anders Logg, Chalmers Finite Element Center.
 
2
// Licensed under the GNU GPL Version 2.
 
3
 
 
4
#ifndef __OUTPUT_HH
 
5
#define __OUTPUT_HH
 
6
 
 
7
#include <stdarg.h>
 
8
#include <stdio.h>
 
9
#include <kw_constants.h>
 
10
#include <SysInfo.hh>
 
11
#include <DataInfo.hh>
 
12
#include <Grid.hh>
 
13
#include <Vector.hh>
 
14
#include <FileType.hh>
 
15
 
 
16
class Output{
 
17
public:
 
18
 
 
19
  Output(int no_data, ...);
 
20
  Output(int no_data, va_list aptr);
 
21
  Output(const char *filename, int no_data, ...);
 
22
 
 
23
  ~Output();
 
24
 
 
25
  /// Set label for data
 
26
  void SetLabel(int i, const char *name, const char *label);
 
27
  /// Add frame to the file
 
28
  void AddFrame(Grid *grid, Vector **u, real t, int no_vectors = 1);
 
29
  /// Reset the file, overwriting previously saved frames
 
30
  void Reset();
 
31
  
 
32
protected:
 
33
  
 
34
  void InitCommon(const char *filename, int no_data, va_list aptr);
 
35
  void GenerateFileName();
 
36
  void SaveTimeValue(real t);
 
37
  
 
38
  void MatlabAddFrame (FILE *fp, Grid *grid, Vector **u, real t, int no_vectors);
 
39
  void OpenDXAddFrame (FILE *fp, Grid *grid, Vector **u, real t, int no_vectors);
 
40
  void GiDAddFrame    (FILE *fp, Grid *grid, Vector **u, real t, int no_vectors);
 
41
  
 
42
  // Filename for saving output
 
43
  char filename[DOLFIN_LINELENGTH];
 
44
  char grid_filename[DOLFIN_LINELENGTH]; // Used when needed
 
45
 
 
46
  // Data dimensions total size of data
 
47
  int *dimensions;
 
48
  int datasize;
 
49
  
 
50
  // Indicators for saving
 
51
  int current_frame;
 
52
  bool done_grid;
 
53
  bool done_header; 
 
54
 
 
55
  // Time values
 
56
  Vector *time_values;
 
57
  
 
58
  // Problem description
 
59
  char problem_description[DOLFIN_LINELENGTH];
 
60
 
 
61
  // System info
 
62
  SysInfo sysinfo;
 
63
 
 
64
  // Info about data labels and variable names
 
65
  DataInfo *datainfo;
 
66
 
 
67
  // File type
 
68
  FileType filetype;
 
69
  
 
70
};
 
71
 
 
72
#endif