ArhReader.h 2.47 KB
Newer Older
1 2 3 4
// ============================================================================
// ==                                                                        ==
// == Amdis - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6 7
// ==                                                                        ==
// ============================================================================
8 9 10
//
// Software License for AMDiS
//
Florian Stenger's avatar
Florian Stenger committed
11
// Copyright (c) 2010 Dresden University of Technology
12 13 14 15 16 17 18 19
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20 21 22 23 24 25 26 27 28 29

/** \file ArhReader.h */

#ifndef AMDIS_ARH_READER_H
#define AMDIS_ARH_READER_H

#include "AMDiS_fwd.h"

namespace AMDiS {

30 31
  using namespace std;

32 33 34
  class ArhReader
  {
  public:
35
    static void read(string filename, Mesh *mesh,
Florian Stenger's avatar
Florian Stenger committed
36
		     DOFVector<double>* vec0 = NULL,
37
		     DOFVector<double>* vec1 = NULL,
Florian Stenger's avatar
Florian Stenger committed
38
		     DOFVector<double>* vec2 = NULL,
39
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
40
		     bool writeParallel = true,
41 42 43
#else
		     bool writeParallel = false,
#endif
44
		     int nProcs = -1);
45

Florian Stenger's avatar
Florian Stenger committed
46
    static void read(string filename, Mesh *mesh,
47
		     vector<DOFVector<double>*> vecs,
48
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
49
		     bool writeParallel = true,
50 51 52
#else
		     bool writeParallel = false,
#endif
53
		     int nProcs = -1);
54

Florian Stenger's avatar
Florian Stenger committed
55
    static void readFromMemoryBlock(vector<char> &data, Mesh *mesh,
56 57 58
				    DOFVector<double>* vec0 = NULL,
				    DOFVector<double>* vec1 = NULL,
				    DOFVector<double>* vec2 = NULL,
Florian Stenger's avatar
Florian Stenger committed
59
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
60
				    bool writeParallel = true,
Florian Stenger's avatar
Florian Stenger committed
61
#else
62
				    bool writeParallel = false,
Florian Stenger's avatar
Florian Stenger committed
63
#endif
64 65
				    int nProcs = -1);
    
Florian Stenger's avatar
Florian Stenger committed
66
    static void readFromMemoryBlock(vector<char> &data, Mesh *mesh,
67
				    vector<DOFVector<double>*> vecs,
Florian Stenger's avatar
Florian Stenger committed
68
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
69
				    bool writeParallel = true,
Florian Stenger's avatar
Florian Stenger committed
70
#else
71
				    bool writeParallel = false,
Florian Stenger's avatar
Florian Stenger committed
72
#endif
73 74 75
				    int nProcs = -1);
    
    static int getNumValueVectors(string filename);
Florian Stenger's avatar
Florian Stenger committed
76

77
  private:
78

Florian Stenger's avatar
Florian Stenger committed
79
    static void readFile(string filename,
80 81 82
			 Mesh *mesh,
			 vector<DOFVector<double>*> vecs);

Florian Stenger's avatar
Florian Stenger committed
83
    static void setDofValues(int macroElIndex, Mesh *mesh,
84
			     vector<double>& values, DOFVector<double>* vec);
Florian Stenger's avatar
Florian Stenger committed
85 86

    static void readBlock(vector<char> &data,
87 88
			  Mesh *mesh,
			  vector<DOFVector<double>*> vecs);
Florian Stenger's avatar
Florian Stenger committed
89

90 91 92 93
  };
}

#endif