-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_TAF2_PR-205a.php
148 lines (112 loc) · 5.66 KB
/
index_TAF2_PR-205a.php
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
spl_autoload_extensions(".php");
spl_autoload_register();
/** PHPExcel_IOFactory */
include 'Classes/PHPExcel/IOFactory.php';
set_time_limit(36000);
\Classes\Factory\Model\Model::$coordinateTolerance = 0.01;
\Classes\Utils\Math\Constant::$epsilon = 0.01;
try {
// UPLOAD STEEL MEMBERS
Classes\Utils\Timer\Timer::start('STEEL_MEMBER_UPLOAD');
$uploadFactory = new \Classes\Factory\Import\Instance\InstanceUploaderFromExcel();
$steelMemberArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_SM.xlsx',
new \Classes\Instance\Member\SteelMember);
foreach ($steelMemberArray as &$object) {
Classes\Factory\Model\Addition\SteelMemberAddition::add($object);
}
// UPLOAD NEW STEEL MEMBERS
$uploadFactory = new \Classes\Factory\Import\Instance\InstanceUploaderFromExcel();
$steelMemberArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_SM_new.xlsx',
new \Classes\Instance\Member\SteelMember);
foreach ($steelMemberArray as &$object) {
Classes\Factory\Model\Addition\SteelMemberAddition::add($object);
}
Classes\Utils\Timer\Timer::stop('STEEL_MEMBER_UPLOAD');
// UPLOAD RC MEMBERS
Classes\Utils\Timer\Timer::start('RC_MEMBER_UPLOAD');
$uploadFactory = new \Classes\Factory\Import\Instance\InstanceUploaderFromExcel();
$rcMemberArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_RC.xlsx',
new \Classes\Instance\Member\ParameterMember);
foreach ($rcMemberArray as &$object) {
Classes\Factory\Model\Addition\ParameterMemberAddition::add($object);
}
Classes\Utils\Timer\Timer::stop('RC_MEMBER_UPLOAD');
// DELETE DOUBLE NODES
\Classes\Utils\Timer\Timer::start('COMBINE_DOUBLE_NODES');
\Classes\Utils\Node\DoubleNodes::combineAll(array(Classes\Factory\Model\Model::getHashTable()));
\Classes\Utils\Timer\Timer::stop('COMBINE_DOUBLE_NODES');
// DIVIDE MEMBERS BY NODES
\Classes\Utils\Timer\Timer::start('DIVIDE_ALL_MEMBERS');
\Classes\Utils\Member\DivideMember::divideAllMembersByExistingNodes();
\Classes\Utils\Timer\Timer::stop('DIVIDE_ALL_MEMBERS');
// UPLOAD LOAD CASES
Classes\Utils\Timer\Timer::start('LOAD_CASES_UPLOAD');
$loadCaseArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_Load_Cases.xlsx',
new \Classes\Instance\LoadCase\LoadCase);
foreach ($loadCaseArray as $object) {
Classes\Factory\Model\Addition\LoadCaseAddition::add($object);
}
Classes\Utils\Timer\Timer::stop('LOAD_CASES_UPLOAD');
// UPLOAD LOADS
Classes\Utils\Timer\Timer::start('LOADS_UPLOAD');
$memberLoadArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_Loads.xlsx',
new \Classes\Instance\Load\Member\CommonMemberLoad);
$notFoundObjects = Classes\Factory\Model\Addition\MemberLoadAddition::add($memberLoadArray);
foreach ($notFoundObjects as $object) {
$name = $object->getProperty('name')->get();
echo "LOAD $name IS NOT FOUND<br/>";
}
echo "<br/>";
// CONCENTRATED LOADS UPLOAD
$memberLoadArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_WO_Loads.xlsx',
new \Classes\Instance\Load\Member\ConcentratedCommonMemberLoad);
$notFoundObjects = Classes\Factory\Model\Addition\ConcentratedMemberLoadAddition::add($memberLoadArray);
foreach ($notFoundObjects as $object) {
$name = $object->getProperty('name')->get();
echo "LOAD $name IS NOT FOUND<br/>";
}
// UPLOAD WIND LOADS
Classes\Utils\Timer\Timer::start('LOADS_UPLOAD');
$memberLoadArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_Wind_Load.xlsx',
new \Classes\Instance\Load\Member\CommonMemberLoad);
$notFoundObjects = Classes\Factory\Model\Addition\MemberLoadAddition::add($memberLoadArray);
foreach ($notFoundObjects as $object) {
$name = $object->getProperty('name')->get();
echo "LOAD $name IS NOT FOUND<br/>";
}
// UPLOAD NEW LOADS
Classes\Utils\Timer\Timer::start('LOADS_UPLOAD');
$memberLoadArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_Loads_new.xlsx',
new \Classes\Instance\Load\Member\CommonMemberLoad);
$notFoundObjects = Classes\Factory\Model\Addition\MemberLoadAddition::add($memberLoadArray);
foreach ($notFoundObjects as $object) {
$name = $object->getProperty('name')->get();
echo "LOAD $name IS NOT FOUND<br/>";
}
Classes\Utils\Timer\Timer::stop('LOADS_UPLOAD');
// UPLOAD CONSTRAINTS
Classes\Utils\Timer\Timer::start('LOAD_CONSTRAINTS');
$constraintArray = $uploadFactory->upload('./Source/Excel/TAF2_PR-205a/PR-205a_Constraint.xlsx',
new \Classes\Instance\Node\Constraint);
foreach ($constraintArray as $object) {
Classes\Factory\Model\Addition\ConstraintAddition::add($object);
}
Classes\Utils\Timer\Timer::stop('LOAD_CONSTRAINTS');
echo "<br/>";
// NUMERATION
\Classes\Utils\Member\Numeration::numerateFromOne();
\Classes\Utils\Node\Numeration::numerateFromOne();
// Print
Classes\Factory\Model\Model::servicePrint();
Classes\Utils\Timer\Timer::servicePrint();
echo '<hr />';
// WRITE C++ FILE
Classes\Factory\Export\Scad21ExportFactory::export("Model.cpp");
// WRITE JSON FILE
Classes\Factory\Export\JSONExportFactory::export("Model.json");
// WRITE BINARY FILE
Classes\Factory\Export\BinaryDataExportFactory::export("Model.bin");
} catch (Exception $e) {
echo "Exception: " . $e->getMessage() . "</br>";
}