├── 2D-TwoLayer.py ├── 2D.py ├── 3D.py ├── Automation_3D.py ├── LICENSE ├── NEW_READ_OPEN_SAVE.py ├── Plaxis_Automation.py ├── README.md ├── TwoLayer.py ├── TwoLayer_crossing.py ├── VelocityZ.txt ├── points.txt └── rsm_code_LECA_new.py /2D-TwoLayer.py: -------------------------------------------------------------------------------- 1 | from plxscripting.easy import * 2 | import math 3 | 4 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 5 | s_i.new() 6 | 7 | g_i.SoilContour.initializerectangular(0, 0, 70, 25) 8 | borehole = g_i.borehole(0) 9 | g_i.soillayer(4.5) 10 | g_i.soillayer(25) 11 | g_i.setproperties("ModelType", "Axisymmetry") 12 | 13 | 14 | material1 = g_i.soilmat() 15 | material1.setproperties( 16 | "MaterialName", "Soil1", 17 | "Colour", 15262369, 18 | "SoilModel", 1, 19 | "gammaUnsat", 20, 20 | "gammaSat", 20, 21 | "Gref", 98674, 22 | "nu", 0.3, 23 | "cref", 0, 24 | "phi", 0, 25 | "RayleighBeta", 0.0003183) 26 | 27 | material2 = g_i.soilmat() 28 | material2.setproperties( 29 | "MaterialName", "Soil2", 30 | "Colour", 15262369, 31 | "SoilModel", 1, 32 | "gammaUnsat", 20, 33 | "gammaSat", 20, 34 | "Gref", 264220, 35 | "nu", 0.3, 36 | "Einc", 10, 37 | "cref", 0, 38 | "phi", 0, 39 | "RayleighBeta", 0.0003183) 40 | 41 | material3 = g_i.soilmat() 42 | material3.setproperties( 43 | "MaterialName", "Geofoam", 44 | "Colour", 9079434, 45 | "SoilModel", 1, 46 | "gammaUnsat", 0.61, 47 | "gammaSat", 0.61, 48 | "Gref", 6807, 49 | "nu", 0.12, 50 | "cref", 0) 51 | 52 | g_i.setmaterial(g_i.Soil_1, material1) 53 | g_i.setmaterial(g_i.Soil_2, material2) 54 | 55 | 56 | g_i.gotostructures() 57 | 58 | g_i.plate((0, 0), (0.36, 0)) 59 | g_i.lineload((0, 0), (0.36, 0)) 60 | g_i.polygon((0, -15), (60, -15), (60, 0), (0, 0)) 61 | 62 | g_i.polygon((2, 0), (2.5, 0), (2.5, -4), (2, -4)) 63 | 64 | EA = 1800000 65 | EI = 1350000 66 | nu = 0.01 67 | w = 1 68 | 69 | d = math.sqrt(12 * EI / EA) 70 | E = EA / d 71 | G = E / (2 * (1 + nu)) 72 | 73 | g_i.platemat(('MaterialName', 'wall'), ('Gref', G), \ 74 | ('d', d), ('nu', nu), ('EA', EA), ('EA2', EA),\ 75 | ('EI', EI), ('w', w), ('PreventPunching', True)) 76 | 77 | g_i.Line_1.Plate.setmaterial(g_i.wall) 78 | 79 | g_i.gotomesh() 80 | 81 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.CoarsenessFactor = 0.1 82 | g_i.BoreholePolygon_1_Polygon_1_1.CoarsenessFactor = 0.3 83 | g_i.BoreholePolygon_2_Polygon_1_1.CoarsenessFactor = 0.3 84 | g_i.BoreholePolygon_2_1.CoarsenessFactor = 0.7 85 | g_i.BoreholePolygon_1.CoarsenessFactor = 0.7 86 | g_i.BoreholePolygon_1_1.CoarsenessFactor = 0.7 87 | g_i.Line_1_Line_2_1.CoarsenessFactor = 0.075 88 | 89 | 90 | g_i.mesh(0.079) 91 | 92 | g_i.gotostages() 93 | phase1 = g_i.phase(g_i.phases[0]) 94 | g_i.set(g_i.InitialPhase.DeformCalcType,"Gravity loading") 95 | g_i.Line_1_Line_2_1.activate(g_i.phase_1) 96 | 97 | phase2 = g_i.phase(g_i.phases[1]) 98 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.deactivate(g_i.phase_2) 99 | 100 | 101 | phase3 = g_i.phase(g_i.phases[2]) 102 | g_i.Soil_1_Soil_3_Soil_4_1.Material[g_i.Phase_3] = material3 103 | 104 | phase4 = g_i.phase(g_i.phases[3]) 105 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.activate(g_i.phase_4) 106 | 107 | phase5 = g_i.phase(g_i.phases[4]) 108 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 109 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.5) 110 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 111 | g_i.DynLineLoad_1_1.activate(g_i.phase_5) 112 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 113 | g_i.DynLineLoad_1_1.qy_start[g_i.Phase_5] = -26 114 | g_i.loadmultiplier() 115 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 116 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 117 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 118 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_5] = g_i.LoadMultiplier_1 119 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 120 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 121 | 122 | 123 | phase6 = g_i.phase(g_i.phases[5]) 124 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 125 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.5) 126 | g_i.DynLineLoad_1_1.activate(g_i.phase_6) 127 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 128 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 129 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 130 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_6] = g_i.LoadMultiplier_1 131 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 132 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 133 | 134 | g_i.calculate() 135 | 136 | outpu_port = g_i.view(phase6) 137 | 138 | #s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 139 | 140 | H = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (12.5, 0)) 141 | print(H) 142 | J = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (13, 0)) 143 | print(J) 144 | K = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (13.5, 0)) 145 | print(K) 146 | L = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (14, 0)) 147 | print(L) 148 | M = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (14.5, 0)) 149 | print(M) 150 | N = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (15, 0)) 151 | print(N) 152 | O = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (15.5, 0)) 153 | print(O) 154 | P = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (16, 0)) 155 | print(P) 156 | Q = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (16.5, 0)) 157 | print(Q) 158 | R = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (17, 0)) 159 | print(R) 160 | S = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (17.5, 0)) 161 | print(S) 162 | T = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (18, 0)) 163 | print(T) 164 | U = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (18.5, 0)) 165 | print(U) 166 | V = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (19, 0)) 167 | print(V) 168 | W = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (19.5, 0)) 169 | print(W) 170 | W1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (20, 0)) 171 | print(W1) 172 | ##X = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (20.5, 0)) 173 | ##print(X) 174 | Y = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (21, 0)) 175 | print(Y) 176 | Z = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (21.5, 0)) 177 | print(Z) 178 | Z1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (22, 0)) 179 | print(Z1) 180 | ##1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (22.5, 0)) 181 | ##print(A1) 182 | B1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (23, 0)) 183 | print(B1) 184 | C1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (23.5, 0)) 185 | print(C1) 186 | C11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (24, 0)) 187 | print(C11) 188 | D1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (24.5, 0)) 189 | print(D1) 190 | E1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (25, 0)) 191 | print(E1) 192 | F1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (25.5, 0)) 193 | print(F1) 194 | G1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (26, 0)) 195 | print(G1) 196 | H1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (26.5, 0)) 197 | print(H1) 198 | I1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (27, 0)) 199 | print(I1) 200 | J1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (27.5, 0)) 201 | print(J1) 202 | K1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (28, 0)) 203 | print(K1) 204 | L1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (28.5, 0)) 205 | print(L1) 206 | M1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (29, 0)) 207 | print(M1) 208 | N1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (29.5, 0)) 209 | print(N1) 210 | O1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (30, 0)) 211 | print(O1) 212 | O2 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (30.5, 0)) 213 | print(O2) 214 | O3 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (31, 0)) 215 | print(O3) 216 | O4 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (31.5, 0)) 217 | print(O4) 218 | O5 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (32, 0)) 219 | print(O5) 220 | O6 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (32.5, 0)) 221 | print(O6) 222 | O7 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (33, 0)) 223 | print(O7) 224 | O8 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (33.5, 0)) 225 | print(O8) 226 | O9 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (34, 0)) 227 | print(O9) 228 | O10 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (34.5, 0)) 229 | print(O10) 230 | O11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (35, 0)) 231 | print(O11) 232 | O23 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (35.5, 0)) 233 | print(O23) 234 | O24 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (36, 0)) 235 | print(O24) 236 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (36.5, 0)) 237 | print(O15) 238 | O17 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (37, 0)) 239 | print(O17) 240 | O16 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (37.5, 0)) 241 | print(O16) 242 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (38, 0)) 243 | print(O15) 244 | O14 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (38.5, 0)) 245 | print(O14) 246 | O13 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (39, 0)) 247 | print(O13) 248 | O12 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (39.5, 0)) 249 | print(O12) 250 | O32 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (40, 0)) 251 | print(O32) 252 | X = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (40.5, 0)) 253 | print(X) 254 | Y = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (41, 0)) 255 | print(Y) 256 | Z = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (41.5, 0)) 257 | print(Z) 258 | Z1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (42, 0)) 259 | print(Z1) 260 | A1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (42.5, 0)) 261 | print(A1) 262 | B1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (43, 0)) 263 | print(B1) 264 | C1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (43.5, 0)) 265 | print(C1) 266 | C11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (44, 0)) 267 | print(C11) 268 | D1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (44.5, 0)) 269 | print(D1) 270 | E1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (45, 0)) 271 | print(E1) 272 | F1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (45.5, 0)) 273 | print(F1) 274 | G1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (46, 0)) 275 | print(G1) 276 | H1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (46.5, 0)) 277 | print(H1) 278 | I1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (47, 0)) 279 | print(I1) 280 | J1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (47.5, 0)) 281 | print(J1) 282 | K1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (48, 0)) 283 | print(K1) 284 | L1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (48.5, 0)) 285 | print(L1) 286 | M1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (49, 0)) 287 | print(M1) 288 | N1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (49.5, 0)) 289 | print(N1) 290 | O1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (50, 0)) 291 | print(O1) 292 | O2 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (50.5, 0)) 293 | print(O2) 294 | O3 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (51, 0)) 295 | print(O3) 296 | O4 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (51.5, 0)) 297 | print(O4) 298 | O5 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (52, 0)) 299 | print(O5) 300 | O6 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (52.5, 0)) 301 | print(O6) 302 | O7 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (53, 0)) 303 | print(O7) 304 | O8= g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (53.5, 0)) 305 | print(O8) 306 | O9 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (54, 0)) 307 | print(O9) 308 | O10 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (54.5, 0)) 309 | print(O10) 310 | O11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (55, 0)) 311 | print(O11) 312 | O23 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (55.5, 0)) 313 | print(O23) 314 | O24 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (56, 0)) 315 | print(O24) 316 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (56.5, 0)) 317 | print(O15) 318 | O17 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (57, 0)) 319 | print(O17) 320 | O16 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (57.5, 0)) 321 | print(O16) 322 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (58, 0)) 323 | print(O15) 324 | O14 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (58.5, 0)) 325 | print(O14) 326 | O13 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (59, 0)) 327 | print(O13) 328 | O12 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (59.5, 0)) 329 | print(O12) 330 | O32 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (60, 0)) 331 | print(O32) 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | -------------------------------------------------------------------------------- /2D.py: -------------------------------------------------------------------------------- 1 | from plxscripting.easy import * 2 | import math 3 | 4 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 5 | s_i.new() 6 | 7 | g_i.SoilContour.initializerectangular(0, 0, 70, 25) 8 | borehole = g_i.borehole(0) 9 | g_i.soillayer(25) 10 | g_i.setproperties("ModelType", "Axisymmetry") 11 | 12 | 13 | material1 = g_i.soilmat() 14 | material1.setproperties( 15 | "MaterialName", "Soil", 16 | "Colour", 15262369, 17 | "SoilModel", 1, 18 | "gammaUnsat", 20, 19 | "gammaSat", 20, 20 | "Gref", 96150, 21 | "nu", 0.3, 22 | "cref", 0, 23 | "phi", 0, 24 | "RayleighBeta", 0.0003183) 25 | 26 | material2 = g_i.soilmat() 27 | material2.setproperties( 28 | "MaterialName", "Geofoam", 29 | "Colour", 9079434, 30 | "SoilModel", 1, 31 | "gammaUnsat", 0.61, 32 | "gammaSat", 0.61, 33 | "Gref", 6807, 34 | "nu", 0.01, 35 | "cref", 0) 36 | 37 | g_i.setmaterial(g_i.Soil_1, material1) 38 | 39 | g_i.gotostructures() 40 | 41 | g_i.plate((0, 0), (0.36, 0)) 42 | g_i.lineload((0, 0), (0.36, 0)) 43 | g_i.polygon((0, -15), (60, -15), (60, 0), (0, 0)) 44 | 45 | g_i.polygon((2, 0), (2.5, 0), (2.5, -4), (2, -4)) 46 | 47 | EA = 1800000 48 | EI = 1350000 49 | nu = 0.01 50 | w = 1 51 | 52 | d = math.sqrt(12 * EI / EA) 53 | E = EA / d 54 | G = E / (2 * (1 + nu)) 55 | 56 | g_i.platemat(('MaterialName', 'wall'), ('Gref', G), \ 57 | ('d', d), ('nu', nu), ('EA', EA), ('EA2', EA),\ 58 | ('EI', EI), ('w', w), ('PreventPunching', True)) 59 | 60 | g_i.Line_1.Plate.setmaterial(g_i.wall) 61 | 62 | g_i.gotomesh() 63 | 64 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.CoarsenessFactor = 0.1 65 | g_i.BoreholePolygon_1_Polygon_1_1.CoarsenessFactor = 0.3 66 | g_i.BoreholePolygon_1_1.CoarsenessFactor = 0.7 67 | g_i.Line_1_Line_2_1.CoarsenessFactor = 0.075 68 | 69 | 70 | g_i.mesh(0.1) 71 | 72 | g_i.gotostages() 73 | phase1 = g_i.phase(g_i.phases[0]) 74 | g_i.set(g_i.InitialPhase.DeformCalcType,"Gravity loading") 75 | g_i.Line_1_Line_2_1.activate(g_i.phase_1) 76 | 77 | phase2 = g_i.phase(g_i.phases[1]) 78 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.deactivate(g_i.phase_2) 79 | 80 | 81 | phase3 = g_i.phase(g_i.phases[2]) 82 | g_i.Soil_1_Soil_2_Soil_3_1.Material[g_i.Phase_3] = material2 83 | 84 | phase4 = g_i.phase(g_i.phases[3]) 85 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.activate(g_i.phase_4) 86 | 87 | phase5 = g_i.phase(g_i.phases[4]) 88 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 89 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.5) 90 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 91 | g_i.DynLineLoad_1_1.activate(g_i.phase_5) 92 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 93 | g_i.DynLineLoad_1_1.qy_start[g_i.Phase_5] = -26 94 | g_i.loadmultiplier() 95 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 96 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 97 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 98 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_5] = g_i.LoadMultiplier_1 99 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 100 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 101 | 102 | 103 | phase6 = g_i.phase(g_i.phases[5]) 104 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 105 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.5) 106 | g_i.DynLineLoad_1_1.activate(g_i.phase_6) 107 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 108 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 109 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 110 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_6] = g_i.LoadMultiplier_1 111 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 112 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 113 | 114 | g_i.calculate() 115 | 116 | outpu_port = g_i.view(phase6) 117 | 118 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 119 | 120 | H = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (12.5, 0)) 121 | print(H) 122 | J = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (13, 0)) 123 | print(J) 124 | K = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (13.5, 0)) 125 | print(K) 126 | L = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (14, 0)) 127 | print(L) 128 | M = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (14.5, 0)) 129 | print(M) 130 | N = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (15, 0)) 131 | print(N) 132 | O = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (15.5, 0)) 133 | print(O) 134 | P = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (16, 0)) 135 | print(P) 136 | Q = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (16.5, 0)) 137 | print(Q) 138 | R = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (17, 0)) 139 | print(R) 140 | S = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (17.5, 0)) 141 | print(S) 142 | T = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (18, 0)) 143 | print(T) 144 | U = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (18.5, 0)) 145 | print(U) 146 | V = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (19, 0)) 147 | print(V) 148 | W = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (19.5, 0)) 149 | print(W) 150 | W1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (20, 0)) 151 | print(W1) 152 | ##X = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (20.5, 0)) 153 | ##print(X) 154 | Y = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (21, 0)) 155 | print(Y) 156 | Z = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (21.5, 0)) 157 | print(Z) 158 | Z1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (22, 0)) 159 | print(Z1) 160 | ##1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (22.5, 0)) 161 | ##print(A1) 162 | B1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (23, 0)) 163 | print(B1) 164 | C1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (23.5, 0)) 165 | print(C1) 166 | C11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (24, 0)) 167 | print(C11) 168 | D1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (24.5, 0)) 169 | print(D1) 170 | E1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (25, 0)) 171 | print(E1) 172 | F1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (25.5, 0)) 173 | print(F1) 174 | G1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (26, 0)) 175 | print(G1) 176 | H1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (26.5, 0)) 177 | print(H1) 178 | I1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (27, 0)) 179 | print(I1) 180 | J1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (27.5, 0)) 181 | print(J1) 182 | K1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (28, 0)) 183 | print(K1) 184 | L1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (28.5, 0)) 185 | print(L1) 186 | M1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (29, 0)) 187 | print(M1) 188 | N1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (29.5, 0)) 189 | print(N1) 190 | O1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (30, 0)) 191 | print(O1) 192 | O2 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (30.5, 0)) 193 | print(O2) 194 | O3 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (31, 0)) 195 | print(O3) 196 | O4 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (31.5, 0)) 197 | print(O4) 198 | O5 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (32, 0)) 199 | print(O5) 200 | O6 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (32.5, 0)) 201 | print(O6) 202 | O7 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (33, 0)) 203 | print(O7) 204 | O8 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (33.5, 0)) 205 | print(O8) 206 | O9 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (34, 0)) 207 | print(O9) 208 | O10 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (34.5, 0)) 209 | print(O10) 210 | O11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (35, 0)) 211 | print(O11) 212 | O23 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (35.5, 0)) 213 | print(O23) 214 | O24 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (36, 0)) 215 | print(O24) 216 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (36.5, 0)) 217 | print(O15) 218 | O17 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (37, 0)) 219 | print(O17) 220 | O16 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (37.5, 0)) 221 | print(O16) 222 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (38, 0)) 223 | print(O15) 224 | O14 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (38.5, 0)) 225 | print(O14) 226 | O13 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (39, 0)) 227 | print(O13) 228 | O12 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (39.5, 0)) 229 | print(O12) 230 | O32 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (40, 0)) 231 | print(O32) 232 | X = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (40.5, 0)) 233 | print(X) 234 | Y = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (41, 0)) 235 | print(Y) 236 | Z = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (41.5, 0)) 237 | print(Z) 238 | Z1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (42, 0)) 239 | print(Z1) 240 | A1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (42.5, 0)) 241 | print(A1) 242 | B1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (43, 0)) 243 | print(B1) 244 | C1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (43.5, 0)) 245 | print(C1) 246 | C11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (44, 0)) 247 | print(C11) 248 | D1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (44.5, 0)) 249 | print(D1) 250 | E1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (45, 0)) 251 | print(E1) 252 | F1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (45.5, 0)) 253 | print(F1) 254 | G1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (46, 0)) 255 | print(G1) 256 | H1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (46.5, 0)) 257 | print(H1) 258 | I1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (47, 0)) 259 | print(I1) 260 | J1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (47.5, 0)) 261 | print(J1) 262 | K1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (48, 0)) 263 | print(K1) 264 | L1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (48.5, 0)) 265 | print(L1) 266 | M1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (49, 0)) 267 | print(M1) 268 | N1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (49.5, 0)) 269 | print(N1) 270 | O1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (50, 0)) 271 | print(O1) 272 | O2 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (50.5, 0)) 273 | print(O2) 274 | O3 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (51, 0)) 275 | print(O3) 276 | O4 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (51.5, 0)) 277 | print(O4) 278 | O5 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (52, 0)) 279 | print(O5) 280 | O6 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (52.5, 0)) 281 | print(O6) 282 | O7 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (53, 0)) 283 | print(O7) 284 | O8= g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (53.5, 0)) 285 | print(O8) 286 | O9 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (54, 0)) 287 | print(O9) 288 | O10 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (54.5, 0)) 289 | print(O10) 290 | O11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (55, 0)) 291 | print(O11) 292 | O23 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (55.5, 0)) 293 | print(O23) 294 | O24 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (56, 0)) 295 | print(O24) 296 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (56.5, 0)) 297 | print(O15) 298 | O17 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (57, 0)) 299 | print(O17) 300 | O16 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (57.5, 0)) 301 | print(O16) 302 | O15 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (58, 0)) 303 | print(O15) 304 | O14 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (58.5, 0)) 305 | print(O14) 306 | O13 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (59, 0)) 307 | print(O13) 308 | O12 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (59.5, 0)) 309 | print(O12) 310 | O32 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (60, 0)) 311 | print(O32) 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | -------------------------------------------------------------------------------- /3D.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | 4 | from plxscripting.easy import * 5 | 6 | input_port_i = '10000' 7 | input_port_o = '10001' 8 | input_password = 'gkiePHMehran7075'# PUT YOUR PLAXIS 3D INPUT PASSWORD HERE 9 | save_path = 'C:\Program Files (x86)\Plaxis\PLAXIS 3D' # r'C:\Plaxis\Data' # PUT THE FOLDER TO SAVE THE PLAXIS FILES HERE 10 | s_i, g_i = new_server('localhost', 10001, password='gkiePHMehran7075') 11 | s_i.new() 12 | material1 = g_i.soilmat() 13 | material1.setproperties( 14 | "MaterialName", "Soil", 15 | "Colour", 15262369, 16 | "SoilModel", 1, 17 | "gammaUnsat", 20, 18 | "gammaSat", 20, 19 | "Gref", 96150, 20 | "nu", 0.3, 21 | "cref", 0, 22 | "phi", 0, 23 | "RayleighBeta", 0.0003183) 24 | material2 = g_i.soilmat() 25 | material2.setproperties( 26 | "MaterialName", "Geofoam", 27 | "Colour", 9079434, 28 | "SoilModel", 1, 29 | "gammaUnsat", 0.61, 30 | "gammaSat", 0.61, 31 | "Gref", 6807, 32 | "nu", 0.01, 33 | "cref", 0, 34 | "phi", 0) 35 | g_i.Soilcontour.initializerectangular(0,0,40,20) 36 | borehole = g_i.borehole(0,0) 37 | g_i.soillayer(20) 38 | g_i.setmaterial(g_i.Soil_1, material1) 39 | g_i.gotostructures() 40 | g_i.plate((0, 0, 0), (0.36, 0, 0), (0.36, 0.36, 0), (0, 0.36, 0)) 41 | material3 = g_i.platemat() 42 | material3.setproperties( 43 | "MaterialName", "Plate", 44 | "Colour", 16711680, 45 | "IsIsotropic", True, 46 | "E1", 30000000, 47 | "E2", 30000000, 48 | "d", 0.1, 49 | "G12", 15000000, 50 | "G13", 15000000, 51 | "G23", 15000000) 52 | g_i.setmaterial(g_i.plate_1, material3) 53 | 54 | g_i.surface(10, 0, 0, 10.5, 0, 0, 10.5, 10, 0, 10, 10, 0, 10, 0, 0) 55 | g_i.extrude((g_i.Polygon_2), 0, 0, -3) 56 | g_i.delete(g_i.Polygon_2) 57 | g_i.setmaterial(g_i.Soil_2, material2) 58 | 59 | g_i.surfload(0, 0, 0, 0.36, 0, 0, 0.36, 0.36, 0, 0, 0.36, 0) 60 | g_i.surface(0, 0, 0, 35, 0, 0, 35, 20, 0, 0, 20, 0, 0, 0, 0) 61 | g_i.surface(0, 0, 0, 35, 0, 0, 35, 0, -15, 0, 0, -15, 0, 0, 0) 62 | 63 | g_i.gotomesh() 64 | 65 | g_i.Polygon_1_Polygon_2_Polygon_3_1.CoarsenessFactor = 0.1 66 | g_i.Polygon_3_1.CoarsenessFactor = 0.15 67 | g_i.Polygon_3_2.CoarsenessFactor = 0.2 68 | g_i.Polygon_4_1.CoarsenessFactor = 0.15 69 | g_i.Polygon_4_2.CoarsenessFactor = 0.3 70 | g_i.BoreholeVolume_1_1.CoarsenessFactor = 0.7 71 | 72 | g_i.mesh(0.15, 256) 73 | g_i.gotostages() 74 | 75 | phase1 = g_i.phase(g_i.phases[0]) 76 | g_i.Polygon_1_Polygon_2_Polygon_3_1.activate(g_i.phase_1) 77 | 78 | phase2 = g_i.phase(g_i.phases[1]) 79 | g_i.BoreholeVolume_1_Volume_1_1.deactivate(g_i.phase_2) 80 | 81 | phase3 = g_i.phase(g_i.phases[2]) 82 | g_i.Soil_1_Soil_2_1.Material[g_i.Phase_3] = material2 83 | 84 | phase4 = g_i.phase(g_i.phases[3]) 85 | g_i.Volume_1.activate(g_i.phase_4) 86 | 87 | phase5 = g_i.phase(g_i.phases[4]) 88 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 89 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.5) 90 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 91 | g_i.DynSurfaceLoad_1_1.activate(g_i.phase_5) 92 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 93 | g_i.DynSurfaceLoad_1_1.sigz[g_i.Phase_5] = -26 94 | g_i.loadmultiplier() 95 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 96 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 97 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 98 | g_i.DynSurfaceLoad_1_1.Multiplierz[g_i.Phase_5] = g_i.LoadMultiplier_1 99 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 100 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "None" 101 | g_i.Dynamics.BoundaryZMin[g_i.Phase_5] = "Viscous" 102 | 103 | phase6 = g_i.phase(g_i.phases[5]) 104 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 105 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.5) 106 | g_i.DynSurfaceLoad_1_1.activate(g_i.phase_6) 107 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 108 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 109 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 110 | g_i.DynSurfaceLoad_1_1.Multiplierz[g_i.Phase_6] = g_i.LoadMultiplier_1 111 | g_i.Dynamics.BoundaryXMin[g_i.Phase_6] = "None" 112 | g_i.Dynamics.BoundaryYMin[g_i.Phase_6] = "None" 113 | g_i.Dynamics.BoundaryZMin[g_i.Phase_6] = "Viscous" 114 | 115 | g_i.calculate() 116 | 117 | outpu_port = g_i.view(phase6) 118 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 119 | 120 | A= g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (8.5, 0, 0)) 121 | print(A) 122 | B = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (9, 0, 0)) 123 | print(B) 124 | C = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (9.5, 0, 0)) 125 | print(C) 126 | D = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (10, 0, 0)) 127 | print(D) 128 | E = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (10.5, 0, 0)) 129 | print(E) 130 | F = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (11, 0, 0)) 131 | print(F) 132 | G = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (11.5, 0, 0)) 133 | print(G) 134 | H11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (12, 0, 0)) 135 | print(H11) 136 | ##H = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (12.5, 0, 0)) 137 | ##print(H) 138 | J = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (13, 0, 0)) 139 | print(J) 140 | K = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (13.5, 0, 0)) 141 | print(K) 142 | L = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (14, 0, 0)) 143 | print(L) 144 | M = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (14.5, 0, 0)) 145 | print(M) 146 | N = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (15, 0, 0)) 147 | print(N) 148 | O = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (15.5, 0, 0)) 149 | print(O) 150 | P = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (16, 0, 0)) 151 | print(P) 152 | Q = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (16.5, 0, 0)) 153 | print(Q) 154 | R = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (17, 0, 0)) 155 | print(R) 156 | S = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (17.5, 0, 0)) 157 | print(S) 158 | T = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (18, 0, 0)) 159 | print(T) 160 | U = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (18.5, 0, 0)) 161 | print(U) 162 | V = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (19, 0, 0)) 163 | print(V) 164 | W = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (19.5, 0, 0)) 165 | print(W) 166 | W1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (20, 0, 0)) 167 | print(W1) 168 | X = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (20.5, 0, 0)) 169 | print(X) 170 | Y = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (21, 0, 0)) 171 | print(Y) 172 | Z = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (21.5, 0, 0)) 173 | print(Z) 174 | Z1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (22, 0, 0)) 175 | print(Z1) 176 | A1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (22.5, 0, 0)) 177 | print(A1) 178 | B1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (23, 0, 0)) 179 | print(B1) 180 | C1 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (23.5, 0, 0)) 181 | print(C1) 182 | C11 = g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (24, 0, 0)) 183 | print(C11) 184 | 185 | -------------------------------------------------------------------------------- /Automation_3D.py: -------------------------------------------------------------------------------- 1 | import math 2 | import numpy 3 | import statistics 4 | from plxscripting.easy import * 5 | 6 | input_port_i = '10000' 7 | input_port_o = '10001' 8 | input_password = 'gkiePHMehran7075'# PUT YOUR PLAXIS 3D INPUT PASSWORD HERE 9 | save_path = 'C:\Program Files (x86)\Plaxis\PLAXIS 3D' # r'C:\Plaxis\Data' # PUT THE FOLDER TO SAVE THE PLAXIS FILES HERE 10 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 11 | 12 | 13 | def Calculator(wx, width, depth, length, Dist, s_i, g_i, type): 14 | s_i.new() 15 | material1 = g_i.soilmat() 16 | material1.setproperties( 17 | "MaterialName", "Soil", 18 | "Colour", 15262369, 19 | "SoilModel", 1, 20 | "gammaUnsat", 20, 21 | "gammaSat", 20, 22 | "Gref", 96150, 23 | "nu", 0.3, 24 | "cref", 0, 25 | "phi", 0, 26 | "RayleighBeta", 0.0003183) 27 | material2 = g_i.soilmat() 28 | material2.setproperties( 29 | "MaterialName", "Geofoam", 30 | "Colour", 9079434, 31 | "SoilModel", 1, 32 | "gammaUnsat", 0.61, 33 | "gammaSat", 0.61, 34 | "Gref", 6807, 35 | "nu", 0.01, 36 | "cref", 0, 37 | "phi", 0) 38 | g_i.Soilcontour.initializerectangular(0,0,40,20) 39 | borehole = g_i.borehole(0, 0) 40 | g_i.soillayer(20) 41 | g_i.setmaterial(g_i.Soil_1, material1) 42 | g_i.gotostructures() 43 | g_i.plate((0, 0, 0), (0.36, 0, 0), (0.36, 0.36, 0), (0, 0.36, 0)) 44 | material3 = g_i.platemat() 45 | material3.setproperties( 46 | "MaterialName", "Plate", 47 | "Colour", 16711680, 48 | "IsIsotropic", True, 49 | "E1", 30000000, 50 | "E2", 30000000, 51 | "d", 0.1, 52 | "G12", 15000000, 53 | "G13", 15000000, 54 | "G23", 15000000) 55 | g_i.setmaterial(g_i.plate_1, material3) 56 | 57 | ''' g_i.surface(10, 0, 0, 10.5, 0, 0, 10.5, 10, 0, 10, 10, 0, 10, 0, 0) 58 | g_i.extrude((g_i.Polygon_2), 0, 0, -3) 59 | g_i.delete(g_i.Polygon_2) 60 | g_i.setmaterial(g_i.Soil_2, material2)''' 61 | 62 | 63 | if (type == 1): #(Function for single wall system) 64 | g_i.surface(wx-width/2, 0, 0, wx+width/2, 0, 0, wx+width/2, length, 0, wx-width/2, length, 0, wx-width/2, 0, 0) 65 | g_i.extrude((g_i.Polygon_2), 0, 0, 0-depth) 66 | g_i.delete(g_i.Polygon_2) 67 | g_i.setmaterial(g_i.Soil_2, material2) 68 | elif (type == 2): # (Function for Double Wall system) 69 | g_i.surface(wx-Dist-width/2, 0, 0, wx-Dist+width/2, 0, 0, wx-Dist+width/2, length, 0, wx-Dist-width/2, length, 0, wx-Dist-width/2, 0, 0) 70 | g_i.extrude((g_i.Polygon_2), 0, 0, 0-depth) 71 | g_i.delete(g_i.Polygon_2) 72 | g_i.setmaterial(g_i.Soil_2, material2) 73 | 74 | g_i.surface(wx+Dist-width/2, 0, 0, wx+Dist+width/2, 0, 0, wx+Dist+width/2, length, 0, wx+Dist-width/2, length, 0, wx+Dist-width/2, 0, 0) 75 | g_i.extrude((g_i.Polygon_2), 0, 0, 0-depth) 76 | g_i.delete(g_i.Polygon_2) 77 | g_i.setmaterial(g_i.Soil_3, material2) 78 | elif (type == 3):# (Function for Triangle wall System) 79 | g_i.surface(wx-width, 0, 0, wx+width, 0, 0, wx, 0, 0-depth) 80 | g_i.delete(g_i.Polygon_2) 81 | g_i.setmaterial(g_i.Soil_2, material2) 82 | 83 | g_i.surfload(0, 0, 0, 0.36, 0, 0, 0.36, 0.36, 0, 0, 0.36, 0) 84 | g_i.surface(0, 0, 0, 35, 0, 0, 35, 20, 0, 0, 20, 0, 0, 0, 0) 85 | g_i.surface(0, 0, 0, 35, 0, 0, 35, 0, -15, 0, 0, -15, 0, 0, 0) 86 | 87 | g_i.gotomesh() 88 | 89 | g_i.Polygon_1_Polygon_2_Polygon_3_1.CoarsenessFactor = 0.1 90 | g_i.Polygon_3_1.CoarsenessFactor = 0.15 91 | g_i.Polygon_3_2.CoarsenessFactor = 0.2 92 | g_i.Polygon_4_1.CoarsenessFactor = 0.15 93 | g_i.Polygon_4_2.CoarsenessFactor = 0.3 94 | g_i.BoreholeVolume_1_1.CoarsenessFactor = 0.7 95 | 96 | g_i.mesh(3.15, 256) 97 | g_i.gotostages() 98 | 99 | phase1 = g_i.phase(g_i.phases[0]) 100 | g_i.Polygon_1_Polygon_2_Polygon_3_1.activate(g_i.phase_1) 101 | 102 | phase2 = g_i.phase(g_i.phases[1]) 103 | g_i.BoreholeVolume_1_Volume_1_1.deactivate(g_i.phase_2) 104 | 105 | phase3 = g_i.phase(g_i.phases[2]) 106 | g_i.Soil_1_Soil_2_1.Material[g_i.Phase_3] = material2 107 | 108 | phase4 = g_i.phase(g_i.phases[3]) 109 | g_i.Volume_1.activate(g_i.phase_4) 110 | 111 | phase5 = g_i.phase(g_i.phases[4]) 112 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 113 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.0005) 114 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 115 | g_i.DynSurfaceLoad_1_1.activate(g_i.phase_5) 116 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 117 | g_i.DynSurfaceLoad_1_1.sigz[g_i.Phase_5] = -26 118 | g_i.loadmultiplier() 119 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 120 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 121 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 122 | g_i.DynSurfaceLoad_1_1.Multiplierz[g_i.Phase_5] = g_i.LoadMultiplier_1 123 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 124 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "None" 125 | g_i.Dynamics.BoundaryZMin[g_i.Phase_5] = "Viscous" 126 | 127 | phase6 = g_i.phase(g_i.phases[5]) 128 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 129 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.005) 130 | g_i.DynSurfaceLoad_1_1.activate(g_i.phase_6) 131 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 132 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 133 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 134 | g_i.DynSurfaceLoad_1_1.Multiplierz[g_i.Phase_6] = g_i.LoadMultiplier_1 135 | g_i.Dynamics.BoundaryXMin[g_i.Phase_6] = "None" 136 | g_i.Dynamics.BoundaryYMin[g_i.Phase_6] = "None" 137 | g_i.Dynamics.BoundaryZMin[g_i.Phase_6] = "Viscous" 138 | 139 | g_i.calculate() 140 | 141 | outpu_port = g_i.view(phase6) 142 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 143 | 144 | f1 = open("points.txt", "r") 145 | if f1.mode == "r": 146 | xloc = list(map(float, f1.read().split())) 147 | else: 148 | print("can't read 'points.txt' file") 149 | f1.close() 150 | 151 | f2 = open("VelocityZ.txt", "r") 152 | if f2.mode == "r": 153 | Vz = list(map(float, f2.read().split())) 154 | else: 155 | print("can't read 'Velocity.txt' file") 156 | f2.close() 157 | 158 | thresh = wx + width / 2 159 | value = [] 160 | Temp = 0 161 | Npoints = len(xloc) 162 | for k in range(0, Npoints): 163 | if (xloc[k] > thresh) and (xloc[k] < (thresh + 30)): 164 | vz = abs(float(g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vz, (xloc[k], 0, 0)))) 165 | value.append(vz / Vz[k]) 166 | #if (vy / Vy[k]<8): 167 | Temp += vz / Vz[k] 168 | 169 | Efficiency = statistics.mean(value) 170 | g_o.close() 171 | return Efficiency 172 | 173 | 174 | 175 | #Calculator(wx, width, length, depth, Dist, s_i, g_i, type): 176 | 177 | Wx = [3, 6] #Location of the trench 178 | De = [2, 3] #Depth of the trench 179 | Le = [5, 20] #Length of the trench 180 | Wi = [0.3, 0.5] #Width of the trench 181 | Dist= [2, 2.5] #Distance between the wall 182 | 183 | List =[] 184 | Iter = 1 185 | type = 1 186 | for i in (Wx): 187 | for j in (Wi): 188 | for k in (De): 189 | for l in (Le): 190 | if type == 1 : 191 | Out = Calculator(i, j, k, l, 1, s_i, g_i, type) 192 | List.append([i, j, k, l, Out]) 193 | continue 194 | for m in (Dist): 195 | Out = Calculator(i, j, k, l, m, s_i, g_i, type) 196 | List.append([i, j, k, l, m, Out]) 197 | 198 | 199 | a = numpy.asarray(List) 200 | if type == 1: 201 | numpy.savetxt("Single_Efficiency.csv", a, delimiter=",") 202 | elif type == 2: 203 | numpy.savetxt("Two_Wall_Efficiency.csv", a, delimiter=",") 204 | elif type == 3: 205 | numpy.savetxt("Triangle_Wall_Efficiency.csv", a, delimiter=",") 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Chair of Geotechnical Engineering and Institute of Geomechanics and Underground Technology 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NEW_READ_OPEN_SAVE.py: -------------------------------------------------------------------------------- 1 | from plxscripting.easy import * 2 | import math 3 | import numpy 4 | 5 | 6 | 7 | def Calculator (ADR): 8 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 9 | # s_i.new() 10 | s_i.open(ADR) 11 | #s_o.open(ADR) 12 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 13 | s_o.open(ADR) 14 | outpu_port = g_o.view(phase6) 15 | 16 | f1 = open("points.txt", "r") 17 | if f1.mode == "r": 18 | xloc = list(map(float, f1.read().split())) 19 | else: 20 | print("can't read 'points.txt' file") 21 | f1.close() 22 | 23 | f2 = open("VelocityY.txt", "r") 24 | if f2.mode == "r": 25 | Vy = list(map(float, f2.read().split())) 26 | else: 27 | print("can't read 'Velocity.txt' file") 28 | f2.close() 29 | 30 | thresh = Wx + Wi / 2 31 | value = [] 32 | Temp = 0 33 | Npoints = len(xloc) 34 | for k in range(0, Npoints): 35 | if (xloc[k] > thresh) and (xloc[k] < (thresh + 30)): 36 | vy = abs(float(g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (xloc[k], 0)))) 37 | value.append(vy / Vy[k]) 38 | Temp += vy / Vy[k] 39 | 40 | Efficiency = Temp / k 41 | #g_o.close() 42 | return Efficiency 43 | 44 | 45 | Wx = [3, 6, 9, 12, 15] 46 | De = [2, 3, 4, 5, 6, 7] 47 | Wi = [0.3, 0.5, 0.7, 1, 1.5] 48 | 49 | List =[] 50 | Iter = 1 51 | for i in (Wx): 52 | for j in (Wi): 53 | for k in (De): 54 | ADDR = str(r'D:/Benutzer/Naghizadehrokni/Chapter Three, Numerical Study/Parametric Study, Layer 1, 2m/Done/EPS 12, Vs 200/') 55 | ADDR = ADDR + str(Iter) + ".P2dx" 56 | print(ADDR) 57 | Iter = Iter + 1 58 | Out = Calculator(ADDR) 59 | Out = i * j * k 60 | List.append([i, k, j, Out]) 61 | 62 | 63 | a = numpy.asarray(List) 64 | numpy.savetxt("Final_List_of_Efficiency.csv", a, delimiter=",") 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Plaxis_Automation.py: -------------------------------------------------------------------------------- 1 | import math 2 | import numpy 3 | import statistics 4 | from plxscripting.easy import * 5 | import TwoLayer_crossing 6 | import TwoLayer 7 | 8 | input_port_i = '10000' 9 | input_port_o = '10001' 10 | input_password = 'gkiePHMehran7075'# PUT YOUR PLAXIS 3D INPUT PASSWORD HERE 11 | save_path = 'C:\Program Files (x86)\Plaxis\PLAXIS 3D' # r'C:\Plaxis\Data' # PUT THE FOLDER TO SAVE THE PLAXIS FILES HERE 12 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 13 | 14 | f1 = open("points.txt", "r") 15 | if f1.mode == "r": 16 | xloc = list(map(float, f1.read().split())) 17 | else: 18 | print("can't read 'points.txt' file") 19 | f1.close() 20 | 21 | f2 = open("VelocityY.txt", "r") 22 | if f2.mode == "r": 23 | Vy = list(map(float, f2.read().split())) 24 | else: 25 | print("can't read 'Velocity.txt' file") 26 | f2.close() 27 | 28 | 29 | #VAR Name : X, Width, Depth, first layer depth (line_9), Gref (Line 21), Geofoam (Line 41) 30 | 31 | 32 | def Calculator(Vector, s_i, g_i,xloc, Vy): 33 | #Vector=[x, d, l, w, gr, Ep] 34 | D = Vector[1] 35 | L = Vector[2] 36 | if D>L: 37 | Out = TwoLayer_crossing.Calculation(Vector, s_i, g_i, xloc, Vy) 38 | else: 39 | Out = TwoLayer.Calculation(Vector, s_i, g_i, xloc, Vy) 40 | return Out 41 | 42 | X = [1.4, 4.2, 7.6, 10.5, 13.8] 43 | D = [2.6, 3.5, 4.7, 5.3, 6.8, 7.5] 44 | L = [1.5, 3.3, 5.2, 8.7] 45 | W = [0.2] 46 | Gref = [105756] 47 | Eps = [12] 48 | List =[] 49 | Iter = 1 50 | f=open('Efficiency_In_Process.csv', 'wb') 51 | for x in (X): 52 | for d in (D): 53 | for l in (L): 54 | for w in (W): 55 | for gr in (Gref): 56 | for Ep in range(0, len(Eps)): 57 | Vector = [x, d, l, w, gr, Ep+1] 58 | Out = Calculator(Vector, s_i, g_i, xloc, Vy) 59 | # Out=x+d+l+w+gr+Ep 60 | Vector1 = [[x, d, l, w, gr, Eps[Ep], Out]] 61 | Vector = [x, d, l, w, gr, Eps[Ep], Out] 62 | List.append(Vector) 63 | a = numpy.asarray(Vector1) 64 | print(a) 65 | print(Vector1) 66 | numpy.savetxt(f, a, fmt='%1.6e', delimiter=",") 67 | Iter = Iter + 1 68 | print(Iter) 69 | 70 | a = numpy.asarray(List) 71 | print("best value obtained with X = {0:3.2f}, W = {1:3.2f}, D = {2:3.2f}, L = {3:3.2f}, Gref = {4:3.2f} and , Geofoam.".format( 72 | x, d, l, w, gr, 73 | ), Eps[Ep]) 74 | numpy.savetxt("Efficiency2.csv", a, fmt='%1.6e', delimiter=",") 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plaxis-Python-Automation-Code 2 | -------------------------------------------------------------------------------- /TwoLayer.py: -------------------------------------------------------------------------------- 1 | from plxscripting.easy import * 2 | import math 3 | import statistics 4 | 5 | def Calculation(gene, s_i, g_i, xloc, Vy): 6 | # Read Gene Data 7 | X = gene[0] #Location of the trench 8 | D = gene[1] #Depth of the trench 9 | L = gene[2] #Thickness of the first layer 10 | W = gene[3] #Width of the trench 11 | Gref = gene[4] #Shear modulud of the first layer 12 | GeoFoam =math.ceil(gene[5]) #Type of geofoam 13 | 14 | # Config the Plaxis 15 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 16 | s_i.new() 17 | 18 | g_i.SoilContour.initializerectangular(0, 0, 70, 25) 19 | borehole = g_i.borehole(0) 20 | g_i.soillayer(L) 21 | g_i.soillayer(25) 22 | g_i.setproperties("ModelType", "Axisymmetry") 23 | 24 | material1 = g_i.soilmat() 25 | material1.setproperties( 26 | "MaterialName", "Soil1", 27 | "Colour", 1887942, 28 | "SoilModel", 1, 29 | "gammaUnsat", 20, 30 | "gammaSat", 20, 31 | "Gref", Gref, 32 | "nu", 0.3, 33 | "cref", 0, 34 | "phi", 0, 35 | "RayleighBeta", 0.0003183) 36 | 37 | material2 = g_i.soilmat() 38 | material2.setproperties( 39 | "MaterialName", "Soil2", 40 | "Colour", 15262369, 41 | "SoilModel", 1, 42 | "gammaUnsat", 20, 43 | "gammaSat", 20, 44 | "Gref", 326198, 45 | "nu", 0.3, 46 | "cref", 0, 47 | "phi", 0, 48 | "RayleighBeta", 0.0003183) 49 | 50 | 51 | if GeoFoam == 1: # 52 | A = 0.15 53 | B = 1300 54 | elif GeoFoam == 2: 55 | A = 0.15 56 | B = 1300 57 | elif GeoFoam == 3: 58 | A = 0.15 59 | B = 1300 60 | elif GeoFoam == 4: 61 | A = 0.15 62 | B = 1300 63 | elif GeoFoam == 5: 64 | A = 0.15 65 | B = 1300 66 | elif GeoFoam == 6: 67 | A = 0.15 68 | B = 1300 69 | 70 | 71 | 72 | material3 = g_i.soilmat() 73 | material3.setproperties( 74 | "MaterialName", "Geofoam", 75 | "Colour", 9079434, 76 | "SoilModel", 1, 77 | "gammaUnsat", A, 78 | "gammaSat", A, 79 | "Gref", B, 80 | "nu", 0.1, 81 | "cref", 0) 82 | 83 | 84 | 85 | g_i.setmaterial(g_i.Soil_1, material1) 86 | g_i.setmaterial(g_i.Soil_2, material2) 87 | 88 | 89 | g_i.gotostructures() 90 | 91 | g_i.plate((0, 0), (0.36, 0)) 92 | g_i.lineload((0, 0), (0.36, 0)) 93 | g_i.polygon((0, -15), (60, -15), (60, 0), (0, 0)) 94 | 95 | g_i.polygon((X-W/2, 0), (X+W/2, 0), (X+W/2, 0-D), (X-W/2, 0-D)) 96 | 97 | EA = 1800000 98 | EI = 1350000 99 | nu = 0.01 100 | w = 1 101 | 102 | d = math.sqrt(12 * EI / EA) 103 | E = EA / d 104 | G = E / (2 * (1 + nu)) 105 | 106 | g_i.platemat(('MaterialName', 'wall'), ('Gref', G), \ 107 | ('d', d), ('nu', nu), ('EA', EA), ('EA2', EA),\ 108 | ('EI', EI), ('w', w), ('PreventPunching', True)) 109 | 110 | g_i.Line_1.Plate.setmaterial(g_i.wall) 111 | 112 | g_i.gotomesh() 113 | 114 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.CoarsenessFactor = 0.1 115 | g_i.BoreholePolygon_1_Polygon_1_1.CoarsenessFactor = 0.3 116 | g_i.BoreholePolygon_2_Polygon_1_1.CoarsenessFactor = 0.3 117 | g_i.BoreholePolygon_2_1.CoarsenessFactor = 0.7 118 | g_i.BoreholePolygon_1.CoarsenessFactor = 0.7 119 | g_i.BoreholePolygon_1_1.CoarsenessFactor = 0.7 120 | g_i.Line_1_Line_2_1.CoarsenessFactor = 0.075 121 | 122 | 123 | g_i.mesh(0.05) 124 | 125 | g_i.gotostages() 126 | phase1 = g_i.phase(g_i.phases[0]) 127 | g_i.set(g_i.InitialPhase.DeformCalcType,"Gravity loading") 128 | g_i.Line_1_Line_2_1.activate(g_i.phase_1) 129 | 130 | phase2 = g_i.phase(g_i.phases[1]) 131 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.deactivate(g_i.phase_2) 132 | 133 | 134 | phase3 = g_i.phase(g_i.phases[2]) 135 | g_i.Soil_1_Soil_3_Soil_4_1.Material[g_i.Phase_3] = material3 136 | 137 | phase4 = g_i.phase(g_i.phases[3]) 138 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.activate(g_i.phase_4) 139 | 140 | phase5 = g_i.phase(g_i.phases[4]) 141 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 142 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.5) 143 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 144 | g_i.DynLineLoad_1_1.activate(g_i.phase_5) 145 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 146 | g_i.DynLineLoad_1_1.qy_start[g_i.Phase_5] = -26 147 | g_i.loadmultiplier() 148 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 149 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 150 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 151 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_5] = g_i.LoadMultiplier_1 152 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 153 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 154 | 155 | 156 | phase6 = g_i.phase(g_i.phases[5]) 157 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 158 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.5) 159 | g_i.DynLineLoad_1_1.activate(g_i.phase_6) 160 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 161 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 162 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 163 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_6] = g_i.LoadMultiplier_1 164 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 165 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 166 | 167 | g_i.calculate() 168 | 169 | outpu_port = g_i.view(phase6) 170 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 171 | Npoints = len(xloc) 172 | thresh = X + W / 2 173 | value = [] 174 | for k in range(0, Npoints): 175 | if (xloc[k]>thresh) and (xloc[k]<(thresh+30)): 176 | vy = abs(float(g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (xloc[k], 0)))) 177 | value.append(vy/Vy[k]) 178 | 179 | g_o.close() 180 | Ar = statistics.mean(value) 181 | return Ar 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /TwoLayer_crossing.py: -------------------------------------------------------------------------------- 1 | from plxscripting.easy import * 2 | import math 3 | import statistics 4 | 5 | def Calculation(gene, s_i, g_i, xloc, Vy): 6 | # Read Gene Data 7 | #gene=[x, d, l, w, gr, Ep] 8 | X = gene[0] #Location of the trench 9 | D = gene[1] #Depth of the trench 10 | L = gene[2] #Thickness of the first layer 11 | W = gene[3] #Width of the trench 12 | Gref = gene[4] #Shear modulud of the first layer 13 | GeoFoam =math.ceil(gene[5]) #Type of geofoam 14 | 15 | # Config the Plaxis 16 | s_i, g_i = new_server('localhost', 10000, password='gkiePHMehran7075') 17 | s_i.new() 18 | 19 | g_i.SoilContour.initializerectangular(0, 0, 70, 25) 20 | borehole = g_i.borehole(0) 21 | g_i.soillayer(L) 22 | g_i.soillayer(25) 23 | g_i.setproperties("ModelType", "Axisymmetry") 24 | 25 | material1 = g_i.soilmat() 26 | material1.setproperties( 27 | "MaterialName", "Soil1", 28 | "Colour", 1887942, 29 | "SoilModel", 1, 30 | "gammaUnsat", 20, 31 | "gammaSat", 20, 32 | "Gref", Gref, 33 | "nu", 0.3, 34 | "cref", 0, 35 | "phi", 0, 36 | "RayleighBeta", 0.0003183) 37 | 38 | material2 = g_i.soilmat() 39 | material2.setproperties( 40 | "MaterialName", "Soil2", 41 | "Colour", 15262369, 42 | "SoilModel", 1, 43 | "gammaUnsat", 20, 44 | "gammaSat", 20, 45 | "Gref", 326198, 46 | "nu", 0.3, 47 | "cref", 0, 48 | "phi", 0, 49 | "RayleighBeta", 0.0003183) 50 | 51 | if GeoFoam == 1: # 52 | A = 0.112 53 | B = 669.6 54 | elif GeoFoam == 2: 55 | A = 0.114 56 | B = 1116 57 | elif GeoFoam == 3: 58 | A = 0.184 59 | B = 1785 60 | elif GeoFoam == 4: 61 | A = 0.216 62 | B = 2232 63 | elif GeoFoam == 5: 64 | A = 0.288 65 | B = 3348 66 | elif GeoFoam == 6: 67 | A = 0.384 68 | B = 4595 69 | 70 | 71 | material3 = g_i.soilmat() 72 | material3.setproperties( 73 | "MaterialName", "Geofoam", 74 | "Colour", 9079434, 75 | "SoilModel", 1, 76 | "gammaUnsat", A, 77 | "gammaSat", A, 78 | "Gref", B, 79 | "nu", 0.1, 80 | "cref", 0) 81 | 82 | g_i.setmaterial(g_i.Soil_1, material1) 83 | g_i.setmaterial(g_i.Soil_2, material2) 84 | 85 | 86 | g_i.gotostructures() 87 | 88 | g_i.plate((0, 0), (0.36, 0)) 89 | g_i.lineload((0, 0), (0.36, 0)) 90 | g_i.polygon((0, -15), (60, -15), (60, 0), (0, 0)) 91 | 92 | g_i.polygon((X-W/2, 0), (X+W/2, 0), (X+W/2, 0-D), (X-W/2, 0-D)) 93 | 94 | EA = 1800000 95 | EI = 1350000 96 | nu = 0.01 97 | w = 1 98 | 99 | d = math.sqrt(12 * EI / EA) 100 | E = EA / d 101 | G = E / (2 * (1 + nu)) 102 | 103 | g_i.platemat(('MaterialName', 'wall'), ('Gref', G), \ 104 | ('d', d), ('nu', nu), ('EA', EA), ('EA2', EA),\ 105 | ('EI', EI), ('w', w), ('PreventPunching', True)) 106 | 107 | g_i.Line_1.Plate.setmaterial(g_i.wall) 108 | 109 | g_i.gotomesh() 110 | 111 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.CoarsenessFactor.CoarsenessFactor = 0.1 112 | g_i.BoreholePolygon_2_Polygon_1_Polygon_2_1.CoarsenessFactor = 0.1 113 | g_i.BoreholePolygon_1_Polygon_1_1.CoarsenessFactor = 0.3 114 | g_i.BoreholePolygon_2_Polygon_1_1.CoarsenessFactor = 0.3 115 | g_i.BoreholePolygon_2_1.CoarsenessFactor = 0.7 116 | g_i.BoreholePolygon_1.CoarsenessFactor = 0.7 117 | g_i.BoreholePolygon_1_1.CoarsenessFactor = 0.7 118 | g_i.Line_1_Line_2_1.CoarsenessFactor = 0.075 119 | 120 | 121 | g_i.mesh(0.05) 122 | 123 | g_i.gotostages() 124 | phase1 = g_i.phase(g_i.phases[0]) 125 | g_i.set(g_i.InitialPhase.DeformCalcType,"Gravity loading") 126 | g_i.Line_1_Line_2_1.activate(g_i.phase_1) 127 | 128 | phase2 = g_i.phase(g_i.phases[1]) 129 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.deactivate(g_i.phase_2) 130 | g_i.BoreholePolygon_2_Polygon_1_Polygon_2_1.deactivate(g_i.phase_2) 131 | 132 | phase3 = g_i.phase(g_i.phases[2]) 133 | g_i.Soil_1_Soil_3_Soil_4_1.Material[g_i.Phase_3] = material3 134 | g_i.Soil_2_Soil_3_Soil_4_1.Material[g_i.Phase_3] = material3 135 | 136 | phase4 = g_i.phase(g_i.phases[3]) 137 | g_i.BoreholePolygon_1_Polygon_1_Polygon_2_1.activate(g_i.phase_4) 138 | g_i.BoreholePolygon_2_Polygon_1_Polygon_2_1.activate(g_i.phase_4) 139 | 140 | phase5 = g_i.phase(g_i.phases[4]) 141 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 142 | g_i.set(g_i.Phase_5.Deform.TimeIntervalSeconds, 0.5) 143 | g_i.set(g_i.Phase_5.Deform.ResetDisplacementsToZero, True) 144 | g_i.DynLineLoad_1_1.activate(g_i.phase_5) 145 | g_i.set(g_i.phase_5.DeformCalcType,"Dynamic") 146 | g_i.DynLineLoad_1_1.qy_start[g_i.Phase_5] = -26 147 | g_i.loadmultiplier() 148 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 149 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 150 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 151 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_5] = g_i.LoadMultiplier_1 152 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 153 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 154 | 155 | 156 | phase6 = g_i.phase(g_i.phases[5]) 157 | g_i.set(g_i.phase_6.DeformCalcType,"Dynamic") 158 | g_i.set(g_i.Phase_6.Deform.TimeIntervalSeconds, 0.5) 159 | g_i.DynLineLoad_1_1.activate(g_i.phase_6) 160 | g_i.set(g_i.LoadMultiplier_1.Signal, "Harmonic") 161 | g_i.set(g_i.LoadMultiplier_1.Amplitude, 1) 162 | g_i.set(g_i.LoadMultiplier_1.Frequency, 50) 163 | g_i.DynLineLoad_1_1.Multipliery[g_i.Phase_6] = g_i.LoadMultiplier_1 164 | g_i.Dynamics.BoundaryXMin[g_i.Phase_5] = "None" 165 | g_i.Dynamics.BoundaryYMin[g_i.Phase_5] = "Viscous" 166 | 167 | 168 | g_i.calculate() 169 | 170 | outpu_port = g_i.view(phase6) 171 | s_o, g_o = new_server('localhost', 10001, password='gkiePHMehran7075') 172 | Npoints = len(xloc) 173 | thresh = X + W / 2 174 | value = [] 175 | for k in range(0, Npoints): 176 | if (xloc[k]>thresh) and (xloc[k]<(thresh+30)): 177 | vy = abs(float(g_o.getsingleresult(g_o.Phase_6, g_o.ResultTypes.Soil.Vy, (xloc[k], 0)))) 178 | value.append(vy/Vy[k]) 179 | 180 | g_o.close() 181 | Ar = statistics.mean(value) 182 | return Ar 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /VelocityZ.txt: -------------------------------------------------------------------------------- 1 | 0.00187658600000000 2 | 0.000625995000000000 3 | 0.000729742000000000 4 | 0.00126884000000000 5 | 0.000988268000000000 6 | 0.000233051000000000 7 | 0.000468261000000000 8 | 0.000734403000000000 9 | 0.000499868000000000 10 | 0.000428605000000000 11 | 0.000548072000000000 12 | 0.000304691000000000 13 | 9.57000000000000e-05 14 | 0.000416938000000000 15 | 0.000460640000000000 16 | 0.000245648000000000 17 | 8.47000000000000e-05 18 | 0.000370295000000000 19 | 0.000410139000000000 20 | 0.000249268000000000 21 | 0.000226483000000000 22 | 0.000253992000000000 23 | 0.000137059000000000 24 | 4.48000000000000e-05 25 | 0.000193213000000000 26 | 0.000208221000000000 27 | 0.000114955000000000 28 | 3.67000000000000e-05 29 | 0.000140893000000000 30 | 0.000153120000000000 31 | 7.29000000000000e-05 32 | 4.70000000000000e-05 33 | 0.000131194000000000 34 | 0.000137482000000000 35 | 6.54000000000000e-05 36 | 3.01000000000000e-05 37 | 9.21000000000000e-05 38 | 9.49000000000000e-05 39 | 3.92000000000000e-05 40 | 3.40000000000000e-05 41 | 8.18000000000000e-05 42 | 8.39000000000000e-05 43 | 2.71000000000000e-05 44 | 3.30000000000000e-05 45 | 7.58000000000000e-05 46 | 6.37000000000000e-05 47 | 2.20000000000000e-05 48 | 2.99000000000000e-05 49 | 5.84000000000000e-05 50 | 5.25000000000000e-05 51 | 1.28000000000000e-05 52 | 3.37000000000000e-05 53 | 5.54000000000000e-05 54 | 5.22000000000000e-05 55 | 2.01000000000000e-05 -------------------------------------------------------------------------------- /points.txt: -------------------------------------------------------------------------------- 1 | 2.10000000000000 2 | 2.50000000000000 3 | 3 4 | 3.50000000000000 5 | 4 6 | 4.50000000000000 7 | 5 8 | 5.50000000000000 9 | 6 10 | 7 11 | 7.50000000000000 12 | 8 13 | 8.50000000000000 14 | 9 15 | 9.50000000000000 16 | 10 17 | 10.5000000000000 18 | 11 19 | 11.5000000000000 20 | 12 21 | 13 22 | 13.5000000000000 23 | 14 24 | 14.5000000000000 25 | 15 26 | 15.5000000000000 27 | 16 28 | 16.5000000000000 29 | 17 30 | 17.5000000000000 31 | 18 32 | 18.5000000000000 33 | 19 34 | 19.5000000000000 35 | 20 36 | 20.5000000000000 37 | 21 38 | 21.5000000000000 39 | 22 40 | 22.5000000000000 41 | 23 42 | 23.5000000000000 43 | 24 44 | 24.5000000000000 45 | 25 46 | 25.5000000000000 47 | 26 48 | 26.5000000000000 49 | 27 50 | 27.5000000000000 51 | 28 52 | 28.5000000000000 53 | 29 54 | 29.5000000000000 55 | 30 -------------------------------------------------------------------------------- /rsm_code_LECA_new.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # In[8]: 5 | 6 | 7 | import os 8 | from plxscripting.easy import * 9 | #for python server setup 10 | s_i, g_i = new_server('localhost', 10000, password='KnaT?M=cLV7~S83=') 11 | s_o, g_o = new_server('localhost', 10001, password='KnaT?M=cLV7~S83=') 12 | def runProcess(n,i,j,k,l,m,o): 13 | int(n) 14 | float(i) 15 | float(j) 16 | float(k) 17 | float(l) 18 | float(m) 19 | float(o) 20 | s_i.new() 21 | g_i.gotosoil() 22 | #setting model conditions 23 | g_i.SoilContour.initializerectangular(0, 0, 70, 50) 24 | g_i.setproperties("Title","Automation_Test") 25 | #for soil layer construction 26 | borehole_1 = g_i.borehole(0, 0) 27 | g_i.soillayer(1) 28 | g_i.soillayer(2) 29 | g_i.soillayer(3) 30 | g_i.setsoillayerlevel(borehole_1,1, -1) 31 | g_i.setsoillayerlevel(borehole_1,2, -i) 32 | g_i.setsoillayerlevel(borehole_1,3, -30) 33 | #for soil conditions 34 | g_i.borehole_1.setproperties("Head ",-30) 35 | material = g_i.soilmat() 36 | material.setproperties("MaterialName","1.Layer","Colour",10676870,"SoilModel",1,"gammaUnsat",19.5,"gammaSat",19.5, 37 | "Gref",j,"nu",0.2,"RayleighAlpha",0.1197,"RayleighBeta",6.973E-3,"Rinter",0.67) 38 | g_i.Soils[0].Material = material 39 | material = g_i.soilmat() 40 | material.setproperties("MaterialName","1.Layer","Colour",10676870,"SoilModel",1,"gammaUnsat",19.5,"gammaSat",19.5, 41 | "Gref",j,"nu",0.2,"RayleighAlpha",0.1197,"RayleighBeta",6.973E-3,"Rinter",0.67) 42 | g_i.Soils[1].Material = material 43 | material = g_i.soilmat() 44 | material.setproperties("MaterialName","2.Layer","Colour",6606905,"SoilModel",1,"gammaUnsat",20.5,"gammaSat",20.5, 45 | "Gref",188100,"nu",0.2,"RayleighAlpha",0.1102,"RayleighBeta",6.657E-3,"Rinter",0.67) 46 | g_i.Soils[2].Material = material 47 | g_i.soilmat("MaterialName","Pile","Colour",8422021,"SoilModel",1,"DrainageType",4,"gammaUnsat",25,"gammaSat",25, 48 | "Gref",16000000,"nu",0.25,"Rinter",0.67) 49 | g_i.soilmat("MaterialName","LECA","Colour",16055291,"SoilModel",1,"gammaUnsat",3,"gammaSat",3,"Gref",969.2, 50 | "nu",0.3,"Rinter",0.67) 51 | #setting construction materials 52 | g_i.platemat("MaterialName","Floors","Colour",16711680,"d",0.1,"w",25,"E1",28000000,"E2",28000000,"Nu12",0.25,"G12",11200000, 53 | "G13",11200000,"G23",11200000) 54 | g_i.platemat("MaterialName","Foundation","Colour",15890743,"d",0.3,"w",25,"E1",28000000,"E2",28000000,"Nu12",0.25,"G12", 55 | 11200000,"G13",11200000,"G23",11200000) 56 | g_i.platemat("MaterialName","Wall","Colour",16668197,"d",0.2,"w",25,"E1",30000000,"E2",30000000,"Nu12",0.25,"G12",12000000, 57 | "G13",12000000,"G23",12000000) 58 | g_i.beammat("MaterialName","Beams","Colour",16711935,"BeamType",0,"PredefinedBeamType",3,"Height",0.5,"Width",0.25,"w",25, 59 | "E",28000000) 60 | g_i.beammat("MaterialName","FoundationBeams","Colour",15666410,"BeamType",0,"PredefinedBeamType",3,"Height",0.8,"Width",0.65, 61 | "w",25,"E",28000000) 62 | g_i.anchormat("MaterialName","Floor_1","Colour",0,"EA",7500000) 63 | g_i.anchormat("MaterialName","Floor","Colour",0,"EA",9080000) 64 | #starting with structures 65 | g_i.gotostructures() 66 | #ground plate 67 | g_i.surface(35,17,-3.5,48.5,17,-3.5,48.5,33,-3.5,35,33,-3.5,35,17,-3.5) 68 | g_i.decomposesrf(g_i.Polygon_1) 69 | g_i.decomposeoutl(g_i.Polygon_1) 70 | #walls 71 | g_i.extrude(g_i.Line_Polygon_1_1,g_i.Line_Polygon_1_2,g_i.Line_Polygon_1_3,g_i.Line_Polygon_1_4,0,0,3.5) 72 | g_i.plate(g_i.Polygon_1,g_i.Polygon_2,g_i.Polygon_3,g_i.Polygon_4,g_i.Polygon_5) 73 | #set materials for geometries 74 | g_i.setmaterial(g_i.Polygon_1.Plate,g_i.Foundation) 75 | g_i.setmaterial(g_i.Polygon_2.Plate,g_i.Polygon_3.Plate,g_i.Polygon_4.Plate,g_i.Polygon_5.Plate,g_i.Wall) 76 | g_i.beam(g_i.Line_Polygon_1_1,g_i.Line_Polygon_1_2,g_i.Line_Polygon_1_3,g_i.Line_Polygon_1_4) 77 | g_i.setmaterial(g_i.Line_Polygon_1_1.Beam,g_i.Line_Polygon_1_2.Beam,g_i.Line_Polygon_1_3.Beam,g_i.Line_Polygon_1_4.Beam, 78 | g_i.FoundationBeams) 79 | #construct reinforments 80 | g_i.arrayr(g_i.Line_Polygon_1_4,5,2.7,0,0) 81 | g_i.arrayr(g_i.Line_Polygon_1_3,5,0,-3.2,0) 82 | g_i.n2nanchor(35,17,-3.5,35,17,0) 83 | g_i.setmaterial(g_i.Line_9.NodeToNodeAnchor,g_i.Floor) 84 | g_i.arrayr(g_i.Line_9,6,2.7,0,0) 85 | g_i.arrayr(g_i.Line_9,g_i.Line_10,g_i.Line_11,g_i.Line_12,g_i.Line_13,g_i.Line_14,6,0,3.2,0) 86 | #building levels 87 | g_i.arrayr(g_i.Line_Polygon_1_1,g_i.Line_Polygon_1_2,g_i.Line_Polygon_1_3,g_i.Line_1,g_i.Line_2,g_i.Line_Polygon_1_4,g_i.Line_3,g_i.Line_4, 88 | g_i.Line_5,g_i.Line_6,g_i.Line_7,g_i.Line_8,2,0,0,3.5) 89 | g_i.setmaterial(g_i.Line_45.Beam,g_i.Line_46.Beam,g_i.Line_47.Beam,g_i.Line_48.Beam,g_i.Line_49.Beam,g_i.Line_50.Beam, 90 | g_i.Line_51.Beam,g_i.Line_52.Beam,g_i.Line_53.Beam,g_i.Line_54.Beam,g_i.Line_55.Beam,g_i.Line_56.Beam,g_i.Beams_1) 91 | g_i.arrayr(g_i.Polygon_1,2,0,0,3.5) 92 | g_i.setmaterial(g_i.Polygon_6.Plate,g_i.Floors) 93 | g_i.n2nanchor(35,17,0,35,17,3) 94 | g_i.setmaterial(g_i.Line_57.NodeToNodeAnchor,g_i.Floor_1) 95 | g_i.arrayr(g_i.Line_57,6,2.7,0,0) 96 | g_i.arrayr(g_i.Line_57,g_i.Line_58,g_i.Line_59,g_i.Line_60,g_i.Line_61,g_i.Line_62,6,0,3.2,0) 97 | g_i.arrayr(g_i.Line_45,g_i.Line_46,g_i.Line_47,g_i.Line_48,g_i.Line_49,g_i.Line_50,g_i.Line_51,g_i.Line_52,g_i.Line_53, 98 | g_i.Line_54,g_i.Line_55,g_i.Line_56,2,0,0,3) 99 | g_i.arrayr(g_i.Polygon_6,2,0,0,3) 100 | #array the floor level to build levels 101 | g_i.arrayr(g_i.Line_57,g_i.Line_58,g_i.Line_59,g_i.Line_60,g_i.Line_61,g_i.Line_62,g_i.Line_63,g_i.Line_64,g_i.Line_65, 102 | g_i.Line_66,g_i.Line_67,g_i.Line_68,g_i.Line_69,g_i.Line_70,g_i.Line_71,g_i.Line_72,g_i.Line_73,g_i.Line_57,g_i.Line_74, 103 | g_i.Line_75,g_i.Line_76,g_i.Line_77,g_i.Line_78,g_i.Line_79,g_i.Line_75,g_i.Line_76,g_i.Line_77,g_i.Line_78,g_i.Line_79, 104 | g_i.Line_80,g_i.Line_81,g_i.Line_82,g_i.Line_83,g_i.Line_84,g_i.Line_85,g_i.Line_86,g_i.Line_87,g_i.Line_88,g_i.Line_89, 105 | g_i.Line_90,g_i.Line_91,g_i.Line_92,g_i.Line_93,g_i.Line_94,g_i.Line_95,g_i.Line_96,g_i.Line_97,g_i.Line_98,g_i.Line_99, 106 | g_i.Line_100,g_i.Line_101,g_i.Line_102,g_i.Line_103,g_i.Line_104,g_i.Polygon_7,5,0,0,3) 107 | #structuring foundation objects 108 | g_i.group(g_i.NodeToNodeAnchor_1,g_i.NodeToNodeAnchor_2,g_i.NodeToNodeAnchor_3,g_i.NodeToNodeAnchor_4,g_i.NodeToNodeAnchor_5, 109 | g_i.NodeToNodeAnchor_6,g_i.NodeToNodeAnchor_7,g_i.NodeToNodeAnchor_8,g_i.NodeToNodeAnchor_9,g_i.NodeToNodeAnchor_10, 110 | g_i.NodeToNodeAnchor_11,g_i.NodeToNodeAnchor_12,g_i.NodeToNodeAnchor_13,g_i.NodeToNodeAnchor_14,g_i.NodeToNodeAnchor_15, 111 | g_i.NodeToNodeAnchor_16,g_i.NodeToNodeAnchor_17,g_i.NodeToNodeAnchor_18,g_i.NodeToNodeAnchor_19,g_i.NodeToNodeAnchor_20, 112 | g_i.NodeToNodeAnchor_21,g_i.NodeToNodeAnchor_22,g_i.NodeToNodeAnchor_23,g_i.NodeToNodeAnchor_24,g_i.NodeToNodeAnchor_25, 113 | g_i.NodeToNodeAnchor_26,g_i.NodeToNodeAnchor_27,g_i.NodeToNodeAnchor_28,g_i.NodeToNodeAnchor_29,g_i.NodeToNodeAnchor_30, 114 | g_i.NodeToNodeAnchor_31,g_i.NodeToNodeAnchor_32,g_i.NodeToNodeAnchor_33,g_i.NodeToNodeAnchor_34,g_i.NodeToNodeAnchor_35, 115 | g_i.NodeToNodeAnchor_36) 116 | g_i.group_1.rename("Foundation_Columns") 117 | g_i.group(g_i.Plate_2,g_i.Plate_3,g_i.Plate_4,g_i.Plate_5) 118 | g_i.group_1.rename("Foundation_Walls") 119 | g_i.group(g_i.Beam_1,g_i.Beam_2,g_i.Beam_3,g_i.Beam_4,g_i.Beam_5,g_i.Beam_6,g_i.Beam_7,g_i.Beam_8,g_i.Beam_9,g_i.Beam_10, 120 | g_i.Beam_11,g_i.Beam_12) 121 | g_i.group_1.rename("Foundation_Beams") 122 | #constructing the pile 123 | g_i.surface(15.15,24.85,0,15.15,25.15,0,14.85,25.15,0,14.85,24.85,0) 124 | g_i.extrude(g_i.polygon_12,0,0,-6) 125 | g_i.decomposesrf(g_i.volume_1) 126 | g_i.posinterface(g_i.Polygon_Volume_1_2,g_i.Polygon_Volume_1_3,g_i.Polygon_Volume_1_4,g_i.Polygon_Volume_1_5, 127 | g_i.Polygon_Volume_1_6) 128 | #constructing the trench 129 | g_i.surface(15.15+k,25-o,0,15.15+k+l,25-o,0,15.15+k+l,25+o,0,15.15+k,25+o,0,15.15+k,25-o,0) 130 | g_i.extrude(g_i.polygon_13,0,0,-m) 131 | g_i.delete(g_i.Polygon_13) 132 | g_i.decomposesrf(g_i.volume_2) 133 | g_i.posinterface(g_i.Polygon_Volume_2_2,g_i.Polygon_Volume_2_3,g_i.Polygon_Volume_2_4,g_i.Polygon_Volume_2_5) 134 | #designing the driving load 135 | g_i.loadmultiplier() 136 | g_i.LoadMultiplier_1.setproperties("Amplitude",7459,"Frequency",10) 137 | g_i.surfload(g_i.Polygon_Volume_1_1) 138 | g_i.DynSurfaceLoad_1.setproperties("sigz",-1,"Multiplierz",g_i.LoadMultiplier_1) 139 | #for better mesh quality around the interacting constructions 140 | g_i.surface(5,5,0,60,5,0,60,45,0,5,45,0,5,5,0) 141 | g_i.extrude(g_i.Polygon_13,0,0,-m-5) 142 | g_i.delete(g_i.Polygon_13) 143 | #meshing 144 | g_i.gotomesh() 145 | #refining the pile 146 | g_i.BoreholeVolume_1_Volume_1_Volume_3_1.setproperties("CoarsenessFactor",0.1) 147 | g_i.BoreholeVolume_2_Volume_1_Volume_3_1.setproperties("CoarsenessFactor",0.1) 148 | if (i<=5): 149 | g_i.BoreholeVolume_3_Volume_1_Volume_3_1.setproperties("CoarsenessFactor",0.1) 150 | #refining the trench 151 | g_i.BoreholeVolume_1_Volume_2_Volume_3_1.setproperties("CoarsenessFactor",0.1) 152 | g_i.BoreholeVolume_2_Volume_2_Volume_3_1.setproperties("CoarsenessFactor",0.1) 153 | #refining the soil 154 | g_i.BoreholeVolume_1_Volume_3_1.setproperties("CoarsenessFactor",0.25) 155 | g_i.BoreholeVolume_2_Volume_3_2.setproperties("CoarsenessFactor",0.25) 156 | if (m+5>i): 157 | g_i.BoreholeVolume_3_Volume_3_1.setproperties("CoarsenessFactor",0.25) 158 | #condtional refinements depending on soil and trench depths 159 | if (m>i): 160 | g_i.BoreholeVolume_3_Volume_2_Volume_3_1.setproperties("CoarsenessFactor",0.1) 161 | g_i.refine(g_i.Polygon_Volume_2_2_3,g_i.Polygon_Volume_2_3_3,g_i.Polygon_Volume_2_4_3,g_i.Polygon_Volume_2_5_3) 162 | #refining the structure 163 | g_i.refine(g_i.Polygon_1_Polygon_Polygon_1_1_1,g_i.Polygon_2_1,g_i.Polygon_2_2,g_i.Polygon_3_1,g_i.Polygon_3_2,g_i.Polygon_4_1,g_i.Polygon_4_2,g_i.Polygon_5_1,g_i.Polygon_5_2,g_i.Polygon_4_1,g_i.Polygon_5_1,g_i.Polygon_6_1, 164 | g_i.Polygon_7_1,g_i.Polygon_8_1,g_i.Polygon_9_1,g_i.Polygon_10_1,g_i.Polygon_11_1) 165 | g_i.refine(g_i.Polygon_1_Polygon_Polygon_1_1_1,g_i.Polygon_2_1,g_i.Polygon_2_2,g_i.Polygon_3_1,g_i.Polygon_3_2,g_i.Polygon_4_1,g_i.Polygon_4_2,g_i.Polygon_5_1,g_i.Polygon_5_2,g_i.Polygon_4_1,g_i.Polygon_5_1,g_i.Polygon_6_1, 166 | g_i.Polygon_7_1,g_i.Polygon_8_1,g_i.Polygon_9_1,g_i.Polygon_10_1,g_i.Polygon_11_1) 167 | g_i.mesh(0.05) 168 | #designing stages 169 | g_i.gotostages() 170 | #1.Phase: Foundation Excavation 171 | g_i.phase(g_i.InitialPhase) 172 | g_i.Phase_1.setproperties("Identification","Foundation_Excavation") 173 | g_i.deactivate(g_i.BoreholeVolume_1_Volume_3_2,g_i.Phase_1) 174 | if (i<=3): 175 | g_i.deactivate(g_i.BoreholeVolume_3_Volume_3_1,g_i.Phase_1) 176 | if (i>3): 177 | g_i.deactivate(g_i.BoreholeVolume_2_Volume_3_1,g_i.Phase_1) 178 | #2.Phase: Foundation construction 179 | g_i.phase(g_i.Phase_1) 180 | g_i.Phase_2.setproperties("Identification","Foundation_Construction") 181 | g_i.Phase_2.setproperties("ResetDisplacementsToZero",True) 182 | g_i.activate(g_i.Plate_1,g_i.Foundation_Walls,g_i.Foundation_Beams,g_i.Foundation_Columns,g_i.Plate_6,g_i.Phase_2) 183 | #3.Phase: Building the floors 184 | g_i.phase(g_i.Phase_2) 185 | g_i.Phase_3.setproperties("Identification","Floor_Construction") 186 | g_i.Phase_3.setproperties("ResetDisplacementsToZero",True) 187 | g_i.activate(g_i.NodeToNodeAnchors,g_i.Beams,g_i.Points,g_i.Plates,g_i.Phase_3) 188 | #4.Phase: Trench Excavation 189 | g_i.phase(g_i.Phase_3) 190 | g_i.Phase_4.setproperties("Identification","Trench_Excavation") 191 | g_i.Phase_4.setproperties("ResetDisplacementsToZero",True) 192 | if (m>i): 193 | g_i.deactivate(g_i.BoreholeVolume_3_Volume_2_Volume_3_1,g_i.Phase_4) 194 | g_i.deactivate(g_i.BoreholeVolume_1_Volume_2_Volume_3_1,g_i.BoreholeVolume_2_Volume_2_Volume_3_1,g_i.Phase_4) 195 | #5.Phase: Geofoam installation 196 | g_i.phase(g_i.Phase_4) 197 | g_i.Phase_5.setproperties("Identification","LECA Installation") 198 | g_i.Phase_5.setproperties("ResetDisplacementsToZero",True) 199 | g_i.Soil_1_Soil_5_Soil_6_1.setmaterial(g_i.Phase_5,g_i.LECA) 200 | g_i.Soil_2_Soil_5_Soil_6_1.setmaterial(g_i.Phase_5,g_i.LECA) 201 | if (m>i): 202 | g_i.Soil_3_Soil_5_Soil_6_1.setmaterial(g_i.Phase_5,g_i.LECA) 203 | g_i.activate(g_i.BoreholeVolume_3_Volume_2_Volume_3_1,g_i.Phase_5) 204 | g_i.activate(g_i.BoreholeVolume_1_Volume_2_Volume_3_1,g_i.BoreholeVolume_2_Volume_2_Volume_3_1,g_i.Phase_5) 205 | #6.Phase: Presetting the pile 206 | g_i.phase(g_i.Phase_5) 207 | g_i.Phase_6.setproperties("Identification","Presetting the pile") 208 | g_i.Phase_6.setproperties("ResetDisplacementsToZero",True) 209 | g_i.Soil_1_Soil_4_Soil_6_1.setmaterial(g_i.Phase_6,g_i.Pile) 210 | g_i.Soil_2_Soil_4_Soil_6_1.setmaterial(g_i.Phase_6,g_i.Pile) 211 | if (i<=5): 212 | g_i.Soil_3_Soil_4_Soil_6_1.setmaterial(g_i.Phase_6,g_i.Pile) 213 | g_i.activate(g_i.Interfaces,g_i.Phase_6) 214 | #7.Phase: Pile driving 215 | g_i.phase(g_i.Phase_6) 216 | g_i.Phase_7.setproperties("Identification","Pile driving","DeformCalcType","dynamic") 217 | g_i.Phase_7.setproperties("TimeIntervalSeconds",0.5) 218 | g_i.Phase_7.setproperties("ResetDisplacementsToZero",False) 219 | g_i.Phase_7.setproperties("UseDefaultIterationParams",False) 220 | g_i.Phase_7.setproperties("TimeStepDetermType","manual") 221 | g_i.Phase_7.setproperties("MaxSteps",100) 222 | g_i.activate(g_i.SurfaceLoads,g_i.Phase_7) 223 | g_i.activate(g_i.DynSurfaceLoad_1_1,g_i.Phase_7) 224 | g_i.Dynamics.setproperties("BoundaryXmin",g_i.Phase_7,"viscous","BoundaryYmin",g_i.Phase_7,"viscous", 225 | "BoundaryZmin",g_i.Phase_7,"viscous","BoundaryXmax",g_i.Phase_7,"viscous","BoundaryYmax",g_i.Phase_7,"viscous", 226 | "BoundaryZmax",g_i.Phase_7,"none") 227 | #Select mesh points prior to caculation 228 | g_i.selectmeshpoints() 229 | g_o.addcurvepoint("node",35,25,-0.5) 230 | g_o.addcurvepoint("node",35,23.4,3) 231 | g_o.addcurvepoint("node",36.35,26.6,3) 232 | g_o.update() 233 | #Start of calculation 234 | g_i.calculate() 235 | #Saving the calculation 236 | n=str(n) 237 | name=r'\\MASTER01\d\Benutzer\Martin\example'+n 238 | g_i.save(name) 239 | #automating the output data generation 240 | s_o.open(name) 241 | def gettable_data(filename=None, phaseorder=None): 242 | # init data for lists 243 | stepids = [] 244 | vzAs = [] 245 | uxBs = [] 246 | uzCs = [] 247 | times = [] 248 | phasenames = [] 249 | #look into all phases, all steps: 250 | for phase in phaseorder: 251 | for step in phase.Steps.value: 252 | phasenames.append(phase.Name.value) 253 | stepids.append(int(step.Name.value.replace("Step_", ""))) 254 | vzAs.append(g_o.getcurveresults(g_o.Nodes[0],step,g_o.ResultTypes.Soil.Vz)) 255 | uxBs.append(g_o.getcurveresults(g_o.Nodes[1],step,g_o.ResultTypes.Soil.Ux)) 256 | uzCs.append(g_o.getcurveresults(g_o.Nodes[2],step,g_o.ResultTypes.Soil.Uz)) 257 | # make sure step info on time is available, then add it: 258 | timevalue = "-" 259 | if hasattr(step, 'Reached'): 260 | if hasattr(step.Reached, 'Time'): 261 | timevalue = step.Reached.Time.value 262 | times.append(timevalue) 263 | if filename: 264 | with open(filename, "w") as file: 265 | file.writelines(["{}\t{}\t{}\t{}\t{}\t{}\n".format(ph, nr, t, vzA, uxB, uzC) 266 | for ph, nr, t, vzA, uxB, uzC in zip(phasenames,stepids,times,vzAs,uxBs,uzCs)]) 267 | gettable_data(filename= name, phaseorder=[g_o.Phase_7]) 268 | s_o.close() 269 | import numpy 270 | def main(): 271 | i=5 272 | j=44720 273 | n=0 274 | for k in numpy.arange(3,3.1,1.7): 275 | for l in numpy.arange(0.3,0.31,0.24): 276 | for m in numpy.arange(2,2.1,1): 277 | for o in numpy.arange(9,9.1,4.5): 278 | n=n+1 279 | runProcess(n,i,j,k,l,m,o) 280 | main() 281 | 282 | 283 | # In[ ]: 284 | 285 | 286 | 287 | 288 | 289 | # In[ ]: 290 | 291 | 292 | 293 | 294 | --------------------------------------------------------------------------------