Project.h 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef PROJECT_H
#define PROJECT_H

#include <string>
#include <list>

#include "DOFVector.h"
#include "SystemVector.h"

using namespace AMDiS;
using namespace std;

struct SolutionInformation {
  SystemVector* sysVec;
  DOFVector< double >* dofVec;
  SolutionInformation():
    sysVec(NULL),
    dofVec(NULL)
  {}

};

void write(SolutionInformation&, std::string filename);
bool compare(SolutionInformation&, std::string filename);
class Project {
  public:
    virtual void create(std::string& ) = 0;
    virtual int solve(SolutionInformation&) = 0;

};

class ProjectInfo {
  string initfilename;
  Project* project;
  string outputfilename;

  public:
    ProjectInfo(Project* project, 
	string initfilename,
	string outputfilename):
      initfilename(initfilename),
      project(project),
      outputfilename(outputfilename) {}

  void create() {
    assert(initfilename.length() > 0);
    assert(project!=NULL);
    project->create(initfilename);
  }

  int solve(SolutionInformation& info) {
    assert(project!=NULL);
    return project->solve(info);
  }

  inline string getFilename() const { 
    return outputfilename;
  }
};

#endif