Skip to content

Commit 65ced79

Browse files
authoredApr 27, 2020
Remove the dependency on openfoammeshreader
1 parent 0a8cbe3 commit 65ced79

7 files changed

+19
-241
lines changed
 

‎python/UnstructuredMesh.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ def _readOFGrid(self, caseDir):
10351035
"""
10361036

10371037
# first import the helper utilities
1038-
from openfoammeshreader import of_mesh_utils as ofm
1038+
from pyofm import pyOFM as ofm
10391039

10401040
# Copy the reference points file to points to ensure
10411041
# consistant starting point

‎python/reg_tests/idwarp_cs_par_reg.ref

-49
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,6 @@
11
+---------------------------------------+
22
| All pyWarpUstruct Options: |
33
+---------------------------------------+
4-
{'LdefFact': 1.0,
5-
'aExp': 3.0,
6-
'alpha': 0.25,
7-
'bExp': 5.0,
8-
'bucketSize': 8,
9-
'cornerAngle': 30.0,
10-
'errTol': 0.0005,
11-
'evalMode': 'fast',
12-
'fileType': 'openfoam',
13-
'gridFile': '/home/gaetan/hg/pywarpustruct/python/input_files/ahmedBodyMesh',
14-
'restartFile': None,
15-
'specifiedSurfaces': None,
16-
'symmTol': 1e-06,
17-
'symmetryPlanes': [[[0, 0, 0], [0, 1, 0]]],
18-
'symmetrySurfaces': None,
19-
'useRotations': True,
20-
'zeroCornerRotations': True}
21-
#------------------------------#
22-
Total Volume Nodes : 22915
23-
#------------------------------#
24-
25-
+------------------------------------------------------------------------------+
26-
| pyWarpUstruct Warning: Using internally generated pyWarpUStruct surfaces. If |
27-
| this mesh object is to be used with an external solver, ensure the mesh |
28-
| object is passed to the solver immediatedly after it is created. The |
29-
| external solver must then call 'setExternalMeshIndices()' and |
30-
| 'setSurfaceDefinition()' routines. |
31-
+------------------------------------------------------------------------------+
32-
33-
+-------------------- Symmetry Planes -------------------+
34-
| Point Normal |
35-
| ( 0.000 0.000 0.000) ( 0.000 1.000 0.000) |
36-
+--------------------------------------------------------+
37-
#--------------------------------#
38-
Unique Surface Nodes : 3652
39-
#--------------------------------#
40-
Computing Denomenator Estimate...
41-
Load Balancing...
42-
Finished Mesh Initialization.
43-
Sum of vCoords Inital:
44-
@value 26501.1051526058 1e-08 1e-08
45-
Sum of vCoords Warped:
46-
@value 26754.64596317404 1e-08 1e-08
47-
Computing Warp Deriv
48-
Sum of dxs:
49-
@value 31939.67520934215 1e-08 1e-08
50-
+---------------------------------------+
51-
| All pyWarpUstruct Options: |
52-
+---------------------------------------+
534
{'LdefFact': 1.0,
545
'aExp': 3.0,
556
'alpha': 0.25,

‎python/reg_tests/idwarp_cs_reg.ref

-49
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,6 @@
11
+---------------------------------------+
22
| All pyWarpUstruct Options: |
33
+---------------------------------------+
4-
{'LdefFact': 1.0,
5-
'aExp': 3.0,
6-
'alpha': 0.25,
7-
'bExp': 5.0,
8-
'bucketSize': 8,
9-
'cornerAngle': 30.0,
10-
'errTol': 0.0005,
11-
'evalMode': 'fast',
12-
'fileType': 'openfoam',
13-
'gridFile': '/home/gaetan/hg/pywarpustruct/python/input_files/ahmedBodyMesh',
14-
'restartFile': None,
15-
'specifiedSurfaces': None,
16-
'symmTol': 1e-06,
17-
'symmetryPlanes': [[[0, 0, 0], [0, 1, 0]]],
18-
'symmetrySurfaces': None,
19-
'useRotations': True,
20-
'zeroCornerRotations': True}
21-
#------------------------------#
22-
Total Volume Nodes : 21706
23-
#------------------------------#
24-
25-
+------------------------------------------------------------------------------+
26-
| pyWarpUstruct Warning: Using internally generated pyWarpUStruct surfaces. If |
27-
| this mesh object is to be used with an external solver, ensure the mesh |
28-
| object is passed to the solver immediatedly after it is created. The |
29-
| external solver must then call 'setExternalMeshIndices()' and |
30-
| 'setSurfaceDefinition()' routines. |
31-
+------------------------------------------------------------------------------+
32-
33-
+-------------------- Symmetry Planes -------------------+
34-
| Point Normal |
35-
| ( 0.000 0.000 0.000) ( 0.000 1.000 0.000) |
36-
+--------------------------------------------------------+
37-
#--------------------------------#
38-
Unique Surface Nodes : 3652
39-
#--------------------------------#
40-
Computing Denomenator Estimate...
41-
Load Balancing...
42-
Finished Mesh Initialization.
43-
Sum of vCoords Inital:
44-
@value 25205.45183210579 1e-08 1e-08
45-
Sum of vCoords Warped:
46-
@value 25445.49922624812 1e-08 1e-08
47-
Computing Warp Deriv
48-
Sum of dxs:
49-
@value 30393.80381494912 1e-08 1e-08
50-
+---------------------------------------+
51-
| All pyWarpUstruct Options: |
52-
+---------------------------------------+
534
{'LdefFact': 1.0,
545
'aExp': 3.0,
556
'alpha': 0.25,

‎python/reg_tests/idwarp_par_reg.ref

-65
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,6 @@
11
+---------------------------------------+
22
| All pyWarpUstruct Options: |
33
+---------------------------------------+
4-
{'LdefFact': 1.0,
5-
'aExp': 3.0,
6-
'alpha': 0.25,
7-
'bExp': 5.0,
8-
'bucketSize': 8,
9-
'cornerAngle': 30.0,
10-
'errTol': 0.0005,
11-
'evalMode': 'fast',
12-
'fileType': 'openfoam',
13-
'gridFile': '/home/gaetan/hg/pywarpustruct/python/input_files/ahmedBodyMesh',
14-
'restartFile': None,
15-
'specifiedSurfaces': None,
16-
'symmTol': 1e-06,
17-
'symmetryPlanes': [[[0, 0, 0], [0, 1, 0]]],
18-
'symmetrySurfaces': None,
19-
'useRotations': True,
20-
'zeroCornerRotations': True}
21-
#------------------------------#
22-
Total Volume Nodes : 22915
23-
#------------------------------#
24-
25-
+------------------------------------------------------------------------------+
26-
| pyWarpUstruct Warning: Using internally generated pyWarpUStruct surfaces. If |
27-
| this mesh object is to be used with an external solver, ensure the mesh |
28-
| object is passed to the solver immediatedly after it is created. The |
29-
| external solver must then call 'setExternalMeshIndices()' and |
30-
| 'setSurfaceDefinition()' routines. |
31-
+------------------------------------------------------------------------------+
32-
33-
+-------------------- Symmetry Planes -------------------+
34-
| Point Normal |
35-
| ( 0.000 0.000 0.000) ( 0.000 1.000 0.000) |
36-
+--------------------------------------------------------+
37-
#--------------------------------#
38-
Unique Surface Nodes : 3652
39-
#--------------------------------#
40-
Computing Denomenator Estimate...
41-
Load Balancing...
42-
Finished Mesh Initialization.
43-
Sum of vCoords Inital:
44-
@value 26501.1051526058 1e-08 1e-08
45-
Sum of vCoords Warped:
46-
@value 26754.64596317404 1e-08 1e-08
47-
Computing Warp Deriv
48-
Sum of dxs:
49-
@value 31939.67520934215 1e-08 1e-08
50-
Verifying Warp Deriv
51-
Welcome to verifyWarpDeriv
52-
Checking 10 degrees of freedom
53-
Doing centered differnce with h: 1.0000000000000001E-009
54-
Running AD Version
55-
DOF: 0 OrigVal: 1.00703580000 AD: 0.910878151857 FD: 0.910883431501 Err(%): 0.5796196761E-03
56-
DOF: 1 OrigVal: 0.171828000000 AD: 3.40030234881 FD: 3.40029899200 Err(%):-0.9872084546E-04
57-
DOF: 2 OrigVal: 0.245136000000 AD:-0.206883876974 FD:-0.206881696947 Err(%):-0.1053749749E-02
58-
DOF: 3 OrigVal: 1.00632220000 AD: 3.44593509230 FD: 3.44593465977 Err(%):-0.1255205677E-04
59-
DOF: 4 OrigVal: 0.194500000000 AD: 3.43503200724 FD: 3.43503154174 Err(%):-0.1355145240E-04
60-
DOF: 5 OrigVal: 0.245664000000 AD: 3.36726889131 FD: 3.36726993803 Err(%): 0.3108490679E-04
61-
DOF: 6 OrigVal: 1.01780670000 AD: 2.92354560941 FD: 2.92354680561 Err(%): 0.4091579895E-04
62-
DOF: 7 OrigVal: 0.194500000000 AD: 4.51873993539 FD: 4.51873962549 Err(%):-0.6858207489E-05
63-
DOF: 8 OrigVal: 0.237334000000 AD: 2.23229317347 FD: 2.23229318012 Err(%): 0.2978833318E-06
64-
DOF: 9 OrigVal: 1.03277400000 AD: 3.90993085300 FD: 3.90993043315 Err(%):-0.1073811148E-04
65-
DOF: 10 OrigVal: 0.194500000000 AD: 4.62303598265 FD: 4.62303555592 Err(%):-0.9230451184E-05
66-
+---------------------------------------+
67-
| All pyWarpUstruct Options: |
68-
+---------------------------------------+
694
{'LdefFact': 1.0,
705
'aExp': 3.0,
716
'alpha': 0.25,

‎python/reg_tests/idwarp_reg.ref

-65
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,6 @@
11
+---------------------------------------+
22
| All pyWarpUstruct Options: |
33
+---------------------------------------+
4-
{'LdefFact': 1.0,
5-
'aExp': 3.0,
6-
'alpha': 0.25,
7-
'bExp': 5.0,
8-
'bucketSize': 8,
9-
'cornerAngle': 30.0,
10-
'errTol': 0.0005,
11-
'evalMode': 'fast',
12-
'fileType': 'openfoam',
13-
'gridFile': '/home/gaetan/hg/pywarpustruct/python/input_files/ahmedBodyMesh',
14-
'restartFile': None,
15-
'specifiedSurfaces': None,
16-
'symmTol': 1e-06,
17-
'symmetryPlanes': [[[0, 0, 0], [0, 1, 0]]],
18-
'symmetrySurfaces': None,
19-
'useRotations': True,
20-
'zeroCornerRotations': True}
21-
#------------------------------#
22-
Total Volume Nodes : 21706
23-
#------------------------------#
24-
25-
+------------------------------------------------------------------------------+
26-
| pyWarpUstruct Warning: Using internally generated pyWarpUStruct surfaces. If |
27-
| this mesh object is to be used with an external solver, ensure the mesh |
28-
| object is passed to the solver immediatedly after it is created. The |
29-
| external solver must then call 'setExternalMeshIndices()' and |
30-
| 'setSurfaceDefinition()' routines. |
31-
+------------------------------------------------------------------------------+
32-
33-
+-------------------- Symmetry Planes -------------------+
34-
| Point Normal |
35-
| ( 0.000 0.000 0.000) ( 0.000 1.000 0.000) |
36-
+--------------------------------------------------------+
37-
#--------------------------------#
38-
Unique Surface Nodes : 3652
39-
#--------------------------------#
40-
Computing Denomenator Estimate...
41-
Load Balancing...
42-
Finished Mesh Initialization.
43-
Sum of vCoords Inital:
44-
@value 25205.45183210579 1e-08 1e-08
45-
Sum of vCoords Warped:
46-
@value 25445.49922624812 1e-08 1e-08
47-
Computing Warp Deriv
48-
Sum of dxs:
49-
@value 30393.80381494912 1e-08 1e-08
50-
Verifying Warp Deriv
51-
Welcome to verifyWarpDeriv
52-
Checking 10 degrees of freedom
53-
Doing centered differnce with h: 1.0000000000000001E-009
54-
Running AD Version
55-
DOF: 0 OrigVal: -2.00000000000 AD: 1.27642322169 FD: 1.27642338371 Err(%): 0.1269357246E-04
56-
DOF: 1 OrigVal: 0.00000000000 AD: 0.978090212310E-02 FD: 0.978063111802E-02 Err(%):-0.2770795872E-02
57-
DOF: 2 OrigVal: 0.00000000000 AD: 0.137257479642 FD: 0.137259123873 Err(%): 0.1197910523E-02
58-
DOF: 3 OrigVal: -1.99166665000 AD: 1.50818834222 FD: 1.50818639158 Err(%):-0.1293367155E-03
59-
DOF: 4 OrigVal: 0.00000000000 AD: 0.982045869970E-02 FD: 0.982017691878E-02 Err(%):-0.2869366621E-02
60-
DOF: 5 OrigVal: 0.166667000000 AD: 0.148925352941 FD: 0.148923765162 Err(%):-0.1066163406E-02
61-
DOF: 6 OrigVal: -1.99166665000 AD: 2.16667422175 FD: 2.16667320500 Err(%):-0.4692644744E-04
62-
DOF: 7 OrigVal: 0.166668000000 AD: 0.371831885487E-01 FD: 0.371833133759E-01 Err(%): 0.3357081919E-03
63-
DOF: 8 OrigVal: 0.166667000000 AD: 0.134529510801 FD: 0.134528078659 Err(%):-0.1064562176E-02
64-
DOF: 9 OrigVal: -2.00000000000 AD: 1.93627939090 FD: 1.93628216326 Err(%): 0.1431798906E-03
65-
DOF: 10 OrigVal: 0.166807000000 AD: 0.167342630294E-01 FD: 0.167339768261E-01 Err(%):-0.1710297994E-02
66-
+---------------------------------------+
67-
| All pyWarpUstruct Options: |
68-
+---------------------------------------+
694
{'LdefFact': 1.0,
705
'aExp': 3.0,
716
'alpha': 0.25,

‎python/reg_tests/solve_script.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def printHeader(testName):
3939
print('| Test Name: ' + '%-66s'%testName + '|')
4040
print('+' + '-'*78 + '+')
4141

42+
# NOTE: we no longer run test1 in idwarp. test1 has been moved to pyofm and will be tested from there.
4243
def test1():
4344
# Test the Ahmed body openfoam mesh
4445
sys.stdout.flush()
@@ -340,21 +341,23 @@ def test5():
340341

341342
if __name__ == '__main__':
342343
if len(sys.argv) == 1:
343-
try:
344-
test1()
345-
except ModuleNotFoundError:
346-
print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
344+
# NOTE: commented out test1. test1 has been moved to pyofom and will be tested from there.
345+
#try:
346+
# test1()
347+
#except ModuleNotFoundError:
348+
# print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
347349
test2()
348350
test3()
349351
test4()
350352
test5()
351353
else:
352354
# Run individual ones
353-
if 'test1' in sys.argv:
354-
try:
355-
test1()
356-
except ModuleNotFoundError:
357-
print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
355+
# NOTE: commented out test1. test1 has been moved to pyofom and will be tested from there.
356+
#if 'test1' in sys.argv:
357+
# try:
358+
# test1()
359+
# except ModuleNotFoundError:
360+
# print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
358361
if 'test2' in sys.argv:
359362
test2()
360363
if 'test3' in sys.argv:

‎python/reg_tests/solve_script_cs.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def printHeader(testName):
4646

4747
h = 1e-40
4848

49+
# NOTE: we no longer run test1 in idwarp. test1 has been moved to pyofm and will be tested from there.
4950
def test1():
5051
# Test the Ahmed body openfoam mesh
5152
sys.stdout.flush()
@@ -283,14 +284,16 @@ def test3():
283284

284285
if __name__ == '__main__':
285286
if len(sys.argv) == 1 or(len(sys.argv) == 2 and 'complex' in sys.argv):
286-
test1()
287+
# NOTE: commented out test1. test1 has been moved to pyofom and will be tested from there.
288+
#test1()
287289
test2()
288290
test3()
289291

290292
else:
291293
# Run individual ones
292-
if 'test1' in sys.argv:
293-
test1()
294+
# NOTE: commented out test1. test1 has been moved to pyofom and will be tested from there.
295+
#if 'test1' in sys.argv:
296+
# test1()
294297
if 'test2' in sys.argv:
295298
test2()
296299
if 'test3' in sys.argv:

0 commit comments

Comments
 (0)
Please sign in to comment.