Skip to content

Commit

Permalink
Make new solid elements the default in cubitpy
Browse files Browse the repository at this point in the history
  • Loading branch information
isteinbrecher committed Jul 14, 2024
1 parent 94f59b1 commit d8e8749
Show file tree
Hide file tree
Showing 38 changed files with 565 additions and 1,155 deletions.
74 changes: 19 additions & 55 deletions cubitpy/cubitpy_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ class ElementType(Enum):
hex8sh = auto()
hex8_fluid = auto()
quad4 = auto()
hex8_new = auto()
hex20_new = auto()
hex27_new = auto()
tet4_new = auto()
tet10_new = auto()

def get_cubit_names(self):
"""
Expand All @@ -144,24 +139,19 @@ def get_cubit_names(self):
"""

# Get the element type parameters.
if (
self == self.hex8
or self == self.hex8sh
or self == self.hex8_fluid
or self == self.hex8_new
):
if self == self.hex8 or self == self.hex8sh or self == self.hex8_fluid:
cubit_scheme = "Auto"
cubit_element_type = "HEX8"
elif self == self.hex20 or self == self.hex20_new:
elif self == self.hex20:
cubit_scheme = "Auto"
cubit_element_type = "HEX20"
elif self == self.hex27 or self == self.hex27_new:
elif self == self.hex27:
cubit_scheme = "Auto"
cubit_element_type = "HEX27"
elif self == self.tet4 or self == self.tet4_new:
elif self == self.tet4:
cubit_scheme = "Tetmesh"
cubit_element_type = "TETRA4"
elif self == self.tet10 or self == self.tet10_new:
elif self == self.tet10:
cubit_scheme = "Tetmesh"
cubit_element_type = "TETRA10"
elif self == self.quad4:
Expand All @@ -176,24 +166,14 @@ def get_four_c_name(self):
"""Get the name of this element in 4C."""

# Get the element type parameters.
if self == self.hex8:
return "SOLIDH8"
elif self == self.hex20:
return "SOLIDH20"
elif self == self.hex27:
return "SOLIDH27"
elif self == self.tet4:
return "SOLIDT4"
elif self == self.tet10:
return "SOLIDT10"
elif self == self.hex8sh:
if self == self.hex8sh:
return "SOLIDSH8"
elif (
self == self.hex8_new
or self == self.hex20_new
or self == self.hex27_new
or self == self.tet10_new
or self == self.tet4_new
self == self.hex8
or self == self.hex20
or self == self.hex27
or self == self.tet10
or self == self.tet4
):
return "SOLID"
elif self == self.hex8_fluid:
Expand All @@ -216,12 +196,6 @@ def get_four_c_section(self):
or self == self.tet4
or self == self.hex8sh
or self == self.tet10
or self == self.hex20_new
or self == self.hex8_new
or self == self.hex20_new
or self == self.hex27_new
or self == self.tet4_new
or self == self.tet10_new
or self == self.quad4
):
return "STRUCTURE"
Expand All @@ -231,20 +205,15 @@ def get_four_c_section(self):
def get_four_c_type(self):
"""Get the correct element shape name of this element in 4C."""

