-
Notifications
You must be signed in to change notification settings - Fork 2
/
FESolve.cpp
60 lines (44 loc) · 1.36 KB
/
FESolve.cpp
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
// FESolve.cpp : Definiert den Einsprungpunkt f�r die Konsolenanwendung.
//
#include "stdafx.h"
#include "Model.h"
#include "LinearSolver.h"
#include <iostream>
#include <fstream>
int main(int argc, char* argv[])
{
if(argc < 2 || argc > 4) {
std::cout << "ERROR: fesolve input.* ?output.*?" << std::endl;
} else {
fesolv::Model model(argv[1]);
fesolv::LinearSolver solver(&model);
solver.Solve();
if(argc != 2){
std::ofstream fout(argv[2]);
if(!fout){
std::cout << "could not open" << argv[2] << std::endl;
goto stdoutput;
}
fout << "################# FESOLVE #################";
fout << std::endl << std::endl << std::endl;
solver.PrintData(fout);
solver.PrintElementStiffnessMatrix(fout);
solver.PrintSystemStiffnessMatrix(fout);
solver.PrintSystemDVector(fout);
solver.PrintSystemDisplacementVector(fout);
solver.PrintReactionForceVector(fout);
} else {
stdoutput:
std::cout << "################# FESOLVE #################" << std::endl;
std::cout << std::endl << std::endl << std::endl;
solver.PrintData(std::cout);
solver.PrintElementStiffnessMatrix(std::cout);
solver.PrintSystemStiffnessMatrix(std::cout);
solver.PrintSystemDVector(std::cout);
solver.PrintSystemDisplacementVector(std::cout);
solver.PrintReactionForceVector(std::cout);
}
}
system("PAUSE");
return 1;
}