-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepost.h
executable file
·75 lines (69 loc) · 1.57 KB
/
prepost.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
ver.03.03
file prepost.h
*/
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include "element.h"
class PrePostProcessor{
public:
PrePostProcessor(
std::vector<Dof*>& vdof,
unsigned& num_dof_dirichlet,
unsigned& num_dof_nond,
MATRIX& T,
std::string projectname,
const unsigned DIM,
const unsigned NODE_IN_ELEM,
const unsigned NUM_GP
):
//num_nodes(global.num_nodes),
vdof(vdof),
num_dof_dirichlet(num_dof_dirichlet),
num_dof_nond(num_dof_nond),
T(T),
projectname(projectname),
DIM(DIM),
NODE_IN_ELEM(NODE_IN_ELEM),
NUM_GP(NUM_GP)
{
m_output_element << "gid-MAFINS/"
<< projectname << "-element.gid/"
<< projectname << "-element.post.res";
};
virtual void post_process(unsigned loadstep)=0;
virtual void save_result(unsigned loadstep)=0;
virtual ~PrePostProcessor(){};
void debug(void){
using namespace std;
for(unsigned int i=0;i<vdof.size()/3;i++){
cout << i << "\t";
cout <<
vdof[raw_to_mi[i*3 ]]->X0 << "\t" <<
vdof[raw_to_mi[i*3+1]]->X0 << "\t" <<
vdof[raw_to_mi[i*3+2]]->X0 << "\t";
cout <<
vdof[raw_to_mi[i*3 ]]->X << "\t" <<
vdof[raw_to_mi[i*3+1]]->X << "\t" <<
vdof[raw_to_mi[i*3+2]]->X <<endl;
}
};
protected:
std::vector<Element_output*> velements;
//Node*& raw_nodes;
Node* raw_nodes;
int* raw_to_mi;
unsigned num_nodes;
//from global
std::vector<Dof*>& vdof;
unsigned& num_dof_dirichlet;
unsigned& num_dof_nond;
MATRIX& T;
const unsigned DIM;
const unsigned NODE_IN_ELEM;
const unsigned NUM_GP;
std::string projectname;
std::ostringstream m_output_element;
};