if (
self == self.hex8
or self == self.hex8sh
or self == self.hex8_fluid
or self == self.hex8_new
):
if self == self.hex8 or self == self.hex8sh or self == self.hex8_fluid:
return "HEX8"
elif self == self.hex20 or self == self.hex20_new:
elif self == self.hex20:
return "HEX20"
elif self == self.hex27 or self == self.hex27_new:
elif self == self.hex27:
return "HEX27"
elif self == self.tet4 or self == self.tet4_new:
elif self == self.tet4:
return "TET4"
elif self == self.tet10 or self == self.tet10_new:
elif self == self.tet10:
return "TET10"
elif self == self.quad4:
return "QUAD4"
Expand All @@ -258,17 +227,12 @@ def get_default_four_c_description(self):
"""

# Get the element type parameters.
if self == self.hex8 or self == self.hex8_new:
return "KINEM nonlinear EAS none"
elif (
self == self.hex20
if (
self == self.hex8
or self == self.hex20
or self == self.hex27
or self == self.tet4
or self == self.tet10
or self == self.hex20_new
or self == self.hex27_new
or self == self.tet4_new
or self == self.tet10_new
):
return "KINEM nonlinear"
elif self == self.hex8sh:
Expand Down
60 changes: 30 additions & 30 deletions tests/input-files-ref/test_block_function_cubitpy.dat
Original file line number Diff line number Diff line change
Expand Up @@ -386,42 +386,42 @@ NODE 383 COORD 7.2500000000000000e+00 3.0000001192092896e-01 3.49999994
NODE 384 COORD 6.7500000000000000e+00 3.0000001192092896e-01 -3.4999999403953552e-01
NODE 385 COORD 7.2500000000000000e+00 3.0000001192092896e-01 -3.4999999403953552e-01
------------------------------------------------STRUCTURE ELEMENTS
1 SOLIDH8 HEX8 1 2 3 4 5 6 7 8 test material string KINEM nonlinear EAS none
2 SOLIDH8 HEX8 4 3 9 10 8 7 11 12 test material string KINEM nonlinear EAS none
3 SOLIDH8 HEX8 5 6 7 8 13 14 15 16 test material string KINEM nonlinear EAS none
4 SOLIDH8 HEX8 8 7 11 12 16 15 17 18 test material string KINEM nonlinear EAS none
5 SOLIDH8 HEX8 13 14 15 16 19 20 21 22 test material string KINEM nonlinear EAS none
6 SOLIDH8 HEX8 16 15 17 18 22 21 23 24 test material string KINEM nonlinear EAS none
7 SOLIDH20 HEX20 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 test material string KINEM nonlinear
8 SOLIDH20 HEX20 28 27 45 46 32 31 47 48 35 49 50 51 40 39 52 53 43 54 55 56 test material string KINEM nonlinear
9 SOLIDH20 HEX20 29 30 31 32 57 58 59 60 41 42 43 44 61 62 63 64 65 66 67 68 test material string KINEM nonlinear
10 SOLIDH20 HEX20 32 31 47 48 60 59 69 70 43 54 55 56 64 63 71 72 67 73 74 75 test material string KINEM nonlinear
11 SOLIDH20 HEX20 57 58 59 60 76 77 78 79 65 66 67 68 80 81 82 83 84 85 86 87 test material string KINEM nonlinear
12 SOLIDH20 HEX20 60 59 69 70 79 78 88 89 67 73 74 75 83 82 90 91 86 92 93 94 test material string KINEM nonlinear
13 SOLIDH27 HEX27 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 test material string KINEM nonlinear
14 SOLIDH27 HEX27 98 97 122 123 102 101 124 125 105 126 127 128 110 109 129 130 113 131 132 133 134 135 136 137 138 121 139 test material string KINEM nonlinear
15 SOLIDH27 HEX27 99 100 101 102 140 141 142 143 111 112 113 114 144 145 146 147 148 149 150 151 152 117 153 154 155 156 157 test material string KINEM nonlinear
16 SOLIDH27 HEX27 102 101 124 125 143 142 158 159 113 131 132 133 147 146 160 161 150 162 163 164 165 136 166 167 168 157 169 test material string KINEM nonlinear
17 SOLIDH27 HEX27 140 141 142 143 170 171 172 173 148 149 150 151 174 175 176 177 178 179 180 181 182 153 183 184 185 186 187 test material string KINEM nonlinear
18 SOLIDH27 HEX27 143 142 158 159 173 172 188 189 150 162 163 164 177 176 190 191 180 192 193 194 195 166 196 197 198 187 199 test material string KINEM nonlinear
1 SOLID HEX8 1 2 3 4 5 6 7 8 test material string KINEM nonlinear
2 SOLID HEX8 4 3 9 10 8 7 11 12 test material string KINEM nonlinear
3 SOLID HEX8 5 6 7 8 13 14 15 16 test material string KINEM nonlinear
4 SOLID HEX8 8 7 11 12 16 15 17 18 test material string KINEM nonlinear
5 SOLID HEX8 13 14 15 16 19 20 21 22 test material string KINEM nonlinear
6 SOLID HEX8 16 15 17 18 22 21 23 24 test material string KINEM nonlinear
7 SOLID HEX20 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 test material string KINEM nonlinear
8 SOLID HEX20 28 27 45 46 32 31 47 48 35 49 50 51 40 39 52 53 43 54 55 56 test material string KINEM nonlinear
9 SOLID HEX20 29 30 31 32 57 58 59 60 41 42 43 44 61 62 63 64 65 66 67 68 test material string KINEM nonlinear
10 SOLID HEX20 32 31 47 48 60 59 69 70 43 54 55 56 64 63 71 72 67 73 74 75 test material string KINEM nonlinear
11 SOLID HEX20 57 58 59 60 76 77 78 79 65 66 67 68 80 81 82 83 84 85 86 87 test material string KINEM nonlinear
12 SOLID HEX20 60 59 69 70 79 78 88 89 67 73 74 75 83 82 90 91 86 92 93 94 test material string KINEM nonlinear
13 SOLID HEX27 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 test material string KINEM nonlinear
14 SOLID HEX27 98 97 122 123 102 101 124 125 105 126 127 128 110 109 129 130 113 131 132 133 134 135 136 137 138 121 139 test material string KINEM nonlinear
15 SOLID HEX27 99 100 101 102 140 141 142 143 111 112 113 114 144 145 146 147 148 149 150 151 152 117 153 154 155 156 157 test material string KINEM nonlinear
16 SOLID HEX27 102 101 124 125 143 142 158 159 113 131 132 133 147 146 160 161 150 162 163 164 165 136 166 167 168 157 169 test material string KINEM nonlinear
17 SOLID HEX27 140 141 142 143 170 171 172 173 148 149 150 151 174 175 176 177 178 179 180 181 182 153 183 184 185 186 187 test material string KINEM nonlinear
18 SOLID HEX27 143 142 158 159 173 172 188 189 150 162 163 164 177 176 190 191 180 192 193 194 195 166 196 197 198 187 199 test material string KINEM nonlinear
19 SOLIDSH8 HEX8 200 201 202 203 204 205 206 207 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
20 SOLIDSH8 HEX8 203 202 208 209 207 206 210 211 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
21 SOLIDSH8 HEX8 204 205 206 207 212 213 214 215 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
22 SOLIDSH8 HEX8 207 206 210 211 215 214 216 217 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
23 SOLIDSH8 HEX8 212 213 214 215 218 219 220 221 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
24 SOLIDSH8 HEX8 215 214 216 217 221 220 222 223 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
25 SOLIDH8 HEX8 224 225 226 227 228 229 230 231 test material string KINEM nonlinear EAS none
26 SOLIDH8 HEX8 225 232 233 226 229 234 235 230 test material string KINEM nonlinear EAS none
27 SOLIDH8 HEX8 227 226 236 237 231 230 238 239 test material string KINEM nonlinear EAS none
28 SOLIDH8 HEX8 226 233 240 236 230 235 241 238 test material string KINEM nonlinear EAS none
29 SOLIDH20 HEX20 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 test material string KINEM nonlinear
30 SOLIDH20 HEX20 243 262 263 244 247 264 265 248 266 267 268 251 255 269 270 256 271 272 273 259 test material string KINEM nonlinear
31 SOLIDH20 HEX20 245 244 274 275 249 248 276 277 252 278 279 280 257 256 281 282 260 283 284 285 test material string KINEM nonlinear
32 SOLIDH20 HEX20 244 263 286 274 248 265 287 276 268 288 289 278 256 270 290 281 273 291 292 283 test material string KINEM nonlinear
33 SOLIDH27 HEX27 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 test material string KINEM nonlinear
34 SOLIDH27 HEX27 294 320 321 295 298 322 323 299 324 325 326 302 306 327 328 307 329 330 331 310 332 333 334 317 335 336 337 test material string KINEM nonlinear
35 SOLIDH27 HEX27 296 295 338 339 300 299 340 341 303 342 343 344 308 307 345 346 311 347 348 349 350 351 352 353 354 319 355 test material string KINEM nonlinear
36 SOLIDH27 HEX27 295 321 356 338 299 323 357 340 326 358 359 342 307 328 360 345 331 361 362 347 363 364 365 354 366 337 367 test material string KINEM nonlinear
25 SOLID HEX8 224 225 226 227 228 229 230 231 test material string KINEM nonlinear
26 SOLID HEX8 225 232 233 226 229 234 235 230 test material string KINEM nonlinear
27 SOLID HEX8 227 226 236 237 231 230 238 239 test material string KINEM nonlinear
28 SOLID HEX8 226 233 240 236 230 235 241 238 test material string KINEM nonlinear
29 SOLID HEX20 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 test material string KINEM nonlinear
30 SOLID HEX20 243 262 263 244 247 264 265 248 266 267 268 251 255 269 270 256 271 272 273 259 test material string KINEM nonlinear
31 SOLID HEX20 245 244 274 275 249 248 276 277 252 278 279 280 257 256 281 282 260 283 284 285 test material string KINEM nonlinear
32 SOLID HEX20 244 263 286 274 248 265 287 276 268 288 289 278 256 270 290 281 273 291 292 283 test material string KINEM nonlinear
33 SOLID HEX27 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 test material string KINEM nonlinear
34 SOLID HEX27 294 320 321 295 298 322 323 299 324 325 326 302 306 327 328 307 329 330 331 310 332 333 334 317 335 336 337 test material string KINEM nonlinear
35 SOLID HEX27 296 295 338 339 300 299 340 341 303 342 343 344 308 307 345 346 311 347 348 349 350 351 352 353 354 319 355 test material string KINEM nonlinear
36 SOLID HEX27 295 321 356 338 299 323 357 340 326 358 359 342 307 328 360 345 331 361 362 347 363 364 365 354 366 337 367 test material string KINEM nonlinear
37 SOLIDSH8 HEX8 368 369 370 371 372 373 374 375 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
38 SOLIDSH8 HEX8 369 376 377 370 373 378 379 374 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
39 SOLIDSH8 HEX8 371 370 380 381 375 374 382 383 test material string KINEM nonlinear EAS none ANS none THICKDIR auto
Expand Down
Loading

0 comments on commit d8e8749

Please sign in to comment.