forked from SeriousSamV/2D-Heat-Transfer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
72 lines (61 loc) · 1.98 KB
/
main.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* 2-D Steady State Conduction without Heat Generation | main.cpp
*
* @libs [Nodes.a, NodesHelper.a]
* @header [Nodes.h, NodesHelper.h]
*
* @author Samuel0Paul <paulsamuelvishesh@live.com>
**/
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstdint>
#include <chrono>
#include <thread>
#include <atomic>
#include "header/Nodes.h"
#include "header/NodesHelper.h"
#include "test/test.cpp"
using std::cout; using std::endl;
using std::clog;
using std::cin;
using std::make_pair;
using prec_t = long double;
void runTest(void)
{
test::NodesWithoutHeatSrc<prec_t> testNodesWOHSrcTE{12, 30,
500.0f, 100.0f, 100.0f, 100.0f, 0.0000001f, true};
testNodesWOHSrcTE.test();
test::NodesWithoutHeatSrc<prec_t> testNodesWOHSrcWTE{12, 30,
500.0f, 100.0f, 100.0f, 100.0f, 0.0000001f, false};
testNodesWOHSrcWTE.test();
std::vector<std::pair<std::pair<uint64_t, uint64_t>, prec_t>> heatSrcs = {
make_pair(make_pair(2, 2), 300.0f),
make_pair(make_pair(5, 5), -1000.0f)
};
test::NodesWithHeatSrc<prec_t> testNodesWHSrcTE{12, 30,
500.0f, 100.0f, 100.0f, 100.0f, 0.0000001f, false,
heatSrcs};
testNodesWHSrcTE.test();
test::NodesWithHeatSrc<prec_t> testNodesWHSrcWTE{12, 30,
500.0f, 100.0f, 100.0f, 100.0f, 0.0000001f, true,
heatSrcs};
testNodesWHSrcWTE.test();
}
int main(int argc, char const *argv[])
{
cout << std::nounitbuf;
cout << std::setprecision(4) << std::fixed << std::boolalpha;
cout << "############################ HMT Assignment ##########################" << endl
<< " 2-D Steady State Conduction with and withour Heat Generation" << endl << endl
<< " Author: Samuel Paul Vishesh [UR11ME145] <paulsamuelvishesh@live.com>" << endl
<< "######################################################################" << endl << endl;
/*HMT::NodesHelper<prec_t> nodes;
nodes.init();
nodes.canUseThreads(false);
nodes.calculate();
cout << nodes;
cout << "Time taken: " << nodes.getDuration<std::chrono::nanoseconds>().count() << "ns" << endl;*/
runTest();
return 0;
}