From 49ddb687411b18ccd3c259615fd3dbc37fffa2b9 Mon Sep 17 00:00:00 2001 From: Romain Boman <romain.boman@gmail.com> Date: Fri, 28 Oct 2022 12:17:07 +0200 Subject: [PATCH] remove flow, mparams, mirrors - update amfe --- CMakeLists.txt | 12 - README.md | 4 +- ext/amfe | 2 +- flow/CMakeLists.txt | 20 - flow/README.md | 27 - flow/__init__.py | 6 - flow/_src/CMakeLists.txt | 52 - flow/_src/floww.h | 30 - flow/_src/floww.i | 85 - flow/benchmark/onera.py | 112 - flow/benchmark/onera_lfs.msh | 3 - flow/cases/coyote.py | 84 - flow/cases/n0012.py | 63 - flow/cases/n0012_3.py | 71 - flow/cases/n64A410.py | 65 - flow/cases/rae2822.py | 68 - flow/cases/wbht.py | 96 - flow/cases/wht.py | 87 - flow/default.py | 145 - flow/models/agard445.geo | 385 -- flow/models/coyote.geo | 129 - flow/models/coyote.stp | 3 - flow/models/cylinder.geo | 68 - flow/models/cylinder_2D5.geo | 161 - flow/models/cylinder_3.geo | 203 -- flow/models/n0012.geo | 282 -- flow/models/n0012_3.geo | 442 --- flow/models/n64A410.geo | 198 - flow/models/old/channel.geo | 48 - flow/models/old/channel3.geo | 116 - flow/models/old/n0012-3_.geo | 339 -- flow/models/old/n0012s.geo | 298 -- flow/models/old/n0012u.geo | 272 -- flow/models/oneraM6.geo | 590 --- flow/models/rae2822.geo | 200 - flow/models/wbht.geo | 1246 ------- flow/models/wht.geo | 1018 ------ flow/scripts/__init__.py | 1 - flow/scripts/config.py | 152 - flow/scripts/polar.py | 95 - flow/scripts/trim.py | 94 - flow/src/CMakeLists.txt | 28 - flow/src/flow.h | 89 - flow/src/wAdjoint.cpp | 614 ---- flow/src/wAdjoint.h | 87 - flow/src/wAssign.cpp | 93 - flow/src/wAssign.h | 86 - flow/src/wBlowing.cpp | 73 - flow/src/wBlowing.h | 56 - flow/src/wBlowingResidual.cpp | 46 - flow/src/wBlowingResidual.h | 39 - flow/src/wBoundary.cpp | 196 - flow/src/wBoundary.h | 62 - flow/src/wF0El.cpp | 180 - flow/src/wF0El.h | 168 - flow/src/wF0Ps.cpp | 52 - flow/src/wF0Ps.h | 57 - flow/src/wF1Ct.cpp | 154 - flow/src/wF1Ct.h | 99 - flow/src/wF1El.cpp | 64 - flow/src/wF1El.h | 65 - flow/src/wFace.h | 90 - flow/src/wFpeLSFunction.cpp | 52 - flow/src/wFpeLSFunction.h | 56 - flow/src/wFreestream.cpp | 40 - flow/src/wFreestream.h | 48 - flow/src/wFreestreamResidual.cpp | 67 - flow/src/wFreestreamResidual.h | 41 - flow/src/wKutta.cpp | 210 -- flow/src/wKutta.h | 58 - flow/src/wKuttaElement.cpp | 60 - flow/src/wKuttaElement.h | 67 - flow/src/wKuttaResidual.cpp | 163 - flow/src/wKuttaResidual.h | 44 - flow/src/wLoadFunctional.cpp | 132 - flow/src/wLoadFunctional.h | 42 - flow/src/wMedium.cpp | 117 - flow/src/wMedium.h | 62 - flow/src/wNewton.cpp | 530 --- flow/src/wNewton.h | 66 - flow/src/wPicard.cpp | 346 -- flow/src/wPicard.h | 55 - flow/src/wPotentialResidual.cpp | 242 -- flow/src/wPotentialResidual.h | 46 - flow/src/wProblem.cpp | 347 -- flow/src/wProblem.h | 94 - flow/src/wSolver.cpp | 248 -- flow/src/wSolver.h | 78 - flow/src/wWake.cpp | 274 -- flow/src/wWake.h | 60 - flow/src/wWakeElement.cpp | 99 - flow/src/wWakeElement.h | 70 - flow/src/wWakeResidual.cpp | 251 -- flow/src/wWakeResidual.h | 44 - flow/tests/adjoint.py | 138 - flow/tests/adjoint3.py | 134 - flow/tests/bli.py | 131 - flow/tests/cylinder.py | 146 - flow/tests/cylinder2D5.py | 134 - flow/tests/cylinder3.py | 137 - flow/tests/lift.py | 109 - flow/tests/lift3.py | 101 - flow/tests/meshDef.py | 148 - flow/tests/meshDef3.py | 134 - flow/tests/nonlift.py | 106 - flow/utils.py | 128 - flow/validation/agard.py | 111 - flow/validation/onera.py | 108 - flow/viscous/__init__.py | 1 - flow/viscous/airfoil.py | 131 - flow/viscous/boundary.py | 36 - flow/viscous/coupler.py | 82 - flow/viscous/newton.py | 75 - flow/viscous/solver.py | 489 --- flow/viscous/wake.py | 78 - heat/src/wSolver.cpp | 16 +- katoptron/src/ContactsList.cpp | 20 +- katoptron/src/DiscreteProblem.hpp | 44 +- katoptron/src/ElementComputation.hpp | 12 +- katoptron/src/ElementMatrices.hpp | 4 +- katoptron/src/ElementVectors.hpp | 16 +- katoptron/src/ElementVectorsETI.cpp | 40 +- katoptron/src/Map.cpp | 10 +- katoptron/src/NeumannList.h | 4 +- katoptron/src/ResultsDef.hpp | 8 +- katoptron/src/SourcesList.h | 4 +- katoptron/src/wContact.cpp | 12 +- katoptron/src/wVtkExport_KIM2CLEAN.cpp | 16 +- mirrors/ANSYS/meshes/M1_S1_lfs.apdl | 3 - mirrors/ANSYS/meshes/M1_all_lfs.apdl | 3 - mirrors/ANSYS/meshes/ansys_mesh.py | 12 - mirrors/ANSYS/meshes/mirrors01_ansys_lfs.apdl | 3 - mirrors/ANSYS/meshes/small_mesh_lfs.apdl | 3 - mirrors/ANSYS/res/mirrors01_T_lfs.ansys | 3 - mirrors/ANSYS/res/mirrors01_u_lfs.ansys | 3 - .../ANSYS/res/mirrors01_u_thermo_lfs.ansys | 3 - mirrors/ANSYS/res/mirrors01_x_lfs.ansys | 3 - .../ANSYS/res/mirrors01_x_thermo_lfs.ansys | 3 - mirrors/ANSYS/res/mirrors01_y_lfs.ansys | 3 - .../ANSYS/res/mirrors01_y_thermo_lfs.ansys | 3 - mirrors/ANSYS/res/mirrors01_z_lfs.ansys | 3 - .../ANSYS/res/mirrors01_z_thermo_lfs.ansys | 3 - mirrors/ANSYS/res/small2_T_lfs.ansys | 3 - mirrors/ANSYS/res/small2_u_lfs.ansys | 3 - mirrors/ANSYS/res/small2_x_lfs.ansys | 3 - mirrors/ANSYS/res/small2_y_lfs.ansys | 3 - mirrors/ANSYS/res/small2_z_lfs.ansys | 3 - mirrors/ANSYS/res/small_T_lfs.ansys | 3 - mirrors/ANSYS/res/small_u_lfs.ansys | 3 - mirrors/CMakeLists.txt | 20 - mirrors/__init__.py | 6 - mirrors/_src/CMakeLists.txt | 51 - mirrors/_src/mirrorsw.i | 109 - mirrors/attic/imported_10x10.py | 13 - mirrors/attic/imported_30x30.py | 13 - mirrors/attic/loop_old.py | 71 - mirrors/attic/loop_old2.py | 214 -- mirrors/broken/NISP_Leg_cond.py | 42 - mirrors/broken/mirrors01.py | 71 - mirrors/broken/mirrors01_ansys_lfs.msh | 3 - .../broken/mirrors01_ansys_partition_lfs.msh | 3 - mirrors/broken/mirrors03.py | 33 - mirrors/broken/mirrors_test_battery.py | 201 - mirrors/broken/small_mesh_lfs.msh | 3 - mirrors/figs/LSP.py | 38 - mirrors/figs/LSP_2.py | 46 - mirrors/figs/LSP_3.py | 65 - mirrors/figs/numpy_matplotlib01.py | 24 - mirrors/figs/numpy_matplotlib02.py | 21 - mirrors/figs/numpy_matplotlib03.py | 25 - mirrors/models/__init__.py | 0 mirrors/models/cube_hex.geo | 50 - mirrors/models/cube_hex.py | 71 - mirrors/models/cube_tri.geo | 52 - mirrors/models/cube_tri.py | 70 - mirrors/models/mirror.geo | 85 - mirrors/models/mirror_ss.py | 88 - mirrors/mparams/mparams.py | 341 -- mirrors/mparams_sols/__init__.py | 0 mirrors/mparams_sols/s10x10.py | 37 - mirrors/mparams_sols/s10x10_c_QR_10x10.py | 39 - mirrors/mparams_sols/s10x10_c_QR_pre_10x10.py | 39 - mirrors/mparams_sols/s30x30.py | 37 - mirrors/mparams_sols/s30x30_c_QR_pre_30x30.py | 38 - mirrors/src/CMakeLists.txt | 28 - mirrors/src/mirrors.h | 52 - mirrors/src/wANSYSSolution.cpp | 38 - mirrors/src/wANSYSSolution.h | 56 - mirrors/src/wMSurface.cpp | 46 - mirrors/src/wMSurface.h | 55 - mirrors/src/wMedium.cpp | 41 - mirrors/src/wMedium.h | 53 - mirrors/src/wProblem.cpp | 81 - mirrors/src/wProblem.h | 72 - mirrors/src/wSolver.cpp | 903 ----- mirrors/src/wSolver.h | 54 - mirrors/src/wTDirichlet.cpp | 52 - mirrors/src/wTDirichlet.h | 51 - mirrors/src/wTNeumann.cpp | 55 - mirrors/src/wTNeumann.h | 52 - mirrors/src/wTSource.cpp | 52 - mirrors/src/wTSource.h | 52 - mirrors/src/wThermoMecaTerm.cpp | 173 - mirrors/src/wThermoMecaTerm.h | 45 - mirrors/src/wuDirichlet.cpp | 83 - mirrors/src/wuDirichlet.h | 54 - mirrors/src/wuNeumann.cpp | 64 - mirrors/src/wuNeumann.h | 53 - mirrors/tests/.gitignore | 5 - mirrors/tests/__init__.py | 0 mirrors/tests/mparams/__init__.py | 0 mirrors/tests/mparams/loop.py | 305 -- mirrors/tests/mparams/loop2.py | 286 -- mirrors/tests/mparams/loop3.py | 306 -- mirrors/tests/mparams/loop4.py | 287 -- mirrors/tests/mparams/loop5.py | 309 -- mirrors/tests/mparams/loop6.py | 308 -- mirrors/tests/mparams/loop7.py | 224 -- mirrors/tests/mparams/loop8.py | 230 -- mirrors/tests/mparams/mparams.py | 216 -- mirrors/tests/simple.py | 31 - mirrors/viewer.py | 71 - params/CMakeLists.txt | 5 - params/CVT/CMakeLists.txt | 3 - params/CVT/Makefile | 136 - params/CVT/__init__.py | 0 params/CVT/_src/CMakeLists.txt | 36 - params/CVT/_src/paramsCVTw.i | 45 - params/CVT/python/__init__.py | 0 params/CVT/python/cvt_circle.txt | 100 - params/CVT/python/cvt_circle3.txt | 100 - params/CVT/python/cvt_circle4.txt | 100 - params/CVT/python/cvt_circle5.txt | 1000 ----- params/CVT/python/cvt_circle6.txt | 1000 ----- params/CVT/python/cvt_circle7.txt | 1000 ----- params/CVT/python/normal.py | 34 - params/CVT/python/rejection.py | 72 - params/CVT/python/test.py | 152 - params/CVT/python/test2D.py | 297 -- params/CVT/python/test2D2.py | 132 - params/CVT/python/test3.py | 131 - params/CVT/python/uniform.py | 30 - params/CVT/src/CMakeLists.txt | 25 - params/CVT/src/cvt.cpp | 3239 ----------------- params/CVT/src/cvt.hpp | 65 - params/CVT/src/interface.cpp | 109 - params/CVT/src/interface.hpp | 51 - params/CVT/src/paramsCVT.h | 41 - params/CVT/test/test.py | 27 - params/__init__.py | 0 params/arnst_ponthot/__init__.py | 0 params/arnst_ponthot/src/__init__.py | 0 params/arnst_ponthot/src/gamma.py | 193 - params/arnst_ponthot/tests/test.py | 39 - params/arnst_ponthot/tests/test1.py | 33 - params/arnst_ponthot/tests/test10.py | 79 - params/arnst_ponthot/tests/test11.py | 99 - params/arnst_ponthot/tests/test2.py | 37 - params/arnst_ponthot/tests/test3.py | 37 - params/arnst_ponthot/tests/test4.py | 37 - params/arnst_ponthot/tests/test5.py | 46 - params/arnst_ponthot/tests/test6.py | 47 - params/arnst_ponthot/tests/test7.py | 46 - params/arnst_ponthot/tests/test8.py | 51 - params/arnst_ponthot/tests/test9.py | 79 - params/dev_tests/LSP.py | 53 - params/dev_tests/LSP_2.py | 61 - params/dev_tests/LSP_3.py | 92 - params/dev_tests/LSP_4.py | 130 - params/dev_tests/LegPol.py | 60 - params/dev_tests/LegPol2.py | 73 - params/dev_tests/numpy_matplotlib01.py | 39 - params/dev_tests/numpy_matplotlib02.py | 38 - params/dev_tests/numpy_matplotlib03.py | 40 - params/dev_tests/numpy_matplotlib04.py | 42 - params/dev_tests/numpy_matplotlib05.py | 52 - params/src/LSP_3.py | 130 - params/src/__init__.py | 3 - params/src/func.py | 116 - params/src/gauss.py | 42 - params/src/indices.py | 38 - params/src/legendre.py | 38 - params/src/legendre_norm.py | 45 - params/src/monomials.py | 45 - params/src/monomials_1norm.py | 105 - params/src/plot.py | 256 -- params/src/voronoi.py | 56 - params/src/write.py | 89 - params/test/leg_lim.py | 107 - waves/src/wTimeIntegration.cpp | 6 +- 290 files changed, 108 insertions(+), 34077 deletions(-) delete mode 100644 flow/CMakeLists.txt delete mode 100644 flow/README.md delete mode 100644 flow/__init__.py delete mode 100644 flow/_src/CMakeLists.txt delete mode 100644 flow/_src/floww.h delete mode 100644 flow/_src/floww.i delete mode 100644 flow/benchmark/onera.py delete mode 100644 flow/benchmark/onera_lfs.msh delete mode 100644 flow/cases/coyote.py delete mode 100644 flow/cases/n0012.py delete mode 100644 flow/cases/n0012_3.py delete mode 100644 flow/cases/n64A410.py delete mode 100644 flow/cases/rae2822.py delete mode 100644 flow/cases/wbht.py delete mode 100644 flow/cases/wht.py delete mode 100644 flow/default.py delete mode 100644 flow/models/agard445.geo delete mode 100755 flow/models/coyote.geo delete mode 100755 flow/models/coyote.stp delete mode 100644 flow/models/cylinder.geo delete mode 100644 flow/models/cylinder_2D5.geo delete mode 100644 flow/models/cylinder_3.geo delete mode 100644 flow/models/n0012.geo delete mode 100644 flow/models/n0012_3.geo delete mode 100644 flow/models/n64A410.geo delete mode 100644 flow/models/old/channel.geo delete mode 100644 flow/models/old/channel3.geo delete mode 100644 flow/models/old/n0012-3_.geo delete mode 100644 flow/models/old/n0012s.geo delete mode 100644 flow/models/old/n0012u.geo delete mode 100644 flow/models/oneraM6.geo delete mode 100644 flow/models/rae2822.geo delete mode 100644 flow/models/wbht.geo delete mode 100644 flow/models/wht.geo delete mode 100644 flow/scripts/__init__.py delete mode 100644 flow/scripts/config.py delete mode 100644 flow/scripts/polar.py delete mode 100644 flow/scripts/trim.py delete mode 100644 flow/src/CMakeLists.txt delete mode 100644 flow/src/flow.h delete mode 100644 flow/src/wAdjoint.cpp delete mode 100644 flow/src/wAdjoint.h delete mode 100644 flow/src/wAssign.cpp delete mode 100644 flow/src/wAssign.h delete mode 100644 flow/src/wBlowing.cpp delete mode 100644 flow/src/wBlowing.h delete mode 100644 flow/src/wBlowingResidual.cpp delete mode 100644 flow/src/wBlowingResidual.h delete mode 100644 flow/src/wBoundary.cpp delete mode 100644 flow/src/wBoundary.h delete mode 100644 flow/src/wF0El.cpp delete mode 100644 flow/src/wF0El.h delete mode 100644 flow/src/wF0Ps.cpp delete mode 100644 flow/src/wF0Ps.h delete mode 100644 flow/src/wF1Ct.cpp delete mode 100644 flow/src/wF1Ct.h delete mode 100644 flow/src/wF1El.cpp delete mode 100644 flow/src/wF1El.h delete mode 100644 flow/src/wFace.h delete mode 100644 flow/src/wFpeLSFunction.cpp delete mode 100644 flow/src/wFpeLSFunction.h delete mode 100644 flow/src/wFreestream.cpp delete mode 100644 flow/src/wFreestream.h delete mode 100644 flow/src/wFreestreamResidual.cpp delete mode 100644 flow/src/wFreestreamResidual.h delete mode 100644 flow/src/wKutta.cpp delete mode 100644 flow/src/wKutta.h delete mode 100644 flow/src/wKuttaElement.cpp delete mode 100644 flow/src/wKuttaElement.h delete mode 100644 flow/src/wKuttaResidual.cpp delete mode 100644 flow/src/wKuttaResidual.h delete mode 100644 flow/src/wLoadFunctional.cpp delete mode 100644 flow/src/wLoadFunctional.h delete mode 100644 flow/src/wMedium.cpp delete mode 100644 flow/src/wMedium.h delete mode 100644 flow/src/wNewton.cpp delete mode 100644 flow/src/wNewton.h delete mode 100644 flow/src/wPicard.cpp delete mode 100644 flow/src/wPicard.h delete mode 100644 flow/src/wPotentialResidual.cpp delete mode 100644 flow/src/wPotentialResidual.h delete mode 100644 flow/src/wProblem.cpp delete mode 100644 flow/src/wProblem.h delete mode 100644 flow/src/wSolver.cpp delete mode 100644 flow/src/wSolver.h delete mode 100644 flow/src/wWake.cpp delete mode 100644 flow/src/wWake.h delete mode 100644 flow/src/wWakeElement.cpp delete mode 100644 flow/src/wWakeElement.h delete mode 100644 flow/src/wWakeResidual.cpp delete mode 100644 flow/src/wWakeResidual.h delete mode 100644 flow/tests/adjoint.py delete mode 100644 flow/tests/adjoint3.py delete mode 100644 flow/tests/bli.py delete mode 100644 flow/tests/cylinder.py delete mode 100644 flow/tests/cylinder2D5.py delete mode 100644 flow/tests/cylinder3.py delete mode 100644 flow/tests/lift.py delete mode 100644 flow/tests/lift3.py delete mode 100644 flow/tests/meshDef.py delete mode 100644 flow/tests/meshDef3.py delete mode 100644 flow/tests/nonlift.py delete mode 100644 flow/utils.py delete mode 100644 flow/validation/agard.py delete mode 100644 flow/validation/onera.py delete mode 100644 flow/viscous/__init__.py delete mode 100644 flow/viscous/airfoil.py delete mode 100644 flow/viscous/boundary.py delete mode 100644 flow/viscous/coupler.py delete mode 100644 flow/viscous/newton.py delete mode 100644 flow/viscous/solver.py delete mode 100644 flow/viscous/wake.py delete mode 100644 mirrors/ANSYS/meshes/M1_S1_lfs.apdl delete mode 100644 mirrors/ANSYS/meshes/M1_all_lfs.apdl delete mode 100755 mirrors/ANSYS/meshes/ansys_mesh.py delete mode 100644 mirrors/ANSYS/meshes/mirrors01_ansys_lfs.apdl delete mode 100644 mirrors/ANSYS/meshes/small_mesh_lfs.apdl delete mode 100644 mirrors/ANSYS/res/mirrors01_T_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_u_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_u_thermo_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_x_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_x_thermo_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_y_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_y_thermo_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_z_lfs.ansys delete mode 100644 mirrors/ANSYS/res/mirrors01_z_thermo_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small2_T_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small2_u_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small2_x_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small2_y_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small2_z_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small_T_lfs.ansys delete mode 100644 mirrors/ANSYS/res/small_u_lfs.ansys delete mode 100644 mirrors/CMakeLists.txt delete mode 100644 mirrors/__init__.py delete mode 100644 mirrors/_src/CMakeLists.txt delete mode 100644 mirrors/_src/mirrorsw.i delete mode 100755 mirrors/attic/imported_10x10.py delete mode 100755 mirrors/attic/imported_30x30.py delete mode 100755 mirrors/attic/loop_old.py delete mode 100755 mirrors/attic/loop_old2.py delete mode 100755 mirrors/broken/NISP_Leg_cond.py delete mode 100755 mirrors/broken/mirrors01.py delete mode 100644 mirrors/broken/mirrors01_ansys_lfs.msh delete mode 100644 mirrors/broken/mirrors01_ansys_partition_lfs.msh delete mode 100755 mirrors/broken/mirrors03.py delete mode 100755 mirrors/broken/mirrors_test_battery.py delete mode 100644 mirrors/broken/small_mesh_lfs.msh delete mode 100755 mirrors/figs/LSP.py delete mode 100755 mirrors/figs/LSP_2.py delete mode 100755 mirrors/figs/LSP_3.py delete mode 100755 mirrors/figs/numpy_matplotlib01.py delete mode 100755 mirrors/figs/numpy_matplotlib02.py delete mode 100755 mirrors/figs/numpy_matplotlib03.py delete mode 100644 mirrors/models/__init__.py delete mode 100644 mirrors/models/cube_hex.geo delete mode 100644 mirrors/models/cube_hex.py delete mode 100644 mirrors/models/cube_tri.geo delete mode 100644 mirrors/models/cube_tri.py delete mode 100644 mirrors/models/mirror.geo delete mode 100755 mirrors/models/mirror_ss.py delete mode 100755 mirrors/mparams/mparams.py delete mode 100644 mirrors/mparams_sols/__init__.py delete mode 100755 mirrors/mparams_sols/s10x10.py delete mode 100755 mirrors/mparams_sols/s10x10_c_QR_10x10.py delete mode 100644 mirrors/mparams_sols/s10x10_c_QR_pre_10x10.py delete mode 100755 mirrors/mparams_sols/s30x30.py delete mode 100644 mirrors/mparams_sols/s30x30_c_QR_pre_30x30.py delete mode 100644 mirrors/src/CMakeLists.txt delete mode 100644 mirrors/src/mirrors.h delete mode 100644 mirrors/src/wANSYSSolution.cpp delete mode 100644 mirrors/src/wANSYSSolution.h delete mode 100644 mirrors/src/wMSurface.cpp delete mode 100644 mirrors/src/wMSurface.h delete mode 100644 mirrors/src/wMedium.cpp delete mode 100644 mirrors/src/wMedium.h delete mode 100644 mirrors/src/wProblem.cpp delete mode 100644 mirrors/src/wProblem.h delete mode 100644 mirrors/src/wSolver.cpp delete mode 100644 mirrors/src/wSolver.h delete mode 100644 mirrors/src/wTDirichlet.cpp delete mode 100644 mirrors/src/wTDirichlet.h delete mode 100644 mirrors/src/wTNeumann.cpp delete mode 100644 mirrors/src/wTNeumann.h delete mode 100644 mirrors/src/wTSource.cpp delete mode 100644 mirrors/src/wTSource.h delete mode 100644 mirrors/src/wThermoMecaTerm.cpp delete mode 100644 mirrors/src/wThermoMecaTerm.h delete mode 100644 mirrors/src/wuDirichlet.cpp delete mode 100644 mirrors/src/wuDirichlet.h delete mode 100644 mirrors/src/wuNeumann.cpp delete mode 100644 mirrors/src/wuNeumann.h delete mode 100644 mirrors/tests/.gitignore delete mode 100644 mirrors/tests/__init__.py delete mode 100644 mirrors/tests/mparams/__init__.py delete mode 100755 mirrors/tests/mparams/loop.py delete mode 100755 mirrors/tests/mparams/loop2.py delete mode 100755 mirrors/tests/mparams/loop3.py delete mode 100755 mirrors/tests/mparams/loop4.py delete mode 100755 mirrors/tests/mparams/loop5.py delete mode 100755 mirrors/tests/mparams/loop6.py delete mode 100755 mirrors/tests/mparams/loop7.py delete mode 100755 mirrors/tests/mparams/loop8.py delete mode 100755 mirrors/tests/mparams/mparams.py delete mode 100644 mirrors/tests/simple.py delete mode 100644 mirrors/viewer.py delete mode 100644 params/CMakeLists.txt delete mode 100644 params/CVT/CMakeLists.txt delete mode 100644 params/CVT/Makefile delete mode 100644 params/CVT/__init__.py delete mode 100644 params/CVT/_src/CMakeLists.txt delete mode 100644 params/CVT/_src/paramsCVTw.i delete mode 100644 params/CVT/python/__init__.py delete mode 100644 params/CVT/python/cvt_circle.txt delete mode 100644 params/CVT/python/cvt_circle3.txt delete mode 100644 params/CVT/python/cvt_circle4.txt delete mode 100644 params/CVT/python/cvt_circle5.txt delete mode 100644 params/CVT/python/cvt_circle6.txt delete mode 100644 params/CVT/python/cvt_circle7.txt delete mode 100644 params/CVT/python/normal.py delete mode 100644 params/CVT/python/rejection.py delete mode 100644 params/CVT/python/test.py delete mode 100644 params/CVT/python/test2D.py delete mode 100644 params/CVT/python/test2D2.py delete mode 100644 params/CVT/python/test3.py delete mode 100644 params/CVT/python/uniform.py delete mode 100644 params/CVT/src/CMakeLists.txt delete mode 100644 params/CVT/src/cvt.cpp delete mode 100644 params/CVT/src/cvt.hpp delete mode 100644 params/CVT/src/interface.cpp delete mode 100644 params/CVT/src/interface.hpp delete mode 100644 params/CVT/src/paramsCVT.h delete mode 100644 params/CVT/test/test.py delete mode 100644 params/__init__.py delete mode 100644 params/arnst_ponthot/__init__.py delete mode 100644 params/arnst_ponthot/src/__init__.py delete mode 100644 params/arnst_ponthot/src/gamma.py delete mode 100644 params/arnst_ponthot/tests/test.py delete mode 100644 params/arnst_ponthot/tests/test1.py delete mode 100644 params/arnst_ponthot/tests/test10.py delete mode 100644 params/arnst_ponthot/tests/test11.py delete mode 100644 params/arnst_ponthot/tests/test2.py delete mode 100644 params/arnst_ponthot/tests/test3.py delete mode 100644 params/arnst_ponthot/tests/test4.py delete mode 100644 params/arnst_ponthot/tests/test5.py delete mode 100644 params/arnst_ponthot/tests/test6.py delete mode 100644 params/arnst_ponthot/tests/test7.py delete mode 100644 params/arnst_ponthot/tests/test8.py delete mode 100644 params/arnst_ponthot/tests/test9.py delete mode 100755 params/dev_tests/LSP.py delete mode 100755 params/dev_tests/LSP_2.py delete mode 100755 params/dev_tests/LSP_3.py delete mode 100755 params/dev_tests/LSP_4.py delete mode 100755 params/dev_tests/LegPol.py delete mode 100755 params/dev_tests/LegPol2.py delete mode 100755 params/dev_tests/numpy_matplotlib01.py delete mode 100755 params/dev_tests/numpy_matplotlib02.py delete mode 100755 params/dev_tests/numpy_matplotlib03.py delete mode 100755 params/dev_tests/numpy_matplotlib04.py delete mode 100644 params/dev_tests/numpy_matplotlib05.py delete mode 100755 params/src/LSP_3.py delete mode 100644 params/src/__init__.py delete mode 100755 params/src/func.py delete mode 100644 params/src/gauss.py delete mode 100755 params/src/indices.py delete mode 100755 params/src/legendre.py delete mode 100755 params/src/legendre_norm.py delete mode 100755 params/src/monomials.py delete mode 100755 params/src/monomials_1norm.py delete mode 100755 params/src/plot.py delete mode 100644 params/src/voronoi.py delete mode 100755 params/src/write.py delete mode 100755 params/test/leg_lim.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 45710eed..ddf537d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,26 +153,14 @@ ENDIF() ADD_SUBDIRECTORY( ext ) -IF(WAVES_USE_FLOW) - ADD_SUBDIRECTORY( flow ) -ENDIF() - IF(WAVES_USE_HEAT) ADD_SUBDIRECTORY( heat ) ENDIF() -IF(WAVES_USE_MIRRORS) - ADD_SUBDIRECTORY( mirrors ) -ENDIF() - IF(WAVES_USE_KATOPTRON) ADD_SUBDIRECTORY( katoptron ) ENDIF() -IF(WAVES_USE_PARAMS) - ADD_SUBDIRECTORY( params ) -ENDIF() - IF(WAVES_USE_TLNOS) ADD_SUBDIRECTORY( tlnos ) ENDIF() diff --git a/README.md b/README.md index 93754a57..e38d97e1 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,9 @@ Waves is a collection of general utilities and finite element tools for solving ## Features Set of python/C++ modules: - [waves](/waves): 3D(Hex8) transient wave equation solver (FEM) - - [flow](/flow): 2D(Tri3) and 3D(Tetra4) steady full potential equation solver (FEM) + - [flow](https://gitlab.uliege.be/am-dept/dartflo): 2D(Tri3) and 3D(Tetra4) steady full potential equation solver (FEM) - moved to [dartflo](https://gitlab.uliege.be/am-dept/dartflo) - [heat](/heat): 2D(Tri3) steady nonlinear heat equation solver (multiscale FE²M) - - [mirrors](/mirrors): 3D(Hex8 and Tetra4) linear thermomechanical equations (FEM) - [katoptron](/katoptron): 3D(Hex8 and Tetra4) linear thermomechanical equations with contact (FEM) - - [params](/params): parametric study - [tlnos](/tlnos): basic Trilinos examples Additional features: diff --git a/ext/amfe b/ext/amfe index 073c11cb..7b5a21b0 160000 --- a/ext/amfe +++ b/ext/amfe @@ -1 +1 @@ -Subproject commit 073c11cb6ea51f23f4f8a915f4aee534fd6c5817 +Subproject commit 7b5a21b0c5fc3885a11e98ebc2e5acbd19bc55bf diff --git a/flow/CMakeLists.txt b/flow/CMakeLists.txt deleted file mode 100644 index 3fc1d71d..00000000 --- a/flow/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add source dir -ADD_SUBDIRECTORY( src ) -ADD_SUBDIRECTORY( _src ) - -# Add test dir -MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests) diff --git a/flow/README.md b/flow/README.md deleted file mode 100644 index 94ebc573..00000000 --- a/flow/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# flow -A wave module solving the Full Potential Equation - - - -## Main features -* Meshes generated using gmsh - - [x] 2D computations (Line2 and Tri3 elements) - - [x] 3D computations (Tri3 and Tetra4 elements) -* Solvers - - [x] nonlinear Newton-Raphson with analytic tangent matrix and quadratic or Bank&Rose line search - - [x] linear Intel MKL Pardiso or Eigen's GMRES or MUMPS -* Post-processing - - [x] data extracted at nodes readily available in python and saved to disk - - [x] ascii, gmsh or vtk data format -* Various - - [x] multi-isolated lifting surfaces (e.g. wing/tail) generated using geoGen - - [x] Kutta condition enforced through direct matrix maniplation - - [x] adaptive artificial viscosity computed with best-upstream-alignement strategy - - [x] mesh deformation using linear elasticity laws and aeroelastic computation using CUPyDO - -## Sub-modules -* [tests](flow/tests): simple tests to be run in battery checking the basic functionnalities of the solver -* [validation](flow/validation): large-scale tests used to validate the solver results -* [benchmark](flow/benchmark): large-scale tests used to monitor the performance -* [cases](flow/cases) : sample configuration files meant to be run with scripts, user-defined case should be derived from these -* [scripts](flow/scripts): various scripts for running the solver automatically diff --git a/flow/__init__.py b/flow/__init__.py deleted file mode 100644 index edc67b07..00000000 --- a/flow/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# flow MODULE initialization file - -import fwk -import tbox -from floww import * diff --git a/flow/_src/CMakeLists.txt b/flow/_src/CMakeLists.txt deleted file mode 100644 index 1ad40ec9..00000000 --- a/flow/_src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# CMake input file of the SWIG wrapper around "floww.so" - -INCLUDE(${SWIG_USE_FILE}) - -FILE(GLOB SRCS *.h *.cpp *.inl *.swg) -FILE(GLOB ISRCS *.i) - -SET(CMAKE_SWIG_FLAGS "") -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON) - -SET(SWINCFLAGS --I${PROJECT_SOURCE_DIR}/flow/src --I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src --I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src --I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src --I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src -) -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}") - -if (${CMAKE_VERSION} VERSION_LESS "3.8.0") - SWIG_ADD_MODULE(floww python ${ISRCS} ${SRCS}) -else() - SWIG_ADD_LIBRARY(floww LANGUAGE python SOURCES ${ISRCS} ${SRCS}) -endif() -MACRO_DebugPostfix(_floww) - -TARGET_INCLUDE_DIRECTORIES(_floww PRIVATE ${PROJECT_SOURCE_DIR}/flow/_src - ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src - ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src - ${PYTHON_INCLUDE_PATH} -) - -SWIG_LINK_LIBRARIES(floww - flow tbox fwk ${PYTHON_LIBRARIES} -) - -INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/floww.py DESTINATION ${CMAKE_INSTALL_PREFIX}) -INSTALL(TARGETS _floww DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/flow/_src/floww.h b/flow/_src/floww.h deleted file mode 100644 index 31c8a04f..00000000 --- a/flow/_src/floww.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wAdjoint.h" -#include "wAssign.h" -#include "wBlowing.h" -#include "wBoundary.h" -#include "wFreestream.h" -#include "wKutta.h" -#include "wKuttaElement.h" -#include "wMedium.h" -#include "wNewton.h" -#include "wPicard.h" -#include "wProblem.h" -#include "wSolver.h" -#include "wWake.h" -#include "wWakeElement.h" \ No newline at end of file diff --git a/flow/_src/floww.i b/flow/_src/floww.i deleted file mode 100644 index 2297bd0e..00000000 --- a/flow/_src/floww.i +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// SWIG input file of the 'flow' module - -%feature("autodoc","1"); - -%module(docstring= -"'floww' module: full potential solver 2018-2021 -(c) ULg - A&M", -directors="0", -threads="1" -) floww -%{ - -#include "flow.h" - -#include "fwkw.h" -#include "tboxw.h" -#include "floww.h" - -%} - - -%include "fwkw.swg" - -// ----------- MODULES UTILISES ------------ -%import "tboxw.i" - -// ----------- FLOW CLASSES ---------------- -%include "flow.h" - -%shared_ptr(flow::Medium); -%shared_ptr(flow::Assign); -%shared_ptr(flow::Initial); -%shared_ptr(flow::Dirichlet); -%shared_ptr(flow::Freestream); -%shared_ptr(flow::Wake); -%shared_ptr(flow::Kutta); -%shared_ptr(flow::Blowing); -%shared_ptr(flow::Boundary); -%shared_ptr(flow::Problem); -%shared_ptr(flow::Solver); -%shared_ptr(flow::Picard); -%shared_ptr(flow::Newton); -%shared_ptr(flow::Adjoint); - -%include "wMedium.h" -%include "wAssign.h" -%include "wFreestream.h" -%warnfilter(509); // Shadowed constructor. Code compiling and running. -%include "wWake.h" -%include "wKutta.h" -%include "wBoundary.h" -%include "wBlowing.h" -%warnfilter(+509); -%include "wWakeElement.h" -%include "wKuttaElement.h" - -%immutable flow::Problem::msh; // read-only variable (no setter) -%include "wProblem.h" - -%immutable flow::Solver::pbl; -%immutable flow::Solver::linsol; // read-only variable (no setter) -%include "wSolver.h" -%include "wPicard.h" -%include "wNewton.h" - -%immutable flow::Adjoint::sol; -%immutable flow::Adjoint::def; -%immutable flow::Adjoint::linsol; // read-only variable (no setter) -%include "wAdjoint.h" diff --git a/flow/benchmark/onera.py b/flow/benchmark/onera.py deleted file mode 100644 index b9b531c2..00000000 --- a/flow/benchmark/onera.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute flow around the Onera M6 wing at 3 degrees AOA and Mach 0.84 for benchmark -# Adrien Crovato - -import numpy as np -import flow.default as floD -import flow.utils as floU -import tbox.utils as tbxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -try: - import tboxVtk - BestWriter = tboxVtk.VtkExport - canPost = True -except: - BestWriter = tbox.GmshExport - canPost = False - -def newton(pbl): - from fwk.wutils import parseargs - import flow - import tbox - # Pardiso and GMRES should give similar perfs - try: - newton = flow.Newton(pbl, tbox.Pardiso()) - except: - gmres = tbox.Gmres() - gmres.setFillFactor(2) - gmres.setDropTol(1e-6) - gmres.setRestart(50) - gmres.setTolerance(1e-5) - newton = flow.Newton(pbl, gmres) - newton.nthreads = parseargs().k - newton.verbose = 1 - newton.relTol = 1e-6 - newton.absTol = 1e-8 - newton.lsTol = 1e-6 - newton.avThrsh = 1e-2 - return newton - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3.06*np.pi/180 - M_inf = 0.839 - dim = 3 - - # define dimension - S_ref = 0.7528 # reference area - c_ref = 0.64 # reference chord (MAC) - - # mesh the wing - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - msh, writer = floD.mesh(dim, 'benchmark/onera_lfs.msh', {}, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, _, _ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = newton(pbl) - solver.run() - solver.save(writer) - tms['solver'].stop() - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('CL', solver.Cl, 0.29, 1e-1)) - tests.add(CTest('CD', solver.Cd, 0.011, 1e-1)) - tests.add(CTest('CS', solver.Cs, 0.014, 1e-1)) - tests.add(CTest('CM', solver.Cm, -0.212, 1e-1)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/benchmark/onera_lfs.msh b/flow/benchmark/onera_lfs.msh deleted file mode 100644 index bad88348..00000000 --- a/flow/benchmark/onera_lfs.msh +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da782b51f3be6ff2b8d222ed9ad1aba46849b2d018df294ac5f780a0258a74c8 -size 39450759 diff --git a/flow/cases/coyote.py b/flow/cases/coyote.py deleted file mode 100644 index d56f41d6..00000000 --- a/flow/cases/coyote.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Coyote - Advanced Pilot Training Aircraft -# Plane designed for the AIAA 2017-2018 aircraft design competition -# by Raphael Dubois, Thibault Laurent, Bao Long Le Van, Nayan Levaux, -# Guillaume Noiset, Axel Piret, Arthur Scheffer, and Vincent Schmitz -# CAD created by Nayan Levaux and exported by Adrien Crovato -# Valid mesh obtained with gmsh 4.4.1 - -def getParam(): - p = {} - # Specific - scl = 2 # scaling factor for lifting surface mesh size - wrtems = scl*0.036 # wing root trailing edge mesh size - trtems = scl*0.028 # tail root trailing mesh size - fums = 0.1 # fuselage mesh size - fams = 5. # farfield mesh size - # Input/Output - p['File'] = '../models/coyote.geo' # Input file containing the model - p['Pars'] = {'msWing' : wrtems, 'msTail' : trtems, - 'msFus' : fums, 'msFar' : fams} # Parameters for input file model - p['Dim'] = 3 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - p['Slice'] = [1.8, 3.5, 5.3] # array of (y) coordinates to perform slice along the span (empty if none) - p['TagId'] = 9 # tag number of physical group to be sliced - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of names of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Fuselage'] = 'fuselage' # Name of physical group containing the fuselage boundaries - p['Wings'] = ['wing', 'tail'] # LIST of names of physical groups containing the lifting surface boundary - p['Wakes'] = ['wakeW', 'wakeT'] # LIST of names of physical group containing the wake - p['WakeTips'] = ['wakeTipW', 'wakeTipT'] # LIST of names of physical group containing the edge of the wake - p['TeTips'] = ['teTipW', 'teTipT'] # LIST of names of physical group containing the edge of the wake and the trailing edge - # Freestream - p['M_inf'] = 0.8 # Freestream Mach number - p['AoA_begin'] = 1 # Freestream angle of attack (begin) - p['AoA_end'] = 1 # Freestream angle of attack (end) - p['AoA_step'] = 1. # Freestream angle of attack (step) - p['AoS'] = 3. # Freestream angle of sideslip - # Geometry - p['S_ref'] = 25 # Reference surface length - p['c_ref'] = 2.6 # Reference chord length - p['x_ref'] = 8.9 # Reference point for moment computation (x) - p['y_ref'] = 1.8 # Reference point for moment computation (y) - p['z_ref'] = 0.8 # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'GMRES' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['G_fill'] = 2 # Fill-in factor for GMRES preconditioner - p['G_tol'] = 1e-5 # Tolerance for GMRES - p['G_restart'] = 50 # Restart for GMRES - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 15 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.polar as p - polar = p.Polar(getParam()) - polar.run() - polar.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/n0012.py b/flow/cases/n0012.py deleted file mode 100644 index dae28aca..00000000 --- a/flow/cases/n0012.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## NACA 0012 airfoil configuration file for flow polar script -# Adrien Crovato - -def getParam(): - p = {} - # Input/Output - p['File'] = '../models/n0012.geo' # Input file containing the model - p['Pars'] = {'xLength' : 5, 'yLength' : 5, 'sEleFar' : 1.0, 'sEleAirfTE' : 0.01, 'sEleAirfLE' : 0.005} # Parameters for input file model - p['Dim'] = 2 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of name of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Wing'] = 'airfoil' # Name of physical group containing the airfoil boundary - p['Wake'] = 'wake' # Name of physical group containing the wake - p['Te'] = 'te' # Name of physical group containing the trailing edge - # Freestream - p['M_inf'] = 0.3 # Freestream Mach number - p['AoA_begin'] = -3. # Freestream angle of attack (begin) - p['AoA_end'] = 3. # Freestream angle of attack (end) - p['AoA_step'] = 1. # Freestream angle of attack (step) - # Geometry - p['S_ref'] = 1. # Reference surface length (c_ref for 2D) - p['c_ref'] = 1. # Reference chord length - p['x_ref'] = 0.25 # Reference point for moment computation (x) - p['y_ref'] = 0. # Reference point for moment computation (y) - p['z_ref'] = 0. # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'SparseLU' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['NSolver'] = 'Picard' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 20 # Solver maximum number of iterations - p['Relaxation'] = 0.7 # Relaxation parameter for Picard solver - return p - -def main(): - # Script call - import flow.scripts.polar as p - polar = p.Polar(getParam()) - polar.run() - polar.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/n0012_3.py b/flow/cases/n0012_3.py deleted file mode 100644 index 58bda7b7..00000000 --- a/flow/cases/n0012_3.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## NACA 0012 wing configuration file for flow polar script -# Adrien Crovato - -def getParam(): - p = {} - # Specific - span = 1. # span length - # Input/Output - p['File'] = '../models/n0012_3.geo' # Input file containing the model - p['Pars'] = {'spn' : span, 'lgt' : 3., 'wdt' : 3., 'hgt' : 3., 'msLe' : 0.02, 'msTe' : 0.02, 'msF' : 1.} # Parameters for input file model - p['Dim'] = 3 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - p['Slice'] = [0.01, 0.25, 0.5, 0.75, 0.95] # array of (y) coordinates to perform slice along the span (empty if none) - p['TagId'] = 4 # tag number of physical group to be sliced - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of name of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Symmetry'] = 'symmetry' # Name of physical group containing the symmetry boundaries - p['Wings'] = ['wing'] # LIST of names of physical groups containing the lifting surface boundary - p['Wakes'] = ['wake'] # LIST of names of physical group containing the wake - p['WakeTips'] = ['wakeTip'] # LIST of names of physical group containing the edge of the wake - p['TeTips'] = ['teTip'] # LIST of names of physical group containing the edge of the wake and the trailing edge - # Freestream - p['M_inf'] = 0.3 # Freestream Mach number - p['AoA_begin'] = -3. # Freestream angle of attack (begin) - p['AoA_end'] = 3. # Freestream angle of attack (end) - p['AoA_step'] = 1. # Freestream angle of attack (step) - # Geometry - p['S_ref'] = 1.*span # Reference surface length - p['c_ref'] = 1. # Reference chord length - p['x_ref'] = 0.25 # Reference point for moment computation (x) - p['y_ref'] = 0. # Reference point for moment computation (y) - p['z_ref'] = 0. # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'MUMPS' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 10 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.polar as p - polar = p.Polar(getParam()) - polar.run() - polar.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/n64A410.py b/flow/cases/n64A410.py deleted file mode 100644 index ea278bf3..00000000 --- a/flow/cases/n64A410.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## NACA 64A210 airfoil configuration file for flow trim script -# Adrien Crovato - -def getParam(): - p = {} - # Input/Output - p['File'] = '../models/n64A410.geo' # Input file containing the model - p['Pars'] = {'xLength' : 5, 'yLength' : 5, 'sEleFar' : 1.0, 'sEleAirfTE' : 0.01, 'sEleAirfLE' : 0.01} # Parameters for input file model - p['Dim'] = 2 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of name of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Wing'] = 'airfoil' # Name of physical group containing the airfoil boundary - p['Wake'] = 'wake' # Name of physical group containing the wake - p['Te'] = 'te' # Name of physical group containing the trailing edge - # Freestream - p['M_inf'] = 0.65 # Freestream Mach number - p['CL'] = 0.8 # Target lift coefficient - p['AoA'] = 3. # Freestream angle of attack (guess) - p['dCL'] = 6.2 # Slope of CL w.r.t AoA [1/rad] (guess) - # Geometry - p['S_ref'] = 1. # Reference surface length (c_ref for 2D) - p['c_ref'] = 1. # Reference chord length - p['x_ref'] = 0.25 # Reference point for moment computation (x) - p['y_ref'] = 0. # Reference point for moment computation (y) - p['z_ref'] = 0. # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'Pardiso' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 25 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.trim as t - trim = t.Trim(getParam()) - trim.run() - trim.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/rae2822.py b/flow/cases/rae2822.py deleted file mode 100644 index ce37142b..00000000 --- a/flow/cases/rae2822.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## RAE 2822 airfoil configuration file for flow polar script -# Adrien Crovato - -def getParam(): - p = {} - # Input/Output - p['File'] = '../models/rae2822.geo' # Input file containing the model - p['Pars'] = {'xLength' : 5, 'yLength' : 5, 'sEleFar' : 1.0, 'sEleAirfTE' : 0.01, 'sEleAirfLE' : 0.005} # Parameters for input file model - p['Dim'] = 2 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of names of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Wing'] = 'airfoil' # Name of physical group containing the airfoil boundary - p['Wake'] = 'wake' # Name of physical group containing the wake - p['Te'] = 'te' # Name of physical group containing the trailing edge - # Freestream - p['M_inf'] = 0.6 # Freestream Mach number - p['AoA_begin'] = -3. # Freestream angle of attack (begin) - p['AoA_end'] = 3. # Freestream angle of attack (end) - p['AoA_step'] = 1. # Freestream angle of attack (step) - # Geometry - p['S_ref'] = 1. # Reference surface length (c_ref for 2D) - p['c_ref'] = 1. # Reference chord length - p['x_ref'] = 0.25 # Reference point for moment computation (x) - p['y_ref'] = 0. # Reference point for moment computation (y) - p['z_ref'] = 0. # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'GMRES' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['G_fill'] = 2 # Fill-in factor for GMRES preconditioner - p['G_tol'] = 1e-5 # Tolerance for GMRES - p['G_restart'] = 50 # Restart for GMRES - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 10 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.polar as p - polar = p.Polar(getParam()) - polar.run() - polar.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/wbht.py b/flow/cases/wbht.py deleted file mode 100644 index e657432e..00000000 --- a/flow/cases/wbht.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Wing-body-tail configuration file for flow trim script -# Adrien Crovato -# -# CAUTION -# Gmsh might not generate the wing/tail surfaces properly. Results might not be accurate - -def getParam(): - p = {} - # Specific - scl = 2 # scaling factor for lifting surface mesh size - wrlems = scl*0.0210 # wing root leading edge mesh size - wrtems = scl*0.0210 # wing root trailing edge mesh size - wtlems = scl*0.0090 # wing tip leading edge mesh size - wttems = scl*0.0090 # wing tip trailing edge mesh size - wwlems = scl*0.0042 # wing winglet leading mesh size - wwtems = scl*0.0060 # wing winglet trailing mesh size - trlems = scl*0.0089 # tail root leading mesh size - trtems = scl*0.0089 # tail root trailing mesh size - ttlems = scl*0.0058 # tail tip leading mesh size - tttems = scl*0.0058 # tail tip trailing mesh size - fums = 0.15 # fuselage mesh size - fucms = 0.01 # fuselage caps mesh size - fams = 5. # farfield mesh size - # Input/Output - p['File'] = '../models/wbht.geo' # Input file containing the model - p['Pars'] = {'msLeW0' : wrlems, 'msTeW0' : wrtems, - 'msLeW1' : wtlems, 'msTeW1' : wttems, - 'msLeW2' : wwlems, 'msTeW2' : wwtems, - 'msLeT0' : trlems, 'msTeT0' : trtems, - 'msLeT1' : ttlems, 'msTeT1' : tttems, - 'msFus' : fums, 'msFusCaps' : fucms, 'msFar' : fams} # Parameters for input file model - p['Dim'] = 3 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - p['Slice'] = [0.83, 3.0, 4.0, 6.2, 6.9] # array of (y) coordinates to perform slice along the span (empty if none) - p['TagId'] = 10 # tag number of physical group to be sliced - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of names of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Symmetry'] = 'symmetry' # Name of physical group containing the symmetry boundaries - p['Fuselage'] = 'fuselage' # Name of physical group containing the fuselage boundaries - p['Wings'] = ['wing', 'tail'] # LIST of names of physical groups containing the lifting surface boundary - p['Wakes'] = ['wakeW', 'wakeT'] # LIST of names of physical group containing the wake - p['WakeTips'] = ['wakeTipW', 'wakeTipT'] # LIST of names of physical group containing the edge of the wake - p['TeTips'] = ['teTipW', 'teTipT'] # LIST of names of physical group containing the edge of the wake and the trailing edge - # Freestream - p['M_inf'] = 0.75 # Freestream Mach number - p['CL'] = 0.4 # Target lift coefficient - p['AoA'] = 0. # Freestream angle of attack (guess) - p['dCL'] = 7.5 # Slope of CL w.r.t AoA [1/rad] (guess) - # Geometry - p['S_ref'] = 8.9 # Reference surface length - p['c_ref'] = 1.7 # Reference chord length - p['x_ref'] = 4.74 # Reference point for moment computation (x) - p['y_ref'] = 0.66 # Reference point for moment computation (y) - p['z_ref'] = -0.5 # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'GMRES' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['G_fill'] = 2 # Fill-in factor for GMRES preconditioner - p['G_tol'] = 1e-5 # Tolerance for GMRES - p['G_restart'] = 50 # Restart for GMRES - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 15 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.trim as t - trim = t.Trim(getParam()) - trim.run() - trim.disp() - -if __name__ == "__main__": - main() diff --git a/flow/cases/wht.py b/flow/cases/wht.py deleted file mode 100644 index 0cf2213f..00000000 --- a/flow/cases/wht.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Wing-tail configuration file for flow trim script -# Adrien Crovato - -def getParam(): - p = {} - # Specific - scl = 2 # scaling factor for lifting surface mesh size - wrlems = scl*0.0210 # wing root leading edge mesh size - wrtems = scl*0.0210 # wing root trailing edge mesh size - wtlems = scl*0.0090 # wing tip leading edge mesh size - wttems = scl*0.0090 # wing tip trailing edge mesh size - wwlems = scl*0.0042 # wing winglet leading mesh size - wwtems = scl*0.0060 # wing winglet trailing mesh size - trlems = scl*0.0089 # tail root leading mesh size - trtems = scl*0.0089 # tail root trailing mesh size - ttlems = scl*0.0058 # tail tip leading mesh size - tttems = scl*0.0058 # tail tip trailing mesh size - fams = 5. # farfield mesh size - # Input/Output - p['File'] = '../models/wht.geo' # Input file containing the model - p['Pars'] = {'msLeW0' : wrlems, 'msTeW0' : wrtems, - 'msLeW1' : wtlems, 'msTeW1' : wttems, - 'msLeW2' : wwlems, 'msTeW2' : wwtems, - 'msLeT0' : trlems, 'msTeT0' : trtems, - 'msLeT1' : ttlems, 'msTeT1' : tttems, - 'msFar' : fams} # Parameters for input file model - p['Dim'] = 3 # Problem dimension - p['Format'] = 'vtk' # Save format (vtk or gmsh) - p['Slice'] = [0.01, 3.0, 4.0, 6.2, 6.9] # array of (y) coordinates to perform slice along the span (empty if none) - p['TagId'] = 9 # tag number of physical group to be sliced - # Markers - p['Fluid'] = 'field' # Name of physical group containing the fluid - p['Farfield'] = ['upstream', 'farfield', 'downstream'] # LIST of names of physical groups containing the farfield boundaries (upstream/downstream should be first/last element) - p['Symmetry'] = 'symmetry' # Name of physical group containing the symmetry boundaries - p['Wings'] = ['wing', 'tail'] # LIST of names of physical groups containing the lifting surface boundary - p['Wakes'] = ['wakeW', 'wakeT'] # LIST of names of physical group containing the wake - p['WakeTips'] = ['wakeTipW', 'wakeTipT'] # LIST of names of physical group containing the edge of the wake - p['TeTips'] = ['teTipW', 'teTipT'] # LIST of names of physical group containing the edge of the wake and the trailing edge - # Freestream - p['M_inf'] = 0.75 # Freestream Mach number - p['CL'] = 0.4 # Target lift coefficient - p['AoA'] = 0. # Freestream angle of attack (guess) - p['dCL'] = 7.5 # Slope of CL w.r.t AoA [1/rad] (guess) - # Geometry - p['S_ref'] = 8.9 # Reference surface length - p['c_ref'] = 1.7 # Reference chord length - p['x_ref'] = 0.0 # Reference point for moment computation (x) - p['y_ref'] = 0.0 # Reference point for moment computation (y) - p['z_ref'] = 0.0 # Reference point for moment computation (z) - # Numerical - p['LSolver'] = 'Pardiso' # Linear solver (Pardiso, GMRES, MUMPS or SparseLU) - p['NSolver'] = 'Newton' # Noninear solver type (Picard or Newton) - p['Rel_tol'] = 1e-6 # Relative tolerance on solver residual - p['Abs_tol'] = 1e-8 # Absolute tolerance on solver residual - p['Max_it'] = 15 # Solver maximum number of iterations - p['LS_tol'] = 1e-6 # Tolerance on linesearch residual - p['Max_it_LS'] = 10 # Linesearch maximum number of iterations - p['AV_thrsh'] = 1e-2 # Residual threshold below which the artificial viscosity is decreased - return p - -def main(): - # Script call - import flow.scripts.trim as t - trim = t.Trim(getParam()) - trim.run() - trim.disp() - -if __name__ == "__main__": - main() diff --git a/flow/default.py b/flow/default.py deleted file mode 100644 index 0ac74567..00000000 --- a/flow/default.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Default initialization for flow tests -# Adrien Crovato - -from fwk.wutils import parseargs -import flow as flo -import tbox - -def mesh(dim, file, pars, bnd, wk = 'wake', wktp = None): - '''Initialize mesh and mesh writer - ''' - import tbox.gmsh as gmsh - # load the mesh - msh = gmsh.MeshLoader(file,__file__).execute(**pars) - # crack the mesh - mshCrck = tbox.MshCrack(msh, dim) - mshCrck.setCrack(wk) - mshCrck.addBoundaries(bnd) - if dim == 3 and wktp is not None: - mshCrck.setExcluded(wktp) - mshCrck.run() - del mshCrck - # create writer - gmshWriter = tbox.GmshExport(msh) - gmshWriter.save(msh.name) - return msh, gmshWriter - -def problem(msh, dim, alpha, beta, minf, sref, lref, xref, yref, zref, sur, fld = 'field', upstr = 'upstream', ff = 'farfield', dnstr = 'downstream', wk = 'wake', te = None, tp = None, vsc = False, dbc = False): - '''Initialize problem - ''' - # create base formulation - pbl = flo.Problem(msh, dim, alpha, beta, minf, sref, lref, xref, yref, zref) - # add incompressible or compressible air medium - pbl.set(flo.Medium(msh, fld, minf, dim, alpha, beta)) - # add initial condition - pbl.set(flo.Initial(msh, fld, dim, alpha, beta)) - if dbc: - # Dirichlet BCs provided and explicitely imposed - dirichlet = flo.Dirichlet(msh, upstr, dim, alpha, beta) - pbl.add(dirichlet) - else: - # Dirichlet BCs not provided, Neumann imposed instead, and a DOF will be pinned automatically - dirichlet = None - pbl.add(flo.Freestream(msh, upstr, dim, alpha, beta)) - # add freestream (Neumann) conditions - pbl.add(flo.Freestream(msh, ff, dim, alpha, beta)) - pbl.add(flo.Freestream(msh, dnstr, dim, alpha, beta)) - # add wake and Kutta conditions - if dim == 2 and te is not None: - wake = flo.Wake(msh, [wk, wk+'_', fld]) - pbl.add(wake) - pbl.add(flo.Kutta(msh, [te, wk+'_', sur, fld])) - elif dim == 3: - wake = flo.Wake(msh, [wk, wk+'_', fld, tp]) - pbl.add(wake) - else: - wake = None - # add boundary of interest - bnd = flo.Boundary(msh, [sur, fld]) - pbl.add(bnd) - # add transpiration BC (VII) - if vsc: - blw = flo.Blowing(msh, sur) - blww = flo.Blowing(msh, wk) - pbl.add(blw) - pbl.add(blww) - else: - blw = None - blww = None - return pbl, dirichlet, wake, bnd, [blw, blww] - -def picard(pbl): - '''Initialize Picard solver - ''' - args = parseargs() - solver = flo.Picard(pbl, tbox.Gmres()) - solver.nthreads = args.k - solver.verbose = args.verb - solver.relTol = 1e-6 - solver.absTol = 1e-8 - solver.maxIt = 25 - solver.relax = 0.7 - return solver - -def newton(pbl): - '''Initialize Newton solver - ''' - from tbox.solvers import LinearSolver - args = parseargs() - solver = flo.Newton(pbl, LinearSolver().pardiso()) - solver.nthreads = args.k - solver.verbose = args.verb - solver.relTol = 1e-6 - solver.absTol = 1e-8 - solver.maxIt = 25 - solver.lsTol = 1e-6 - solver.maxLsIt = 10 - solver.avThrsh = 1e-2 - return solver - -def meshMorpher(msh, dim, mov, fxd = ['upstream', 'farfield', 'downstream'], fld = 'field', wk = 'wake', sym = 'symmetry'): - '''Initialize mesh morpher - ''' - args = parseargs() - mshDef = tbox.MshDeform(msh, dim, args.k) - mshDef.setField(fld) - mshDef.addFixed(fxd) - mshDef.addMoving(mov) - if dim == 3: - mshDef.setSymmetry(sym, 1) - mshDef.addInternal([wk, wk+'_']) - mshDef.initialize() - return mshDef - -def adjoint(solver, morpher): - '''Initialize adjoint solver - ''' - from tbox.solvers import LinearSolver - adjoint = flo.Adjoint(solver, morpher, LinearSolver().pardiso()) - return adjoint - -def initViewer(problem): - '''Initialize viewer - ''' - args = parseargs() - if not args.nogui: - from tbox.viewer import GUI - GUI().open( problem.msh.name ) diff --git a/flow/models/agard445.geo b/flow/models/agard445.geo deleted file mode 100644 index c7007513..00000000 --- a/flow/models/agard445.geo +++ /dev/null @@ -1,385 +0,0 @@ -/* AGARD 445 wing */ -// Initially generated by unsRgridWingGen.m -// For gmsh 4, use line 220 instead of line 221 (Bezier <- BSpline) - -// Parameters -// domain and mesh -DefineConstant[ xO = { -3, Name "Box origin (x)" } ]; -DefineConstant[ zO = { -3, Name "Box origin (z)" } ]; -DefineConstant[ xL = { 7, Name "Box length" } ]; -DefineConstant[ yL = { 3, Name "Box width" } ]; -DefineConstant[ zL = { 6, Name "Box height" } ]; -DefineConstant[ msLeRt = { 0.005, Name "Root leading edge mesh size" } ]; -DefineConstant[ msTeRt = { 0.005, Name "Root trailing edge mesh size" } ]; -DefineConstant[ msLeTp = { 0.003, Name "Tip leading edge mesh size" } ]; -DefineConstant[ msTeTp = { 0.003, Name "Tip trailing edge mesh size" } ]; -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; - -//// GEOMETRY - - -/// Points - -// Airfoil 1: agard445, 51 points -Point(1) = {0.559000,0.000000,0.000000,msTeRt}; -Point(2) = {0.531050,0.000000,0.001398}; -Point(3) = {0.503100,0.000000,0.002739,msTeRt}; -Point(4) = {0.475150,0.000000,0.004075}; -Point(5) = {0.447200,0.000000,0.005406}; -Point(6) = {0.419250,0.000000,0.006680}; -Point(7) = {0.391300,0.000000,0.007837}; -Point(8) = {0.363350,0.000000,0.008866}; -Point(9) = {0.335400,0.000000,0.009743}; -Point(10) = {0.307450,0.000000,0.010442}; -Point(11) = {0.279500,0.000000,0.010923}; -Point(12) = {0.251550,0.000000,0.011158}; -Point(13) = {0.223600,0.000000,0.011163}; -Point(14) = {0.195650,0.000000,0.010968}; -Point(15) = {0.167700,0.000000,0.010576,1.5*msLeRt}; -Point(16) = {0.139750,0.000000,0.009995}; -Point(17) = {0.111800,0.000000,0.009196}; -Point(18) = {0.083850,0.000000,0.008156}; -Point(19) = {0.055900,0.000000,0.006781}; -Point(20) = {0.041925,0.000000,0.005920}; -Point(21) = {0.027950,0.000000,0.004891}; -Point(22) = {0.013975,0.000000,0.003617}; -Point(23) = {0.006988,0.000000,0.002622}; -Point(24) = {0.004193,0.000000,0.002057}; -Point(25) = {0.002795,0.000000,0.001699}; -Point(26) = {0.000000,0.000000,0.000000,msLeRt}; -Point(27) = {0.002795,0.000000,-0.001699}; -Point(28) = {0.004193,0.000000,-0.002057}; -Point(29) = {0.006988,0.000000,-0.002622}; -Point(30) = {0.013975,0.000000,-0.003617}; -Point(31) = {0.027950,0.000000,-0.004891}; -Point(32) = {0.041925,0.000000,-0.005920}; -Point(33) = {0.055900,0.000000,-0.006781}; -Point(34) = {0.083850,0.000000,-0.008156}; -Point(35) = {0.111800,0.000000,-0.009196}; -Point(36) = {0.139750,0.000000,-0.009995}; -Point(37) = {0.167700,0.000000,-0.010576,1.5*msLeRt}; -Point(38) = {0.195650,0.000000,-0.010968}; -Point(39) = {0.223600,0.000000,-0.011163}; -Point(40) = {0.251550,0.000000,-0.011158}; -Point(41) = {0.279500,0.000000,-0.010923}; -Point(42) = {0.307450,0.000000,-0.010442}; -Point(43) = {0.335400,0.000000,-0.009743}; -Point(44) = {0.363350,0.000000,-0.008866}; -Point(45) = {0.391300,0.000000,-0.007837}; -Point(46) = {0.419250,0.000000,-0.006680}; -Point(47) = {0.447200,0.000000,-0.005406}; -Point(48) = {0.475150,0.000000,-0.004075}; -Point(49) = {0.503100,0.000000,-0.002739,msTeRt}; -Point(50) = {0.531050,0.000000,-0.001398,msTeRt}; - -// Airfoil 2: agard445, 51 points -Point(52) = {1.178128,0.762000,0.000000,msTeTp}; -Point(53) = {1.159709,0.762000,0.000921}; -Point(54) = {1.141290,0.762000,0.001805,msTeTp}; -Point(55) = {1.122870,0.762000,0.002685}; -Point(56) = {1.104451,0.762000,0.003562}; -Point(57) = {1.086032,0.762000,0.004402}; -Point(58) = {1.067613,0.762000,0.005165}; -Point(59) = {1.049194,0.762000,0.005843}; -Point(60) = {1.030775,0.762000,0.006421}; -Point(61) = {1.012356,0.762000,0.006881}; -Point(62) = {0.993937,0.762000,0.007198}; -Point(63) = {0.975518,0.762000,0.007353}; -Point(64) = {0.957099,0.762000,0.007357}; -Point(65) = {0.938680,0.762000,0.007228}; -Point(66) = {0.920261,0.762000,0.006970,1.5*msLeTp}; -Point(67) = {0.901842,0.762000,0.006587}; -Point(68) = {0.883423,0.762000,0.006060}; -Point(69) = {0.865004,0.762000,0.005375}; -Point(70) = {0.846585,0.762000,0.004468}; -Point(71) = {0.837375,0.762000,0.003901}; -Point(72) = {0.828166,0.762000,0.003223}; -Point(73) = {0.818956,0.762000,0.002383}; -Point(74) = {0.814351,0.762000,0.001728}; -Point(75) = {0.812509,0.762000,0.001356}; -Point(76) = {0.811589,0.762000,0.001120}; -Point(77) = {0.809747,0.762000,0.000000,msLeTp}; -Point(78) = {0.811589,0.762000,-0.001120}; -Point(79) = {0.812509,0.762000,-0.001356}; -Point(80) = {0.814351,0.762000,-0.001728}; -Point(81) = {0.818956,0.762000,-0.002383}; -Point(82) = {0.828166,0.762000,-0.003223}; -Point(83) = {0.837375,0.762000,-0.003901}; -Point(84) = {0.846585,0.762000,-0.004468}; -Point(85) = {0.865004,0.762000,-0.005375}; -Point(86) = {0.883423,0.762000,-0.006060}; -Point(87) = {0.901842,0.762000,-0.006587}; -Point(88) = {0.920261,0.762000,-0.006970,1.5*msLeTp}; -Point(89) = {0.938680,0.762000,-0.007228}; -Point(90) = {0.957099,0.762000,-0.007357}; -Point(91) = {0.975518,0.762000,-0.007353}; -Point(92) = {0.993937,0.762000,-0.007198}; -Point(93) = {1.012356,0.762000,-0.006881}; -Point(94) = {1.030775,0.762000,-0.006421}; -Point(95) = {1.049194,0.762000,-0.005843}; -Point(96) = {1.067613,0.762000,-0.005165}; -Point(97) = {1.086032,0.762000,-0.004402}; -Point(98) = {1.104451,0.762000,-0.003562}; -Point(99) = {1.122870,0.762000,-0.002685}; -Point(100) = {1.141290,0.762000,-0.001805,msTeTp}; -Point(101) = {1.159709,0.762000,-0.000921,msTeTp}; - -// Box: -Point(5001) = {xO,0.000000,zO,msF}; -Point(5002) = {xO+xL,0.000000,zO,msF}; -Point(5003) = {xO,0.000000,zO+zL,msF}; -Point(5004) = {xO+xL,0.000000,zO+zL,msF}; -Point(5005) = {xO,yL,zO,msF}; -Point(5006) = {xO+xL,yL,zO,msF}; -Point(5007) = {xO,yL,zO+zL,msF}; -Point(5008) = {xO+xL,yL,zO+zL,msF}; - -// Tip: -Point(5101) = {1.159709,0.762000,0.000000}; -Point(5102) = {1.141290,0.762268,0.000000,msTeTp}; -Point(5103) = {1.122870,0.762536,0.000000}; -Point(5104) = {1.104451,0.762804,0.000000}; -Point(5105) = {1.086032,0.763072,0.000000}; -Point(5106) = {1.067613,0.763340,0.000000}; -Point(5107) = {1.049194,0.763608,0.000000}; -Point(5108) = {1.030775,0.763876,0.000000}; -Point(5109) = {1.012356,0.764145,0.000000}; -Point(5110) = {0.993937,0.764413,0.000000}; -Point(5111) = {0.975518,0.764681,0.000000}; -Point(5112) = {0.957099,0.764949,0.000000}; -Point(5113) = {0.938680,0.765217,0.000000}; -Point(5114) = {0.920261,0.765485,0.000000,1.5*msLeTp}; -Point(5115) = {0.815077,0.767016,0.000000}; - -// Dummy tip center: -Point(5349) = {1.141290,0.762000,0.000000}; -Point(5350) = {0.920261,0.762000,0.000000}; - - -// Midplane: -Point(5351) = {xO+xL,0.000000,0.000000,msF}; -Point(5352) = {xO+xL,0.762000,0.000000,msF}; -Point(5353) = {xO+xL,yL,0.000000,msF}; -Point(5354) = {1.178128,yL,0.000000,msF}; -Point(5355) = {1.141290,yL,0.000000,msF}; -Point(5356) = {0.920261,yL,0.000000,msF}; -Point(5357) = {0.809747,yL,0.000000,msF}; -Point(5358) = {xO,yL,0.000000,msF}; -Point(5359) = {xO,0.762000,0.000000,msF}; -Point(5360) = {xO,0.000000,0.000000,msF}; - -/// Lines - -// Airfoil 1: -Spline(1) = {1,2,3}; -Spline(2) = {3,4,5,6,7,8,9,10,11,12,13,14,15}; -Spline(3) = {15,16,17,18,19,20,21,22,23,24,25,26}; -Spline(4) = {26,27,28,29,30,31,32,33,34,35,36,37}; -Spline(5) = {37,38,39,40,41,42,43,44,45,46,47,48,49}; -Spline(6) = {49,50,1}; - -// Airfoil 2: -Spline(7) = {52,53,54}; -Spline(8) = {54,55,56,57,58,59,60,61,62,63,64,65,66}; -Spline(9) = {66,67,68,69,70,71,72,73,74,75,76,77}; -Spline(10) = {77,78,79,80,81,82,83,84,85,86,87,88}; -Spline(11) = {88,89,90,91,92,93,94,95,96,97,98,99,100}; -Spline(12) = {100,101,52}; - - -// Box: -Line(41) = {5001,5002}; -Line(42) = {5003,5004}; -Line(43) = {5005,5006}; -Line(44) = {5007,5008}; -Line(45) = {5001,5005}; -Line(46) = {5002,5006}; -Line(47) = {5003,5007}; -Line(48) = {5004,5008}; -Line(49) = {5001,5360}; -Line(50) = {5002,5351}; -Line(51) = {5003,5360}; -Line(52) = {5004,5351}; -Line(53) = {5005,5358}; -Line(54) = {5006,5353}; -Line(55) = {5007,5358}; -Line(56) = {5008,5353}; - -// Airfoil 1 to airfoil 2: -Line(61) = {1,52}; -Line(62) = {3,54}; -Line(63) = {15,66}; -Line(64) = {26,77}; -Line(65) = {37,88}; -Line(66) = {49,100}; - - -// Tip: -Spline(121) = {52,5101,5102}; -Spline(122) = {5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114}; -If(GMSH_MAJOR_VERSION >= 4) - Bezier(123) = {5114,5115,77}; -Else - BSpline(123) = {5114,5115,77}; -EndIf -//Ellipse(124) = {54,5349,54,5102}; -Line(124) = {54,5102}; -Ellipse(125) = {66,5350,66,5114}; -Ellipse(126) = {88,5350,88,5114}; -//Ellipse(127) = {100,5349,100,5102}; -Line(127) = {100, 5102}; - -// Midplane: -Line(131) = {5351,5352}; -Line(132) = {5352,5353}; -Line(133) = {5353,5354}; -Line(134) = {5354,5355}; -Line(135) = {5355,5356}; -Line(136) = {5356,5357}; -Line(137) = {5357,5358}; -Line(138) = {5358,5359}; -Line(139) = {5359,5360}; - -// Wing to midplane: -Line(161) = {1,5351}; -Line(162) = {52,5352}; -Line(163) = {52,5354}; -Line(164) = {5102,5355}; -Line(165) = {5114,5356}; -Line(166) = {77,5357}; -Line(167) = {77,5359}; -Line(168) = {26,5360}; - -/// Line loops & Surfaces - -// Box: -Line Loop(1) = {1,2,3,168,-51,42,52,-161}; -Line Loop(2) = {48,56,-132,-131,-52}; -Line Loop(3) = {44,56,133,134,135,136,137,-55}; -Line Loop(4) = {47,55,138,139,-51}; -Line Loop(5) = {42,48,-44,-47}; -Line Loop(6) = {-6,-5,-4,168,-49,41,50,-161}; -Line Loop(7) = {46,54,-132,-131,-50}; -Line Loop(8) = {43,54,133,134,135,136,137,-53}; -Line Loop(9) = {45,53,138,139,-49}; -Line Loop(10) = {41,46,-43,-45}; -Plane Surface(1) = {1}; -Plane Surface(2) = {2}; -Plane Surface(3) = {-3}; -Plane Surface(4) = {-4}; -Plane Surface(5) = {-5}; -Plane Surface(6) = {-6}; -Plane Surface(7) = {-7}; -Plane Surface(8) = {8}; -Plane Surface(9) = {9}; -Plane Surface(10) = {10}; - -// Wing 1: -Line Loop(11) = {1,62,-7,-61}; -Line Loop(12) = {2,63,-8,-62}; -Line Loop(13) = {3,64,-9,-63}; -Line Loop(14) = {4,65,-10,-64}; -Line Loop(15) = {5,66,-11,-65}; -Line Loop(16) = {6,61,-12,-66}; -Surface(11) = {-11}; -Surface(12) = {-12}; -Surface(13) = {-13}; -Surface(14) = {-14}; -Surface(15) = {-15}; -Surface(16) = {-16}; - -// Wingtip: -Line Loop(71) = {7,124,-121}; -Line Loop(72) = {8,125,-122,-124}; -Line Loop(73) = {9,-123,-125}; -Line Loop(74) = {10,126,123}; -Line Loop(75) = {11,127,122,-126}; -Line Loop(76) = {12,121,-127}; -Surface(71) = {-71}; -Surface(72) = {-72}; -Surface(73) = {-73}; -Surface(74) = {-74}; -Surface(75) = {-75}; -Surface(76) = {-76}; - -// Midplane: -Line Loop(81) = {161,131,-162,-61}; -Line Loop(82) = {162,132,133,-163}; -Line Loop(83) = {163,134,-164,-121}; -Line Loop(84) = {164,135,-165,-122}; -Line Loop(85) = {165,136,-166,-123}; -Line Loop(86) = {167,-138,-137,-166}; -Line Loop(87) = {167,139,-168,64}; -Surface(81) = {81}; -Surface(82) = {82}; -Surface(83) = {83}; -Surface(84) = {84}; -Surface(85) = {85}; -Surface(86) = {-86}; -Surface(87) = {87}; - -/// Surface loops & Volumes - -// Upper: -Surface Loop(1) = {11,12,13,71,72,73,1,2,3,4,5,81,82,83,84,85,86,87}; -Volume(1) = {1}; -// Lower: -Surface Loop(2) = {14,15,16,74,75,76,6,7,8,9,10,81,82,83,84,85,86,87}; -Volume(2) = {2}; - - - -//// MESHING ALGORITHM - - -/// 2D: - -///Wing, farfield and symmetry plane: -MeshAlgorithm Surface{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,81,82,83,84,85,86,87} = 5; - -///Tip: -MeshAlgorithm Surface{73,74} = 1; -MeshAlgorithm Surface{71,72,75,76} = 5; - -/// 3D: - -Mesh.Algorithm3D = 2; -Mesh.OptimizeNetgen = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - - - -//// PHYSICAL GROUPS - -// Trailing edge and wake tip -Physical Line("wakeTip") = {162}; -Physical Line("teTip") = {61, 162}; - -// Internal Field: -Physical Volume("field") = {1}; -Physical Volume("field") += {2}; - -// Wing: -Physical Surface("wing") = {11,12,13,71,72,73}; -Physical Surface("wing_") = {14,15,16,74,75,76}; - -// Tip -//Physical Surface("tip") = {71,72,73,74,75,76}; - -// Symmetry: -Physical Surface("symmetry") = {1}; -Physical Surface("symmetry") += {6}; - -// Farfield: -Physical Surface("upstream") = {10}; -Physical Surface("farfield") = {3,4,5,8,9}; - -// Downstream: -Physical Surface("downstream") = {2}; -Physical Surface("downstream") += {7}; - -// Wake: -Physical Surface("wake") = {81}; - -Coherence; diff --git a/flow/models/coyote.geo b/flow/models/coyote.geo deleted file mode 100755 index 559ca778..00000000 --- a/flow/models/coyote.geo +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Coyote - Advanced Pilot Training Aircraft - * Plane designed for the AIAA 2017-2018 aircraft design competition - * by Raphael Dubois, Thibault Laurent, Bao Long Le Van, Nayan Levaux, - * Guillaume Noiset, Axel Piret, Arthur Scheffer, and Vincent Schmitz - * CAD created by Nayan Levaux and exported by Adrien Crovato - * Valid mesh obtained with gmsh 4.4.1 - */ - -/* Constants */ -scl = 2; // scaling factor for lifting surfaces mesh size (testing purpose) -DefineConstant[ msFar = { 5, Name "farfield mesh size" } ]; -DefineConstant[ msFus = { 0.1, Name "fuselage mesh size" } ]; -DefineConstant[ msWing = { 0.036 * scl, Name "wing mesh size" } ]; -DefineConstant[ msTail = { 0.028 * scl, Name "tail mesh size" } ]; - -/* Geometry */ - -Geometry.OCCAutoFix = 0; -Geometry.OCCFixDegenerated = 1; -Geometry.OCCFixSmallEdges = 1; -Geometry.OCCFixSmallFaces = 1; -Geometry.OCCSewFaces = 1; -Geometry.OCCScaling = 0.001; -Geometry.Tolerance = 1e-4; // 0.1 mm -Merge "coyote.stp"; -Coherence; -Surface Loop(1) = {1:58, 65:70}; -Volume(1) = {1}; - -// Embedded -Line{159} In Surface{68}; -Line{153} In Surface{68}; -Line{162} In Surface{68}; -Line{168} In Surface{68}; -Line{172} In Surface{68}; -Line{177} In Surface{68}; -Surface{59} In Volume{1}; -Surface{60} In Volume{1}; -Surface{61} In Volume{1}; -Surface{62} In Volume{1}; -Surface{63} In Volume{1}; -Surface{64} In Volume{1}; -Coherence; - -/* Physical */ - -// Tips -Physical Line("teTipW") = {155:158, 160:161, 164:167, 169:170}; -Physical Line("wakeTipW") = {160, 169}; -Physical Line("teTipT") = {173:176, 178:181}; -Physical Line("wakeTipT") = {173, 178}; - -// Downstream -Physical Surface("downstream") = {68}; - -// Farfield -Physical Surface("upstream") = {65}; -Physical Surface("farfield") = {66, 67, 69, 70}; - -// Fuselage -Physical Surface("fuselage") = {1:15, 30:44}; - -// Wing -Physical Surface("wing") = {24, 26, 53, 55}; -Physical Surface("wing_") = {25, 54}; - -// LEX -Physical Surface("wing") += {16, 19:23, 45, 48:52}; -Physical Surface("wing_") += {17:18, 46:47}; - -// Tail -Physical Surface("tail") = {27, 28, 56, 57}; -Physical Surface("tail_") = {29, 58}; - -// Wake -Physical Surface("wakeW") = {59:62}; -Physical Surface("wakeT") = {63, 64}; - -// Internal Field -Physical Volume("field") = {1}; - -/* Mesh */ - -// Sizes -Characteristic Length {125, 122, 124, 123, 127, 129, 126, 128, 118, 110, 113, 114, 105, 97, 98, 103} = msFar; // Farfield -Characteristic Length {107, 108, 101, 100, 9, 31, 70, 2, 3, 1, 78, 65, 79, 80, 81, 82, 64, 83, 16, 17, 15, 14, 13, 55, 12, 11, 69, 56, 32, 40, 10, 29, 68, 67, 66, 30, 5, 26} = msFus; // Fuselage -Characteristic Length {4, 18, 27, 28, 54} = 0.5 * msFus; // Fuselage nose -Characteristic Length {59, 74, 37, 41, 60:63, 33:36, 38, 39, 57, 58} = 2.5 * msFus; // Intake -Characteristic Length {72, 121, 73, 24, 71, 109, 20, 112, 23, 117, 19, 96, 25, 102, 21, 22} = 2 * msFus; // Nozzle -Characteristic Length {93, 86, 91, 90, 88, 89, 87, 51, 44, 49, 48, 46, 47, 45, 106, 99} = msWing; // Wing root -Characteristic Length {43, 85} = 0.5 * msWing; // Wing root LE -Characteristic Length {93, 51, 111, 104} = 0.75 * msWing; // Wing tip -Characteristic Length {92, 50} = 0.35 * msWing; // Wing tip LE -Characteristic Length {6, 8, 42, 75, 76, 77, 116, 120} = msTail; // Tail root -Characteristic Length {7, 84} = 0.5 * msTail; // Tail root LE -Characteristic Length {52, 94, 115, 119} = 0.75 * msTail; // Tail tip TE -Characteristic Length {53, 95} = 0.35 * msTail; // Tail tip LE - -// 2D -Mesh.Algorithm = 1; -// 3D -Mesh.Algorithm3D = 2; -Mesh.OptimizeNetgen = 0; -Mesh.Optimize = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -Mesh 1; -Geometry.Tolerance = 1e-6; -Coherence Mesh; -//Mesh 2; -//Mesh 3; -//OptimizeMesh "Gmsh"; // re-optimize just to be sure diff --git a/flow/models/coyote.stp b/flow/models/coyote.stp deleted file mode 100755 index 014c5631..00000000 --- a/flow/models/coyote.stp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa1ba0c6730f0462e2eefafde009ee124c5947b3c19dc6e4171e500ae7eaef62 -size 14132943 diff --git a/flow/models/cylinder.geo b/flow/models/cylinder.geo deleted file mode 100644 index 09e3b6ee..00000000 --- a/flow/models/cylinder.geo +++ /dev/null @@ -1,68 +0,0 @@ -/* Cylinder */ - -// Parameters - -DefineConstant[ dmt = { 1.0, Name "Cylinder diameter" } ]; -DefineConstant[ lgt = { 8.0, Name "Channel length" } ]; -DefineConstant[ hgt = { 6.0, Name "Channel height" } ]; -DefineConstant[ msF = { 0.75, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; -DefineConstant[ msN = { 0.25, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; - -// Geometry - -// cylinder -Point(0) = {0, 0, 0}; -Point(1) = {dmt/2, 0, 0, msN}; -Point(2) = {0, dmt/2, 0, msN}; -Point(3) = {-dmt/2, 0, 0, msN}; -Point(4) = {0, -dmt/2, 0, msN}; - -// farfield -Point(11) = {lgt/2, 0, 0, msF}; -Point(12) = {lgt/2, hgt/2, 0, msF}; -Point(13) = {-lgt/2, hgt/2, 0, msF}; -Point(14) = {-lgt/2, 0, 0, msF}; -Point(15) = {-lgt/2, -hgt/2, 0, msF}; -Point(16) = {lgt/2, -hgt/2, 0, msF}; - -// cylinder -Circle(1) = {2, 0, 1}; -Circle(2) = {3, 0, 2}; -Circle(3) = {4, 0, 3}; -Circle(4) = {1, 0, 4}; - -// farfield -Line(11) = {11, 12}; -Line(12) = {12, 13}; -Line(13) = {13, 14}; -Line(14) = {14, 15}; -Line(15) = {15, 16}; -Line(16) = {16, 11}; - -// front and wake -Line(21) = {1, 11}; -Line(22) = {3, 14}; - -// internal field -Line Loop(1) = {21, 11, 12, 13, -22, 1, 2}; -Line Loop(2) = {4, 3, 22, 14, 15, 16, -21}; -Plane Surface(1) = {1}; -Plane Surface(2) = {2}; - -// Mesh - -Mesh.Algorithm = 5; // Delaunay - -// Physical groups - -Physical Point("te") = {1}; -Physical Line("upstream") = {13, 14}; -Physical Line("farfield") = {12, 15}; -Physical Line("downstream") = {11}; -Physical Line("downstream_") = {16}; -Physical Line("cylinder") = {1, 2}; -Physical Line("cylinder_") = {3, 4}; -Physical Line("wake") = {21}; -Physical Surface("field") = {1}; -Physical Surface("field_") = {2}; - diff --git a/flow/models/cylinder_2D5.geo b/flow/models/cylinder_2D5.geo deleted file mode 100644 index 25106222..00000000 --- a/flow/models/cylinder_2D5.geo +++ /dev/null @@ -1,161 +0,0 @@ -/* 2D5 Cylinder */ - -// Parameters -// domain -DefineConstant[ dmt = { 1.0, Name "Cylinder diameter" } ]; -DefineConstant[ lgt = { 3.0, Name "Channel length" } ]; -DefineConstant[ wdt = { 2.0, Name "Channel width" } ]; -DefineConstant[ hgt = { 3.0, Name "Channel height" } ]; -DefineConstant[ msN = { 0.1, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; -DefineConstant[ msF = { 1.0, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; - -// mesh algo -msh3D = 2; -msh2D = 5; - -// Geometry -// cylinder -Point(0) = {0, 0, 0}; -Point(1) = {dmt/2, 0, 0, msN}; -Point(2) = {0, 0, dmt/2, msN}; -Point(3) = {-dmt/2, 0, 0, msN}; -Point(4) = {0, 0, -dmt/2, msN}; -Point(10) = {0, wdt, 0}; -Point(11) = {dmt/2, wdt, 0, msN}; -Point(12) = {0, wdt, dmt/2, msN}; -Point(13) = {-dmt/2, wdt, 0, msN}; -Point(14) = {0, wdt, -dmt/2, msN}; - -// box -Point(31) = {lgt/2, 0, hgt/2, msF}; -Point(32) = {-lgt/2, 0, hgt/2, msF}; -Point(33) = {-lgt/2, 0, -hgt/2, msF}; -Point(34) = {lgt/2, 0, -hgt/2, msF}; -Point(35) = {lgt/2, wdt, hgt/2, msF}; -Point(36) = {-lgt/2, wdt, hgt/2, msF}; -Point(37) = {-lgt/2, wdt, -hgt/2, msF}; -Point(38) = {lgt/2, wdt, -hgt/2, msF}; - -// midplane -Point(41) = {lgt/2, 0, 0, msF}; -Point(42) = {lgt/2, wdt, 0, msF}; -Point(43) = {-lgt/2, wdt, 0, msF}; -Point(44) = {-lgt/2, 0, 0, msF}; - -// wing -Circle(1) = {1, 0, 2}; -Circle(2) = {2, 0, 3}; -Circle(3) = {3, 0, 4}; -Circle(4) = {4, 0, 1}; -Circle(5) = {11, 10, 12}; -Circle(6) = {12, 10, 13}; -Circle(7) = {13, 10, 14}; -Circle(8) = {14, 10, 11}; -Line(9) = {1, 11}; -Line(10) = {2, 12}; -Line(11) = {3, 13}; -Line(12) = {4, 14}; - -// box -Line(21) = {41, 31}; -Line(22) = {31, 32}; -Line(23) = {32, 44}; -Line(24) = {44, 33}; -Line(25) = {33, 34}; -Line(26) = {34, 41}; -Line(27) = {42, 35}; -Line(28) = {35, 36}; -Line(29) = {36, 43}; -Line(30) = {43, 37}; -Line(31) = {37, 38}; -Line(32) = {38, 42}; -Line(33) = {31, 35}; -Line(34) = {32, 36}; -Line(35) = {33, 37}; -Line(36) = {34, 38}; - -// midplane -Line(41) = {1, 41}; -Line(42) = {11, 42}; -Line(43) = {13, 43}; -Line(44) = {3, 44}; -Line(45) = {41, 42}; -Line(46) = {42, 11}; -Line(47) = {13, 43}; -Line(48) = {43, 44}; - -// wing -Line Loop(1) = {1, 10, -5, -9}; -Surface(1) = {-1}; -Line Loop(2) = {2, 11, -6, -10}; -Surface(2) = {-2}; -Line Loop(3) = {3, 12, -7, -11}; -Surface(3) = {-3}; -Line Loop(4) = {4, 9, -8, -12}; -Surface(4) = {-4}; - -// symmetry -Line Loop(5) = {41, 21, 22, 23, -44, -2, -1}; -Plane Surface(5) = {-5}; -Line Loop(12) = {42, 27, 28, 29, -43, -6, -5}; -Plane Surface(12) = {12}; -Line Loop(6) = {44, 24, 25, 26, -41, -4, -3}; -Plane Surface(6) = {-6}; -Line Loop(13) = {43, 30, 31, 32, -42, -8, -7}; -Plane Surface(13) = {13}; - -// upstream -Line Loop(7) = {48, -23, 34, 29}; -Plane Surface(7) = {-7}; -Line Loop(8) = {48, 24, 35, -30}; -Plane Surface(8) = {8}; - -// downstream -Line Loop(9) = {45, 27, -33, -21}; -Plane Surface(9) = {-9}; -Line Loop(10) = {45, -32, -36, 26}; -Plane Surface(10) = {10}; - -// farfield -Line Loop(11) = {22, 34, -28, -33}; -Plane Surface(11) = {11}; -Line Loop(14) = {25, 36, -31, -35}; -Plane Surface(14) = {14}; - -// wake -Line Loop(15) = {41, 45, -42, -9}; -Plane Surface(15) = {15}; - -// internal -Line Loop(16) = {11, 43, 48, -44}; -Plane Surface(16) = {16}; - -// field -Surface Loop(1) = {7, 5, 9, 12, 11, 2, 1, 16, 15}; -Volume(1) = {1}; -Surface Loop(2) = {6, 8, 14, 10, 13, 4, 3, 16, 15}; -Volume(2) = {2}; - -// Mesh -// 2D -MeshAlgorithm Surface{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} = msh2D; -// 3D -Mesh.Algorithm3D = msh3D; -Mesh.OptimizeNetgen = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -// Physical -Physical Line("te") = {9}; -Physical Surface("cylinder") = {1, 2}; -Physical Surface("cylinder_") = {3, 4}; -Physical Surface("symmetry") = {5, 12}; -Physical Surface("symmetry_") = {6, 13}; -Physical Surface("upstream") = {7, 8}; -Physical Surface("downstream") = {9}; -Physical Surface("downstream_") = {10}; -Physical Surface("farfield") = {11, 14}; -Physical Surface("wake") = {15}; -Physical Volume("field") = {1}; -Physical Volume("field_") = {2}; - diff --git a/flow/models/cylinder_3.geo b/flow/models/cylinder_3.geo deleted file mode 100644 index e7cd4cfe..00000000 --- a/flow/models/cylinder_3.geo +++ /dev/null @@ -1,203 +0,0 @@ -/* 3D Cylinder */ - -// Parameters -// domain -DefineConstant[ dmt = { 1.0, Name "Cylinder diameter" } ]; -DefineConstant[ spn = { 2.5, Name "Cylinder span" } ]; -DefineConstant[ tpt = { .05, Name "Cylinder tip thickness" } ]; // percentage of span -DefineConstant[ lgt = { 8.0, Name "Channel length" } ]; -DefineConstant[ wdt = { 4.0, Name "Channel width" } ]; -DefineConstant[ hgt = { 6.0, Name "Channel height" } ]; -DefineConstant[ msN = { 0.1, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; -DefineConstant[ msF = { 1.0, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; - -// mesh algo -msh3D = 2; -msh2D = 5; - -// Geometry -// cylinder -Point(0) = {0, 0, 0}; -Point(1) = {dmt/2, 0, 0, msN}; -Point(2) = {0, 0, dmt/2, msN}; -Point(3) = {-dmt/2, 0, 0, msN}; -Point(4) = {0, 0, -dmt/2, msN}; -Point(10) = {0, spn, 0}; -Point(11) = {dmt/2, spn, 0, msN}; -Point(12) = {0, spn, dmt/2, msN}; -Point(13) = {-dmt/2, spn, 0, msN}; -Point(14) = {0, spn, -dmt/2, msN}; - -// tip -Point(21) = {0, spn+tpt*spn, 0, msN}; - -// box -Point(31) = {lgt/2, 0, hgt/2, msF}; -Point(32) = {-lgt/2, 0, hgt/2, msF}; -Point(33) = {-lgt/2, 0, -hgt/2, msF}; -Point(34) = {lgt/2, 0, -hgt/2, msF}; -Point(35) = {lgt/2, wdt, hgt/2, msF}; -Point(36) = {-lgt/2, wdt, hgt/2, msF}; -Point(37) = {-lgt/2, wdt, -hgt/2, msF}; -Point(38) = {lgt/2, wdt, -hgt/2, msF}; - -// midplane -Point(41) = {lgt/2, 0, 0, msF}; -Point(42) = {lgt/2, spn, 0, msF}; -Point(43) = {lgt/2, wdt, 0, msF}; -Point(44) = {dmt/2, wdt, 0, msF}; -Point(45) = {0, wdt, 0, msF}; -Point(46) = {-dmt/2, wdt, 0, msF}; -Point(47) = {-lgt/2, wdt, 0, msF}; -Point(48) = {-lgt/2, spn, 0, msF}; -Point(49) = {-lgt/2, 0, 0, msF}; - -// wing -Circle(1) = {1, 0, 2}; -Circle(2) = {2, 0, 3}; -Circle(3) = {3, 0, 4}; -Circle(4) = {4, 0, 1}; -Circle(11) = {11, 10, 12}; -Circle(12) = {12, 10, 13}; -Circle(13) = {13, 10, 14}; -Circle(14) = {14, 10, 11}; -Line(21) = {1, 11}; -Line(22) = {2, 12}; -Line(23) = {3, 13}; -Line(24) = {4, 14}; - -// tip -Ellipse(31) = {11, 10, 10, 21}; -Ellipse(32) = {12, 10, 10, 21}; -Ellipse(33) = {13, 10, 10, 21}; -Ellipse(34) = {14, 10, 10, 21}; - -// box -Line(41) = {41, 31}; -Line(42) = {31, 32}; -Line(43) = {32, 49}; -Line(44) = {49, 33}; -Line(45) = {33, 34}; -Line(46) = {34, 41}; -Line(47) = {43, 35}; -Line(48) = {35, 36}; -Line(49) = {36, 47}; -Line(50) = {47, 37}; -Line(51) = {37, 38}; -Line(52) = {38, 43}; -Line(53) = {31, 35}; -Line(54) = {32, 36}; -Line(55) = {33, 37}; -Line(56) = {34, 38}; - -// midplane -Line(61) = {1, 41}; -Line(62) = {11, 42}; -Line(63) = {11, 44}; -Line(64) = {21, 45}; -Line(65) = {13, 46}; -Line(66) = {13, 48}; -Line(67) = {3, 49}; -Line(68) = {41, 42}; -Line(69) = {42, 43}; -Line(70) = {43, 44}; -Line(71) = {44, 45}; -Line(72) = {45, 46}; -Line(73) = {46, 47}; -Line(74) = {47, 48}; -Line(75) = {48, 49}; - -// cylinder -Line Loop(1) = {1, 22, -11, -21}; -Surface(1) = {-1}; -Line Loop(2) = {2, 23, -12, -22}; -Surface(2) = {-2}; -Line Loop(3) = {3, 24, -13, -23}; -Surface(3) = {-3}; -Line Loop(4) = {4, 21, -14, -24}; -Surface(4) = {-4}; -//tip -Line Loop(5) = {11, 32, -31}; -Surface(5) = {-5}; -Line Loop(6) = {12, 33, -32}; -Surface(6) = {-6}; -Line Loop(7) = {13, 34, -33}; -Surface(7) = {-7}; -Line Loop(8) = {14, 31, -34}; -Surface(8) = {-8}; - -// symmetry -Line Loop(9) = {61, 41, 42, 43, -67, -2, -1}; -Plane Surface(9) = {-9}; -Line Loop(10) = {4, 61, -46, -45, -44, -67, 3}; -Plane Surface(10) = {10}; - -// upstream -Line Loop(11) = {43, -75, -74, -49, -54}; -Plane Surface(11) = {11}; -Line Loop(12) = {75, 44, 55, -50, 74}; -Plane Surface(12) = {12}; - -// downstream -Line Loop(13) = {41, 53, -47, -69, -68}; -Plane Surface(13) = {13}; -Line Loop(14) = {68, 69, -52, -56, 46}; -Plane Surface(14) = {14}; - -// farfield -Line Loop(15) = {42, 54, -48, -53}; -Plane Surface(15) = {15}; -Line Loop(16) = {47, 48, 49, -73, -72, -71, -70}; -Plane Surface(16) = {16}; -Line Loop(17) = {51, 52, 70, 71, 72, 73, 50}; -Plane Surface(17) = {17}; -Line Loop(18) = {45, 56, -51, -55}; -Plane Surface(18) = {18}; - -// wake -Line Loop(19) = {61, 68, -62, -21}; -Surface(19) = {19}; - -// internal -Line Loop(20) = {62, 69, 70, -63}; -Surface(20) = {20}; -Line Loop(21) = {64, -71, -63, 31}; -Surface(21) = {-21}; -Line Loop(22) = {65, -72, -64, -33}; -Surface(22) = {-22}; -Line Loop(23) = {74, -66, 65, 73}; -Surface(23) = {23}; -Line Loop(24) = {75, -67, 23, 66}; -Surface(24) = {24}; - -// field -Surface Loop(1) = {15, 9, 13, 16, 11, 2, 6, 5, 1, 24, 23, 22, 21, 20, 19}; -Volume(1) = {1}; -Surface Loop(2) = {10, 4, 8, 7, 3, 14, 17, 18, 12, 24, 23, 22, 21, 20, 19}; -Volume(2) = {2}; - -// Mesh -// cylinder, farfield, symmetry, midplane -MeshAlgorithm Surface{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24} = msh2D; -// 3D -Mesh.Algorithm3D = msh3D; -Mesh.OptimizeNetgen = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -// Physical -Physical Line("teTip") = {21, 62}; -Physical Line("wakeTip") = {62}; -Physical Surface("cylinder") = {1, 2}; -Physical Surface("cylinder_") = {3, 4}; -Physical Surface("tip") = {5, 6, 7, 8}; -Physical Surface("symmetry") = {9}; -Physical Surface("symmetry_") = {10}; -Physical Surface("upstream") = {11, 12}; -Physical Surface("downstream") = {13}; -Physical Surface("downstream_") = {14}; -Physical Surface("farfield") = {15, 16, 17, 18}; -Physical Surface("wake") = {19}; -Physical Volume("field") = {1}; -Physical Volume("field_") = {2}; - diff --git a/flow/models/n0012.geo b/flow/models/n0012.geo deleted file mode 100644 index e03f6491..00000000 --- a/flow/models/n0012.geo +++ /dev/null @@ -1,282 +0,0 @@ -/* Naca0012 */ - -// Geometry -DefineConstant[ xLgt = { 5.0, Name "Domain length (x-dir)" } ]; -DefineConstant[ yLgt = { 5.0, Name "Domain length (y-dir)" } ]; - -// Mesh -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; -DefineConstant[ msTe = { 0.01, Name "Airfoil TE mesh size" } ]; -DefineConstant[ msLe = { 0.01, Name "Airfoil LE mesh size" } ]; - -// Rotation -DefineConstant[ xRot = { 0.25, Name "Center of rotation" } ]; -DefineConstant[ angle = { 0*Pi/180, Name "Angle of rotation" } ]; -Geometry.AutoCoherence = 0; // Needed so that gmsh does not remove duplicate - -/************** - Geometry - **************/ - -// Airfoil -Te = 1; -Le = 101; -N = 200; - -//Point(201) = {1.000000,0.000000,0,msTe}; -Point(200) = {0.999753,-0.000035,0, msTe}; -Point(199) = {0.999013,-0.000141,0}; -Point(198) = {0.997781,-0.000317,0}; -Point(197) = {0.996057,-0.000562,0}; -Point(196) = {0.993844,-0.000876,0}; -Point(195) = {0.991144,-0.001258,0}; -Point(194) = {0.987958,-0.001707,0}; -Point(193) = {0.984292,-0.002222,0}; -Point(192) = {0.980147,-0.002801,0}; -Point(191) = {0.975528,-0.003443,0}; -Point(190) = {0.970440,-0.004147,0}; -Point(189) = {0.964888,-0.004909,0}; -Point(188) = {0.958877,-0.005729,0}; -Point(187) = {0.952414,-0.006603,0}; -Point(186) = {0.945503,-0.007531,0}; -Point(185) = {0.938153,-0.008510,0}; -Point(184) = {0.930371,-0.009537,0}; -Point(183) = {0.922164,-0.010610,0}; -Point(182) = {0.913540,-0.011726,0}; -Point(181) = {0.904508,-0.012883,0}; -Point(180) = {0.895078,-0.014079,0}; -Point(179) = {0.885257,-0.015310,0}; -Point(178) = {0.875056,-0.016574,0}; -Point(177) = {0.864484,-0.017868,0}; -Point(176) = {0.853553,-0.019189,0}; -Point(175) = {0.842274,-0.020535,0}; -Point(174) = {0.830656,-0.021904,0}; -Point(173) = {0.818712,-0.023291,0}; -Point(172) = {0.806454,-0.024694,0}; -Point(171) = {0.793893,-0.026111,0}; -Point(170) = {0.781042,-0.027539,0}; -Point(169) = {0.767913,-0.028974,0}; -Point(168) = {0.754521,-0.030414,0}; -Point(167) = {0.740877,-0.031856,0}; -Point(166) = {0.726995,-0.033296,0}; -Point(165) = {0.712890,-0.034733,0}; -Point(164) = {0.698574,-0.036163,0}; -Point(163) = {0.684062,-0.037582,0}; -Point(162) = {0.669369,-0.038988,0}; -Point(161) = {0.654508,-0.040378,0}; -Point(160) = {0.639496,-0.041747,0}; -Point(159) = {0.624345,-0.043094,0}; -Point(158) = {0.609072,-0.044414,0}; -Point(157) = {0.593691,-0.045705,0}; -Point(156) = {0.578217,-0.046962,0}; -Point(155) = {0.562667,-0.048182,0}; -Point(154) = {0.547054,-0.049362,0}; -Point(153) = {0.531395,-0.050499,0}; -Point(152) = {0.515705,-0.051587,0}; -Point(151) = {0.500000,-0.052625,0}; -Point(150) = {0.484295,-0.053608,0}; -Point(149) = {0.468605,-0.054534,0}; -Point(148) = {0.452946,-0.055397,0}; -Point(147) = {0.437333,-0.056195,0}; -Point(146) = {0.421783,-0.056924,0}; -Point(145) = {0.406309,-0.057581,0}; -Point(144) = {0.390928,-0.058163,0}; -Point(143) = {0.375655,-0.058666,0}; -Point(142) = {0.360504,-0.059087,0}; -Point(141) = {0.345492,-0.059424,0}; -Point(140) = {0.330631,-0.059674,0}; -Point(139) = {0.315938,-0.059834,0}; -Point(138) = {0.301426,-0.059902,0}; -Point(137) = {0.287110,-0.059876,0}; -Point(136) = {0.273005,-0.059754,0}; -Point(135) = {0.259123,-0.059535,0}; -Point(134) = {0.245479,-0.059217,0}; -Point(133) = {0.232087,-0.058799,0}; -Point(132) = {0.218958,-0.058280,0}; -Point(131) = {0.206107,-0.057661,0}; -Point(130) = {0.193546,-0.056940,0}; -Point(129) = {0.181288,-0.056119,0}; -Point(128) = {0.169344,-0.055197,0}; -Point(127) = {0.157726,-0.054176,0}; -Point(126) = {0.146447,-0.053056,0}; -Point(125) = {0.135516,-0.051839,0}; -Point(124) = {0.124944,-0.050527,0}; -Point(123) = {0.114743,-0.049121,0}; -Point(122) = {0.104922,-0.047624,0}; -Point(121) = {0.095492,-0.046037,0}; -Point(120) = {0.086460,-0.044364,0}; -Point(119) = {0.077836,-0.042608,0}; -Point(118) = {0.069629,-0.040770,0}; -Point(117) = {0.061847,-0.038854,0}; -Point(116) = {0.054497,-0.036863,0}; -Point(115) = {0.047586,-0.034800,0}; -Point(114) = {0.041123,-0.032668,0}; -Point(113) = {0.035112,-0.030471,0}; -Point(112) = {0.029560,-0.028212,0}; -Point(111) = {0.024472,-0.025893,0}; -Point(110) = {0.019853,-0.023517,0}; -Point(109) = {0.015708,-0.021088,0}; -Point(108) = {0.012042,-0.018607,0}; -Point(107) = {0.008856,-0.016078,0}; -Point(106) = {0.006156,-0.013503,0}; -Point(105) = {0.003943,-0.010884,0}; -Point(104) = {0.002219,-0.008223,0}; -Point(103) = {0.000987,-0.005521,0}; -Point(102) = {0.000247,-0.002779,0}; -Point(101) = {0.000000,0.000000,0,msLe}; -Point(100) = {0.000247,0.002779,0}; -Point(99) = {0.000987,0.005521,0}; -Point(98) = {0.002219,0.008223,0}; -Point(97) = {0.003943,0.010884,0}; -Point(96) = {0.006156,0.013503,0}; -Point(95) = {0.008856,0.016078,0}; -Point(94) = {0.012042,0.018607,0}; -Point(93) = {0.015708,0.021088,0}; -Point(92) = {0.019853,0.023517,0}; -Point(91) = {0.024472,0.025893,0}; -Point(90) = {0.029560,0.028212,0}; -Point(89) = {0.035112,0.030471,0}; -Point(88) = {0.041123,0.032668,0}; -Point(87) = {0.047586,0.034800,0}; -Point(86) = {0.054497,0.036863,0}; -Point(85) = {0.061847,0.038854,0}; -Point(84) = {0.069629,0.040770,0}; -Point(83) = {0.077836,0.042608,0}; -Point(82) = {0.086460,0.044364,0}; -Point(81) = {0.095492,0.046037,0}; -Point(80) = {0.104922,0.047624,0}; -Point(79) = {0.114743,0.049121,0}; -Point(78) = {0.124944,0.050527,0}; -Point(77) = {0.135516,0.051839,0}; -Point(76) = {0.146447,0.053056,0}; -Point(75) = {0.157726,0.054176,0}; -Point(74) = {0.169344,0.055197,0}; -Point(73) = {0.181288,0.056119,0}; -Point(72) = {0.193546,0.056940,0}; -Point(71) = {0.206107,0.057661,0}; -Point(70) = {0.218958,0.058280,0}; -Point(69) = {0.232087,0.058799,0}; -Point(68) = {0.245479,0.059217,0}; -Point(67) = {0.259123,0.059535,0}; -Point(66) = {0.273005,0.059754,0}; -Point(65) = {0.287110,0.059876,0}; -Point(64) = {0.301426,0.059902,0}; -Point(63) = {0.315938,0.059834,0}; -Point(62) = {0.330631,0.059674,0}; -Point(61) = {0.345492,0.059424,0}; -Point(60) = {0.360504,0.059087,0}; -Point(59) = {0.375655,0.058666,0}; -Point(58) = {0.390928,0.058163,0}; -Point(57) = {0.406309,0.057581,0}; -Point(56) = {0.421783,0.056924,0}; -Point(55) = {0.437333,0.056195,0}; -Point(54) = {0.452946,0.055397,0}; -Point(53) = {0.468605,0.054534,0}; -Point(52) = {0.484295,0.053608,0}; -Point(51) = {0.500000,0.052625,0}; -Point(50) = {0.515705,0.051587,0}; -Point(49) = {0.531395,0.050499,0}; -Point(48) = {0.547054,0.049362,0}; -Point(47) = {0.562667,0.048182,0}; -Point(46) = {0.578217,0.046962,0}; -Point(45) = {0.593691,0.045705,0}; -Point(44) = {0.609072,0.044414,0}; -Point(43) = {0.624345,0.043094,0}; -Point(42) = {0.639496,0.041747,0}; -Point(41) = {0.654508,0.040378,0}; -Point(40) = {0.669369,0.038988,0}; -Point(39) = {0.684062,0.037582,0}; -Point(38) = {0.698574,0.036163,0}; -Point(37) = {0.712890,0.034733,0}; -Point(36) = {0.726995,0.033296,0}; -Point(35) = {0.740877,0.031856,0}; -Point(34) = {0.754521,0.030414,0}; -Point(33) = {0.767913,0.028974,0}; -Point(32) = {0.781042,0.027539,0}; -Point(31) = {0.793893,0.026111,0}; -Point(30) = {0.806454,0.024694,0}; -Point(29) = {0.818712,0.023291,0}; -Point(28) = {0.830656,0.021904,0}; -Point(27) = {0.842274,0.020535,0}; -Point(26) = {0.853553,0.019189,0}; -Point(25) = {0.864484,0.017868,0}; -Point(24) = {0.875056,0.016574,0}; -Point(23) = {0.885257,0.015310,0}; -Point(22) = {0.895078,0.014079,0}; -Point(21) = {0.904508,0.012883,0}; -Point(20) = {0.913540,0.011726,0}; -Point(19) = {0.922164,0.010610,0}; -Point(18) = {0.930371,0.009537,0}; -Point(17) = {0.938153,0.008510,0}; -Point(16) = {0.945503,0.007531,0}; -Point(15) = {0.952414,0.006603,0}; -Point(14) = {0.958877,0.005729,0}; -Point(13) = {0.964888,0.004909,0}; -Point(12) = {0.970440,0.004147,0}; -Point(11) = {0.975528,0.003443,0}; -Point(10) = {0.980147,0.002801,0}; -Point(9) = {0.984292,0.002222,0}; -Point(8) = {0.987958,0.001707,0}; -Point(7) = {0.991144,0.001258,0}; -Point(6) = {0.993844,0.000876,0}; -Point(5) = {0.996057,0.000562,0}; -Point(4) = {0.997781,0.000317,0}; -Point(3) = {0.999013,0.000141,0}; -Point(2) = {0.999753,0.000035,0}; -Point(1) = {1.000000,0.000000,0,msTe}; - -Spline(1) = {101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; -Spline(2) = {1,200,199,198,197,196,195,194,193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,142,141,140,139,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101}; - -// Rotation -If (angle != 0) - For i In {Te:N:1} - Rotate{{0, 0, 1}, {xRot, 0, 0}, -angle} {Point{i};} - EndFor -EndIf - -// Farfield -Point(10001) = {1+xLgt, 0, 0,msF}; -Point(10002) = {1+xLgt, yLgt, 0,msF}; -Point(10003) = {-xLgt, yLgt, 0,msF}; -Point(10004) = {-xLgt, 0, 0,msF}; -Point(10005) = {-xLgt,-yLgt, 0,msF}; -Point(10006) = {1+xLgt, -yLgt, 0,msF}; - -Line(10001) = {10001, 10002}; -Line(10002) = {10002, 10003}; -Line(10003) = {10003, 10004}; -Line(10004) = {10004, 10005}; -Line(10005) = {10005, 10006}; -Line(10006) = {10006, 10001}; - -// Front and wake -Line(10007) = {Le, 10004}; -Line(10008) = {Te, 10001}; - -// Internal field -Line Loop(10001) = {10008, 10001, 10002, 10003, -10007, 1}; -Line Loop(10002) = {10007, 10004, 10005, 10006, -10008, 2}; -Plane Surface(10001) = {10001}; -Plane Surface(10002) = {10002}; - -/************************* - Mesh Options - *************************/ - -Mesh.Algorithm = 5; // Delaunay - -/************************* - Physical Groups - *************************/ - -Physical Point("te") = {Te}; -Physical Line("upstream") = {10003, 10004}; -Physical Line("farfield") = {10002, 10005}; -Physical Line("downstream") = {10001}; -Physical Line("downstream") += {10006}; -Physical Line("airfoil") = {1}; -Physical Line("airfoil_") = {2}; -Physical Line("wake") = {10008}; -Physical Surface("field") = {10001}; -Physical Surface("field") += {10002}; diff --git a/flow/models/n0012_3.geo b/flow/models/n0012_3.geo deleted file mode 100644 index c8b02ca4..00000000 --- a/flow/models/n0012_3.geo +++ /dev/null @@ -1,442 +0,0 @@ -/* Rectangular NACA0012 wing */ -// Initially generated by unsRgridWingGen.m -// For gmsh 4, use line 334 instead of line 335 (Bezier <- BSpline) - -// Parameters -// domain and mesh -DefineConstant[ spn = { 2.0, Name "Wing span" } ]; -DefineConstant[ lgt = { 3.0, Name "Channel length" } ]; -DefineConstant[ wdt = { 3.0, Name "Channel width" } ]; -DefineConstant[ hgt = { 3.0, Name "Channel height" } ]; -DefineConstant[ msLe = { 0.05, Name "Leading edge mesh size" } ]; -DefineConstant[ msTe = { 0.05, Name "Trailing edge mesh size" } ]; -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; - -//// GEOMETRY - - -/// Points - -// Airfoil 1: naca0012, 101 points -Point(1) = {1.000000,0.000000,0.000000,msTe}; -Point(2) = {0.999013,0.000000,0.000143}; -Point(3) = {0.996057,0.000000,0.000572}; -Point(4) = {0.991144,0.000000,0.001280}; -Point(5) = {0.984292,0.000000,0.002260}; -Point(6) = {0.975528,0.000000,0.003501}; -Point(7) = {0.964888,0.000000,0.004990}; -Point(8) = {0.952414,0.000000,0.006710}; -Point(9) = {0.938153,0.000000,0.008643}; -Point(10) = {0.922164,0.000000,0.010770}; -Point(11) = {0.904508,0.000000,0.013071,msTe}; -Point(12) = {0.885257,0.000000,0.015523}; -Point(13) = {0.864484,0.000000,0.018106}; -Point(14) = {0.842274,0.000000,0.020795}; -Point(15) = {0.818712,0.000000,0.023569}; -Point(16) = {0.793893,0.000000,0.026405}; -Point(17) = {0.767913,0.000000,0.029279}; -Point(18) = {0.740877,0.000000,0.032168}; -Point(19) = {0.712890,0.000000,0.035048}; -Point(20) = {0.684062,0.000000,0.037896}; -Point(21) = {0.654508,0.000000,0.040686}; -Point(22) = {0.624345,0.000000,0.043394}; -Point(23) = {0.593691,0.000000,0.045992}; -Point(24) = {0.562667,0.000000,0.048455}; -Point(25) = {0.531395,0.000000,0.050754}; -Point(26) = {0.500000,0.000000,0.052862}; -Point(27) = {0.468605,0.000000,0.054749}; -Point(28) = {0.437333,0.000000,0.056390}; -Point(29) = {0.406309,0.000000,0.057755}; -Point(30) = {0.375655,0.000000,0.058819}; -Point(31) = {0.345492,0.000000,0.059557}; -Point(32) = {0.315938,0.000000,0.059947}; -Point(33) = {0.287110,0.000000,0.059971,msTe}; -Point(34) = {0.259123,0.000000,0.059614}; -Point(35) = {0.232087,0.000000,0.058863}; -Point(36) = {0.206107,0.000000,0.057712}; -Point(37) = {0.181288,0.000000,0.056159}; -Point(38) = {0.157726,0.000000,0.054206}; -Point(39) = {0.135516,0.000000,0.051862}; -Point(40) = {0.114743,0.000000,0.049138}; -Point(41) = {0.095492,0.000000,0.046049}; -Point(42) = {0.077836,0.000000,0.042615}; -Point(43) = {0.061847,0.000000,0.038859}; -Point(44) = {0.047586,0.000000,0.034803}; -Point(45) = {0.035112,0.000000,0.030473}; -Point(46) = {0.024472,0.000000,0.025893}; -Point(47) = {0.015708,0.000000,0.021088}; -Point(48) = {0.008856,0.000000,0.016078}; -Point(49) = {0.003943,0.000000,0.010884}; -Point(50) = {0.000987,0.000000,0.005521}; -Point(51) = {0.000000,0.000000,0.000000,msLe}; -Point(52) = {0.000987,0.000000,-0.005521}; -Point(53) = {0.003943,0.000000,-0.010884}; -Point(54) = {0.008856,0.000000,-0.016078}; -Point(55) = {0.015708,0.000000,-0.021088}; -Point(56) = {0.024472,0.000000,-0.025893}; -Point(57) = {0.035112,0.000000,-0.030473}; -Point(58) = {0.047586,0.000000,-0.034803}; -Point(59) = {0.061847,0.000000,-0.038859}; -Point(60) = {0.077836,0.000000,-0.042615}; -Point(61) = {0.095492,0.000000,-0.046049}; -Point(62) = {0.114743,0.000000,-0.049138}; -Point(63) = {0.135516,0.000000,-0.051862}; -Point(64) = {0.157726,0.000000,-0.054206}; -Point(65) = {0.181288,0.000000,-0.056159}; -Point(66) = {0.206107,0.000000,-0.057712}; -Point(67) = {0.232087,0.000000,-0.058863}; -Point(68) = {0.259123,0.000000,-0.059614}; -Point(69) = {0.287110,0.000000,-0.059971,msTe}; -Point(70) = {0.315938,0.000000,-0.059947}; -Point(71) = {0.345492,0.000000,-0.059557}; -Point(72) = {0.375655,0.000000,-0.058819}; -Point(73) = {0.406309,0.000000,-0.057755}; -Point(74) = {0.437333,0.000000,-0.056390}; -Point(75) = {0.468605,0.000000,-0.054749}; -Point(76) = {0.500000,0.000000,-0.052862}; -Point(77) = {0.531395,0.000000,-0.050754}; -Point(78) = {0.562667,0.000000,-0.048455}; -Point(79) = {0.593691,0.000000,-0.045992}; -Point(80) = {0.624345,0.000000,-0.043394}; -Point(81) = {0.654508,0.000000,-0.040686}; -Point(82) = {0.684062,0.000000,-0.037896}; -Point(83) = {0.712890,0.000000,-0.035048}; -Point(84) = {0.740877,0.000000,-0.032168}; -Point(85) = {0.767913,0.000000,-0.029279}; -Point(86) = {0.793893,0.000000,-0.026405}; -Point(87) = {0.818712,0.000000,-0.023569}; -Point(88) = {0.842274,0.000000,-0.020795}; -Point(89) = {0.864484,0.000000,-0.018106}; -Point(90) = {0.885257,0.000000,-0.015523}; -Point(91) = {0.904508,0.000000,-0.013071,msTe}; -Point(92) = {0.922164,0.000000,-0.010770}; -Point(93) = {0.938153,0.000000,-0.008643}; -Point(94) = {0.952414,0.000000,-0.006710}; -Point(95) = {0.964888,0.000000,-0.004990}; -Point(96) = {0.975528,0.000000,-0.003501}; -Point(97) = {0.984292,0.000000,-0.002260}; -Point(98) = {0.991144,0.000000,-0.001280}; -Point(99) = {0.996057,0.000000,-0.000572}; -Point(100) = {0.999013,0.000000,-0.000143,msTe}; - -// Airfoil 2: naca0012, 101 points -Point(102) = {1.000000,spn,0.000000,msTe}; -Point(103) = {0.999013,spn,0.000143}; -Point(104) = {0.996057,spn,0.000572}; -Point(105) = {0.991144,spn,0.001280}; -Point(106) = {0.984292,spn,0.002260}; -Point(107) = {0.975528,spn,0.003501}; -Point(108) = {0.964888,spn,0.004990}; -Point(109) = {0.952414,spn,0.006710}; -Point(110) = {0.938153,spn,0.008643}; -Point(111) = {0.922164,spn,0.010770}; -Point(112) = {0.904508,spn,0.013071,msTe}; -Point(113) = {0.885257,spn,0.015523}; -Point(114) = {0.864484,spn,0.018106}; -Point(115) = {0.842274,spn,0.020795}; -Point(116) = {0.818712,spn,0.023569}; -Point(117) = {0.793893,spn,0.026405}; -Point(118) = {0.767913,spn,0.029279}; -Point(119) = {0.740877,spn,0.032168}; -Point(120) = {0.712890,spn,0.035048}; -Point(121) = {0.684062,spn,0.037896}; -Point(122) = {0.654508,spn,0.040686}; -Point(123) = {0.624345,spn,0.043394}; -Point(124) = {0.593691,spn,0.045992}; -Point(125) = {0.562667,spn,0.048455}; -Point(126) = {0.531395,spn,0.050754}; -Point(127) = {0.500000,spn,0.052862}; -Point(128) = {0.468605,spn,0.054749}; -Point(129) = {0.437333,spn,0.056390}; -Point(130) = {0.406309,spn,0.057755}; -Point(131) = {0.375655,spn,0.058819}; -Point(132) = {0.345492,spn,0.059557}; -Point(133) = {0.315938,spn,0.059947}; -Point(134) = {0.287110,spn,0.059971,msTe}; -Point(135) = {0.259123,spn,0.059614}; -Point(136) = {0.232087,spn,0.058863}; -Point(137) = {0.206107,spn,0.057712}; -Point(138) = {0.181288,spn,0.056159}; -Point(139) = {0.157726,spn,0.054206}; -Point(140) = {0.135516,spn,0.051862}; -Point(141) = {0.114743,spn,0.049138}; -Point(142) = {0.095492,spn,0.046049}; -Point(143) = {0.077836,spn,0.042615}; -Point(144) = {0.061847,spn,0.038859}; -Point(145) = {0.047586,spn,0.034803}; -Point(146) = {0.035112,spn,0.030473}; -Point(147) = {0.024472,spn,0.025893}; -Point(148) = {0.015708,spn,0.021088}; -Point(149) = {0.008856,spn,0.016078}; -Point(150) = {0.003943,spn,0.010884}; -Point(151) = {0.000987,spn,0.005521}; -Point(152) = {0.000000,spn,0.000000,msLe}; -Point(153) = {0.000987,spn,-0.005521}; -Point(154) = {0.003943,spn,-0.010884}; -Point(155) = {0.008856,spn,-0.016078}; -Point(156) = {0.015708,spn,-0.021088}; -Point(157) = {0.024472,spn,-0.025893}; -Point(158) = {0.035112,spn,-0.030473}; -Point(159) = {0.047586,spn,-0.034803}; -Point(160) = {0.061847,spn,-0.038859}; -Point(161) = {0.077836,spn,-0.042615}; -Point(162) = {0.095492,spn,-0.046049}; -Point(163) = {0.114743,spn,-0.049138}; -Point(164) = {0.135516,spn,-0.051862}; -Point(165) = {0.157726,spn,-0.054206}; -Point(166) = {0.181288,spn,-0.056159}; -Point(167) = {0.206107,spn,-0.057712}; -Point(168) = {0.232087,spn,-0.058863}; -Point(169) = {0.259123,spn,-0.059614}; -Point(170) = {0.287110,spn,-0.059971,msTe}; -Point(171) = {0.315938,spn,-0.059947}; -Point(172) = {0.345492,spn,-0.059557}; -Point(173) = {0.375655,spn,-0.058819}; -Point(174) = {0.406309,spn,-0.057755}; -Point(175) = {0.437333,spn,-0.056390}; -Point(176) = {0.468605,spn,-0.054749}; -Point(177) = {0.500000,spn,-0.052862}; -Point(178) = {0.531395,spn,-0.050754}; -Point(179) = {0.562667,spn,-0.048455}; -Point(180) = {0.593691,spn,-0.045992}; -Point(181) = {0.624345,spn,-0.043394}; -Point(182) = {0.654508,spn,-0.040686}; -Point(183) = {0.684062,spn,-0.037896}; -Point(184) = {0.712890,spn,-0.035048}; -Point(185) = {0.740877,spn,-0.032168}; -Point(186) = {0.767913,spn,-0.029279}; -Point(187) = {0.793893,spn,-0.026405}; -Point(188) = {0.818712,spn,-0.023569}; -Point(189) = {0.842274,spn,-0.020795}; -Point(190) = {0.864484,spn,-0.018106}; -Point(191) = {0.885257,spn,-0.015523}; -Point(192) = {0.904508,spn,-0.013071,msTe}; -Point(193) = {0.922164,spn,-0.010770}; -Point(194) = {0.938153,spn,-0.008643}; -Point(195) = {0.952414,spn,-0.006710}; -Point(196) = {0.964888,spn,-0.004990}; -Point(197) = {0.975528,spn,-0.003501}; -Point(198) = {0.984292,spn,-0.002260}; -Point(199) = {0.991144,spn,-0.001280}; -Point(200) = {0.996057,spn,-0.000572}; -Point(201) = {0.999013,spn,-0.000143,msTe}; - -// Tip: -Point(5101) = {0.999013,spn,0.000000}; -Point(5102) = {0.996057,spn+0.000125,0.000000}; -Point(5103) = {0.991144,spn+0.000331,0.000000}; -Point(5104) = {0.984292,spn+0.000620,0.000000}; -Point(5105) = {0.975528,spn+0.000989,0.000000}; -Point(5106) = {0.964888,spn+0.001437,0.000000}; -Point(5107) = {0.952414,spn+0.001963,0.000000}; -Point(5108) = {0.938153,spn+0.002563,0.000000}; -Point(5109) = {0.922164,spn+0.003237,0.000000}; -Point(5110) = {0.904508,spn+0.003981,0.000000,msTe}; -Point(5111) = {0.885257,spn+0.004791,0.000000}; -Point(5112) = {0.864484,spn+0.005666,0.000000}; -Point(5113) = {0.842274,spn+0.006602,0.000000}; -Point(5114) = {0.818712,spn+0.007594,0.000000}; -Point(5115) = {0.793893,spn+0.008640,0.000000}; -Point(5116) = {0.767913,spn+0.009734,0.000000}; -Point(5117) = {0.740877,spn+0.010873,0.000000}; -Point(5118) = {0.712890,spn+0.012052,0.000000}; -Point(5119) = {0.684062,spn+0.013266,0.000000}; -Point(5120) = {0.654508,spn+0.014511,0.000000}; -Point(5121) = {0.624345,spn+0.015781,0.000000}; -Point(5122) = {0.593691,spn+0.017072,0.000000}; -Point(5123) = {0.562667,spn+0.018379,0.000000}; -Point(5124) = {0.531395,spn+0.019696,0.000000}; -Point(5125) = {0.500000,spn+0.021019,0.000000}; -Point(5126) = {0.468605,spn+0.022341,0.000000}; -Point(5127) = {0.437333,spn+0.023658,0.000000}; -Point(5128) = {0.406309,spn+0.024965,0.000000}; -Point(5129) = {0.375655,spn+0.026256,0.000000}; -Point(5130) = {0.345492,spn+0.027526,0.000000}; -Point(5131) = {0.315938,spn+0.028771,0.000000}; -Point(5132) = {0.287110,spn+0.029985,0.000000,msTe}; -Point(5133) = {0.019492,spn+0.041801,0.000000}; - -// Dummy tip center: -Point(5349) = {0.904508,spn,0.000000}; -Point(5350) = {0.287110,spn,0.000000}; - -// Box -Point(10001) = {1+lgt, 0, 0, msF}; -Point(10002) = {1+lgt, 0, hgt, msF}; -Point(10003) = {-lgt, 0, hgt, msF}; -Point(10004) = {-lgt, 0, -hgt, msF}; -Point(10005) = {1+lgt, 0, -hgt, msF}; -Point(10011) = {1+lgt, wdt, hgt, msF}; -Point(10012) = {-lgt, wdt, hgt, msF}; -Point(10013) = {-lgt, wdt, -hgt, msF}; -Point(10014) = {1+lgt, wdt, -hgt, msF}; - -// Wake -Point(10021) = {1+lgt, spn, 0, msF}; - -/// Lines - -// Airfoil 1: -Spline(1) = {1,2,3,4,5,6,7,8,9,10,11}; -Spline(2) = {11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33}; -Spline(3) = {33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; -Spline(4) = {51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69}; -Spline(5) = {69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91}; -Spline(6) = {91,92,93,94,95,96,97,98,99,100,1}; - -// Airfoil 2: -Spline(7) = {102,103,104,105,106,107,108,109,110,111,112}; -Spline(8) = {112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134}; -Spline(9) = {134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152}; -Spline(10) = {152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170}; -Spline(11) = {170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192}; -Spline(12) = {192,193,194,195,196,197,198,199,200,201,102}; - -// Airfoil 1 to airfoil 2: -Line(61) = {1,102}; -Line(62) = {11,112}; -Line(63) = {33,134}; -Line(64) = {51,152}; -Line(65) = {69,170}; -Line(66) = {91,192}; - -// Tip: -Spline(121) = {102,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110}; -Spline(122) = {5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132}; -If(GMSH_MAJOR_VERSION >= 4) - Bezier(123) = {5132,5133,152}; -Else - BSpline(123) = {5132,5133,152}; -EndIf -Ellipse(124) = {112,5349,112,5110}; -Ellipse(125) = {134,5350,134,5132}; -Ellipse(126) = {170,5350,170,5132}; -Ellipse(127) = {192,5349,192,5110}; - -// Box -Line(201) = {10001,10002}; -Line(202) = {10002,10003}; -Line(203) = {10003,10004}; -Line(204) = {10004,10005}; -Line(205) = {10005,10001}; -Line(211) = {10011,10012}; -Line(212) = {10012,10013}; -Line(213) = {10013,10014}; -Line(214) = {10014,10011}; -Line(221) = {1, 10001}; -Line(222) = {102, 10021}; -Line(231) = {10002,10011}; -Line(232) = {10003,10012}; -Line(233) = {10004,10013}; -Line(234) = {10005,10014}; - -// Wake -Line(241) = {10001, 10021}; - -/// Line loops & Surfaces - -// Wing 1: -Line Loop(1) = {1,62,-7,-61}; -Line Loop(2) = {2,63,-8,-62}; -Line Loop(3) = {3,64,-9,-63}; -Line Loop(4) = {4,65,-10,-64}; -Line Loop(5) = {5,66,-11,-65}; -Line Loop(6) = {6,61,-12,-66}; -Surface(1) = {-1}; -Surface(2) = {-2}; -Surface(3) = {-3}; -Surface(4) = {-4}; -Surface(5) = {-5}; -Surface(6) = {-6}; - -// Wingtip: -Line Loop(11) = {7,124,-121}; -Line Loop(12) = {8,125,-122,-124}; -Line Loop(13) = {9,-123,-125}; -Line Loop(14) = {10,126,123}; -Line Loop(15) = {11,127,122,-126}; -Line Loop(16) = {12,121,-127}; -Surface(11) = {-11}; -Surface(12) = {-12}; -Surface(13) = {-13}; -Surface(14) = {-14}; -Surface(15) = {-15}; -Surface(16) = {-16}; - -// Symmetry -Line Loop(21) = {201, 202, 203, 204, 205}; -Line Loop(22) = {1, 2, 3, 4, 5, 6}; -Plane Surface(21) = {-21, 22}; - -// Downsteam -Line Loop(31) = {201, 231, -214, -234, 205}; -Plane Surface(31) = {31}; - -// Farfield -Line Loop(41) = {233, -212, -232, 203}; -Plane Surface(41) = {41}; -Line Loop(42) = {204, 234, -213, -233}; -Plane Surface(42) = {42}; -Line Loop(43) = {202, 232, -211, -231}; -Plane Surface(43) = {43}; -Line Loop(44) = {213, 214, 211, 212}; -Plane Surface(44) = {44}; - -// Wake -Line Loop(51) = {221, 241, -222, -61}; -Surface(51) = {51}; - -/// Volume -Surface Loop(1) = {1,2,3,4,5,6,11,12,13,14,15,16,21,31,41,42,43,44}; -Volume(1) = {1}; - -/// Embbeded -Line{221} In Surface{21}; -Line{241} In Surface{31}; -Surface{51} In Volume{1}; - -//// MESHING ALGORITHM - -/// 2D: - -///Wing, farfield and symmetry plane: -MeshAlgorithm Surface{1,2,3,4,5,6,21,31,41,42,43,44,51} = 5; - -///Tip: -MeshAlgorithm Surface{11,12,13,14,15,16} = 1; - -/// 3D: - -Mesh.Algorithm3D = 2; -//Mesh.OptimizeNetgen = 1; -Mesh.Optimize = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - - - -//// PHYSICAL GROUPS - -// Trailing edge and wake tip -Physical Line("wakeTip") = {222}; -Physical Line("teTip") = {61, 222}; - -// Internal Field: -Physical Volume("field") = {1}; - -// Wing: -Physical Surface("wing") = {1,2,3,11,12,13}; -Physical Surface("wing_") = {4,5,6,14,15,16}; - -// Symmetry: -Physical Surface("symmetry") = {21}; - -// Downstream: -Physical Surface("downstream") = {31}; - -// Farfield: -Physical Surface("upstream") = {41}; -Physical Surface("farfield") = {42,43,44}; - -// Wake: -Physical Surface("wake") = {51}; diff --git a/flow/models/n64A410.geo b/flow/models/n64A410.geo deleted file mode 100644 index c059f779..00000000 --- a/flow/models/n64A410.geo +++ /dev/null @@ -1,198 +0,0 @@ -/* Naca 64A410 */ - -// Geometry -DefineConstant[ xLgt = { 5.0, Name "Domain length (x-dir)" } ]; -DefineConstant[ yLgt = { 5.0, Name "Domain length (y-dir)" } ]; - -// Mesh -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; -DefineConstant[ msTe = { 0.01, Name "Airfoil TE mesh size" } ]; -DefineConstant[ msLe = { 0.01, Name "Airfoil LE mesh size" } ]; - -/************** - Geometry - **************/ - -// Airfoil -Te = 1; -Le = 64; - -Point(1) = {1.000000, 0.000000, 0.000000,msTe}; -Point(2) = {0.995000, 0.001837, 0.000000}; -Point(3) = {0.990000, 0.002895, 0.000000}; -Point(4) = {0.980000, 0.004790, 0.000000}; -Point(5) = {0.970000, 0.006613, 0.000000}; -Point(6) = {0.960000, 0.008463, 0.000000}; -Point(7) = {0.940000, 0.012357, 0.000000}; -Point(8) = {0.920000, 0.016451, 0.000000}; -Point(9) = {0.900000, 0.020593, 0.000000}; -Point(10) = {0.880000, 0.024668, 0.000000}; -Point(11) = {0.860000, 0.028469, 0.000000}; -Point(12) = {0.840000, 0.032435, 0.000000}; -Point(13) = {0.820000, 0.036270, 0.000000}; -Point(14) = {0.800000, 0.039914, 0.000000}; -Point(15) = {0.780000, 0.043268, 0.000000}; -Point(16) = {0.760000, 0.046431, 0.000000}; -Point(17) = {0.740000, 0.049438, 0.000000}; -Point(18) = {0.720000, 0.052291, 0.000000}; -Point(19) = {0.700000, 0.055004, 0.000000}; -Point(20) = {0.680000, 0.057572, 0.000000}; -Point(21) = {0.660000, 0.059984, 0.000000}; -Point(22) = {0.640000, 0.062245, 0.000000}; -Point(23) = {0.620000, 0.064341, 0.000000}; -Point(24) = {0.600000, 0.066278, 0.000000}; -Point(25) = {0.580000, 0.068051, 0.000000}; -Point(26) = {0.560000, 0.069656, 0.000000}; -Point(27) = {0.540000, 0.071091, 0.000000}; -Point(28) = {0.520000, 0.072351, 0.000000}; -Point(29) = {0.500000, 0.073417, 0.000000}; -Point(30) = {0.480000, 0.074281, 0.000000}; -Point(31) = {0.460000, 0.074942, 0.000000}; -Point(32) = {0.440000, 0.075381, 0.000000}; -Point(33) = {0.420000, 0.075587, 0.000000}; -Point(34) = {0.400000, 0.075525, 0.000000}; -Point(35) = {0.380000, 0.075182, 0.000000}; -Point(36) = {0.360000, 0.074579, 0.000000}; -Point(37) = {0.340000, 0.073744, 0.000000}; -Point(38) = {0.320000, 0.072695, 0.000000}; -Point(39) = {0.300000, 0.071420, 0.000000}; -Point(40) = {0.280000, 0.069924, 0.000000}; -Point(41) = {0.260000, 0.068203, 0.000000}; -Point(42) = {0.240000, 0.066247, 0.000000}; -Point(43) = {0.220000, 0.064042, 0.000000}; -Point(44) = {0.200000, 0.061573, 0.000000}; -Point(45) = {0.180000, 0.058819, 0.000000}; -Point(46) = {0.160000, 0.055761, 0.000000}; -Point(47) = {0.140000, 0.052376, 0.000000}; -Point(48) = {0.120000, 0.048619, 0.000000}; -Point(49) = {0.100000, 0.044414, 0.000000}; -Point(50) = {0.080000, 0.039655, 0.000000}; -Point(51) = {0.060000, 0.034234, 0.000000}; -Point(52) = {0.050000, 0.031193, 0.000000}; -Point(53) = {0.040000, 0.027846, 0.000000}; -Point(54) = {0.030000, 0.024089, 0.000000}; -Point(55) = {0.020000, 0.019724, 0.000000}; -Point(56) = {0.015000, 0.017185, 0.000000}; -Point(57) = {0.010000, 0.014248, 0.000000}; -Point(58) = {0.005000, 0.010569, 0.000000}; -Point(59) = {0.002000, 0.007424, 0.000000}; -Point(60) = {0.001500, 0.006728, 0.000000}; -Point(61) = {0.001000, 0.005929, 0.000000}; -Point(62) = {0.000500, 0.004961, 0.000000}; -Point(63) = {0.000200, 0.004230, 0.000000}; -Point(64) = {0.000000, 0.000000, 0.000000, msLe}; -Point(65) = {0.000200, -0.000537, 0.000000}; -Point(66) = {0.000500, -0.001189, 0.000000}; -Point(67) = {0.001000, -0.002111, 0.000000}; -Point(68) = {0.001500, -0.002868, 0.000000}; -Point(69) = {0.002000, -0.003495, 0.000000}; -Point(70) = {0.005000, -0.006014, 0.000000}; -Point(71) = {0.010000, -0.008383, 0.000000}; -Point(72) = {0.015000, -0.009943, 0.000000}; -Point(73) = {0.020000, -0.011158, 0.000000}; -Point(74) = {0.030000, -0.013034, 0.000000}; -Point(75) = {0.040000, -0.014487, 0.000000}; -Point(76) = {0.050000, -0.015687, 0.000000}; -Point(77) = {0.060000, -0.016710, 0.000000}; -Point(78) = {0.080000, -0.018411, 0.000000}; -Point(79) = {0.100000, -0.019815, 0.000000}; -Point(80) = {0.120000, -0.020971, 0.000000}; -Point(81) = {0.140000, -0.021932, 0.000000}; -Point(82) = {0.160000, -0.022743, 0.000000}; -Point(83) = {0.180000, -0.023434, 0.000000}; -Point(84) = {0.200000, -0.024009, 0.000000}; -Point(85) = {0.220000, -0.024471, 0.000000}; -Point(86) = {0.240000, -0.024831, 0.000000}; -Point(87) = {0.260000, -0.025096, 0.000000}; -Point(88) = {0.280000, -0.025270, 0.000000}; -Point(89) = {0.300000, -0.025358, 0.000000}; -Point(90) = {0.320000, -0.025361, 0.000000}; -Point(91) = {0.340000, -0.025268, 0.000000}; -Point(92) = {0.360000, -0.025088, 0.000000}; -Point(93) = {0.380000, -0.024804, 0.000000}; -Point(94) = {0.400000, -0.024383, 0.000000}; -Point(95) = {0.420000, -0.023801, 0.000000}; -Point(96) = {0.440000, -0.023067, 0.000000}; -Point(97) = {0.460000, -0.022215, 0.000000}; -Point(98) = {0.480000, -0.021262, 0.000000}; -Point(99) = {0.500000, -0.020227, 0.000000}; -Point(100) = {0.520000, -0.019111, 0.000000}; -Point(101) = {0.540000, -0.017926, 0.000000}; -Point(102) = {0.560000, -0.016696, 0.000000}; -Point(103) = {0.580000, -0.015426, 0.000000}; -Point(104) = {0.600000, -0.014125, 0.000000}; -Point(105) = {0.620000, -0.012801, 0.000000}; -Point(106) = {0.640000, -0.011466, 0.000000}; -Point(107) = {0.660000, -0.010122, 0.000000}; -Point(108) = {0.680000, -0.008794, 0.000000}; -Point(109) = {0.700000, -0.007488, 0.000000}; -Point(110) = {0.720000, -0.006231, 0.000000}; -Point(111) = {0.740000, -0.005048, 0.000000}; -Point(112) = {0.760000, -0.003956, 0.000000}; -Point(113) = {0.780000, -0.002994, 0.000000}; -Point(114) = {0.800000, -0.002213, 0.000000}; -Point(115) = {0.820000, -0.001715, 0.000000}; -Point(116) = {0.840000, -0.001412, 0.000000}; -Point(117) = {0.860000, -0.001215, 0.000000}; -Point(118) = {0.880000, -0.000871, 0.000000}; -Point(119) = {0.900000, -0.000755, 0.000000}; -Point(120) = {0.920000, -0.000579, 0.000000}; -Point(121) = {0.940000, -0.000460, 0.000000}; -Point(122) = {0.960000, -0.000538, 0.000000}; -Point(123) = {0.970000, -0.000669, 0.000000}; -Point(124) = {0.980000, -0.000819, 0.000000}; -Point(125) = {0.990000, -0.000900, 0.000000}; -Point(126) = {0.995000, -0.000814, 0.000000, msTe}; -//Point(127) = {1.000000, 0.000000, 0.000000, msTe}; - -Spline(1) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; -Spline(2) = {1,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64}; - -// Center -Point(0) = {1,0,0}; - -// Farfield -Point(10001) = {1+xLgt, 0, 0,msF}; -Point(10002) = {1+xLgt, yLgt, 0,msF}; -Point(10003) = {-xLgt, yLgt, 0,msF}; -Point(10004) = {-xLgt, 0, 0,msF}; -Point(10005) = {-xLgt,-yLgt, 0,msF}; -Point(10006) = {1+xLgt, -yLgt, 0,msF}; - -Line(10001) = {10001, 10002}; -Line(10002) = {10002, 10003}; -Line(10003) = {10003, 10004}; -Line(10004) = {10004, 10005}; -Line(10005) = {10005, 10006}; -Line(10006) = {10006, 10001}; - -// Front and wake -Line(10007) = {Le, 10004}; -Line(10008) = {Te, 10001}; - -// Internal field -Line Loop(10001) = {10008, 10001, 10002, 10003, -10007, 1}; -Line Loop(10002) = {10007, 10004, 10005, 10006, -10008, 2}; -Plane Surface(10001) = {10001}; -Plane Surface(10002) = {10002}; - -/************************* - Mesh Options - *************************/ - -Mesh.Algorithm = 5; // Delaunay - -/************************* - Physical Groups - *************************/ - -Physical Point("te") = {Te}; -Physical Line("upstream") = {10003, 10004}; -Physical Line("farfield") = {10002, 10005}; -Physical Line("downstream") = {10001}; -Physical Line("downstream") += {10006}; -Physical Line("airfoil") = {1}; -Physical Line("airfoil_") = {2}; -Physical Line("wake") = {10008}; -Physical Surface("field") = {10001}; -Physical Surface("field") += {10002}; diff --git a/flow/models/old/channel.geo b/flow/models/old/channel.geo deleted file mode 100644 index baf434cf..00000000 --- a/flow/models/old/channel.geo +++ /dev/null @@ -1,48 +0,0 @@ -/* Flow test case */ -// Channel flow with or without a cylinder - -DefineConstant[ type = { 1, Min 0, Max 1, Step 1, Name "Model type" } ]; - -DefineConstant[ fms = { 0.75, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; -DefineConstant[ nms = { 0.25, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; - -Point(1) = {-4, -3, 0, fms}; -Point(2) = {6, -3, 0, fms}; -Point(3) = {6, 3, 0, fms}; -Point(4) = {-4, 3, 0, fms}; - -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; - -Physical Line("upstream", 2) = {4}; -Physical Line("side", 3) = {1, 3}; -Physical Line("downstream", 4) = {2}; - -Line Loop(1) = {1,2,3,4}; - -If (type==1) - Point(0) = {0, 0, 0}; - Point(6) = {-0.5, 0, 0, nms}; - Point(7) = {0, -0.5, 0, nms}; - Point(8) = {0.5, 0, 0, nms}; - Point(9) = {0, 0.5, 0, nms}; - - Circle(6) = {6, 0, 7}; - Circle(7) = {7, 0, 8}; - Circle(8) = {8, 0, 9}; - Circle(9) = {9, 0, 6}; - - Physical Line("cylinder", 5) = {6, 7, 8, 9}; - - Line Loop(2) = {6,7,8,9}; - - Surface(1) = {1, 2}; - -Else - Surface(1) = {1}; - -EndIf - -Physical Surface("internalField", 1) = {1}; diff --git a/flow/models/old/channel3.geo b/flow/models/old/channel3.geo deleted file mode 100644 index 81026411..00000000 --- a/flow/models/old/channel3.geo +++ /dev/null @@ -1,116 +0,0 @@ -/* 3D channel with cylinder */ - -// Parameters -DefineConstant[ dmt = { 0.5, Name "Cylinder diameter" } ]; -DefineConstant[ spn = { 1.5, Name "Cylinder span" } ]; -DefineConstant[ lgt = { 4.0, Name "Channel length" } ]; -DefineConstant[ wdt = { 2.5, Name "Channel width" } ]; -DefineConstant[ hgt = { 3.0, Name "Channel height" } ]; -DefineConstant[ mshN = { 0.1, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; -DefineConstant[ mshF = { 0.5, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; - - -// Geometry - -// center -Point(0) = {0., 0., 0.}; -Point(5) = {0., spn, 0.}; -// cylinder -Point(1) = {dmt/2, 0., 0., mshN}; -Point(2) = {0., 0., dmt/2, mshN}; -Point(3) = {-dmt/2, 0., 0., mshN}; -Point(4) = {0., 0., -dmt/2, mshN}; -Point(6) = {dmt/2, spn, 0., mshN}; -Point(7) = {0., spn, dmt/2, mshN}; -Point(8) = {-dmt/2, spn, 0., mshN}; -Point(9) = {0., spn, -dmt/2, mshN}; -// symmetry -Point(11) = {lgt/2, 0., hgt/2, mshF}; -Point(12) = {-lgt/2, 0., hgt/2, mshF}; -Point(13) = {-lgt/2, 0., -hgt/2, mshF}; -Point(14) = {lgt/2, 0., -hgt/2, mshF}; -// farfield -Point(16) = {lgt/2, wdt, hgt/2, mshF}; -Point(17) = {-lgt/2, wdt, hgt/2, mshF}; -Point(18) = {-lgt/2, wdt, -hgt/2, mshF}; -Point(19) = {lgt/2, wdt, -hgt/2, mshF}; - -// cylinder -Circle(1) = {1, 0, 2}; -Circle(2) = {2, 0, 3}; -Circle(3) = {3, 0, 4}; -Circle(4) = {4, 0, 1}; -Line(6) = {1, 6}; -Line(7) = {2, 7}; -Line(8) = {3, 8}; -Line(9) = {4, 9}; -Circle(11) = {6, 5, 7}; -Circle(12) = {7, 5, 8}; -Circle(13) = {8, 5, 9}; -Circle(14) = {9, 5, 6}; -// box -Line(21) = {11, 12}; -Line(22) = {12, 13}; -Line(23) = {13, 14}; -Line(24) = {14, 11}; -Line(26) = {11, 16}; -Line(27) = {12, 17}; -Line(28) = {13, 18}; -Line(29) = {14, 19}; -Line(31) = {16, 17}; -Line(32) = {17, 18}; -Line(33) = {18, 19}; -Line(34) = {19, 16}; - -// cylinder -Line Loop(1) = {1, 7, -11, -6}; -Line Loop(2) = {2, 8, -12, -7}; -Line Loop(3) = {3, 9, -13, -8}; -Line Loop(4) = {4, 6, -14, -9}; -Surface(1) = {-1}; -Surface(2) = {-2}; -Surface(3) = {-3}; -Surface(4) = {-4}; -Line Loop(5) = {11, 12, 13, 14}; -Surface(5) = {-5}; -// symmetry -Line Loop(11) = {1, 2, 3, 4}; -Line Loop(12) = {21, 22, 23, 24}; -Surface(11) = {-12, 11}; - -// inlet -Line Loop(13) = {-22, 27, 32, -28}; -Surface(12) = {-13}; -// outlet -Line Loop(14) = {24, 26, -34, -29}; -Surface(13) = {14}; -// top -Line Loop(15) = {-21, 26, 31, -27}; -Surface(14) = {-15}; -// bottom -Line Loop(16) = {23, 29, -33, -28}; -Surface(15) = {16}; -// farfield -Line Loop(17) = {31, 32, 33, 34}; -Surface(16) = {17}; - -// Field -Surface Loop(1) = {1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 16}; -Volume(1) = {1}; - -// Physical groups -internalField = 1000; -inlet = 1001; -outlet = 1002; -side = 1003; -symmetry = 1004; -farfield = 1005; -cylinder = 1006; - -Physical Volume("internalField", internalField) = {1}; -Physical Surface("upstream", inlet) = {12}; -Physical Surface("downstream", outlet) = {13}; -Physical Surface("side", side) = {14, 15}; -Physical Surface("symmetry", symmetry) = {11}; -Physical Surface("farfield", farfield) = {16}; -Physical Surface("cylinder", cylinder) = {1, 2, 3, 4, 5}; \ No newline at end of file diff --git a/flow/models/old/n0012-3_.geo b/flow/models/old/n0012-3_.geo deleted file mode 100644 index 565fa91c..00000000 --- a/flow/models/old/n0012-3_.geo +++ /dev/null @@ -1,339 +0,0 @@ -/* Naca 0012 2D5 wing */ - -// Parameters -// domain -DefineConstant[ lgt = { 8.0, Name "Channel length" } ]; -DefineConstant[ wdt = { 5.0, Name "Channel width" } ]; -DefineConstant[ hgt = { 6.0, Name "Channel height" } ]; -DefineConstant[ msN = { 0.1, Min 0.1, Max 1, Step 0.1, Name "Nearfield mesh size" } ]; -DefineConstant[ msF = { 1.0, Min 0.1, Max 1, Step 0.1, Name "Farfield mesh size" } ]; - -// mesh algo -msh3D = 2; -msh2D = 5; - -// Geometry -// wing -Point(1) = {1.000000,0.000000,0,msN}; -Point(2) = {0.999013,0.000000,0.000143}; -Point(3) = {0.996057,0.000000,0.000572}; -Point(4) = {0.991144,0.000000,0.001280}; -Point(5) = {0.984292,0.000000,0.002260}; -Point(6) = {0.975528,0.000000,0.003501}; -Point(7) = {0.964888,0.000000,0.004990}; -Point(8) = {0.952414,0.000000,0.006710}; -Point(9) = {0.938153,0.000000,0.008643}; -Point(10) = {0.922164,0.000000,0.010770}; -Point(11) = {0.904508,0.000000,0.013071}; -Point(12) = {0.885257,0.000000,0.015523}; -Point(13) = {0.864484,0.000000,0.018106}; -Point(14) = {0.842274,0.000000,0.020795}; -Point(15) = {0.818712,0.000000,0.023569}; -Point(16) = {0.793893,0.000000,0.026405}; -Point(17) = {0.767913,0.000000,0.029279}; -Point(18) = {0.740877,0.000000,0.032168}; -Point(19) = {0.712890,0.000000,0.035048}; -Point(20) = {0.684062,0.000000,0.037896}; -Point(21) = {0.654508,0.000000,0.040686}; -Point(22) = {0.624345,0.000000,0.043394}; -Point(23) = {0.593691,0.000000,0.045992}; -Point(24) = {0.562667,0.000000,0.048455}; -Point(25) = {0.531395,0.000000,0.050754}; -Point(26) = {0.500000,0.000000,0.052862}; -Point(27) = {0.468605,0.000000,0.054749}; -Point(28) = {0.437333,0.000000,0.056390}; -Point(29) = {0.406309,0.000000,0.057755}; -Point(30) = {0.375655,0.000000,0.058819}; -Point(31) = {0.345492,0.000000,0.059557}; -Point(32) = {0.315938,0.000000,0.059947}; -Point(33) = {0.287110,0.000000,0.059971}; -Point(34) = {0.259123,0.000000,0.059614}; -Point(35) = {0.232087,0.000000,0.058863}; -Point(36) = {0.206107,0.000000,0.057712}; -Point(37) = {0.181288,0.000000,0.056159}; -Point(38) = {0.157726,0.000000,0.054206}; -Point(39) = {0.135516,0.000000,0.051862}; -Point(40) = {0.114743,0.000000,0.049138}; -Point(41) = {0.095492,0.000000,0.046049}; -Point(42) = {0.077836,0.000000,0.042615}; -Point(43) = {0.061847,0.000000,0.038859}; -Point(44) = {0.047586,0.000000,0.034803}; -Point(45) = {0.035112,0.000000,0.030473}; -Point(46) = {0.024472,0.000000,0.025893}; -Point(47) = {0.015708,0.000000,0.021088}; -Point(48) = {0.008856,0.000000,0.016078}; -Point(49) = {0.003943,0.000000,0.010884}; -Point(50) = {0.000987,0.000000,0.005521}; -Point(51) = {0.000000,0.000000,0,msN}; -Point(52) = {0.000987,0.000000,-0.005521}; -Point(53) = {0.003943,0.000000,-0.010884}; -Point(54) = {0.008856,0.000000,-0.016078}; -Point(55) = {0.015708,0.000000,-0.021088}; -Point(56) = {0.024472,0.000000,-0.025893}; -Point(57) = {0.035112,0.000000,-0.030473}; -Point(58) = {0.047586,0.000000,-0.034803}; -Point(59) = {0.061847,0.000000,-0.038859}; -Point(60) = {0.077836,0.000000,-0.042615}; -Point(61) = {0.095492,0.000000,-0.046049}; -Point(62) = {0.114743,0.000000,-0.049138}; -Point(63) = {0.135516,0.000000,-0.051862}; -Point(64) = {0.157726,0.000000,-0.054206}; -Point(65) = {0.181288,0.000000,-0.056159}; -Point(66) = {0.206107,0.000000,-0.057712}; -Point(67) = {0.232087,0.000000,-0.058863}; -Point(68) = {0.259123,0.000000,-0.059614}; -Point(69) = {0.287110,0.000000,-0.059971}; -Point(70) = {0.315938,0.000000,-0.059947}; -Point(71) = {0.345492,0.000000,-0.059557}; -Point(72) = {0.375655,0.000000,-0.058819}; -Point(73) = {0.406309,0.000000,-0.057755}; -Point(74) = {0.437333,0.000000,-0.056390}; -Point(75) = {0.468605,0.000000,-0.054749}; -Point(76) = {0.500000,0.000000,-0.052862}; -Point(77) = {0.531395,0.000000,-0.050754}; -Point(78) = {0.562667,0.000000,-0.048455}; -Point(79) = {0.593691,0.000000,-0.045992}; -Point(80) = {0.624345,0.000000,-0.043394}; -Point(81) = {0.654508,0.000000,-0.040686}; -Point(82) = {0.684062,0.000000,-0.037896}; -Point(83) = {0.712890,0.000000,-0.035048}; -Point(84) = {0.740877,0.000000,-0.032168}; -Point(85) = {0.767913,0.000000,-0.029279}; -Point(86) = {0.793893,0.000000,-0.026405}; -Point(87) = {0.818712,0.000000,-0.023569}; -Point(88) = {0.842274,0.000000,-0.020795}; -Point(89) = {0.864484,0.000000,-0.018106}; -Point(90) = {0.885257,0.000000,-0.015523}; -Point(91) = {0.904508,0.000000,-0.013071}; -Point(92) = {0.922164,0.000000,-0.010770}; -Point(93) = {0.938153,0.000000,-0.008643}; -Point(94) = {0.952414,0.000000,-0.006710}; -Point(95) = {0.964888,0.000000,-0.004990}; -Point(96) = {0.975528,0.000000,-0.003501}; -Point(97) = {0.984292,0.000000,-0.002260}; -Point(98) = {0.991144,0.000000,-0.001280}; -Point(99) = {0.996057,0.000000,-0.000572}; -Point(100) = {0.999013,0.000000,-0.000143, msN}; - -// Airfoil 2: naca0012, 101 points -Point(102) = {1.000000,wdt,0,msN}; -Point(103) = {0.999013,wdt,0.000143}; -Point(104) = {0.996057,wdt,0.000572}; -Point(105) = {0.991144,wdt,0.001280}; -Point(106) = {0.984292,wdt,0.002260}; -Point(107) = {0.975528,wdt,0.003501}; -Point(108) = {0.964888,wdt,0.004990}; -Point(109) = {0.952414,wdt,0.006710}; -Point(110) = {0.938153,wdt,0.008643}; -Point(111) = {0.922164,wdt,0.010770}; -Point(112) = {0.904508,wdt,0.013071}; -Point(113) = {0.885257,wdt,0.015523}; -Point(114) = {0.864484,wdt,0.018106}; -Point(115) = {0.842274,wdt,0.020795}; -Point(116) = {0.818712,wdt,0.023569}; -Point(117) = {0.793893,wdt,0.026405}; -Point(118) = {0.767913,wdt,0.029279}; -Point(119) = {0.740877,wdt,0.032168}; -Point(120) = {0.712890,wdt,0.035048}; -Point(121) = {0.684062,wdt,0.037896}; -Point(122) = {0.654508,wdt,0.040686}; -Point(123) = {0.624345,wdt,0.043394}; -Point(124) = {0.593691,wdt,0.045992}; -Point(125) = {0.562667,wdt,0.048455}; -Point(126) = {0.531395,wdt,0.050754}; -Point(127) = {0.500000,wdt,0.052862}; -Point(128) = {0.468605,wdt,0.054749}; -Point(129) = {0.437333,wdt,0.056390}; -Point(130) = {0.406309,wdt,0.057755}; -Point(131) = {0.375655,wdt,0.058819}; -Point(132) = {0.345492,wdt,0.059557}; -Point(133) = {0.315938,wdt,0.059947}; -Point(134) = {0.287110,wdt,0.059971}; -Point(135) = {0.259123,wdt,0.059614}; -Point(136) = {0.232087,wdt,0.058863}; -Point(137) = {0.206107,wdt,0.057712}; -Point(138) = {0.181288,wdt,0.056159}; -Point(139) = {0.157726,wdt,0.054206}; -Point(140) = {0.135516,wdt,0.051862}; -Point(141) = {0.114743,wdt,0.049138}; -Point(142) = {0.095492,wdt,0.046049}; -Point(143) = {0.077836,wdt,0.042615}; -Point(144) = {0.061847,wdt,0.038859}; -Point(145) = {0.047586,wdt,0.034803}; -Point(146) = {0.035112,wdt,0.030473}; -Point(147) = {0.024472,wdt,0.025893}; -Point(148) = {0.015708,wdt,0.021088}; -Point(149) = {0.008856,wdt,0.016078}; -Point(150) = {0.003943,wdt,0.010884}; -Point(151) = {0.000987,wdt,0.005521}; -Point(152) = {0.000000,wdt,0,msN}; -Point(153) = {0.000987,wdt,-0.005521}; -Point(154) = {0.003943,wdt,-0.010884}; -Point(155) = {0.008856,wdt,-0.016078}; -Point(156) = {0.015708,wdt,-0.021088}; -Point(157) = {0.024472,wdt,-0.025893}; -Point(158) = {0.035112,wdt,-0.030473}; -Point(159) = {0.047586,wdt,-0.034803}; -Point(160) = {0.061847,wdt,-0.038859}; -Point(161) = {0.077836,wdt,-0.042615}; -Point(162) = {0.095492,wdt,-0.046049}; -Point(163) = {0.114743,wdt,-0.049138}; -Point(164) = {0.135516,wdt,-0.051862}; -Point(165) = {0.157726,wdt,-0.054206}; -Point(166) = {0.181288,wdt,-0.056159}; -Point(167) = {0.206107,wdt,-0.057712}; -Point(168) = {0.232087,wdt,-0.058863}; -Point(169) = {0.259123,wdt,-0.059614}; -Point(170) = {0.287110,wdt,-0.059971}; -Point(171) = {0.315938,wdt,-0.059947}; -Point(172) = {0.345492,wdt,-0.059557}; -Point(173) = {0.375655,wdt,-0.058819}; -Point(174) = {0.406309,wdt,-0.057755}; -Point(175) = {0.437333,wdt,-0.056390}; -Point(176) = {0.468605,wdt,-0.054749}; -Point(177) = {0.500000,wdt,-0.052862}; -Point(178) = {0.531395,wdt,-0.050754}; -Point(179) = {0.562667,wdt,-0.048455}; -Point(180) = {0.593691,wdt,-0.045992}; -Point(181) = {0.624345,wdt,-0.043394}; -Point(182) = {0.654508,wdt,-0.040686}; -Point(183) = {0.684062,wdt,-0.037896}; -Point(184) = {0.712890,wdt,-0.035048}; -Point(185) = {0.740877,wdt,-0.032168}; -Point(186) = {0.767913,wdt,-0.029279}; -Point(187) = {0.793893,wdt,-0.026405}; -Point(188) = {0.818712,wdt,-0.023569}; -Point(189) = {0.842274,wdt,-0.020795}; -Point(190) = {0.864484,wdt,-0.018106}; -Point(191) = {0.885257,wdt,-0.015523}; -Point(192) = {0.904508,wdt,-0.013071}; -Point(193) = {0.922164,wdt,-0.010770}; -Point(194) = {0.938153,wdt,-0.008643}; -Point(195) = {0.952414,wdt,-0.006710}; -Point(196) = {0.964888,wdt,-0.004990}; -Point(197) = {0.975528,wdt,-0.003501}; -Point(198) = {0.984292,wdt,-0.002260}; -Point(199) = {0.991144,wdt,-0.001280}; -Point(200) = {0.996057,wdt,-0.000572}; -Point(201) = {0.999013,wdt,-0.000143,msN}; - -// box -Point(1031) = {1+lgt/2, 0, hgt/2, msF}; -Point(1032) = {-lgt/2, 0, hgt/2, msF}; -Point(1033) = {-lgt/2, 0, -hgt/2, msF}; -Point(1034) = {1+lgt/2, 0, -hgt/2, msF}; -Point(1035) = {1+lgt/2, wdt, hgt/2, msF}; -Point(1036) = {-lgt/2, wdt, hgt/2, msF}; -Point(1037) = {-lgt/2, wdt, -hgt/2, msF}; -Point(1038) = {1+lgt/2, wdt, -hgt/2, msF}; - -// midplane -Point(1041) = {1+lgt/2, 0, 0, msF}; -Point(1042) = {1+lgt/2, wdt, 0, msF}; -Point(1043) = {-lgt/2, wdt, 0, msF}; -Point(1044) = {-lgt/2, 0, 0, msF}; - -// wing -Spline(1) = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; -Spline(2) = {51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,1}; -Spline(3) = {102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152}; -Spline(4) = {152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,102}; -Line(5) = {1, 102}; -Line(6) = {51, 152}; - -// box -Line(7) = {1041, 1031}; -Line(8) = {1031, 1032}; -Line(9) = {1032, 1044}; -Line(10) = {1044, 1033}; -Line(11) = {1033, 1034}; -Line(12) = {1034, 1041}; -Line(13) = {1042, 1035}; -Line(14) = {1035, 1036}; -Line(15) = {1036, 1043}; -Line(16) = {1043, 1037}; -Line(17) = {1037, 1038}; -Line(18) = {1038, 1042}; -Line(19) = {1031, 1035}; -Line(20) = {1032, 1036}; -Line(21) = {1033, 1037}; -Line(22) = {1034, 1038}; - -// midplane -Line(23) = {1, 1041}; -Line(24) = {102, 1042}; -Line(25) = {152, 1043}; -Line(26) = {51, 1044}; -Line(27) = {1041, 1042}; -Line(28) = {1044, 1043}; - -// wing -Line Loop(1) = {1, 6, -3, -5}; -Surface(1) = {-1}; -Line Loop(2) = {2, 5, -4, -6}; -Surface(2) = {-2}; - -// symmetry -Line Loop(3) = {23, 7, 8, 9, -26, -1}; -Plane Surface(3) = {-3}; -Line Loop(9) = {24, 13, 14, 15, -25, -3}; -Plane Surface(9) = {9}; -Line Loop(4) = {26, 10, 11, 12, -23, -2}; -Plane Surface(4) = {-4}; -Line Loop(10) = {25, 16, 17, 18, -24, -4}; -Plane Surface(10) = {10}; - -// upstream -Line Loop(5) = {28, -15, -20, 9}; -Plane Surface(5) = {5}; -Line Loop(6) = {21, -16, -28, 10}; -Plane Surface(6) = {6}; - -// downstream -Line Loop(7) = {27, 13, -19, -7}; -Plane Surface(7) = {-7}; -Line Loop(8) = {22, 18, -27, -12}; -Plane Surface(8) = {-8}; - -// farfield -Line Loop(11) = {8, 20, -14, -19}; -Plane Surface(11) = {11}; -Line Loop(12) = {11, 22, -17, -21}; -Plane Surface(12) = {12}; - -// wake -Line Loop(13) = {23, 27, -24, -5}; -Plane Surface(13) = {13}; - -// internal -Line Loop(14) = {26, 28, -25, -6}; -Plane Surface(14) = {-14}; - -// field -Surface Loop(1) = {5, 9, 7, 11, 3, 1, 14, 13}; -Volume(1) = {1}; -Surface Loop(2) = {4, 6, 12, 8, 10, 2, 14, 13}; -Volume(2) = {2}; - -// Mesh -// 2D -MeshAlgorithm Surface{1,2,3,4,5,6,7,8,9,10,11,12,13,14} = msh2D; -// 3D -Mesh.Algorithm3D = msh3D; -Mesh.OptimizeNetgen = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -// Physical -Physical Line("te") = {5}; -Physical Surface("cylinder") = {1}; -Physical Surface("cylinder_") = {2}; -Physical Surface("symmetry") = {3, 9}; -Physical Surface("symmetry_") = {4, 10}; -Physical Surface("upstream") = {5, 6}; -Physical Surface("downstream") = {7}; -Physical Surface("downstream_") = {8}; -Physical Surface("farfield") = {11, 12}; -Physical Surface("wake") = {13}; -Physical Volume("field") = {1}; -Physical Volume("field_") = {2}; diff --git a/flow/models/old/n0012s.geo b/flow/models/old/n0012s.geo deleted file mode 100644 index 227f8f56..00000000 --- a/flow/models/old/n0012s.geo +++ /dev/null @@ -1,298 +0,0 @@ -/* Naca0012 */ - -// Geometry -DefineConstant[ xLgt = { 5.0, Name "Domain length (x-dir)" } ]; -DefineConstant[ yLgt = { 5.0, Name "Domain length (y-dir)" } ]; - -// Mesh -nChord = 50; -pChord = 0.3; -nLe = 20; -pLe = 1.02; -nPerp = 25; -pPerp = 1.2; - -/************** - Geometry - **************/ - -//Point(201) = {1.000000,0.000000,0}; -Point(200) = {0.999753,-0.000035,0}; -Point(199) = {0.999013,-0.000141,0}; -Point(198) = {0.997781,-0.000317,0}; -Point(197) = {0.996057,-0.000562,0}; -Point(196) = {0.993844,-0.000876,0}; -Point(195) = {0.991144,-0.001258,0}; -Point(194) = {0.987958,-0.001707,0}; -Point(193) = {0.984292,-0.002222,0}; -Point(192) = {0.980147,-0.002801,0}; -Point(191) = {0.975528,-0.003443,0}; -Point(190) = {0.970440,-0.004147,0}; -Point(189) = {0.964888,-0.004909,0}; -Point(188) = {0.958877,-0.005729,0}; -Point(187) = {0.952414,-0.006603,0}; -Point(186) = {0.945503,-0.007531,0}; -Point(185) = {0.938153,-0.008510,0}; -Point(184) = {0.930371,-0.009537,0}; -Point(183) = {0.922164,-0.010610,0}; -Point(182) = {0.913540,-0.011726,0}; -Point(181) = {0.904508,-0.012883,0}; -Point(180) = {0.895078,-0.014079,0}; -Point(179) = {0.885257,-0.015310,0}; -Point(178) = {0.875056,-0.016574,0}; -Point(177) = {0.864484,-0.017868,0}; -Point(176) = {0.853553,-0.019189,0}; -Point(175) = {0.842274,-0.020535,0}; -Point(174) = {0.830656,-0.021904,0}; -Point(173) = {0.818712,-0.023291,0}; -Point(172) = {0.806454,-0.024694,0}; -Point(171) = {0.793893,-0.026111,0}; -Point(170) = {0.781042,-0.027539,0}; -Point(169) = {0.767913,-0.028974,0}; -Point(168) = {0.754521,-0.030414,0}; -Point(167) = {0.740877,-0.031856,0}; -Point(166) = {0.726995,-0.033296,0}; -Point(165) = {0.712890,-0.034733,0}; -Point(164) = {0.698574,-0.036163,0}; -Point(163) = {0.684062,-0.037582,0}; -Point(162) = {0.669369,-0.038988,0}; -Point(161) = {0.654508,-0.040378,0}; -Point(160) = {0.639496,-0.041747,0}; -Point(159) = {0.624345,-0.043094,0}; -Point(158) = {0.609072,-0.044414,0}; -Point(157) = {0.593691,-0.045705,0}; -Point(156) = {0.578217,-0.046962,0}; -Point(155) = {0.562667,-0.048182,0}; -Point(154) = {0.547054,-0.049362,0}; -Point(153) = {0.531395,-0.050499,0}; -Point(152) = {0.515705,-0.051587,0}; -Point(151) = {0.500000,-0.052625,0}; -Point(150) = {0.484295,-0.053608,0}; -Point(149) = {0.468605,-0.054534,0}; -Point(148) = {0.452946,-0.055397,0}; -Point(147) = {0.437333,-0.056195,0}; -Point(146) = {0.421783,-0.056924,0}; -Point(145) = {0.406309,-0.057581,0}; -Point(144) = {0.390928,-0.058163,0}; -Point(143) = {0.375655,-0.058666,0}; -Point(142) = {0.360504,-0.059087,0}; -Point(141) = {0.345492,-0.059424,0}; -Point(140) = {0.330631,-0.059674,0}; -Point(139) = {0.315938,-0.059834,0}; -Point(138) = {0.301426,-0.059902,0}; -Point(137) = {0.287110,-0.059876,0}; -Point(136) = {0.273005,-0.059754,0}; -Point(135) = {0.259123,-0.059535,0}; -Point(134) = {0.245479,-0.059217,0}; -Point(133) = {0.232087,-0.058799,0}; -Point(132) = {0.218958,-0.058280,0}; -Point(131) = {0.206107,-0.057661,0}; -Point(130) = {0.193546,-0.056940,0}; -Point(129) = {0.181288,-0.056119,0}; -Point(128) = {0.169344,-0.055197,0}; -Point(127) = {0.157726,-0.054176,0}; -Point(126) = {0.146447,-0.053056,0}; -Point(125) = {0.135516,-0.051839,0}; -Point(124) = {0.124944,-0.050527,0}; -Point(123) = {0.114743,-0.049121,0}; -Point(122) = {0.104922,-0.047624,0}; -Point(121) = {0.095492,-0.046037,0}; -Point(120) = {0.086460,-0.044364,0}; -Point(119) = {0.077836,-0.042608,0}; -Point(118) = {0.069629,-0.040770,0}; -Point(117) = {0.061847,-0.038854,0}; -Point(116) = {0.054497,-0.036863,0}; -Point(115) = {0.047586,-0.034800,0}; -Point(114) = {0.041123,-0.032668,0}; -Point(113) = {0.035112,-0.030471,0}; -Point(112) = {0.029560,-0.028212,0}; -Point(111) = {0.024472,-0.025893,0}; -Point(110) = {0.019853,-0.023517,0}; -Point(109) = {0.015708,-0.021088,0}; -Point(108) = {0.012042,-0.018607,0}; -Point(107) = {0.008856,-0.016078,0}; -Point(106) = {0.006156,-0.013503,0}; -Point(105) = {0.003943,-0.010884,0}; -Point(104) = {0.002219,-0.008223,0}; -Point(103) = {0.000987,-0.005521,0}; -Point(102) = {0.000247,-0.002779,0}; -Point(101) = {0.000000,0.000000,0}; -Point(100) = {0.000247,0.002779,0}; -Point(99) = {0.000987,0.005521,0}; -Point(98) = {0.002219,0.008223,0}; -Point(97) = {0.003943,0.010884,0}; -Point(96) = {0.006156,0.013503,0}; -Point(95) = {0.008856,0.016078,0}; -Point(94) = {0.012042,0.018607,0}; -Point(93) = {0.015708,0.021088,0}; -Point(92) = {0.019853,0.023517,0}; -Point(91) = {0.024472,0.025893,0}; -Point(90) = {0.029560,0.028212,0}; -Point(89) = {0.035112,0.030471,0}; -Point(88) = {0.041123,0.032668,0}; -Point(87) = {0.047586,0.034800,0}; -Point(86) = {0.054497,0.036863,0}; -Point(85) = {0.061847,0.038854,0}; -Point(84) = {0.069629,0.040770,0}; -Point(83) = {0.077836,0.042608,0}; -Point(82) = {0.086460,0.044364,0}; -Point(81) = {0.095492,0.046037,0}; -Point(80) = {0.104922,0.047624,0}; -Point(79) = {0.114743,0.049121,0}; -Point(78) = {0.124944,0.050527,0}; -Point(77) = {0.135516,0.051839,0}; -Point(76) = {0.146447,0.053056,0}; -Point(75) = {0.157726,0.054176,0}; -Point(74) = {0.169344,0.055197,0}; -Point(73) = {0.181288,0.056119,0}; -Point(72) = {0.193546,0.056940,0}; -Point(71) = {0.206107,0.057661,0}; -Point(70) = {0.218958,0.058280,0}; -Point(69) = {0.232087,0.058799,0}; -Point(68) = {0.245479,0.059217,0}; -Point(67) = {0.259123,0.059535,0}; -Point(66) = {0.273005,0.059754,0}; -Point(65) = {0.287110,0.059876,0}; -Point(64) = {0.301426,0.059902,0}; -Point(63) = {0.315938,0.059834,0}; -Point(62) = {0.330631,0.059674,0}; -Point(61) = {0.345492,0.059424,0}; -Point(60) = {0.360504,0.059087,0}; -Point(59) = {0.375655,0.058666,0}; -Point(58) = {0.390928,0.058163,0}; -Point(57) = {0.406309,0.057581,0}; -Point(56) = {0.421783,0.056924,0}; -Point(55) = {0.437333,0.056195,0}; -Point(54) = {0.452946,0.055397,0}; -Point(53) = {0.468605,0.054534,0}; -Point(52) = {0.484295,0.053608,0}; -Point(51) = {0.500000,0.052625,0}; -Point(50) = {0.515705,0.051587,0}; -Point(49) = {0.531395,0.050499,0}; -Point(48) = {0.547054,0.049362,0}; -Point(47) = {0.562667,0.048182,0}; -Point(46) = {0.578217,0.046962,0}; -Point(45) = {0.593691,0.045705,0}; -Point(44) = {0.609072,0.044414,0}; -Point(43) = {0.624345,0.043094,0}; -Point(42) = {0.639496,0.041747,0}; -Point(41) = {0.654508,0.040378,0}; -Point(40) = {0.669369,0.038988,0}; -Point(39) = {0.684062,0.037582,0}; -Point(38) = {0.698574,0.036163,0}; -Point(37) = {0.712890,0.034733,0}; -Point(36) = {0.726995,0.033296,0}; -Point(35) = {0.740877,0.031856,0}; -Point(34) = {0.754521,0.030414,0}; -Point(33) = {0.767913,0.028974,0}; -Point(32) = {0.781042,0.027539,0}; -Point(31) = {0.793893,0.026111,0}; -Point(30) = {0.806454,0.024694,0}; -Point(29) = {0.818712,0.023291,0}; -Point(28) = {0.830656,0.021904,0}; -Point(27) = {0.842274,0.020535,0}; -Point(26) = {0.853553,0.019189,0}; -Point(25) = {0.864484,0.017868,0}; -Point(24) = {0.875056,0.016574,0}; -Point(23) = {0.885257,0.015310,0}; -Point(22) = {0.895078,0.014079,0}; -Point(21) = {0.904508,0.012883,0}; -Point(20) = {0.913540,0.011726,0}; -Point(19) = {0.922164,0.010610,0}; -Point(18) = {0.930371,0.009537,0}; -Point(17) = {0.938153,0.008510,0}; -Point(16) = {0.945503,0.007531,0}; -Point(15) = {0.952414,0.006603,0}; -Point(14) = {0.958877,0.005729,0}; -Point(13) = {0.964888,0.004909,0}; -Point(12) = {0.970440,0.004147,0}; -Point(11) = {0.975528,0.003443,0}; -Point(10) = {0.980147,0.002801,0}; -Point(9) = {0.984292,0.002222,0}; -Point(8) = {0.987958,0.001707,0}; -Point(7) = {0.991144,0.001258,0}; -Point(6) = {0.993844,0.000876,0}; -Point(5) = {0.996057,0.000562,0}; -Point(4) = {0.997781,0.000317,0}; -Point(3) = {0.999013,0.000141,0}; -Point(2) = {0.999753,0.000035,0}; -Point(1) = {1.000000,0.000000,0}; - -Spline(1) = {80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; -Spline(2) = {101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80}; -Spline(3) = {122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101}; -Spline(4) = {1,200,199,198,197,196,195,194,193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,142,141,140,139,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122}; - -// Farfield -Point(10001) = {1+xLgt, 0, 0}; -Point(10002) = {1+xLgt, yLgt, 0}; -Point(10003) = {1, yLgt, 0}; -Point(10004) = {-xLgt, yLgt, 0}; -Point(10005) = {-xLgt, 0, 0}; -Point(10006) = {-xLgt,-yLgt, 0}; -Point(10007) = {1, -yLgt, 0}; -Point(10008) = {1+xLgt, -yLgt, 0}; - -Line(10001) = {10001, 10002}; -Line(10002) = {10002, 10003}; -Line(10003) = {10003, 10004}; -Line(10004) = {10004, 10005}; -Line(10005) = {10005, 10006}; -Line(10006) = {10006, 10007}; -Line(10007) = {10007, 10008}; -Line(10008) = {10008, 10001}; - -// Perpendicular lines -Line(10011) = {1, 10001}; -Line(10012) = {1, 10003}; -Line(10013) = {80, 10004}; -Line(10014) = {101, 10005}; -Line(10015) = {122, 10006}; -Line(10016) = {1, 10007}; - -// Internal field -Line Loop(10001) = {10011, 10001, 10002, -10012}; -Line Loop(10002) = {1, 10012, 10003, -10013}; -Line Loop(10003) = {2, 10013, 10004, -10014}; -Line Loop(10004) = {3, 10014, 10005, -10015}; -Line Loop(10005) = {4, 10015, 10006, -10016}; -Line Loop(10006) = {-10011, 10016, 10007, 10008}; - -Plane Surface(10001) = {10001}; -Plane Surface(10002) = {10002}; -Plane Surface(10003) = {10003}; -Plane Surface(10004) = {10004}; -Plane Surface(10005) = {10005}; -Plane Surface(10006) = {10006}; - -/************************* - Meshing - *************************/ - -Transfinite Line {1, 4, 10003, 10006} = nChord Using Bump pChord; -Transfinite Line {2, 10004} = nLe Using Progression 1/pLe; -Transfinite Line {3, 10005} = nLe Using Progression pLe; -Transfinite Line {10011, 10012, 10013, 10014, 10015, 10016, 10001, 10007} = nPerp Using Progression pPerp; -Transfinite Line {10002, 10008} = nPerp Using Progression 1/pPerp; - -Transfinite Surface {10001} = {1, 10001, 10002, 10003}; -Transfinite Surface {10002} = {1, 10003, 10004, 80}; -Transfinite Surface {10003} = {80, 10004, 10005, 101}; -Transfinite Surface {10004} = {122, 10006, 10005, 101}; -Transfinite Surface {10005} = {1, 10007, 10006, 122}; -Transfinite Surface {10006} = {1, 10007, 10008, 10001}; -//Recombine Surface {10001, 10002, 10003, 10004, 10005, 10006}; - -/************************* - Physical Groups - *************************/ - -Physical Point("te") = {1}; -Physical Line("upstream") = {10004, 10005}; -Physical Line("farfield") = {10002, 10003, 10006, 10007}; -Physical Line("downstream") = {10001, 10008}; -Physical Line("airfoil") = {1, 2}; -Physical Line("airfoil_") = {3, 4}; -Physical Line("wake") = {10011}; -Physical Surface("field") = {10001, 10002, 10003, 10004, 10005, 10006}; - diff --git a/flow/models/old/n0012u.geo b/flow/models/old/n0012u.geo deleted file mode 100644 index 23dd169b..00000000 --- a/flow/models/old/n0012u.geo +++ /dev/null @@ -1,272 +0,0 @@ -/* Naca0012 */ - -// Geometry -normalLength = 20; -trailingLength = 20; -gap = 0e-6; // TE gap, should be zero (testing purpose only) - -// Mesh -sEleFar = 2.0; -sEleAirfTE = 0.001; -sEleAirfLE = 0.001; - -/************** - Geometry - **************/ - -// Airfoil -Point(201) = {1.000000,-gap/2,0,sEleAirfTE}; -Point(200) = {0.999753,-0.000035,0}; -Point(199) = {0.999013,-0.000141,0}; -Point(198) = {0.997781,-0.000317,0}; -Point(197) = {0.996057,-0.000562,0}; -Point(196) = {0.993844,-0.000876,0}; -Point(195) = {0.991144,-0.001258,0}; -Point(194) = {0.987958,-0.001707,0}; -Point(193) = {0.984292,-0.002222,0}; -Point(192) = {0.980147,-0.002801,0}; -Point(191) = {0.975528,-0.003443,0}; -Point(190) = {0.970440,-0.004147,0}; -Point(189) = {0.964888,-0.004909,0}; -Point(188) = {0.958877,-0.005729,0}; -Point(187) = {0.952414,-0.006603,0}; -Point(186) = {0.945503,-0.007531,0}; -Point(185) = {0.938153,-0.008510,0}; -Point(184) = {0.930371,-0.009537,0}; -Point(183) = {0.922164,-0.010610,0}; -Point(182) = {0.913540,-0.011726,0}; -Point(181) = {0.904508,-0.012883,0}; -Point(180) = {0.895078,-0.014079,0}; -Point(179) = {0.885257,-0.015310,0}; -Point(178) = {0.875056,-0.016574,0}; -Point(177) = {0.864484,-0.017868,0}; -Point(176) = {0.853553,-0.019189,0}; -Point(175) = {0.842274,-0.020535,0}; -Point(174) = {0.830656,-0.021904,0}; -Point(173) = {0.818712,-0.023291,0}; -Point(172) = {0.806454,-0.024694,0}; -Point(171) = {0.793893,-0.026111,0}; -Point(170) = {0.781042,-0.027539,0}; -Point(169) = {0.767913,-0.028974,0}; -Point(168) = {0.754521,-0.030414,0}; -Point(167) = {0.740877,-0.031856,0}; -Point(166) = {0.726995,-0.033296,0}; -Point(165) = {0.712890,-0.034733,0}; -Point(164) = {0.698574,-0.036163,0}; -Point(163) = {0.684062,-0.037582,0}; -Point(162) = {0.669369,-0.038988,0}; -Point(161) = {0.654508,-0.040378,0}; -Point(160) = {0.639496,-0.041747,0}; -Point(159) = {0.624345,-0.043094,0}; -Point(158) = {0.609072,-0.044414,0}; -Point(157) = {0.593691,-0.045705,0}; -Point(156) = {0.578217,-0.046962,0}; -Point(155) = {0.562667,-0.048182,0}; -Point(154) = {0.547054,-0.049362,0}; -Point(153) = {0.531395,-0.050499,0}; -Point(152) = {0.515705,-0.051587,0}; -Point(151) = {0.500000,-0.052625,0}; -Point(150) = {0.484295,-0.053608,0}; -Point(149) = {0.468605,-0.054534,0}; -Point(148) = {0.452946,-0.055397,0}; -Point(147) = {0.437333,-0.056195,0}; -Point(146) = {0.421783,-0.056924,0}; -Point(145) = {0.406309,-0.057581,0}; -Point(144) = {0.390928,-0.058163,0}; -Point(143) = {0.375655,-0.058666,0}; -Point(142) = {0.360504,-0.059087,0}; -Point(141) = {0.345492,-0.059424,0}; -Point(140) = {0.330631,-0.059674,0}; -Point(139) = {0.315938,-0.059834,0}; -Point(138) = {0.301426,-0.059902,0}; -Point(137) = {0.287110,-0.059876,0}; -Point(136) = {0.273005,-0.059754,0}; -Point(135) = {0.259123,-0.059535,0}; -Point(134) = {0.245479,-0.059217,0}; -Point(133) = {0.232087,-0.058799,0}; -Point(132) = {0.218958,-0.058280,0}; -Point(131) = {0.206107,-0.057661,0}; -Point(130) = {0.193546,-0.056940,0}; -Point(129) = {0.181288,-0.056119,0}; -Point(128) = {0.169344,-0.055197,0}; -Point(127) = {0.157726,-0.054176,0}; -Point(126) = {0.146447,-0.053056,0}; -Point(125) = {0.135516,-0.051839,0}; -Point(124) = {0.124944,-0.050527,0}; -Point(123) = {0.114743,-0.049121,0}; -Point(122) = {0.104922,-0.047624,0}; -Point(121) = {0.095492,-0.046037,0}; -Point(120) = {0.086460,-0.044364,0}; -Point(119) = {0.077836,-0.042608,0}; -Point(118) = {0.069629,-0.040770,0}; -Point(117) = {0.061847,-0.038854,0}; -Point(116) = {0.054497,-0.036863,0}; -Point(115) = {0.047586,-0.034800,0}; -Point(114) = {0.041123,-0.032668,0}; -Point(113) = {0.035112,-0.030471,0}; -Point(112) = {0.029560,-0.028212,0}; -Point(111) = {0.024472,-0.025893,0}; -Point(110) = {0.019853,-0.023517,0}; -Point(109) = {0.015708,-0.021088,0}; -Point(108) = {0.012042,-0.018607,0}; -Point(107) = {0.008856,-0.016078,0}; -Point(106) = {0.006156,-0.013503,0}; -Point(105) = {0.003943,-0.010884,0}; -Point(104) = {0.002219,-0.008223,0}; -Point(103) = {0.000987,-0.005521,0}; -Point(102) = {0.000247,-0.002779,0}; -Point(101) = {0.000000,0.000000,0,sEleAirfLE}; -Point(100) = {0.000247,0.002779,0}; -Point(99) = {0.000987,0.005521,0}; -Point(98) = {0.002219,0.008223,0}; -Point(97) = {0.003943,0.010884,0}; -Point(96) = {0.006156,0.013503,0}; -Point(95) = {0.008856,0.016078,0}; -Point(94) = {0.012042,0.018607,0}; -Point(93) = {0.015708,0.021088,0}; -Point(92) = {0.019853,0.023517,0}; -Point(91) = {0.024472,0.025893,0}; -Point(90) = {0.029560,0.028212,0}; -Point(89) = {0.035112,0.030471,0}; -Point(88) = {0.041123,0.032668,0}; -Point(87) = {0.047586,0.034800,0}; -Point(86) = {0.054497,0.036863,0}; -Point(85) = {0.061847,0.038854,0}; -Point(84) = {0.069629,0.040770,0}; -Point(83) = {0.077836,0.042608,0}; -Point(82) = {0.086460,0.044364,0}; -Point(81) = {0.095492,0.046037,0}; -Point(80) = {0.104922,0.047624,0}; -Point(79) = {0.114743,0.049121,0}; -Point(78) = {0.124944,0.050527,0}; -Point(77) = {0.135516,0.051839,0}; -Point(76) = {0.146447,0.053056,0}; -Point(75) = {0.157726,0.054176,0}; -Point(74) = {0.169344,0.055197,0}; -Point(73) = {0.181288,0.056119,0}; -Point(72) = {0.193546,0.056940,0}; -Point(71) = {0.206107,0.057661,0}; -Point(70) = {0.218958,0.058280,0}; -Point(69) = {0.232087,0.058799,0}; -Point(68) = {0.245479,0.059217,0}; -Point(67) = {0.259123,0.059535,0}; -Point(66) = {0.273005,0.059754,0}; -Point(65) = {0.287110,0.059876,0}; -Point(64) = {0.301426,0.059902,0}; -Point(63) = {0.315938,0.059834,0}; -Point(62) = {0.330631,0.059674,0}; -Point(61) = {0.345492,0.059424,0}; -Point(60) = {0.360504,0.059087,0}; -Point(59) = {0.375655,0.058666,0}; -Point(58) = {0.390928,0.058163,0}; -Point(57) = {0.406309,0.057581,0}; -Point(56) = {0.421783,0.056924,0}; -Point(55) = {0.437333,0.056195,0}; -Point(54) = {0.452946,0.055397,0}; -Point(53) = {0.468605,0.054534,0}; -Point(52) = {0.484295,0.053608,0}; -Point(51) = {0.500000,0.052625,0}; -Point(50) = {0.515705,0.051587,0}; -Point(49) = {0.531395,0.050499,0}; -Point(48) = {0.547054,0.049362,0}; -Point(47) = {0.562667,0.048182,0}; -Point(46) = {0.578217,0.046962,0}; -Point(45) = {0.593691,0.045705,0}; -Point(44) = {0.609072,0.044414,0}; -Point(43) = {0.624345,0.043094,0}; -Point(42) = {0.639496,0.041747,0}; -Point(41) = {0.654508,0.040378,0}; -Point(40) = {0.669369,0.038988,0}; -Point(39) = {0.684062,0.037582,0}; -Point(38) = {0.698574,0.036163,0}; -Point(37) = {0.712890,0.034733,0}; -Point(36) = {0.726995,0.033296,0}; -Point(35) = {0.740877,0.031856,0}; -Point(34) = {0.754521,0.030414,0}; -Point(33) = {0.767913,0.028974,0}; -Point(32) = {0.781042,0.027539,0}; -Point(31) = {0.793893,0.026111,0}; -Point(30) = {0.806454,0.024694,0}; -Point(29) = {0.818712,0.023291,0}; -Point(28) = {0.830656,0.021904,0}; -Point(27) = {0.842274,0.020535,0}; -Point(26) = {0.853553,0.019189,0}; -Point(25) = {0.864484,0.017868,0}; -Point(24) = {0.875056,0.016574,0}; -Point(23) = {0.885257,0.015310,0}; -Point(22) = {0.895078,0.014079,0}; -Point(21) = {0.904508,0.012883,0}; -Point(20) = {0.913540,0.011726,0}; -Point(19) = {0.922164,0.010610,0}; -Point(18) = {0.930371,0.009537,0}; -Point(17) = {0.938153,0.008510,0}; -Point(16) = {0.945503,0.007531,0}; -Point(15) = {0.952414,0.006603,0}; -Point(14) = {0.958877,0.005729,0}; -Point(13) = {0.964888,0.004909,0}; -Point(12) = {0.970440,0.004147,0}; -Point(11) = {0.975528,0.003443,0}; -Point(10) = {0.980147,0.002801,0}; -Point(9) = {0.984292,0.002222,0}; -Point(8) = {0.987958,0.001707,0}; -Point(7) = {0.991144,0.001258,0}; -Point(6) = {0.993844,0.000876,0}; -Point(5) = {0.996057,0.000562,0}; -Point(4) = {0.997781,0.000317,0}; -Point(3) = {0.999013,0.000141,0}; -Point(2) = {0.999753,0.000035,0}; -Point(1) = {1.000000,gap/2,0,sEleAirfTE}; - -Spline(1) = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101}; -Spline(2) = {101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201}; - -//Center -Point(0) = {1, 0, 0}; - -// Farfield -Point(10001) = {1, normalLength, 0,sEleFar}; -Point(10002) = {1-normalLength, 0, 0,sEleFar} ; -Point(10003) = {1, -normalLength, 0,sEleFar}; -Point(10004) = {1+trailingLength,-normalLength, 0,sEleFar}; -Point(10005) = {1+trailingLength, -gap/2, 0,sEleFar}; -Point(10006) = {1+trailingLength, gap/2, 0,sEleFar}; -Point(10007) = {1+trailingLength, normalLength, 0,sEleFar}; - -Circle(10001) = {10001, 0, 10002}; -Circle(10002) = {10002, 0, 10003}; -Line(10003) = {10003, 10004}; -Line(10004) = {10004, 10005}; -Line(10005) = {10006, 10007}; -Line(10006) = {10007, 10001}; - -// Front and wake -Line(10007) = {101, 10002}; -Line(10008) = {1, 10006}; -Line(10009) = {201, 10005}; - -// Internal field -Line Loop(10001) = {-1, 10008, 10005, 10006, 10001, -10007}; -Line Loop(10002) = {-2, 10007, 10002, 10003, 10004, -10009}; -Plane Surface(10001) = {10001}; -Plane Surface(10002) = {10002}; - -/************************* - Physical Groups - *************************/ - -// Physical Groups numbering -internalField = 1000000; -farfield = 1000001; -downstream = 1000002; -airfoil = 1000003; -front = 1000004; -wakeUp = 1000005; -wakeLw = 1000006; - -Physical Line("farfield", farfield) = {10001, 10002, 10003, 10006}; -Physical Line("downstream", downstream) = {10004, 10005}; -Physical Line("wakeUp", wakeUp) = {10008}; -Physical Line("wakeLw", wakeLw) = {10009}; -Physical Line("front", front) = {10007}; -Physical Line("airfoil", airfoil) = {1, 2}; -Physical Surface("internalField", internalField) = {10001, 10002}; diff --git a/flow/models/oneraM6.geo b/flow/models/oneraM6.geo deleted file mode 100644 index 6c14627b..00000000 --- a/flow/models/oneraM6.geo +++ /dev/null @@ -1,590 +0,0 @@ -/* Onera M6 wing */ -// Initially generated by unsRgridWingGen.m -// For gmsh 4, use line 425 instead of line 426 (Bezier <- BSpline) - -// Parameters -// domain and mesh -DefineConstant[ lgt = { 3.0, Name "Channel half length" } ]; -DefineConstant[ wdt = { 2.0, Name "Channel width" } ]; -DefineConstant[ hgt = { 3.0, Name "Channel half height" } ]; -DefineConstant[ msLeRt = { 0.01, Name "Root leading edge mesh size" } ]; -DefineConstant[ msTeRt = { 0.01, Name "Root trailing edge mesh size" } ]; -DefineConstant[ msLeTp = { 0.01, Name "Tip leading edge mesh size" } ]; -DefineConstant[ msTeTp = { 0.01, Name "Tip trailing edge mesh size" } ]; -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; - - -//// GEOMETRY - - -/// Points - -// Airfoil 1: oneraM6, 143 points -Point(1) = {0.805900,0.000000,0.000000,msTeRt}; -Point(2) = {0.804129,0.000000,0.000232}; -Point(3) = {0.802038,0.000000,0.000505}; -Point(4) = {0.799569,0.000000,0.000828}; -Point(5) = {0.796652,0.000000,0.001210}; -Point(6) = {0.793208,0.000000,0.001661}; -Point(7) = {0.789139,0.000000,0.002193}; -Point(8) = {0.784331,0.000000,0.002822}; -Point(9) = {0.778649,0.000000,0.003565}; -Point(10) = {0.771932,0.000000,0.004444}; -Point(11) = {0.763989,0.000000,0.005483}; -Point(12) = {0.754592,0.000000,0.006710}; -Point(13) = {0.743470,0.000000,0.008151}; -Point(14) = {0.730299,0.000000,0.009828,msTeRt}; -Point(15) = {0.714691,0.000000,0.011690}; -Point(16) = {0.696182,0.000000,0.013774}; -Point(17) = {0.677546,0.000000,0.015783}; -Point(18) = {0.658809,0.000000,0.017717}; -Point(19) = {0.639970,0.000000,0.019586}; -Point(20) = {0.621026,0.000000,0.021397}; -Point(21) = {0.601980,0.000000,0.023159}; -Point(22) = {0.582826,0.000000,0.024875}; -Point(23) = {0.563568,0.000000,0.026547}; -Point(24) = {0.544202,0.000000,0.028170}; -Point(25) = {0.524729,0.000000,0.029737}; -Point(26) = {0.505147,0.000000,0.031238}; -Point(27) = {0.485455,0.000000,0.032658}; -Point(28) = {0.465652,0.000000,0.033984}; -Point(29) = {0.445738,0.000000,0.035197}; -Point(30) = {0.425711,0.000000,0.036282}; -Point(31) = {0.405570,0.000000,0.037225}; -Point(32) = {0.385317,0.000000,0.038011}; -Point(33) = {0.364947,0.000000,0.038631}; -Point(34) = {0.344460,0.000000,0.039073}; -Point(35) = {0.323856,0.000000,0.039344}; -Point(36) = {0.303135,0.000000,0.039432}; -Point(37) = {0.282293,0.000000,0.039343}; -Point(38) = {0.261331,0.000000,0.039078}; -Point(39) = {0.240248,0.000000,0.038642,1.5*msLeRt}; -Point(40) = {0.219042,0.000000,0.038037}; -Point(41) = {0.197712,0.000000,0.037261}; -Point(42) = {0.176258,0.000000,0.036306}; -Point(43) = {0.154679,0.000000,0.035154}; -Point(44) = {0.132972,0.000000,0.033774}; -Point(45) = {0.111131,0.000000,0.032117}; -Point(46) = {0.092662,0.000000,0.030457}; -Point(47) = {0.077073,0.000000,0.028830}; -Point(48) = {0.063937,0.000000,0.027269}; -Point(49) = {0.052891,0.000000,0.025800}; -Point(50) = {0.043619,0.000000,0.024441}; -Point(51) = {0.035851,0.000000,0.023203}; -Point(52) = {0.029356,0.000000,0.022027}; -Point(53) = {0.023936,0.000000,0.020812}; -Point(54) = {0.019428,0.000000,0.019503}; -Point(55) = {0.015684,0.000000,0.018096}; -Point(56) = {0.012586,0.000000,0.016619}; -Point(57) = {0.010032,0.000000,0.015114}; -Point(58) = {0.007931,0.000000,0.013618}; -Point(59) = {0.006214,0.000000,0.012165}; -Point(60) = {0.004815,0.000000,0.010776}; -Point(61) = {0.003683,0.000000,0.009463}; -Point(62) = {0.002775,0.000000,0.008233}; -Point(63) = {0.002050,0.000000,0.007089}; -Point(64) = {0.001480,0.000000,0.006027}; -Point(65) = {0.001037,0.000000,0.005045}; -Point(66) = {0.000698,0.000000,0.004138}; -Point(67) = {0.000444,0.000000,0.003301}; -Point(68) = {0.000260,0.000000,0.002529}; -Point(69) = {0.000135,0.000000,0.001818}; -Point(70) = {0.000056,0.000000,0.001162}; -Point(71) = {0.000013,0.000000,0.000557}; -Point(72) = {0.000000,0.000000,0.000000,msLeRt}; -Point(73) = {0.000013,0.000000,-0.000557}; -Point(74) = {0.000056,0.000000,-0.001162}; -Point(75) = {0.000135,0.000000,-0.001818}; -Point(76) = {0.000260,0.000000,-0.002529}; -Point(77) = {0.000444,0.000000,-0.003301}; -Point(78) = {0.000698,0.000000,-0.004138}; -Point(79) = {0.001037,0.000000,-0.005045}; -Point(80) = {0.001480,0.000000,-0.006027}; -Point(81) = {0.002050,0.000000,-0.007089}; -Point(82) = {0.002775,0.000000,-0.008233}; -Point(83) = {0.003683,0.000000,-0.009463}; -Point(84) = {0.004815,0.000000,-0.010776}; -Point(85) = {0.006214,0.000000,-0.012165}; -Point(86) = {0.007931,0.000000,-0.013618}; -Point(87) = {0.010032,0.000000,-0.015114}; -Point(88) = {0.012586,0.000000,-0.016619}; -Point(89) = {0.015684,0.000000,-0.018096}; -Point(90) = {0.019428,0.000000,-0.019503}; -Point(91) = {0.023936,0.000000,-0.020812}; -Point(92) = {0.029356,0.000000,-0.022027}; -Point(93) = {0.035851,0.000000,-0.023203}; -Point(94) = {0.043619,0.000000,-0.024441}; -Point(95) = {0.052891,0.000000,-0.025800}; -Point(96) = {0.063937,0.000000,-0.027269}; -Point(97) = {0.077073,0.000000,-0.028830}; -Point(98) = {0.092662,0.000000,-0.030457}; -Point(99) = {0.111131,0.000000,-0.032117}; -Point(100) = {0.132972,0.000000,-0.033774}; -Point(101) = {0.154679,0.000000,-0.035154}; -Point(102) = {0.176258,0.000000,-0.036306}; -Point(103) = {0.197712,0.000000,-0.037261}; -Point(104) = {0.219042,0.000000,-0.038037}; -Point(105) = {0.240248,0.000000,-0.038642,1.5*msLeRt}; -Point(106) = {0.261331,0.000000,-0.039078}; -Point(107) = {0.282293,0.000000,-0.039343}; -Point(108) = {0.303135,0.000000,-0.039432}; -Point(109) = {0.323856,0.000000,-0.039344}; -Point(110) = {0.344460,0.000000,-0.039073}; -Point(111) = {0.364947,0.000000,-0.038631}; -Point(112) = {0.385317,0.000000,-0.038011}; -Point(113) = {0.405570,0.000000,-0.037225}; -Point(114) = {0.425711,0.000000,-0.036282}; -Point(115) = {0.445738,0.000000,-0.035197}; -Point(116) = {0.465652,0.000000,-0.033984}; -Point(117) = {0.485455,0.000000,-0.032658}; -Point(118) = {0.505147,0.000000,-0.031238}; -Point(119) = {0.524729,0.000000,-0.029737}; -Point(120) = {0.544202,0.000000,-0.028170}; -Point(121) = {0.563568,0.000000,-0.026547}; -Point(122) = {0.582826,0.000000,-0.024875}; -Point(123) = {0.601980,0.000000,-0.023159}; -Point(124) = {0.621026,0.000000,-0.021397}; -Point(125) = {0.639970,0.000000,-0.019586}; -Point(126) = {0.658809,0.000000,-0.017717}; -Point(127) = {0.677546,0.000000,-0.015783}; -Point(128) = {0.696182,0.000000,-0.013774}; -Point(129) = {0.714691,0.000000,-0.011690}; -Point(130) = {0.730299,0.000000,-0.009828,msTeRt}; -Point(131) = {0.743470,0.000000,-0.008151}; -Point(132) = {0.754592,0.000000,-0.006710}; -Point(133) = {0.763989,0.000000,-0.005483}; -Point(134) = {0.771932,0.000000,-0.004444}; -Point(135) = {0.778649,0.000000,-0.003565}; -Point(136) = {0.784331,0.000000,-0.002822}; -Point(137) = {0.789139,0.000000,-0.002193}; -Point(138) = {0.793208,0.000000,-0.001661}; -Point(139) = {0.796652,0.000000,-0.001210}; -Point(140) = {0.799569,0.000000,-0.000828}; -Point(141) = {0.802038,0.000000,-0.000505}; -Point(142) = {0.804129,0.000000,-0.000232,msTeRt}; - -// Airfoil 2: oneraM6, 143 points -Point(144) = {1.143427,1.196000,0.000000,msTeTp}; -Point(145) = {1.142432,1.196000,0.000130}; -Point(146) = {1.141256,1.196000,0.000284}; -Point(147) = {1.139869,1.196000,0.000466}; -Point(148) = {1.138230,1.196000,0.000680}; -Point(149) = {1.136294,1.196000,0.000933}; -Point(150) = {1.134007,1.196000,0.001232}; -Point(151) = {1.131305,1.196000,0.001586}; -Point(152) = {1.128112,1.196000,0.002004}; -Point(153) = {1.124337,1.196000,0.002498}; -Point(154) = {1.119873,1.196000,0.003082}; -Point(155) = {1.114592,1.196000,0.003771}; -Point(156) = {1.108341,1.196000,0.004581}; -Point(157) = {1.100939,1.196000,0.005523,1.5*msTeTp}; -Point(158) = {1.092167,1.196000,0.006570}; -Point(159) = {1.081765,1.196000,0.007741}; -Point(160) = {1.071292,1.196000,0.008870}; -Point(161) = {1.060762,1.196000,0.009957}; -Point(162) = {1.050174,1.196000,0.011007}; -Point(163) = {1.039528,1.196000,0.012025}; -Point(164) = {1.028824,1.196000,0.013015}; -Point(165) = {1.018059,1.196000,0.013980}; -Point(166) = {1.007236,1.196000,0.014919}; -Point(167) = {0.996353,1.196000,0.015831}; -Point(168) = {0.985409,1.196000,0.016712}; -Point(169) = {0.974403,1.196000,0.017556}; -Point(170) = {0.963336,1.196000,0.018354}; -Point(171) = {0.952208,1.196000,0.019099}; -Point(172) = {0.941016,1.196000,0.019781}; -Point(173) = {0.929760,1.196000,0.020391}; -Point(174) = {0.918441,1.196000,0.020920}; -Point(175) = {0.907059,1.196000,0.021362}; -Point(176) = {0.895611,1.196000,0.021711}; -Point(177) = {0.884097,1.196000,0.021959}; -Point(178) = {0.872518,1.196000,0.022111}; -Point(179) = {0.860873,1.196000,0.022161}; -Point(180) = {0.849160,1.196000,0.022111}; -Point(181) = {0.837379,1.196000,0.021962}; -Point(182) = {0.825530,1.196000,0.021717,1.5*msLeTp}; -Point(183) = {0.813612,1.196000,0.021377}; -Point(184) = {0.801625,1.196000,0.020941}; -Point(185) = {0.789568,1.196000,0.020404}; -Point(186) = {0.777440,1.196000,0.019757}; -Point(187) = {0.765241,1.196000,0.018981}; -Point(188) = {0.752966,1.196000,0.018050}; -Point(189) = {0.742587,1.196000,0.017117}; -Point(190) = {0.733826,1.196000,0.016203}; -Point(191) = {0.726444,1.196000,0.015325}; -Point(192) = {0.720236,1.196000,0.014500}; -Point(193) = {0.715025,1.196000,0.013736}; -Point(194) = {0.710659,1.196000,0.013040}; -Point(195) = {0.707009,1.196000,0.012379}; -Point(196) = {0.703963,1.196000,0.011696}; -Point(197) = {0.701429,1.196000,0.010961}; -Point(198) = {0.699325,1.196000,0.010170}; -Point(199) = {0.697584,1.196000,0.009340}; -Point(200) = {0.696149,1.196000,0.008494}; -Point(201) = {0.694968,1.196000,0.007654}; -Point(202) = {0.694003,1.196000,0.006837}; -Point(203) = {0.693217,1.196000,0.006056}; -Point(204) = {0.692581,1.196000,0.005318}; -Point(205) = {0.692070,1.196000,0.004627}; -Point(206) = {0.691663,1.196000,0.003984}; -Point(207) = {0.691343,1.196000,0.003387}; -Point(208) = {0.691094,1.196000,0.002835}; -Point(209) = {0.690903,1.196000,0.002325}; -Point(210) = {0.690760,1.196000,0.001855}; -Point(211) = {0.690657,1.196000,0.001421}; -Point(212) = {0.690587,1.196000,0.001022}; -Point(213) = {0.690542,1.196000,0.000653}; -Point(214) = {0.690518,1.196000,0.000313}; -Point(215) = {0.690511,1.196000,0.000000,msLeTp}; -Point(216) = {0.690518,1.196000,-0.000313}; -Point(217) = {0.690542,1.196000,-0.000653}; -Point(218) = {0.690587,1.196000,-0.001022}; -Point(219) = {0.690657,1.196000,-0.001421}; -Point(220) = {0.690760,1.196000,-0.001855}; -Point(221) = {0.690903,1.196000,-0.002325}; -Point(222) = {0.691094,1.196000,-0.002835}; -Point(223) = {0.691343,1.196000,-0.003387}; -Point(224) = {0.691663,1.196000,-0.003984}; -Point(225) = {0.692070,1.196000,-0.004627}; -Point(226) = {0.692581,1.196000,-0.005318}; -Point(227) = {0.693217,1.196000,-0.006056}; -Point(228) = {0.694003,1.196000,-0.006837}; -Point(229) = {0.694968,1.196000,-0.007654}; -Point(230) = {0.696149,1.196000,-0.008494}; -Point(231) = {0.697584,1.196000,-0.009340}; -Point(232) = {0.699325,1.196000,-0.010170}; -Point(233) = {0.701429,1.196000,-0.010961}; -Point(234) = {0.703963,1.196000,-0.011696}; -Point(235) = {0.707009,1.196000,-0.012379}; -Point(236) = {0.710659,1.196000,-0.013040}; -Point(237) = {0.715025,1.196000,-0.013736}; -Point(238) = {0.720236,1.196000,-0.014500}; -Point(239) = {0.726444,1.196000,-0.015325}; -Point(240) = {0.733826,1.196000,-0.016203}; -Point(241) = {0.742587,1.196000,-0.017117}; -Point(242) = {0.752966,1.196000,-0.018050}; -Point(243) = {0.765241,1.196000,-0.018981}; -Point(244) = {0.777440,1.196000,-0.019757}; -Point(245) = {0.789568,1.196000,-0.020404}; -Point(246) = {0.801625,1.196000,-0.020941}; -Point(247) = {0.813612,1.196000,-0.021377}; -Point(248) = {0.825530,1.196000,-0.021717,1.5*msLeTp}; -Point(249) = {0.837379,1.196000,-0.021962}; -Point(250) = {0.849160,1.196000,-0.022111}; -Point(251) = {0.860873,1.196000,-0.022161}; -Point(252) = {0.872518,1.196000,-0.022111}; -Point(253) = {0.884097,1.196000,-0.021959}; -Point(254) = {0.895611,1.196000,-0.021711}; -Point(255) = {0.907059,1.196000,-0.021362}; -Point(256) = {0.918441,1.196000,-0.020920}; -Point(257) = {0.929760,1.196000,-0.020391}; -Point(258) = {0.941016,1.196000,-0.019781}; -Point(259) = {0.952208,1.196000,-0.019099}; -Point(260) = {0.963336,1.196000,-0.018354}; -Point(261) = {0.974403,1.196000,-0.017556}; -Point(262) = {0.985409,1.196000,-0.016712}; -Point(263) = {0.996353,1.196000,-0.015831}; -Point(264) = {1.007236,1.196000,-0.014919}; -Point(265) = {1.018059,1.196000,-0.013980}; -Point(266) = {1.028824,1.196000,-0.013015}; -Point(267) = {1.039528,1.196000,-0.012025}; -Point(268) = {1.050174,1.196000,-0.011007}; -Point(269) = {1.060762,1.196000,-0.009957}; -Point(270) = {1.071292,1.196000,-0.008870}; -Point(271) = {1.081765,1.196000,-0.007741}; -Point(272) = {1.092167,1.196000,-0.006570}; -Point(273) = {1.100939,1.196000,-0.005523,1.5*msTeTp}; -Point(274) = {1.108341,1.196000,-0.004581}; -Point(275) = {1.114592,1.196000,-0.003771}; -Point(276) = {1.119873,1.196000,-0.003082}; -Point(277) = {1.124337,1.196000,-0.002498}; -Point(278) = {1.128112,1.196000,-0.002004}; -Point(279) = {1.131305,1.196000,-0.001586}; -Point(280) = {1.134007,1.196000,-0.001232}; -Point(281) = {1.136294,1.196000,-0.000933}; -Point(282) = {1.138230,1.196000,-0.000680}; -Point(283) = {1.139869,1.196000,-0.000466}; -Point(284) = {1.141256,1.196000,-0.000284}; -Point(285) = {1.142432,1.196000,-0.000130,msTeTp}; - -// Box: -Point(5001) = {-lgt,0.000000,-hgt,msF}; -Point(5002) = {1+lgt,0.000000,-hgt,msF}; -Point(5003) = {-lgt,0.000000,hgt,msF}; -Point(5004) = {1+lgt,0.000000,hgt,msF}; -Point(5005) = {-lgt,wdt,-hgt,msF}; -Point(5006) = {1+lgt,wdt,-hgt,msF}; -Point(5007) = {-lgt,wdt,hgt,msF}; -Point(5008) = {1+lgt,wdt,hgt,msF}; - -// Tip: -Point(5101) = {1.142432,1.196000,0.000000}; -Point(5102) = {1.141256,1.196040,0.000000}; -Point(5103) = {1.139869,1.196088,0.000000}; -Point(5104) = {1.138230,1.196144,0.000000}; -Point(5105) = {1.136294,1.196210,0.000000}; -Point(5106) = {1.134007,1.196289,0.000000}; -Point(5107) = {1.131305,1.196381,0.000000}; -Point(5108) = {1.128112,1.196491,0.000000}; -Point(5109) = {1.124337,1.196620,0.000000}; -Point(5110) = {1.119873,1.196773,0.000000}; -Point(5111) = {1.114592,1.196954,0.000000}; -Point(5112) = {1.108341,1.197168,0.000000}; -Point(5113) = {1.100939,1.197422,0.000000,1.5*msTeTp}; -Point(5114) = {1.092167,1.197722,0.000000}; -Point(5115) = {1.081765,1.198079,0.000000}; -Point(5116) = {1.071292,1.198438,0.000000}; -Point(5117) = {1.060762,1.198798,0.000000}; -Point(5118) = {1.050174,1.199161,0.000000}; -Point(5119) = {1.039528,1.199526,0.000000}; -Point(5120) = {1.028824,1.199893,0.000000}; -Point(5121) = {1.018059,1.200262,0.000000}; -Point(5122) = {1.007236,1.200632,0.000000}; -Point(5123) = {0.996353,1.201005,0.000000}; -Point(5124) = {0.985409,1.201380,0.000000}; -Point(5125) = {0.974403,1.201757,0.000000}; -Point(5126) = {0.963336,1.202137,0.000000}; -Point(5127) = {0.952208,1.202518,0.000000}; -Point(5128) = {0.941016,1.202901,0.000000}; -Point(5129) = {0.929760,1.203287,0.000000}; -Point(5130) = {0.918441,1.203675,0.000000}; -Point(5131) = {0.907059,1.204065,0.000000}; -Point(5132) = {0.895611,1.204457,0.000000}; -Point(5133) = {0.884097,1.204852,0.000000}; -Point(5134) = {0.872518,1.205248,0.000000}; -Point(5135) = {0.860873,1.205648,0.000000}; -Point(5136) = {0.849160,1.206049,0.000000}; -Point(5137) = {0.837379,1.206453,0.000000}; -Point(5138) = {0.825530,1.206859,0.000000,1.5*msLeTp}; -Point(5139) = {0.699294,1.211213,0.000000}; - -// Dummy tip center: -Point(5349) = {1.100939,1.196000,0.000000}; -Point(5350) = {0.825530,1.196000,0.000000}; - - -// Midplane: -Point(5351) = {1+lgt,0.000000,0.000000,msF}; -Point(5352) = {1+lgt,1.196000,0.000000,msF}; -Point(5353) = {1+lgt,wdt,0.000000,msF}; -Point(5354) = {1.143427,wdt,0.000000,msF}; -Point(5355) = {1.100939,wdt,0.000000,msF}; -Point(5356) = {0.825530,wdt,0.000000,msF}; -Point(5357) = {0.690511,wdt,0.000000,msF}; -Point(5358) = {-lgt,wdt,0.000000,msF}; -Point(5359) = {-lgt,1.196000,0.000000,msF}; -Point(5360) = {-lgt,0.000000,0.000000,msF}; - -/// Lines - -// Airfoil 1: -Spline(1) = {1,2,3,4,5,6,7,8,9,10,11,12,13,14}; -Spline(2) = {14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39}; -Spline(3) = {39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72}; -Spline(4) = {72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105}; -Spline(5) = {105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130}; -Spline(6) = {130,131,132,133,134,135,136,137,138,139,140,141,142,1}; - -// Airfoil 2: -Spline(7) = {144,145,146,147,148,149,150,151,152,153,154,155,156,157}; -Spline(8) = {157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182}; -Spline(9) = {182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215}; -Spline(10) = {215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248}; -Spline(11) = {248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273}; -Spline(12) = {273,274,275,276,277,278,279,280,281,282,283,284,285,144}; - - -// Box: -Line(41) = {5001,5002}; -Line(42) = {5003,5004}; -Line(43) = {5005,5006}; -Line(44) = {5007,5008}; -Line(45) = {5001,5005}; -Line(46) = {5002,5006}; -Line(47) = {5003,5007}; -Line(48) = {5004,5008}; -Line(49) = {5001,5360}; -Line(50) = {5002,5351}; -Line(51) = {5003,5360}; -Line(52) = {5004,5351}; -Line(53) = {5005,5358}; -Line(54) = {5006,5353}; -Line(55) = {5007,5358}; -Line(56) = {5008,5353}; - -// Airfoil 1 to airfoil 2: -Line(61) = {1,144}; -Line(62) = {14,157}; -Line(63) = {39,182}; -Line(64) = {72,215}; -Line(65) = {105,248}; -Line(66) = {130,273}; - - -// Tip: -Spline(121) = {144,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113}; -Spline(122) = {5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138}; -If(GMSH_MAJOR_VERSION >= 4) - Bezier(123) = {5138,5139,215}; -Else - BSpline(123) = {5138,5139,215}; -EndIf -Ellipse(124) = {157,5349,157,5113}; -Ellipse(125) = {182,5350,182,5138}; -Ellipse(126) = {248,5350,248,5138}; -Ellipse(127) = {273,5349,273,5113}; - -// Midplane: -Line(131) = {5351,5352}; -Line(132) = {5352,5353}; -Line(133) = {5353,5354}; -Line(134) = {5354,5355}; -Line(135) = {5355,5356}; -Line(136) = {5356,5357}; -Line(137) = {5357,5358}; -Line(138) = {5358,5359}; -Line(139) = {5359,5360}; - -// Wing to midplane: -Line(161) = {1,5351}; -Line(162) = {144,5352}; -Line(163) = {144,5354}; -Line(164) = {5113,5355}; -Line(165) = {5138,5356}; -Line(166) = {215,5357}; -Line(167) = {215,5359}; -Line(168) = {72,5360}; - -/// Line loops & Surfaces - -// Box: -Line Loop(1) = {1,2,3,168,-51,42,52,-161}; -Line Loop(2) = {48,56,-132,-131,-52}; -Line Loop(3) = {44,56,133,134,135,136,137,-55}; -Line Loop(4) = {47,55,138,139,-51}; -Line Loop(5) = {42,48,-44,-47}; -Line Loop(6) = {-6,-5,-4,168,-49,41,50,-161}; -Line Loop(7) = {46,54,-132,-131,-50}; -Line Loop(8) = {43,54,133,134,135,136,137,-53}; -Line Loop(9) = {45,53,138,139,-49}; -Line Loop(10) = {41,46,-43,-45}; -Plane Surface(1) = {1}; -Plane Surface(2) = {2}; -Plane Surface(3) = {-3}; -Plane Surface(4) = {-4}; -Plane Surface(5) = {-5}; -Plane Surface(6) = {-6}; -Plane Surface(7) = {-7}; -Plane Surface(8) = {8}; -Plane Surface(9) = {9}; -Plane Surface(10) = {10}; - -// Wing 1: -Line Loop(11) = {1,62,-7,-61}; -Line Loop(12) = {2,63,-8,-62}; -Line Loop(13) = {3,64,-9,-63}; -Line Loop(14) = {4,65,-10,-64}; -Line Loop(15) = {5,66,-11,-65}; -Line Loop(16) = {6,61,-12,-66}; -Surface(11) = {-11}; -Surface(12) = {-12}; -Surface(13) = {-13}; -Surface(14) = {-14}; -Surface(15) = {-15}; -Surface(16) = {-16}; - -// Wingtip: -Line Loop(71) = {7,124,-121}; -Line Loop(72) = {8,125,-122,-124}; -Line Loop(73) = {9,-123,-125}; -Line Loop(74) = {10,126,123}; -Line Loop(75) = {11,127,122,-126}; -Line Loop(76) = {12,121,-127}; -Surface(71) = {-71}; -Surface(72) = {-72}; -Surface(73) = {-73}; -Surface(74) = {-74}; -Surface(75) = {-75}; -Surface(76) = {-76}; - -// Midplane: -Line Loop(81) = {161,131,-162,-61}; -Line Loop(82) = {162,132,133,-163}; -Line Loop(83) = {163,134,-164,-121}; -Line Loop(84) = {164,135,-165,-122}; -Line Loop(85) = {165,136,-166,-123}; -Line Loop(86) = {167,-138,-137,-166}; -Line Loop(87) = {167,139,-168,64}; -Surface(81) = {81}; -Surface(82) = {82}; -Surface(83) = {83}; -Surface(84) = {84}; -Surface(85) = {85}; -Surface(86) = {-86}; -Surface(87) = {87}; - -/// Surface loops & Volumes - -// Upper: -Surface Loop(1) = {11,12,13,71,72,73,1,2,3,4,5,81,82,83,84,85,86,87}; -Volume(1) = {1}; -// Lower: -Surface Loop(2) = {14,15,16,74,75,76,6,7,8,9,10,81,82,83,84,85,86,87}; -Volume(2) = {2}; - - - -//// MESHING ALGORITHM - - -/// 2D: - -///Wing, farfield and symmetry plane: -MeshAlgorithm Surface{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,81,82,83,84,85,86,87} = 5; - -///Tip: -MeshAlgorithm Surface{73,74} = 1; -MeshAlgorithm Surface{71,72,75,76} = 5; - -/// 3D: - -Mesh.Algorithm3D = 2; -Mesh.OptimizeNetgen = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - - - -//// PHYSICAL GROUPS - -// Trailing edge and wake tip -Physical Line("wakeTip") = {162}; -Physical Line("teTip") = {61, 162}; - -// Internal Field: -Physical Volume("field") = {1}; -Physical Volume("field") += {2}; - -// Wing: -Physical Surface("wing") = {11,12,13,71,72,73}; -Physical Surface("wing_") = {14,15,16,74,75,76}; - -// Tip -//Physical Surface("tip") = {71,72,73,74,75,76}; - -// Symmetry: -Physical Surface("symmetry") = {1}; -Physical Surface("symmetry") += {6}; - -// Farfield: -Physical Surface("upstream") = {10}; -Physical Surface("farfield") = {3,4,5,8,9}; - -// Downstream: -Physical Surface("downstream") = {2}; -Physical Surface("downstream") += {7}; - -// Wake: -Physical Surface("wake") = {81}; - -Coherence; diff --git a/flow/models/rae2822.geo b/flow/models/rae2822.geo deleted file mode 100644 index 2cc16762..00000000 --- a/flow/models/rae2822.geo +++ /dev/null @@ -1,200 +0,0 @@ -/* Rae 2822 */ - -// Geometry -DefineConstant[ xLgt = { 5.0, Name "Domain length (x-dir)" } ]; -DefineConstant[ yLgt = { 5.0, Name "Domain length (y-dir)" } ]; - -// Mesh -DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; -DefineConstant[ msTe = { 0.01, Name "Airfoil TE mesh size" } ]; -DefineConstant[ msLe = { 0.01, Name "Airfoil LE mesh size" } ]; - -/************** - Geometry - **************/ - -// Airfoil -Te = 1; -Le = 65; - -Point(1) = {1.000000, 0.000000, 0.000000,msTe}; -Point(2) = {0.999398, 0.000128, 0.000000}; -Point(3) = {0.997592, 0.000510, 0.000000}; -Point(4) = {0.994588, 0.001137, 0.000000}; -Point(5) = {0.990393, 0.002001, 0.000000}; -Point(6) = {0.985016, 0.003092, 0.000000}; -Point(7) = {0.978470, 0.004401, 0.000000}; -Point(8) = {0.970772, 0.005915, 0.000000}; -Point(9) = {0.961940, 0.007622, 0.000000}; -Point(10) = {0.951995, 0.009508, 0.000000}; -Point(11) = {0.940961, 0.011562, 0.000000}; -Point(12) = {0.928864, 0.013769, 0.000000}; -Point(13) = {0.915735, 0.016113, 0.000000}; -Point(14) = {0.901604, 0.018580, 0.000000}; -Point(15) = {0.886505, 0.021153, 0.000000}; -Point(16) = {0.870476, 0.023817, 0.000000}; -Point(17) = {0.853553, 0.026554, 0.000000}; -Point(18) = {0.835779, 0.029347, 0.000000}; -Point(19) = {0.817197, 0.032176, 0.000000}; -Point(20) = {0.797850, 0.035017, 0.000000}; -Point(21) = {0.777785, 0.037847, 0.000000}; -Point(22) = {0.757051, 0.040641, 0.000000}; -Point(23) = {0.735698, 0.043377, 0.000000}; -Point(24) = {0.713778, 0.046029, 0.000000}; -Point(25) = {0.691342, 0.048575, 0.000000}; -Point(26) = {0.668445, 0.050993, 0.000000}; -Point(27) = {0.645142, 0.053258, 0.000000}; -Point(28) = {0.621490, 0.055344, 0.000000}; -Point(29) = {0.597545, 0.057218, 0.000000}; -Point(30) = {0.573365, 0.058845, 0.000000}; -Point(31) = {0.549009, 0.060194, 0.000000}; -Point(32) = {0.524534, 0.061254, 0.000000}; -Point(33) = {0.500000, 0.062029, 0.000000}; -Point(34) = {0.475466, 0.062530, 0.000000}; -Point(35) = {0.450991, 0.062774, 0.000000}; -Point(36) = {0.426635, 0.062779, 0.000000}; -Point(37) = {0.402455, 0.062562, 0.000000}; -Point(38) = {0.378510, 0.062133, 0.000000}; -Point(39) = {0.354858, 0.061497, 0.000000}; -Point(40) = {0.331555, 0.060660, 0.000000}; -Point(41) = {0.308658, 0.059629, 0.000000}; -Point(42) = {0.286222, 0.058414, 0.000000}; -Point(43) = {0.264302, 0.057026, 0.000000}; -Point(44) = {0.242949, 0.055470, 0.000000}; -Point(45) = {0.222215, 0.053753, 0.000000}; -Point(46) = {0.202150, 0.051885, 0.000000}; -Point(47) = {0.182803, 0.049874, 0.000000}; -Point(48) = {0.164221, 0.047729, 0.000000}; -Point(49) = {0.146447, 0.045457, 0.000000}; -Point(50) = {0.129524, 0.043071, 0.000000}; -Point(51) = {0.113495, 0.040585, 0.000000}; -Point(52) = {0.098396, 0.038011, 0.000000}; -Point(53) = {0.084265, 0.035360, 0.000000}; -Point(54) = {0.071136, 0.032644, 0.000000}; -Point(55) = {0.059039, 0.029874, 0.000000}; -Point(56) = {0.048005, 0.027062, 0.000000}; -Point(57) = {0.038060, 0.024219, 0.000000}; -Point(58) = {0.029228, 0.021348, 0.000000}; -Point(59) = {0.021530, 0.018441, 0.000000}; -Point(60) = {0.014984, 0.015489, 0.000000}; -Point(61) = {0.009607, 0.012480, 0.000000}; -Point(62) = {0.005412, 0.009416, 0.000000}; -Point(63) = {0.002408, 0.006306, 0.000000}; -Point(64) = {0.000602, 0.003165, 0.000000}; -Point(65) = {0.000000, 0.000000, 0.000000, msLe}; -Point(66) = {0.000602, -0.003160, 0.000000}; -Point(67) = {0.002408, -0.006308, 0.000000}; -Point(68) = {0.005412, -0.009443, 0.000000}; -Point(69) = {0.009607, -0.012559, 0.000000}; -Point(70) = {0.014984, -0.015649, 0.000000}; -Point(71) = {0.021530, -0.018707, 0.000000}; -Point(72) = {0.029228, -0.021722, 0.000000}; -Point(73) = {0.038060, -0.024685, 0.000000}; -Point(74) = {0.048005, -0.027586, 0.000000}; -Point(75) = {0.059039, -0.030416, 0.000000}; -Point(76) = {0.071136, -0.033170, 0.000000}; -Point(77) = {0.084265, -0.035843, 0.000000}; -Point(78) = {0.098396, -0.038431, 0.000000}; -Point(79) = {0.113495, -0.040929, 0.000000}; -Point(80) = {0.129524, -0.043326, 0.000000}; -Point(81) = {0.146447, -0.045610, 0.000000}; -Point(82) = {0.164221, -0.047773, 0.000000}; -Point(83) = {0.182803, -0.049805, 0.000000}; -Point(84) = {0.202150, -0.051694, 0.000000}; -Point(85) = {0.222215, -0.053427, 0.000000}; -Point(86) = {0.242949, -0.054994, 0.000000}; -Point(87) = {0.264302, -0.056376, 0.000000}; -Point(88) = {0.286222, -0.057547, 0.000000}; -Point(89) = {0.308658, -0.058459, 0.000000}; -Point(90) = {0.331555, -0.059046, 0.000000}; -Point(91) = {0.354858, -0.059236, 0.000000}; -Point(92) = {0.378510, -0.058974, 0.000000}; -Point(93) = {0.402455, -0.058224, 0.000000}; -Point(94) = {0.426635, -0.056979, 0.000000}; -Point(95) = {0.450991, -0.055257, 0.000000}; -Point(96) = {0.475466, -0.053099, 0.000000}; -Point(97) = {0.500000, -0.050563, 0.000000}; -Point(98) = {0.524534, -0.047719, 0.000000}; -Point(99) = {0.549009, -0.044642, 0.000000}; -Point(100) = {0.573365, -0.041397, 0.000000}; -Point(101) = {0.597545, -0.038043, 0.000000}; -Point(102) = {0.621490, -0.034631, 0.000000}; -Point(103) = {0.645142, -0.031207, 0.000000}; -Point(104) = {0.668445, -0.027814, 0.000000}; -Point(105) = {0.691342, -0.024495, 0.000000}; -Point(106) = {0.713778, -0.021289, 0.000000}; -Point(107) = {0.735698, -0.018232, 0.000000}; -Point(108) = {0.757051, -0.015357, 0.000000}; -Point(109) = {0.777785, -0.012690, 0.000000}; -Point(110) = {0.797850, -0.010244, 0.000000}; -Point(111) = {0.817197, -0.008027, 0.000000}; -Point(112) = {0.835779, -0.006048, 0.000000}; -Point(113) = {0.853553, -0.004314, 0.000000}; -Point(114) = {0.870476, -0.002829, 0.000000}; -Point(115) = {0.886505, -0.001592, 0.000000}; -Point(116) = {0.901604, -0.000600, 0.000000}; -Point(117) = {0.915735, 0.000157, 0.000000}; -Point(118) = {0.928864, 0.000694, 0.000000}; -Point(119) = {0.940961, 0.001033, 0.000000}; -Point(120) = {0.951995, 0.001197, 0.000000}; -Point(121) = {0.961940, 0.001212, 0.000000}; -Point(122) = {0.970772, 0.001112, 0.000000}; -Point(123) = {0.978470, 0.000935, 0.000000}; -Point(124) = {0.985016, 0.000719, 0.000000}; -Point(125) = {0.990393, 0.000497, 0.000000}; -Point(126) = {0.994588, 0.000296, 0.000000}; -Point(127) = {0.997592, 0.000137, 0.000000}; -Point(128) = {0.999398, 0.000035, 0.000000, msTe}; -//Point(129) = {1.000000, 0.000000, 0.000000, msTe}; - -Spline(1) = {65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; -Spline(2) = {1,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65}; - -// Center -Point(0) = {1,0,0}; - -// Farfield -Point(10001) = {1+xLgt, 0, 0,msF}; -Point(10002) = {1+xLgt, yLgt, 0,msF}; -Point(10003) = {-xLgt, yLgt, 0,msF}; -Point(10004) = {-xLgt, 0, 0,msF}; -Point(10005) = {-xLgt,-yLgt, 0,msF}; -Point(10006) = {1+xLgt, -yLgt, 0,msF}; - -Line(10001) = {10001, 10002}; -Line(10002) = {10002, 10003}; -Line(10003) = {10003, 10004}; -Line(10004) = {10004, 10005}; -Line(10005) = {10005, 10006}; -Line(10006) = {10006, 10001}; - -// Front and wake -Line(10007) = {Le, 10004}; -Line(10008) = {Te, 10001}; - -// Internal field -Line Loop(10001) = {10008, 10001, 10002, 10003, -10007, 1}; -Line Loop(10002) = {10007, 10004, 10005, 10006, -10008, 2}; -Plane Surface(10001) = {10001}; -Plane Surface(10002) = {10002}; - -/************************* - Mesh Options - *************************/ - -Mesh.Algorithm = 5; // Delaunay - -/************************* - Physical Groups - *************************/ - -Physical Point("te") = {Te}; -Physical Line("upstream") = {10003, 10004}; -Physical Line("farfield") = {10002, 10005}; -Physical Line("downstream") = {10001}; -Physical Line("downstream") += {10006}; -Physical Line("airfoil") = {1}; -Physical Line("airfoil_") = {2}; -Physical Line("wake") = {10008}; -Physical Surface("field") = {10001}; -Physical Surface("field") += {10002}; diff --git a/flow/models/wbht.geo b/flow/models/wbht.geo deleted file mode 100644 index 0e79a8e9..00000000 --- a/flow/models/wbht.geo +++ /dev/null @@ -1,1246 +0,0 @@ -/* Template Wing-body-horizontal-tail */ -/* Plane designed in SUMO starting from "Light executive jet" template - * Points imported in Gmsh, and splining and surfacing made in Gmsh - * Restricted to Gmsh 4 - * CAUTION: Gmsh w/ OCAA not very robust at generating wing/tail-fuselage intersection! - */ -/* Adrien Crovato */ -/* Uliege, 2018-2019 */ - -SetFactory("OpenCASCADE"); - -/* Parameters */ - -scl = 2; // scaling factor for lifting surfaces mesh size (testing purpose) -DefineConstant[ msLeW0 = { 0.0210*scl, Name "leading edge mesh size on 0th wing spanwise station" } ]; -DefineConstant[ msTeW0 = { 0.0210*scl, Name "trailing edge mesh size on 0th wing spanwise station" } ]; -DefineConstant[ grW0 = { 1.5, Name "growth ratio for 0th wing spanwise station" } ]; -DefineConstant[ msLeW1 = { 0.0090*scl, Name "leading edge mesh size on 1th wing spanwise station" } ]; -DefineConstant[ msTeW1 = { 0.0090*scl, Name "trailing edge mesh size on 1th wing spanwise station" } ]; -DefineConstant[ grW1 = { 1.5, Name "growth ratio for 1th wing spanwise station" } ]; -DefineConstant[ msLeW2 = { 0.0042*scl, Name "leading edge mesh size on 2th wing spanwise station" } ]; -DefineConstant[ msTeW2 = { 0.0060*scl, Name "trailing edge mesh size on 2th wing spanwise station" } ]; -DefineConstant[ grW2 = { 1.5, Name "growth ratio for 2th wing spanwise station" } ]; -DefineConstant[ msLeT0 = { 0.0089*scl, Name "leading edge mesh size on 0th tail spanwise station" } ]; -DefineConstant[ msTeT0 = { 0.0089*scl, Name "trailing edge mesh size on 0th tail spanwise station" } ]; -DefineConstant[ grT0 = { 1.5, Name "growth ratio for 0th tail spanwise station" } ]; -DefineConstant[ msLeT1 = { 0.0048*scl, Name "leading edge mesh size on 1th tail spanwise station" } ]; -DefineConstant[ msTeT1 = { 0.0048*scl, Name "trailing edge mesh size on 1th tail spanwise station" } ]; -DefineConstant[ grT1 = { 1.5, Name "growth ratio for 1th tail spanwise station" } ]; -DefineConstant[ msFus = { 0.15, Name "fuselage mesh size" } ]; -DefineConstant[ msFusCaps = { 0.01, Name "fuselage caps mesh size" } ]; -DefineConstant[ msFar = { 5., Name "farfield mesh size" } ]; - -/* Splining */ - -// Domain -Point(1) = {-15, 0, -15}; -Point(2) = {25, 0, -15}; -Point(3) = {25, 0, 15}; -Point(4) = {-15, 0, 15}; -Point(11) = {-15, 15, -15}; -Point(12) = {25, 15, -15}; -Point(13) = {25, 15, 15}; -Point(14) = {-15, 15, 15}; - -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line(11) = {11,12}; -Line(12) = {12,13}; -Line(13) = {13,14}; -Line(14) = {14,11}; -Line(21) = {1,11}; -Line(22) = {2,12}; -Line(23) = {3,13}; -Line(24) = {4,14}; - -// Fuselage -Point(1011) = {0.000000000000000e+00, 0.000000000000000e+00, -4.150000000000000e-01}; -Point(1012) = {0.000000000000000e+00, 7.499999999999999e-03, -4.129903810567666e-01}; -Point(1013) = {0.000000000000000e+00, 1.299038105676658e-02, -4.075000000000000e-01}; -Point(1014) = {0.000000000000000e+00, 1.500000000000000e-02, -4.000000000000000e-01}; -Point(1015) = {0.000000000000000e+00, 1.299038105676658e-02, -3.925000000000000e-01}; -Point(1016) = {0.000000000000000e+00, 7.499999999999999e-03, -3.870096189432334e-01}; -Point(1017) = {0.000000000000000e+00, 0.000000000000000e+00, -3.850000000000000e-01}; -Point(1021) = {4.455460000000000e-01, 0.000000000000000e+00, -6.419390000000000e-01}; -Point(1022) = {4.455460000000000e-01, 2.000000000000000e-01, -6.067665432500000e-01}; -Point(1023) = {4.455460000000000e-01, 3.464100000000001e-01, -5.106740000000000e-01}; -Point(1024) = {4.455460000000000e-01, 4.000000000000000e-01, -3.794090000000000e-01}; -Point(1025) = {4.455460000000000e-01, 3.399484000000000e-01, -2.513749567100000e-01}; -Point(1026) = {4.455460000000000e-01, 2.080772000000000e-01, -1.472051529500000e-01}; -Point(1027) = {4.455460000000000e-01, 0.000000000000000e+00, -1.168790000000000e-01}; -Point(1031) = {1.416930000000000e+00, 0.000000000000000e+00, -8.000214999999999e-01}; -Point(1032) = {1.416930000000000e+00, 3.456600000000000e-01, -7.354480285375000e-01}; -Point(1033) = {1.416930000000000e+00, 5.987004030000000e-01, -5.590307500000000e-01}; -Point(1034) = {1.416930000000000e+00, 6.913200000000000e-01, -3.180400000000000e-01}; -Point(1035) = {1.416930000000000e+00, 5.987004030000000e-01, -7.704924999999999e-02}; -Point(1036) = {1.416930000000000e+00, 4.444627630800000e-01, 9.936802853750004e-02 }; -Point(1037) = {1.416930000000000e+00, 0.000000000000000e+00, 1.639415000000000e-01 }; -Point(1041) = {2.383160000000000e+00, 0.000000000000000e+00, -8.238591000000000e-01}; -Point(1042) = {2.383160000000000e+00, 4.030500000000000e-01, -7.205804520000001e-01}; -Point(1043) = {2.383160000000000e+00, 6.981027525000001e-01, -4.384191000000000e-01}; -Point(1044) = {2.383160000000000e+00, 8.061000000000000e-01, -5.297910000000005e-02}; -Point(1045) = {2.383160000000000e+00, 6.981027525000001e-01, 3.324609000000000e-01 }; -Point(1046) = {2.383160000000000e+00, 4.030500000000000e-01, 6.146222520000000e-01 }; -Point(1047) = {2.383160000000000e+00, 0.000000000000000e+00, 7.179009000000001e-01 }; -Point(1051) = {2.940000000000000e+00, 0.000000000000000e+00, -8.250000000000000e-01}; -Point(1052) = {2.940000000000000e+00, 4.124999999999999e-01, -7.144709581221619e-01}; -Point(1053) = {2.940000000000000e+00, 7.144709581221618e-01, -4.125000000000001e-01}; -Point(1054) = {2.940000000000000e+00, 8.250000000000000e-01, -5.051668046482832e-17}; -Point(1055) = {2.940000000000000e+00, 7.144709581221620e-01, 4.124999999999998e-01 }; -Point(1056) = {2.940000000000000e+00, 4.124999999999999e-01, 7.144709581221619e-01 }; -Point(1057) = {2.940000000000000e+00, 0.000000000000000e+00, 8.250000000000000e-01 }; -//Point(1061) = {5.500000000000000e+00, 0.000000000000000e+00, -8.250000000000000e-01}; -//Point(1062) = {5.500000000000000e+00, 4.124999999999999e-01, -7.144709581221619e-01}; -//Point(1063) = {5.500000000000000e+00, 7.144709581221618e-01, -4.125000000000001e-01}; -//Point(1064) = {5.500000000000000e+00, 8.250000000000000e-01, -5.051668046482832e-17}; -//Point(1065) = {5.500000000000000e+00, 7.144709581221620e-01, 4.124999999999998e-01 }; -//Point(1066) = {5.500000000000000e+00, 4.124999999999999e-01, 7.144709581221619e-01 }; -//Point(1067) = {5.500000000000000e+00, 0.000000000000000e+00, 8.250000000000000e-01 }; -Point(1071) = {8.029999999999999e+00, 0.000000000000000e+00, -8.250000000000000e-01}; -Point(1072) = {8.029999999999999e+00, 4.124999999999999e-01, -7.144709581221619e-01}; -Point(1073) = {8.029999999999999e+00, 7.144709581221618e-01, -4.125000000000001e-01}; -Point(1074) = {8.029999999999999e+00, 8.250000000000000e-01, -5.051668046482832e-17}; -Point(1075) = {8.029999999999999e+00, 7.144709581221620e-01, 4.124999999999998e-01 }; -Point(1076) = {8.029999999999999e+00, 4.124999999999999e-01, 7.144709581221619e-01 }; -Point(1077) = {8.029999999999999e+00, 0.000000000000000e+00, 8.250000000000000e-01 }; -Point(1081) = {9.650000000000000e+00, 0.000000000000000e+00, -5.580000000000001e-01}; -Point(1082) = {9.650000000000000e+00, 3.325000000000000e-01, -4.675671475544961e-01}; -Point(1083) = {9.650000000000000e+00, 5.759068935166517e-01, -2.205000000000001e-01}; -Point(1084) = {9.650000000000000e+00, 6.650000000000000e-01, 1.170000000000000e-01 }; -Point(1085) = {9.650000000000000e+00, 5.759068935166518e-01, 4.544999999999998e-01 }; -Point(1086) = {9.650000000000000e+00, 3.325000000000000e-01, 7.015671475544961e-01 }; -Point(1087) = {9.650000000000000e+00, 0.000000000000000e+00, 7.920000000000000e-01 }; -Point(1091) = {1.130000000000000e+01, 0.000000000000000e+00, -3.300000000000003e-02}; -Point(1092) = {1.130000000000000e+01, 1.598545708842964e-01, 1.884816873542217e-02 }; -Point(1093) = {1.130000000000000e+01, 2.858605400945955e-01, 1.604999999999999e-01 }; -Point(1094) = {1.130000000000000e+01, 3.460384680829078e-01, 3.540000000000000e-01 }; -Point(1095) = {1.130000000000000e+01, 3.157148450935477e-01, 5.475000000000000e-01 }; -Point(1096) = {1.130000000000000e+01, 1.900839966014704e-01, 6.891518312645778e-01 }; -Point(1097) = {1.130000000000000e+01, 0.000000000000000e+00, 7.410000000000000e-01 }; -Point(1111) = {1.240000000000000e+01, 0.000000000000000e+00, 4.823900000000000e-01}; -Point(1112) = {1.240000000000000e+01, 1.482268005571162e-02, 4.945555632093541e-01}; -Point(1113) = {1.240000000000000e+01, 2.714703393055281e-02, 5.277925000000000e-01}; -Point(1114) = {1.240000000000000e+01, 3.422834706753449e-02, 5.731950000000000e-01}; -Point(1115) = {1.240000000000000e+01, 3.298326053652364e-02, 6.185975000000000e-01}; -Point(1116) = {1.240000000000000e+01, 2.095662007323815e-02, 6.518344367906460e-01}; -Point(1117) = {1.240000000000000e+01, 0.000000000000000e+00, 6.640000000000000e-01}; - -Spline(1001) = {1011:1017}; -Spline(1002) = {1021:1027}; -Spline(1003) = {1031:1037}; -Spline(1004) = {1041:1047}; -Spline(1005) = {1051:1057}; -//Spline(1006) = {1061:1067}; -Spline(1007) = {1071:1077}; -Spline(1008) = {1081:1087}; -Spline(1009) = {1091:1097}; -Spline(1010) = {1111:1117}; -Line(1011) = {1011,1017}; -Line(1012) = {1111,1117}; -Line(1021) = {1011,1021}; -Line(1022) = {1021,1031}; -Line(1023) = {1031,1041}; -Line(1024) = {1041,1051}; -//Line(1025) = {1051,1061}; -//Line(1026) = {1061,1071}; -Line(1025) = {1051,1071}; -Line(1027) = {1071,1081}; -Line(1028) = {1081,1091}; -Line(1029) = {1091,1111}; -Line(1031) = {1017,1027}; -Line(1032) = {1027,1037}; -Line(1033) = {1037,1047}; -Line(1034) = {1047,1057}; -//Line(1035) = {1057,1067}; -//Line(1036) = {1067,1077}; -Line(1035) = {1057,1077}; -Line(1037) = {1077,1087}; -Line(1038) = {1087,1097}; -Line(1039) = {1097,1117}; -Line(1041) = {1014,1024}; -Line(1042) = {1024,1034}; -Line(1043) = {1034,1044}; -Line(1044) = {1044,1054}; -//Line(1045) = {1054,1064}; -//Line(1046) = {1064,1074}; -Line(1045) = {1054,1074}; -Line(1047) = {1074,1084}; -Line(1048) = {1084,1094}; -Line(1049) = {1094,1114}; - -/// Wing - -// Centerline -Point(2001) = {6.699678367697018e+000, 0.000000000000000e+000, -5.976254114367533e-001}; -Point(2002) = {6.677793794267236e+000, 0.000000000000000e+000, -5.908206365663777e-001}; -Point(2003) = {6.655903423148036e+000, 0.000000000000000e+000, -5.843480111003332e-001}; -Point(2004) = {6.634007331130006e+000, 0.000000000000000e+000, -5.782031357087608e-001}; -Point(2005) = {6.612103560053143e+000, 0.000000000000000e+000, -5.724981933030573e-001}; -Point(2006) = {6.590194029682156e+000, 0.000000000000000e+000, -5.671232006367554e-001}; -Point(2007) = {6.568278740017044e+000, 0.000000000000000e+000, -5.620781577098551e-001}; -Point(2008) = {6.546359572427223e+000, 0.000000000000000e+000, -5.572552809408186e-001}; -Point(2009) = {6.524432764173863e+000, 0.000000000000000e+000, -5.528701374927214e-001}; -Point(2010) = {6.502505226409914e+000, 0.000000000000000e+000, -5.485267876782819e-001}; -Point(2011) = {6.480577688645965e+000, 0.000000000000000e+000, -5.441834378638424e-001}; -Point(2012) = {6.458650150882017e+000, 0.000000000000000e+000, -5.398400880494029e-001}; -Point(2013) = {6.436718773588652e+000, 0.000000000000000e+000, -5.357167047278977e-001}; -Point(2014) = {6.414787396295286e+000, 0.000000000000000e+000, -5.315933214063925e-001}; -Point(2015) = {6.392856019001921e+000, 0.000000000000000e+000, -5.274699380848874e-001}; -Point(2016) = {6.370920802179139e+000, 0.000000000000000e+000, -5.235665212563166e-001}; -Point(2017) = {6.348985585356358e+000, 0.000000000000000e+000, -5.196631044277459e-001}; -Point(2018) = {6.327050368533577e+000, 0.000000000000000e+000, -5.157596875991752e-001}; -Point(2019) = {6.305115151710796e+000, 0.000000000000000e+000, -5.118562707706045e-001}; -Point(2020) = {6.283176095358598e+000, 0.000000000000000e+000, -5.081728204349681e-001}; -Point(2021) = {6.261237039006400e+000, 0.000000000000000e+000, -5.044893700993318e-001}; -Point(2022) = {6.239297982654202e+000, 0.000000000000000e+000, -5.008059197636955e-001}; -Point(2023) = {6.217358926302005e+000, 0.000000000000000e+000, -4.971224694280592e-001}; -Point(2024) = {6.195416030420391e+000, 0.000000000000000e+000, -4.936589855853572e-001}; -Point(2025) = {6.173473134538778e+000, 0.000000000000000e+000, -4.901955017426553e-001}; -Point(2026) = {6.151530238657164e+000, 0.000000000000000e+000, -4.867320178999534e-001}; -Point(2027) = {6.129583503246134e+000, 0.000000000000000e+000, -4.834885005501859e-001}; -Point(2028) = {6.107636767835103e+000, 0.000000000000000e+000, -4.802449832004183e-001}; -Point(2029) = {6.085690032424074e+000, 0.000000000000000e+000, -4.770014658506508e-001}; -Point(2030) = {6.063743297013044e+000, 0.000000000000000e+000, -4.737579485008833e-001}; -Point(2031) = {6.041792722072597e+000, 0.000000000000000e+000, -4.707343976440502e-001}; -Point(2032) = {6.019842147132152e+000, 0.000000000000000e+000, -4.677108467872171e-001}; -Point(2033) = {5.997887732662290e+000, 0.000000000000000e+000, -4.649072624233184e-001}; -Point(2034) = {5.975933318192427e+000, 0.000000000000000e+000, -4.621036780594197e-001}; -Point(2035) = {5.953978903722565e+000, 0.000000000000000e+000, -4.593000936955209e-001}; -Point(2036) = {5.932020649723286e+000, 0.000000000000000e+000, -4.567164758245567e-001}; -Point(2037) = {5.910062395724007e+000, 0.000000000000000e+000, -4.541328579535924e-001}; -Point(2038) = {5.888100302195312e+000, 0.000000000000000e+000, -4.517692065755625e-001}; -Point(2039) = {5.866138208666618e+000, 0.000000000000000e+000, -4.494055551975326e-001}; -Point(2040) = {5.844176115137923e+000, 0.000000000000000e+000, -4.470419038195027e-001}; -Point(2041) = {5.822210182079812e+000, 0.000000000000000e+000, -4.448982189344072e-001}; -Point(2042) = {5.800244249021700e+000, 0.000000000000000e+000, -4.427545340493117e-001}; -Point(2043) = {5.778274476434174e+000, 0.000000000000000e+000, -4.408308156571507e-001}; -Point(2044) = {5.756304703846647e+000, 0.000000000000000e+000, -4.389070972649896e-001}; -Point(2045) = {5.734331091729703e+000, 0.000000000000000e+000, -4.372033453657629e-001}; -Point(2046) = {5.712357479612760e+000, 0.000000000000000e+000, -4.354995934665362e-001}; -Point(2047) = {5.690380027966400e+000, 0.000000000000000e+000, -4.340158080602440e-001}; -Point(2048) = {5.668402576320041e+000, 0.000000000000000e+000, -4.325320226539517e-001}; -Point(2049) = {5.646421285144265e+000, 0.000000000000000e+000, -4.312682037405938e-001}; -Point(2050) = {5.624439993968489e+000, 0.000000000000000e+000, -4.300043848272359e-001}; -Point(2051) = {5.602458702792713e+000, 0.000000000000000e+000, -4.287405659138781e-001}; -Point(2052) = {5.580473572087521e+000, 0.000000000000000e+000, -4.276967134934546e-001}; -Point(2053) = {5.558488441382329e+000, 0.000000000000000e+000, -4.266528610730311e-001}; -Point(2054) = {5.536503310677137e+000, 0.000000000000000e+000, -4.256090086526078e-001}; -Point(2055) = {5.514514340442529e+000, 0.000000000000000e+000, -4.247851227251187e-001}; -Point(2056) = {5.492525370207921e+000, 0.000000000000000e+000, -4.239612367976297e-001}; -Point(2057) = {5.470536399973312e+000, 0.000000000000000e+000, -4.231373508701406e-001}; -Point(2058) = {5.448543590209288e+000, 0.000000000000000e+000, -4.225334314355859e-001}; -Point(2059) = {5.426550780445264e+000, 0.000000000000000e+000, -4.219295120010313e-001}; -Point(2060) = {5.404557970681239e+000, 0.000000000000000e+000, -4.213255925664766e-001}; -Point(2061) = {5.382561321387799e+000, 0.000000000000000e+000, -4.209416396248564e-001}; -Point(2062) = {5.360564672094358e+000, 0.000000000000000e+000, -4.205576866832362e-001}; -Point(2063) = {5.338568022800917e+000, 0.000000000000000e+000, -4.201737337416159e-001}; -Point(2064) = {5.316567533978061e+000, 0.000000000000000e+000, -4.200097472929301e-001}; -Point(2065) = {5.294567045155204e+000, 0.000000000000000e+000, -4.198457608442443e-001}; -Point(2066) = {5.272566556332347e+000, 0.000000000000000e+000, -4.196817743955584e-001}; -Point(2067) = {5.250562227980074e+000, 0.000000000000000e+000, -4.197377544398070e-001}; -Point(2068) = {5.228557899627801e+000, 0.000000000000000e+000, -4.197937344840556e-001}; -Point(2069) = {5.206553571275528e+000, 0.000000000000000e+000, -4.198497145283042e-001}; -Point(2070) = {5.184549242923255e+000, 0.000000000000000e+000, -4.199056945725528e-001}; -Point(2071) = {5.162541075041566e+000, 0.000000000000000e+000, -4.201816411097357e-001}; -Point(2072) = {5.140532907159876e+000, 0.000000000000000e+000, -4.204575876469187e-001}; -Point(2073) = {5.118520899748771e+000, 0.000000000000000e+000, -4.209535006770361e-001}; -Point(2074) = {5.096508892337665e+000, 0.000000000000000e+000, -4.214494137071535e-001}; -Point(2075) = {5.074496884926560e+000, 0.000000000000000e+000, -4.219453267372709e-001}; -Point(2076) = {5.052481037986039e+000, 0.000000000000000e+000, -4.226612062603227e-001}; -Point(2077) = {5.030465191045517e+000, 0.000000000000000e+000, -4.233770857833745e-001}; -Point(2078) = {5.008445504575579e+000, 0.000000000000000e+000, -4.243129317993607e-001}; -Point(2079) = {4.986425818105642e+000, 0.000000000000000e+000, -4.252487778153468e-001}; -Point(2080) = {4.964402292106287e+000, 0.000000000000000e+000, -4.264045903242675e-001}; -Point(2081) = {4.942378766106933e+000, 0.000000000000000e+000, -4.275604028331880e-001}; -Point(2082) = {4.920351400578163e+000, 0.000000000000000e+000, -4.289361818350431e-001}; -Point(2083) = {4.898324035049392e+000, 0.000000000000000e+000, -4.303119608368980e-001}; -Point(2084) = {4.876292829991206e+000, 0.000000000000000e+000, -4.319077063316875e-001}; -Point(2085) = {4.854257785403604e+000, 0.000000000000000e+000, -4.337234183194113e-001}; -Point(2086) = {4.832222740816001e+000, 0.000000000000000e+000, -4.355391303071352e-001}; -Point(2087) = {4.810183856698982e+000, 0.000000000000000e+000, -4.375748087877934e-001}; -Point(2088) = {4.788141133052547e+000, 0.000000000000000e+000, -4.398304537613860e-001}; -Point(2089) = {4.766094569876696e+000, 0.000000000000000e+000, -4.423060652279131e-001}; -Point(2090) = {4.744044167171428e+000, 0.000000000000000e+000, -4.450016431873745e-001}; -Point(2091) = {4.721989924936745e+000, 0.000000000000000e+000, -4.479171876397703e-001}; -Point(2092) = {4.699928003643229e+000, 0.000000000000000e+000, -4.512726650780350e-001}; -Point(2093) = {4.677858403290880e+000, 0.000000000000000e+000, -4.550680755021685e-001}; -Point(2094) = {4.655784963409116e+000, 0.000000000000000e+000, -4.590834524192364e-001}; -Point(2095) = {4.633700004939103e+000, 0.000000000000000e+000, -4.637587288151075e-001}; -Point(2096) = {4.611599688351424e+000, 0.000000000000000e+000, -4.693138711827162e-001}; -Point(2097) = {4.589480174116665e+000, 0.000000000000000e+000, -4.759688460149970e-001}; -Point(2098) = {4.567333783175993e+000, 0.000000000000000e+000, -4.841635862978186e-001}; -Point(2099) = {4.545141317882326e+000, 0.000000000000000e+000, -4.949979244958531e-001}; -Point(2100) = {4.522860543412087e+000, 0.000000000000000e+000, -5.108914920313789e-001}; -Point(2101) = {4.511635686529810e+000, 0.000000000000000e+000, -5.236775386436987e-001}; -Point(2102) = {4.504813999035638e+000, 0.000000000000000e+000, -5.363204093514082e-001}; -Point(2103) = {4.500000000000000e+000, 0.000000000000000e+000, -5.600000000000001e-001}; -Point(2104) = {4.503984660681739e+000, 0.000000000000000e+000, -5.838331718252399e-001}; -Point(2105) = {4.510360962763631e+000, 0.000000000000000e+000, -5.967064142979215e-001}; -Point(2106) = {4.521132755174795e+000, 0.000000000000000e+000, -6.098764138518616e-001}; -Point(2107) = {4.542845279291437e+000, 0.000000000000000e+000, -6.265378872706280e-001}; -Point(2108) = {4.564646112584651e+000, 0.000000000000000e+000, -6.381401313519028e-001}; -Point(2109) = {4.586493020230860e+000, 0.000000000000000e+000, -6.471027775179650e-001}; -Point(2110) = {4.608366804582982e+000, 0.000000000000000e+000, -6.545256582334862e-001}; -Point(2111) = {4.630259786582185e+000, 0.000000000000000e+000, -6.608487064843354e-001}; -Point(2112) = {4.652164287169637e+000, 0.000000000000000e+000, -6.665118552563814e-001}; -Point(2113) = {4.674080306345338e+000, 0.000000000000000e+000, -6.715151045496242e-001}; -Point(2114) = {4.696004004579870e+000, 0.000000000000000e+000, -6.760784208569981e-001}; -Point(2115) = {4.717935381873235e+000, 0.000000000000000e+000, -6.802018041785032e-001}; -Point(2116) = {4.739870598696016e+000, 0.000000000000000e+000, -6.841052210070739e-001}; -Point(2117) = {4.761809655048214e+000, 0.000000000000000e+000, -6.877886713427103e-001}; -Point(2118) = {4.783756390459244e+000, 0.000000000000000e+000, -6.910321886924777e-001}; -Point(2119) = {4.805706965399690e+000, 0.000000000000000e+000, -6.940557395493109e-001}; -Point(2120) = {4.827657540340137e+000, 0.000000000000000e+000, -6.970792904061440e-001}; -Point(2121) = {4.849611954809999e+000, 0.000000000000000e+000, -6.998828747700427e-001}; -Point(2122) = {4.871570208809278e+000, 0.000000000000000e+000, -7.024664926410070e-001}; -Point(2123) = {4.893532302337972e+000, 0.000000000000000e+000, -7.048301440190370e-001}; -Point(2124) = {4.915494395866667e+000, 0.000000000000000e+000, -7.071937953970668e-001}; -Point(2125) = {4.937460328924778e+000, 0.000000000000000e+000, -7.093374802821623e-001}; -Point(2126) = {4.959430101512306e+000, 0.000000000000000e+000, -7.112611986743234e-001}; -Point(2127) = {4.981399874099832e+000, 0.000000000000000e+000, -7.131849170664845e-001}; -Point(2128) = {5.003373486216776e+000, 0.000000000000000e+000, -7.148886689657111e-001}; -Point(2129) = {5.025347098333719e+000, 0.000000000000000e+000, -7.165924208649378e-001}; -Point(2130) = {5.047324549980079e+000, 0.000000000000000e+000, -7.180762062712300e-001}; -Point(2131) = {5.069302001626438e+000, 0.000000000000000e+000, -7.195599916775224e-001}; -Point(2132) = {5.091283292802214e+000, 0.000000000000000e+000, -7.208238105908802e-001}; -Point(2133) = {5.113264583977990e+000, 0.000000000000000e+000, -7.220876295042380e-001}; -Point(2134) = {5.135249714683182e+000, 0.000000000000000e+000, -7.231314819246615e-001}; -Point(2135) = {5.157234845388373e+000, 0.000000000000000e+000, -7.241753343450850e-001}; -Point(2136) = {5.179223815622982e+000, 0.000000000000000e+000, -7.249992202725740e-001}; -Point(2137) = {5.201212785857591e+000, 0.000000000000000e+000, -7.258231062000631e-001}; -Point(2138) = {5.223205595621614e+000, 0.000000000000000e+000, -7.264270256346177e-001}; -Point(2139) = {5.245198405385639e+000, 0.000000000000000e+000, -7.270309450691723e-001}; -Point(2140) = {5.267195054679080e+000, 0.000000000000000e+000, -7.274148980107926e-001}; -Point(2141) = {5.289191703972520e+000, 0.000000000000000e+000, -7.277988509524128e-001}; -Point(2142) = {5.311192192795377e+000, 0.000000000000000e+000, -7.279628374010987e-001}; -Point(2143) = {5.333192681618234e+000, 0.000000000000000e+000, -7.281268238497844e-001}; -Point(2144) = {5.355193170441090e+000, 0.000000000000000e+000, -7.282908102984703e-001}; -Point(2145) = {5.377197498793364e+000, 0.000000000000000e+000, -7.282348302542218e-001}; -Point(2146) = {5.399201827145637e+000, 0.000000000000000e+000, -7.281788502099732e-001}; -Point(2147) = {5.421209995027326e+000, 0.000000000000000e+000, -7.279029036727902e-001}; -Point(2148) = {5.443222002438431e+000, 0.000000000000000e+000, -7.274069906426728e-001}; -Point(2149) = {5.465234009849537e+000, 0.000000000000000e+000, -7.269110776125554e-001}; -Point(2150) = {5.487249856790059e+000, 0.000000000000000e+000, -7.261951980895036e-001}; -Point(2151) = {5.509265703730581e+000, 0.000000000000000e+000, -7.254793185664519e-001}; -Point(2152) = {5.531285390200518e+000, 0.000000000000000e+000, -7.245434725504656e-001}; -Point(2153) = {5.553308916199872e+000, 0.000000000000000e+000, -7.233876600415450e-001}; -Point(2154) = {5.575336281728642e+000, 0.000000000000000e+000, -7.220118810396901e-001}; -Point(2155) = {5.597367486786829e+000, 0.000000000000000e+000, -7.204161355449006e-001}; -Point(2156) = {5.619398691845015e+000, 0.000000000000000e+000, -7.188203900501111e-001}; -Point(2157) = {5.641433736432617e+000, 0.000000000000000e+000, -7.170046780623873e-001}; -Point(2158) = {5.663472620549637e+000, 0.000000000000000e+000, -7.149689995817291e-001}; -Point(2159) = {5.685515344196071e+000, 0.000000000000000e+000, -7.127133546081365e-001}; -Point(2160) = {5.707561907371924e+000, 0.000000000000000e+000, -7.102377431416095e-001}; -Point(2161) = {5.729612310077190e+000, 0.000000000000000e+000, -7.075421651821480e-001}; -Point(2162) = {5.751666552311874e+000, 0.000000000000000e+000, -7.046266207297521e-001}; -Point(2163) = {5.773720794546557e+000, 0.000000000000000e+000, -7.017110762773563e-001}; -Point(2164) = {5.795778876310657e+000, 0.000000000000000e+000, -6.985755653320260e-001}; -Point(2165) = {5.817840797604173e+000, 0.000000000000000e+000, -6.952200878937613e-001}; -Point(2166) = {5.839906558427106e+000, 0.000000000000000e+000, -6.916446439625623e-001}; -Point(2167) = {5.861972319250038e+000, 0.000000000000000e+000, -6.880692000313632e-001}; -Point(2168) = {5.884041919602386e+000, 0.000000000000000e+000, -6.842737896072297e-001}; -Point(2169) = {5.906115359484151e+000, 0.000000000000000e+000, -6.802584126901619e-001}; -Point(2170) = {5.928188799365916e+000, 0.000000000000000e+000, -6.762430357730940e-001}; -Point(2171) = {5.950266078777097e+000, 0.000000000000000e+000, -6.720076923630917e-001}; -Point(2172) = {5.972343358188278e+000, 0.000000000000000e+000, -6.677723489530894e-001}; -Point(2173) = {5.994420637599458e+000, 0.000000000000000e+000, -6.635370055430871e-001}; -Point(2174) = {6.016501756540055e+000, 0.000000000000000e+000, -6.590816956401504e-001}; -Point(2175) = {6.038582875480652e+000, 0.000000000000000e+000, -6.546263857372137e-001}; -Point(2176) = {6.060663994421249e+000, 0.000000000000000e+000, -6.501710758342770e-001}; -Point(2177) = {6.082745113361846e+000, 0.000000000000000e+000, -6.457157659313403e-001}; -Point(2178) = {6.104826232302443e+000, 0.000000000000000e+000, -6.412604560284037e-001}; -Point(2179) = {6.126907351243041e+000, 0.000000000000000e+000, -6.368051461254669e-001}; -Point(2180) = {6.148988470183638e+000, 0.000000000000000e+000, -6.323498362225302e-001}; -Point(2181) = {6.171065749594819e+000, 0.000000000000000e+000, -6.281144928125280e-001}; -Point(2182) = {6.193143029005999e+000, 0.000000000000000e+000, -6.238791494025257e-001}; -Point(2183) = {6.215216468887764e+000, 0.000000000000000e+000, -6.198637724854578e-001}; -Point(2184) = {6.237289908769529e+000, 0.000000000000000e+000, -6.158483955683899e-001}; -Point(2185) = {6.259359509121877e+000, 0.000000000000000e+000, -6.120529851442564e-001}; -Point(2186) = {6.281429109474226e+000, 0.000000000000000e+000, -6.082575747201229e-001}; -Point(2187) = {6.303494870297158e+000, 0.000000000000000e+000, -6.046821307889239e-001}; -Point(2188) = {6.325556791590674e+000, 0.000000000000000e+000, -6.013266533506592e-001}; -Point(2189) = {6.347614873354774e+000, 0.000000000000000e+000, -5.981911424053289e-001}; -Point(2190) = {6.369669115589457e+000, 0.000000000000000e+000, -5.952755979529331e-001}; -Point(2191) = {6.391715678765308e+000, 0.000000000000000e+000, -5.927999864864060e-001}; -Point(2192) = {6.413758402411744e+000, 0.000000000000000e+000, -5.905443415128133e-001}; -Point(2193) = {6.435793446999346e+000, 0.000000000000000e+000, -5.887286295250895e-001}; -Point(2194) = {6.457824652057533e+000, 0.000000000000000e+000, -5.871328840303002e-001}; -Point(2195) = {6.479848178056887e+000, 0.000000000000000e+000, -5.859770715213796e-001}; -Point(2196) = {6.501864024997408e+000, 0.000000000000000e+000, -5.852611919983277e-001}; -Point(2197) = {6.523868353349682e+000, 0.000000000000000e+000, -5.852052119540792e-001}; -Point(2198) = {6.545865732153711e+000, 0.000000000000000e+000, -5.855473712620418e-001}; -Point(2199) = {6.567855431898908e+000, 0.000000000000000e+000, -5.863294635558733e-001}; -Point(2200) = {6.589841253719396e+000, 0.000000000000000e+000, -5.873337220075686e-001}; -Point(2201) = {6.611821354641053e+000, 0.000000000000000e+000, -5.886657305337362e-001}; -Point(2202) = {6.633795696268585e+000, 0.000000000000000e+000, -5.903276887993053e-001}; -Point(2203) = {6.655762320441991e+000, 0.000000000000000e+000, -5.924317797156726e-001}; -Point(2204) = {6.677723223716567e+000, 0.000000000000000e+000, -5.948636207065121e-001}; - -// Tip -Point(2301) = {7.599850359908118e+000, 6.100000000000000e+000, 1.642705613406781e-002}; -Point(2302) = {7.590814913055090e+000, 6.100000000000000e+000, 1.837926317383409e-002}; -Point(2303) = {7.581781822276931e+000, 6.100000000000000e+000, 2.019649077475438e-002}; -Point(2304) = {7.572751103280808e+000, 6.100000000000000e+000, 2.187783907390295e-002}; -Point(2305) = {7.563723510010677e+000, 6.100000000000000e+000, 2.338011465084888e-002}; -Point(2306) = {7.554697487457125e+000, 6.100000000000000e+000, 2.479240393523086e-002}; -Point(2307) = {7.545673820978443e+000, 6.100000000000000e+000, 2.606971378076661e-002}; -Point(2308) = {7.536651740923506e+000, 6.100000000000000e+000, 2.725613747081268e-002}; -Point(2309) = {7.527632001236272e+000, 6.100000000000000e+000, 2.830848158493837e-002}; -Point(2310) = {7.518612952664332e+000, 6.100000000000000e+000, 2.932123173033574e-002}; -Point(2311) = {7.509593904092393e+000, 6.100000000000000e+000, 3.033398187573322e-002}; -Point(2312) = {7.500574855520454e+000, 6.100000000000000e+000, 3.134673202113059e-002}; -Point(2313) = {7.491557377665094e+000, 6.100000000000000e+000, 3.226949587396399e-002}; -Point(2314) = {7.482539899809734e+000, 6.100000000000000e+000, 3.319225972679729e-002}; -Point(2315) = {7.473522421954375e+000, 6.100000000000000e+000, 3.411502357963070e-002}; -Point(2316) = {7.464504944099015e+000, 6.100000000000000e+000, 3.503778743246400e-002}; -Point(2317) = {7.455489036960234e+000, 6.100000000000000e+000, 3.587056499273333e-002}; -Point(2318) = {7.446473129821454e+000, 6.100000000000000e+000, 3.670334255300256e-002}; -Point(2319) = {7.437457222682673e+000, 6.100000000000000e+000, 3.753612011327179e-002}; -Point(2320) = {7.428441315543893e+000, 6.100000000000000e+000, 3.836889767354113e-002}; -Point(2321) = {7.419425408405113e+000, 6.100000000000000e+000, 3.920167523381035e-002}; -Point(2322) = {7.410411071982912e+000, 6.100000000000000e+000, 3.994446650151562e-002}; -Point(2323) = {7.401396735560711e+000, 6.100000000000000e+000, 4.068725776922078e-002}; -Point(2324) = {7.392382399138509e+000, 6.100000000000000e+000, 4.143004903692604e-002}; -Point(2325) = {7.383368062716309e+000, 6.100000000000000e+000, 4.217284030463120e-002}; -Point(2326) = {7.374355297010687e+000, 6.100000000000000e+000, 4.282564527977228e-002}; -Point(2327) = {7.365342531305065e+000, 6.100000000000000e+000, 4.347845025491348e-002}; -Point(2328) = {7.356329765599443e+000, 6.100000000000000e+000, 4.413125523005457e-002}; -Point(2329) = {7.347316999893821e+000, 6.100000000000000e+000, 4.478406020519565e-002}; -Point(2330) = {7.338305804904779e+000, 6.100000000000000e+000, 4.534687888777278e-002}; -Point(2331) = {7.329294609915737e+000, 6.100000000000000e+000, 4.590969757034979e-002}; -Point(2332) = {7.320283414926695e+000, 6.100000000000000e+000, 4.647251625292681e-002}; -Point(2333) = {7.311272219937652e+000, 6.100000000000000e+000, 4.703533493550394e-002}; -Point(2334) = {7.302262595665189e+000, 6.100000000000000e+000, 4.750816732551688e-002}; -Point(2335) = {7.293252971392726e+000, 6.100000000000000e+000, 4.798099971552983e-002}; -Point(2336) = {7.284243347120263e+000, 6.100000000000000e+000, 4.845383210554277e-002}; -Point(2337) = {7.275235293564379e+000, 6.100000000000000e+000, 4.883667820299176e-002}; -Point(2338) = {7.266227240008496e+000, 6.100000000000000e+000, 4.921952430044063e-002}; -Point(2339) = {7.257219186452613e+000, 6.100000000000000e+000, 4.960237039788951e-002}; -Point(2340) = {7.248211132896728e+000, 6.100000000000000e+000, 4.998521649533838e-002}; -Point(2341) = {7.239204650057424e+000, 6.100000000000000e+000, 5.027807630022330e-002}; -Point(2342) = {7.230198167218120e+000, 6.100000000000000e+000, 5.057093610510810e-002}; -Point(2343) = {7.221191684378816e+000, 6.100000000000000e+000, 5.086379590999290e-002}; -Point(2344) = {7.212186772256091e+000, 6.100000000000000e+000, 5.106666942231364e-002}; -Point(2345) = {7.203181860133366e+000, 6.100000000000000e+000, 5.126954293463437e-002}; -Point(2346) = {7.194176948010641e+000, 6.100000000000000e+000, 5.147241644695511e-002}; -Point(2347) = {7.185173606604495e+000, 6.100000000000000e+000, 5.158530366671177e-002}; -Point(2348) = {7.176170265198349e+000, 6.100000000000000e+000, 5.169819088646854e-002}; -Point(2349) = {7.167166923792204e+000, 6.100000000000000e+000, 5.181107810622521e-002}; -Point(2350) = {7.158163582386059e+000, 6.100000000000000e+000, 5.192396532598187e-002}; -Point(2351) = {7.149161811696493e+000, 6.100000000000000e+000, 5.194686625317446e-002}; -Point(2352) = {7.140160041006926e+000, 6.100000000000000e+000, 5.196976718036706e-002}; -Point(2353) = {7.131158270317360e+000, 6.100000000000000e+000, 5.199266810755965e-002}; -Point(2354) = {7.122156499627794e+000, 6.100000000000000e+000, 5.201556903475224e-002}; -Point(2355) = {7.113156299654807e+000, 6.100000000000000e+000, 5.194848366938076e-002}; -Point(2356) = {7.104156099681820e+000, 6.100000000000000e+000, 5.188139830400929e-002}; -Point(2357) = {7.095155899708833e+000, 6.100000000000000e+000, 5.181431293863781e-002}; -Point(2358) = {7.086155699735846e+000, 6.100000000000000e+000, 5.174722757326633e-002}; -Point(2359) = {7.077157070479439e+000, 6.100000000000000e+000, 5.159015591533078e-002}; -Point(2360) = {7.068158441223031e+000, 6.100000000000000e+000, 5.143308425739523e-002}; -Point(2361) = {7.059159811966623e+000, 6.100000000000000e+000, 5.127601259945969e-002}; -Point(2362) = {7.050161182710216e+000, 6.100000000000000e+000, 5.111894094152414e-002}; -Point(2363) = {7.041162553453808e+000, 6.100000000000000e+000, 5.096186928358859e-002}; -Point(2364) = {7.032165494913980e+000, 6.100000000000000e+000, 5.071481133308897e-002}; -Point(2365) = {7.023168436374152e+000, 6.100000000000000e+000, 5.046775338258935e-002}; -Point(2366) = {7.014171377834324e+000, 6.100000000000000e+000, 5.022069543208974e-002}; -Point(2367) = {7.005174319294495e+000, 6.100000000000000e+000, 4.997363748159012e-002}; -Point(2368) = {6.996177260754667e+000, 6.100000000000000e+000, 4.972657953109039e-002}; -Point(2369) = {6.987181772931418e+000, 6.100000000000000e+000, 4.938953528802670e-002}; -Point(2370) = {6.978186285108170e+000, 6.100000000000000e+000, 4.905249104496301e-002}; -Point(2371) = {6.969190797284921e+000, 6.100000000000000e+000, 4.871544680189932e-002}; -Point(2372) = {6.960195309461672e+000, 6.100000000000000e+000, 4.837840255883563e-002}; -Point(2373) = {6.951201392355003e+000, 6.100000000000000e+000, 4.795137202320787e-002}; -Point(2374) = {6.942207475248333e+000, 6.100000000000000e+000, 4.752434148758011e-002}; -Point(2375) = {6.933213558141664e+000, 6.100000000000000e+000, 4.709731095195235e-002}; -Point(2376) = {6.924221211751574e+000, 6.100000000000000e+000, 4.658029412376041e-002}; -Point(2377) = {6.915228865361484e+000, 6.100000000000000e+000, 4.606327729556858e-002}; -Point(2378) = {6.906236518971394e+000, 6.100000000000000e+000, 4.554626046737675e-002}; -Point(2379) = {6.897245743297883e+000, 6.100000000000000e+000, 4.493925734662085e-002}; -Point(2380) = {6.888254967624372e+000, 6.100000000000000e+000, 4.433225422586484e-002}; -Point(2381) = {6.879265762667441e+000, 6.100000000000000e+000, 4.363526481254487e-002}; -Point(2382) = {6.870276557710509e+000, 6.100000000000000e+000, 4.293827539922490e-002}; -Point(2383) = {6.861287352753578e+000, 6.100000000000000e+000, 4.224128598590493e-002}; -Point(2384) = {6.852299718513226e+000, 6.100000000000000e+000, 4.145431028002078e-002}; -Point(2385) = {6.843312084272874e+000, 6.100000000000000e+000, 4.066733457413674e-002}; -Point(2386) = {6.834326020749101e+000, 6.100000000000000e+000, 3.979037257568852e-002}; -Point(2387) = {6.825339957225328e+000, 6.100000000000000e+000, 3.891341057724040e-002}; -Point(2388) = {6.816355464418136e+000, 6.100000000000000e+000, 3.794646228622822e-002}; -Point(2389) = {6.807372542327521e+000, 6.100000000000000e+000, 3.688952770265186e-002}; -Point(2390) = {6.798389620236907e+000, 6.100000000000000e+000, 3.583259311907561e-002}; -Point(2391) = {6.789408268862873e+000, 6.100000000000000e+000, 3.468567224293517e-002}; -Point(2392) = {6.780428488205417e+000, 6.100000000000000e+000, 3.344876507423078e-002}; -Point(2393) = {6.771451848981121e+000, 6.100000000000000e+000, 3.203188532039814e-002}; -Point(2394) = {6.762476780473404e+000, 6.100000000000000e+000, 3.052501927400142e-002}; -Point(2395) = {6.753504853398845e+000, 6.100000000000000e+000, 2.883818064247667e-002}; -Point(2396) = {6.744536067757446e+000, 6.100000000000000e+000, 2.697136942582368e-002}; -Point(2397) = {6.735571994265784e+000, 6.100000000000000e+000, 2.483459933147847e-002}; -Point(2398) = {6.726615774357018e+000, 6.100000000000000e+000, 2.224789777431291e-002}; -Point(2399) = {6.717672120180889e+000, 6.100000000000000e+000, 1.894130587663467e-002}; -Point(2400) = {6.708755168186608e+000, 6.100000000000000e+000, 1.410494700536724e-002}; -Point(2401) = {6.704317111504999e+000, 6.100000000000000e+000, 1.051694576640050e-002}; -Point(2402) = {6.701680351391251e+000, 6.100000000000000e+000, 6.870372566456839e-003}; -Point(2403) = {6.700000000000000e+000, 6.100000000000000e+000, 0.000000000000000e+000}; -Point(2404) = {6.701919100311313e+000, 6.100000000000000e+000, -6.807543903282587e-003}; -Point(2405) = {6.704681517751409e+000, 6.100000000000000e+000, -1.035987410846495e-002}; -Point(2406) = {6.709242090326208e+000, 6.100000000000000e+000, -1.379080368949609e-002}; -Point(2407) = {6.718322396844742e+000, 6.100000000000000e+000, -1.831301924489248e-002}; -Point(2408) = {6.727376001181427e+000, 6.100000000000000e+000, -2.130546782669957e-002}; -Point(2409) = {6.736417039785478e+000, 6.100000000000000e+000, -2.357802606799403e-002}; -Point(2410) = {6.745450224806630e+000, 6.100000000000000e+000, -2.540065284646814e-002}; -Point(2411) = {6.754478697678046e+000, 6.100000000000000e+000, -2.695332074724999e-002}; -Point(2412) = {6.763504029116302e+000, 6.100000000000000e+000, -2.832601606290375e-002}; -Point(2413) = {6.772526219121399e+000, 6.100000000000000e+000, -2.951873879342931e-002}; -Point(2414) = {6.781546838409918e+000, 6.100000000000000e+000, -3.062147523139081e-002}; -Point(2415) = {6.790565886981858e+000, 6.100000000000000e+000, -3.163422537678823e-002}; -Point(2416) = {6.799583364837218e+000, 6.100000000000000e+000, -3.255698922962158e-002}; -Point(2417) = {6.808599271975998e+000, 6.100000000000000e+000, -3.338976678989086e-002}; -Point(2418) = {6.817613608398199e+000, 6.100000000000000e+000, -3.413255805759607e-002}; -Point(2419) = {6.826626374103821e+000, 6.100000000000000e+000, -3.478536303273722e-002}; -Point(2420) = {6.835639139809443e+000, 6.100000000000000e+000, -3.543816800787830e-002}; -Point(2421) = {6.844650334798485e+000, 6.100000000000000e+000, -3.600098669045537e-002}; -Point(2422) = {6.853659959070948e+000, 6.100000000000000e+000, -3.647381908046832e-002}; -Point(2423) = {6.862669583343411e+000, 6.100000000000000e+000, -3.694665147048132e-002}; -Point(2424) = {6.871679207615873e+000, 6.100000000000000e+000, -3.741948386049432e-002}; -Point(2425) = {6.880687261171758e+000, 6.100000000000000e+000, -3.780232995794319e-002}; -Point(2426) = {6.889693744011062e+000, 6.100000000000000e+000, -3.809518976282800e-002}; -Point(2427) = {6.898700226850366e+000, 6.100000000000000e+000, -3.838804956771286e-002}; -Point(2428) = {6.907706709689670e+000, 6.100000000000000e+000, -3.868090937259766e-002}; -Point(2429) = {6.916711621812395e+000, 6.100000000000000e+000, -3.888378288491839e-002}; -Point(2430) = {6.925716533935120e+000, 6.100000000000000e+000, -3.908665639723918e-002}; -Point(2431) = {6.934719875341266e+000, 6.100000000000000e+000, -3.919954361699585e-002}; -Point(2432) = {6.943723216747411e+000, 6.100000000000000e+000, -3.931243083675251e-002}; -Point(2433) = {6.952726558153557e+000, 6.100000000000000e+000, -3.942531805650917e-002}; -Point(2434) = {6.961728328843123e+000, 6.100000000000000e+000, -3.944821898370177e-002}; -Point(2435) = {6.970730099532689e+000, 6.100000000000000e+000, -3.947111991089436e-002}; -Point(2436) = {6.979731870222256e+000, 6.100000000000000e+000, -3.949402083808695e-002}; -Point(2437) = {6.988732070195242e+000, 6.100000000000000e+000, -3.942693547271547e-002}; -Point(2438) = {6.997732270168229e+000, 6.100000000000000e+000, -3.935985010734405e-002}; -Point(2439) = {7.006732470141216e+000, 6.100000000000000e+000, -3.929276474197258e-002}; -Point(2440) = {7.015732670114203e+000, 6.100000000000000e+000, -3.922567937660110e-002}; -Point(2441) = {7.024731299370611e+000, 6.100000000000000e+000, -3.906860771866555e-002}; -Point(2442) = {7.033729928627018e+000, 6.100000000000000e+000, -3.891153606073000e-002}; -Point(2443) = {7.042728557883425e+000, 6.100000000000000e+000, -3.875446440279440e-002}; -Point(2444) = {7.051725616423254e+000, 6.100000000000000e+000, -3.850740645229478e-002}; -Point(2445) = {7.060722674963082e+000, 6.100000000000000e+000, -3.826034850179516e-002}; -Point(2446) = {7.069719733502910e+000, 6.100000000000000e+000, -3.801329055129554e-002}; -Point(2447) = {7.078715221326159e+000, 6.100000000000000e+000, -3.767624630823185e-002}; -Point(2448) = {7.087710709149408e+000, 6.100000000000000e+000, -3.733920206516816e-002}; -Point(2449) = {7.096706196972656e+000, 6.100000000000000e+000, -3.700215782210442e-002}; -Point(2450) = {7.105700114079326e+000, 6.100000000000000e+000, -3.657512728647666e-002}; -Point(2451) = {7.114694031185996e+000, 6.100000000000000e+000, -3.614809675084890e-002}; -Point(2452) = {7.123686377576085e+000, 6.100000000000000e+000, -3.563107992265702e-002}; -Point(2453) = {7.132678723966176e+000, 6.100000000000000e+000, -3.511406309446519e-002}; -Point(2454) = {7.141671070356265e+000, 6.100000000000000e+000, -3.459704626627330e-002}; -Point(2455) = {7.150661846029776e+000, 6.100000000000000e+000, -3.399004314551740e-002}; -Point(2456) = {7.159652621703287e+000, 6.100000000000000e+000, -3.338304002476145e-002}; -Point(2457) = {7.168641826660219e+000, 6.100000000000000e+000, -3.268605061144148e-002}; -Point(2458) = {7.177629460900571e+000, 6.100000000000000e+000, -3.189907490555738e-002}; -Point(2459) = {7.186617095140923e+000, 6.100000000000000e+000, -3.111209919967328e-002}; -Point(2460) = {7.195603158664696e+000, 6.100000000000000e+000, -3.023513720122517e-002}; -Point(2461) = {7.204587651471889e+000, 6.100000000000000e+000, -2.926818891021293e-002}; -Point(2462) = {7.213570573562503e+000, 6.100000000000000e+000, -2.821125432663663e-002}; -Point(2463) = {7.222551924936537e+000, 6.100000000000000e+000, -2.706433345049625e-002}; -Point(2464) = {7.231531705593993e+000, 6.100000000000000e+000, -2.582742628179180e-002}; -Point(2465) = {7.240511486251448e+000, 6.100000000000000e+000, -2.459051911308735e-002}; -Point(2466) = {7.249489696192324e+000, 6.100000000000000e+000, -2.326362565181883e-002}; -Point(2467) = {7.258467906133200e+000, 6.100000000000000e+000, -2.193673219055026e-002}; -Point(2468) = {7.267444545357496e+000, 6.100000000000000e+000, -2.051985243671767e-002}; -Point(2469) = {7.276421184581793e+000, 6.100000000000000e+000, -1.910297268288508e-002}; -Point(2470) = {7.285396253089510e+000, 6.100000000000000e+000, -1.759610663648836e-002}; -Point(2471) = {7.294371321597227e+000, 6.100000000000000e+000, -1.608924059009170e-002}; -Point(2472) = {7.303344819388365e+000, 6.100000000000000e+000, -1.449238825113097e-002}; -Point(2473) = {7.312318317179503e+000, 6.100000000000000e+000, -1.289553591217019e-002}; -Point(2474) = {7.321291814970641e+000, 6.100000000000000e+000, -1.129868357320946e-002}; -Point(2475) = {7.330265312761778e+000, 6.100000000000000e+000, -9.701831234248670e-003}; -Point(2476) = {7.339238810552916e+000, 6.100000000000000e+000, -8.104978895287940e-003}; -Point(2477) = {7.348212308344055e+000, 6.100000000000000e+000, -6.508126556327154e-003}; -Point(2478) = {7.357185806135192e+000, 6.100000000000000e+000, -4.911274217366424e-003}; -Point(2479) = {7.366159303926330e+000, 6.100000000000000e+000, -3.314421878405693e-003}; -Point(2480) = {7.375132801717468e+000, 6.100000000000000e+000, -1.717569539444908e-003}; -Point(2481) = {7.384106299508606e+000, 6.100000000000000e+000, -1.207172004841772e-004}; -Point(2482) = {7.393079797299743e+000, 6.100000000000000e+000, 1.476135138476553e-003}; -Point(2483) = {7.402053295090881e+000, 6.100000000000000e+000, 3.072987477437339e-003}; -Point(2484) = {7.411028363598598e+000, 6.100000000000000e+000, 4.579853523834054e-003}; -Point(2485) = {7.420003432106316e+000, 6.100000000000000e+000, 6.086719570230770e-003}; -Point(2486) = {7.428980071330612e+000, 6.100000000000000e+000, 7.503599324063304e-003}; -Point(2487) = {7.437956710554909e+000, 6.100000000000000e+000, 8.920479077895949e-003}; -Point(2488) = {7.446934920495784e+000, 6.100000000000000e+000, 1.024737253916441e-002}; -Point(2489) = {7.455913130436660e+000, 6.100000000000000e+000, 1.157426600043299e-002}; -Point(2490) = {7.464892911094116e+000, 6.100000000000000e+000, 1.281117316913749e-002}; -Point(2491) = {7.473874262468151e+000, 6.100000000000000e+000, 1.395809404527781e-002}; -Point(2492) = {7.482857184558764e+000, 6.100000000000000e+000, 1.501502862885418e-002}; -Point(2493) = {7.491841677365958e+000, 6.100000000000000e+000, 1.598197691986636e-002}; -Point(2494) = {7.500829311606310e+000, 6.100000000000000e+000, 1.676895262575040e-002}; -Point(2495) = {7.509818516563241e+000, 6.100000000000000e+000, 1.746594203907048e-002}; -Point(2496) = {7.518810862953331e+000, 6.100000000000000e+000, 1.798295886726231e-002}; -Point(2497) = {7.527806350776580e+000, 6.100000000000000e+000, 1.832000311032600e-002}; -Point(2498) = {7.536804288917693e+000, 6.100000000000000e+000, 1.851666873698976e-002}; -Point(2499) = {7.545804598840840e+000, 6.100000000000000e+000, 1.857745506188169e-002}; -Point(2500) = {7.554806463773401e+000, 6.100000000000000e+000, 1.854915495713527e-002}; -Point(2501) = {7.563810684780831e+000, 6.100000000000000e+000, 1.838587541354275e-002}; -Point(2502) = {7.572816476504841e+000, 6.100000000000000e+000, 1.813260957738605e-002}; -Point(2503) = {7.581825409662009e+000, 6.100000000000000e+000, 1.769937115610132e-002}; -Point(2504) = {7.590836714601212e+000, 6.100000000000000e+000, 1.713025343304475e-002}; - -// Winglet -Point(2601) = {7.869930167957122e+000, 7.000000000000000e+000, 2.576659595292317e-001}; -Point(2602) = {7.865713626092376e+000, 7.000000000000000e+000, 2.585769894811226e-001}; -Point(2603) = {7.861498183729235e+000, 7.000000000000000e+000, 2.594250290282187e-001}; -Point(2604) = {7.857283848197710e+000, 7.000000000000000e+000, 2.602096582344881e-001}; -Point(2605) = {7.853070971338315e+000, 7.000000000000000e+000, 2.609107201703962e-001}; -Point(2606) = {7.848858827479992e+000, 7.000000000000000e+000, 2.615697885031078e-001}; -Point(2607) = {7.844647783123273e+000, 7.000000000000000e+000, 2.621658664310245e-001}; -Point(2608) = {7.840437479097636e+000, 7.000000000000000e+000, 2.627195308197126e-001}; -Point(2609) = {7.836228267243593e+000, 7.000000000000000e+000, 2.632106247396379e-001}; -Point(2610) = {7.832019377910022e+000, 7.000000000000000e+000, 2.636832414741567e-001}; -Point(2611) = {7.827810488576450e+000, 7.000000000000000e+000, 2.641558582086755e-001}; -Point(2612) = {7.823601599242879e+000, 7.000000000000000e+000, 2.646284749431943e-001}; -Point(2613) = {7.819393442910378e+000, 7.000000000000000e+000, 2.650590980745166e-001}; -Point(2614) = {7.815185286577876e+000, 7.000000000000000e+000, 2.654897212058387e-001}; -Point(2615) = {7.810977130245375e+000, 7.000000000000000e+000, 2.659203443371609e-001}; -Point(2616) = {7.806768973912874e+000, 7.000000000000000e+000, 2.663509674684832e-001}; -Point(2617) = {7.802561550581443e+000, 7.000000000000000e+000, 2.667395969966089e-001}; -Point(2618) = {7.798354127250012e+000, 7.000000000000000e+000, 2.671282265247346e-001}; -Point(2619) = {7.794146703918581e+000, 7.000000000000000e+000, 2.675168560528602e-001}; -Point(2620) = {7.789939280587150e+000, 7.000000000000000e+000, 2.679054855809858e-001}; -Point(2621) = {7.785731857255719e+000, 7.000000000000000e+000, 2.682941151091115e-001}; -Point(2622) = {7.781525166925359e+000, 7.000000000000000e+000, 2.686407510340406e-001}; -Point(2623) = {7.777318476594998e+000, 7.000000000000000e+000, 2.689873869589697e-001}; -Point(2624) = {7.773111786264638e+000, 7.000000000000000e+000, 2.693340228838989e-001}; -Point(2625) = {7.768905095934278e+000, 7.000000000000000e+000, 2.696806588088279e-001}; -Point(2626) = {7.764699138604987e+000, 7.000000000000000e+000, 2.699853011305604e-001}; -Point(2627) = {7.760493181275697e+000, 7.000000000000000e+000, 2.702899434522930e-001}; -Point(2628) = {7.756287223946407e+000, 7.000000000000000e+000, 2.705945857740255e-001}; -Point(2629) = {7.752081266617116e+000, 7.000000000000000e+000, 2.708992280957580e-001}; -Point(2630) = {7.747876042288898e+000, 7.000000000000000e+000, 2.711618768142939e-001}; -Point(2631) = {7.743670817960677e+000, 7.000000000000000e+000, 2.714245255328299e-001}; -Point(2632) = {7.739465593632458e+000, 7.000000000000000e+000, 2.716871742513659e-001}; -Point(2633) = {7.735260369304237e+000, 7.000000000000000e+000, 2.719498229699018e-001}; -Point(2634) = {7.731055877977088e+000, 7.000000000000000e+000, 2.721704780852412e-001}; -Point(2635) = {7.726851386649939e+000, 7.000000000000000e+000, 2.723911332005806e-001}; -Point(2636) = {7.722646895322789e+000, 7.000000000000000e+000, 2.726117883159200e-001}; -Point(2637) = {7.718443136996711e+000, 7.000000000000000e+000, 2.727904498280628e-001}; -Point(2638) = {7.714239378670632e+000, 7.000000000000000e+000, 2.729691113402056e-001}; -Point(2639) = {7.710035620344552e+000, 7.000000000000000e+000, 2.731477728523485e-001}; -Point(2640) = {7.705831862018473e+000, 7.000000000000000e+000, 2.733264343644912e-001}; -Point(2641) = {7.701628836693464e+000, 7.000000000000000e+000, 2.734631022734375e-001}; -Point(2642) = {7.697425811368456e+000, 7.000000000000000e+000, 2.735997701823838e-001}; -Point(2643) = {7.693222786043448e+000, 7.000000000000000e+000, 2.737364380913300e-001}; -Point(2644) = {7.689020493719509e+000, 7.000000000000000e+000, 2.738311123970797e-001}; -Point(2645) = {7.684818201395570e+000, 7.000000000000000e+000, 2.739257867028294e-001}; -Point(2646) = {7.680615909071633e+000, 7.000000000000000e+000, 2.740204610085790e-001}; -Point(2647) = {7.676414349748765e+000, 7.000000000000000e+000, 2.740731417111322e-001}; -Point(2648) = {7.672212790425896e+000, 7.000000000000000e+000, 2.741258224136853e-001}; -Point(2649) = {7.668011231103028e+000, 7.000000000000000e+000, 2.741785031162384e-001}; -Point(2650) = {7.663809671780161e+000, 7.000000000000000e+000, 2.742311838187915e-001}; -Point(2651) = {7.659608845458363e+000, 7.000000000000000e+000, 2.742418709181481e-001}; -Point(2652) = {7.655408019136566e+000, 7.000000000000000e+000, 2.742525580175046e-001}; -Point(2653) = {7.651207192814768e+000, 7.000000000000000e+000, 2.742632451168612e-001}; -Point(2654) = {7.647006366492970e+000, 7.000000000000000e+000, 2.742739322162178e-001}; -Point(2655) = {7.642806273172243e+000, 7.000000000000000e+000, 2.742426257123777e-001}; -Point(2656) = {7.638606179851516e+000, 7.000000000000000e+000, 2.742113192085377e-001}; -Point(2657) = {7.634406086530788e+000, 7.000000000000000e+000, 2.741800127046976e-001}; -Point(2658) = {7.630205993210062e+000, 7.000000000000000e+000, 2.741487062008576e-001}; -Point(2659) = {7.626006632890405e+000, 7.000000000000000e+000, 2.740754060938211e-001}; -Point(2660) = {7.621807272570748e+000, 7.000000000000000e+000, 2.740021059867844e-001}; -Point(2661) = {7.617607912251091e+000, 7.000000000000000e+000, 2.739288058797479e-001}; -Point(2662) = {7.613408551931434e+000, 7.000000000000000e+000, 2.738555057727112e-001}; -Point(2663) = {7.609209191611777e+000, 7.000000000000000e+000, 2.737822056656747e-001}; -Point(2664) = {7.605010564293191e+000, 7.000000000000000e+000, 2.736669119554415e-001}; -Point(2665) = {7.600811936974605e+000, 7.000000000000000e+000, 2.735516182452084e-001}; -Point(2666) = {7.596613309656018e+000, 7.000000000000000e+000, 2.734363245349752e-001}; -Point(2667) = {7.592414682337431e+000, 7.000000000000000e+000, 2.733210308247420e-001}; -Point(2668) = {7.588216055018845e+000, 7.000000000000000e+000, 2.732057371145089e-001}; -Point(2669) = {7.584018160701328e+000, 7.000000000000000e+000, 2.730484498010791e-001}; -Point(2670) = {7.579820266383813e+000, 7.000000000000000e+000, 2.728911624876494e-001}; -Point(2671) = {7.575622372066297e+000, 7.000000000000000e+000, 2.727338751742197e-001}; -Point(2672) = {7.571424477748781e+000, 7.000000000000000e+000, 2.725765878607900e-001}; -Point(2673) = {7.567227316432335e+000, 7.000000000000000e+000, 2.723773069441636e-001}; -Point(2674) = {7.563030155115889e+000, 7.000000000000000e+000, 2.721780260275374e-001}; -Point(2675) = {7.558832993799443e+000, 7.000000000000000e+000, 2.719787451109110e-001}; -Point(2676) = {7.554636565484068e+000, 7.000000000000000e+000, 2.717374705910882e-001}; -Point(2677) = {7.550440137168692e+000, 7.000000000000000e+000, 2.714961960712653e-001}; -Point(2678) = {7.546243708853317e+000, 7.000000000000000e+000, 2.712549215514425e-001}; -Point(2679) = {7.542048013539012e+000, 7.000000000000000e+000, 2.709716534284230e-001}; -Point(2680) = {7.537852318224707e+000, 7.000000000000000e+000, 2.706883853054036e-001}; -Point(2681) = {7.533657355911473e+000, 7.000000000000000e+000, 2.703631235791876e-001}; -Point(2682) = {7.529462393598237e+000, 7.000000000000000e+000, 2.700378618529716e-001}; -Point(2683) = {7.525267431285004e+000, 7.000000000000000e+000, 2.697126001267556e-001}; -Point(2684) = {7.521073201972839e+000, 7.000000000000000e+000, 2.693453447973431e-001}; -Point(2685) = {7.516878972660674e+000, 7.000000000000000e+000, 2.689780894679305e-001}; -Point(2686) = {7.512685476349581e+000, 7.000000000000000e+000, 2.685688405353214e-001}; -Point(2687) = {7.508491980038487e+000, 7.000000000000000e+000, 2.681595916027122e-001}; -Point(2688) = {7.504299216728463e+000, 7.000000000000000e+000, 2.677083490669064e-001}; -Point(2689) = {7.500107186419510e+000, 7.000000000000000e+000, 2.672151129279042e-001}; -Point(2690) = {7.495915156110557e+000, 7.000000000000000e+000, 2.667218767889019e-001}; -Point(2691) = {7.491723858802674e+000, 7.000000000000000e+000, 2.661866470467031e-001}; -Point(2692) = {7.487533294495862e+000, 7.000000000000000e+000, 2.656094237013077e-001}; -Point(2693) = {7.483344196191190e+000, 7.000000000000000e+000, 2.649482131495191e-001}; -Point(2694) = {7.479155830887589e+000, 7.000000000000000e+000, 2.642450089945340e-001}; -Point(2695) = {7.474968931586128e+000, 7.000000000000000e+000, 2.634578176331558e-001}; -Point(2696) = {7.470783498286808e+000, 7.000000000000000e+000, 2.625866390653844e-001}; -Point(2697) = {7.466600263990699e+000, 7.000000000000000e+000, 2.615894796880233e-001}; -Point(2698) = {7.462420694699942e+000, 7.000000000000000e+000, 2.603823522946793e-001}; -Point(2699) = {7.458246989417749e+000, 7.000000000000000e+000, 2.588392760757629e-001}; -Point(2700) = {7.454085745153750e+000, 7.000000000000000e+000, 2.565823086025048e-001}; -Point(2701) = {7.452014652035667e+000, 7.000000000000000e+000, 2.549079080243203e-001}; -Point(2702) = {7.450784163982584e+000, 7.000000000000000e+000, 2.532061738643465e-001}; -Point(2703) = {7.450000000000000e+000, 7.000000000000000e+000, 2.500000000000000e-001}; -Point(2704) = {7.450895580145279e+000, 7.000000000000000e+000, 2.468231461784681e-001}; -Point(2705) = {7.452184708283991e+000, 7.000000000000000e+000, 2.451653920827164e-001}; -Point(2706) = {7.454312975485564e+000, 7.000000000000000e+000, 2.435642916115685e-001}; -Point(2707) = {7.458550451860880e+000, 7.000000000000000e+000, 2.414539243523836e-001}; -Point(2708) = {7.462775467217999e+000, 7.000000000000000e+000, 2.400574483475402e-001}; -Point(2709) = {7.466994618566556e+000, 7.000000000000000e+000, 2.389969211682694e-001}; -Point(2710) = {7.471210104909761e+000, 7.000000000000000e+000, 2.381463620049815e-001}; -Point(2711) = {7.475423392249755e+000, 7.000000000000000e+000, 2.374217836512833e-001}; -Point(2712) = {7.479635213587608e+000, 7.000000000000000e+000, 2.367811925039782e-001}; -Point(2713) = {7.483845568923320e+000, 7.000000000000000e+000, 2.362245885630663e-001}; -Point(2714) = {7.488055191257962e+000, 7.000000000000000e+000, 2.357099782253510e-001}; -Point(2715) = {7.492264080591534e+000, 7.000000000000000e+000, 2.352373614908322e-001}; -Point(2716) = {7.496472236924035e+000, 7.000000000000000e+000, 2.348067383595099e-001}; -Point(2717) = {7.500679660255466e+000, 7.000000000000000e+000, 2.344181088313843e-001}; -Point(2718) = {7.504886350585826e+000, 7.000000000000000e+000, 2.340714729064551e-001}; -Point(2719) = {7.509092307915116e+000, 7.000000000000000e+000, 2.337668305847227e-001}; -Point(2720) = {7.513298265244407e+000, 7.000000000000000e+000, 2.334621882629901e-001}; -Point(2721) = {7.517503489572627e+000, 7.000000000000000e+000, 2.331995395444542e-001}; -Point(2722) = {7.521707980899776e+000, 7.000000000000000e+000, 2.329788844291147e-001}; -Point(2723) = {7.525912472226925e+000, 7.000000000000000e+000, 2.327582293137754e-001}; -Point(2724) = {7.530116963554074e+000, 7.000000000000000e+000, 2.325375741984360e-001}; -Point(2725) = {7.534320721880153e+000, 7.000000000000000e+000, 2.323589126862932e-001}; -Point(2726) = {7.538523747205162e+000, 7.000000000000000e+000, 2.322222447773469e-001}; -Point(2727) = {7.542726772530171e+000, 7.000000000000000e+000, 2.320855768684007e-001}; -Point(2728) = {7.546929797855180e+000, 7.000000000000000e+000, 2.319489089594544e-001}; -Point(2729) = {7.551132090179118e+000, 7.000000000000000e+000, 2.318542346537047e-001}; -Point(2730) = {7.555334382503056e+000, 7.000000000000000e+000, 2.317595603479551e-001}; -Point(2731) = {7.559535941825924e+000, 7.000000000000000e+000, 2.317068796454019e-001}; -Point(2732) = {7.563737501148792e+000, 7.000000000000000e+000, 2.316541989428489e-001}; -Point(2733) = {7.567939060471661e+000, 7.000000000000000e+000, 2.316015182402957e-001}; -Point(2734) = {7.572139886793458e+000, 7.000000000000000e+000, 2.315908311409392e-001}; -Point(2735) = {7.576340713115255e+000, 7.000000000000000e+000, 2.315801440415827e-001}; -Point(2736) = {7.580541539437053e+000, 7.000000000000000e+000, 2.315694569422261e-001}; -Point(2737) = {7.584741632757780e+000, 7.000000000000000e+000, 2.316007634460661e-001}; -Point(2738) = {7.588941726078508e+000, 7.000000000000000e+000, 2.316320699499062e-001}; -Point(2739) = {7.593141819399234e+000, 7.000000000000000e+000, 2.316633764537461e-001}; -Point(2740) = {7.597341912719962e+000, 7.000000000000000e+000, 2.316946829575862e-001}; -Point(2741) = {7.601541273039619e+000, 7.000000000000000e+000, 2.317679830646228e-001}; -Point(2742) = {7.605740633359275e+000, 7.000000000000000e+000, 2.318412831716593e-001}; -Point(2743) = {7.609939993678932e+000, 7.000000000000000e+000, 2.319145832786960e-001}; -Point(2744) = {7.614138620997519e+000, 7.000000000000000e+000, 2.320298769889291e-001}; -Point(2745) = {7.618337248316105e+000, 7.000000000000000e+000, 2.321451706991623e-001}; -Point(2746) = {7.622535875634691e+000, 7.000000000000000e+000, 2.322604644093954e-001}; -Point(2747) = {7.626733769952208e+000, 7.000000000000000e+000, 2.324177517228252e-001}; -Point(2748) = {7.630931664269724e+000, 7.000000000000000e+000, 2.325750390362549e-001}; -Point(2749) = {7.635129558587240e+000, 7.000000000000000e+000, 2.327323263496846e-001}; -Point(2750) = {7.639326719903686e+000, 7.000000000000000e+000, 2.329316072663109e-001}; -Point(2751) = {7.643523881220132e+000, 7.000000000000000e+000, 2.331308881829372e-001}; -Point(2752) = {7.647720309535506e+000, 7.000000000000000e+000, 2.333721627027601e-001}; -Point(2753) = {7.651916737850883e+000, 7.000000000000000e+000, 2.336134372225829e-001}; -Point(2754) = {7.656113166166257e+000, 7.000000000000000e+000, 2.338547117424058e-001}; -Point(2755) = {7.660308861480562e+000, 7.000000000000000e+000, 2.341379798654252e-001}; -Point(2756) = {7.664504556794867e+000, 7.000000000000000e+000, 2.344212479884447e-001}; -Point(2757) = {7.668699519108102e+000, 7.000000000000000e+000, 2.347465097146606e-001}; -Point(2758) = {7.672893748420266e+000, 7.000000000000000e+000, 2.351137650440732e-001}; -Point(2759) = {7.677087977732430e+000, 7.000000000000000e+000, 2.354810203734858e-001}; -Point(2760) = {7.681281474043525e+000, 7.000000000000000e+000, 2.358902693060949e-001}; -Point(2761) = {7.685474237353548e+000, 7.000000000000000e+000, 2.363415118419007e-001}; -Point(2762) = {7.689666267662501e+000, 7.000000000000000e+000, 2.368347479809029e-001}; -Point(2763) = {7.693857564970385e+000, 7.000000000000000e+000, 2.373699777231018e-001}; -Point(2764) = {7.698048129277197e+000, 7.000000000000000e+000, 2.379472010684972e-001}; -Point(2765) = {7.702238693584009e+000, 7.000000000000000e+000, 2.385244244138925e-001}; -Point(2766) = {7.706428524889751e+000, 7.000000000000000e+000, 2.391436413624846e-001}; -Point(2767) = {7.710618356195493e+000, 7.000000000000000e+000, 2.397628583110766e-001}; -Point(2768) = {7.714807454500165e+000, 7.000000000000000e+000, 2.404240688628651e-001}; -Point(2769) = {7.718996552804837e+000, 7.000000000000000e+000, 2.410852794146536e-001}; -Point(2770) = {7.723184918108438e+000, 7.000000000000000e+000, 2.417884835696388e-001}; -Point(2771) = {7.727373283412040e+000, 7.000000000000000e+000, 2.424916877246239e-001}; -Point(2772) = {7.731560915714571e+000, 7.000000000000000e+000, 2.432368854828055e-001}; -Point(2773) = {7.735748548017101e+000, 7.000000000000000e+000, 2.439820832409873e-001}; -Point(2774) = {7.739936180319632e+000, 7.000000000000000e+000, 2.447272809991690e-001}; -Point(2775) = {7.744123812622163e+000, 7.000000000000000e+000, 2.454724787573506e-001}; -Point(2776) = {7.748311444924694e+000, 7.000000000000000e+000, 2.462176765155323e-001}; -Point(2777) = {7.752499077227226e+000, 7.000000000000000e+000, 2.469628742737140e-001}; -Point(2778) = {7.756686709529756e+000, 7.000000000000000e+000, 2.477080720318957e-001}; -Point(2779) = {7.760874341832287e+000, 7.000000000000000e+000, 2.484532697900773e-001}; -Point(2780) = {7.765061974134818e+000, 7.000000000000000e+000, 2.491984675482590e-001}; -Point(2781) = {7.769249606437350e+000, 7.000000000000000e+000, 2.499436653064407e-001}; -Point(2782) = {7.773437238739881e+000, 7.000000000000000e+000, 2.506888630646225e-001}; -Point(2783) = {7.777624871042411e+000, 7.000000000000000e+000, 2.514340608228041e-001}; -Point(2784) = {7.781813236346013e+000, 7.000000000000000e+000, 2.521372649777892e-001}; -Point(2785) = {7.786001601649614e+000, 7.000000000000000e+000, 2.528404691327744e-001}; -Point(2786) = {7.790190699954286e+000, 7.000000000000000e+000, 2.535016796845628e-001}; -Point(2787) = {7.794379798258957e+000, 7.000000000000000e+000, 2.541628902363514e-001}; -Point(2788) = {7.798569629564700e+000, 7.000000000000000e+000, 2.547821071849434e-001}; -Point(2789) = {7.802759460870441e+000, 7.000000000000000e+000, 2.554013241335355e-001}; -Point(2790) = {7.806950025177255e+000, 7.000000000000000e+000, 2.559785474789308e-001}; -Point(2791) = {7.811141322485137e+000, 7.000000000000000e+000, 2.565137772211297e-001}; -Point(2792) = {7.815333352794090e+000, 7.000000000000000e+000, 2.570070133601319e-001}; -Point(2793) = {7.819526116104114e+000, 7.000000000000000e+000, 2.574582558959376e-001}; -Point(2794) = {7.823720345416279e+000, 7.000000000000000e+000, 2.578255112253503e-001}; -Point(2795) = {7.827915307729512e+000, 7.000000000000000e+000, 2.581507729515662e-001}; -Point(2796) = {7.832111736044888e+000, 7.000000000000000e+000, 2.583920474713891e-001}; -Point(2797) = {7.836309630362404e+000, 7.000000000000000e+000, 2.585493347848188e-001}; -Point(2798) = {7.840508668161590e+000, 7.000000000000000e+000, 2.586411120772619e-001}; -Point(2799) = {7.844708812792392e+000, 7.000000000000000e+000, 2.586694790288782e-001}; -Point(2800) = {7.848909683094254e+000, 7.000000000000000e+000, 2.586562723133298e-001}; -Point(2801) = {7.853111652897721e+000, 7.000000000000000e+000, 2.585800751929867e-001}; -Point(2802) = {7.857314355702259e+000, 7.000000000000000e+000, 2.584618844694469e-001}; -Point(2803) = {7.861518524508938e+000, 7.000000000000000e+000, 2.582597065395139e-001}; -Point(2804) = {7.865723800147232e+000, 7.000000000000000e+000, 2.579941182687542e-001}; - -Spline(2001) = {2001:2010}; -Spline(2002) = {2010:2098}; -Spline(2003) = {2098:2103}; -Spline(2004) = {2103:2108}; -Spline(2005) = {2108:2196}; -Spline(2006) = {2196:2204,2001}; -Spline(2011) = {2301:2310}; -Spline(2012) = {2310:2388}; -Spline(2013) = {2388:2403}; -Spline(2014) = {2403:2418}; -Spline(2015) = {2418:2496}; -Spline(2016) = {2496:2504,2301}; -Spline(2021) = {2601:2610}; -Spline(2022) = {2610:2678}; -Spline(2023) = {2678:2703}; -Spline(2024) = {2703:2728}; -Spline(2025) = {2728:2796}; -Spline(2026) = {2796:2804,2601}; -Line(2031) = {2001, 2301}; -Line(2032) = {2010, 2310}; -Line(2033) = {2098, 2388}; -Line(2034) = {2103, 2403}; -Line(2035) = {2108, 2418}; -Line(2036) = {2196, 2496}; -Line(2041) = {2301, 2601}; -Line(2042) = {2310, 2610}; -Line(2043) = {2388, 2678}; -Line(2044) = {2403, 2703}; -Line(2045) = {2418, 2728}; -Line(2046) = {2496, 2796}; - -/// Horizontal tail - -// Centerline -Point(3001) = {1.150000000000000e+001-0.3, 0.000000000000000e+000, 5.000000000000000e-001}; -Point(3002) = {1.145000000000000e+001-0.3, 0.000000000000000e+000, 5.043800000000001e-001}; -Point(3003) = {1.140000000000000e+001-0.3, 0.000000000000000e+000, 5.085800000000000e-001}; -Point(3004) = {1.135000000000000e+001-0.3, 0.000000000000000e+000, 5.127800000000000e-001}; -Point(3005) = {1.130000000000000e+001-0.3, 0.000000000000000e+000, 5.169800000000000e-001}; -Point(3006) = {1.125000000000000e+001-0.3, 0.000000000000000e+000, 5.211700000000000e-001}; -Point(3007) = {1.120000000000000e+001-0.3, 0.000000000000000e+000, 5.252100000000000e-001}; -Point(3008) = {1.115000000000000e+001-0.3, 0.000000000000000e+000, 5.289700000000001e-001}; -Point(3009) = {1.110000000000000e+001-0.3, 0.000000000000000e+000, 5.323400000000000e-001}; -Point(3010) = {1.105000000000000e+001-0.3, 0.000000000000000e+000, 5.352400000000001e-001}; -Point(3011) = {1.100000000000000e+001-0.3, 0.000000000000000e+000, 5.375700000000000e-001}; -Point(3012) = {1.095000000000000e+001-0.3, 0.000000000000000e+000, 5.392100000000000e-001}; -Point(3013) = {1.090000000000000e+001-0.3, 0.000000000000000e+000, 5.399800000000000e-001}; -Point(3014) = {1.085000000000000e+001-0.3, 0.000000000000000e+000, 5.397200000000000e-001}; -Point(3015) = {1.080000000000000e+001-0.3, 0.000000000000000e+000, 5.386600000000000e-001}; -Point(3016) = {1.075000000000000e+001-0.3, 0.000000000000000e+000, 5.368100000000000e-001}; -Point(3017) = {1.070000000000000e+001-0.3, 0.000000000000000e+000, 5.341400000000000e-001}; -Point(3018) = {1.065000000000000e+001-0.3, 0.000000000000000e+000, 5.304700000000000e-001}; -Point(3019) = {1.060000000000000e+001-0.3, 0.000000000000000e+000, 5.255900000000000e-001}; -Point(3020) = {1.057500000000000e+001-0.3, 0.000000000000000e+000, 5.224500000000000e-001}; -Point(3021) = {1.055000000000000e+001-0.3, 0.000000000000000e+000, 5.186300000000000e-001}; -Point(3022) = {1.052500000000000e+001-0.3, 0.000000000000000e+000, 5.135300000000000e-001}; -Point(3023) = {1.051250000000000e+001-0.3, 0.000000000000000e+000, 5.098300000000000e-001}; -Point(3024) = {1.050750000000000e+001-0.3, 0.000000000000000e+000, 5.077800000000000e-001}; -Point(3025) = {1.050500000000000e+001-0.3, 0.000000000000000e+000, 5.064600000000000e-001}; -Point(3026) = {1.050000000000000e+001-0.3, 0.000000000000000e+000, 5.000000000000000e-001}; -Point(3027) = {1.050500000000000e+001-0.3, 0.000000000000000e+000, 4.935400000000000e-001}; -Point(3028) = {1.050750000000000e+001-0.3, 0.000000000000000e+000, 4.922200000000000e-001}; -Point(3029) = {1.051250000000000e+001-0.3, 0.000000000000000e+000, 4.901700000000000e-001}; -Point(3030) = {1.052500000000000e+001-0.3, 0.000000000000000e+000, 4.864700000000000e-001}; -Point(3031) = {1.055000000000000e+001-0.3, 0.000000000000000e+000, 4.813700000000000e-001}; -Point(3032) = {1.057500000000000e+001-0.3, 0.000000000000000e+000, 4.775500000000000e-001}; -Point(3033) = {1.060000000000000e+001-0.3, 0.000000000000000e+000, 4.744100000000000e-001}; -Point(3034) = {1.065000000000000e+001-0.3, 0.000000000000000e+000, 4.695300000000000e-001}; -Point(3035) = {1.070000000000000e+001-0.3, 0.000000000000000e+000, 4.658600000000000e-001}; -Point(3036) = {1.075000000000000e+001-0.3, 0.000000000000000e+000, 4.631900000000000e-001}; -Point(3037) = {1.080000000000000e+001-0.3, 0.000000000000000e+000, 4.613400000000000e-001}; -Point(3038) = {1.085000000000000e+001-0.3, 0.000000000000000e+000, 4.602800000000000e-001}; -Point(3039) = {1.090000000000000e+001-0.3, 0.000000000000000e+000, 4.600200000000000e-001}; -Point(3040) = {1.095000000000000e+001-0.3, 0.000000000000000e+000, 4.607900000000000e-001}; -Point(3041) = {1.100000000000000e+001-0.3, 0.000000000000000e+000, 4.624300000000000e-001}; -Point(3042) = {1.105000000000000e+001-0.3, 0.000000000000000e+000, 4.647600000000000e-001}; -Point(3043) = {1.110000000000000e+001-0.3, 0.000000000000000e+000, 4.676600000000000e-001}; -Point(3044) = {1.115000000000000e+001-0.3, 0.000000000000000e+000, 4.710300000000000e-001}; -Point(3045) = {1.120000000000000e+001-0.3, 0.000000000000000e+000, 4.747900000000000e-001}; -Point(3046) = {1.125000000000000e+001-0.3, 0.000000000000000e+000, 4.788300000000000e-001}; -Point(3047) = {1.130000000000000e+001-0.3, 0.000000000000000e+000, 4.830200000000000e-001}; -Point(3048) = {1.135000000000000e+001-0.3, 0.000000000000000e+000, 4.872200000000000e-001}; -Point(3049) = {1.140000000000000e+001-0.3, 0.000000000000000e+000, 4.914200000000000e-001}; -Point(3050) = {1.145000000000000e+001-0.3, 0.000000000000000e+000, 4.956200000000000e-001}; - -// Tip -Point(3101) = {1.178700000000000e+001-0.3, 2.300000000000000e+000, 8.000000000000000e-001}; -Point(3102) = {1.176450000000000e+001-0.3, 2.300000000000000e+000, 8.019710000000000e-001}; -Point(3103) = {1.174200000000000e+001-0.3, 2.300000000000000e+000, 8.038609999999999e-001}; -Point(3104) = {1.171950000000000e+001-0.3, 2.300000000000000e+000, 8.057510000000000e-001}; -Point(3105) = {1.169700000000000e+001-0.3, 2.300000000000000e+000, 8.076410000000001e-001}; -Point(3106) = {1.167450000000000e+001-0.3, 2.300000000000000e+000, 8.095265000000000e-001}; -Point(3107) = {1.165200000000000e+001-0.3, 2.300000000000000e+000, 8.113444999999999e-001}; -Point(3108) = {1.162950000000000e+001-0.3, 2.300000000000000e+000, 8.130364999999999e-001}; -Point(3109) = {1.160700000000000e+001-0.3, 2.300000000000000e+000, 8.145530000000000e-001}; -Point(3110) = {1.158450000000000e+001-0.3, 2.300000000000000e+000, 8.158580000000000e-001}; -Point(3111) = {1.156200000000000e+001-0.3, 2.300000000000000e+000, 8.169065000000000e-001}; -Point(3112) = {1.153950000000000e+001-0.3, 2.300000000000000e+000, 8.176445000000000e-001}; -Point(3113) = {1.151700000000000e+001-0.3, 2.300000000000000e+000, 8.179909999999999e-001}; -Point(3114) = {1.149450000000000e+001-0.3, 2.300000000000000e+000, 8.178740000000000e-001}; -Point(3115) = {1.147200000000000e+001-0.3, 2.300000000000000e+000, 8.173969999999999e-001}; -Point(3116) = {1.144950000000000e+001-0.3, 2.300000000000000e+000, 8.165644999999999e-001}; -Point(3117) = {1.142700000000000e+001-0.3, 2.300000000000000e+000, 8.153630000000001e-001}; -Point(3118) = {1.140450000000000e+001-0.3, 2.300000000000000e+000, 8.137114999999999e-001}; -Point(3119) = {1.138200000000000e+001-0.3, 2.300000000000000e+000, 8.115155000000001e-001}; -Point(3120) = {1.137075000000000e+001-0.3, 2.300000000000000e+000, 8.101025000000000e-001}; -Point(3121) = {1.135950000000000e+001-0.3, 2.300000000000000e+000, 8.083834999999999e-001}; -Point(3122) = {1.134825000000000e+001-0.3, 2.300000000000000e+000, 8.060885000000000e-001}; -Point(3123) = {1.134262500000000e+001-0.3, 2.300000000000000e+000, 8.044235000000000e-001}; -Point(3124) = {1.134037500000000e+001-0.3, 2.300000000000000e+000, 8.035010000000000e-001}; -Point(3125) = {1.133925000000000e+001-0.3, 2.300000000000000e+000, 8.029070000000000e-001}; -Point(3126) = {1.133700000000000e+001-0.3, 2.300000000000000e+000, 8.000000000000000e-001}; -Point(3127) = {1.133925000000000e+001-0.3, 2.300000000000000e+000, 7.970930000000001e-001}; -Point(3128) = {1.134037500000000e+001-0.3, 2.300000000000000e+000, 7.964990000000001e-001}; -Point(3129) = {1.134262500000000e+001-0.3, 2.300000000000000e+000, 7.955764999999999e-001}; -Point(3130) = {1.134825000000000e+001-0.3, 2.300000000000000e+000, 7.939115000000000e-001}; -Point(3131) = {1.135950000000000e+001-0.3, 2.300000000000000e+000, 7.916165000000000e-001}; -Point(3132) = {1.137075000000000e+001-0.3, 2.300000000000000e+000, 7.898974999999999e-001}; -Point(3133) = {1.138200000000000e+001-0.3, 2.300000000000000e+000, 7.884845000000000e-001}; -Point(3134) = {1.140450000000000e+001-0.3, 2.300000000000000e+000, 7.862885000000000e-001}; -Point(3135) = {1.142700000000000e+001-0.3, 2.300000000000000e+000, 7.846370000000000e-001}; -Point(3136) = {1.144950000000000e+001-0.3, 2.300000000000000e+000, 7.834355000000000e-001}; -Point(3137) = {1.147200000000000e+001-0.3, 2.300000000000000e+000, 7.826029999999999e-001}; -Point(3138) = {1.149450000000000e+001-0.3, 2.300000000000000e+000, 7.821260000000000e-001}; -Point(3139) = {1.151700000000000e+001-0.3, 2.300000000000000e+000, 7.820090000000000e-001}; -Point(3140) = {1.153950000000000e+001-0.3, 2.300000000000000e+000, 7.823555000000000e-001}; -Point(3141) = {1.156200000000000e+001-0.3, 2.300000000000000e+000, 7.830935000000000e-001}; -Point(3142) = {1.158450000000000e+001-0.3, 2.300000000000000e+000, 7.841420000000000e-001}; -Point(3143) = {1.160700000000000e+001-0.3, 2.300000000000000e+000, 7.854470000000000e-001}; -Point(3144) = {1.162950000000000e+001-0.3, 2.300000000000000e+000, 7.869634999999999e-001}; -Point(3145) = {1.165200000000000e+001-0.3, 2.300000000000000e+000, 7.886555000000000e-001}; -Point(3146) = {1.167450000000000e+001-0.3, 2.300000000000000e+000, 7.904735000000001e-001}; -Point(3147) = {1.169700000000000e+001-0.3, 2.300000000000000e+000, 7.923590000000000e-001}; -Point(3148) = {1.171950000000000e+001-0.3, 2.300000000000000e+000, 7.942490000000000e-001}; -Point(3149) = {1.174200000000000e+001-0.3, 2.300000000000000e+000, 7.961389999999999e-001}; -Point(3150) = {1.176450000000000e+001-0.3, 2.300000000000000e+000, 7.980290000000000e-001}; - -Spline(3001) = {3001:3003}; -Spline(3002) = {3003:3014}; -Spline(3003) = {3014:3026}; -Spline(3004) = {3026:3038}; -Spline(3005) = {3038:3049}; -Spline(3006) = {3049:3050,3001}; -Spline(3011) = {3101:3103}; -Spline(3012) = {3103:3114}; -Spline(3013) = {3114:3126}; -Spline(3014) = {3126:3138}; -Spline(3015) = {3138:3149}; -Spline(3016) = {3149:3150,3101}; -Line(3021) = {3001, 3101}; -Line(3022) = {3003, 3103}; -Line(3023) = {3014, 3114}; -Line(3024) = {3026, 3126}; -Line(3025) = {3038, 3138}; -Line(3026) = {3049, 3149}; - -/// Wake - -// Wing -Point(4001) = {25, 0, -2.26}; -Point(4002) = {25, 6.1, -0.66}; -Point(4003) = {25, 7, -0.41}; - -Line(4001) = {2001, 4001}; -Line(4002) = {2301, 4002}; -Line(4003) = {2601, 4003}; -Line(4004) = {4001, 4002}; -Line(4005) = {4002, 4003}; - -// Tail -Point(4011) = {25, 0, 0.5}; -Point(4012) = {25, 2.3, 0.8}; - -Line(4011) = {3001, 4011}; -Line(4012) = {3101, 4012}; -Line(4013) = {4011, 4012}; - -Coherence; - -/* Surfacing */ - -/// Domain -// Symmetry -Curve Loop(1) = {4, 1, 4018, 4019, 4020, 3}; -Curve Loop(2) = {1011, 1031, 1032, 1033, 1034, 1035, 1037, 1038, 1039, -4022, -4021, -1029, -1028, -4024, -4023, -1025, -1024, -1023, -1022, -1021}; -Plane Surface(1) = {1, 2}; - -// Downstream -Curve Loop(3) = {23, -12, -22, 4018, 4019, 4020}; -Plane Surface(2) = {3}; - -// Farfield -Curve Loop(4) = {4, 21, -14, -24}; -Plane Surface(3) = {4}; -Curve Loop(5) = {3, 24, -13, -23}; -Plane Surface(4) = {5}; -Curve Loop(6) = {1, 22, -11, -21}; -Plane Surface(5) = {6}; -Curve Loop(7) = {12, 13, 14, 11}; -Plane Surface(6) = {7}; - -// Fuselage -Curve Loop(11) = {1011, -4030, -4029}; -Plane Surface(11) = {11}; -Curve Loop(12) = {4030, 1031, -4032, -1041}; -Surface(12) = {12}; -Curve Loop(14) = {4032, 1032, -4034, -1042}; -Surface(13) = {14}; -Curve Loop(16) = {4034, 1033, -4036, -1043}; -Surface(14) = {16}; -Curve Loop(18) = {4036, 1034, -4038, -1044}; -Surface(15) = {18}; -Curve Loop(20) = {4038, 1035, -4040, -1045}; -Surface(16) = {20}; -Curve Loop(22) = {4040, 1037, -4042, -1047}; -Surface(17) = {22}; -Curve Loop(24) = {4042, 1038, -4015, -1048}; -Surface(18) = {24}; -Curve Loop(26) = {4015, 1039, -4017, -1049}; -Surface(19) = {26}; -Curve Loop(28) = {4029, 1041, -4031, -1021}; -Surface(20) = {28}; -Curve Loop(30) = {4031, 1042, -4033, -1022}; -Surface(21) = {30}; -Curve Loop(32) = {4033, 1043, -4035, -1023}; -Surface(22) = {32}; -Curve Loop(34) = {4035, 1044, -4037, -1024}; -Surface(23) = {34}; -Curve Loop(36) = {4037, 1045, -4039, -1025}; -Surface(24) = {36}; -Curve Loop(38) = {4039, 1047, -4041, -4024, -4023}; -Surface(25) = {38}; -Curve Loop(40) = {4041, 1048, -4014, -1028}; -Surface(26) = {40}; -Curve Loop(42) = {1049, -4016, -1029, 4014}; -Surface(27) = {42}; -Curve Loop(44) = {4022, -4017, -4016, 4021}; -Plane Surface(28) = {44}; - -// Wing -Curve Loop(46) = {2001, 2032, -2011, -2031}; -Surface(29) = {46}; -Curve Loop(48) = {2002, 2033, -2012, -2032}; -Surface(30) = {48}; -Curve Loop(50) = {2003, 2034, -2013, -2033}; -Surface(31) = {50}; -Curve Loop(52) = {2004, 2035, -2014, -2034}; -Surface(32) = {52}; -Curve Loop(54) = {2005, 2036, -2015, -2035}; -Surface(33) = {54}; -Curve Loop(56) = {2006, 2031, -2016, -2036}; -Surface(34) = {56}; -Curve Loop(58) = {2011, 2042, -2021, -2041}; -Surface(35) = {58}; -Curve Loop(60) = {2012, 2043, -2022, -2042}; -Surface(36) = {60}; -Curve Loop(62) = {2013, 2044, -2023, -2043}; -Surface(37) = {62}; -Curve Loop(64) = {2014, 2045, -2024, -2044}; -Surface(38) = {64}; -Curve Loop(66) = {2015, 2046, -2025, -2045}; -Surface(39) = {66}; -Curve Loop(68) = {2016, 2041, -2026, -2046}; -Surface(40) = {68}; -Curve Loop(70) = {2021, 2022, 2023, 2024, 2025, 2026}; -Plane Surface(41) = {70}; - -// Horizontal tail -Curve Loop(71) = {3001, 3022, -3011, -3021}; -Surface(42) = {71}; -Curve Loop(73) = {3002, 3023, -3012, -3022}; -Surface(43) = {73}; -Curve Loop(75) = {3003, 3024, -3013, -3023}; -Surface(44) = {75}; -Curve Loop(77) = {3004, 3025, -3014, -3024}; -Surface(45) = {77}; -Curve Loop(79) = {3005, 3026, -3015, -3025}; -Surface(46) = {79}; -Curve Loop(81) = {3006, 3021, -3016, -3026}; -Surface(47) = {81}; -Curve Loop(83) = {3011, 3012, 3013, 3014, 3015, 3016}; -Plane Surface(48) = {83}; - -// Wing wake -Curve Loop(84) = {4025, 4026, 4004, -4002, -2031}; -Surface(49) = {84}; -Curve Loop(86) = {4002, 4005, -4003, -2041}; -Surface(50) = {86}; - -// Tail wake -Curve Loop(88) = {4027, 4028, 4013, -4012, -3021}; -Surface(51) = {88}; - -/* Boolean */ - -// Wing -BooleanFragments{ Surface{29}; Surface{30}; Surface{31}; Surface{32}; Surface{33}; Surface{34}; Delete; }{ Surface{24}; Delete; } -Recursive Delete { - Surface{56}; Surface{54}; Surface{58}; Surface{52}; Surface{62}; Surface{60}; Surface{65}; -} - -// Tail -BooleanFragments{ Surface{47}; Surface{43}; Surface{44}; Surface{45}; Surface{46}; Surface{42}; Delete; }{ Surface{18}; Delete; } -Recursive Delete { - Surface{75}; Surface{67}; Surface{69}; Surface{71}; Surface{73}; Surface{65}; Surface{78}; -} - -// Wake -BooleanFragments{ Surface{49}; Delete; }{ Surface{64}; Surface{25}; Delete; } -Recursive Delete { - Surface{78}; -} -BooleanFragments{ Surface{51}; Delete; }{ Surface{77}; Surface{19}; Surface{28}; Surface{27}; Delete; } -Recursive Delete { - Surface{82}; -} - -// Clean duplicate TE -Delete { - Surface{63}; Surface{53}; Curve{4047}; -} -Delete { - Surface{76}; Surface{66}; Curve{4071}; -} -ll = newll; -Curve Loop(ll) = {4044, 4094, 2011, -4048}; -Surface(63) = {ll}; -ll = newll; -Curve Loop(ll) = {4094, -2016, -4064, 4066}; -Surface(53) = {ll}; -ll = newll; -Curve Loop(ll) = {4089, 4105, 3011, -4077}; -Surface(76) = {ll}; -ll = newll; -Curve Loop(ll) = {4069, 4105, -3016, -4072}; -Surface(66) = {ll}; - -// Remaining points -Recursive Delete { - Point{2002:2009}; Point{2011:2097}; Point{2099:2102}; Point{2104:2107}; Point{2109:2195}; Point{2197:2204}; -} -Recursive Delete { - Point{3002}; Point{3004:3013}; Point{3015:3025}; Point{3027:3037}; Point{3039:3048}; Point{3050}; -} - -/* Volume */ - -// Domain 1 -> 6 -// Fuselage 11 -> 26 -// Wing 53 -> 41 -// Tail 76 -> 48 -Geometry.OCCAutoFix = 0; // prevents gmsh with OCCA to duplicate some surfaces -Surface Loop(1) = {1,2,3,4,5,6,11,12,13,14,15,16,17,77,84,85,89,86,87,88,20,21,22,23,64,80,81,26,53,55,57,59,61,63,35,36,37,38,39,40,41,76,68,70,72,74,66,48}; -Volume(1) = {1}; - -/* Embedded */ - -Line{4096} In Surface{1}; -Line{4108} In Surface{1}; -Line{4095} In Surface{2}; -Line{4005} In Surface{2}; -Line{4107} In Surface{2}; -Surface{79} In Volume{1}; -Surface{50} In Volume{1}; -Surface{83} In Volume{1}; - -/* Heal surface normals */ -ReverseMesh Surface{1}; -ReverseMesh Surface{12, 15, 16, 17, 77, 85, 86, 88, 89, 87, 84, 20, 21, 22, 64, 80, 81, 26}; -ReverseMesh Surface{63, 55, 57, 35, 36, 37, 41}; -ReverseMesh Surface{76, 68, 70, 48}; - -/* Mesh size */ - -// Farfield -Characteristic Length {1, 2, 3, 4, 11, 12, 13, 14} = msFar; // Regular -Characteristic Length {4001, 4002, 4003, 4011, 4043} = msFar; // Embedded - -// Fuselage -Characteristic Length {1011, 1014, 1017, 1111, 1117, 4013, 4044} = msFusCaps; // Caps -Characteristic Length {1021, 1024, 1027, 1031, 1034, 1037, 1041, 1044, 1047, 1051, 1054, 1057, 1071, 1074, 1077, 1081, 1084, 1087, 1091, 1094, 1097} = msFus; // Regular -Characteristic Length {4042} = msFusCaps; // Embdeded caps -Characteristic Length {4038, 4014, 4040, 4041} = msFus; // Embedded - -// Wing -Characteristic Length {4015} = msTeW0; // TE -Characteristic Length {4016, 4025} = msTeW0 * grW0; // Aft -Characteristic Length {4018, 4023} = msLeW0; // Fwd -Characteristic Length {4020} = msLeW0; // LE -Characteristic Length {2301} = msTeW1; // TE -Characteristic Length {2310, 2496} = msTeW1 * grW1; // Aft -Characteristic Length {2388, 2418} = msLeW1; // Fwd -Characteristic Length {2403} = msLeW1; // LE -Characteristic Length {2601} = msTeW2; // TE -Characteristic Length {2610, 2796} = msTeW2 * grW2; // Aft -Characteristic Length {2678, 2728} = msLeW2; // Fwd -Characteristic Length {2703} = msLeW2; // LE - -// Tail -Characteristic Length {4027} = msTeT0; // TE -Characteristic Length {4030, 4028} = msTeT0 * grT0; // Aft -Characteristic Length {4031, 4036} = msLeT0 * grT0; // Fwd -Characteristic Length {4033} = msLeT0; // LE -Characteristic Length {3101} = msTeT1; // TE -Characteristic Length {3103, 3149} = msTeT1 * grT1; // Aft -Characteristic Length {3114, 3138} = msLeT1 * grT1; // Fwd -Characteristic Length {3126} = msLeT1; // LE - -/* Mesh Algorithm */ - -// 2D -Mesh.Algorithm = 5; - -// 3D -Mesh.Algorithm3D = 2; -Mesh.Optimize = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -/* Physical */ - -// Tips: -Physical Line("teTipW") = {4092,4091,4094,2041,4003}; -Physical Line("wakeTipW") = {4003}; -Physical Line("teTipT") = {4103,4102,4101,4100,4105,4106}; -Physical Line("wakeTipT") = {4106}; - -// Symmetry: -Physical Surface("symmetry") = {1}; - -// Downstream: -Physical Surface("downstream") = {2}; - -// Farfield: -Physical Surface("upstream") = {3}; -Physical Surface("farfield") = {4,5,6}; - -// Fuselage: -Physical Surface("fuselage") = {11,12,13,14,15,16,17,77,84,85,89,86,87,88,20,21,22,23,64,80,81,26}; - -// Wing: -Physical Surface("wing") = {63,55,57,35,36,37,41}; -Physical Surface("wing_") = {59,61,53,38,39,40}; - -Physical Surface("tail") = {76,68,70,48}; -Physical Surface("tail_") = {72,74,66}; - -// Wake: -Physical Surface("wakeW") = {79,50}; -Physical Surface("wakeT") = {83}; - -// Internal Field: -Physical Volume("field") = {1}; diff --git a/flow/models/wht.geo b/flow/models/wht.geo deleted file mode 100644 index 53a64ea4..00000000 --- a/flow/models/wht.geo +++ /dev/null @@ -1,1018 +0,0 @@ -/* Template Wing-horizontal-tail */ -/* Adrien Crovato */ -/* Uliege, 2018-2019 */ - -/* Parameters */ - -scl = 2; // scaling factor for lifting surfaces mesh size (testing purpose) -DefineConstant[ msLeW0 = { 0.0210*scl, Name "leading edge mesh size on 0th wing spanwise station" } ]; -DefineConstant[ msTeW0 = { 0.0210*scl, Name "trailing edge mesh size on 0th wing spanwise station" } ]; -DefineConstant[ grW0 = { 1.5, Name "growth ratio for 0th wing spanwise station" } ]; -DefineConstant[ msLeW1 = { 0.0090*scl, Name "leading edge mesh size on 1th wing spanwise station" } ]; -DefineConstant[ msTeW1 = { 0.0090*scl, Name "trailing edge mesh size on 1th wing spanwise station" } ]; -DefineConstant[ grW1 = { 1.5, Name "growth ratio for 1th wing spanwise station" } ]; -DefineConstant[ msLeW2 = { 0.0042*scl, Name "leading edge mesh size on 2th wing spanwise station" } ]; -DefineConstant[ msTeW2 = { 0.0060*scl, Name "trailing edge mesh size on 2th wing spanwise station" } ]; -DefineConstant[ grW2 = { 1.5, Name "growth ratio for 2th wing spanwise station" } ]; -DefineConstant[ msLeT0 = { 0.0089*scl, Name "leading edge mesh size on 0th tail spanwise station" } ]; -DefineConstant[ msTeT0 = { 0.0089*scl, Name "trailing edge mesh size on 0th tail spanwise station" } ]; -DefineConstant[ grT0 = { 1.5, Name "growth ratio for 0th tail spanwise station" } ]; -DefineConstant[ msLeT1 = { 0.0048*scl, Name "leading edge mesh size on 1th tail spanwise station" } ]; -DefineConstant[ msTeT1 = { 0.0048*scl, Name "trailing edge mesh size on 1th tail spanwise station" } ]; -DefineConstant[ grT1 = { 1.5, Name "growth ratio for 1th tail spanwise station" } ]; -DefineConstant[ msFar = { 5., Name "farfield mesh size" } ]; - -xOfst = 4.5; // wing LE offset -zOfst = 0.56; - -/* Splining */ - -// Domain -Point(1) = {-10, 0, -10}; -Point(2) = {17, 0, -10}; -Point(4001) = {17, 0, -1.39}; -Point(4011) = {17, 0, 1.06}; -Point(3) = {17, 0, 10}; -Point(4) = {-10, 0, 10}; -Point(11) = {-10, 15, -10}; -Point(12) = {17, 15, -10}; -Point(13) = {17, 15, 10}; -Point(14) = {-10, 15, 10}; - -Line(1) = {1,2}; -Line(2) = {2,4001}; -Line(3) = {4001,4011}; -Line(4) = {4011,3}; -Line(5) = {3,4}; -Line(6) = {4,1}; -Line(11) = {11,12}; -Line(12) = {12,13}; -Line(13) = {13,14}; -Line(14) = {14,11}; -Line(21) = {1,11}; -Line(22) = {2,12}; -Line(23) = {3,13}; -Line(24) = {4,14}; - -/// Wing - -// Centerline -Point(2001) = {6.699678367697018e+000-xOfst, 0.000000000000000e+000, -5.976254114367533e-001+0.56}; -Point(2002) = {6.677793794267236e+000-xOfst, 0.000000000000000e+000, -5.908206365663777e-001+0.56}; -Point(2003) = {6.655903423148036e+000-xOfst, 0.000000000000000e+000, -5.843480111003332e-001+0.56}; -Point(2004) = {6.634007331130006e+000-xOfst, 0.000000000000000e+000, -5.782031357087608e-001+0.56}; -Point(2005) = {6.612103560053143e+000-xOfst, 0.000000000000000e+000, -5.724981933030573e-001+0.56}; -Point(2006) = {6.590194029682156e+000-xOfst, 0.000000000000000e+000, -5.671232006367554e-001+0.56}; -Point(2007) = {6.568278740017044e+000-xOfst, 0.000000000000000e+000, -5.620781577098551e-001+0.56}; -Point(2008) = {6.546359572427223e+000-xOfst, 0.000000000000000e+000, -5.572552809408186e-001+0.56}; -Point(2009) = {6.524432764173863e+000-xOfst, 0.000000000000000e+000, -5.528701374927214e-001+0.56}; -Point(2010) = {6.502505226409914e+000-xOfst, 0.000000000000000e+000, -5.485267876782819e-001+0.56}; -Point(2011) = {6.480577688645965e+000-xOfst, 0.000000000000000e+000, -5.441834378638424e-001+0.56}; -Point(2012) = {6.458650150882017e+000-xOfst, 0.000000000000000e+000, -5.398400880494029e-001+0.56}; -Point(2013) = {6.436718773588652e+000-xOfst, 0.000000000000000e+000, -5.357167047278977e-001+0.56}; -Point(2014) = {6.414787396295286e+000-xOfst, 0.000000000000000e+000, -5.315933214063925e-001+0.56}; -Point(2015) = {6.392856019001921e+000-xOfst, 0.000000000000000e+000, -5.274699380848874e-001+0.56}; -Point(2016) = {6.370920802179139e+000-xOfst, 0.000000000000000e+000, -5.235665212563166e-001+0.56}; -Point(2017) = {6.348985585356358e+000-xOfst, 0.000000000000000e+000, -5.196631044277459e-001+0.56}; -Point(2018) = {6.327050368533577e+000-xOfst, 0.000000000000000e+000, -5.157596875991752e-001+0.56}; -Point(2019) = {6.305115151710796e+000-xOfst, 0.000000000000000e+000, -5.118562707706045e-001+0.56}; -Point(2020) = {6.283176095358598e+000-xOfst, 0.000000000000000e+000, -5.081728204349681e-001+0.56}; -Point(2021) = {6.261237039006400e+000-xOfst, 0.000000000000000e+000, -5.044893700993318e-001+0.56}; -Point(2022) = {6.239297982654202e+000-xOfst, 0.000000000000000e+000, -5.008059197636955e-001+0.56}; -Point(2023) = {6.217358926302005e+000-xOfst, 0.000000000000000e+000, -4.971224694280592e-001+0.56}; -Point(2024) = {6.195416030420391e+000-xOfst, 0.000000000000000e+000, -4.936589855853572e-001+0.56}; -Point(2025) = {6.173473134538778e+000-xOfst, 0.000000000000000e+000, -4.901955017426553e-001+0.56}; -Point(2026) = {6.151530238657164e+000-xOfst, 0.000000000000000e+000, -4.867320178999534e-001+0.56}; -Point(2027) = {6.129583503246134e+000-xOfst, 0.000000000000000e+000, -4.834885005501859e-001+0.56}; -Point(2028) = {6.107636767835103e+000-xOfst, 0.000000000000000e+000, -4.802449832004183e-001+0.56}; -Point(2029) = {6.085690032424074e+000-xOfst, 0.000000000000000e+000, -4.770014658506508e-001+0.56}; -Point(2030) = {6.063743297013044e+000-xOfst, 0.000000000000000e+000, -4.737579485008833e-001+0.56}; -Point(2031) = {6.041792722072597e+000-xOfst, 0.000000000000000e+000, -4.707343976440502e-001+0.56}; -Point(2032) = {6.019842147132152e+000-xOfst, 0.000000000000000e+000, -4.677108467872171e-001+0.56}; -Point(2033) = {5.997887732662290e+000-xOfst, 0.000000000000000e+000, -4.649072624233184e-001+0.56}; -Point(2034) = {5.975933318192427e+000-xOfst, 0.000000000000000e+000, -4.621036780594197e-001+0.56}; -Point(2035) = {5.953978903722565e+000-xOfst, 0.000000000000000e+000, -4.593000936955209e-001+0.56}; -Point(2036) = {5.932020649723286e+000-xOfst, 0.000000000000000e+000, -4.567164758245567e-001+0.56}; -Point(2037) = {5.910062395724007e+000-xOfst, 0.000000000000000e+000, -4.541328579535924e-001+0.56}; -Point(2038) = {5.888100302195312e+000-xOfst, 0.000000000000000e+000, -4.517692065755625e-001+0.56}; -Point(2039) = {5.866138208666618e+000-xOfst, 0.000000000000000e+000, -4.494055551975326e-001+0.56}; -Point(2040) = {5.844176115137923e+000-xOfst, 0.000000000000000e+000, -4.470419038195027e-001+0.56}; -Point(2041) = {5.822210182079812e+000-xOfst, 0.000000000000000e+000, -4.448982189344072e-001+0.56}; -Point(2042) = {5.800244249021700e+000-xOfst, 0.000000000000000e+000, -4.427545340493117e-001+0.56}; -Point(2043) = {5.778274476434174e+000-xOfst, 0.000000000000000e+000, -4.408308156571507e-001+0.56}; -Point(2044) = {5.756304703846647e+000-xOfst, 0.000000000000000e+000, -4.389070972649896e-001+0.56}; -Point(2045) = {5.734331091729703e+000-xOfst, 0.000000000000000e+000, -4.372033453657629e-001+0.56}; -Point(2046) = {5.712357479612760e+000-xOfst, 0.000000000000000e+000, -4.354995934665362e-001+0.56}; -Point(2047) = {5.690380027966400e+000-xOfst, 0.000000000000000e+000, -4.340158080602440e-001+0.56}; -Point(2048) = {5.668402576320041e+000-xOfst, 0.000000000000000e+000, -4.325320226539517e-001+0.56}; -Point(2049) = {5.646421285144265e+000-xOfst, 0.000000000000000e+000, -4.312682037405938e-001+0.56}; -Point(2050) = {5.624439993968489e+000-xOfst, 0.000000000000000e+000, -4.300043848272359e-001+0.56}; -Point(2051) = {5.602458702792713e+000-xOfst, 0.000000000000000e+000, -4.287405659138781e-001+0.56}; -Point(2052) = {5.580473572087521e+000-xOfst, 0.000000000000000e+000, -4.276967134934546e-001+0.56}; -Point(2053) = {5.558488441382329e+000-xOfst, 0.000000000000000e+000, -4.266528610730311e-001+0.56}; -Point(2054) = {5.536503310677137e+000-xOfst, 0.000000000000000e+000, -4.256090086526078e-001+0.56}; -Point(2055) = {5.514514340442529e+000-xOfst, 0.000000000000000e+000, -4.247851227251187e-001+0.56}; -Point(2056) = {5.492525370207921e+000-xOfst, 0.000000000000000e+000, -4.239612367976297e-001+0.56}; -Point(2057) = {5.470536399973312e+000-xOfst, 0.000000000000000e+000, -4.231373508701406e-001+0.56}; -Point(2058) = {5.448543590209288e+000-xOfst, 0.000000000000000e+000, -4.225334314355859e-001+0.56}; -Point(2059) = {5.426550780445264e+000-xOfst, 0.000000000000000e+000, -4.219295120010313e-001+0.56}; -Point(2060) = {5.404557970681239e+000-xOfst, 0.000000000000000e+000, -4.213255925664766e-001+0.56}; -Point(2061) = {5.382561321387799e+000-xOfst, 0.000000000000000e+000, -4.209416396248564e-001+0.56}; -Point(2062) = {5.360564672094358e+000-xOfst, 0.000000000000000e+000, -4.205576866832362e-001+0.56}; -Point(2063) = {5.338568022800917e+000-xOfst, 0.000000000000000e+000, -4.201737337416159e-001+0.56}; -Point(2064) = {5.316567533978061e+000-xOfst, 0.000000000000000e+000, -4.200097472929301e-001+0.56}; -Point(2065) = {5.294567045155204e+000-xOfst, 0.000000000000000e+000, -4.198457608442443e-001+0.56}; -Point(2066) = {5.272566556332347e+000-xOfst, 0.000000000000000e+000, -4.196817743955584e-001+0.56}; -Point(2067) = {5.250562227980074e+000-xOfst, 0.000000000000000e+000, -4.197377544398070e-001+0.56}; -Point(2068) = {5.228557899627801e+000-xOfst, 0.000000000000000e+000, -4.197937344840556e-001+0.56}; -Point(2069) = {5.206553571275528e+000-xOfst, 0.000000000000000e+000, -4.198497145283042e-001+0.56}; -Point(2070) = {5.184549242923255e+000-xOfst, 0.000000000000000e+000, -4.199056945725528e-001+0.56}; -Point(2071) = {5.162541075041566e+000-xOfst, 0.000000000000000e+000, -4.201816411097357e-001+0.56}; -Point(2072) = {5.140532907159876e+000-xOfst, 0.000000000000000e+000, -4.204575876469187e-001+0.56}; -Point(2073) = {5.118520899748771e+000-xOfst, 0.000000000000000e+000, -4.209535006770361e-001+0.56}; -Point(2074) = {5.096508892337665e+000-xOfst, 0.000000000000000e+000, -4.214494137071535e-001+0.56}; -Point(2075) = {5.074496884926560e+000-xOfst, 0.000000000000000e+000, -4.219453267372709e-001+0.56}; -Point(2076) = {5.052481037986039e+000-xOfst, 0.000000000000000e+000, -4.226612062603227e-001+0.56}; -Point(2077) = {5.030465191045517e+000-xOfst, 0.000000000000000e+000, -4.233770857833745e-001+0.56}; -Point(2078) = {5.008445504575579e+000-xOfst, 0.000000000000000e+000, -4.243129317993607e-001+0.56}; -Point(2079) = {4.986425818105642e+000-xOfst, 0.000000000000000e+000, -4.252487778153468e-001+0.56}; -Point(2080) = {4.964402292106287e+000-xOfst, 0.000000000000000e+000, -4.264045903242675e-001+0.56}; -Point(2081) = {4.942378766106933e+000-xOfst, 0.000000000000000e+000, -4.275604028331880e-001+0.56}; -Point(2082) = {4.920351400578163e+000-xOfst, 0.000000000000000e+000, -4.289361818350431e-001+0.56}; -Point(2083) = {4.898324035049392e+000-xOfst, 0.000000000000000e+000, -4.303119608368980e-001+0.56}; -Point(2084) = {4.876292829991206e+000-xOfst, 0.000000000000000e+000, -4.319077063316875e-001+0.56}; -Point(2085) = {4.854257785403604e+000-xOfst, 0.000000000000000e+000, -4.337234183194113e-001+0.56}; -Point(2086) = {4.832222740816001e+000-xOfst, 0.000000000000000e+000, -4.355391303071352e-001+0.56}; -Point(2087) = {4.810183856698982e+000-xOfst, 0.000000000000000e+000, -4.375748087877934e-001+0.56}; -Point(2088) = {4.788141133052547e+000-xOfst, 0.000000000000000e+000, -4.398304537613860e-001+0.56}; -Point(2089) = {4.766094569876696e+000-xOfst, 0.000000000000000e+000, -4.423060652279131e-001+0.56}; -Point(2090) = {4.744044167171428e+000-xOfst, 0.000000000000000e+000, -4.450016431873745e-001+0.56}; -Point(2091) = {4.721989924936745e+000-xOfst, 0.000000000000000e+000, -4.479171876397703e-001+0.56}; -Point(2092) = {4.699928003643229e+000-xOfst, 0.000000000000000e+000, -4.512726650780350e-001+0.56}; -Point(2093) = {4.677858403290880e+000-xOfst, 0.000000000000000e+000, -4.550680755021685e-001+0.56}; -Point(2094) = {4.655784963409116e+000-xOfst, 0.000000000000000e+000, -4.590834524192364e-001+0.56}; -Point(2095) = {4.633700004939103e+000-xOfst, 0.000000000000000e+000, -4.637587288151075e-001+0.56}; -Point(2096) = {4.611599688351424e+000-xOfst, 0.000000000000000e+000, -4.693138711827162e-001+0.56}; -Point(2097) = {4.589480174116665e+000-xOfst, 0.000000000000000e+000, -4.759688460149970e-001+0.56}; -Point(2098) = {4.567333783175993e+000-xOfst, 0.000000000000000e+000, -4.841635862978186e-001+0.56}; -Point(2099) = {4.545141317882326e+000-xOfst, 0.000000000000000e+000, -4.949979244958531e-001+0.56}; -Point(2100) = {4.522860543412087e+000-xOfst, 0.000000000000000e+000, -5.108914920313789e-001+0.56}; -Point(2101) = {4.511635686529810e+000-xOfst, 0.000000000000000e+000, -5.236775386436987e-001+0.56}; -Point(2102) = {4.504813999035638e+000-xOfst, 0.000000000000000e+000, -5.363204093514082e-001+0.56}; -Point(2103) = {4.500000000000000e+000-xOfst, 0.000000000000000e+000, -5.600000000000001e-001+0.56}; -Point(2104) = {4.503984660681739e+000-xOfst, 0.000000000000000e+000, -5.838331718252399e-001+0.56}; -Point(2105) = {4.510360962763631e+000-xOfst, 0.000000000000000e+000, -5.967064142979215e-001+0.56}; -Point(2106) = {4.521132755174795e+000-xOfst, 0.000000000000000e+000, -6.098764138518616e-001+0.56}; -Point(2107) = {4.542845279291437e+000-xOfst, 0.000000000000000e+000, -6.265378872706280e-001+0.56}; -Point(2108) = {4.564646112584651e+000-xOfst, 0.000000000000000e+000, -6.381401313519028e-001+0.56}; -Point(2109) = {4.586493020230860e+000-xOfst, 0.000000000000000e+000, -6.471027775179650e-001+0.56}; -Point(2110) = {4.608366804582982e+000-xOfst, 0.000000000000000e+000, -6.545256582334862e-001+0.56}; -Point(2111) = {4.630259786582185e+000-xOfst, 0.000000000000000e+000, -6.608487064843354e-001+0.56}; -Point(2112) = {4.652164287169637e+000-xOfst, 0.000000000000000e+000, -6.665118552563814e-001+0.56}; -Point(2113) = {4.674080306345338e+000-xOfst, 0.000000000000000e+000, -6.715151045496242e-001+0.56}; -Point(2114) = {4.696004004579870e+000-xOfst, 0.000000000000000e+000, -6.760784208569981e-001+0.56}; -Point(2115) = {4.717935381873235e+000-xOfst, 0.000000000000000e+000, -6.802018041785032e-001+0.56}; -Point(2116) = {4.739870598696016e+000-xOfst, 0.000000000000000e+000, -6.841052210070739e-001+0.56}; -Point(2117) = {4.761809655048214e+000-xOfst, 0.000000000000000e+000, -6.877886713427103e-001+0.56}; -Point(2118) = {4.783756390459244e+000-xOfst, 0.000000000000000e+000, -6.910321886924777e-001+0.56}; -Point(2119) = {4.805706965399690e+000-xOfst, 0.000000000000000e+000, -6.940557395493109e-001+0.56}; -Point(2120) = {4.827657540340137e+000-xOfst, 0.000000000000000e+000, -6.970792904061440e-001+0.56}; -Point(2121) = {4.849611954809999e+000-xOfst, 0.000000000000000e+000, -6.998828747700427e-001+0.56}; -Point(2122) = {4.871570208809278e+000-xOfst, 0.000000000000000e+000, -7.024664926410070e-001+0.56}; -Point(2123) = {4.893532302337972e+000-xOfst, 0.000000000000000e+000, -7.048301440190370e-001+0.56}; -Point(2124) = {4.915494395866667e+000-xOfst, 0.000000000000000e+000, -7.071937953970668e-001+0.56}; -Point(2125) = {4.937460328924778e+000-xOfst, 0.000000000000000e+000, -7.093374802821623e-001+0.56}; -Point(2126) = {4.959430101512306e+000-xOfst, 0.000000000000000e+000, -7.112611986743234e-001+0.56}; -Point(2127) = {4.981399874099832e+000-xOfst, 0.000000000000000e+000, -7.131849170664845e-001+0.56}; -Point(2128) = {5.003373486216776e+000-xOfst, 0.000000000000000e+000, -7.148886689657111e-001+0.56}; -Point(2129) = {5.025347098333719e+000-xOfst, 0.000000000000000e+000, -7.165924208649378e-001+0.56}; -Point(2130) = {5.047324549980079e+000-xOfst, 0.000000000000000e+000, -7.180762062712300e-001+0.56}; -Point(2131) = {5.069302001626438e+000-xOfst, 0.000000000000000e+000, -7.195599916775224e-001+0.56}; -Point(2132) = {5.091283292802214e+000-xOfst, 0.000000000000000e+000, -7.208238105908802e-001+0.56}; -Point(2133) = {5.113264583977990e+000-xOfst, 0.000000000000000e+000, -7.220876295042380e-001+0.56}; -Point(2134) = {5.135249714683182e+000-xOfst, 0.000000000000000e+000, -7.231314819246615e-001+0.56}; -Point(2135) = {5.157234845388373e+000-xOfst, 0.000000000000000e+000, -7.241753343450850e-001+0.56}; -Point(2136) = {5.179223815622982e+000-xOfst, 0.000000000000000e+000, -7.249992202725740e-001+0.56}; -Point(2137) = {5.201212785857591e+000-xOfst, 0.000000000000000e+000, -7.258231062000631e-001+0.56}; -Point(2138) = {5.223205595621614e+000-xOfst, 0.000000000000000e+000, -7.264270256346177e-001+0.56}; -Point(2139) = {5.245198405385639e+000-xOfst, 0.000000000000000e+000, -7.270309450691723e-001+0.56}; -Point(2140) = {5.267195054679080e+000-xOfst, 0.000000000000000e+000, -7.274148980107926e-001+0.56}; -Point(2141) = {5.289191703972520e+000-xOfst, 0.000000000000000e+000, -7.277988509524128e-001+0.56}; -Point(2142) = {5.311192192795377e+000-xOfst, 0.000000000000000e+000, -7.279628374010987e-001+0.56}; -Point(2143) = {5.333192681618234e+000-xOfst, 0.000000000000000e+000, -7.281268238497844e-001+0.56}; -Point(2144) = {5.355193170441090e+000-xOfst, 0.000000000000000e+000, -7.282908102984703e-001+0.56}; -Point(2145) = {5.377197498793364e+000-xOfst, 0.000000000000000e+000, -7.282348302542218e-001+0.56}; -Point(2146) = {5.399201827145637e+000-xOfst, 0.000000000000000e+000, -7.281788502099732e-001+0.56}; -Point(2147) = {5.421209995027326e+000-xOfst, 0.000000000000000e+000, -7.279029036727902e-001+0.56}; -Point(2148) = {5.443222002438431e+000-xOfst, 0.000000000000000e+000, -7.274069906426728e-001+0.56}; -Point(2149) = {5.465234009849537e+000-xOfst, 0.000000000000000e+000, -7.269110776125554e-001+0.56}; -Point(2150) = {5.487249856790059e+000-xOfst, 0.000000000000000e+000, -7.261951980895036e-001+0.56}; -Point(2151) = {5.509265703730581e+000-xOfst, 0.000000000000000e+000, -7.254793185664519e-001+0.56}; -Point(2152) = {5.531285390200518e+000-xOfst, 0.000000000000000e+000, -7.245434725504656e-001+0.56}; -Point(2153) = {5.553308916199872e+000-xOfst, 0.000000000000000e+000, -7.233876600415450e-001+0.56}; -Point(2154) = {5.575336281728642e+000-xOfst, 0.000000000000000e+000, -7.220118810396901e-001+0.56}; -Point(2155) = {5.597367486786829e+000-xOfst, 0.000000000000000e+000, -7.204161355449006e-001+0.56}; -Point(2156) = {5.619398691845015e+000-xOfst, 0.000000000000000e+000, -7.188203900501111e-001+0.56}; -Point(2157) = {5.641433736432617e+000-xOfst, 0.000000000000000e+000, -7.170046780623873e-001+0.56}; -Point(2158) = {5.663472620549637e+000-xOfst, 0.000000000000000e+000, -7.149689995817291e-001+0.56}; -Point(2159) = {5.685515344196071e+000-xOfst, 0.000000000000000e+000, -7.127133546081365e-001+0.56}; -Point(2160) = {5.707561907371924e+000-xOfst, 0.000000000000000e+000, -7.102377431416095e-001+0.56}; -Point(2161) = {5.729612310077190e+000-xOfst, 0.000000000000000e+000, -7.075421651821480e-001+0.56}; -Point(2162) = {5.751666552311874e+000-xOfst, 0.000000000000000e+000, -7.046266207297521e-001+0.56}; -Point(2163) = {5.773720794546557e+000-xOfst, 0.000000000000000e+000, -7.017110762773563e-001+0.56}; -Point(2164) = {5.795778876310657e+000-xOfst, 0.000000000000000e+000, -6.985755653320260e-001+0.56}; -Point(2165) = {5.817840797604173e+000-xOfst, 0.000000000000000e+000, -6.952200878937613e-001+0.56}; -Point(2166) = {5.839906558427106e+000-xOfst, 0.000000000000000e+000, -6.916446439625623e-001+0.56}; -Point(2167) = {5.861972319250038e+000-xOfst, 0.000000000000000e+000, -6.880692000313632e-001+0.56}; -Point(2168) = {5.884041919602386e+000-xOfst, 0.000000000000000e+000, -6.842737896072297e-001+0.56}; -Point(2169) = {5.906115359484151e+000-xOfst, 0.000000000000000e+000, -6.802584126901619e-001+0.56}; -Point(2170) = {5.928188799365916e+000-xOfst, 0.000000000000000e+000, -6.762430357730940e-001+0.56}; -Point(2171) = {5.950266078777097e+000-xOfst, 0.000000000000000e+000, -6.720076923630917e-001+0.56}; -Point(2172) = {5.972343358188278e+000-xOfst, 0.000000000000000e+000, -6.677723489530894e-001+0.56}; -Point(2173) = {5.994420637599458e+000-xOfst, 0.000000000000000e+000, -6.635370055430871e-001+0.56}; -Point(2174) = {6.016501756540055e+000-xOfst, 0.000000000000000e+000, -6.590816956401504e-001+0.56}; -Point(2175) = {6.038582875480652e+000-xOfst, 0.000000000000000e+000, -6.546263857372137e-001+0.56}; -Point(2176) = {6.060663994421249e+000-xOfst, 0.000000000000000e+000, -6.501710758342770e-001+0.56}; -Point(2177) = {6.082745113361846e+000-xOfst, 0.000000000000000e+000, -6.457157659313403e-001+0.56}; -Point(2178) = {6.104826232302443e+000-xOfst, 0.000000000000000e+000, -6.412604560284037e-001+0.56}; -Point(2179) = {6.126907351243041e+000-xOfst, 0.000000000000000e+000, -6.368051461254669e-001+0.56}; -Point(2180) = {6.148988470183638e+000-xOfst, 0.000000000000000e+000, -6.323498362225302e-001+0.56}; -Point(2181) = {6.171065749594819e+000-xOfst, 0.000000000000000e+000, -6.281144928125280e-001+0.56}; -Point(2182) = {6.193143029005999e+000-xOfst, 0.000000000000000e+000, -6.238791494025257e-001+0.56}; -Point(2183) = {6.215216468887764e+000-xOfst, 0.000000000000000e+000, -6.198637724854578e-001+0.56}; -Point(2184) = {6.237289908769529e+000-xOfst, 0.000000000000000e+000, -6.158483955683899e-001+0.56}; -Point(2185) = {6.259359509121877e+000-xOfst, 0.000000000000000e+000, -6.120529851442564e-001+0.56}; -Point(2186) = {6.281429109474226e+000-xOfst, 0.000000000000000e+000, -6.082575747201229e-001+0.56}; -Point(2187) = {6.303494870297158e+000-xOfst, 0.000000000000000e+000, -6.046821307889239e-001+0.56}; -Point(2188) = {6.325556791590674e+000-xOfst, 0.000000000000000e+000, -6.013266533506592e-001+0.56}; -Point(2189) = {6.347614873354774e+000-xOfst, 0.000000000000000e+000, -5.981911424053289e-001+0.56}; -Point(2190) = {6.369669115589457e+000-xOfst, 0.000000000000000e+000, -5.952755979529331e-001+0.56}; -Point(2191) = {6.391715678765308e+000-xOfst, 0.000000000000000e+000, -5.927999864864060e-001+0.56}; -Point(2192) = {6.413758402411744e+000-xOfst, 0.000000000000000e+000, -5.905443415128133e-001+0.56}; -Point(2193) = {6.435793446999346e+000-xOfst, 0.000000000000000e+000, -5.887286295250895e-001+0.56}; -Point(2194) = {6.457824652057533e+000-xOfst, 0.000000000000000e+000, -5.871328840303002e-001+0.56}; -Point(2195) = {6.479848178056887e+000-xOfst, 0.000000000000000e+000, -5.859770715213796e-001+0.56}; -Point(2196) = {6.501864024997408e+000-xOfst, 0.000000000000000e+000, -5.852611919983277e-001+0.56}; -Point(2197) = {6.523868353349682e+000-xOfst, 0.000000000000000e+000, -5.852052119540792e-001+0.56}; -Point(2198) = {6.545865732153711e+000-xOfst, 0.000000000000000e+000, -5.855473712620418e-001+0.56}; -Point(2199) = {6.567855431898908e+000-xOfst, 0.000000000000000e+000, -5.863294635558733e-001+0.56}; -Point(2200) = {6.589841253719396e+000-xOfst, 0.000000000000000e+000, -5.873337220075686e-001+0.56}; -Point(2201) = {6.611821354641053e+000-xOfst, 0.000000000000000e+000, -5.886657305337362e-001+0.56}; -Point(2202) = {6.633795696268585e+000-xOfst, 0.000000000000000e+000, -5.903276887993053e-001+0.56}; -Point(2203) = {6.655762320441991e+000-xOfst, 0.000000000000000e+000, -5.924317797156726e-001+0.56}; -Point(2204) = {6.677723223716567e+000-xOfst, 0.000000000000000e+000, -5.948636207065121e-001+0.56}; - -// Tip -Point(2301) = {7.599850359908118e+000-xOfst, 6.100000000000000e+000, 1.642705613406781e-002+0.56}; -Point(2302) = {7.590814913055090e+000-xOfst, 6.100000000000000e+000, 1.837926317383409e-002+0.56}; -Point(2303) = {7.581781822276931e+000-xOfst, 6.100000000000000e+000, 2.019649077475438e-002+0.56}; -Point(2304) = {7.572751103280808e+000-xOfst, 6.100000000000000e+000, 2.187783907390295e-002+0.56}; -Point(2305) = {7.563723510010677e+000-xOfst, 6.100000000000000e+000, 2.338011465084888e-002+0.56}; -Point(2306) = {7.554697487457125e+000-xOfst, 6.100000000000000e+000, 2.479240393523086e-002+0.56}; -Point(2307) = {7.545673820978443e+000-xOfst, 6.100000000000000e+000, 2.606971378076661e-002+0.56}; -Point(2308) = {7.536651740923506e+000-xOfst, 6.100000000000000e+000, 2.725613747081268e-002+0.56}; -Point(2309) = {7.527632001236272e+000-xOfst, 6.100000000000000e+000, 2.830848158493837e-002+0.56}; -Point(2310) = {7.518612952664332e+000-xOfst, 6.100000000000000e+000, 2.932123173033574e-002+0.56}; -Point(2311) = {7.509593904092393e+000-xOfst, 6.100000000000000e+000, 3.033398187573322e-002+0.56}; -Point(2312) = {7.500574855520454e+000-xOfst, 6.100000000000000e+000, 3.134673202113059e-002+0.56}; -Point(2313) = {7.491557377665094e+000-xOfst, 6.100000000000000e+000, 3.226949587396399e-002+0.56}; -Point(2314) = {7.482539899809734e+000-xOfst, 6.100000000000000e+000, 3.319225972679729e-002+0.56}; -Point(2315) = {7.473522421954375e+000-xOfst, 6.100000000000000e+000, 3.411502357963070e-002+0.56}; -Point(2316) = {7.464504944099015e+000-xOfst, 6.100000000000000e+000, 3.503778743246400e-002+0.56}; -Point(2317) = {7.455489036960234e+000-xOfst, 6.100000000000000e+000, 3.587056499273333e-002+0.56}; -Point(2318) = {7.446473129821454e+000-xOfst, 6.100000000000000e+000, 3.670334255300256e-002+0.56}; -Point(2319) = {7.437457222682673e+000-xOfst, 6.100000000000000e+000, 3.753612011327179e-002+0.56}; -Point(2320) = {7.428441315543893e+000-xOfst, 6.100000000000000e+000, 3.836889767354113e-002+0.56}; -Point(2321) = {7.419425408405113e+000-xOfst, 6.100000000000000e+000, 3.920167523381035e-002+0.56}; -Point(2322) = {7.410411071982912e+000-xOfst, 6.100000000000000e+000, 3.994446650151562e-002+0.56}; -Point(2323) = {7.401396735560711e+000-xOfst, 6.100000000000000e+000, 4.068725776922078e-002+0.56}; -Point(2324) = {7.392382399138509e+000-xOfst, 6.100000000000000e+000, 4.143004903692604e-002+0.56}; -Point(2325) = {7.383368062716309e+000-xOfst, 6.100000000000000e+000, 4.217284030463120e-002+0.56}; -Point(2326) = {7.374355297010687e+000-xOfst, 6.100000000000000e+000, 4.282564527977228e-002+0.56}; -Point(2327) = {7.365342531305065e+000-xOfst, 6.100000000000000e+000, 4.347845025491348e-002+0.56}; -Point(2328) = {7.356329765599443e+000-xOfst, 6.100000000000000e+000, 4.413125523005457e-002+0.56}; -Point(2329) = {7.347316999893821e+000-xOfst, 6.100000000000000e+000, 4.478406020519565e-002+0.56}; -Point(2330) = {7.338305804904779e+000-xOfst, 6.100000000000000e+000, 4.534687888777278e-002+0.56}; -Point(2331) = {7.329294609915737e+000-xOfst, 6.100000000000000e+000, 4.590969757034979e-002+0.56}; -Point(2332) = {7.320283414926695e+000-xOfst, 6.100000000000000e+000, 4.647251625292681e-002+0.56}; -Point(2333) = {7.311272219937652e+000-xOfst, 6.100000000000000e+000, 4.703533493550394e-002+0.56}; -Point(2334) = {7.302262595665189e+000-xOfst, 6.100000000000000e+000, 4.750816732551688e-002+0.56}; -Point(2335) = {7.293252971392726e+000-xOfst, 6.100000000000000e+000, 4.798099971552983e-002+0.56}; -Point(2336) = {7.284243347120263e+000-xOfst, 6.100000000000000e+000, 4.845383210554277e-002+0.56}; -Point(2337) = {7.275235293564379e+000-xOfst, 6.100000000000000e+000, 4.883667820299176e-002+0.56}; -Point(2338) = {7.266227240008496e+000-xOfst, 6.100000000000000e+000, 4.921952430044063e-002+0.56}; -Point(2339) = {7.257219186452613e+000-xOfst, 6.100000000000000e+000, 4.960237039788951e-002+0.56}; -Point(2340) = {7.248211132896728e+000-xOfst, 6.100000000000000e+000, 4.998521649533838e-002+0.56}; -Point(2341) = {7.239204650057424e+000-xOfst, 6.100000000000000e+000, 5.027807630022330e-002+0.56}; -Point(2342) = {7.230198167218120e+000-xOfst, 6.100000000000000e+000, 5.057093610510810e-002+0.56}; -Point(2343) = {7.221191684378816e+000-xOfst, 6.100000000000000e+000, 5.086379590999290e-002+0.56}; -Point(2344) = {7.212186772256091e+000-xOfst, 6.100000000000000e+000, 5.106666942231364e-002+0.56}; -Point(2345) = {7.203181860133366e+000-xOfst, 6.100000000000000e+000, 5.126954293463437e-002+0.56}; -Point(2346) = {7.194176948010641e+000-xOfst, 6.100000000000000e+000, 5.147241644695511e-002+0.56}; -Point(2347) = {7.185173606604495e+000-xOfst, 6.100000000000000e+000, 5.158530366671177e-002+0.56}; -Point(2348) = {7.176170265198349e+000-xOfst, 6.100000000000000e+000, 5.169819088646854e-002+0.56}; -Point(2349) = {7.167166923792204e+000-xOfst, 6.100000000000000e+000, 5.181107810622521e-002+0.56}; -Point(2350) = {7.158163582386059e+000-xOfst, 6.100000000000000e+000, 5.192396532598187e-002+0.56}; -Point(2351) = {7.149161811696493e+000-xOfst, 6.100000000000000e+000, 5.194686625317446e-002+0.56}; -Point(2352) = {7.140160041006926e+000-xOfst, 6.100000000000000e+000, 5.196976718036706e-002+0.56}; -Point(2353) = {7.131158270317360e+000-xOfst, 6.100000000000000e+000, 5.199266810755965e-002+0.56}; -Point(2354) = {7.122156499627794e+000-xOfst, 6.100000000000000e+000, 5.201556903475224e-002+0.56}; -Point(2355) = {7.113156299654807e+000-xOfst, 6.100000000000000e+000, 5.194848366938076e-002+0.56}; -Point(2356) = {7.104156099681820e+000-xOfst, 6.100000000000000e+000, 5.188139830400929e-002+0.56}; -Point(2357) = {7.095155899708833e+000-xOfst, 6.100000000000000e+000, 5.181431293863781e-002+0.56}; -Point(2358) = {7.086155699735846e+000-xOfst, 6.100000000000000e+000, 5.174722757326633e-002+0.56}; -Point(2359) = {7.077157070479439e+000-xOfst, 6.100000000000000e+000, 5.159015591533078e-002+0.56}; -Point(2360) = {7.068158441223031e+000-xOfst, 6.100000000000000e+000, 5.143308425739523e-002+0.56}; -Point(2361) = {7.059159811966623e+000-xOfst, 6.100000000000000e+000, 5.127601259945969e-002+0.56}; -Point(2362) = {7.050161182710216e+000-xOfst, 6.100000000000000e+000, 5.111894094152414e-002+0.56}; -Point(2363) = {7.041162553453808e+000-xOfst, 6.100000000000000e+000, 5.096186928358859e-002+0.56}; -Point(2364) = {7.032165494913980e+000-xOfst, 6.100000000000000e+000, 5.071481133308897e-002+0.56}; -Point(2365) = {7.023168436374152e+000-xOfst, 6.100000000000000e+000, 5.046775338258935e-002+0.56}; -Point(2366) = {7.014171377834324e+000-xOfst, 6.100000000000000e+000, 5.022069543208974e-002+0.56}; -Point(2367) = {7.005174319294495e+000-xOfst, 6.100000000000000e+000, 4.997363748159012e-002+0.56}; -Point(2368) = {6.996177260754667e+000-xOfst, 6.100000000000000e+000, 4.972657953109039e-002+0.56}; -Point(2369) = {6.987181772931418e+000-xOfst, 6.100000000000000e+000, 4.938953528802670e-002+0.56}; -Point(2370) = {6.978186285108170e+000-xOfst, 6.100000000000000e+000, 4.905249104496301e-002+0.56}; -Point(2371) = {6.969190797284921e+000-xOfst, 6.100000000000000e+000, 4.871544680189932e-002+0.56}; -Point(2372) = {6.960195309461672e+000-xOfst, 6.100000000000000e+000, 4.837840255883563e-002+0.56}; -Point(2373) = {6.951201392355003e+000-xOfst, 6.100000000000000e+000, 4.795137202320787e-002+0.56}; -Point(2374) = {6.942207475248333e+000-xOfst, 6.100000000000000e+000, 4.752434148758011e-002+0.56}; -Point(2375) = {6.933213558141664e+000-xOfst, 6.100000000000000e+000, 4.709731095195235e-002+0.56}; -Point(2376) = {6.924221211751574e+000-xOfst, 6.100000000000000e+000, 4.658029412376041e-002+0.56}; -Point(2377) = {6.915228865361484e+000-xOfst, 6.100000000000000e+000, 4.606327729556858e-002+0.56}; -Point(2378) = {6.906236518971394e+000-xOfst, 6.100000000000000e+000, 4.554626046737675e-002+0.56}; -Point(2379) = {6.897245743297883e+000-xOfst, 6.100000000000000e+000, 4.493925734662085e-002+0.56}; -Point(2380) = {6.888254967624372e+000-xOfst, 6.100000000000000e+000, 4.433225422586484e-002+0.56}; -Point(2381) = {6.879265762667441e+000-xOfst, 6.100000000000000e+000, 4.363526481254487e-002+0.56}; -Point(2382) = {6.870276557710509e+000-xOfst, 6.100000000000000e+000, 4.293827539922490e-002+0.56}; -Point(2383) = {6.861287352753578e+000-xOfst, 6.100000000000000e+000, 4.224128598590493e-002+0.56}; -Point(2384) = {6.852299718513226e+000-xOfst, 6.100000000000000e+000, 4.145431028002078e-002+0.56}; -Point(2385) = {6.843312084272874e+000-xOfst, 6.100000000000000e+000, 4.066733457413674e-002+0.56}; -Point(2386) = {6.834326020749101e+000-xOfst, 6.100000000000000e+000, 3.979037257568852e-002+0.56}; -Point(2387) = {6.825339957225328e+000-xOfst, 6.100000000000000e+000, 3.891341057724040e-002+0.56}; -Point(2388) = {6.816355464418136e+000-xOfst, 6.100000000000000e+000, 3.794646228622822e-002+0.56}; -Point(2389) = {6.807372542327521e+000-xOfst, 6.100000000000000e+000, 3.688952770265186e-002+0.56}; -Point(2390) = {6.798389620236907e+000-xOfst, 6.100000000000000e+000, 3.583259311907561e-002+0.56}; -Point(2391) = {6.789408268862873e+000-xOfst, 6.100000000000000e+000, 3.468567224293517e-002+0.56}; -Point(2392) = {6.780428488205417e+000-xOfst, 6.100000000000000e+000, 3.344876507423078e-002+0.56}; -Point(2393) = {6.771451848981121e+000-xOfst, 6.100000000000000e+000, 3.203188532039814e-002+0.56}; -Point(2394) = {6.762476780473404e+000-xOfst, 6.100000000000000e+000, 3.052501927400142e-002+0.56}; -Point(2395) = {6.753504853398845e+000-xOfst, 6.100000000000000e+000, 2.883818064247667e-002+0.56}; -Point(2396) = {6.744536067757446e+000-xOfst, 6.100000000000000e+000, 2.697136942582368e-002+0.56}; -Point(2397) = {6.735571994265784e+000-xOfst, 6.100000000000000e+000, 2.483459933147847e-002+0.56}; -Point(2398) = {6.726615774357018e+000-xOfst, 6.100000000000000e+000, 2.224789777431291e-002+0.56}; -Point(2399) = {6.717672120180889e+000-xOfst, 6.100000000000000e+000, 1.894130587663467e-002+0.56}; -Point(2400) = {6.708755168186608e+000-xOfst, 6.100000000000000e+000, 1.410494700536724e-002+0.56}; -Point(2401) = {6.704317111504999e+000-xOfst, 6.100000000000000e+000, 1.051694576640050e-002+0.56}; -Point(2402) = {6.701680351391251e+000-xOfst, 6.100000000000000e+000, 6.870372566456839e-003+0.56}; -Point(2403) = {6.700000000000000e+000-xOfst, 6.100000000000000e+000, 0.000000000000000e+000+0.56}; -Point(2404) = {6.701919100311313e+000-xOfst, 6.100000000000000e+000, -6.807543903282587e-003+0.56}; -Point(2405) = {6.704681517751409e+000-xOfst, 6.100000000000000e+000, -1.035987410846495e-002+0.56}; -Point(2406) = {6.709242090326208e+000-xOfst, 6.100000000000000e+000, -1.379080368949609e-002+0.56}; -Point(2407) = {6.718322396844742e+000-xOfst, 6.100000000000000e+000, -1.831301924489248e-002+0.56}; -Point(2408) = {6.727376001181427e+000-xOfst, 6.100000000000000e+000, -2.130546782669957e-002+0.56}; -Point(2409) = {6.736417039785478e+000-xOfst, 6.100000000000000e+000, -2.357802606799403e-002+0.56}; -Point(2410) = {6.745450224806630e+000-xOfst, 6.100000000000000e+000, -2.540065284646814e-002+0.56}; -Point(2411) = {6.754478697678046e+000-xOfst, 6.100000000000000e+000, -2.695332074724999e-002+0.56}; -Point(2412) = {6.763504029116302e+000-xOfst, 6.100000000000000e+000, -2.832601606290375e-002+0.56}; -Point(2413) = {6.772526219121399e+000-xOfst, 6.100000000000000e+000, -2.951873879342931e-002+0.56}; -Point(2414) = {6.781546838409918e+000-xOfst, 6.100000000000000e+000, -3.062147523139081e-002+0.56}; -Point(2415) = {6.790565886981858e+000-xOfst, 6.100000000000000e+000, -3.163422537678823e-002+0.56}; -Point(2416) = {6.799583364837218e+000-xOfst, 6.100000000000000e+000, -3.255698922962158e-002+0.56}; -Point(2417) = {6.808599271975998e+000-xOfst, 6.100000000000000e+000, -3.338976678989086e-002+0.56}; -Point(2418) = {6.817613608398199e+000-xOfst, 6.100000000000000e+000, -3.413255805759607e-002+0.56}; -Point(2419) = {6.826626374103821e+000-xOfst, 6.100000000000000e+000, -3.478536303273722e-002+0.56}; -Point(2420) = {6.835639139809443e+000-xOfst, 6.100000000000000e+000, -3.543816800787830e-002+0.56}; -Point(2421) = {6.844650334798485e+000-xOfst, 6.100000000000000e+000, -3.600098669045537e-002+0.56}; -Point(2422) = {6.853659959070948e+000-xOfst, 6.100000000000000e+000, -3.647381908046832e-002+0.56}; -Point(2423) = {6.862669583343411e+000-xOfst, 6.100000000000000e+000, -3.694665147048132e-002+0.56}; -Point(2424) = {6.871679207615873e+000-xOfst, 6.100000000000000e+000, -3.741948386049432e-002+0.56}; -Point(2425) = {6.880687261171758e+000-xOfst, 6.100000000000000e+000, -3.780232995794319e-002+0.56}; -Point(2426) = {6.889693744011062e+000-xOfst, 6.100000000000000e+000, -3.809518976282800e-002+0.56}; -Point(2427) = {6.898700226850366e+000-xOfst, 6.100000000000000e+000, -3.838804956771286e-002+0.56}; -Point(2428) = {6.907706709689670e+000-xOfst, 6.100000000000000e+000, -3.868090937259766e-002+0.56}; -Point(2429) = {6.916711621812395e+000-xOfst, 6.100000000000000e+000, -3.888378288491839e-002+0.56}; -Point(2430) = {6.925716533935120e+000-xOfst, 6.100000000000000e+000, -3.908665639723918e-002+0.56}; -Point(2431) = {6.934719875341266e+000-xOfst, 6.100000000000000e+000, -3.919954361699585e-002+0.56}; -Point(2432) = {6.943723216747411e+000-xOfst, 6.100000000000000e+000, -3.931243083675251e-002+0.56}; -Point(2433) = {6.952726558153557e+000-xOfst, 6.100000000000000e+000, -3.942531805650917e-002+0.56}; -Point(2434) = {6.961728328843123e+000-xOfst, 6.100000000000000e+000, -3.944821898370177e-002+0.56}; -Point(2435) = {6.970730099532689e+000-xOfst, 6.100000000000000e+000, -3.947111991089436e-002+0.56}; -Point(2436) = {6.979731870222256e+000-xOfst, 6.100000000000000e+000, -3.949402083808695e-002+0.56}; -Point(2437) = {6.988732070195242e+000-xOfst, 6.100000000000000e+000, -3.942693547271547e-002+0.56}; -Point(2438) = {6.997732270168229e+000-xOfst, 6.100000000000000e+000, -3.935985010734405e-002+0.56}; -Point(2439) = {7.006732470141216e+000-xOfst, 6.100000000000000e+000, -3.929276474197258e-002+0.56}; -Point(2440) = {7.015732670114203e+000-xOfst, 6.100000000000000e+000, -3.922567937660110e-002+0.56}; -Point(2441) = {7.024731299370611e+000-xOfst, 6.100000000000000e+000, -3.906860771866555e-002+0.56}; -Point(2442) = {7.033729928627018e+000-xOfst, 6.100000000000000e+000, -3.891153606073000e-002+0.56}; -Point(2443) = {7.042728557883425e+000-xOfst, 6.100000000000000e+000, -3.875446440279440e-002+0.56}; -Point(2444) = {7.051725616423254e+000-xOfst, 6.100000000000000e+000, -3.850740645229478e-002+0.56}; -Point(2445) = {7.060722674963082e+000-xOfst, 6.100000000000000e+000, -3.826034850179516e-002+0.56}; -Point(2446) = {7.069719733502910e+000-xOfst, 6.100000000000000e+000, -3.801329055129554e-002+0.56}; -Point(2447) = {7.078715221326159e+000-xOfst, 6.100000000000000e+000, -3.767624630823185e-002+0.56}; -Point(2448) = {7.087710709149408e+000-xOfst, 6.100000000000000e+000, -3.733920206516816e-002+0.56}; -Point(2449) = {7.096706196972656e+000-xOfst, 6.100000000000000e+000, -3.700215782210442e-002+0.56}; -Point(2450) = {7.105700114079326e+000-xOfst, 6.100000000000000e+000, -3.657512728647666e-002+0.56}; -Point(2451) = {7.114694031185996e+000-xOfst, 6.100000000000000e+000, -3.614809675084890e-002+0.56}; -Point(2452) = {7.123686377576085e+000-xOfst, 6.100000000000000e+000, -3.563107992265702e-002+0.56}; -Point(2453) = {7.132678723966176e+000-xOfst, 6.100000000000000e+000, -3.511406309446519e-002+0.56}; -Point(2454) = {7.141671070356265e+000-xOfst, 6.100000000000000e+000, -3.459704626627330e-002+0.56}; -Point(2455) = {7.150661846029776e+000-xOfst, 6.100000000000000e+000, -3.399004314551740e-002+0.56}; -Point(2456) = {7.159652621703287e+000-xOfst, 6.100000000000000e+000, -3.338304002476145e-002+0.56}; -Point(2457) = {7.168641826660219e+000-xOfst, 6.100000000000000e+000, -3.268605061144148e-002+0.56}; -Point(2458) = {7.177629460900571e+000-xOfst, 6.100000000000000e+000, -3.189907490555738e-002+0.56}; -Point(2459) = {7.186617095140923e+000-xOfst, 6.100000000000000e+000, -3.111209919967328e-002+0.56}; -Point(2460) = {7.195603158664696e+000-xOfst, 6.100000000000000e+000, -3.023513720122517e-002+0.56}; -Point(2461) = {7.204587651471889e+000-xOfst, 6.100000000000000e+000, -2.926818891021293e-002+0.56}; -Point(2462) = {7.213570573562503e+000-xOfst, 6.100000000000000e+000, -2.821125432663663e-002+0.56}; -Point(2463) = {7.222551924936537e+000-xOfst, 6.100000000000000e+000, -2.706433345049625e-002+0.56}; -Point(2464) = {7.231531705593993e+000-xOfst, 6.100000000000000e+000, -2.582742628179180e-002+0.56}; -Point(2465) = {7.240511486251448e+000-xOfst, 6.100000000000000e+000, -2.459051911308735e-002+0.56}; -Point(2466) = {7.249489696192324e+000-xOfst, 6.100000000000000e+000, -2.326362565181883e-002+0.56}; -Point(2467) = {7.258467906133200e+000-xOfst, 6.100000000000000e+000, -2.193673219055026e-002+0.56}; -Point(2468) = {7.267444545357496e+000-xOfst, 6.100000000000000e+000, -2.051985243671767e-002+0.56}; -Point(2469) = {7.276421184581793e+000-xOfst, 6.100000000000000e+000, -1.910297268288508e-002+0.56}; -Point(2470) = {7.285396253089510e+000-xOfst, 6.100000000000000e+000, -1.759610663648836e-002+0.56}; -Point(2471) = {7.294371321597227e+000-xOfst, 6.100000000000000e+000, -1.608924059009170e-002+0.56}; -Point(2472) = {7.303344819388365e+000-xOfst, 6.100000000000000e+000, -1.449238825113097e-002+0.56}; -Point(2473) = {7.312318317179503e+000-xOfst, 6.100000000000000e+000, -1.289553591217019e-002+0.56}; -Point(2474) = {7.321291814970641e+000-xOfst, 6.100000000000000e+000, -1.129868357320946e-002+0.56}; -Point(2475) = {7.330265312761778e+000-xOfst, 6.100000000000000e+000, -9.701831234248670e-003+0.56}; -Point(2476) = {7.339238810552916e+000-xOfst, 6.100000000000000e+000, -8.104978895287940e-003+0.56}; -Point(2477) = {7.348212308344055e+000-xOfst, 6.100000000000000e+000, -6.508126556327154e-003+0.56}; -Point(2478) = {7.357185806135192e+000-xOfst, 6.100000000000000e+000, -4.911274217366424e-003+0.56}; -Point(2479) = {7.366159303926330e+000-xOfst, 6.100000000000000e+000, -3.314421878405693e-003+0.56}; -Point(2480) = {7.375132801717468e+000-xOfst, 6.100000000000000e+000, -1.717569539444908e-003+0.56}; -Point(2481) = {7.384106299508606e+000-xOfst, 6.100000000000000e+000, -1.207172004841772e-004+0.56}; -Point(2482) = {7.393079797299743e+000-xOfst, 6.100000000000000e+000, 1.476135138476553e-003+0.56}; -Point(2483) = {7.402053295090881e+000-xOfst, 6.100000000000000e+000, 3.072987477437339e-003+0.56}; -Point(2484) = {7.411028363598598e+000-xOfst, 6.100000000000000e+000, 4.579853523834054e-003+0.56}; -Point(2485) = {7.420003432106316e+000-xOfst, 6.100000000000000e+000, 6.086719570230770e-003+0.56}; -Point(2486) = {7.428980071330612e+000-xOfst, 6.100000000000000e+000, 7.503599324063304e-003+0.56}; -Point(2487) = {7.437956710554909e+000-xOfst, 6.100000000000000e+000, 8.920479077895949e-003+0.56}; -Point(2488) = {7.446934920495784e+000-xOfst, 6.100000000000000e+000, 1.024737253916441e-002+0.56}; -Point(2489) = {7.455913130436660e+000-xOfst, 6.100000000000000e+000, 1.157426600043299e-002+0.56}; -Point(2490) = {7.464892911094116e+000-xOfst, 6.100000000000000e+000, 1.281117316913749e-002+0.56}; -Point(2491) = {7.473874262468151e+000-xOfst, 6.100000000000000e+000, 1.395809404527781e-002+0.56}; -Point(2492) = {7.482857184558764e+000-xOfst, 6.100000000000000e+000, 1.501502862885418e-002+0.56}; -Point(2493) = {7.491841677365958e+000-xOfst, 6.100000000000000e+000, 1.598197691986636e-002+0.56}; -Point(2494) = {7.500829311606310e+000-xOfst, 6.100000000000000e+000, 1.676895262575040e-002+0.56}; -Point(2495) = {7.509818516563241e+000-xOfst, 6.100000000000000e+000, 1.746594203907048e-002+0.56}; -Point(2496) = {7.518810862953331e+000-xOfst, 6.100000000000000e+000, 1.798295886726231e-002+0.56}; -Point(2497) = {7.527806350776580e+000-xOfst, 6.100000000000000e+000, 1.832000311032600e-002+0.56}; -Point(2498) = {7.536804288917693e+000-xOfst, 6.100000000000000e+000, 1.851666873698976e-002+0.56}; -Point(2499) = {7.545804598840840e+000-xOfst, 6.100000000000000e+000, 1.857745506188169e-002+0.56}; -Point(2500) = {7.554806463773401e+000-xOfst, 6.100000000000000e+000, 1.854915495713527e-002+0.56}; -Point(2501) = {7.563810684780831e+000-xOfst, 6.100000000000000e+000, 1.838587541354275e-002+0.56}; -Point(2502) = {7.572816476504841e+000-xOfst, 6.100000000000000e+000, 1.813260957738605e-002+0.56}; -Point(2503) = {7.581825409662009e+000-xOfst, 6.100000000000000e+000, 1.769937115610132e-002+0.56}; -Point(2504) = {7.590836714601212e+000-xOfst, 6.100000000000000e+000, 1.713025343304475e-002+0.56}; - -// Winglet -Point(2601) = {7.869930167957122e+000-xOfst, 7.000000000000000e+000, 2.576659595292317e-001+0.56}; -Point(2602) = {7.865713626092376e+000-xOfst, 7.000000000000000e+000, 2.585769894811226e-001+0.56}; -Point(2603) = {7.861498183729235e+000-xOfst, 7.000000000000000e+000, 2.594250290282187e-001+0.56}; -Point(2604) = {7.857283848197710e+000-xOfst, 7.000000000000000e+000, 2.602096582344881e-001+0.56}; -Point(2605) = {7.853070971338315e+000-xOfst, 7.000000000000000e+000, 2.609107201703962e-001+0.56}; -Point(2606) = {7.848858827479992e+000-xOfst, 7.000000000000000e+000, 2.615697885031078e-001+0.56}; -Point(2607) = {7.844647783123273e+000-xOfst, 7.000000000000000e+000, 2.621658664310245e-001+0.56}; -Point(2608) = {7.840437479097636e+000-xOfst, 7.000000000000000e+000, 2.627195308197126e-001+0.56}; -Point(2609) = {7.836228267243593e+000-xOfst, 7.000000000000000e+000, 2.632106247396379e-001+0.56}; -Point(2610) = {7.832019377910022e+000-xOfst, 7.000000000000000e+000, 2.636832414741567e-001+0.56}; -Point(2611) = {7.827810488576450e+000-xOfst, 7.000000000000000e+000, 2.641558582086755e-001+0.56}; -Point(2612) = {7.823601599242879e+000-xOfst, 7.000000000000000e+000, 2.646284749431943e-001+0.56}; -Point(2613) = {7.819393442910378e+000-xOfst, 7.000000000000000e+000, 2.650590980745166e-001+0.56}; -Point(2614) = {7.815185286577876e+000-xOfst, 7.000000000000000e+000, 2.654897212058387e-001+0.56}; -Point(2615) = {7.810977130245375e+000-xOfst, 7.000000000000000e+000, 2.659203443371609e-001+0.56}; -Point(2616) = {7.806768973912874e+000-xOfst, 7.000000000000000e+000, 2.663509674684832e-001+0.56}; -Point(2617) = {7.802561550581443e+000-xOfst, 7.000000000000000e+000, 2.667395969966089e-001+0.56}; -Point(2618) = {7.798354127250012e+000-xOfst, 7.000000000000000e+000, 2.671282265247346e-001+0.56}; -Point(2619) = {7.794146703918581e+000-xOfst, 7.000000000000000e+000, 2.675168560528602e-001+0.56}; -Point(2620) = {7.789939280587150e+000-xOfst, 7.000000000000000e+000, 2.679054855809858e-001+0.56}; -Point(2621) = {7.785731857255719e+000-xOfst, 7.000000000000000e+000, 2.682941151091115e-001+0.56}; -Point(2622) = {7.781525166925359e+000-xOfst, 7.000000000000000e+000, 2.686407510340406e-001+0.56}; -Point(2623) = {7.777318476594998e+000-xOfst, 7.000000000000000e+000, 2.689873869589697e-001+0.56}; -Point(2624) = {7.773111786264638e+000-xOfst, 7.000000000000000e+000, 2.693340228838989e-001+0.56}; -Point(2625) = {7.768905095934278e+000-xOfst, 7.000000000000000e+000, 2.696806588088279e-001+0.56}; -Point(2626) = {7.764699138604987e+000-xOfst, 7.000000000000000e+000, 2.699853011305604e-001+0.56}; -Point(2627) = {7.760493181275697e+000-xOfst, 7.000000000000000e+000, 2.702899434522930e-001+0.56}; -Point(2628) = {7.756287223946407e+000-xOfst, 7.000000000000000e+000, 2.705945857740255e-001+0.56}; -Point(2629) = {7.752081266617116e+000-xOfst, 7.000000000000000e+000, 2.708992280957580e-001+0.56}; -Point(2630) = {7.747876042288898e+000-xOfst, 7.000000000000000e+000, 2.711618768142939e-001+0.56}; -Point(2631) = {7.743670817960677e+000-xOfst, 7.000000000000000e+000, 2.714245255328299e-001+0.56}; -Point(2632) = {7.739465593632458e+000-xOfst, 7.000000000000000e+000, 2.716871742513659e-001+0.56}; -Point(2633) = {7.735260369304237e+000-xOfst, 7.000000000000000e+000, 2.719498229699018e-001+0.56}; -Point(2634) = {7.731055877977088e+000-xOfst, 7.000000000000000e+000, 2.721704780852412e-001+0.56}; -Point(2635) = {7.726851386649939e+000-xOfst, 7.000000000000000e+000, 2.723911332005806e-001+0.56}; -Point(2636) = {7.722646895322789e+000-xOfst, 7.000000000000000e+000, 2.726117883159200e-001+0.56}; -Point(2637) = {7.718443136996711e+000-xOfst, 7.000000000000000e+000, 2.727904498280628e-001+0.56}; -Point(2638) = {7.714239378670632e+000-xOfst, 7.000000000000000e+000, 2.729691113402056e-001+0.56}; -Point(2639) = {7.710035620344552e+000-xOfst, 7.000000000000000e+000, 2.731477728523485e-001+0.56}; -Point(2640) = {7.705831862018473e+000-xOfst, 7.000000000000000e+000, 2.733264343644912e-001+0.56}; -Point(2641) = {7.701628836693464e+000-xOfst, 7.000000000000000e+000, 2.734631022734375e-001+0.56}; -Point(2642) = {7.697425811368456e+000-xOfst, 7.000000000000000e+000, 2.735997701823838e-001+0.56}; -Point(2643) = {7.693222786043448e+000-xOfst, 7.000000000000000e+000, 2.737364380913300e-001+0.56}; -Point(2644) = {7.689020493719509e+000-xOfst, 7.000000000000000e+000, 2.738311123970797e-001+0.56}; -Point(2645) = {7.684818201395570e+000-xOfst, 7.000000000000000e+000, 2.739257867028294e-001+0.56}; -Point(2646) = {7.680615909071633e+000-xOfst, 7.000000000000000e+000, 2.740204610085790e-001+0.56}; -Point(2647) = {7.676414349748765e+000-xOfst, 7.000000000000000e+000, 2.740731417111322e-001+0.56}; -Point(2648) = {7.672212790425896e+000-xOfst, 7.000000000000000e+000, 2.741258224136853e-001+0.56}; -Point(2649) = {7.668011231103028e+000-xOfst, 7.000000000000000e+000, 2.741785031162384e-001+0.56}; -Point(2650) = {7.663809671780161e+000-xOfst, 7.000000000000000e+000, 2.742311838187915e-001+0.56}; -Point(2651) = {7.659608845458363e+000-xOfst, 7.000000000000000e+000, 2.742418709181481e-001+0.56}; -Point(2652) = {7.655408019136566e+000-xOfst, 7.000000000000000e+000, 2.742525580175046e-001+0.56}; -Point(2653) = {7.651207192814768e+000-xOfst, 7.000000000000000e+000, 2.742632451168612e-001+0.56}; -Point(2654) = {7.647006366492970e+000-xOfst, 7.000000000000000e+000, 2.742739322162178e-001+0.56}; -Point(2655) = {7.642806273172243e+000-xOfst, 7.000000000000000e+000, 2.742426257123777e-001+0.56}; -Point(2656) = {7.638606179851516e+000-xOfst, 7.000000000000000e+000, 2.742113192085377e-001+0.56}; -Point(2657) = {7.634406086530788e+000-xOfst, 7.000000000000000e+000, 2.741800127046976e-001+0.56}; -Point(2658) = {7.630205993210062e+000-xOfst, 7.000000000000000e+000, 2.741487062008576e-001+0.56}; -Point(2659) = {7.626006632890405e+000-xOfst, 7.000000000000000e+000, 2.740754060938211e-001+0.56}; -Point(2660) = {7.621807272570748e+000-xOfst, 7.000000000000000e+000, 2.740021059867844e-001+0.56}; -Point(2661) = {7.617607912251091e+000-xOfst, 7.000000000000000e+000, 2.739288058797479e-001+0.56}; -Point(2662) = {7.613408551931434e+000-xOfst, 7.000000000000000e+000, 2.738555057727112e-001+0.56}; -Point(2663) = {7.609209191611777e+000-xOfst, 7.000000000000000e+000, 2.737822056656747e-001+0.56}; -Point(2664) = {7.605010564293191e+000-xOfst, 7.000000000000000e+000, 2.736669119554415e-001+0.56}; -Point(2665) = {7.600811936974605e+000-xOfst, 7.000000000000000e+000, 2.735516182452084e-001+0.56}; -Point(2666) = {7.596613309656018e+000-xOfst, 7.000000000000000e+000, 2.734363245349752e-001+0.56}; -Point(2667) = {7.592414682337431e+000-xOfst, 7.000000000000000e+000, 2.733210308247420e-001+0.56}; -Point(2668) = {7.588216055018845e+000-xOfst, 7.000000000000000e+000, 2.732057371145089e-001+0.56}; -Point(2669) = {7.584018160701328e+000-xOfst, 7.000000000000000e+000, 2.730484498010791e-001+0.56}; -Point(2670) = {7.579820266383813e+000-xOfst, 7.000000000000000e+000, 2.728911624876494e-001+0.56}; -Point(2671) = {7.575622372066297e+000-xOfst, 7.000000000000000e+000, 2.727338751742197e-001+0.56}; -Point(2672) = {7.571424477748781e+000-xOfst, 7.000000000000000e+000, 2.725765878607900e-001+0.56}; -Point(2673) = {7.567227316432335e+000-xOfst, 7.000000000000000e+000, 2.723773069441636e-001+0.56}; -Point(2674) = {7.563030155115889e+000-xOfst, 7.000000000000000e+000, 2.721780260275374e-001+0.56}; -Point(2675) = {7.558832993799443e+000-xOfst, 7.000000000000000e+000, 2.719787451109110e-001+0.56}; -Point(2676) = {7.554636565484068e+000-xOfst, 7.000000000000000e+000, 2.717374705910882e-001+0.56}; -Point(2677) = {7.550440137168692e+000-xOfst, 7.000000000000000e+000, 2.714961960712653e-001+0.56}; -Point(2678) = {7.546243708853317e+000-xOfst, 7.000000000000000e+000, 2.712549215514425e-001+0.56}; -Point(2679) = {7.542048013539012e+000-xOfst, 7.000000000000000e+000, 2.709716534284230e-001+0.56}; -Point(2680) = {7.537852318224707e+000-xOfst, 7.000000000000000e+000, 2.706883853054036e-001+0.56}; -Point(2681) = {7.533657355911473e+000-xOfst, 7.000000000000000e+000, 2.703631235791876e-001+0.56}; -Point(2682) = {7.529462393598237e+000-xOfst, 7.000000000000000e+000, 2.700378618529716e-001+0.56}; -Point(2683) = {7.525267431285004e+000-xOfst, 7.000000000000000e+000, 2.697126001267556e-001+0.56}; -Point(2684) = {7.521073201972839e+000-xOfst, 7.000000000000000e+000, 2.693453447973431e-001+0.56}; -Point(2685) = {7.516878972660674e+000-xOfst, 7.000000000000000e+000, 2.689780894679305e-001+0.56}; -Point(2686) = {7.512685476349581e+000-xOfst, 7.000000000000000e+000, 2.685688405353214e-001+0.56}; -Point(2687) = {7.508491980038487e+000-xOfst, 7.000000000000000e+000, 2.681595916027122e-001+0.56}; -Point(2688) = {7.504299216728463e+000-xOfst, 7.000000000000000e+000, 2.677083490669064e-001+0.56}; -Point(2689) = {7.500107186419510e+000-xOfst, 7.000000000000000e+000, 2.672151129279042e-001+0.56}; -Point(2690) = {7.495915156110557e+000-xOfst, 7.000000000000000e+000, 2.667218767889019e-001+0.56}; -Point(2691) = {7.491723858802674e+000-xOfst, 7.000000000000000e+000, 2.661866470467031e-001+0.56}; -Point(2692) = {7.487533294495862e+000-xOfst, 7.000000000000000e+000, 2.656094237013077e-001+0.56}; -Point(2693) = {7.483344196191190e+000-xOfst, 7.000000000000000e+000, 2.649482131495191e-001+0.56}; -Point(2694) = {7.479155830887589e+000-xOfst, 7.000000000000000e+000, 2.642450089945340e-001+0.56}; -Point(2695) = {7.474968931586128e+000-xOfst, 7.000000000000000e+000, 2.634578176331558e-001+0.56}; -Point(2696) = {7.470783498286808e+000-xOfst, 7.000000000000000e+000, 2.625866390653844e-001+0.56}; -Point(2697) = {7.466600263990699e+000-xOfst, 7.000000000000000e+000, 2.615894796880233e-001+0.56}; -Point(2698) = {7.462420694699942e+000-xOfst, 7.000000000000000e+000, 2.603823522946793e-001+0.56}; -Point(2699) = {7.458246989417749e+000-xOfst, 7.000000000000000e+000, 2.588392760757629e-001+0.56}; -Point(2700) = {7.454085745153750e+000-xOfst, 7.000000000000000e+000, 2.565823086025048e-001+0.56}; -Point(2701) = {7.452014652035667e+000-xOfst, 7.000000000000000e+000, 2.549079080243203e-001+0.56}; -Point(2702) = {7.450784163982584e+000-xOfst, 7.000000000000000e+000, 2.532061738643465e-001+0.56}; -Point(2703) = {7.450000000000000e+000-xOfst, 7.000000000000000e+000, 2.500000000000000e-001+0.56}; -Point(2704) = {7.450895580145279e+000-xOfst, 7.000000000000000e+000, 2.468231461784681e-001+0.56}; -Point(2705) = {7.452184708283991e+000-xOfst, 7.000000000000000e+000, 2.451653920827164e-001+0.56}; -Point(2706) = {7.454312975485564e+000-xOfst, 7.000000000000000e+000, 2.435642916115685e-001+0.56}; -Point(2707) = {7.458550451860880e+000-xOfst, 7.000000000000000e+000, 2.414539243523836e-001+0.56}; -Point(2708) = {7.462775467217999e+000-xOfst, 7.000000000000000e+000, 2.400574483475402e-001+0.56}; -Point(2709) = {7.466994618566556e+000-xOfst, 7.000000000000000e+000, 2.389969211682694e-001+0.56}; -Point(2710) = {7.471210104909761e+000-xOfst, 7.000000000000000e+000, 2.381463620049815e-001+0.56}; -Point(2711) = {7.475423392249755e+000-xOfst, 7.000000000000000e+000, 2.374217836512833e-001+0.56}; -Point(2712) = {7.479635213587608e+000-xOfst, 7.000000000000000e+000, 2.367811925039782e-001+0.56}; -Point(2713) = {7.483845568923320e+000-xOfst, 7.000000000000000e+000, 2.362245885630663e-001+0.56}; -Point(2714) = {7.488055191257962e+000-xOfst, 7.000000000000000e+000, 2.357099782253510e-001+0.56}; -Point(2715) = {7.492264080591534e+000-xOfst, 7.000000000000000e+000, 2.352373614908322e-001+0.56}; -Point(2716) = {7.496472236924035e+000-xOfst, 7.000000000000000e+000, 2.348067383595099e-001+0.56}; -Point(2717) = {7.500679660255466e+000-xOfst, 7.000000000000000e+000, 2.344181088313843e-001+0.56}; -Point(2718) = {7.504886350585826e+000-xOfst, 7.000000000000000e+000, 2.340714729064551e-001+0.56}; -Point(2719) = {7.509092307915116e+000-xOfst, 7.000000000000000e+000, 2.337668305847227e-001+0.56}; -Point(2720) = {7.513298265244407e+000-xOfst, 7.000000000000000e+000, 2.334621882629901e-001+0.56}; -Point(2721) = {7.517503489572627e+000-xOfst, 7.000000000000000e+000, 2.331995395444542e-001+0.56}; -Point(2722) = {7.521707980899776e+000-xOfst, 7.000000000000000e+000, 2.329788844291147e-001+0.56}; -Point(2723) = {7.525912472226925e+000-xOfst, 7.000000000000000e+000, 2.327582293137754e-001+0.56}; -Point(2724) = {7.530116963554074e+000-xOfst, 7.000000000000000e+000, 2.325375741984360e-001+0.56}; -Point(2725) = {7.534320721880153e+000-xOfst, 7.000000000000000e+000, 2.323589126862932e-001+0.56}; -Point(2726) = {7.538523747205162e+000-xOfst, 7.000000000000000e+000, 2.322222447773469e-001+0.56}; -Point(2727) = {7.542726772530171e+000-xOfst, 7.000000000000000e+000, 2.320855768684007e-001+0.56}; -Point(2728) = {7.546929797855180e+000-xOfst, 7.000000000000000e+000, 2.319489089594544e-001+0.56}; -Point(2729) = {7.551132090179118e+000-xOfst, 7.000000000000000e+000, 2.318542346537047e-001+0.56}; -Point(2730) = {7.555334382503056e+000-xOfst, 7.000000000000000e+000, 2.317595603479551e-001+0.56}; -Point(2731) = {7.559535941825924e+000-xOfst, 7.000000000000000e+000, 2.317068796454019e-001+0.56}; -Point(2732) = {7.563737501148792e+000-xOfst, 7.000000000000000e+000, 2.316541989428489e-001+0.56}; -Point(2733) = {7.567939060471661e+000-xOfst, 7.000000000000000e+000, 2.316015182402957e-001+0.56}; -Point(2734) = {7.572139886793458e+000-xOfst, 7.000000000000000e+000, 2.315908311409392e-001+0.56}; -Point(2735) = {7.576340713115255e+000-xOfst, 7.000000000000000e+000, 2.315801440415827e-001+0.56}; -Point(2736) = {7.580541539437053e+000-xOfst, 7.000000000000000e+000, 2.315694569422261e-001+0.56}; -Point(2737) = {7.584741632757780e+000-xOfst, 7.000000000000000e+000, 2.316007634460661e-001+0.56}; -Point(2738) = {7.588941726078508e+000-xOfst, 7.000000000000000e+000, 2.316320699499062e-001+0.56}; -Point(2739) = {7.593141819399234e+000-xOfst, 7.000000000000000e+000, 2.316633764537461e-001+0.56}; -Point(2740) = {7.597341912719962e+000-xOfst, 7.000000000000000e+000, 2.316946829575862e-001+0.56}; -Point(2741) = {7.601541273039619e+000-xOfst, 7.000000000000000e+000, 2.317679830646228e-001+0.56}; -Point(2742) = {7.605740633359275e+000-xOfst, 7.000000000000000e+000, 2.318412831716593e-001+0.56}; -Point(2743) = {7.609939993678932e+000-xOfst, 7.000000000000000e+000, 2.319145832786960e-001+0.56}; -Point(2744) = {7.614138620997519e+000-xOfst, 7.000000000000000e+000, 2.320298769889291e-001+0.56}; -Point(2745) = {7.618337248316105e+000-xOfst, 7.000000000000000e+000, 2.321451706991623e-001+0.56}; -Point(2746) = {7.622535875634691e+000-xOfst, 7.000000000000000e+000, 2.322604644093954e-001+0.56}; -Point(2747) = {7.626733769952208e+000-xOfst, 7.000000000000000e+000, 2.324177517228252e-001+0.56}; -Point(2748) = {7.630931664269724e+000-xOfst, 7.000000000000000e+000, 2.325750390362549e-001+0.56}; -Point(2749) = {7.635129558587240e+000-xOfst, 7.000000000000000e+000, 2.327323263496846e-001+0.56}; -Point(2750) = {7.639326719903686e+000-xOfst, 7.000000000000000e+000, 2.329316072663109e-001+0.56}; -Point(2751) = {7.643523881220132e+000-xOfst, 7.000000000000000e+000, 2.331308881829372e-001+0.56}; -Point(2752) = {7.647720309535506e+000-xOfst, 7.000000000000000e+000, 2.333721627027601e-001+0.56}; -Point(2753) = {7.651916737850883e+000-xOfst, 7.000000000000000e+000, 2.336134372225829e-001+0.56}; -Point(2754) = {7.656113166166257e+000-xOfst, 7.000000000000000e+000, 2.338547117424058e-001+0.56}; -Point(2755) = {7.660308861480562e+000-xOfst, 7.000000000000000e+000, 2.341379798654252e-001+0.56}; -Point(2756) = {7.664504556794867e+000-xOfst, 7.000000000000000e+000, 2.344212479884447e-001+0.56}; -Point(2757) = {7.668699519108102e+000-xOfst, 7.000000000000000e+000, 2.347465097146606e-001+0.56}; -Point(2758) = {7.672893748420266e+000-xOfst, 7.000000000000000e+000, 2.351137650440732e-001+0.56}; -Point(2759) = {7.677087977732430e+000-xOfst, 7.000000000000000e+000, 2.354810203734858e-001+0.56}; -Point(2760) = {7.681281474043525e+000-xOfst, 7.000000000000000e+000, 2.358902693060949e-001+0.56}; -Point(2761) = {7.685474237353548e+000-xOfst, 7.000000000000000e+000, 2.363415118419007e-001+0.56}; -Point(2762) = {7.689666267662501e+000-xOfst, 7.000000000000000e+000, 2.368347479809029e-001+0.56}; -Point(2763) = {7.693857564970385e+000-xOfst, 7.000000000000000e+000, 2.373699777231018e-001+0.56}; -Point(2764) = {7.698048129277197e+000-xOfst, 7.000000000000000e+000, 2.379472010684972e-001+0.56}; -Point(2765) = {7.702238693584009e+000-xOfst, 7.000000000000000e+000, 2.385244244138925e-001+0.56}; -Point(2766) = {7.706428524889751e+000-xOfst, 7.000000000000000e+000, 2.391436413624846e-001+0.56}; -Point(2767) = {7.710618356195493e+000-xOfst, 7.000000000000000e+000, 2.397628583110766e-001+0.56}; -Point(2768) = {7.714807454500165e+000-xOfst, 7.000000000000000e+000, 2.404240688628651e-001+0.56}; -Point(2769) = {7.718996552804837e+000-xOfst, 7.000000000000000e+000, 2.410852794146536e-001+0.56}; -Point(2770) = {7.723184918108438e+000-xOfst, 7.000000000000000e+000, 2.417884835696388e-001+0.56}; -Point(2771) = {7.727373283412040e+000-xOfst, 7.000000000000000e+000, 2.424916877246239e-001+0.56}; -Point(2772) = {7.731560915714571e+000-xOfst, 7.000000000000000e+000, 2.432368854828055e-001+0.56}; -Point(2773) = {7.735748548017101e+000-xOfst, 7.000000000000000e+000, 2.439820832409873e-001+0.56}; -Point(2774) = {7.739936180319632e+000-xOfst, 7.000000000000000e+000, 2.447272809991690e-001+0.56}; -Point(2775) = {7.744123812622163e+000-xOfst, 7.000000000000000e+000, 2.454724787573506e-001+0.56}; -Point(2776) = {7.748311444924694e+000-xOfst, 7.000000000000000e+000, 2.462176765155323e-001+0.56}; -Point(2777) = {7.752499077227226e+000-xOfst, 7.000000000000000e+000, 2.469628742737140e-001+0.56}; -Point(2778) = {7.756686709529756e+000-xOfst, 7.000000000000000e+000, 2.477080720318957e-001+0.56}; -Point(2779) = {7.760874341832287e+000-xOfst, 7.000000000000000e+000, 2.484532697900773e-001+0.56}; -Point(2780) = {7.765061974134818e+000-xOfst, 7.000000000000000e+000, 2.491984675482590e-001+0.56}; -Point(2781) = {7.769249606437350e+000-xOfst, 7.000000000000000e+000, 2.499436653064407e-001+0.56}; -Point(2782) = {7.773437238739881e+000-xOfst, 7.000000000000000e+000, 2.506888630646225e-001+0.56}; -Point(2783) = {7.777624871042411e+000-xOfst, 7.000000000000000e+000, 2.514340608228041e-001+0.56}; -Point(2784) = {7.781813236346013e+000-xOfst, 7.000000000000000e+000, 2.521372649777892e-001+0.56}; -Point(2785) = {7.786001601649614e+000-xOfst, 7.000000000000000e+000, 2.528404691327744e-001+0.56}; -Point(2786) = {7.790190699954286e+000-xOfst, 7.000000000000000e+000, 2.535016796845628e-001+0.56}; -Point(2787) = {7.794379798258957e+000-xOfst, 7.000000000000000e+000, 2.541628902363514e-001+0.56}; -Point(2788) = {7.798569629564700e+000-xOfst, 7.000000000000000e+000, 2.547821071849434e-001+0.56}; -Point(2789) = {7.802759460870441e+000-xOfst, 7.000000000000000e+000, 2.554013241335355e-001+0.56}; -Point(2790) = {7.806950025177255e+000-xOfst, 7.000000000000000e+000, 2.559785474789308e-001+0.56}; -Point(2791) = {7.811141322485137e+000-xOfst, 7.000000000000000e+000, 2.565137772211297e-001+0.56}; -Point(2792) = {7.815333352794090e+000-xOfst, 7.000000000000000e+000, 2.570070133601319e-001+0.56}; -Point(2793) = {7.819526116104114e+000-xOfst, 7.000000000000000e+000, 2.574582558959376e-001+0.56}; -Point(2794) = {7.823720345416279e+000-xOfst, 7.000000000000000e+000, 2.578255112253503e-001+0.56}; -Point(2795) = {7.827915307729512e+000-xOfst, 7.000000000000000e+000, 2.581507729515662e-001+0.56}; -Point(2796) = {7.832111736044888e+000-xOfst, 7.000000000000000e+000, 2.583920474713891e-001+0.56}; -Point(2797) = {7.836309630362404e+000-xOfst, 7.000000000000000e+000, 2.585493347848188e-001+0.56}; -Point(2798) = {7.840508668161590e+000-xOfst, 7.000000000000000e+000, 2.586411120772619e-001+0.56}; -Point(2799) = {7.844708812792392e+000-xOfst, 7.000000000000000e+000, 2.586694790288782e-001+0.56}; -Point(2800) = {7.848909683094254e+000-xOfst, 7.000000000000000e+000, 2.586562723133298e-001+0.56}; -Point(2801) = {7.853111652897721e+000-xOfst, 7.000000000000000e+000, 2.585800751929867e-001+0.56}; -Point(2802) = {7.857314355702259e+000-xOfst, 7.000000000000000e+000, 2.584618844694469e-001+0.56}; -Point(2803) = {7.861518524508938e+000-xOfst, 7.000000000000000e+000, 2.582597065395139e-001+0.56}; -Point(2804) = {7.865723800147232e+000-xOfst, 7.000000000000000e+000, 2.579941182687542e-001+0.56}; - -Spline(2001) = {2001:2010}; -Spline(2002) = {2010:2078}; -Spline(2003) = {2078:2103}; -Spline(2004) = {2103:2128}; -Spline(2005) = {2128:2196}; -Spline(2006) = {2196:2204,2001}; -Spline(2011) = {2301:2310}; -Spline(2012) = {2310:2378}; -Spline(2013) = {2378:2403}; -Spline(2014) = {2403:2428}; -Spline(2015) = {2428:2496}; -Spline(2016) = {2496:2504,2301}; -Spline(2021) = {2601:2610}; -Spline(2022) = {2610:2678}; -Spline(2023) = {2678:2703}; -Spline(2024) = {2703:2728}; -Spline(2025) = {2728:2796}; -Spline(2026) = {2796:2804,2601}; -Line(2031) = {2001, 2301}; -Line(2032) = {2010, 2310}; -Line(2033) = {2078, 2378}; -Line(2034) = {2103, 2403}; -Line(2035) = {2128, 2428}; -Line(2036) = {2196, 2496}; -Line(2041) = {2301, 2601}; -Line(2042) = {2310, 2610}; -Line(2043) = {2378, 2678}; -Line(2044) = {2403, 2703}; -Line(2045) = {2428, 2728}; -Line(2046) = {2496, 2796}; - -/// Horizontal tail - -// Centerline -Point(3001) = {1.150000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.000000000000000e-001+0.56}; -Point(3002) = {1.145000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.043800000000001e-001+0.56}; -Point(3003) = {1.140000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.085800000000000e-001+0.56}; -Point(3004) = {1.135000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.127800000000000e-001+0.56}; -Point(3005) = {1.130000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.169800000000000e-001+0.56}; -Point(3006) = {1.125000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.211700000000000e-001+0.56}; -Point(3007) = {1.120000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.252100000000000e-001+0.56}; -Point(3008) = {1.115000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.289700000000001e-001+0.56}; -Point(3009) = {1.110000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.323400000000000e-001+0.56}; -Point(3010) = {1.105000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.352400000000001e-001+0.56}; -Point(3011) = {1.100000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.375700000000000e-001+0.56}; -Point(3012) = {1.095000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.392100000000000e-001+0.56}; -Point(3013) = {1.090000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.399800000000000e-001+0.56}; -Point(3014) = {1.085000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.397200000000000e-001+0.56}; -Point(3015) = {1.080000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.386600000000000e-001+0.56}; -Point(3016) = {1.075000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.368100000000000e-001+0.56}; -Point(3017) = {1.070000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.341400000000000e-001+0.56}; -Point(3018) = {1.065000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.304700000000000e-001+0.56}; -Point(3019) = {1.060000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.255900000000000e-001+0.56}; -Point(3020) = {1.057500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.224500000000000e-001+0.56}; -Point(3021) = {1.055000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.186300000000000e-001+0.56}; -Point(3022) = {1.052500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.135300000000000e-001+0.56}; -Point(3023) = {1.051250000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.098300000000000e-001+0.56}; -Point(3024) = {1.050750000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.077800000000000e-001+0.56}; -Point(3025) = {1.050500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.064600000000000e-001+0.56}; -Point(3026) = {1.050000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 5.000000000000000e-001+0.56}; -Point(3027) = {1.050500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.935400000000000e-001+0.56}; -Point(3028) = {1.050750000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.922200000000000e-001+0.56}; -Point(3029) = {1.051250000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.901700000000000e-001+0.56}; -Point(3030) = {1.052500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.864700000000000e-001+0.56}; -Point(3031) = {1.055000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.813700000000000e-001+0.56}; -Point(3032) = {1.057500000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.775500000000000e-001+0.56}; -Point(3033) = {1.060000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.744100000000000e-001+0.56}; -Point(3034) = {1.065000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.695300000000000e-001+0.56}; -Point(3035) = {1.070000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.658600000000000e-001+0.56}; -Point(3036) = {1.075000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.631900000000000e-001+0.56}; -Point(3037) = {1.080000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.613400000000000e-001+0.56}; -Point(3038) = {1.085000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.602800000000000e-001+0.56}; -Point(3039) = {1.090000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.600200000000000e-001+0.56}; -Point(3040) = {1.095000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.607900000000000e-001+0.56}; -Point(3041) = {1.100000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.624300000000000e-001+0.56}; -Point(3042) = {1.105000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.647600000000000e-001+0.56}; -Point(3043) = {1.110000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.676600000000000e-001+0.56}; -Point(3044) = {1.115000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.710300000000000e-001+0.56}; -Point(3045) = {1.120000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.747900000000000e-001+0.56}; -Point(3046) = {1.125000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.788300000000000e-001+0.56}; -Point(3047) = {1.130000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.830200000000000e-001+0.56}; -Point(3048) = {1.135000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.872200000000000e-001+0.56}; -Point(3049) = {1.140000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.914200000000000e-001+0.56}; -Point(3050) = {1.145000000000000e+001-0.3-xOfst, 0.000000000000000e+000, 4.956200000000000e-001+0.56}; - -// Tip -Point(3101) = {1.178700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.000000000000000e-001+0.56}; -Point(3102) = {1.176450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.019710000000000e-001+0.56}; -Point(3103) = {1.174200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.038609999999999e-001+0.56}; -Point(3104) = {1.171950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.057510000000000e-001+0.56}; -Point(3105) = {1.169700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.076410000000001e-001+0.56}; -Point(3106) = {1.167450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.095265000000000e-001+0.56}; -Point(3107) = {1.165200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.113444999999999e-001+0.56}; -Point(3108) = {1.162950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.130364999999999e-001+0.56}; -Point(3109) = {1.160700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.145530000000000e-001+0.56}; -Point(3110) = {1.158450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.158580000000000e-001+0.56}; -Point(3111) = {1.156200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.169065000000000e-001+0.56}; -Point(3112) = {1.153950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.176445000000000e-001+0.56}; -Point(3113) = {1.151700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.179909999999999e-001+0.56}; -Point(3114) = {1.149450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.178740000000000e-001+0.56}; -Point(3115) = {1.147200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.173969999999999e-001+0.56}; -Point(3116) = {1.144950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.165644999999999e-001+0.56}; -Point(3117) = {1.142700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.153630000000001e-001+0.56}; -Point(3118) = {1.140450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.137114999999999e-001+0.56}; -Point(3119) = {1.138200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.115155000000001e-001+0.56}; -Point(3120) = {1.137075000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.101025000000000e-001+0.56}; -Point(3121) = {1.135950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.083834999999999e-001+0.56}; -Point(3122) = {1.134825000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.060885000000000e-001+0.56}; -Point(3123) = {1.134262500000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.044235000000000e-001+0.56}; -Point(3124) = {1.134037500000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.035010000000000e-001+0.56}; -Point(3125) = {1.133925000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.029070000000000e-001+0.56}; -Point(3126) = {1.133700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 8.000000000000000e-001+0.56}; -Point(3127) = {1.133925000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.970930000000001e-001+0.56}; -Point(3128) = {1.134037500000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.964990000000001e-001+0.56}; -Point(3129) = {1.134262500000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.955764999999999e-001+0.56}; -Point(3130) = {1.134825000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.939115000000000e-001+0.56}; -Point(3131) = {1.135950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.916165000000000e-001+0.56}; -Point(3132) = {1.137075000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.898974999999999e-001+0.56}; -Point(3133) = {1.138200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.884845000000000e-001+0.56}; -Point(3134) = {1.140450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.862885000000000e-001+0.56}; -Point(3135) = {1.142700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.846370000000000e-001+0.56}; -Point(3136) = {1.144950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.834355000000000e-001+0.56}; -Point(3137) = {1.147200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.826029999999999e-001+0.56}; -Point(3138) = {1.149450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.821260000000000e-001+0.56}; -Point(3139) = {1.151700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.820090000000000e-001+0.56}; -Point(3140) = {1.153950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.823555000000000e-001+0.56}; -Point(3141) = {1.156200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.830935000000000e-001+0.56}; -Point(3142) = {1.158450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.841420000000000e-001+0.56}; -Point(3143) = {1.160700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.854470000000000e-001+0.56}; -Point(3144) = {1.162950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.869634999999999e-001+0.56}; -Point(3145) = {1.165200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.886555000000000e-001+0.56}; -Point(3146) = {1.167450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.904735000000001e-001+0.56}; -Point(3147) = {1.169700000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.923590000000000e-001+0.56}; -Point(3148) = {1.171950000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.942490000000000e-001+0.56}; -Point(3149) = {1.174200000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.961389999999999e-001+0.56}; -Point(3150) = {1.176450000000000e+001-0.3-xOfst, 2.300000000000000e+000, 7.980290000000000e-001+0.56}; - -Spline(3001) = {3001:3003}; -Spline(3002) = {3003:3014}; -Spline(3003) = {3014:3026}; -Spline(3004) = {3026:3038}; -Spline(3005) = {3038:3049}; -Spline(3006) = {3049:3050,3001}; -Spline(3011) = {3101:3103}; -Spline(3012) = {3103:3114}; -Spline(3013) = {3114:3126}; -Spline(3014) = {3126:3138}; -Spline(3015) = {3138:3149}; -Spline(3016) = {3149:3150,3101}; -Line(3021) = {3001, 3101}; -Line(3022) = {3003, 3103}; -Line(3023) = {3014, 3114}; -Line(3024) = {3026, 3126}; -Line(3025) = {3038, 3138}; -Line(3026) = {3049, 3149}; - -/// Wake - -// Wing -Point(4002) = {17, 6.1, 0.09}; -Point(4003) = {17, 7, 0.29}; - -Line(4001) = {2001, 4001}; -Line(4002) = {2301, 4002}; -Line(4003) = {2601, 4003}; -Line(4004) = {4001, 4002}; -Line(4005) = {4002, 4003}; - -// Tail -Point(4012) = {17, 2.3, 1.36}; - -Line(4011) = {3001, 4011}; -Line(4012) = {3101, 4012}; -Line(4013) = {4011, 4012}; - -/* Surfacing */ - -/// Domain -// Symmetry -Curve Loop(1) = {1, 2, 3, 4, 5, 6}; -Curve Loop(2) = {2001, 2002, 2003, 2004, 2005, 2006}; -Curve Loop(3) = {3001, 3002, 3003, 3004, 3005, 3006}; -Plane Surface(1) = {-1, 2, 3}; - -// Downstream -Curve Loop(4) = {2, 3, 4, 23, -12, -22}; -Plane Surface(2) = {4}; - -// Farfield -Curve Loop(5) = {6, 21, -14, -24}; -Plane Surface(3) = {5}; -Curve Loop(6) = {5, 24, -13, -23}; -Plane Surface(4) = {6}; -Curve Loop(7) = {1, 22, -11, -21}; -Plane Surface(5) = {7}; -Curve Loop(8) = {12, 13, 14, 11}; -Plane Surface(6) = {8}; - -// Wing -Curve Loop(9) = {2001, 2032, -2011, -2031}; -Surface(7) = {-9}; -Curve Loop(10) = {2002, 2033, -2012, -2032}; -Surface(8) = {-10}; -Curve Loop(11) = {2003, 2034, -2013, -2033}; -Surface(9) = {-11}; -Curve Loop(12) = {2004, 2035, -2014, -2034}; -Surface(10) = {-12}; -Curve Loop(13) = {2005, 2036, -2015, -2035}; -Surface(11) = {-13}; -Curve Loop(14) = {2006, 2031, -2016, -2036}; -Surface(12) = {-14}; -Curve Loop(15) = {2011, 2042, -2021, -2041}; -Surface(13) = {-15}; -Curve Loop(16) = {2012, 2043, -2022, -2042}; -Surface(14) = {-16}; -Curve Loop(17) = {2013, 2044, -2023, -2043}; -Surface(15) = {-17}; -Curve Loop(18) = {2014, 2045, -2024, -2044}; -Surface(16) = {-18}; -Curve Loop(19) = {2015, 2046, -2025, -2045}; -Surface(17) = {-19}; -Curve Loop(20) = {2016, 2041, -2026, -2046}; -Surface(18) = {-20}; -Curve Loop(30) = {2021, 2022, 2023, 2024, 2025, 2026}; -Plane Surface(28) = {-30}; - -// Horizontal tail -Curve Loop(21) = {3001, 3022, -3011, -3021}; -Surface(19) = {-21}; -Curve Loop(22) = {3002, 3023, -3012, -3022}; -Surface(20) = {-22}; -Curve Loop(23) = {3003, 3024, -3013, -3023}; -Surface(21) = {-23}; -Curve Loop(24) = {3004, 3025, -3014, -3024}; -Surface(22) = {-24}; -Curve Loop(25) = {3005, 3026, -3015, -3025}; -Surface(23) = {-25}; -Curve Loop(26) = {3006, 3021, -3016, -3026}; -Surface(24) = {-26}; -Curve Loop(31) = {3011, 3012, 3013, 3014, 3015, 3016}; -Plane Surface(29) = {-31}; - -// Wing wake -Curve Loop(27) = {2031, 4002, -4004, -4001}; -Surface(25) = {-27}; -Curve Loop(28) = {2041, 4003, -4005, -4002}; -Surface(26) = {-28}; - -// Tail wake -Curve Loop(29) = {3021, 4012, -4013, -4011}; -Surface(27) = {-29}; - -/* Volume */ - -Surface Loop(1) = {1, 4, 3, 5, 2, 6, 12, 18, 28, 13, 7, 8, 9, 10, 11, 17, 16, 15, 14, 24, 29, 19, 20, 21, 22, 23}; -Volume(1) = {1}; - -/* Embedded */ - -Line{4001} In Surface{1}; -Line{4011} In Surface{1}; -Line{4004} In Surface{2}; -Line{4005} In Surface{2}; -Line{4013} In Surface{2}; -Surface{25} In Volume{1}; -Surface{26} In Volume{1}; -Surface{27} In Volume{1}; - -Coherence; - -/* Mesh size */ - -// Farfield -Characteristic Length {1, 2, 3, 4, 11, 12, 13, 14} = msFar; // Regular -Characteristic Length {4001, 4002, 4003, 4011, 4012} = msFar; // Embedded - -// Wing -Characteristic Length {2001} = msTeW0; // TE -Characteristic Length {2010, 2078} = msTeW0 * grW0; // Aft -Characteristic Length {2196, 2128} = msLeW0 * grW0; // Fwd -Characteristic Length {2103} = msLeW0; // LE -Characteristic Length {2301} = msTeW1; // TE -Characteristic Length {2310, 2496} = msTeW1 * grW1; // Aft -Characteristic Length {2378, 2428} = msLeW1 * grW1; // Fwd -Characteristic Length {2403} = msLeW1; // LE -Characteristic Length {2601} = msTeW2; // TE -Characteristic Length {2610, 2796} = msTeW2 * grW2; // Aft -Characteristic Length {2678, 2728} = msLeW2 * grW2; // Fwd -Characteristic Length {2703} = msLeW2; // LE - -// Tail -Characteristic Length {3001} = msTeT0; // TE -Characteristic Length {3003, 3049} = msTeT0 * grT0; // Aft -Characteristic Length {3014, 3038} = msLeT0 * grT0; // Fwd -Characteristic Length {3026} = msLeT0; // LE -Characteristic Length {3101} = msTeT1; // TE -Characteristic Length {3103, 3149} = msTeT1 * grT1; // Aft -Characteristic Length {3114, 3138} = msLeT1 * grT1; // Fwd -Characteristic Length {3126} = msLeT1; // LE - -/* Mesh Algorithm */ - -// 2D -Mesh.Algorithm = 5; - -// 3D -Mesh.Algorithm3D = 2; -Mesh.Optimize = 1; -Mesh.Smoothing = 10; -Mesh.SmoothNormals = 1; - -/* Physical */ - -// Tips: -Physical Line("teTipW") = {2031, 2041, 4003}; -Physical Line("wakeTipW") = {4003}; -Physical Line("teTipT") = {3021, 4012}; -Physical Line("wakeTipT") = {4012}; - -// Symmetry: -Physical Surface("symmetry") = {1}; - -// Downstream: -Physical Surface("downstream") = {2}; - -// Farfield: -Physical Surface("upstream") = {3}; -Physical Surface("farfield") = {4,5,6}; - -// Wing: -Physical Surface("wing") = {7, 8, 9, 13, 14, 15, 28}; -Physical Surface("wing_") = {10, 11, 12, 16, 17, 18}; - -Physical Surface("tail") = {19, 20, 21, 29}; -Physical Surface("tail_") = {22, 23, 24}; - -// Wake: -Physical Surface("wakeW") = {25, 26}; -Physical Surface("wakeT") = {27}; - -// Internal Field: -Physical Volume("field") = {1}; diff --git a/flow/scripts/__init__.py b/flow/scripts/__init__.py deleted file mode 100644 index 40a96afc..00000000 --- a/flow/scripts/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/flow/scripts/config.py b/flow/scripts/config.py deleted file mode 100644 index b9b2c3a2..00000000 --- a/flow/scripts/config.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Base class for configuration -# Adrien Crovato - -import math -import flow as f -import tbox -import tbox.gmsh as gmsh -import fwk -from tbox.solvers import LinearSolver -from fwk.wutils import parseargs -from fwk.coloring import ccolors - -class Config: - def __init__(self, p): - # timer - self.tms = fwk.Timers() - self.tms["total"].start() - - # basic checks - if p['Dim'] != 2 and p['Dim'] != 3: - raise RuntimeError('Problem dimension should be 2 or 3, but ' + p['Dim'] + ' was given!\n') - if p['Dim'] == 2: - if 'AoS' in p and p['AoS'] != 0: - raise RuntimeError('Angle of sideslip (AoS) should be zero for 2D problems!\n') - beta = 0 - if 'Symmetry' in p: - raise RuntimeError('Symmetry boundary condition cannot be used for 2D problems!\n') - else: - if 'AoS' in p: - if p['AoS'] != 0 and 'Symmetry' in p: - raise RuntimeError('Symmetry boundary condition cannot be used with nonzero angle of sideslip (AoS)!\n') - beta = p['AoS']*math.pi/180 - else: - beta = 0 - # basic config - if p['Format'] == 'vtk': - try: - import tboxVtk - Writer = tboxVtk.VtkExport - print("Found VTK libraries! Results will be saved in VTK format.\n") - except: - Writer = tbox.GmshExport - print("VTK libraries not found! Results will be saved in gmsh format.\n") - else: - Writer = tbox.GmshExport - print("Results will be saved in gmsh format.\n") - - # mesh the airfoil - print(ccolors.ANSI_BLUE + 'Meshing the airfoil...' + ccolors.ANSI_RESET) - self.msh = gmsh.MeshLoader(p['File'],__file__).execute(**p['Pars']) - if p['Dim'] == 2: - mshCrck = tbox.MshCrack(self.msh, p['Dim']) - mshCrck.setCrack(p['Wake']) - mshCrck.addBoundaries([p['Fluid'], p['Farfield'][-1], p['Wing']]) - mshCrck.run() - else: - for i in range(0, len(p['Wakes'])): - mshCrck = tbox.MshCrack(self.msh, p['Dim']) - mshCrck.setCrack(p['Wakes'][i]) - mshCrck.addBoundaries([p['Fluid'], p['Farfield'][-1], p['Wings'][i]]) - if 'Fuselage' in p: - mshCrck.addBoundaries([p['Fuselage']]) - if 'Symmetry' in p: - mshCrck.addBoundaries([p['Symmetry']]) - mshCrck.setExcluded(p['WakeTips'][i]) - mshCrck.run() - tbox.GmshExport(self.msh).save(self.msh.name) - del mshCrck - self.mshWriter = Writer(self.msh) - print('\n') - - # initialize the problem - self.pbl = f.Problem(self.msh, p['Dim'], 0., beta, p['M_inf'], p['S_ref'], p['c_ref'], p['x_ref'], p['y_ref'], p['z_ref']) - # add a medium "air" - self.pbl.set(f.Medium(self.msh, p['Fluid'], p['M_inf'], p['Dim'], 0., beta)) - # add initial condition - self.pbl.set(f.Initial(self.msh, p['Fluid'], p['Dim'], 0., beta)) - # add farfield boundary conditions (Neumann only, a DOF will be pinned automatically) - for i in range (0, len(p['Farfield'])): - self.pbl.add(f.Freestream(self.msh, p['Farfield'][i], p['Dim'], 0., beta)) - # add solid boundaries - if p['Dim'] == 2: - self.bnd = f.Boundary(self.msh, [p['Wing'], p['Fluid']]) - self.pbl.add(self.bnd) - else: - self.bnd = [] - for bd in p['Wings']: - bnd = f.Boundary(self.msh, [bd, p['Fluid']]) - self.bnd.append(bnd) - self.pbl.add(bnd) - if 'Fuselage' in p: - bnd = f.Boundary(self.msh, [p['Fuselage'], p['Fluid']]) - self.bnd.append(bnd) - self.pbl.add(bnd) - # add Wake/Kutta boundary conditions - if p['Dim'] == 2: - self.pbl.add(f.Wake(self.msh, [p['Wake'], p['Wake']+'_', p['Fluid']])) - self.pbl.add(f.Kutta(self.msh, [p['Te'], p['Wake']+'_', p['Wing'], p['Fluid']])) - else: - for i in range(0, len(p['Wakes'])): - self.pbl.add(f.Wake(self.msh, [p['Wakes'][i], p['Wakes'][i]+'_', p['Fluid'], p['TeTips'][i]])) - - # initialize the linear (inner) solver - print(ccolors.ANSI_BLUE + 'Initializing the solver...' + ccolors.ANSI_RESET) - if p['LSolver'] == 'Pardiso': - linsol = LinearSolver().pardiso() - elif p['LSolver'] == 'GMRES': - linsol = tbox.Gmres() - linsol.setFillFactor(p['G_fill']) - linsol.setRestart(p['G_restart']) - linsol.setTolerance(p['G_tol']) - elif p['LSolver'] == 'MUMPS': - linsol = LinearSolver().mumps() - elif p['LSolver'] == 'SparseLU': - linsol = tbox.SparseLu() - else: - raise RuntimeError('Available linear solvers: Pardiso, GMRES, MUMPS or SparseLU, but ' + p['LSolver'] + ' was given!\n') - # initialize the nonlinear (outer) solver - if p['NSolver'] == 'Picard': - self.solver = f.Picard(self.pbl, linsol) - self.solver.relax = p['Relaxation'] - elif p['NSolver'] == 'Newton': - self.solver = f.Newton(self.pbl, linsol) - self.solver.lsTol = p['LS_tol'] - self.solver.maxLsIt = p['Max_it_LS'] - self.solver.avThrsh = p['AV_thrsh'] - else: - raise RuntimeError('Available nonlinear solvers: Picard or Newton, but ' + p['NSolver'] + ' was given!\n') - args = parseargs() - self.solver.nthreads = args.k - self.solver.verbose = args.verb - self.solver.relTol = p['Rel_tol'] - self.solver.absTol = p['Abs_tol'] - self.solver.maxIt = p['Max_it'] diff --git a/flow/scripts/polar.py b/flow/scripts/polar.py deleted file mode 100644 index ca7253d9..00000000 --- a/flow/scripts/polar.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Polar -# Adrien Crovato -# -# Compute lift and polar curves - -import math -import flow.utils as fU -import tbox.utils as tU -from fwk.coloring import ccolors -from flow.scripts.config import Config - -class Polar(Config): - def __init__(self, p): - # save some parameters for later use - self.dim = p['Dim'] - self.format = p['Format'] - try: - self.slice = p['Slice'] - self.tag = p['TagId'] - except: - self.slice = None - self.tag = None - self.mach = p['M_inf'] - self.alphas = tU.myrange(p['AoA_begin'], p['AoA_end'], p['AoA_step']) - # basic init - Config.__init__(self, p) - - def run(self): - # initialize the loop - ac = 0 if self.alphas[0] == self.alphas[-1] else 1 - self.Cls = [] - self.Cds = [] - self.Cms = [] - print(ccolors.ANSI_BLUE + 'Sweeping AoA from', self.alphas[0], 'to', self.alphas[-1], ccolors.ANSI_RESET) - for alpha in self.alphas: - # define current angle of attack - alpha = alpha*math.pi/180 - # update problem - self.pbl.update(alpha) - # run the solver and save the results - print(ccolors.ANSI_BLUE + 'Running the solver for', alpha*180/math.pi, 'degrees', ccolors.ANSI_RESET) - self.tms["solver"].start() - self.solver.run() - self.tms["solver"].stop() - self.solver.save(self.mshWriter, ac) - print('\n') - # extract Cp - if self.dim == 2: - Cp = fU.extract(self.bnd.groups[0].tag.elems, self.solver.Cp) - tU.write(Cp, 'Cp_airfoil_'+str(ac)+'.dat', '%1.5e', ', ', 'alpha = '+str(alpha*180/math.pi)+' deg\nx, y, z, Cp', '') - elif self.dim == 3 and self.format == 'vtk' and self.slice: - fU.writeSlices(self.msh.name, self.slice, self.tag, ac) - # extract force coefficients - self.Cls.append(self.solver.Cl) - self.Cds.append(self.solver.Cd) - self.Cms.append(self.solver.Cm) - # end loop - ac+=1 - - def disp(self): - # display results - print(ccolors.ANSI_BLUE + 'Airfoil polar' + ccolors.ANSI_RESET) - print(" M alpha Cl Cd Cm") - i = 0 - while i < len(self.alphas): - print("{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}".format(self.mach, self.alphas[i], self.Cls[i], self.Cds[i], self.Cms[i])) - i = i+1 - print('\n') - # display timers - self.tms["total"].stop() - print(ccolors.ANSI_BLUE + 'CPU statistics' + ccolors.ANSI_RESET) - print(self.tms) - # plot results - if self.alphas[0] != self.alphas[-1]: - tU.plot(self.alphas, self.Cls, "alpha", "Cl", "") - tU.plot(self.alphas, self.Cds, "alpha", "Cd", "") - tU.plot(self.alphas, self.Cms, "alpha", "Cm", "") diff --git a/flow/scripts/trim.py b/flow/scripts/trim.py deleted file mode 100644 index 8ddda187..00000000 --- a/flow/scripts/trim.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Trim analysis -# Adrien Crovato -# -# Find the angle of attack to match a specified lift coefficient - -import math -import flow.utils as fU -import tbox.utils as tU -from fwk.coloring import ccolors -from flow.scripts.config import Config - -class Trim(Config): - def __init__(self, p): - # save some parameters for later use - self.dim = p['Dim'] - self.format = p['Format'] - try: - self.slice = p['Slice'] - self.tag = p['TagId'] - except: - self.slice = None - self.tag = None - self.mach = p['M_inf'] - self.ClTgt = p['CL'] - self.alpha = p['AoA']*math.pi/180 - self.dCl = p['dCL'] - # basic init - Config.__init__(self, p) - - def run(self): - # initialize loop - it = 0 - while True: - # define current angle of attack - print(ccolors.ANSI_BLUE + 'Setting AoA to', self.alpha*180/math.pi, ccolors.ANSI_RESET) - # update problem - self.pbl.update(self.alpha) - # run the solver - self.tms["solver"].start() - success = self.solver.run() - if not success: - raise RuntimeError('Flow solver diverged!\n') - self.tms["solver"].stop() - # update slope - if it != 0: - self.dCl = (self.solver.Cl - Cl_) / (self.alpha - alpha_) - # break or store values and update AoA - if abs(self.ClTgt - self.solver.Cl) < 0.005 or math.isnan(self.solver.Cl): - break - else: - Cl_ = self.solver.Cl - alpha_ = self.alpha - dAlpha = (self.ClTgt - self.solver.Cl) / self.dCl - self.alpha += dAlpha - it += 1 - - # save results - self.solver.save(self.mshWriter) - print('\n') - # extract Cp - if self.dim == 2: - Cp = fU.extract(self.bnd.groups[0].tag.elems, self.solver.Cp) - tU.write(Cp, "Cp_airfoil.dat", "%1.5e", ", ", "x, y, z, Cp", "") - elif self.dim == 3 and self.format == 'vtk' and self.slice: - fU.writeSlices(self.msh.name, self.slice, self.tag) - - def disp(self): - # display results - print(ccolors.ANSI_BLUE + 'Trim analysis' + ccolors.ANSI_RESET) - print(" M alpha dCl Cl Cd Cm") - print("{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f} {5:8.4f}".format(self.mach, self.alpha*180/math.pi, self.dCl, self.solver.Cl, self.solver.Cd, self.solver.Cm)) - print('\n') - # display timers - self.tms["total"].stop() - print(ccolors.ANSI_BLUE + 'CPU statistics' + ccolors.ANSI_RESET) - print(self.tms) diff --git a/flow/src/CMakeLists.txt b/flow/src/CMakeLists.txt deleted file mode 100644 index cccfb0ff..00000000 --- a/flow/src/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# CMake input file of flow.so - -FILE(GLOB SRCS *.h *.cpp *.inl *.hpp) - -ADD_LIBRARY(flow SHARED ${SRCS}) -MACRO_DebugPostfix(flow) -TARGET_INCLUDE_DIRECTORIES(flow PUBLIC ${PROJECT_SOURCE_DIR}/flow/src) - -TARGET_LINK_LIBRARIES(flow tbox) - -INSTALL(TARGETS flow DESTINATION ${CMAKE_INSTALL_PREFIX}) - -SOURCE_GROUP(base REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)") - diff --git a/flow/src/flow.h b/flow/src/flow.h deleted file mode 100644 index 2d6ad7f9..00000000 --- a/flow/src/flow.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// global header of the "flow" module - -#ifndef FLOW_H -#define FLOW_H - -#if defined(WIN32) -#ifdef flow_EXPORTS -#define FLOW_API __declspec(dllexport) -#else -#define FLOW_API __declspec(dllimport) -#endif -#else -#define FLOW_API -#endif - -#include "tbox.h" - -/** - * @brief Namespace for flow module - */ -namespace flow -{ -// Problem and B.C. handling -class Problem; -class Medium; -class Assign; -class Initial; -class Dirichlet; -class Freestream; -class Wake; -class WakeElement; -class Kutta; -class KuttaElement; -class Blowing; -class Boundary; - -// Formulation -class PotentialResidual; -class FreestreamResidual; -class WakeResidual; -class KuttaResidual; -class BlowingResidual; -class LoadFunctional; - -// Solver -class Solver; -class Picard; -class Newton; -class FpeLSFunction; -class Adjoint; - -// General -class F0Ps; -class F0El; -class F0ElC; -class F0ElRho; -class F0ElRhoL; -class F0ElMach; -class F0ElMachL; -class F0ElCp; -class F0ElCpL; -class F1El; -class F1ElVi; -class F1Ct; -class F1CtDrag; -class F1CtSide; -class F1CtLift; -class Face; -class FaceEq; - -} // namespace flow - -#endif //FLOW_H diff --git a/flow/src/wAdjoint.cpp b/flow/src/wAdjoint.cpp deleted file mode 100644 index cd14f91d..00000000 --- a/flow/src/wAdjoint.cpp +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wAdjoint.h" -#include "wProblem.h" -#include "wMedium.h" -#include "wFreestream.h" -#include "wWake.h" -#include "wKutta.h" -#include "wBoundary.h" -#include "wNewton.h" -#include "wPotentialResidual.h" -#include "wFreestreamResidual.h" -#include "wWakeResidual.h" -#include "wKuttaResidual.h" -#include "wLoadFunctional.h" - -#include "wMshData.h" -#include "wNode.h" -#include "wElement.h" -#include "wLinearSolver.h" -#include "wMshDeform.h" -#include "wResults.h" -#include "wMshExport.h" - -#include <Eigen/Sparse> - -#include <tbb/global_control.h> -#include <tbb/parallel_for_each.h> -#include <tbb/spin_mutex.h> - -#include <iomanip> -#include <deque> - -using namespace tbox; -using namespace flow; - -#define ANSI_COLOR_YELLOW "\x1b[1;33m" -#define ANSI_COLOR_RESET "\x1b[0m" - -/** - * @brief Initialize the adjoint solver - * @authors Adrien Crovato - */ -Adjoint::Adjoint(std::shared_ptr<Newton> _sol, std::shared_ptr<tbox::MshDeform> _morph, std::shared_ptr<tbox::LinearSolver> _linsol) : sol(_sol), morph(_morph), linsol(_linsol) -{ - // Default parameters - nthreads = sol->nthreads; - verbose = sol->verbose; - - // Update element gradients - sol->pbl->initGradElems(); - - // Setup adjoint variables and gradients - lamClFlo.resize(sol->pbl->msh->nodes.size(), 0.); - lamCdFlo.resize(sol->pbl->msh->nodes.size(), 0.); - dClMsh.resize(sol->pbl->msh->nodes.size(), Eigen::Vector3d::Zero()); - dCdMsh.resize(sol->pbl->msh->nodes.size(), Eigen::Vector3d::Zero()); - dClAoa = 0; - dCdAoa = 0; - - // Setup rows (unknown index) - this->mapRows(); -} - -/** - * @brief Run the adjoint method - * - * Solve the adjoint steady transonic Full Potential Equation - * and compute lift and drag sensitivites - */ -void Adjoint::run() -{ - // Init - tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads); - - // Display solver parameters - std::cout << "--- Adjoint solver ---\n" - << "Number of threads: " << nthreads << "\n" - << std::endl; - - // Solve adjoint flow equation - tms["0-AdjFlo"].start(); - this->solve(); - tms["0-AdjFlo"].stop(); - - // Compute total gradient of loads with respect to angle of attack - tms["1-GradAoA"].start(); - this->computeGradientAoa(); - tms["1-GradAoA"].stop(); - - // Compute total gradient of loads with respect to mesh nodes (including deformation) - tms["2-GradMsh"].start(); - this->computeGradientMesh(); - tms["2-GradMsh"].stop(); - - // Display timers - if (verbose > 0) - std::cout << "Adjoint solver CPU" << std::endl - << tms; - std::cout << std::endl; -} - -/** - * @brief Solve the adjoint steady transonic Full Potential Equation - */ -void Adjoint::solve() -{ - // Build partial gradients of residual wrt to potential - tms["00-AdjFloJac"].start(); - Eigen::SparseMatrix<double, Eigen::RowMajor> dR(sol->pbl->msh->nodes.size(), sol->pbl->msh->nodes.size()); - Eigen::SparseMatrix<double, Eigen::RowMajor> dR_(sol->pbl->msh->nodes.size(), sol->pbl->msh->nodes.size()); - sol->buildJac(dR_); - dR = dR_.transpose(); - tms["00-AdjFloJac"].stop(); - tms["01-AdjFloRes"].start(); - // Build partial gradients of loads wrt potential - Eigen::VectorXd dCl(sol->pbl->msh->nodes.size()), dCd(sol->pbl->msh->nodes.size()); - this->buildGradientLoadsFlow(dCl, dCd); - tms["01-AdjFloRes"].stop(); - - // Solve linear adjoint equations: dR {lambdaCl, lambdaCd} = {dCl, dCd} - tms["02-AdjFloSol"].start(); - Eigen::Map<Eigen::VectorXd> lamCl_(lamClFlo.data(), lamClFlo.size()), lamCd_(lamCdFlo.data(), lamCdFlo.size()); - linsol->compute(dR, Eigen::Map<Eigen::VectorXd>(dCl.data(), dCl.size()), lamCl_); - linsol->compute(dR, Eigen::Map<Eigen::VectorXd>(dCd.data(), dCd.size()), lamCd_); - tms["02-AdjFloSol"].stop(); - - // Display - std::cout << std::setw(15) << std::left << "Flow adjoint" - << std::setw(15) << std::right << "Res[lambdaCl]" - << std::setw(15) << std::right << "Res[lambdaCd]" << std::endl; - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(15) << std::left << "" - << std::setw(15) << std::right << log10((dR * lamCl_ - dCl).norm()) - << std::setw(15) << std::right << log10((dR * lamCd_ - dCd).norm()) << std::endl; -} - -/** - * @brief Compute total gradients of the loads with respect to angle of attack - * @todo one gradient for each surface node - */ -void Adjoint::computeGradientAoa() -{ - // Compute partial gradients with respect to AoA - tms["10-GradAoARes"].start(); - Eigen::VectorXd dR = Eigen::VectorXd::Zero(sol->pbl->msh->nodes.size()); - this->buildGradientResidualAoa(dR); - tms["10-GradAoARes"].stop(); - tms["11-GradAoALoad"].start(); - double dL = 0, dD = 0; - this->buildGradientLoadsAoa(dL, dD); - tms["11-GradAoALoad"].stop(); - // Compute total gradients - dClAoa = (dL - Eigen::Map<Eigen::VectorXd>(lamClFlo.data(), lamClFlo.size()).transpose() * dR); - dCdAoa = (dD - Eigen::Map<Eigen::VectorXd>(lamCdFlo.data(), lamCdFlo.size()).transpose() * dR); - - // Display - std::cout << std::setw(15) << std::left << "AoA gradients" - << std::setw(15) << std::right << "dCl_dAoA" - << std::setw(15) << std::right << "dCd_dAoA" << std::endl; - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(15) << std::left << "" - << std::setw(15) << std::right << dClAoa - << std::setw(15) << std::right << dCdAoa << std::endl; -} - -/** - * @brief Compute total gradients of the loads with respect to mesh nodes - */ -void Adjoint::computeGradientMesh() -{ - // Build partial gradients of flow residual wrt mesh - tms["20-GradMshRes"].start(); - Eigen::SparseMatrix<double, Eigen::RowMajor> dR(sol->pbl->msh->nodes.size(), sol->pbl->nDim * sol->pbl->msh->nodes.size()); - this->buildGradientResidualMesh(dR); - tms["20-GradMshRes"].stop(); - // Build partial gradients of loads wrt mesh - tms["21-GradMshLoad"].start(); - Eigen::RowVectorXd dCl = Eigen::RowVectorXd::Zero(sol->pbl->nDim * sol->pbl->msh->nodes.size()), dCd = Eigen::RowVectorXd::Zero(sol->pbl->nDim * sol->pbl->msh->nodes.size()); - this->buildGradientLoadsMesh(dCl, dCd); - tms["21-GradMshLoad"].stop(); - - // Build partial gradients of mesh deformation residual wrt mesh - tms["22-GradMshAdj"].start(); - Eigen::SparseMatrix<double, Eigen::RowMajor> Kmesh(sol->pbl->nDim * sol->pbl->msh->nodes.size(), sol->pbl->nDim * sol->pbl->msh->nodes.size()); - Eigen::SparseMatrix<double, Eigen::RowMajor> Kmesh_(sol->pbl->nDim * sol->pbl->msh->nodes.size(), sol->pbl->nDim * sol->pbl->msh->nodes.size()); - morph->build(Kmesh_); - Kmesh = Kmesh_.transpose(); - // Build RHS of mesh deformation adjoint equations: {dCl, dCd} = {dCl, dCd}_x - {lambdaCl, lambdaCd}_flow * dR_x - Eigen::VectorXd dClXyz = (dCl - Eigen::Map<Eigen::VectorXd>(lamClFlo.data(), lamClFlo.size()).transpose() * dR).transpose(); - Eigen::VectorXd dCdXyz = (dCd - Eigen::Map<Eigen::VectorXd>(lamCdFlo.data(), lamCdFlo.size()).transpose() * dR).transpose(); - tms["22-GradMshAdj"].stop(); - // Solve mesh deformation adjoint equations: K {lambdaCl, lambdaCd}_mesh = {dCl, dCd} - tms["23-GradMshSol"].start(); - Eigen::VectorXd lamClMsh = Eigen::VectorXd::Zero(sol->pbl->nDim * sol->pbl->msh->nodes.size()); - Eigen::VectorXd lamCdMsh = Eigen::VectorXd::Zero(sol->pbl->nDim * sol->pbl->msh->nodes.size()); - Eigen::Map<Eigen::VectorXd> lamClMsh_(lamClMsh.data(), lamClMsh.size()), lamCdMsh_(lamCdMsh.data(), lamCdMsh.size()); - linsol->compute(Kmesh, Eigen::Map<Eigen::VectorXd>(dClXyz.data(), dClXyz.size()), lamClMsh_); - linsol->compute(Kmesh, Eigen::Map<Eigen::VectorXd>(dCdXyz.data(), dCdXyz.size()), lamCdMsh_); - tms["23-GradMshSol"].stop(); - // Store solution - for (auto n : sol->pbl->msh->nodes) - { - for (int m = 0; m < sol->pbl->nDim; m++) - { - dClMsh[n->row](m) = lamClMsh(sol->pbl->nDim * (n->row) + m); - dCdMsh[n->row](m) = lamCdMsh(sol->pbl->nDim * (n->row) + m); - } - } - - // Display - std::cout << std::setw(15) << std::left << "Mesh adjoint" - << std::setw(15) << std::right << "Res[lambdaCl]" - << std::setw(15) << std::right << "Res[lambdaCd]" << std::endl; - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(15) << std::left << "" - << std::setw(15) << std::right << log10((Kmesh * lamClMsh - dClXyz).norm()) - << std::setw(15) << std::right << log10((Kmesh * lamCdMsh - dCdXyz).norm()) << std::endl; - std::cout << std::setw(15) << std::left << "Mesh gradients" - << std::setw(15) << std::right << "Norm[dCl_dX]" - << std::setw(15) << std::right << "Norm[dCd_dX]" << std::endl; - std::cout << std::setw(15) << std::left << "" - << std::setw(15) << std::right << lamClMsh.norm() - << std::setw(15) << std::right << lamCdMsh.norm() << std::endl; -} - -/** - * @brief Build the gradients of the lift and drag with respect to the flow variables - * @todo one gradient for each surface node - */ -void Adjoint::buildGradientLoadsFlow(Eigen::VectorXd &dL, Eigen::VectorXd &dD) -{ - // Multithread - tbb::spin_mutex mutex; - - // Reset and compute gradient of lift and drag - dL.setZero(); - dD.setZero(); - for (auto sur : sol->pbl->bnds) - { - tbb::parallel_for_each(sur->groups[0]->tag->elems.begin(), sur->groups[0]->tag->elems.end(), [&](Element *e) { - // Associated volume element - Element *eV = sur->svMap.at(e); - // Build - Eigen::MatrixXd Ae = LoadFunctional::buildGradientFlow(*e, *eV, sol->phi, *sol->pbl->medium->cP); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t i = 0; i < e->nodes.size(); ++i) - { - Eigen::RowVectorXd AeL = sol->pbl->dirL.eval().transpose() * Ae.block(i * 3, 0, 3, eV->nodes.size()); - Eigen::RowVectorXd AeD = sol->pbl->dirD.eval().transpose() * Ae.block(i * 3, 0, 3, eV->nodes.size()); - for (size_t j = 0; j < eV->nodes.size(); ++j) - { - Node *nodj = eV->nodes[j]; - dL(nodj->row) += AeL(j); - dD(nodj->row) += AeD(j); - } - } - }); - } -} - -/** - * @brief Compute gradients of the residual with respect to angle of attack - */ -void Adjoint::buildGradientResidualAoa(Eigen::VectorXd &dR) -{ - // Multithread - tbb::spin_mutex mutex; - - // Reset gradient - dR.setZero(); - - // Freestream contribution - for (auto nBC : sol->pbl->fBCs) - { - tbb::parallel_for_each(nBC->tag->elems.begin(), nBC->tag->elems.end(), [&](Element *e) { - // Build elementary flux vector - Eigen::VectorXd be = FreestreamResidual::buildGradientAoa(*e, sol->phi, *nBC); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - dR(sol->rows[nodi->row]) += be(ii); - } - }); - } -} - -/** - * @brief Compute gradients of the lift and drag with respect to angle of attack - * @todo one gradient for each surface node - */ -void Adjoint::buildGradientLoadsAoa(double &dL, double &dD) -{ - // Compute integrated aerodynamic load coefficients (normalized by freestream dynamic pressure and reference area) - Eigen::Vector3d Cf(0, 0, 0); - for (auto bnd : sol->pbl->bnds) - for (size_t i = 0; i < bnd->nodes.size(); ++i) - Cf += bnd->nLoads[i]; - // Rotate to gradient of flow direction - dD = Cf.dot(sol->pbl->dirD.evalGrad()); - dL = Cf.dot(sol->pbl->dirL.evalGrad()); -} - -/** - * @brief Compute gradients of the residual with respect to mesh nodes - */ -void Adjoint::buildGradientResidualMesh(Eigen::SparseMatrix<double, Eigen::RowMajor> &dR) -{ - // Multithread - tbb::spin_mutex mutex; - - // List of triplets - std::deque<Eigen::Triplet<double>> T; - - // Volume - auto fluid = sol->pbl->medium; - tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) { - // Current element - Element *e = p.first; - //Upwind element - Element *eU = p.second[0]; - // Build elementary matrices - Eigen::MatrixXd Ae1, Ae2; - std::tie(Ae1, Ae2) = PotentialResidual::buildGradientMesh(*e, *eU, sol->phi, *fluid, sol->pbl->nDim, sol->muCv, sol->mCOv); - - // Assembly (subsonic) - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t i = 0; i < e->nodes.size(); ++i) - { - size_t rowi = e->nodes[i]->row; - for (size_t j = 0; j < e->nodes.size(); ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[e->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[e->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(sol->rows[rowi], rowj, Ae1(i, sol->pbl->nDim * j + n))); - } - } - } - } - // Assembly (supersonic) - double mach = fluid->mach->eval(*e, sol->phi, 0); - if (mach > sol->mCOv) - { - for (size_t i = 0; i < e->nodes.size(); ++i) - { - size_t rowi = e->nodes[i]->row; - for (size_t j = 0; j < eU->nodes.size(); ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[eU->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[eU->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(sol->rows[rowi], rowj, Ae2(i, sol->pbl->nDim * j + n))); - } - } - } - } - } - }); - // Farfield B.C. are not taken into account because they have no influence on the solution - - // Wake - for (auto wake : sol->pbl->wBCs) - { - tbb::parallel_for_each(wake->wEle.begin(), wake->wEle.end(), [&](WakeElement *we) { - // Build elementary matrices - Eigen::MatrixXd Aeu, Ael, Aes; - std::tie(Aeu, Ael, Aes) = WakeResidual::buildGradientMesh(*we, sol->phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t i = 0; i < we->nRow; ++i) - { - int rowi = we->wkN[i].second->row; - for (size_t j = 0; j < we->nColUp; ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[we->volUpE->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[we->volUpE->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(rowi, rowj, Aeu(i, sol->pbl->nDim * j + n))); - } - } - } - for (size_t j = 0; j < we->nColLw; ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[we->volLwE->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[we->volLwE->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(rowi, rowj, -Ael(i, sol->pbl->nDim * j + n))); - } - } - } - for (size_t j = 0; j < we->surUpE->nodes.size(); ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[we->surUpE->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[we->surUpE->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(rowi, rowj, Aes(i, sol->pbl->nDim * j + n))); - } - } - } - } - }); - } - // Kutta - for (auto kutta : sol->pbl->kSCs) - { - tbb::parallel_for_each(kutta->kEle.begin(), kutta->kEle.end(), [&](KuttaElement *ke) { - // Build elementary matrices - Eigen::MatrixXd Ae, Aes; - std::tie(Ae, Aes) = KuttaResidual::buildGradientMesh(*ke, sol->phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t i = 0; i < ke->nRow; ++i) - { - int rowi = ke->teN[i].second->row; - for (size_t j = 0; j < ke->nCol; ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[ke->volE->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[ke->volE->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(rowi, rowj, Ae(i, sol->pbl->nDim * j + n))); - } - } - } - for (size_t j = 0; j < ke->surE->nodes.size(); ++j) - { - for (int n = 0; n < sol->pbl->nDim; ++n) - { - for (size_t jj = 0; jj < arows[ke->surE->nodes[j]->row].size(); ++jj) - { - int rowj = sol->pbl->nDim * (arows[ke->surE->nodes[j]->row][jj]) + n; - T.push_back(Eigen::Triplet<double>(rowi, rowj, Aes(i, sol->pbl->nDim * j + n))); - } - } - } - } - }); - } - // Assemble matrix - dR.setFromTriplets(T.begin(), T.end()); - dR.prune(0.); - dR.makeCompressed(); -} - -/** - * @brief Compute gradients of the lift and drag with respect to mesh nodes - * @todo one gradient for each surface node - */ -void Adjoint::buildGradientLoadsMesh(Eigen::RowVectorXd &dL, Eigen::RowVectorXd &dD) -{ - // Multithread - tbb::spin_mutex mutex; - - // Reset and compute gradient of lift and drag - dL.setZero(); - dD.setZero(); - for (auto bnd : sol->pbl->bnds) - { - tbb::parallel_for_each(bnd->groups[0]->tag->elems.begin(), bnd->groups[0]->tag->elems.end(), [&](Element *e) { - // Volume element - Element *eV = bnd->svMap.at(e); - // Build - Eigen::MatrixXd Aes, Aev; - std::tie(Aes, Aev) = LoadFunctional::buildGradientMesh(*e, *eV, sol->phi, *sol->pbl->medium->cP, sol->pbl->nDim); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t i = 0; i < e->nodes.size(); ++i) - { - // rotate to flow direction - Eigen::RowVectorXd AesL = sol->pbl->dirL.eval().transpose() * Aes.block(i * 3, 0, 3, sol->pbl->nDim * e->nodes.size()); - Eigen::RowVectorXd AesD = sol->pbl->dirD.eval().transpose() * Aes.block(i * 3, 0, 3, sol->pbl->nDim * e->nodes.size()); - Eigen::RowVectorXd AevL = sol->pbl->dirL.eval().transpose() * Aev.block(i * 3, 0, 3, sol->pbl->nDim * eV->nodes.size()); - Eigen::RowVectorXd AevD = sol->pbl->dirD.eval().transpose() * Aev.block(i * 3, 0, 3, sol->pbl->nDim * eV->nodes.size()); - for (size_t m = 0; m < sol->pbl->nDim; ++m) - { - // surface - for (size_t j = 0; j < e->nodes.size(); ++j) - { - size_t rowj = e->nodes[j]->row; - for (size_t jj = 0; jj < arows[rowj].size(); ++jj) - { - dL.col((arows[rowj][jj]) * sol->pbl->nDim + m) += AesL.col(j * sol->pbl->nDim + m); - dD.col((arows[rowj][jj]) * sol->pbl->nDim + m) += AesD.col(j * sol->pbl->nDim + m); - } - } - // volume - for (size_t j = 0; j < eV->nodes.size(); ++j) - { - size_t rowj = eV->nodes[j]->row; - for (size_t jj = 0; jj < arows[rowj].size(); ++jj) - { - dL.col((arows[rowj][jj]) * sol->pbl->nDim + m) += AevL.col(j * sol->pbl->nDim + m); - dD.col((arows[rowj][jj]) * sol->pbl->nDim + m) += AevD.col(j * sol->pbl->nDim + m); - } - } - } - } - }); - } -} - -/** - * @brief Create the rows vector for the adjoint mesh - * @todo duplicated from wake - */ -void Adjoint::mapRows() -{ - // Collect each row associated to each node - arows.resize(sol->pbl->msh->nodes.size()); - for (size_t i = 0; i < sol->pbl->msh->nodes.size(); ++i) - arows[i].push_back(sol->pbl->msh->nodes[i]->row); - - // Add duplicated row on the wake - for (auto wake : sol->pbl->wBCs) - { - // Collect nodes on the wake - std::vector<Node *> nodesUp, nodesLw; - for (auto e : wake->groups[0]->tag->elems) - for (auto n : e->nodes) - nodesUp.push_back(n); - for (auto e : wake->groups[1]->tag->elems) - for (auto n : e->nodes) - nodesLw.push_back(n); - std::sort(nodesUp.begin(), nodesUp.end()); - auto it = std::unique(nodesUp.begin(), nodesUp.end()); - nodesUp.resize(std::distance(nodesUp.begin(), it)); - std::sort(nodesLw.begin(), nodesLw.end()); - it = std::unique(nodesLw.begin(), nodesLw.end()); - nodesLw.resize(std::distance(nodesLw.begin(), it)); - // Create map between upper and lower sides, but only retain different nodes - std::map<Node *, Node *> nodMap; - for (auto nUp : nodesUp) - { - for (auto nLw : nodesLw) - { - if ((nUp->pos - nLw->pos).norm() <= 1e-14 && nUp != nLw) - { - nodMap[nUp] = nLw; - break; - } - } - } - // Create rows - for (auto p : nodMap) - { - arows[p.first->row].push_back(p.second->row); - arows[p.second->row].push_back(p.first->row); - } - } -} - -/** - * @brief Write the results - */ -void Adjoint::save(MshExport *mshWriter, int n) -{ - // Write files - std::cout << "Saving files... " << std::endl; - // setup results - Results results; - results.scalars_at_nodes["lambdaClPhi"] = &lamClFlo; - results.scalars_at_nodes["lambdaCdPhi"] = &lamCdFlo; - results.vectors_at_nodes["gradClMsh"] = &dClMsh; - results.vectors_at_nodes["gradCdMsh"] = &dCdMsh; - // save (all mesh and boundary surface) - if (n > 0) - { - mshWriter->save(sol->pbl->msh->name + "_adjoint_" + std::to_string(n), results); - for (auto sur : sol->pbl->bnds) - sur->save(sur->groups[0]->tag->name + "adjoint_" + std::to_string(n), results); - } - else - { - mshWriter->save(sol->pbl->msh->name + "_adjoint", results); - for (auto sur : sol->pbl->bnds) - sur->save(sur->groups[0]->tag->name + "_adjoint", results); - } -} - -void Adjoint::write(std::ostream &out) const -{ - out << "flow::Adjoint" - << "\n"; -} diff --git a/flow/src/wAdjoint.h b/flow/src/wAdjoint.h deleted file mode 100644 index 54d148e1..00000000 --- a/flow/src/wAdjoint.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WADJOINT_H -#define WADJOINT_H - -#include "flow.h" -#include "wObject.h" -#include "wTimers.h" - -#include <iostream> -#include <vector> -#include <memory> -#include <Eigen/Sparse> - -namespace flow -{ - -/** - * @brief Adjoint solver class - * @authors Adrien Crovato - */ -class FLOW_API Adjoint : public fwk::wSharedObject -{ -public: - std::shared_ptr<Newton> sol; ///< Newton solver - std::shared_ptr<tbox::MshDeform> morph; ///< mesh morpher - std::shared_ptr<tbox::LinearSolver> linsol; ///< linear solver - - int nthreads; ///< number of threads for the assembly - int verbose; ///< display more info - - std::vector<double> lamClFlo; ///< lift flow adjoint - std::vector<double> lamCdFlo; ///< drag flow adjoint - std::vector<Eigen::Vector3d> dClMsh; ///< lift gradient with respect to mesh - std::vector<Eigen::Vector3d> dCdMsh; ///< drag gradient with respect to mesh - double dClAoa; ///< lift gradient with respect to angle of attack - double dCdAoa; ///< drag gradient with respect to angle of attack - -private: - fwk::Timers tms; ///< internal timers - std::vector<std::vector<int>> arows; ///< rows (unknown index) with duplicated dof on wake - -public: - Adjoint(std::shared_ptr<Newton> _sol, std::shared_ptr<tbox::MshDeform> _morph, std::shared_ptr<tbox::LinearSolver> _linsol); - virtual ~Adjoint() { std::cout << "~Adjoint()\n"; } - - void run(); - void save(tbox::MshExport *mshWriter, int n = 0); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - // Adjoint solution and total gradients - void solve(); - void computeGradientAoa(); - void computeGradientMesh(); - // Partial gradients wrt with respect to flow variables - void buildGradientLoadsFlow(Eigen::VectorXd &dL, Eigen::VectorXd &dD); - // Partial gradients with respect to angle of attack - void buildGradientResidualAoa(Eigen::VectorXd &dR); - void buildGradientLoadsAoa(double &dL, double &dD); - // Partial gradients with respect to mesh - void buildGradientResidualMesh(Eigen::SparseMatrix<double, Eigen::RowMajor> &dR); - void buildGradientLoadsMesh(Eigen::RowVectorXd &dL, Eigen::RowVectorXd &dD); - - // @todo - void mapRows(); -}; - -} // namespace flow -#endif //WADJOINT_H diff --git a/flow/src/wAssign.cpp b/flow/src/wAssign.cpp deleted file mode 100644 index f939b55f..00000000 --- a/flow/src/wAssign.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wAssign.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -#include <algorithm> -using namespace tbox; -using namespace flow; - -Assign::Assign(std::shared_ptr<MshData> _msh, int no) : Group(_msh, no) -{ - getNodes(); -} -Assign::Assign(std::shared_ptr<MshData> _msh, std::string const &name) : Group(_msh, name) -{ - getNodes(); -} -Assign::~Assign() -{ - delete f; - std::cout << "~Assign()\n"; -} - -/** - * @brief Prescribe value to all nodes (default implementation) - */ -void Assign::apply(std::vector<double> &vec) -{ - for (auto n : nodes) - vec[n->row] = f->eval(n->pos); -} - -/** - * @brief Get all nodes belonging to boundary tag - */ -void Assign::getNodes() -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - std::sort(nodes.begin(), nodes.end()); - auto it = std::unique(nodes.begin(), nodes.end()); - nodes.resize(std::distance(nodes.begin(), it)); -} - -Initial::Initial(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta) : Assign(_msh, no) -{ - f = new F0PsPhiInf(dim, alpha, beta); -} -Initial::Initial(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta) : Assign(_msh, name) -{ - f = new F0PsPhiInf(dim, alpha, beta); -} -void Initial::write(std::ostream &out) const -{ - out << "flow::Initial condition on " << *tag << ")\n"; - for (auto n : nodes) - out << '\t' << *n << ": (val=" << f->eval(n->pos) << ")\n"; -} - -Dirichlet::Dirichlet(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta, bool pin) : Assign(_msh, no) -{ - f = new F0PsPhiInf(dim, alpha, beta); - // Only retain the first node, so that the DOF associated to this node will be pinned - if (pin) - this->nodes.resize(1); -} -Dirichlet::Dirichlet(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta) : Assign(_msh, name) -{ - f = new F0PsPhiInf(dim, alpha, beta); -} -void Dirichlet::write(std::ostream &out) const -{ - out << "flow::Dirichlet boundary condition on " << *tag << ")\n"; - for (auto n : nodes) - out << '\t' << *n << ": (val=" << f->eval(n->pos) << ")\n"; -} \ No newline at end of file diff --git a/flow/src/wAssign.h b/flow/src/wAssign.h deleted file mode 100644 index f33a99be..00000000 --- a/flow/src/wAssign.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WASSIGN_H -#define WASSIGN_H - -#include "flow.h" -#include "wGroup.h" -#include "wF0Ps.h" -#include <vector> -#include <string> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Manage assign type condition - * @authors Adrien Crovato - */ -class FLOW_API Assign : public tbox::Group -{ -public: - std::vector<tbox::Node *> nodes; ///< nodes of the boundary -#ifndef SWIG - F0Ps *f; ///< position-based function to compute the boundary value - - Assign(std::shared_ptr<tbox::MshData> _msh, int no); - Assign(std::shared_ptr<tbox::MshData> _msh, std::string const &name); - virtual ~Assign(); - - void apply(std::vector<double> &vec); -#endif - -private: - void getNodes(); -}; - -/** - * @brief Manage initial condition - * @authors Adrien Crovato - */ -class FLOW_API Initial : public Assign -{ -public: - Initial(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta = 0.0); - Initial(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta = 0.0); - virtual ~Initial() { std::cout << "~Initial()\n"; } - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -/** - * @brief Manage Dirchlet boundary condition - * @authors Adrien Crovato - */ -class FLOW_API Dirichlet : public Assign -{ -public: - Dirichlet(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta = 0.0, bool pin = false); - Dirichlet(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta = 0.0); - virtual ~Dirichlet() { std::cout << "~Dirichlet()\n"; } - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif //WASSIGN_H diff --git a/flow/src/wBlowing.cpp b/flow/src/wBlowing.cpp deleted file mode 100644 index 8354ed86..00000000 --- a/flow/src/wBlowing.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wBlowing.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -using namespace tbox; -using namespace flow; - -Blowing::Blowing(std::shared_ptr<MshData> _msh, int no) : Group(_msh, no) -{ - create(); -} - -Blowing::Blowing(std::shared_ptr<MshData> _msh, std::string const &name) : Group(_msh, name) -{ - create(); -} -Blowing::~Blowing() -{ - for (auto p : uE) - delete p.second; - std::cout << "~Blowing()\n"; -} - -/** - * @brief Create data structure - */ -void Blowing::create() -{ - // Get the nodes of Blowing - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - std::sort(nodes.begin(), nodes.end()); - auto iterator = std::unique(nodes.begin(), nodes.end()); - nodes.resize(std::distance(nodes.begin(), iterator)); - - // Initialize blowing velocity - uE.resize(tag->elems.size()); - for (size_t i = 0; i < tag->elems.size(); ++i) - { - F0ElC *f = new F0ElC(0.); - uE[i] = std::pair<Element *, F0ElC *>(tag->elems[i], f); - } -} - -/** - * @brief Set blowing velocity - */ -void Blowing::setU(size_t i, double ue) -{ - uE[i].second->update(ue); -} - -void Blowing::write(std::ostream &out) const -{ - out << " Blowing boundary condition on " << *tag << std::endl; -} \ No newline at end of file diff --git a/flow/src/wBlowing.h b/flow/src/wBlowing.h deleted file mode 100644 index 5049a00c..00000000 --- a/flow/src/wBlowing.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WBLOWING_H -#define WBLOWING_H - -#include "flow.h" -#include "wGroup.h" -#include "wF0El.h" -#include <vector> - -namespace flow -{ - -/** - * @brief Manage blowing boundary condition - * @authors Adrien Crovato - */ -class FLOW_API Blowing : public tbox::Group -{ -public: - std::vector<tbox::Node *> nodes; ///< nodes of Blowing -#ifndef SWIG - std::vector<std::pair<tbox::Element *, F0ElC *>> uE; ///< blowing velocity for each element -#endif - - Blowing(std::shared_ptr<tbox::MshData> _msh, int nos); - Blowing(std::shared_ptr<tbox::MshData> _msh, std::string const &names); - virtual ~Blowing(); - - void setU(size_t i, double ue); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void create(); -}; - -} // namespace flow - -#endif //WBLOWING_H diff --git a/flow/src/wBlowingResidual.cpp b/flow/src/wBlowingResidual.cpp deleted file mode 100644 index 8625d57c..00000000 --- a/flow/src/wBlowingResidual.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wBlowingResidual.h" -#include "wF0El.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Build the residual vector, on one boundary element - * - * b = \int psi * vn dV - */ -Eigen::VectorXd BlowingResidual::build(Element const &e, std::vector<double> const &phi, F0El const &f) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Blowing velocity - double vn = f.eval(e, phi, 0); - - // Integral of (normal) transpiration velocity - Eigen::VectorXd b = Eigen::VectorXd::Zero(e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - b += cache.getSf(k) * vn * gauss.getW(k) * e.getDetJ(k); - return b; -} diff --git a/flow/src/wBlowingResidual.h b/flow/src/wBlowingResidual.h deleted file mode 100644 index c32f5ab7..00000000 --- a/flow/src/wBlowingResidual.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WBLOWINGRESIDUAL_H -#define WBLOWINGRESIDUAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of transpiration boundary terms - */ -class FLOW_API BlowingResidual -{ -public: - // Newton - static Eigen::VectorXd build(tbox::Element const &e, std::vector<double> const &phi, F0El const &f); -}; - -} // namespace flow -#endif //WBLOWINGRESIDUAL_H diff --git a/flow/src/wBoundary.cpp b/flow/src/wBoundary.cpp deleted file mode 100644 index 2b64a39f..00000000 --- a/flow/src/wBoundary.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wBoundary.h" -#include "wFace.h" -#include "wResults.h" -#include "wGroup.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -#include <unordered_set> -#include <iomanip> -#include <fstream> -using namespace tbox; -using namespace flow; - -Boundary::Boundary(std::shared_ptr<MshData> _msh, std::vector<int> const &nos) : Groups(_msh, nos), Cl(0), Cd(0), Cs(0), Cm(0) -{ - // Sanity check - if (groups.size() != 2) - { - std::stringstream err; - err << "flow::Boundary should be built with exactly 2 physical groups but " << groups.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - create(); -} - -Boundary::Boundary(std::shared_ptr<MshData> _msh, std::vector<std::string> const &names) : Groups(_msh, names), Cl(0), Cd(0), Cs(0), Cm(0) -{ - // Sanity check - if (groups.size() != 2) - { - std::stringstream err; - err << "flow::Boundary should be built with exactly 2 physical groups but " << groups.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - create(); -} - -/** - * @brief Create data structure - * @authors Adrien Crovato - */ -void Boundary::create() -{ - // Get the nodes of Boundary - for (auto e : groups[0]->tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - std::sort(nodes.begin(), nodes.end()); - auto iterator = std::unique(nodes.begin(), nodes.end()); - nodes.resize(std::distance(nodes.begin(), iterator)); - // Create a map between the boundary (surface) nodes and their local index - for (size_t i = 0; i < nodes.size(); ++i) - nMap[nodes[i]] = i; - - // Create unordered set of surface faces - std::unordered_set<Face *, EquFace, EquFace> bndFaces; - for (auto e : groups[0]->tag->elems) - { - Face *f = new Face(e->nodes); - f->el0 = e; - bndFaces.insert(f); - } - // Find volume faces that are surface faces (valid for TRI3 and TETRA4 only) - for (auto e : groups[1]->tag->elems) - { - size_t idx = 0; - for (size_t i = 0; i < e->nodes.size(); ++i) - { - // build volume face - std::vector<Node *> fN(e->nodes.size() - 1); - for (size_t j = 0; j < e->nodes.size() - 1; ++j) - fN[j] = e->nodes[(idx + j) % e->nodes.size()]; - Face f(fN); - // check if face is a surface face - // for some meshes, 1 tetra4 can have 2 faces that are surface tri3! - auto it = bndFaces.find(&f); - if (it != bndFaces.end()) - (*it)->el1 = e; - idx++; - } - } - // Create a map between the boundary (surface) and volume elements - for (auto f : bndFaces) - { - if (f->el1 == NULL) - { - std::stringstream err; - err << "flow::Boundary: no volume element from tag " << *groups[1]->tag << "could be associated to surface element " << *(f->el0) << "!\n"; - throw std::runtime_error(err.str()); - } - svMap[f->el0] = f->el1; - delete f; - } - - // Resize loads vector - nLoads.resize(nodes.size(), Eigen::Vector3d::Zero()); -} - -/** - * @brief Save nodal data for further post-processing - * @authors Adrien Crovato - */ -void Boundary::save(std::string const &name, Results const &res) -{ - // Write to file - std::cout << "writing file: " << name + ".dat" - << "... " << std::flush; - std::ofstream outfile; - outfile.open(name + ".dat"); - // Header - outfile << "$Boundary data" << std::endl; - // Aerodynamic coefficients - outfile << "$Aerodynamic coefficients" << std::endl; - outfile << "!" << std::fixed - << std::setw(14) << "Cl" - << std::setw(15) << "Cd" - << std::setw(15) << "Cs" - << std::setw(15) << "Cm" - << std::endl; - outfile << std::fixed - << std::setw(15) << Cl - << std::setw(15) << Cd - << std::setw(15) << Cs - << std::setw(15) << Cm - << std::endl; - // Elements (connectvity) - outfile << "$Elements" << std::endl; - outfile << groups[0]->tag->elems.size() << std::endl; - for (auto e : groups[0]->tag->elems) - { - outfile << std::fixed - << std::setw(10) << e->no; - for (auto n : e->nodes) - outfile << std::setw(10) << n->no; - outfile << std::endl; - } - //Nodes (data) - outfile << "$Nodal data" << std::endl; - outfile << nodes.size() << std::endl; - outfile << "!" << std::fixed - << std::setw(9) << "no" - << std::setw(15) << "x" - << std::setw(15) << "y" - << std::setw(15) << "z"; - for (auto &p : res.scalars_at_nodes) - outfile << std::setw(15) << p.first; - for (auto &p : res.vectors_at_nodes) - { - outfile << std::setw(14) << p.first << "x" - << std::setw(14) << p.first << "y" - << std::setw(14) << p.first << "z"; - } - outfile << std::endl; - for (auto n : nodes) - { - outfile << std::fixed - << std::setw(10) << n->no - << std::scientific << std::setprecision(6) - << std::setw(15) << n->pos(0) - << std::setw(15) << n->pos(1) - << std::setw(15) << n->pos(2); - for (auto &p : res.scalars_at_nodes) - outfile << std::setw(15) << (*(p.second))[n->row]; - for (auto &p : res.vectors_at_nodes) - outfile << std::setw(15) << (*(p.second))[n->row](0) - << std::setw(15) << (*(p.second))[n->row](1) - << std::setw(15) << (*(p.second))[n->row](2); - outfile << std::endl; - } - // Footer - outfile << std::endl; - // Close file - outfile.close(); - std::cout << "done!" << std::endl; -} - -void Boundary::write(std::ostream &out) const -{ - out << *groups[0]->tag << " is a Boundary of " << *groups[1]->tag << std::endl; -} \ No newline at end of file diff --git a/flow/src/wBoundary.h b/flow/src/wBoundary.h deleted file mode 100644 index 21ad216c..00000000 --- a/flow/src/wBoundary.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WBOUNDARY_H -#define WBOUNDARY_H - -#include "flow.h" -#include "wGroups.h" - -#include <vector> -#include <map> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Handle the boundary of a medium - * @authors Adrien Crovato - */ -class FLOW_API Boundary : public tbox::Groups -{ -public: - std::vector<tbox::Node *> nodes; ///< nodes of Boundary - std::map<tbox::Node *, size_t> nMap; ///< node to local index map - std::map<tbox::Element *, tbox::Element *> svMap; ///< surface to volume element map - double Cl; ///< lift coefficient - double Cd; ///< drag coefficient - double Cs; ///< sideforce coefficient - double Cm; ///< pitch moment coefficient (positive nose-up) - std::vector<Eigen::Vector3d> nLoads; ///< nodal (normalized) aerodynamic loads on boundary - - Boundary(std::shared_ptr<tbox::MshData> _msh, std::vector<int> const &nos); - Boundary(std::shared_ptr<tbox::MshData> _msh, std::vector<std::string> const &names); - virtual ~Boundary() { std::cout << "~Boundary()\n"; } - - void save(std::string const &name, tbox::Results const &res); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void create(); -}; - -} // namespace flow - -#endif //WBOUNDARY_H diff --git a/flow/src/wF0El.cpp b/flow/src/wF0El.cpp deleted file mode 100644 index 5dbee4fb..00000000 --- a/flow/src/wF0El.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wF0El.h" -using namespace tbox; -using namespace flow; - -/** - * @brief Update the value - */ -void F0ElC::update(double _v) -{ - v = _v; -} -/** - * @brief Evaluate the constant - */ -double F0ElC::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - return v; -} -/** - * @brief Evaluate the gradient of the constant - */ -double F0ElC::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - return 0; -} - -/** - * @brief Evaluate the nonlinear density (constant over element) - */ -double F0ElRho::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - double gradU = e.computeGradient(u, k).norm(); // norm of velocity - - if (gradU < gradUC) // true density - { - // particularized: pow(1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2), 1 / (gamma - 1)); - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU * gradU); - return sqrt(a * a * a * a * a); - } - else - { - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradUC * gradUC); - double beta = mInf * mInf * gradUC / a; - return sqrt(a * a * a * a * a) / (1 + beta * (gradU / gradUC - 1)); // limited density - } -} -/** - * @brief Evaluate the nonlinear density derivative (constant over element) - */ -double F0ElRho::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - double gradU = e.computeGradient(u, k).norm(); // norm of velocity - - if (gradU < gradUC) // true density - { - //particularized: -mInf * mInf * pow(rho, 2 - gamma); - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU * gradU); - return -mInf * mInf * sqrt(a * a * a); // has to be multiplied by grad u to recover true derivative - } - else // limited density - { - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradUC * gradUC); - double beta = mInf * mInf * gradUC / a; - return -sqrt(a * a * a * a * a) / ((1 + beta * (gradU / gradUC - 1)) * (1 + beta * (gradU / gradUC - 1))) * beta / gradUC / gradU; // has to be multiplied by grad u to recover true derivative - } -} - -/** - * @brief Evaluate the linear density (constant over element) - */ -double F0ElRhoL::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - return 1.; -} -/** - * @brief Evaluate the linear density derivative (constant over element) - */ -double F0ElRhoL::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - return 0.; -} - -/** - * @brief Evaluate the nonlinear Mach number (constant over element) - */ -double F0ElMach::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - Eigen::VectorXd gradU = e.computeGradient(u, k); // velocity - double gradU2 = gradU.squaredNorm(); // velocity squared - double a2 = 1 / (mInf * mInf) + 0.5 * (gamma - 1) * (1 - gradU2); // speed of sound squared - - return sqrt(gradU2) / sqrt(a2); -} -/** - * @brief Evaluate the nonlinear Mach number derivative (constant over element) - */ -double F0ElMach::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - Eigen::VectorXd gradU = e.computeGradient(u, k); // velocity - double gradU2 = gradU.squaredNorm(); // velocity squared - double a2 = 1 / (mInf * mInf) + 0.5 * (gamma - 1) * (1 - gradU2); - - return 1 / sqrt(gradU2 * a2) + 0.5 * (gamma - 1) * sqrt(gradU2) / sqrt(a2 * a2 * a2); // has to be multiplied by grad u to recover true derivative -} - -/** - * @brief Evaluate the linear Mach number (constant over element) - */ -double F0ElMachL::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - return 0.; -} -/** - * @brief Evaluate the linear Mach number derivative (constant over element) - */ -double F0ElMachL::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - return 0.; -} - -/** - * @brief Evaluate the nonlinear pressure coefficient (constant over element) - */ -double F0ElCp::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - Eigen::VectorXd gradU = e.computeGradient(u, k); // velocity - double gradU2 = gradU.squaredNorm(); // velocity squared - //particularized: 2 / (gamma * mInf * mInf) * (pow(1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2), gamma / (gamma - 1)) - 1); - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2); - - if (a <= 0) - return -2 / (gamma * mInf * mInf); // limit the pressure coefficient when vacuum conditions are reached - else - return 2 / (gamma * mInf * mInf) * (sqrt(a * a * a * a * a * a * a) - 1); -} -/** - * @brief Evaluate the nonlinear pressure coefficient derivative (constant over element) - */ -double F0ElCp::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - Eigen::VectorXd gradU = e.computeGradient(u, k); // velocity - double gradU2 = gradU.squaredNorm(); // velocity squared - //particularized: -2 * pow(1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2), 1 / (gamma - 1)); - double a = 1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2); - - if (a <= 0) - return 0; // limit the gradient when vacuum conditions are reached - else - return -2 * sqrt(a * a * a * a * a); // has to be multiplied by grad u to recover true derivative -} - -/** - * @brief Evaluate the linear pressure coefficient (constant over element) - */ -double F0ElCpL::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - Eigen::VectorXd gradU = e.computeGradient(u, k); // velocity - double gradU2 = gradU.squaredNorm(); // velocity squared - return 1 - gradU2; -} -double F0ElCpL::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - return -2.; // has to be multiplied by grad u to recover true derivative -} \ No newline at end of file diff --git a/flow/src/wF0El.h b/flow/src/wF0El.h deleted file mode 100644 index 56f88ff6..00000000 --- a/flow/src/wF0El.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WF0EL_H -#define WF0EL_H - -#include "flow.h" -#include "wObserver.h" -#include "wElement.h" -#include <vector> - -namespace flow -{ - -/** - * @brief Scalar function to be integrated over an element - */ -class FLOW_API F0El : public fwk::Observer -{ -public: - F0El() : Observer() {} - virtual ~F0El() {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const = 0; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const = 0; -}; - -/** - * @brief Constant function - */ -class FLOW_API F0ElC : public F0El -{ - double v; - -public: - F0ElC(double _v) : F0El(), v(_v) {} - virtual void update(double _v) override; - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Nonlinear density - * - * The density is limited (Padé approximation) for large value of velocity and - * particularized for diatomic gas. The input _mC2 is the square of the critical - * Mach number used to compute the critical velocity. - */ -class FLOW_API F0ElRho : public F0El -{ - double gamma; ///< heat capacity ratio (diatomic gas only) - double mInf; ///< freestream Mach number - double gradUC; ///< critical velocity - -public: - F0ElRho(double _mInf, double _mC2 = 5) : F0El(), gamma(1.4), mInf(_mInf) - { - gradUC = sqrt(_mC2 * (1 / (mInf * mInf) + (gamma - 1) / 2) / (1 + (gamma - 1) / 2 * _mC2)); - } - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Linear density (constant) - */ -class FLOW_API F0ElRhoL : public F0El -{ -public: - F0ElRhoL() : F0El() {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Nonlinear Mach number - * - * Particularized for diatomic gas - */ -class FLOW_API F0ElMach : public F0El -{ - double gamma; ///< heat capacity ratio (diatomic gas only) - double mInf; ///< freestream Mach number - -public: - F0ElMach(double _mInf) : F0El(), gamma(1.4), mInf(_mInf) {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Linear Mach number (constant) - */ -class FLOW_API F0ElMachL : public F0El -{ -public: - F0ElMachL() : F0El() {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Nonlinear pressure coefficient - * - * Particularized for diatomic gas - */ -class FLOW_API F0ElCp : public F0El -{ - double gamma; ///< heat capacity ratio (diatomic gas only) - double mInf; ///< freestream Mach number - -public: - F0ElCp(double _mInf) : F0El(), gamma(1.4), mInf(_mInf) {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -/** - * @brief Linear pressure coefficient - */ -class FLOW_API F0ElCpL : public F0El -{ - -public: - F0ElCpL() : F0El() {} - - virtual double eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual double evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -} // namespace flow - -#endif //WF0EL_H diff --git a/flow/src/wF0Ps.cpp b/flow/src/wF0Ps.cpp deleted file mode 100644 index efa03505..00000000 --- a/flow/src/wF0Ps.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wF0Ps.h" -using namespace tbox; -using namespace flow; - -F0PsPhiInf::F0PsPhiInf(int _nDim, double _alpha, double _beta) : F0Ps(), - nDim(_nDim), - alpha(_alpha), - beta(_beta) -{ - // Sanity check - if (nDim != 2 && nDim != 3) - { - std::stringstream err; - err << "F0PsPhiInf::nDim should be equal to 2 or 3 but " << nDim << " was given!\n"; - throw std::runtime_error(err.str()); - } - if (nDim != 3 && beta != 0) - throw std::runtime_error("F0PsPhiInf::beta can be nonzero only for 3D cases!\n"); -} -/** - * @brief Update the angle of attack - */ -void F0PsPhiInf::update(double _alpha) -{ - alpha = _alpha; -} -/** - * @brief Evaluate the freestream potential - */ -double F0PsPhiInf::eval(Eigen::Vector3d const &pos) const -{ - if (nDim == 2) - return cos(alpha) * pos(0) + sin(alpha) * pos(1); - else - return cos(alpha) * cos(beta) * pos(0) + sin(beta) * pos(1) + sin(alpha) * cos(beta) * pos(2); -} diff --git a/flow/src/wF0Ps.h b/flow/src/wF0Ps.h deleted file mode 100644 index c7d926ea..00000000 --- a/flow/src/wF0Ps.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WF0PS_H -#define WF0PS_H - -#include "flow.h" -#include "wObserver.h" -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Scalar functions depending on spatial position - */ -class FLOW_API F0Ps : public fwk::Observer -{ -public: - F0Ps() : Observer() {} - virtual ~F0Ps() {} - - virtual double eval(Eigen::Vector3d const &pos) const = 0; -}; - -/** - * @brief Freestream potential - */ -class FLOW_API F0PsPhiInf : public F0Ps -{ - int nDim; ///< number of dimensions - double alpha; ///< angle of attack - double beta; ///< angle of sideslip - -public: - F0PsPhiInf(int _nDim, double _alpha, double _beta = 0); - virtual void update(double _alpha) override; - - virtual double eval(Eigen::Vector3d const &pos) const override; -}; - -} // namespace flow - -#endif //WF0PS_H diff --git a/flow/src/wF1Ct.cpp b/flow/src/wF1Ct.cpp deleted file mode 100644 index 2653211a..00000000 --- a/flow/src/wF1Ct.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wF1Ct.h" -using namespace tbox; -using namespace flow; - -F1CtDrag::F1CtDrag(int _nDim, double _sRef, double alpha, double _beta) : F1Ct(), nDim(_nDim), sRef(_sRef), beta(_beta) -{ - // Sanity check - if (nDim != 2 && nDim != 3) - { - std::stringstream err; - err << "F1CtDrag::nDim should be equal to 2 or 3 but " << nDim << " was given!\n"; - throw std::runtime_error(err.str()); - } - if (nDim != 3 && beta != 0) - throw std::runtime_error("F1CtDrag::beta can be nonzero only for 3D cases!\n"); - // Set the velocity - this->update(alpha); -} -/** - * @brief Update the direction and its gradient - */ -void F1CtDrag::update(double alpha) -{ - if (nDim == 2) - { - v = Eigen::Vector3d(cos(alpha), sin(alpha), 0) / sRef; - dv = Eigen::Vector3d(-sin(alpha), cos(alpha), 0) / sRef; - } - else - { - v = Eigen::Vector3d(cos(alpha) * cos(beta), sin(beta), sin(alpha) * cos(beta)) / sRef; - dv = Eigen::Vector3d(-sin(alpha) * cos(beta), sin(beta), cos(alpha) * cos(beta)) / sRef; - } -} -/** - * @brief Return the direction - */ -Eigen::Vector3d F1CtDrag::eval() const -{ - return v; -} -/** - * @brief Return the gradient of the direction with respect to angle of attack - */ -Eigen::Vector3d F1CtDrag::evalGrad() const -{ - return dv; -} - -F1CtSide::F1CtSide(int _nDim, double _sRef, double alpha, double _beta) : F1Ct(), nDim(_nDim), sRef(_sRef), beta(_beta) -{ - // Sanity check - if (nDim != 2 && nDim != 3) - { - std::stringstream err; - err << "F1CtSide::nDim should be equal to 2 or 3 but " << nDim << " was given!\n"; - throw std::runtime_error(err.str()); - } - if (nDim != 3 && beta != 0) - throw std::runtime_error("F1CtSide::beta can be nonzero only for 3D cases!\n"); - // Set the velocity - this->update(alpha); -} -/** - * @brief Update the direction and its gradient - */ -void F1CtSide::update(double alpha) -{ - if (nDim == 2) - { - v = Eigen::Vector3d(0, 0, 0); - dv = Eigen::Vector3d(0, 0, 0); - } - else - { - v = Eigen::Vector3d(-cos(alpha) * sin(beta), cos(beta), -sin(alpha) * sin(beta)) / sRef; - dv = Eigen::Vector3d(sin(alpha) * sin(beta), cos(beta), -cos(alpha) * sin(beta)) / sRef; - } -} -/** - * @brief Return the direction - */ -Eigen::Vector3d F1CtSide::eval() const -{ - return v; -} -/** - * @brief Return the gradient of the direction with respect to angle of attack - */ -Eigen::Vector3d F1CtSide::evalGrad() const -{ - return dv; -} - -F1CtLift::F1CtLift(int _nDim, double _sRef, double alpha, double _beta) : F1Ct(), nDim(_nDim), sRef(_sRef), beta(_beta) -{ - // Sanity check - if (nDim != 2 && nDim != 3) - { - std::stringstream err; - err << "F1CtLift::nDim should be equal to 2 or 3 but " << nDim << " was given!\n"; - throw std::runtime_error(err.str()); - } - if (nDim != 3 && beta != 0) - throw std::runtime_error("F1CtLift::beta can be nonzero only for 3D cases!\n"); - // Set the velocity - this->update(alpha); -} -/** - * @brief Update the direction and its gradient - */ -void F1CtLift::update(double alpha) -{ - if (nDim == 2) - { - v = Eigen::Vector3d(-sin(alpha), cos(alpha), 0) / sRef; - dv = Eigen::Vector3d(-cos(alpha), -sin(alpha), 0) / sRef; - } - else - { - v = Eigen::Vector3d(-sin(alpha), 0, cos(alpha)) / sRef; - dv = Eigen::Vector3d(-cos(alpha), 0, -sin(alpha)) / sRef; - } -} -/** - * @brief Return the direction - */ -Eigen::Vector3d F1CtLift::eval() const -{ - return v; -} -/** - * @brief Return the gradient of the direction with respect to angle of attack - */ -Eigen::Vector3d F1CtLift::evalGrad() const -{ - return dv; -} diff --git a/flow/src/wF1Ct.h b/flow/src/wF1Ct.h deleted file mode 100644 index 8a65a01d..00000000 --- a/flow/src/wF1Ct.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WF1CT_H -#define WF1CT_H - -#include "flow.h" -#include "wObserver.h" -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Constant vector function - */ -class FLOW_API F1Ct : public fwk::Observer -{ -public: - F1Ct() : Observer() {} - virtual ~F1Ct() {} - - virtual Eigen::Vector3d eval() const = 0; - virtual Eigen::Vector3d evalGrad() const = 0; -}; - -/** - * @brief Drag direction - */ -class FLOW_API F1CtDrag : public F1Ct -{ - int nDim; ///< number of dimensions - double sRef; ///< reference area - double beta; ///< angle of sideslip - Eigen::Vector3d v; ///< drag direction unit vector - Eigen::Vector3d dv; ///< gradient of drag direction unit vector (wrt alpha) - -public: - F1CtDrag(int _nDim, double _sRef, double alpha, double _beta = 0); - void update(double alpha); - - virtual Eigen::Vector3d eval() const override; - virtual Eigen::Vector3d evalGrad() const override; -}; - -/** - * @brief Sideforce direction - */ -class FLOW_API F1CtSide : public F1Ct -{ - int nDim; ///< number of dimensions - double sRef; ///< reference area - double beta; ///< angle of sideslip - Eigen::Vector3d v; ///< sideforce direction unit vector - Eigen::Vector3d dv; ///< gradient of sideforce direction unit vector (wrt alpha) - -public: - F1CtSide(int _nDim, double _sRef, double alpha, double _beta = 0); - void update(double alpha); - - virtual Eigen::Vector3d eval() const override; - virtual Eigen::Vector3d evalGrad() const override; -}; - -/** - * @brief Lift direction - */ -class FLOW_API F1CtLift : public F1Ct -{ - int nDim; ///< number of dimensions - double sRef; ///< reference area - double beta; ///< angle of sideslip - Eigen::Vector3d v; ///< lift direction unit vector - Eigen::Vector3d dv; ///< gradient of lift direction unit vector (wrt alpha) - -public: - F1CtLift(int _nDim, double _sRef, double alpha, double _beta = 0); - void update(double alpha); - - virtual Eigen::Vector3d eval() const override; - virtual Eigen::Vector3d evalGrad() const override; -}; - -} // namespace flow - -#endif //WF1CT_H diff --git a/flow/src/wF1El.cpp b/flow/src/wF1El.cpp deleted file mode 100644 index 3f9d629b..00000000 --- a/flow/src/wF1El.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wF1El.h" -using namespace tbox; -using namespace flow; - -F1ElVi::F1ElVi(int _nDim, double alpha, double _beta) : F1El(), nDim(_nDim), beta(_beta) -{ - // Sanity check - if (nDim != 2 && nDim != 3) - { - std::stringstream err; - err << "F1ElVi::nDim should be equal to 2 or 3 but " << nDim << " was given!\n"; - throw std::runtime_error(err.str()); - } - if (nDim != 3 && beta != 0) - throw std::runtime_error("F1ElVi::beta can be nonzero only for 3D cases!\n"); - // Set the velocity - this->update(alpha); -} -/** - * @brief Update the velocity vector - */ -void F1ElVi::update(double alpha) -{ - if (nDim == 2) - { - v << cos(alpha), sin(alpha), 0; - dv << -sin(alpha), cos(alpha), 0; - } - else - { - v << cos(alpha) * cos(beta), sin(beta), sin(alpha) * cos(beta); - dv << -sin(alpha) * cos(beta), 0, cos(alpha) * cos(beta); - } -} -/** - * @brief Return the freestream velocity - */ -Eigen::Vector3d F1ElVi::eval(Element const &e, std::vector<double> const &u, size_t k) const -{ - return v; -} -/** - * @brief Return the gradient of freestream velocity with respect to angle of attack - */ -Eigen::Vector3d F1ElVi::evalGrad(Element const &e, std::vector<double> const &u, size_t k) const -{ - return dv; -} diff --git a/flow/src/wF1El.h b/flow/src/wF1El.h deleted file mode 100644 index ad4a433a..00000000 --- a/flow/src/wF1El.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WF1EL_H -#define WF1EL_H - -#include "flow.h" -#include "wObserver.h" -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Vector function to be integrated over an element - */ -class FLOW_API F1El : public fwk::Observer -{ -public: - F1El() : Observer() {} - virtual ~F1El() {} - - virtual Eigen::Vector3d eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const = 0; - virtual Eigen::Vector3d evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const = 0; -}; - -/** - * @brief Freestream velocity - */ -class FLOW_API F1ElVi : public F1El -{ - int nDim; ///< number of dimensions - double beta; ///< angle of sideslip - Eigen::Vector3d v; ///< freestream velocity vector - Eigen::Vector3d dv; ///< freestream velocity vector gradient (wrt alpha) - -public: - F1ElVi(int _nDim, double alpha, double _beta = 0); - virtual void update(double alpha) override; - - virtual Eigen::Vector3d eval(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; - virtual Eigen::Vector3d evalGrad(tbox::Element const &e, std::vector<double> const &u, - size_t k) const override; -}; - -} // namespace flow - -#endif //WF1EL_H diff --git a/flow/src/wFace.h b/flow/src/wFace.h deleted file mode 100644 index 7498884e..00000000 --- a/flow/src/wFace.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WFACE_H -#define WFACE_H - -#include "flow.h" -#include "wNode.h" - -#ifndef SWIG -namespace flow -{ - -/** - * @brief Common face of two elements - * @authors Adrien Crovato - */ -class FLOW_API Face -{ -public: - std::vector<tbox::Node *> nods; - tbox::Element *el0; - tbox::Element *el1; - - Face(std::vector<tbox::Node *> const &_nods) : nods(_nods), el0(NULL), el1(NULL) {} -}; - -/** - * @brief Face comparator - * @authors Adrien Crovato, Romain Boman - */ -class FLOW_API EquFace -{ -public: - // Default parameters - static const size_t bucket_size = 4; - static const size_t min_buckets = 8; - // Function returning a unique size_t per Face - size_t operator()(Face *const f) const - { - size_t sum = 0; - for (auto n : f->nods) - sum += static_cast<size_t>(n->no); - - return sum; // sum of nodes id - } - // Function allowing to univoquely identify a Face - bool operator()(Face *const f0, Face *const f1) const - { - bool flag = false; - size_t cnt = 0; - // compare nodes of f0 to nodes of f1 - for (auto n0 : f0->nods) - { - for (auto n1 : f1->nods) - { - if (n0 == n1) - { - cnt++; - break; - } - } - if (cnt == 0) - break; - } - // check the number of shared nodes - if (cnt == f0->nods.size()) - flag = true; - - return flag; // true if f0 = f1 (ie, f0 and f1 share the same nodes) - } -}; - -} // namespace flow -#endif - -#endif //WFACE_H diff --git a/flow/src/wFpeLSFunction.cpp b/flow/src/wFpeLSFunction.cpp deleted file mode 100644 index 8335f68d..00000000 --- a/flow/src/wFpeLSFunction.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wFpeLSFunction.h" -using namespace tbox; -using namespace flow; - -FpeLSFunction::FpeLSFunction(flow::Newton &_solver, std::vector<double> &_u, - std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du, - Eigen::Map<Eigen::VectorXd> &_fRes) : LSFunction(), solver(_solver), u(_u), u0(_u0), du(_du), fRes(_fRes) -{ -} - -/** - * @brief Update initial and change in solution - * @authors Adrien Crovato - */ -void FpeLSFunction::update(std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du) -{ - u0 = _u0; - du = _du; -} - -/** - * @brief Evaluate residual - * @authors Adrien Crovato - */ -double FpeLSFunction::eval(double alpha) -{ - for (size_t i = 0; i < u.size(); ++i) - u[i] = u0[i] + alpha * du(i); - solver.buildRes(fRes); - return fRes.norm(); -} - -void FpeLSFunction::write(std::ostream &out) const -{ - out << "flow::FpeLSFunction " << std::endl; -} diff --git a/flow/src/wFpeLSFunction.h b/flow/src/wFpeLSFunction.h deleted file mode 100644 index a09bf0e4..00000000 --- a/flow/src/wFpeLSFunction.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WFPELSFUNCTION_H -#define WFPELSFUNCTION_H - -#include "flow.h" -#include "wLinesearch.h" -#include "wNewton.h" - -#ifndef SWIG - -namespace flow -{ - -/** - * @brief Line search function for Full Potential Equation - * @authors Adrien Crovato - */ -class FLOW_API FpeLSFunction : public tbox::LSFunction -{ -private: - flow::Newton &solver; ///< solver object (must be of Newton type) - std::vector<double> &u; ///< solution - std::vector<double> u0; ///< initial solution - Eigen::Map<Eigen::VectorXd> du; ///< change in solution - Eigen::Map<Eigen::VectorXd> &fRes; ///< residual vector - -public: - FpeLSFunction(flow::Newton &_solver, std::vector<double> &_u, std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du, Eigen::Map<Eigen::VectorXd> &_fRes); - void update(std::vector<double> &_u0, Eigen::Map<Eigen::VectorXd> &_du); - virtual double eval(double alpha) override; - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif - -#endif //WFPELSFUNCTION_H diff --git a/flow/src/wFreestream.cpp b/flow/src/wFreestream.cpp deleted file mode 100644 index fa0fe0d2..00000000 --- a/flow/src/wFreestream.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wFreestream.h" -#include "wTag.h" -using namespace tbox; -using namespace flow; - -Freestream::Freestream(std::shared_ptr<MshData> _msh, int no, int dim, double alpha, double beta) : Group(_msh, no) -{ - f = new F1ElVi(dim, alpha, beta); -} - -Freestream::Freestream(std::shared_ptr<MshData> _msh, std::string const &name, int dim, double alpha, double beta) : Group(_msh, name) -{ - f = new F1ElVi(dim, alpha, beta); -} -Freestream::~Freestream() -{ - delete f; - std::cout << "~Freestream()\n"; -} - -void Freestream::write(std::ostream &out) const -{ - out << "Freestream boundary condition on " << *tag; -} diff --git a/flow/src/wFreestream.h b/flow/src/wFreestream.h deleted file mode 100644 index c86b18ab..00000000 --- a/flow/src/wFreestream.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WFREESTREAM_H -#define WFREESTREAM_H - -#include "flow.h" -#include "wGroup.h" -#include "wF1El.h" - -namespace flow -{ - -/** - * @brief Manage freestream (Neumann) boundary condtion - * @authors Adrien Crovato - */ -class FLOW_API Freestream : public tbox::Group -{ -public: -#ifndef SWIG - F1ElVi *f; ///< vector valued function to compute flux -#endif - Freestream(std::shared_ptr<tbox::MshData> _msh, int no, int dim, double alpha, double beta = 0.0); - Freestream(std::shared_ptr<tbox::MshData> _msh, std::string const &name, int dim, double alpha, double beta = 0.0); - virtual ~Freestream(); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif //WFREESTREAM_H diff --git a/flow/src/wFreestreamResidual.cpp b/flow/src/wFreestreamResidual.cpp deleted file mode 100644 index 14d58514..00000000 --- a/flow/src/wFreestreamResidual.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wFreestreamResidual.h" -#include "wFreestream.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Build the residual vector, on one freestream boundary element - * - * b = \int psi * v_inf * n dV - */ -Eigen::VectorXd FreestreamResidual::build(Element const &e, std::vector<double> const &phi, Freestream const &fs) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Normal velocity - double vn = fs.f->eval(e, phi, 0).dot(e.getNormal()); - - // Integral of mass flux (density times normal velocity) through freestream boundary - Eigen::VectorXd b = Eigen::VectorXd::Zero(e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - b += cache.getSf(k) * vn * gauss.getW(k) * e.getDetJ(k); - return b; -} - -/** - * @brief Build the gradient of the residual vector with respect to the angle of attack, on one freestream boundary element - * - * b = \int psi * dv_inf * n dV - */ -Eigen::VectorXd FreestreamResidual::buildGradientAoa(tbox::Element const &e, std::vector<double> const &phi, Freestream const &fs) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Gradient of normal velocity - double dvn = fs.f->evalGrad(e, phi, 0).dot(e.getNormal()); - - // Build mass flux gradient - Eigen::VectorXd b = Eigen::VectorXd::Zero(e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - b += cache.getSf(k) * dvn * gauss.getW(k) * e.getDetJ(k); - return b; -} diff --git a/flow/src/wFreestreamResidual.h b/flow/src/wFreestreamResidual.h deleted file mode 100644 index 39f2b564..00000000 --- a/flow/src/wFreestreamResidual.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WFREESTREAMRESIDUAL_H -#define WFREESTREAMRESIDUAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of freestream boundary residuals - */ -class FLOW_API FreestreamResidual -{ -public: - // Newton - static Eigen::VectorXd build(tbox::Element const &e, std::vector<double> const &phi, Freestream const &fs); - // Adjoint - static Eigen::VectorXd buildGradientAoa(tbox::Element const &e, std::vector<double> const &phi, Freestream const &fs); -}; - -} // namespace flow -#endif //WFREESTREAMRESIDUAL_H diff --git a/flow/src/wKutta.cpp b/flow/src/wKutta.cpp deleted file mode 100644 index def45766..00000000 --- a/flow/src/wKutta.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wKutta.h" -#include "wGroup.h" -#include "wTag.h" -#include <algorithm> -using namespace tbox; -using namespace flow; - -Kutta::Kutta(std::shared_ptr<MshData> _msh, std::vector<int> const &nos) - : Groups(_msh, nos) -{ - // Sanity check - if (nos.size() != 4) - { - std::stringstream err; - err << "flow::Kutta should be built with 4 physical groups but " << nos.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - // Build data structure - connectNodes(); - createElements(); -} -Kutta::Kutta(std::shared_ptr<MshData> _msh, std::vector<std::string> const &names) - : Groups(_msh, names) -{ - // Sanity check - if (names.size() != 4) - { - std::stringstream err; - err << "flow::Kutta should be built with 4 physical groups but " << names.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - // Build data structure - connectNodes(); - createElements(); -} -Kutta::~Kutta() -{ - for (size_t i = 0; i < kEle.size(); ++i) - { - delete kEle[i]; - } - std::cout << "~Kutta()\n"; -} - -/** - * @brief Connect matching nodes on wing trailing edge - * @authors Adrien Crovato - */ -void Kutta::connectNodes() -{ - // Temporary container for nodes - std::vector<Node *> nodesUp, nodesLw; - // Get unique node - for (auto e : groups[0]->tag->elems) - for (auto n : e->nodes) - nodesUp.push_back(n); - for (auto e : groups[1]->tag->elems) - for (auto n : e->nodes) - nodesLw.push_back(n); - std::sort(nodesUp.begin(), nodesUp.end()); - auto it = std::unique(nodesUp.begin(), nodesUp.end()); - nodesUp.resize(std::distance(nodesUp.begin(), it)); - std::sort(nodesLw.begin(), nodesLw.end()); - it = std::unique(nodesLw.begin(), nodesLw.end()); - nodesLw.resize(std::distance(nodesLw.begin(), it)); - - // Create the node map - for (auto nUp : nodesUp) - { - //std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl; - for (auto nLw : nodesLw) - { - //std::cout << " SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl; - if ((nUp->pos - nLw->pos).norm() <= 1e-14) - { - nodMap.push_back(std::pair<Node *, Node *>(nUp, nLw)); - break; - } - } - } - // Check if node map is not empty - if (nodMap.size() != nodesUp.size()) - { - std::stringstream err; - err << "flow::Kutta: some nodes from " << *groups[0]->tag << " and " << *groups[1]->tag << " could not be mapped (number of mapped nodes: " << nodMap.size() << ")!\n"; - throw std::runtime_error(err.str()); - } -} - -/** - * @brief Create Kutta elements - * @authors Adrien Crovato - */ -void Kutta::createElements() -{ - // temporary - std::vector<std::pair<Element *, Element *>> uPair, lPair; - std::vector<std::vector<std::pair<size_t, Node *>>> uNodes, lNodes; - // find and connect upper and lower surface-volume elements - connectElements(uPair, uNodes, true); - connectElements(lPair, lNodes, false); - - // Create the Kutta elements - size_t i = 0; - size_t k = 0; - for (auto it = uPair.begin(); it != uPair.end(); it++, i++) - { - KuttaElement *ke = new KuttaElement(i + 1, (*it).first, (*it).second, uNodes[k], 1); - kEle.push_back(ke); - k++; - } - k = 0; - for (auto it = lPair.begin(); it != lPair.end(); it++, i++) - { - KuttaElement *ke = new KuttaElement(i + 1, (*it).first, (*it).second, lNodes[k], -1); - kEle.push_back(ke); - k++; - } -} - -/** - * @brief Detect surface elements touching TE and connect with their volume element - * @authors Adrien Crovato - */ -void Kutta::connectElements(std::vector<std::pair<Element *, Element *>> &svPair, std::vector<std::vector<std::pair<size_t, Node *>>> &surN, bool uFlag) -{ - // find elements with (at least) one node on TE and store in vector by comparing the element nodes to the trailing edge nodes - std::vector<Element *> surE; - for (auto sE : groups[2]->tag->elems) - { - std::vector<std::pair<size_t, Node *>> tmp; - for (size_t i = 0; i < sE->nodes.size(); ++i) - { - for (auto teP : nodMap) - { - // check if the node is on the upper or lower TE - Node *teN; - if (uFlag) - teN = teP.first; - else - teN = teP.second; - if (sE->nodes[i] == teN) - { - tmp.push_back(std::pair<size_t, Node *>(i, teP.first)); - break; - } - } - } - if (!tmp.empty()) - { - surN.push_back(tmp); - surE.push_back(sE); - } - } - // find matching volume elements for each surface element by comparing each node of surface element to volume element - svPair.resize(surE.size()); - int i = 0; - for (auto sE : surE) - { - for (auto vE : groups[3]->tag->elems) - { - size_t cnt = 0; - for (auto sN : sE->nodes) - { - for (auto vN : vE->nodes) - { - if (sN == vN) - { - cnt++; - break; - } - } - if (cnt == 0) - break; - } - // if all surface nodes are also volume nodes - if (cnt == sE->nodes.size()) - { - svPair[i] = std::pair<Element *, Element *>(sE, vE); - break; - } - } - i++; - } -} - -void Kutta::write(std::ostream &out) const -{ - out << "flow::Kutta on " << *groups[0]->tag << " and " << *groups[1]->tag << "\n"; - for (auto p : nodMap) - out << "\t" << p.first->no << " linked with " << p.second->no << "\n"; - for (auto ke : kEle) - ke->write(out); -} \ No newline at end of file diff --git a/flow/src/wKutta.h b/flow/src/wKutta.h deleted file mode 100644 index ec1a39aa..00000000 --- a/flow/src/wKutta.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WKUTTA_H -#define WKUTTA_H - -#include "flow.h" -#include "wGroups.h" -#include "wElement.h" -#include "wNode.h" -#include "wKuttaElement.h" -#include <vector> -#include <string> - -namespace flow -{ - -/** - * @brief Handle Kutta condition - * @authors Adrien Crovato - */ -class FLOW_API Kutta : public tbox::Groups -{ -public: - std::vector<std::pair<tbox::Node *, tbox::Node *>> nodMap; ///< upper to lower trailing edge nodes map - std::vector<std::pair<tbox::Element *, tbox::Element *>> teMap; ///< upper to lower trailing edge elements map - std::vector<KuttaElement *> kEle; ///< list of Kutta elements - - Kutta(std::shared_ptr<tbox::MshData> _msh, std::vector<int> const &nos); - Kutta(std::shared_ptr<tbox::MshData> _msh, std::vector<std::string> const &names); - virtual ~Kutta(); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void connectNodes(); - void createElements(); - void connectElements(std::vector<std::pair<tbox::Element *, tbox::Element *>> &svPair, std::vector<std::vector<std::pair<size_t, tbox::Node *>>> &surN, bool uFlag); -}; - -} // namespace flow - -#endif //WKUTTA_H diff --git a/flow/src/wKuttaElement.cpp b/flow/src/wKuttaElement.cpp deleted file mode 100644 index 348cc667..00000000 --- a/flow/src/wKuttaElement.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wKuttaElement.h" -#include "wNode.h" -using namespace tbox; -using namespace flow; - -KuttaElement::KuttaElement(size_t _no, Element *&_surE, Element *&_volE, - std::vector<std::pair<size_t, Node *>> &_teN, int _sign) - : wObject(), no(_no), surE(_surE), volE(_volE), - teN(_teN), sign(_sign) - -{ - // Sanity checks - if (surE->type() == ELTYPE::LINE2) - nDim = 2; - else - { - std::stringstream err; - err << "KuttaElement only implemented for surface elements of type " - << ELTYPE::LINE2 << " (" << surE->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - if (volE->type() == ELTYPE::TRI3) - nCol = volE->nodes.size(); - else - { - std::stringstream err; - err << "KuttaElement only implemented for volume elements of type " - << ELTYPE::TRI3 << " (" << volE->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - // Count TE nodes - nRow = teN.size(); -} - -void KuttaElement::write(std::ostream &out) const -{ - out << "KuttaElement #" << no - << "\n\ton surface element (" << surE->type() << "): " << surE->no - << "\n\ton volume element: (" << volE->type() << "): " << volE->no - << "\n\twith " << teN.size() << " TE nodes: "; - for (auto p : teN) - out << p.second->no << " "; - out << "\n\twith sign: " << sign << std::endl; -} \ No newline at end of file diff --git a/flow/src/wKuttaElement.h b/flow/src/wKuttaElement.h deleted file mode 100644 index 9c1e05f1..00000000 --- a/flow/src/wKuttaElement.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WKUTTAELEMENT_H -#define WKUTTAELEMENT_H - -#include "flow.h" -#include "wObject.h" -#include "wElement.h" -#include <vector> - -namespace flow -{ - -/** - * @brief Kutta finite element - * - * Made up of one surface element at the trailing edge and the connected volume - * element. Only Line2 (surface) and Tri3 (volume) elements are curently - * implemented. - * Since Tri3 are used, the evaluation of the volume integrals is performed at - * dummy Gauss point #0. If volume elements with non-constant shape function - * derivatives are used, those derivates should be recomputed at the true - * surface element Gauss points. - * Kutta works well in 2D, but fails in 3D unless the geometry follows strict - * restrictions (thin and sharp TE, simple planform, same mesh elements on TE - * suction and pressure side, ...). Kutta contribution is therefore disabled for - * 3D cases. - * @authors Adrien Crovato - */ -class FLOW_API KuttaElement : public fwk::wObject -{ -public: - size_t no; ///< ID - tbox::Element *surE; ///< Surface element - tbox::Element *volE; ///< Connected volume element - - size_t nRow; ///< number of rows in stiffness matrix - size_t nCol; ///< number of columns in stiffness matrix - size_t nDim; ///< dimension of volume element - - std::vector<std::pair<size_t, tbox::Node *>> teN; ///< Map of local node indices and trailing edge nodes - int sign; ///< +1 if upper element, -1 if lower element - - KuttaElement(size_t _no, tbox::Element *&_surE, tbox::Element *&_volE, std::vector<std::pair<size_t, tbox::Node *>> &_teN, int _sign); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif //WKUTTAELEMENT_H diff --git a/flow/src/wKuttaResidual.cpp b/flow/src/wKuttaResidual.cpp deleted file mode 100644 index 2a8ef98d..00000000 --- a/flow/src/wKuttaResidual.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wKuttaResidual.h" -#include "wKuttaElement.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Build the residual matrix for a fixed-point iteration, on one Kutta element - * - * A = \int psi * v_u*grad_phi dS - */ -Eigen::MatrixXd KuttaResidual::buildFixed(KuttaElement const &ke, std::vector<double> const &phi) -{ - // Get shape functions, Jacobian and Gauss points - Cache &sCache = ke.surE->getVCache(); - Gauss &sGauss = sCache.getVGauss(); - // Get size - size_t nRow = ke.nRow; - - // Velocity - Eigen::RowVectorXd Aup = ke.volE->computeGradient(phi, 0).transpose() * ke.volE->getJinv(0) * ke.volE->getVCache().getDsf(0); - - // Build - Eigen::MatrixXd A = Eigen::MatrixXd::Zero(nRow, ke.nCol); - for (size_t k = 0; k < sGauss.getN(); ++k) - { - // shape functions - Eigen::VectorXd const &sf = sCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = sf(ke.teN[i].first); - // wake contribution - A += ke.sign * sfp * Aup * sGauss.getW(k) * ke.surE->getDetJ(k); - } - return A; -} - -/** - * @brief Build the residual vector, on one Kutta element - * - * b = \int psi * (grad_phi)^2 dS - */ -Eigen::VectorXd KuttaResidual::build(KuttaElement const &ke, std::vector<double> const &phi) -{ - // Get shape functions, Jacobian and Gauss points - Cache &sCache = ke.surE->getVCache(); - Gauss &sGauss = sCache.getVGauss(); - // Get size - size_t nRow = ke.nRow; - - // Velocity - Eigen::VectorXd dPhi = ke.volE->computeGradient(phi, 0); - double dPhi2 = dPhi.squaredNorm(); - - // Build - Eigen::VectorXd b = Eigen::VectorXd::Zero(nRow); - for (size_t k = 0; k < sGauss.getN(); ++k) - { - // shape functions - Eigen::VectorXd const &sf = sCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = sf(ke.teN[i].first); - // wake contribution - b += ke.sign * sfp * dPhi2 * sGauss.getW(k) * ke.surE->getDetJ(k); - } - return b; -} - -/** - * @brief Build the gradient of the residual vector with respect to the flow variable (jacobian), on one Kutta element - * - * A = \int psi * 2*(grad_phi_u)*dgrad_phi_u dS - */ -Eigen::MatrixXd KuttaResidual::buildGradientFlow(KuttaElement const &ke, std::vector<double> const &phi) -{ - // Build - Eigen::MatrixXd A = KuttaResidual::buildFixed(ke, phi); - return 2 * A; -} - -/** - * @brief Build the gradient of the residual vector with respect to the nodes, on one Kutta element - * - * A = d( \int psi * (grad_phi)^2 dS ) - * = \int psi * d(grad_phi)^2 dS - * + \int psi * (grad_phi)^2 ddS - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> KuttaResidual::buildGradientMesh(KuttaElement const &ke, std::vector<double> const &phi) -{ - // Get shape functions and Gauss points - Cache &surCache = ke.surE->getVCache(); - Gauss &surGauss = surCache.getVGauss(); - // Get Jacobian - Eigen::MatrixXd const &iJ = ke.volE->getJinv(0); - std::vector<Eigen::MatrixXd> const &dJ = ke.volE->getGradJ(0); - // Get size - size_t nRow = ke.nRow; - size_t nDim = ke.nDim; - size_t nCol = ke.nCol; - size_t nSur = ke.surE->nodes.size(); - - // velocity - Eigen::VectorXd dPhi = ke.volE->computeGradient(phi, 0); - - // Build - Eigen::MatrixXd Av = Eigen::MatrixXd::Zero(nRow, nDim * nCol); - Eigen::MatrixXd As = Eigen::MatrixXd::Zero(nRow, nDim * nSur); - for (size_t k = 0; k < surGauss.getN(); ++k) - { - // weight and Jacobian determinant - double w = surGauss.getW(k); - double detJ = ke.surE->getDetJ(k); - std::vector<double> dDetJ = ke.surE->getGradDetJ(k); - // shape functions - Eigen::VectorXd const &sf = surCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = sf(ke.teN[i].first); - - // Volume - for (size_t i = 0; i < nCol; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - // gradient of velocity jump - Av.col(idx) += ke.sign * w * sfp * 2 * dPhi.transpose() * (-iJ * dJ[idx] * dPhi) * detJ; // psi * dgrad_phi^2 - } - } - // Surface - for (size_t i = 0; i < nSur; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - // gradient of jacobian determinant - As.col(idx) += ke.sign * w * sfp * dPhi.dot(dPhi) * dDetJ[idx]; // psi * grad_phi^2 * ddetJ - } - } - } - return std::make_tuple(Av, As); -} diff --git a/flow/src/wKuttaResidual.h b/flow/src/wKuttaResidual.h deleted file mode 100644 index 12ea01bb..00000000 --- a/flow/src/wKuttaResidual.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WKUTTARESIDUAL_H -#define WKUTTARESIDUAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of Kutta residuals - */ -class FLOW_API KuttaResidual -{ -public: - // Picard - static Eigen::MatrixXd buildFixed(KuttaElement const &ke, std::vector<double> const &phi); - // Newton - static Eigen::VectorXd build(KuttaElement const &ke, std::vector<double> const &phi); - static Eigen::MatrixXd buildGradientFlow(KuttaElement const &ke, std::vector<double> const &phi); - // Adjoint - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildGradientMesh(KuttaElement const &ke, std::vector<double> const &phi); -}; - -} // namespace flow -#endif //WKUTTARESIDUAL_H diff --git a/flow/src/wLoadFunctional.cpp b/flow/src/wLoadFunctional.cpp deleted file mode 100644 index da322f6b..00000000 --- a/flow/src/wLoadFunctional.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wLoadFunctional.h" -#include "wF0El.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Compute the loads due to pressure normalized by the freestream dynamic pressure, on one boundary element - * - * b = \int psi * cp * n dS - */ -Eigen::VectorXd LoadFunctional::build(Element const &e, Element const &eV, std::vector<double> const &phi, F0El const &cp) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Pressure force coefficient in associated volume - Eigen::Vector3d fcp = -cp.eval(eV, phi, 0) * e.getNormal(); // "-" because force on body not on fluid - - // Integrate cp on the surface - Eigen::VectorXd b = Eigen::VectorXd::Zero(3 * e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - Eigen::VectorXd sf = cache.getSf(k); - double wdj = gauss.getW(k) * e.getDetJ(k); - for (size_t i = 0; i < e.nodes.size(); ++i) - b.block<3, 1>(i * 3, 0) += sf(i) * fcp * wdj; // stack nodal force vectors [fx1, fy1, fz1, fx2, fy2, fz2, ...] - } - return b; -} - -/** - * @brief Build the gradient of the loads with respect to the flow variable, on one boundary element - * - * A = \int psi * dcp * n dS - */ -Eigen::MatrixXd LoadFunctional::buildGradientFlow(Element const &e, Element const &eV, std::vector<double> const &phi, F0El const &cp) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Gradient of pressure force coefficient in associated volume - Eigen::MatrixXd dfcp = -e.getNormal() * cp.evalGrad(eV, phi, 0) * eV.computeGradient(phi, 0).transpose() * eV.getJinv(0) * eV.getVCache().getDsf(0); // "-" because force on body not on fluid - - // Integrate cp on the surface - Eigen::MatrixXd A = Eigen::MatrixXd::Zero(3 * e.nodes.size(), eV.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - Eigen::VectorXd sf = cache.getSf(k); - double wdj = gauss.getW(k) * e.getDetJ(k); - for (size_t i = 0; i < e.nodes.size(); ++i) - A.block(i * 3, 0, 3, eV.nodes.size()) += sf(i) * dfcp * wdj; - } - return A; -} - -/** - * @brief Build the gradient of the loads with respect to the nodes, on one boundary element - * - * A = d( \int psi * cp * n dS ) - * = \int psi * dcp * n * dS - * + \int psi * cp * dn * dS - * + \int psi * cp * n * ddS - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> LoadFunctional::buildGradientMesh(Element const &e, Element const &eV, std::vector<double> const &phi, F0El const &cp, int nDim) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Variables - double cP = -cp.eval(eV, phi, 0); // pressure coefficient ("-" because force on body not on fluid) - Eigen::Vector3d nrm = e.getNormal(); // unit normal - // Gradients - double dCp = -cp.evalGrad(eV, phi, 0); // pressure coefficient ("-" because force on body not on fluid) - Eigen::VectorXd dPhi = eV.computeGradient(phi, 0); // potential - Eigen::MatrixXd const &iJ = eV.getJinv(0); // inverse Jacobian - std::vector<Eigen::MatrixXd> const &dJ = eV.getGradJ(0); // Jacobian - std::vector<Eigen::Vector3d> dNrm = e.getGradNormal(); // unit normal - - // Build element contributions - Eigen::MatrixXd As = Eigen::MatrixXd::Zero(3 * e.nodes.size(), e.nodes.size() * nDim); - Eigen::MatrixXd Av = Eigen::MatrixXd::Zero(3 * e.nodes.size(), eV.nodes.size() * nDim); - for (size_t k = 0; k < gauss.getN(); ++k) - { - Eigen::VectorXd sf = cache.getSf(k); - double w = gauss.getW(k); - double detJ = e.getDetJ(k); - std::vector<double> dDetJ = e.getGradDetJ(k); - for (size_t i = 0; i < e.nodes.size(); ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - // surface - for (size_t j = 0; j < e.nodes.size(); ++j) - { - size_t idx = j * nDim + m; - As.block<3, 1>(i * 3, idx) += sf(i) * cP * w * (dNrm[idx] * detJ + nrm * dDetJ[idx]); // Cp * dn * S + Cp * n * dS - } - // volume - for (size_t j = 0; j < eV.nodes.size(); ++j) - { - size_t idx = j * nDim + m; - Av.block<3, 1>(i * 3, idx) += sf(i) * dCp * dPhi.transpose() * (-iJ * dJ[idx] * dPhi) * nrm * w * detJ; // dCp * n * S - } - } - } - } - return std::make_tuple(As, Av); -} diff --git a/flow/src/wLoadFunctional.h b/flow/src/wLoadFunctional.h deleted file mode 100644 index e481cf1d..00000000 --- a/flow/src/wLoadFunctional.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WLOADFUNCTIONAL_H -#define WLOADFUNCTIONAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of load functional - */ -class FLOW_API LoadFunctional -{ -public: - // Solver - static Eigen::VectorXd build(tbox::Element const &e, tbox::Element const &eV, std::vector<double> const &phi, F0El const &cp); - // Adjoint - static Eigen::MatrixXd buildGradientFlow(tbox::Element const &e, tbox::Element const &eV, std::vector<double> const &phi, F0El const &cp); - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildGradientMesh(tbox::Element const &e, tbox::Element const &eV, std::vector<double> const &phi, F0El const &cp, int nDim); -}; - -} // namespace flow -#endif //WLOADFUNCTIONAL_H diff --git a/flow/src/wMedium.cpp b/flow/src/wMedium.cpp deleted file mode 100644 index 198e37a3..00000000 --- a/flow/src/wMedium.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wMedium.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -using namespace tbox; -using namespace flow; - -Medium::Medium(std::shared_ptr<MshData> _msh, int no, - double mInf, int dim, double alpha, double beta) : Group(_msh, no) -{ - initFun(mInf, dim, alpha, beta); - createMap(); - std::cout << "Fluid is " << *tag << "with " << nCnt << " nodes." - << std::endl - << std::endl; -} -Medium::Medium(std::shared_ptr<MshData> _msh, std::string const &name, - double mInf, int dim, double alpha, double beta) : Group(_msh, name) -{ - initFun(mInf, dim, alpha, beta); - createMap(); - std::cout << "Fluid is " << *tag << "with " << nCnt << " nodes." - << std::endl - << std::endl; -} -Medium::~Medium() -{ - delete rho; - delete mach; - delete cP; - std::cout << "~Medium()\n"; -} - -/** - * Initialize functions - */ -void Medium::initFun(double mInf, int dim, double alpha, double beta) -{ - if (mInf == 0) - { - rho = new F0ElRhoL(); - mach = new F0ElMachL(); - cP = new F0ElCpL(); - } - else - { - rho = new F0ElRho(mInf); - mach = new F0ElMach(mInf); - cP = new F0ElCp(mInf); - } - phiInf = new F0PsPhiInf(dim, alpha, beta); -} - -/** - * @brief Create data structure - */ -void Medium::createMap() -{ - // Create map of elements connected to node - for (auto e : tag->elems) - for (auto n : e->nodes) - neMap[n].push_back(e); - nCnt = neMap.size(); - // Collect connected elements - adjMap.resize(tag->elems.size()); - int i = 0; - for (auto e : tag->elems) - { - // Get elements sharing at least one node - std::vector<Element *> vAdjE; - for (auto n : e->nodes) - vAdjE.insert(vAdjE.end(), neMap.at(n).begin(), neMap.at(n).end()); - // Sort and remove duplicates - std::sort(vAdjE.begin(), vAdjE.end()); - auto iterator = std::unique(vAdjE.begin(), vAdjE.end()); - vAdjE.resize(std::distance(vAdjE.begin(), iterator)); - // Remove self - for (size_t j = 0; j < vAdjE.size(); ++j) - { - if (vAdjE[j] == e) - vAdjE.erase(vAdjE.begin() + j); - } - // Pair an element and its adjacent elements - adjMap[i] = std::pair<Element *, std::vector<Element *>>(e, vAdjE); - i++; - } -} - -void Medium::write(std::ostream &out) const -{ - out << "Fluid on " << *tag << " with:\n\t" - << "rho = " << this->rho << ", mach = " << this->mach << ", cP = " << this->cP << "\n"; - out << "Adjencency map:\n"; - for (auto p : adjMap) - { - out << "\t" << p.first->no << ':'; - for (size_t j = 0; j < p.second.size(); j++) - out << p.second[j]->no << ','; - out << ";\n"; - } -} diff --git a/flow/src/wMedium.h b/flow/src/wMedium.h deleted file mode 100644 index 49c34319..00000000 --- a/flow/src/wMedium.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WMEDIUM_H -#define WMEDIUM_H - -#include "flow.h" -#include "wGroup.h" -#include "wF0El.h" -#include "wF0Ps.h" -#include <map> - -namespace flow -{ - -/** - * @brief Handle fluid medium - * @authors Adrien Crovato - */ -class FLOW_API Medium : public tbox::Group -{ -private: - size_t nCnt; ///< number of nodes -public: - std::map<tbox::Node *, std::vector<tbox::Element *>> neMap; ///< map each elements connected to a node - -#ifndef SWIG - F0El *rho; ///< density - F0El *mach; ///< Mach number - F0El *cP; ///< pressure coefficient - F0PsPhiInf *phiInf; ///< freestream potential -#endif - - std::vector<std::pair<tbox::Element *, std::vector<tbox::Element *>>> adjMap; ///< map of adjacent elements - - Medium(std::shared_ptr<tbox::MshData> _msh, int no, double mInf, int dim, double alpha, double beta); - Medium(std::shared_ptr<tbox::MshData> _msh, std::string const &name, double mInf, int dim, double alpha, double beta); - virtual ~Medium(); - -#ifndef SWIG - void initFun(double mInf, int dim, double alpha, double beta); - void createMap(); - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif //WMEDIUM_H diff --git a/flow/src/wNewton.cpp b/flow/src/wNewton.cpp deleted file mode 100644 index fc8709c8..00000000 --- a/flow/src/wNewton.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wNewton.h" -#include "wProblem.h" -#include "wMedium.h" -#include "wAssign.h" -#include "wFreestream.h" -#include "wWake.h" -#include "wKutta.h" -#include "wBlowing.h" -#include "wFpeLSFunction.h" -#include "wPotentialResidual.h" -#include "wFreestreamResidual.h" -#include "wWakeResidual.h" -#include "wKuttaResidual.h" -#include "wBlowingResidual.h" - -#include "wMshData.h" -#include "wTag.h" -#include "wNode.h" -#include "wElement.h" -#include "wLinesearch.h" -#include "wLinearSolver.h" - -#include <Eigen/Sparse> - -#include <tbb/global_control.h> -#include <tbb/parallel_for_each.h> -#include <tbb/spin_mutex.h> - -#include <iomanip> -#include <deque> - -using namespace tbox; -using namespace flow; - -#define ANSI_COLOR_RED "\x1b[1;31m" -#define ANSI_COLOR_GREEN "\x1b[1;32m" -#define ANSI_COLOR_YELLOW "\x1b[1;33m" -#define ANSI_COLOR_RESET "\x1b[0m" - -/** - * @brief Initialize the solver and set default parameters - * @authors Adrien Crovato - */ -Newton::Newton(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol) : Solver(_pbl, _linsol) -{ - // Additional default parameters - lsTol = 1e-6; - maxLsIt = 10; - avThrsh = 1e-2; - mCOv = 1.; - muCv = 1.; -} - -/** - * @brief Run the Newton solver - * - * Solve the steady transonic Full Potential Equation - * @authors Adrien Crovato - */ -bool Newton::run() -{ - // Multithread - tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads); - - // Display solver and problem parameters - std::cout << "--- Newton solver ---\n" - << "Inner solver: " << *linsol - << std::setprecision(5) - << "Number of threads: " << nthreads << "\n" - << "Relative tolerance: " << log10(relTol) << "\n" - << "Absolute tolerance: " << log10(absTol) << "\n" - << "Maximum iterations: " << maxIt << "\n"; - std::cout << "--- Problem definition ---\n" - << std::setprecision(5) - << "Angle of attack: " << pbl->alpha * 180 / 3.14159 << " deg\n" - << "Angle of sideslip: " << pbl->beta * 180 / 3.14159 << " deg\n" - << "Mach number: " << pbl->M_inf << "\n" - << "Reference area: " << pbl->S_ref << "\n" - << "Reference length: " << pbl->c_ref << "\n" - << "Reference origin: (" << pbl->x_ref(0) << ", " << pbl->x_ref(1) << ", " << pbl->x_ref(2) << ")\n" - << std::endl; - - // Initialize solver loop - nIt = 0; // iteration counter - int avC = 0; // adaptive viscosity counter - bool rUpwd = true; // update best upwind element - - // Residual and change in solution - std::vector<double> dPhi(phi.size()); // dummy dPhi - Eigen::Map<Eigen::VectorXd> rPhi_(rPhi.data(), rPhi.size()), dPhi_(dPhi.data(), dPhi.size()); - - // Find initial best upwind element - findUpwd(); - // Compute initial residual - buildRes(rPhi_); - double resInit = rPhi_.norm(); - double absRes = rPhi_.norm(); - double relRes = absRes / resInit; - - // Linesearch - FpeLSFunction fpe(*this, phi, phi, dPhi_, rPhi_); - BankRoseLS ls(fpe); - //FleuryLS ls(fpe, 1., 1e-2, false); - ls.set(maxLsIt, lsTol, verbose); - - // Display residual - std::cout << std::setw(8) << "N_Iter" - << std::setw(8) << "L_Iter" - << std::setw(8) << "f_eval" - << std::setw(12) << "Cl" - << std::setw(12) << "Cd" - << std::setw(15) << "Rel_Res[phi]" - << std::setw(15) << "Abs_Res[phi]" << std::endl; - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(8) << nIt - << std::setw(8) << 0 - << std::setw(8) << 1 - << std::setw(12) << "-" - << std::setw(12) << "-" - << std::setw(15) << log10(relRes) - << std::setw(15) << log10(absRes) << "\n"; - - do - { - // Viscosity damping - if (relRes < avThrsh && avC < 2) - { - avC++; - rUpwd = true; - } - switch (avC) - { - case 0: - { - mCOv = 0.92; - muCv = 2.; - break; - } - case 1: - { - mCOv = 0.935; - muCv = 1.5; - break; - } - default: - { - mCOv = 0.95; - muCv = 1.; - break; - } - } - - // Build Jacobian matrix - Eigen::SparseMatrix<double, Eigen::RowMajor> J(pbl->msh->nodes.size(), pbl->msh->nodes.size()); - buildJac(J); - - // Solve linear SoE J \DeltaPhi = R - tms["3-Slinsol"].start(); - linsol->compute(J, rPhi_, dPhi_); - tms["3-Slinsol"].stop(); - nIt++; - - // Compute new solution and residual with linesearch - tms["4-Rlnsrch"].start(); - fpe.update(phi, dPhi_); - try - { - ls.run(); - } - catch (...) - { - } - tms["4-Rlnsrch"].stop(); - absRes = rPhi_.norm(); - relRes = absRes / resInit; - // Re-find best upwind element - if (rUpwd) - { - findUpwd(); - rUpwd = false; - } - - // Compute aerodynamic coefficient on boundaries - Solver::computeLoad(); - - // Display residual - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(8) << nIt - << std::setw(8) << linsol->getIterations() - << std::setw(8) << ls.fevalIt - << std::setw(12) << Cl - << std::setw(12) << Cd - << std::setw(15) << log10(relRes) - << std::setw(15) << log10(absRes) << "\n"; - - // Check convergence - if ((relRes < relTol || absRes < absTol) && nIt != 0) - break; - else if (std::isnan(relRes)) - break; - else - continue; - } while (nIt < maxIt); - - // Compute field variables - Solver::computeFlow(); - - // Check the solution - if (relRes < relTol || absRes < absTol) - { - std::cout << ANSI_COLOR_GREEN << "Newton solver converged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Newton solver CPU" << std::endl - << tms; - std::cout << std::endl; - return true; - } - else if (std::isnan(relRes)) - { - std::cout << ANSI_COLOR_RED << "Newton solver diverged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Newton solver CPU" << std::endl - << tms; - std::cout << std::endl; - return false; - } - else - { - std::cout << ANSI_COLOR_YELLOW << "Newton solver not fully converged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Newton solver CPU" << std::endl - << tms; - std::cout << std::endl; - return true; - } -} - -/** - * @brief Build the Jacobian (tangent) matrix - * @authors Adrien Crovato - */ -void Newton::buildJac(Eigen::SparseMatrix<double, Eigen::RowMajor> &J) -{ - // Multithread - tbb::spin_mutex mutex; - - // List of triplets to build Jacobian matrix - std::deque<Eigen::Triplet<double>> T; - - // Full Potential Equation with upwind bias: analytical derivatives - tms["0-Jbase"].start(); - auto fluid = pbl->medium; - tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) { - // Current element - Element *e = p.first; - //Upwind element - Element *eU = p.second[0]; - // Build elementary matrices - Eigen::MatrixXd Ae1, Ae2; - std::tie(Ae1, Ae2) = PotentialResidual::buildGradientFlow(*e, *eU, phi, *fluid, muCv, mCOv); - - // Assembly (subsonic) - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - { - Node *nodj = e->nodes[jj]; - T.push_back(Eigen::Triplet<double>(rows[nodi->row], nodj->row, Ae1(ii, jj))); - } - } - // Assembly (supersonic) - double mach = fluid->mach->eval(*e, phi, 0); - if (mach > mCOv) - { - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < eU->nodes.size(); ++jj) - { - Node *nodj = eU->nodes[jj]; - T.push_back(Eigen::Triplet<double>(rows[nodi->row], nodj->row, Ae2(ii, jj))); - } - } - } - }); - tms["0-Jbase"].stop(); - - // Kutta condition step 2: equality of velocity norm through the wake - // -> add the Kutta equation on the upper wake node rows - // Nishida Thesis, pp. 29-30, Eq. 2.18 - tms["1-Jkutta"].start(); - for (auto wake : pbl->wBCs) - { - tbb::parallel_for_each(wake->wEle.begin(), wake->wEle.end(), [&](WakeElement *we) { - // Build Ku, Kl - Eigen::MatrixXd Aue, Ale; - std::tie(Aue, Ale) = WakeResidual::buildGradientFlow(*we, phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < we->nRow; ++ii) - { - Node *nodi = we->wkN[ii].second; - for (size_t jj = 0; jj < we->nColUp; ++jj) - { - Node *nodj = we->volUpE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, Aue(ii, jj))); - } - for (size_t jj = 0; jj < we->nColLw; ++jj) - { - Node *nodj = we->volLwE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, -Ale(ii, jj))); - } - } - }); - } - // Kutta condition step 3: equality of velocity norm on the Trailing edge (Kutta) - // -> add the Kutta equation on the upper TE node rows (only works for 2D cases) - // Galbraith paper, pp. 7, Eq. 34 - for (auto kutta : pbl->kSCs) - { - tbb::parallel_for_each(kutta->kEle.begin(), kutta->kEle.end(), [&](KuttaElement *ke) { - // Build K - Eigen::MatrixXd Ae = KuttaResidual::buildGradientFlow(*ke, phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < ke->nRow; ++ii) - { - Node *nodi = ke->teN[ii].second; - for (size_t jj = 0; jj < ke->nCol; ++jj) - { - Node *nodj = ke->volE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, Ae(ii, jj))); - } - } - }); - } - tms["1-Jkutta"].stop(); - - // Build Jacobian matrix without BCs - J.setFromTriplets(T.begin(), T.end()); - - // Apply Dirichlet BCs - tms["2-Jdbc"].start(); - for (auto dBC : pbl->dBCs) - { - for (auto nod : dBC->nodes) - { - for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(J, nod->row); it; ++it) - { - if (it.row() == it.col()) - it.valueRef() = 1.; - else - it.valueRef() = 0.; - } - } - } - tms["2-Jdbc"].stop(); - - // Clean matrix and turn to compressed row format - J.prune(0.); - J.makeCompressed(); - - if (verbose > 1) - std::cout << "J (" << J.rows() << "," << J.cols() << ") nnz=" << J.nonZeros() << "\n"; -} - -/** - * @brief Build the residual vector - * @authors Adrien Crovato - */ -void Newton::buildRes(Eigen::Map<Eigen::VectorXd> &R) -{ - // Multithread - tbb::spin_mutex mutex; - - // Reset residual - R.setZero(); - - // Full Potential Equation with upwind bias - auto fluid = pbl->medium; - tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) { - // Current element - Element *e = p.first; - // Upwind element - Element *eU = p.second[0]; - // Build elementary vector - Eigen::VectorXd be = PotentialResidual::build(*e, *eU, phi, *fluid, muCv, mCOv); - // Assembly (subsonic) - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - R(rows[nodi->row]) -= be(ii); - } - }); - // Apply freestream (Neumann) BCs - for (auto nBC : pbl->fBCs) - { - tbb::parallel_for_each(nBC->tag->elems.begin(), nBC->tag->elems.end(), [&](Element *e) { - // Build elementary flux vector - Eigen::VectorXd be = FreestreamResidual::build(*e, phi, *nBC); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - R(rows[nodi->row]) -= be(ii); - } - }); - } - // Apply blowing (transpiration) BCs - for (auto bBC : pbl->bBCs) - { - tbb::parallel_for_each(bBC->uE.begin(), bBC->uE.end(), [&](std::pair<Element *, F0ElC *> p) { - // Build elementary flux vector - Eigen::VectorXd be = BlowingResidual::build(*p.first, phi, *p.second); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < p.first->nodes.size(); ++ii) - { - Node *nodi = p.first->nodes[ii]; - R(rows[nodi->row]) -= be(ii); - } - }); - } - // Slip BCs are naturally enforced in FEM, hence not applied explicitely - - // Kutta condition step 2: equality of velocity norm through the wake - // -> add the Kutta equation on the upper wake node rows - // Nishida Thesis, pp. 29-30, Eq. 2.18 - for (auto wake : pbl->wBCs) - { - tbb::parallel_for_each(wake->wEle.begin(), wake->wEle.end(), [&](WakeElement *we) { - // Build bu, bl - Eigen::VectorXd bue, ble; - std::tie(bue, ble) = WakeResidual::build(*we, phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < we->nRow; ++ii) - { - Node *nodi = we->wkN[ii].second; - R(nodi->row) -= bue(ii); - R(nodi->row) += ble(ii); - } - }); - } - // Kutta condition step 3: equality of velocity norm on the Trailing edge (Kutta) - // -> add the Kutta equation on the upper TE node rows (only works for 2D cases) - // Galbraith paper, pp. 7, Eq. 34 - for (auto kutta : pbl->kSCs) - { - tbb::parallel_for_each(kutta->kEle.begin(), kutta->kEle.end(), [&](KuttaElement *ke) { - // Build b - Eigen::VectorXd be = KuttaResidual::build(*ke, phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < ke->nRow; ++ii) - { - Node *nodi = ke->teN[ii].second; - R(nodi->row) -= be(ii); - } - }); - } - - // Apply Dirichlet BCs - for (auto dBC : pbl->dBCs) - for (auto nod : dBC->nodes) - R(nod->row) = 0.; - - if (verbose > 1) - std::cout << "R (" << R.size() << ")\n"; -} - -/** - * @brief Find upwind element which is best aligned with current velocity vector - * @authors Adrien Crovato - */ -void Newton::findUpwd() -{ - tbb::parallel_for_each(pbl->medium->adjMap.begin(), pbl->medium->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> &p) { - // Opposite velocity vector - Eigen::VectorXd vel_ = -p.first->computeGradient(phi, 0); - vel_.normalize(); - // Best alignement strategy - // -> find (cgU-cgE) \dot vel_ closest to one - double SPbest = -1; - size_t idx = 0; - Eigen::VectorXd cgE = (p.first)->getCg().block(0, 0, pbl->nDim, 1); - for (size_t i = 0; i < p.second.size(); ++i) - { - Eigen::VectorXd cgU = (p.second[i])->getCg().block(0, 0, pbl->nDim, 1); - double SP = (cgU - cgE).normalized().dot(vel_); - if (fabs(SP - 1) < fabs(SPbest - 1)) - { - idx = i; - SPbest = SP; - } - } - // Swap (best upwind element is moved at first emplacement) - Element *tmp = p.second[0]; - p.second[0] = p.second[idx]; - p.second[idx] = tmp; - }); -} - -void Newton::write(std::ostream &out) const -{ - out << "flow::Newton" - << "\n"; -} diff --git a/flow/src/wNewton.h b/flow/src/wNewton.h deleted file mode 100644 index 488fea90..00000000 --- a/flow/src/wNewton.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WNEWTON_H -#define WNEWTON_H - -#include "flow.h" -#include "wSolver.h" - -#include <iostream> -#include <vector> -#include <memory> -#include <Eigen/Sparse> - -namespace flow -{ - -/** - * @brief Newton solver - * @authors Adrien Crovato - */ -class FLOW_API Newton : public Solver -{ - friend class Adjoint; - friend class FpeLSFunction; - -public: - double lsTol; ///< tolerance for line search - int maxLsIt; ///< max number of line search - double avThrsh; ///< residual threshold to deacrease artificial viscosity - -private: - double mCOv; ///< variable cut-off Mach number - double muCv; ///< variable artificial viscosity scaling factor - -public: - Newton(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol); - - virtual bool run() override; - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void buildJac(Eigen::SparseMatrix<double, Eigen::RowMajor> &J); - void buildRes(Eigen::Map<Eigen::VectorXd> &R); - void findUpwd(); -}; - -} // namespace flow - -#endif //WNEWTON_H diff --git a/flow/src/wPicard.cpp b/flow/src/wPicard.cpp deleted file mode 100644 index 07811049..00000000 --- a/flow/src/wPicard.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wPicard.h" -#include "wProblem.h" -#include "wMedium.h" -#include "wAssign.h" -#include "wFreestream.h" -#include "wWake.h" -#include "wKutta.h" -#include "wBlowing.h" -#include "wPotentialResidual.h" -#include "wFreestreamResidual.h" -#include "wWakeResidual.h" -#include "wKuttaResidual.h" -#include "wBlowingResidual.h" - -#include "wMshData.h" -#include "wTag.h" -#include "wNode.h" -#include "wElement.h" -#include "wLinearSolver.h" - -#include <Eigen/Sparse> - -#include <tbb/global_control.h> -#include <tbb/parallel_for_each.h> -#include <tbb/spin_mutex.h> - -#include <iomanip> -#include <deque> - -using namespace tbox; -using namespace flow; - -#define ANSI_COLOR_RED "\x1b[1;31m" -#define ANSI_COLOR_GREEN "\x1b[1;32m" -#define ANSI_COLOR_YELLOW "\x1b[1;33m" -#define ANSI_COLOR_RESET "\x1b[0m" - -/** - * @brief Initialize Picard solver - * @authors Adrien Crovato - */ -Picard::Picard(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol) : Solver(_pbl, _linsol) -{ - // Additional default parameters - relax = 1.; -} - -/** - * @brief Run the Picard sovler - * - * Solve the steady subsonic Full Potential Equation - * @authors Adrien Crovato - */ -bool Picard::run() -{ - // Multithread - tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads); - - // Display solver and problem parameters - std::cout << "--- Picard solver ---\n" - << "Inner solver: " << *linsol - << std::setprecision(5) - << "Number of threads: " << nthreads << "\n" - << "Relative tolerance: " << log10(relTol) << "\n" - << "Absolute tolerance: " << log10(absTol) << "\n" - << "Maximum iterations: " << maxIt << "\n"; - std::cout << "--- Problem definition ---\n" - << std::setprecision(5) - << "Angle of attack: " << pbl->alpha * 180 / 3.14159 << " deg\n" - << "Angle of sideslip: " << pbl->beta * 180 / 3.14159 << " deg\n" - << "Mach number: " << pbl->M_inf << "\n" - << "Reference area: " << pbl->S_ref << "\n" - << "Reference length: " << pbl->c_ref << "\n" - << "Reference origin: (" << pbl->x_ref(0) << ", " << pbl->x_ref(1) << ", " << pbl->x_ref(2) << ")\n" - << std::endl; - - // Initialize solver loop - nIt = 0; - double resInit = 1.; - double absRes = 1., relRes = 1.; - // Solution, residual and old solution - Eigen::Map<Eigen::VectorXd> phi_(phi.data(), phi.size()), rPhi_(rPhi.data(), rPhi.size()); - Eigen::VectorXd phiOld(phi.size()); - - std::cout << std::setw(8) << "N_Iter" - << std::setw(12) << "Cl" - << std::setw(12) << "Cd" - << std::setw(15) << "Rel_Res[phi]" - << std::setw(15) << "Abs_Res[phi]" << std::endl; - - do - { - // Reinitialize SoE - Eigen::SparseMatrix<double, Eigen::RowMajor> A(pbl->msh->nodes.size(), pbl->msh->nodes.size()); - std::vector<double> b(pbl->msh->nodes.size()); // dummy b vector - Eigen::Map<Eigen::VectorXd> b_ = Eigen::Map<Eigen::VectorXd>(b.data(), b.size()); - - // Build system of equations A \phi = b - build(A, b); - - // Compute residual - rPhi_ = A * phi_ - b_; - if (nIt == 0) - resInit = rPhi_.norm(); - absRes = rPhi_.norm(); - relRes = absRes / resInit; - - // Compute aerodynamic coefficient on boundaries - Solver::computeLoad(); - - // Display residual - std::cout << std::fixed << std::setprecision(5); - std::cout << std::setw(8) << nIt - << std::setw(12) << Cl - << std::setw(12) << Cd - << std::setw(15) << log10(relRes) - << std::setw(15) << log10(absRes) << "\n"; - - // Check convergence - if ((relRes < relTol || absRes < absTol) && nIt != 0) - break; - else if (std::isnan(relRes)) - break; - nIt++; - - // Transfer old solution - phiOld = phi_; - - // Solve linear SoE - tms["4-Slinsol"].start(); - linsol->compute(A, b_, phi_); - tms["4-Slinsol"].stop(); - - // Relaxation - phi_ = (1 - relax) * phiOld + relax * phi_; - } while (nIt < maxIt); - - // Compute field variables - Solver::computeFlow(); - - // Check the solution - if (relRes < relTol || absRes < absTol) - { - std::cout << ANSI_COLOR_GREEN << "Picard solver converged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Picard solver CPU" << std::endl - << tms; - std::cout << std::endl; - return true; - } - else if (std::isnan(relRes)) - { - std::cout << ANSI_COLOR_RED << "Picard sovler diverged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Picard solver CPU" << std::endl - << tms; - std::cout << std::endl; - return false; - } - else - { - std::cout << ANSI_COLOR_YELLOW << "Picard solver not fully converged!" << ANSI_COLOR_RESET << std::endl; - if (verbose > 0) - std::cout << "Picard solver CPU" << std::endl - << tms; - std::cout << std::endl; - return true; - } -} - -/** - * @brief Build LHS matrix and RHS vector for Picard iteration - * @authors Adrien Crovato - */ -void Picard::build(Eigen::SparseMatrix<double, Eigen::RowMajor> &A, std::vector<double> &b) -{ - // Multithread - tbb::spin_mutex mutex; - - // List of triplets to build matrix - std::deque<Eigen::Triplet<double>> T; - - // Full Potential Equation: analytical derivatives - tms["0-Abase"].start(); - auto fluid = pbl->medium; - tbb::parallel_for_each(fluid->adjMap.begin(), fluid->adjMap.end(), [&](std::pair<Element *, std::vector<Element *>> p) { - // Current element - Element *e = p.first; - - // Elementary stiffness - Eigen::MatrixXd Ae = PotentialResidual::buildFixed(*e, phi, *fluid); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - { - Node *nodj = e->nodes[jj]; - T.push_back(Eigen::Triplet<double>(rows[nodi->row], nodj->row, Ae(ii, jj))); - } - } - }); - tms["0-Abase"].stop(); - - // Kutta condition step 2: equality of velocity norm through the wake - // -> add the Kutta equation on the upper wake node lines - // Nishida Thesis, pp. 29-30, Eq. 2.18 - tms["1-Akutta"].start(); - for (auto wake : pbl->wBCs) - { - tbb::parallel_for_each(wake->wEle.begin(), wake->wEle.end(), [&](WakeElement *we) { - // Build Ku, Kl - Eigen::MatrixXd Aue, Ale; - std::tie(Aue, Ale) = WakeResidual::buildFixed(*we, phi); - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < we->nRow; ++ii) - { - Node *nodi = we->wkN[ii].second; - for (size_t jj = 0; jj < we->nColUp; ++jj) - { - Node *nodj = we->volUpE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, Aue(ii, jj))); - } - for (size_t jj = 0; jj < we->nColLw; ++jj) - { - Node *nodj = we->volLwE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, -Ale(ii, jj))); - } - } - }); - } - // Kutta condition step 3: equality of velocity norm on the Trailing edge (Kutta) - // -> add the Kutta equation on the upper TE node lines (only works for 2D cases) - // Galbraith paper, pp. 7, Eq. 34 - for (auto kutta : pbl->kSCs) - { - tbb::parallel_for_each(kutta->kEle.begin(), kutta->kEle.end(), [&](KuttaElement *ke) { - // Build K - Eigen::MatrixXd Ae = KuttaResidual::buildFixed(*ke, phi); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < ke->nRow; ++ii) - { - Node *nodi = ke->teN[ii].second; - for (size_t jj = 0; jj < ke->nCol; ++jj) - { - Node *nodj = ke->volE->nodes[jj]; - T.push_back(Eigen::Triplet<double>(nodi->row, nodj->row, Ae(ii, jj))); - } - } - }); - } - tms["1-Akutta"].stop(); - - // Fill vector b: loop on all Neumann boundaries (except slip condition which are naturally enforced) - tms["2-bnbc"].start(); - for (auto nBC : pbl->fBCs) - { - tbb::parallel_for_each(nBC->tag->elems.begin(), nBC->tag->elems.end(), [&](Element *e) { - // Build elementary flux vector - Eigen::VectorXd be = FreestreamResidual::build(*e, phi, *nBC); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - b[rows[nodi->row]] -= be(ii); - } - }); - } - // Apply blowing (transpiration) BCs - for (auto bBC : pbl->bBCs) - { - tbb::parallel_for_each(bBC->uE.begin(), bBC->uE.end(), [&](std::pair<Element *, F0ElC *> p) { - // Build elementary flux vector - Eigen::VectorXd be = BlowingResidual::build(*p.first, phi, *p.second); - - // Assembly - tbb::spin_mutex::scoped_lock lock(mutex); - for (size_t ii = 0; ii < p.first->nodes.size(); ++ii) - { - Node *nodi = p.first->nodes[ii]; - b[rows[nodi->row]] -= be(ii); - } - }); - } - tms["2-bnbc"].stop(); - - // Build matrix without BCs - A.setFromTriplets(T.begin(), T.end()); - - // Apply Dirichlet BCs to A matrix and b vector - tms["3-Abdbc"].start(); - for (auto dBC : pbl->dBCs) - { - for (auto nod : dBC->nodes) - { - for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(A, nod->row); it; ++it) - { - if (it.row() == it.col()) - it.valueRef() = 1.; - else - it.valueRef() = 0.; - } - } - dBC->apply(b); - } - tms["3-Abdbc"].stop(); - - // Clean matrix and turn to compressed row format - A.prune(0.); - A.makeCompressed(); - - if (verbose > 1) - { - std::cout << "A (" << A.rows() << "," << A.cols() << ") nnz=" << A.nonZeros() << "\n"; - std::cout << "b (" << b.size() << ")\n"; - } -} - -void Picard::write(std::ostream &out) const -{ - out << "flow::Picard" - << "\n"; -} diff --git a/flow/src/wPicard.h b/flow/src/wPicard.h deleted file mode 100644 index fb9cb73c..00000000 --- a/flow/src/wPicard.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WPICARD_H -#define WPICARD_H - -#include "flow.h" -#include "wSolver.h" - -#include <iostream> -#include <vector> -#include <memory> -#include <Eigen/Sparse> - -namespace flow -{ - -/** - * @brief Picard solver - * @authors Adrien Crovato - */ -class FLOW_API Picard : public Solver -{ -public: - double relax; ///< relaxation - -public: - Picard(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol); - - virtual bool run() override; - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void build(Eigen::SparseMatrix<double, Eigen::RowMajor> &A, std::vector<double> &b); -}; - -} // namespace flow - -#endif //WPICARD_H diff --git a/flow/src/wPotentialResidual.cpp b/flow/src/wPotentialResidual.cpp deleted file mode 100644 index ee86e495..00000000 --- a/flow/src/wPotentialResidual.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wPotentialResidual.h" -#include "wMedium.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Build the residual matrix for a fixed-point iteration, on one element - * - * A = \int rho * grad_phi * grad_psi dV - */ -Eigen::MatrixXd PotentialResidual::buildFixed(Element const &e, std::vector<double> const &phi, Medium const &fluid) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Build - Eigen::MatrixXd A = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Shape functions gradient - Eigen::MatrixXd const &dSf = e.getJinv(k) * cache.getDsf(k); - // Elementary stiffness matrix - A += dSf.transpose() * dSf * fluid.rho->eval(e, phi, k) * gauss.getW(k) * e.getDetJ(k); - } - return A; -} - -/** - * @brief Build the residual vector, on one element - * - * b = \int ( (1-mu)*rho + mu*rhoU ) * grad_phi * grad_psi dV - */ -Eigen::VectorXd PotentialResidual::build(Element const &e, Element const &eU, std::vector<double> const &phi, Medium const &fluid, double muC, double mCO) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Subsonic contribution - Eigen::VectorXd b = Eigen::VectorXd::Zero(e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - b += fluid.rho->eval(e, phi, k) * (e.getJinv(k) * cache.getDsf(k)).transpose() * e.computeGradient(phi, k) * gauss.getW(k) * e.getDetJ(k); - - // Supersonic contribution - double mach = fluid.mach->eval(e, phi, 0); - if (mach > mCO) - { - double mu = muC * (1 - (mCO * mCO) / (mach * mach)); // switching function - double rhoU = fluid.rho->eval(eU, phi, 0); // density on upwind element - // scale 1st term - b *= 1 - mu; - // contribution of upwind element - for (size_t k = 0; k < gauss.getN(); ++k) - b += mu * rhoU * (e.getJinv(k) * cache.getDsf(k)).transpose() * e.computeGradient(phi, k) * gauss.getW(k) * e.getDetJ(k); - } - return b; -} - -/** - * @brief Build the gradient of the residual vector with respect to the flow variable (jacobian), on one element - * - * A = \int d( (1-mu)*rho + mu*rhoU ) * grad_phi * grad_psi dV - * = \int (1-mu)*drho * grad_phi * grad_psi dV - * + \int mu*drhoU * grad_phi * grad_psi dV - * + \int ( (1-mu)*rho + mu*rhoU ) * dgrad_phi * grad_psi dV - * + \int (rhoU - rho)*dmu * grad_phi * grad_psi dV - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> PotentialResidual::buildGradientFlow(tbox::Element const &e, tbox::Element const &eU, std::vector<double> const &phi, Medium const &fluid, double muC, double mCO) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Subsonic contribution - Eigen::MatrixXd A1 = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Gauss point and determinant - double wdj = gauss.getW(k) * e.getDetJ(k); - // Shape functions and solution gradient - Eigen::MatrixXd const &dSf = e.getJinv(k) * cache.getDsf(k); - Eigen::VectorXd dPhi = e.computeGradient(phi, k); - - // rho * grad_phi*grad_psi + drho * grad_phi*grad_psi - A1 += fluid.rho->eval(e, phi, k) * dSf.transpose() * dSf * wdj; - A1 += fluid.rho->evalGrad(e, phi, k) * dSf.transpose() * dPhi * dPhi.transpose() * dSf * wdj; - } - - // Supersonic contribution - Eigen::MatrixXd A2; - double mach = fluid.mach->eval(e, phi, 0); - if (mach > mCO) - { - // switching function and gradient - double mu = muC * (1 - (mCO * mCO) / (mach * mach)); - double dmu = 2 * muC * mCO * mCO / (mach * mach * mach); - // density and gradients on upwind elements - Eigen::VectorXd dPhiU = eU.computeGradient(phi, 0); - double rhoU = fluid.rho->eval(eU, phi, 0); - double dRhoU = fluid.rho->evalGrad(eU, phi, 0); - Eigen::MatrixXd const &dSfU = eU.getJinv(0) * eU.getVCache().getDsf(0); - - // upwinding - A1 *= 1 - mu; - A2 = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Gauss point and determinant - double wdj = gauss.getW(k) * e.getDetJ(k); - // Shape functions and solution gradient - Eigen::MatrixXd const &dSf = e.getJinv(k) * cache.getDsf(k); - Eigen::VectorXd dPhi = e.computeGradient(phi, k); - - // mu*drhoU*grad_phi*grad_psi - A2 += mu * dRhoU * dSf.transpose() * dPhi * dPhiU.transpose() * dSfU * wdj; - // mu*rhoU*grad_phi*grad_psi + dmu*(rhoU-rho)*grad_phi*grad_psi - A1 += mu * rhoU * dSf.transpose() * dSf * wdj; - A1 += dmu * (rhoU - fluid.rho->eval(e, phi, k)) * fluid.mach->evalGrad(e, phi, k) * dSf.transpose() * dPhi * dPhi.transpose() * dSf * wdj; - } - } - return std::make_tuple(A1, A2); -} - -/** - * @brief Build the gradient of the residual vector with respect to the nodes, on one element - * - * A = d( \int ( (1-mu)*rho + mu*rhoU ) * grad_phi * grad_psi dV ) - * = \int (1-mu)*drho * grad_phi * grad_psi dV - * + \int mu*drhoU * grad_phi * grad_psi dV - * + \int ( (1-mu)*rho + mu*rhoU ) * dgrad_phi * grad_psi dV - * + \int ( (1-mu)*rho + mu*rhoU ) * grad_phi * dgrad_psi dV - * + \int (rhoU - rho)*dmu * grad_phi * grad_psi dV - * + \int ( (1-mu)*rho + mu*rhoU ) * grad_phi * grad_psi ddV - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> PotentialResidual::buildGradientMesh(tbox::Element const &e, tbox::Element const &eU, std::vector<double> const &phi, Medium const &fluid, int nDim, double muC, double mCO) -{ - // Get pre-computed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Subsonic contribution - Eigen::MatrixXd A1 = Eigen::MatrixXd::Zero(e.nodes.size(), nDim * e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Density and gradients - Eigen::VectorXd dPhi = e.computeGradient(phi, k); - double rho = fluid.rho->eval(e, phi, k); - double dRho = fluid.rho->evalGrad(e, phi, k); - Eigen::MatrixXd const &dSf = cache.getDsf(k); - Eigen::MatrixXd const &iJ = e.getJinv(k); - // Jacobian gradients - std::vector<Eigen::MatrixXd> const &dJ = e.getGradJ(k); - std::vector<double> const &dDetJ = e.getGradDetJ(k); - // Gauss points and determinant - double w = gauss.getW(k); - double detJ = e.getDetJ(k); - for (size_t i = 0; i < e.nodes.size(); ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - A1.col(idx) += w * dRho * dPhi.transpose() * (-iJ * dJ[idx] * dPhi) * (iJ * dSf).transpose() * dPhi * detJ; // drho * grad_phi*grad_psi * detj - A1.col(idx) += w * rho * (iJ * dSf).transpose() * (-iJ * dJ[idx] * dPhi) * detJ; // rho * dgrad_phi * grad_psi * detj - A1.col(idx) += w * rho * (-iJ * dJ[idx] * iJ * dSf).transpose() * dPhi * detJ; // rho * grad_phi * dgrad_psi * detj - A1.col(idx) += w * rho * (iJ * dSf).transpose() * dPhi * dDetJ[idx]; // rho * grad_phi * grad_psi * ddetj - } - } - } - // Supersonic contribution - Eigen::MatrixXd A2; - double mach = fluid.mach->eval(e, phi, 0); - if (mach > mCO) - { - // switching function and gradient - double mu = muC * (1 - (mCO * mCO) / (mach * mach)); - double dmu = 2 * muC * mCO * mCO / (mach * mach * mach); - // upwind density and gradient - Eigen::VectorXd dPhiU = eU.computeGradient(phi, 0); - double rhoU = fluid.rho->eval(eU, phi, 0); - double dRhoU = fluid.rho->evalGrad(eU, phi, 0); - Eigen::MatrixXd const &iJU = eU.getJinv(0); - std::vector<Eigen::MatrixXd> const &dJU = eU.getGradJ(0); - - // upwinding - A1 *= 1 - mu; - A2 = Eigen::MatrixXd::Zero(e.nodes.size(), nDim * eU.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Density, Mach and Gradients - Eigen::VectorXd dPhi = e.computeGradient(phi, k); - double rho = fluid.rho->eval(e, phi, k); - double dM = fluid.mach->evalGrad(e, phi, k); - Eigen::MatrixXd const &dSf = cache.getDsf(k); - Eigen::MatrixXd const &iJ = e.getJinv(k); - // Jacobian gradients - std::vector<Eigen::MatrixXd> const &dJ = e.getGradJ(k); - std::vector<double> const &dDetJ = e.getGradDetJ(k); - // Gauss points and determinant - double w = gauss.getW(k); - double detJ = e.getDetJ(k); - for (size_t m = 0; m < nDim; ++m) - { - for (size_t i = 0; i < e.nodes.size(); ++i) - { - size_t idx = i * nDim + m; - A1.col(idx) += w * mu * rhoU * (iJ * dSf).transpose() * (-iJ * dJ[idx] * dPhi) * detJ; // mu * rhoU * dgrad_phi * grad_psi * detj - A1.col(idx) += w * mu * rhoU * (-iJ * dJ[idx] * iJ * dSf).transpose() * dPhi * detJ; // mu * rhoU * grad_phi * dgrad_psi * detj - A1.col(idx) += w * mu * rhoU * (iJ * dSf).transpose() * dPhi * dDetJ[idx]; // mu * rhoU * grad_phi * grad_psi * ddetj - A1.col(idx) += w * (-rho + rhoU) * dmu * dM * dPhi.transpose() * (-iJ * dJ[idx] * dPhi) * (iJ * dSf).transpose() * dPhi * detJ; // (rhoU-rho) * dmu * grad_phi * grad_psi * detj - } - for (size_t i = 0; i < eU.nodes.size(); ++i) - { - size_t idx = i * nDim + m; - A2.col(idx) += w * mu * dRhoU * dPhiU.transpose() * (-iJU * dJU[idx] * dPhiU) * (iJ * dSf).transpose() * dPhi * detJ; // mu * drhoU * grad_phi * grad_psi * detj - } - } - } - } - return std::make_tuple(A1, A2); -} diff --git a/flow/src/wPotentialResidual.h b/flow/src/wPotentialResidual.h deleted file mode 100644 index 1db6f196..00000000 --- a/flow/src/wPotentialResidual.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WPOTENTIALRESIDUAL_H -#define WPOTENTIALRESIDUAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of nonlinear potential equation residuals - * @todo mu as F0ElMu? - * @todo split stabilization terms from subsonic terms? - */ -class FLOW_API PotentialResidual -{ -public: - // Picard - static Eigen::MatrixXd buildFixed(tbox::Element const &e, std::vector<double> const &phi, Medium const &fluid); - // Newton - static Eigen::VectorXd build(tbox::Element const &e, tbox::Element const &eU, std::vector<double> const &phi, Medium const &fluid, double muC, double mCO); - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildGradientFlow(tbox::Element const &e, tbox::Element const &eU, std::vector<double> const &phi, Medium const &fluid, double muC, double mCO); - // Adjoint - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildGradientMesh(tbox::Element const &e, tbox::Element const &eU, std::vector<double> const &phi, Medium const &fluid, int nDim, double muC, double mCO); -}; - -} // namespace flow -#endif //WPOTENTIALRESIDUAL_H diff --git a/flow/src/wProblem.cpp b/flow/src/wProblem.cpp deleted file mode 100644 index eef94cf6..00000000 --- a/flow/src/wProblem.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wProblem.h" -#include "wElement.h" -#include "wMedium.h" -#include "wBoundary.h" -#include "wAssign.h" -#include "wFreestream.h" -#include "wWake.h" -#include "wKutta.h" -#include "wBlowing.h" -using namespace tbox; -using namespace flow; - -Problem::Problem(std::shared_ptr<MshData> _msh, int dim, double aoa, double aos, - double minf, double sref, double cref, double xref, - double yref, double zref) : msh(_msh), nDim(dim), alpha(aoa), - beta(aos), M_inf(minf), - S_ref(sref), c_ref(cref), - x_ref(xref, yref, zref), - dirD(dim, sref, aoa, aos), - dirS(dim, sref, aoa, aos), - dirL(dim, sref, aoa, aos) -{ - obs.push_back(&dirD); - obs.push_back(&dirS); - obs.push_back(&dirL); -} - -/** - * @brief Set the fluid medium - */ -void Problem::set(std::shared_ptr<Medium> m) -{ - medium = m; - obs.push_back(m->phiInf); -} - -/** - * @brief Add a boundary surface - */ -void Problem::add(std::shared_ptr<Boundary> b) -{ - bnds.push_back(b); -} - -/** - * @brief Add initial condition - */ -void Problem::set(std::shared_ptr<Initial> i) -{ - iIC = i; - obs.push_back(i->f); -} - -/** - * @brief Add Dirichlet boundary condition - */ -void Problem::add(std::shared_ptr<Dirichlet> d) -{ - dBCs.push_back(d); - obs.push_back(d->f); -} - -/** - * @brief Add freestream (Neumann) boundary condition - */ -void Problem::add(std::shared_ptr<Freestream> f) -{ - fBCs.push_back(f); - obs.push_back(f->f); -} - -/** - * @brief Add wake boundary condition - */ -void Problem::add(std::shared_ptr<Wake> w) -{ - wBCs.push_back(w); -} - -/** - * @brief Add Kutta condition - */ -void Problem::add(std::shared_ptr<Kutta> k) -{ - kSCs.push_back(k); -} - -/** - * @brief Add Blowing boundary condition - */ -void Problem::add(std::shared_ptr<Blowing> b) -{ - bBCs.push_back(b); -} - -/** - * @brief Update the angle of attack - */ -void Problem::update(double aoa) -{ - alpha = aoa; - for (auto o : obs) - o->update(aoa); -} - -/** - * @brief Initialize the elements precomputed values - */ -void Problem::initElems() -{ - // Update volume - for (auto e : medium->tag->elems) - e->initValues(true, 1); - // Update surface (boundaries) - for (auto surf : bnds) - for (auto e : surf->groups[0]->tag->elems) - e->initValues(false); - // Update surface (Freestream B.C.) - for (auto surf : fBCs) - for (auto e : surf->tag->elems) - e->initValues(false); - // Update surface (Wake B.C.) - for (auto surf : wBCs) - { - for (auto e : surf->groups[0]->tag->elems) - e->initValues(false); - for (auto e : surf->groups[1]->tag->elems) - e->initValues(false); - } - // Update surface (Blowing B.C.) if not already done - for (auto surf : bBCs) - for (auto e : surf->tag->elems) - if (!(e->hasValues())) - e->initValues(false); -} - -/** - * @brief Initialize the elements precomputed gradients - */ -void Problem::initGradElems() -{ - // Update volume - for (auto e : medium->tag->elems) - e->initGradients(); - // Update surface (boundaries) - for (auto surf : bnds) - for (auto e : surf->groups[0]->tag->elems) - e->initGradients(); - // Update surface (Wake B.C.) - for (auto surf : wBCs) - { - for (auto e : surf->groups[0]->tag->elems) - e->initGradients(); - for (auto e : surf->groups[1]->tag->elems) - e->initGradients(); - } - // Update surface (Blowing B.C.) if not already done - for (auto surf : bBCs) - for (auto e : surf->tag->elems) - if (!(e->hasGradients())) - e->initGradients(); -} - -/** - * @brief Pin a degree of freedom if no Dirichlet BC is explicitely provided - */ -void Problem::pin() -{ - if (dBCs.empty()) - this->add(std::make_shared<Dirichlet>(msh, fBCs.front()->tag->no, nDim, alpha, beta, true)); -} - -/** - * @brief Check that Problem is not empty and that elements are supported - */ -void Problem::check() const -{ - // Sanity checks - if (medium == NULL) - throw std::runtime_error("No Medium provided!\n"); - if (iIC == NULL) - throw std::runtime_error("No Initial Condition provided!\n"); - if (fBCs.empty()) - throw std::runtime_error("No Freestream B.C. provided!\n"); - if (wBCs.empty()) - throw std::runtime_error("No Wake B.C. provided!\n"); - // Three-dimension problem - if (nDim == 3) - { - // Volume element type - for (auto e : medium->tag->elems) - { - if (e->type() != ELTYPE::TETRA4) - { - std::stringstream err; - err << "3D solver is only implemented for volume elements of type " - << ELTYPE::TETRA4 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - // Surface element type (Freestream B.C.) - for (auto surf : fBCs) - { - for (auto e : surf->tag->elems) - { - if (e->type() != ELTYPE::TRI3) - { - std::stringstream err; - err << "3D solver is only implemented for surface elements of type " - << ELTYPE::TRI3 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - } - // Surface element type (Wake B.C.) - for (auto surf : wBCs) - { - for (auto e : surf->groups[0]->tag->elems) - { - if (e->type() != ELTYPE::TRI3) - { - std::stringstream err; - err << "3D solver is only implemented for surface elements of type " - << ELTYPE::TRI3 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - for (auto e : surf->groups[1]->tag->elems) - { - if (e->type() != ELTYPE::TRI3) - { - std::stringstream err; - err << "3D solver is only implemented for surface elements of type " - << ELTYPE::TRI3 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - } - // Blowing B.C. - if (!bBCs.empty()) - throw std::runtime_error("Blowing boundary conditions are not supported for 3D problems!\n"); - } - // Two-dimension problem - else if (nDim == 2) - { - // Volume element type - for (auto e : medium->tag->elems) - { - if (e->type() != ELTYPE::TRI3) - { - std::stringstream err; - err << "2D solver is only implemented for volume elements of type " - << ELTYPE::TRI3 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - // Surface element type (Freestream B.C.) - for (auto surf : fBCs) - { - for (auto e : surf->tag->elems) - { - if (e->type() != ELTYPE::LINE2) - { - std::stringstream err; - err << "2D solver is only implemented for surface elements of type " - << ELTYPE::LINE2 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - } - // Surface element type (Wake B.C.) - for (auto surf : wBCs) - { - for (auto e : surf->groups[0]->tag->elems) - { - if (e->type() != ELTYPE::LINE2) - { - std::stringstream err; - err << "2D solver is only implemented for surface elements of type " - << ELTYPE::LINE2 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - for (auto e : surf->groups[1]->tag->elems) - { - if (e->type() != ELTYPE::LINE2) - { - std::stringstream err; - err << "2D solver is only implemented for surface elements of type " - << ELTYPE::LINE2 << " (" << e->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - } - } - } - else - { - std::stringstream err; - err << "Solver is only implemented for 2D or 3D problems (dimension " - << nDim << " was given)!\n"; - throw std::runtime_error(err.str()); - } -} - -void Problem::write(std::ostream &out) const -{ - out << "flow::Problem parameters" - << "\n\tDimension: " << nDim - << "\n\tAngle of attack: " << alpha - << "\n\tAngle of sideslip: " << beta - << "\n\tFreestream Mach number: " << M_inf - << "\n\tReference area: " << S_ref - << "\n\tReference length: " << c_ref - << "\n\tReference point: [" << x_ref(0) << ", " << x_ref(1) << ", " << x_ref(2) << ']' - << std::endl; - out << "with" - << "\n\t" << *medium; - for (auto b : bnds) - out << "\n\t" << *b; - out << "\n\t" << *iIC; - for (auto d : dBCs) - out << "\n\t" << *d; - for (auto f : fBCs) - out << "\n\t" << *f; - for (auto w : wBCs) - out << "\n\t" << *w; - for (auto k : kSCs) - out << "\n\t" << *k; - for (auto b : bBCs) - out << "\n\t" << *b; -} diff --git a/flow/src/wProblem.h b/flow/src/wProblem.h deleted file mode 100644 index b2f98f34..00000000 --- a/flow/src/wProblem.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WPROBLEM_H -#define WPROBLEM_H - -#include "flow.h" -#include "wObject.h" -#include "wF1Ct.h" -#include <memory> -#include <iostream> -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Manage the problem - * - * Contains freestream definition, reference values and physical groups - * @authors Adrien Crovato - */ -class FLOW_API Problem : public fwk::wSharedObject -{ -public: - std::shared_ptr<tbox::MshData> msh; ///< Mesh structure - int nDim; ///< Problem dimension - // Freestream - double alpha; ///< Angle of attack - double beta; ///< Angle of sideslip - double M_inf; ///< Mach number - // Reference values - double S_ref; ///< Reference surface - double c_ref; ///< Reference chord - Eigen::Vector3d x_ref; ///< Reference center point (for moment computation) -#ifndef SWIG - // Loads direction - F1CtDrag dirD; // drag - F1CtSide dirS; // sideforce - F1CtLift dirL; // lift - // Physical groups - std::shared_ptr<Medium> medium; ///< Fluid - std::vector<std::shared_ptr<Boundary>> bnds; ///< Boundaries - std::shared_ptr<Initial> iIC; ///< Initial condition - std::vector<std::shared_ptr<Dirichlet>> dBCs; ///< Dirichlet boundary conditions - std::vector<std::shared_ptr<Freestream>> fBCs; ///< Freestream boundary conditions - std::vector<std::shared_ptr<Wake>> wBCs; ///< Wake boundary condition - std::vector<std::shared_ptr<Kutta>> kSCs; ///< Kutta condition - std::vector<std::shared_ptr<Blowing>> bBCs; ///< Blowing (transpiration) boundary condition - // Observers - std::vector<fwk::Observer *> obs; ///< classes depending on problem variables -#endif - - Problem(std::shared_ptr<tbox::MshData> _msh, int dim, double aoa, double aos, - double minf, double sref, double cref, double xref, double yref, - double zref); - virtual ~Problem() { std::cout << "~Problem()\n"; } - - void set(std::shared_ptr<Medium> m); - void add(std::shared_ptr<Boundary> b); - void set(std::shared_ptr<Initial> i); - void add(std::shared_ptr<Dirichlet> d); - void add(std::shared_ptr<Freestream> f); - void add(std::shared_ptr<Wake> w); - void add(std::shared_ptr<Kutta> k); - void add(std::shared_ptr<Blowing> b); - void update(double aoa); - -#ifndef SWIG - void check() const; - void pin(); - void initElems(); - void initGradElems(); - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace flow - -#endif //WPROBLEM_H diff --git a/flow/src/wSolver.cpp b/flow/src/wSolver.cpp deleted file mode 100644 index b5dc19ca..00000000 --- a/flow/src/wSolver.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wSolver.h" -#include "wProblem.h" -#include "wMedium.h" -#include "wAssign.h" -#include "wBoundary.h" -#include "wWake.h" -#include "wLoadFunctional.h" - -#include "wMshData.h" -#include "wNode.h" -#include "wElement.h" -#include "wTag.h" -#include "wResults.h" -#include "wMshExport.h" - -#include <tbb/parallel_for_each.h> -#include <tbb/spin_mutex.h> - -using namespace tbox; -using namespace flow; - -#define ANSI_COLOR_YELLOW "\x1b[1;33m" -#define ANSI_COLOR_RESET "\x1b[0m" - -/** - * @brief Initialize the solver and perform sanity checks - * @authors Adrien Crovato - */ -Solver::Solver(std::shared_ptr<Problem> _pbl, std::shared_ptr<LinearSolver> _linsol) : pbl(_pbl), linsol(_linsol), nIt(0), Cl(0), Cd(0), Cs(0), Cm(0) -{ - // Say hi - std::cout << std::endl; - std::cout << "*******************************************************************************" << std::endl; - std::cout << "** \\_/ **" << std::endl; - std::cout << "** \\_______O(_)O_______/ **" << std::endl; - std::cout << "** **" << std::endl; - std::cout << "** ___ _ **" << std::endl; - std::cout << "** | __| | | __ __ __ **" << std::endl; - std::cout << "** | __| | | / \\ \\ \\_/ / **" << std::endl; - std::cout << "** |_| |_| \\__/ \\/ \\/ **" << std::endl; - std::cout << "*******************************************************************************" << std::endl; - std::cout << "** Hi! My name is Flow v1.8-21.06 **" << std::endl; - std::cout << "** Adrien Crovato & Romain Boman **" << std::endl; - std::cout << "** ULiege 2018-2021 **" << std::endl; - std::cout << "*******************************************************************************" << std::endl - << std::endl; - - // Default parameters - nthreads = 1; - verbose = 0; - maxIt = 50; - relTol = 1e-6; - absTol = 1e-8; - - // Check the problem, pin a degree of freedom if necessary, and update element memory - pbl->check(); - pbl->pin(); - pbl->initElems(); - - // Assign a row (unknown index) for each node, and setup the local list - rows.resize(pbl->msh->nodes.size()); - for (size_t i = 0; i < pbl->msh->nodes.size(); ++i) - rows[i] = pbl->msh->nodes[i]->row; - - // Setup variables (unkwown vector) - phi.resize(pbl->msh->nodes.size(), 0.); - rPhi.resize(pbl->msh->nodes.size(), 0.); - vPhi.resize(pbl->msh->nodes.size(), 0.); - U.resize(pbl->msh->nodes.size(), Eigen::Vector3d::Zero()); - rho.resize(pbl->msh->nodes.size(), 0.); - M.resize(pbl->msh->nodes.size(), 0.); - Cp.resize(pbl->msh->nodes.size(), 0.); - - // Apply Initial and Dirichlet boundary conditions - pbl->iIC->apply(phi); - for (auto dBC : pbl->dBCs) - dBC->apply(phi); - - // Kutta condition step 1: equality of normal flux through the wake - // -> directly assemble upper wake contributions on lower wake rows, and leave the upper wake rows to zero - // Nishida Thesis, pp. 29, Eq 2.17, Galbraith paper, pp. 5, Eq. 27 - for (auto wake : pbl->wBCs) - for (auto p : wake->nodMap) - rows[p.first->row] = p.second->row; -} -Solver::~Solver() -{ - // Say bye - std::cout << std::endl; - std::cout << "*******************************************************************************" << std::endl; - std::cout << "** \\_/ **" << std::endl; - std::cout << "** \\_______O(_)O_______/ **" << std::endl; - std::cout << "** ! ! **" << std::endl; - std::cout << "*******************************************************************************" << std::endl; - std::cout << std::endl; -} - -/** - * @brief Dummy run - * @authors Adrien Crovato - */ -bool Solver::run() -{ - throw std::runtime_error("flow::Solver::run not implemented!\n"); -} - -/** - * @brief Write the results - * @authors Adrien Crovato - */ -void Solver::save(MshExport *mshWriter, int n) -{ - // Write files - std::cout << "Saving files... " << std::endl; - // setup results - Results results; - results.scalars_at_nodes["phi"] = φ - results.scalars_at_nodes["varPhi"] = &vPhi; - results.scalars_at_nodes["resPhi"] = &rPhi; - results.vectors_at_nodes["U"] = &U; - results.scalars_at_nodes["rho"] = ρ - results.scalars_at_nodes["Mach"] = &M; - results.scalars_at_nodes["Cp"] = &Cp; - // save (all mesh and boundary surface) - if (n > 0) - { - mshWriter->save(pbl->msh->name + "_" + std::to_string(n), results); - for (auto sur : pbl->bnds) - sur->save(sur->groups[0]->tag->name + "_" + std::to_string(n), results); - } - else - { - mshWriter->save(pbl->msh->name, results); - for (auto sur : pbl->bnds) - sur->save(sur->groups[0]->tag->name, results); - } -} - -/** - * @brief Compute total aerodynamic load coefficients on boundaries - * @authors Adrien Crovato - */ -void Solver::computeLoad() -{ - // Reset coefficients and compute loads - Cl = 0; - Cd = 0; - Cs = 0; - Cm = 0; - for (auto sur : pbl->bnds) - { - // Reset - std::fill(sur->nLoads.begin(), sur->nLoads.end(), Eigen::Vector3d::Zero()); - - // Compute pressure loads coefficient (normalized by freestream dynamic pressure) on each element - for (auto e : sur->groups[0]->tag->elems) - { - // Build nodal pressure load - Eigen::VectorXd be = LoadFunctional::build(*e, *sur->svMap.at(e), phi, *pbl->medium->cP); - - // Assembly - for (size_t i = 0; i < e->nodes.size(); ++i) - { - size_t idx = sur->nMap.at(e->nodes[i]); - sur->nLoads[idx] += be.block<3, 1>(i * 3, 0); - } - } - // Compute integrated aerodynamic load coefficients (normalized by freestream dynamic pressure and reference area) - // force coefficients along x and vertical (y in 2D, z in 3D) directions and pitching moment (along -z in 2D, y in 3D) - sur->Cm = 0; - Eigen::Vector3d Cf(0, 0, 0); - for (size_t i = 0; i < sur->nodes.size(); ++i) - { - Eigen::Vector3d l = sur->nodes[i]->pos - pbl->x_ref; // lever arm - Eigen::Vector3d cf = sur->nLoads[i]; // normalized force - Cf += cf; - sur->Cm += (l(pbl->nDim - 1) * cf(0) - l(0) * cf(pbl->nDim - 1)) / (pbl->S_ref * pbl->c_ref); // moment is positive along y (3D) and negative along z (2D) => positive nose-up - } - // rotate to flow direction - sur->Cd = Cf.dot(pbl->dirD.eval()); - sur->Cs = Cf.dot(pbl->dirS.eval()); - sur->Cl = Cf.dot(pbl->dirL.eval()); - // compute total - Cl += sur->Cl; - Cd += sur->Cd; - Cs += sur->Cs; - Cm += sur->Cm; - } -} - -/** - * @brief Compute variables in the flow field - * @authors Adrien Crovato - */ -void Solver::computeFlow() -{ - // Compute results in volume - auto fluid = pbl->medium; - tbb::parallel_for_each(fluid->neMap.begin(), fluid->neMap.end(), [&](std::pair<Node *, std::vector<Element *>> p) { - Node *n = p.first; - // Perturbation potential - vPhi[n->row] = phi[n->row] - fluid->phiInf->eval(n->pos); - // Velocity (averaged at nodes) - U[n->row] = Eigen::Vector3d::Zero(); - for (auto e : p.second) - { - Eigen::VectorXd grad = e->computeGradient(phi, 0); - for (int i = 0; i < grad.size(); ++i) - U[n->row](i) += grad(i); - } - U[n->row] /= static_cast<double>(p.second.size()); - // Density (averaged at nodes) - rho[n->row] = 0.; - for (auto e : p.second) - rho[n->row] += fluid->rho->eval(*e, phi, 0); - rho[n->row] /= p.second.size(); - // Mach number (averaged at nodes) - M[n->row] = 0.; - for (auto e : p.second) - M[n->row] += fluid->mach->eval(*e, phi, 0); - M[n->row] /= p.second.size(); - // Pressure coefficient (averaged at nodes) - Cp[n->row] = 0.; - for (auto e : p.second) - Cp[n->row] += fluid->cP->eval(*e, phi, 0); - Cp[n->row] /= p.second.size(); - }); - - // Check maximum Mach number - if (*std::max_element(M.begin(), M.end()) >= 1.25) - std::cout << ANSI_COLOR_YELLOW << "Max. Mach greater than 1.25!" << ANSI_COLOR_RESET << std::endl; -} diff --git a/flow/src/wSolver.h b/flow/src/wSolver.h deleted file mode 100644 index 1dc38153..00000000 --- a/flow/src/wSolver.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WSOLVER_H -#define WSOLVER_H - -#include "flow.h" -#include "wObject.h" -#include "wTimers.h" - -#include <iostream> -#include <vector> -#include <memory> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Base solver class - * @authors Adrien Crovato - */ -class FLOW_API Solver : public fwk::wSharedObject -{ -public: - std::shared_ptr<Problem> pbl; ///< problem definition - std::shared_ptr<tbox::LinearSolver> linsol; ///< linear solver - - int nthreads; ///< number of threads for the execution - double relTol; ///< relative tolerance on the residual - double absTol; ///< absolute tolerance on the residual - int maxIt; ///< max number of iterations - int verbose; ///< display more info - - int nIt; ///< number of iterations - std::vector<double> phi; ///< full potential - std::vector<double> rPhi; ///< residual on potential - std::vector<double> vPhi; ///< perturbation potential - std::vector<Eigen::Vector3d> U; ///< velocity - std::vector<double> rho; ///< density - std::vector<double> M; ///< mach number - std::vector<double> Cp; ///< pressure coefficient - double Cl; ///< lift coefficient - double Cd; ///< drag coefficient - double Cs; ///< sideforce coefficient - double Cm; ///< pitch moment coefficient (positive nose-up) - -protected: - fwk::Timers tms; ///< internal timers - std::vector<int> rows; ///< unknown nodal index - -public: - Solver(std::shared_ptr<Problem> _pbl, std::shared_ptr<tbox::LinearSolver> _linsol); - virtual ~Solver(); - - virtual bool run(); - void save(tbox::MshExport *mshWriter, int n = 0); - -protected: - void computeFlow(); - void computeLoad(); -}; - -} // namespace flow -#endif //WSOLVER_H diff --git a/flow/src/wWake.cpp b/flow/src/wWake.cpp deleted file mode 100644 index 9af5d4a1..00000000 --- a/flow/src/wWake.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wWake.h" -#include "wGroup.h" -#include "wFace.h" -#include <algorithm> -#include <unordered_set> -using namespace tbox; -using namespace flow; - -Wake::Wake(std::shared_ptr<MshData> _msh, std::vector<int> const &nos) - : Groups(_msh, nos) -{ - // Sanity check - if (nos.size() != 3 && nos.size() != 4) - { - std::stringstream err; - err << "flow::Wake should be built with 3 or 4 physical groups (for 2D or 3D resp.) but " << nos.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - if (groups[0]->tag->elems.size() != groups[1]->tag->elems.size()) - { - std::stringstream err; - err << "flow::Wake: Groups " << nos[0] << " and " << nos[1] << " do not contain the same number of elements!\n"; - throw std::runtime_error(err.str()); - } - // Build data structure - connectNodes(); - createElements(); -} -Wake::Wake(std::shared_ptr<MshData> _msh, std::vector<std::string> const &names) - : Groups(_msh, names) -{ - // Sanity check - if (names.size() != 3 && names.size() != 4) - { - std::stringstream err; - err << "flow::Wake should be built with 3 or 4 physical groups (for 2D or 3D resp.) but " << names.size() << " were given!\n"; - throw std::runtime_error(err.str()); - } - if (groups[0]->tag->elems.size() != groups[1]->tag->elems.size()) - { - std::stringstream err; - err << "flow::Wake: Groups " << names[0] << " and " << names[1] << " do not contain the same number of elements!\n"; - throw std::runtime_error(err.str()); - } - // Build data structure - connectNodes(); - createElements(); -} -Wake::~Wake() -{ - for (size_t i = 0; i < wEle.size(); ++i) - { - delete wEle[i]; - } - std::cout << "~Wake()\n"; -} - -/** - * @brief Connect matching nodes on wake - * @authors Adrien Crovato - */ -void Wake::connectNodes() -{ - // Temporary container for nodes - std::vector<Node *> nodesUp, nodesLw; - // Get unique node - for (auto e : groups[0]->tag->elems) - for (auto n : e->nodes) - nodesUp.push_back(n); - for (auto e : groups[1]->tag->elems) - for (auto n : e->nodes) - nodesLw.push_back(n); - std::sort(nodesUp.begin(), nodesUp.end()); - auto it = std::unique(nodesUp.begin(), nodesUp.end()); - nodesUp.resize(std::distance(nodesUp.begin(), it)); - std::sort(nodesLw.begin(), nodesLw.end()); - it = std::unique(nodesLw.begin(), nodesLw.end()); - nodesLw.resize(std::distance(nodesLw.begin(), it)); - // Remove TE and/or tip nodes - if (groups.size() == 4) - { - std::vector<Node *> edge; - for (auto e : groups[3]->tag->elems) - for (auto n : e->nodes) - edge.push_back(n); - std::sort(edge.begin(), edge.end()); - it = std::unique(edge.begin(), edge.end()); - edge.resize(std::distance(edge.begin(), it)); - // Find the intersection and remove - std::vector<Node *>::iterator endRange; - endRange = std::set_difference(nodesUp.begin(), nodesUp.end(), - edge.begin(), edge.end(), - nodesUp.begin()); - nodesUp.erase(endRange, nodesUp.end()); - } - - // Create the node map - for (auto nUp : nodesUp) - { - //std::cout << "MASTER: " << nUp->pos(0) << ',' << nUp->pos(1) << ',' << nUp->pos(2) << std::endl; - for (auto nLw : nodesLw) - { - //std::cout << " SLAVE: " << nLw->pos(0) << ',' << nLw->pos(1) << ',' << nLw->pos(2) << std::endl; - if ((nUp->pos - nLw->pos).norm() <= 1e-14) - { - nodMap[nUp] = nLw; - break; - } - } - } - // Check if node map is not empty - if (nodMap.size() != nodesUp.size()) - { - std::stringstream err; - err << "flow::Wake: some nodes from " << *groups[0]->tag << " could not be mapped to nodes from " << *groups[1]->tag << " (number of mapped nodes: " << nodMap.size() << ")!\n"; - throw std::runtime_error(err.str()); - } -} - -/** - * @brief Create Wake elements - * @authors Adrien Crovato - */ -void Wake::createElements() -{ - // Temporary container - std::map<Element *, Element *> suslE, suvuE, slvlE; - std::map<Element *, std::vector<std::pair<size_t, Node *>>> asmbN; - // Find the connected elements - connectSurElements(suslE); - connectVolElements(groups[0]->tag, groups[2]->tag, suvuE); - connectVolElements(groups[1]->tag, groups[2]->tag, slvlE); - // Find the node to be assembled - findNodes(asmbN); - - // Create the Wake elements - size_t i = 0; - for (auto it = groups[0]->tag->elems.begin(); it != groups[0]->tag->elems.end(); it++, i++) - { - WakeElement *we = new WakeElement(i + 1, *it, suslE.at(*it), suvuE.at(*it), slvlE.at(suslE.at(*it)), asmbN.at(*it)); - wEle.push_back(we); - } -} - -/** - * @brief Connect matching surface elements on upper/lower wake surface - * @authors Adrien Crovato - */ -void Wake::connectSurElements(std::map<Element *, Element *> &ssMap) -{ - // Compare the position of each node of upper to lower surfaces - for (auto uE : groups[0]->tag->elems) - { - for (auto lE : groups[1]->tag->elems) - { - size_t cnt = 0; - for (auto uN : uE->nodes) - { - for (auto lN : lE->nodes) - { - if ((uN->pos - lN->pos).norm() <= 1e-14) - { - cnt++; - break; - } - } - if (cnt == 0) - break; - } - // if all element nodes have the same position - if (cnt == uE->nodes.size()) - { - ssMap[uE] = lE; - break; - } - } - } - // Check that all elements have been mapped - if (ssMap.size() != groups[0]->tag->elems.size()) - { - std::stringstream err; - err << "flow::Wake: some elements from " << *groups[0]->tag << " could not be mapped to elements from " << *groups[1]->tag << " (number of mapped elements: " << ssMap.size() << ")!\n"; - throw std::runtime_error(err.str()); - } -} - -/** - * @brief Connect matching volume elements over wake surface - * @authors Adrien Crovato - */ -void Wake::connectVolElements(Tag *tagS, Tag *tagV, std::map<Element *, Element *> &svMap) -{ - // Create unordered set of wake faces - std::unordered_set<Face *, EquFace, EquFace> wakFaces; - for (auto e : tagS->elems) - { - Face *f = new Face(e->nodes); - f->el0 = e; - wakFaces.insert(f); - } - // Find volume faces that are wake faces - for (auto e : tagV->elems) - { - size_t idx = 0; - for (size_t i = 0; i < e->nodes.size(); ++i) - { - // build volume face - std::vector<Node *> fN(e->nodes.size() - 1); - for (size_t j = 0; j < e->nodes.size() - 1; ++j) - fN[j] = e->nodes[(idx + j) % e->nodes.size()]; - Face f(fN); - // check if face is a surface face - // for some meshes, 1 tetra4 can have 2 faces that are surface tri3! - auto it = wakFaces.find(&f); - if (it != wakFaces.end()) - (*it)->el1 = e; - idx++; - } - } - // Create a map between the wake and volume elements - for (auto f : wakFaces) - { - if (f->el1 == NULL) - { - std::stringstream err; - err << "flow::Wake: no volume element from tag " << *tagV << "could be associated to surface element " << *(f->el0) << "!\n"; - throw std::runtime_error(err.str()); - } - svMap[f->el0] = f->el1; - delete f; - } -} - -/** - * @brief Find nodes for which a contribution will be assembled - * @authors Adrien Crovato - */ -void Wake::findNodes(std::map<Element *, std::vector<std::pair<size_t, Node *>>> &mapEN) -{ - // Check if nodes are in the node map and add them - for (auto e : groups[0]->tag->elems) - { - std::vector<std::pair<size_t, Node *>> tmpN; - for (size_t i = 0; i < e->nodes.size(); ++i) - if (nodMap.find(e->nodes[i]) != nodMap.end()) - tmpN.push_back(std::pair<size_t, Node *>(i, e->nodes[i])); - mapEN[e] = tmpN; - } -} - -void Wake::write(std::ostream &out) const -{ - out << "flow::Wake on " << *groups[0]->tag << " and " << *groups[1]->tag << "\n"; - for (auto p : nodMap) - out << "\t" << p.first->no << " linked with " << p.second->no << "\n"; - for (auto we : wEle) - we->write(out); -} diff --git a/flow/src/wWake.h b/flow/src/wWake.h deleted file mode 100644 index 9e4b9c42..00000000 --- a/flow/src/wWake.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WWAKE_H -#define WWAKE_H - -#include "flow.h" -#include "wGroups.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -#include "wWakeElement.h" -#include <vector> -#include <string> - -namespace flow -{ - -/** - * @brief Handle wake boundary condition - * @authors Adrien Crovato - */ -class FLOW_API Wake : public tbox::Groups -{ -public: - std::map<tbox::Node *, tbox::Node *> nodMap; ///< upper to lower surface nodes map - std::vector<WakeElement *> wEle; - - Wake(std::shared_ptr<tbox::MshData> _msh, std::vector<int> const &nos); - Wake(std::shared_ptr<tbox::MshData> _msh, std::vector<std::string> const &names); - virtual ~Wake(); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void connectNodes(); - void createElements(); - void connectSurElements(std::map<tbox::Element *, tbox::Element *> &ssMap); - void connectVolElements(tbox::Tag *tagS, tbox::Tag *tagV, std::map<tbox::Element *, tbox::Element *> &svMap); - void findNodes(std::map<tbox::Element *, std::vector<std::pair<size_t, tbox::Node *>>> &mapEN); -}; - -} // namespace flow - -#endif //WWAKE_H diff --git a/flow/src/wWakeElement.cpp b/flow/src/wWakeElement.cpp deleted file mode 100644 index 099a5db6..00000000 --- a/flow/src/wWakeElement.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wWakeElement.h" -#include "wNode.h" -using namespace tbox; -using namespace flow; - -WakeElement::WakeElement(size_t _no, Element *&_surUpE, Element *&_surLwE, - Element *&_volUpE, Element *&_volLwE, - std::vector<std::pair<size_t, Node *>> &_wkN) - : wObject(), no(_no), surUpE(_surUpE), surLwE(_surLwE), - volUpE(_volUpE), volLwE(_volLwE), wkN(_wkN) -{ - // Sanity checks - if (surUpE->type() != surLwE->type()) - throw std::runtime_error("WakeElement: upper and lower surface element are not the same type!\n"); - if (surUpE->type() == ELTYPE::LINE2) - nDim = 2; - else if (surUpE->type() == ELTYPE::TRI3) - nDim = 3; - else - { - std::stringstream err; - err << "WakeElement only implemented for surface elements of type " - << ELTYPE::LINE2 << " or " << ELTYPE::TRI3 - << " (" << surUpE->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - if (volUpE->type() == ELTYPE::TRI3 || volUpE->type() == ELTYPE::TETRA4) - nColUp = volUpE->nodes.size(); - else - { - std::stringstream err; - err << "WakeElement only implemented for volume elements of type " - << ELTYPE::TRI3 << " or " << ELTYPE::TETRA4 - << " (" << volUpE->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - if (volLwE->type() == ELTYPE::TRI3 || volLwE->type() == ELTYPE::TETRA4) - nColLw = volLwE->nodes.size(); - else - { - std::stringstream err; - err << "WakeElement only implemented for volume elements of type " - << ELTYPE::TRI3 << " or " << ELTYPE::TETRA4 - << " (" << volLwE->type() << " was given)!\n"; - throw std::runtime_error(err.str()); - } - // Map the nodes - mapNodes(); - nRow = wkN.size(); -} - -/** - * @brief Map the wake nodes to their local volume node indices - */ -void WakeElement::mapNodes() -{ - // Find local volume index of contributing surface nodes - for (auto p : wkN) - { - for (size_t i = 0; i < volUpE->nodes.size(); ++i) - { - if (p.second == volUpE->nodes[i]) - { - vsMap[p.first] = i; - break; - } - } - } - // Check that all contributing surface nodes have been mapped - if (vsMap.size() != wkN.size()) - { - std::stringstream err; - err << "flow::WakeElement: could not map some contributing nodes from surface element " << *surUpE << " to " << *volUpE << " (number of mapped nodes: " << vsMap.size() << ")!\n"; - throw std::runtime_error(err.str()); - } -} - -void WakeElement::write(std::ostream &out) const -{ - out << "WakeElement #" << no - << "\n\ton surface elements (" << surUpE->type() << "): " << surUpE->no << " and " << surLwE->no - << "\n\ton volume elements: (" << volUpE->type() << "): " << volUpE->no << " and " << volLwE->no << std::endl; -} \ No newline at end of file diff --git a/flow/src/wWakeElement.h b/flow/src/wWakeElement.h deleted file mode 100644 index 43f06018..00000000 --- a/flow/src/wWakeElement.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WWAKEELEMENT_H -#define WWAKEELEMENT_H - -#include "flow.h" -#include "wObject.h" -#include "wElement.h" -#include <vector> -#include <map> - -namespace flow -{ - -/** - * @brief Kutta element - * - * Made up of two surface elements on the wake and the connected volume - * elements. Only Line2 (surface) and Tri3 (volume) elements are curently - * implemented. - * Since Tri3 or Tetra4 are used, the evalutaion of the volume integrals is - * performed at dummy Gauss point #0. If volume elements with non-constant shape - * function derivatives are used, those derivates should be recomputed at the - * true surface element Gauss points. - * @authors Adrien Crovato - */ -class FLOW_API WakeElement : public fwk::wObject -{ -public: - size_t no; ///< ID - tbox::Element *surUpE; ///< Surface element "+" side - tbox::Element *surLwE; ///< Surface element "-" side - tbox::Element *volUpE; ///< Connected volume elements "+" side - tbox::Element *volLwE; ///< Connected volume elements "-" side - - size_t nRow; ///< number of rows in stiffness matrix - size_t nColUp; ///< number of columns in in stiffness matrix "+" side - size_t nColLw; ///< number of columns in in stiffness matrix "-" side - size_t nDim; ///< dimension of volume element - - std::vector<std::pair<size_t, tbox::Node *>> wkN; ///< map between local index and contributing wake global nodes - std::map<size_t, size_t> vsMap; ///< map between surface node and volume node indices - - WakeElement(size_t _no, tbox::Element *&_surUpE, tbox::Element *&_surLwE, tbox::Element *&_volUpE, tbox::Element *&_volLwE, std::vector<std::pair<size_t, tbox::Node *>> &_wkN); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif - -private: - void mapNodes(); -}; - -} // namespace flow - -#endif //WWAKEELEMENT_H diff --git a/flow/src/wWakeResidual.cpp b/flow/src/wWakeResidual.cpp deleted file mode 100644 index 88f918af..00000000 --- a/flow/src/wWakeResidual.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wWakeResidual.h" -#include "wWakeElement.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" - -using namespace tbox; -using namespace flow; - -/** - * @brief Build the residual matrix for a fixed-point iteration, on one wake element - * - * A_u = \int (psi + grad_psi*v_inf) * v_u*grad_phi_u dS - * A_l = \int (psi + grad_psi*v_inf) * v_l*grad_phi_l dS - * NB: A_u and A_l will be assembled on same row DOF, but on different columns - * NB: v_inf = [1, 0, 0] - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> WakeResidual::buildFixed(WakeElement const &we, std::vector<double> const &phi) -{ - // Get shape functions and Gauss points - Cache &sCache = we.surUpE->getVCache(); - Gauss &sGauss = sCache.getVGauss(); - Eigen::MatrixXd const &vUpDsf = we.volUpE->getVCache().getDsf(0); - Eigen::MatrixXd const &vLwDsf = we.volLwE->getVCache().getDsf(0); - // Get Jacobian - Eigen::MatrixXd const &vUpJ = we.volUpE->getJinv(0); - Eigen::MatrixXd const &vLwJ = we.volLwE->getJinv(0); - // Get size - size_t nRow = we.nRow; - size_t nDim = we.nDim; - - // Stabilization - Eigen::MatrixXd dSf(nRow, nDim); - for (size_t i = 0; i < nRow; ++i) - for (size_t j = 0; j < nDim; ++j) - dSf(i, j) = vUpDsf(j, we.vsMap.at(we.wkN[i].first)); - Eigen::VectorXd dSfp(nRow); - dSfp = 0.5 * sqrt(we.surUpE->getVol()) * dSf * vUpJ.transpose() * Eigen::Vector3d(1, 0, 0).block(0, 0, nDim, 1); - // Velocity - Eigen::RowVectorXd Aup = we.volUpE->computeGradient(phi, 0).transpose() * vUpJ * vUpDsf; - Eigen::RowVectorXd Alw = we.volLwE->computeGradient(phi, 0).transpose() * vLwJ * vLwDsf; - - // Build - Eigen::MatrixXd Au = Eigen::MatrixXd::Zero(nRow, we.nColUp); - Eigen::MatrixXd Al = Eigen::MatrixXd::Zero(nRow, we.nColLw); - for (size_t k = 0; k < sGauss.getN(); ++k) - { - // stabilized shape functions - Eigen::VectorXd const &sf = sCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = dSfp(i) + sf(we.wkN[i].first); - // wake contribution - Au += sfp * Aup * sGauss.getW(k) * we.surUpE->getDetJ(k); - Al += sfp * Alw * sGauss.getW(k) * we.surUpE->getDetJ(k); - } - return std::make_tuple(Au, Al); -} - -/** - * @brief Build the residual vector, on one wake element - * - * b_u = \int (psi + grad_psi*v_inf) * (grad_phi_u)^2 dS - * b_l = \int (psi + grad_psi*v_inf) * (grad_phi_l)^2 dS - * NB: v_inf = [1, 0, 0] - */ -std::tuple<Eigen::VectorXd, Eigen::VectorXd> WakeResidual::build(WakeElement const &we, std::vector<double> const &phi) -{ - // Get shape functions and Gauss points - Cache &sCache = we.surUpE->getVCache(); - Gauss &sGauss = sCache.getVGauss(); - Eigen::MatrixXd const &vUpDsf = we.volUpE->getVCache().getDsf(0); - // Get size - size_t nRow = we.nRow; - size_t nDim = we.nDim; - - // Stabilization - Eigen::MatrixXd dSf(nRow, nDim); - for (size_t i = 0; i < nRow; ++i) - for (size_t j = 0; j < nDim; ++j) - dSf(i, j) = vUpDsf(j, we.vsMap.at(we.wkN[i].first)); - Eigen::VectorXd dSfp(nRow); - dSfp = 0.5 * sqrt(we.surUpE->getVol()) * dSf * we.volUpE->getJinv(0).transpose() * Eigen::Vector3d(1, 0, 0).block(0, 0, nDim, 1); - // Velocity squared - Eigen::VectorXd dPhiU = we.volUpE->computeGradient(phi, 0); - Eigen::VectorXd dPhiL = we.volLwE->computeGradient(phi, 0); - double dPhi2u = dPhiU.squaredNorm(); - double dPhi2l = dPhiL.squaredNorm(); - - // Build - Eigen::VectorXd bu = Eigen::VectorXd::Zero(nRow); - Eigen::VectorXd bl = Eigen::VectorXd::Zero(nRow); - for (size_t k = 0; k < sGauss.getN(); ++k) - { - // stabilized shape functions - Eigen::VectorXd const &sf = sCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = dSfp(i) + sf(we.wkN[i].first); - // wake contribution - bu += sfp * dPhi2u * sGauss.getW(k) * we.surUpE->getDetJ(k); - bl += sfp * dPhi2l * sGauss.getW(k) * we.surUpE->getDetJ(k); - } - return std::make_tuple(bu, bl); -} - -/** - * @brief Build the gradient of the residual vector with respect to the flow variable (jacobian), on one wake element - * - * A_u = \int (psi + grad_psi*v_inf) * 2*(grad_phi_u)*dgrad_phi_u dS - * A_l = \int (psi + grad_psi*v_inf) * 2*(grad_phi_l)*dgrad_phi_l dS - * NB: v_inf = [1, 0, 0] - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> WakeResidual::buildGradientFlow(WakeElement const &we, std::vector<double> const &phi) -{ - // Build - Eigen::MatrixXd Au, Al; - std::tie(Au, Al) = WakeResidual::buildFixed(we, phi); - return std::make_tuple(2 * Au, 2 * Al); -} - -/** - * @brief Build the gradient of the residual vector with respect to the nodes, on one wake element - * - * A = d( \int (psi + grad_psi*v_inf) * (grad_phi)^2 dS ) - * = \int dgrad_psi*v_inf * (grad_phi)^2 dS - * + \int (psi + grad_psi*v_inf) * d(grad_phi)^2 dS - * + \int (psi + grad_psi*v_inf) * (grad_phi)^2 ddS - * NB: v_inf = [1, 0, 0] - */ -std::tuple<Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd> WakeResidual::buildGradientMesh(WakeElement const &we, std::vector<double> const &phi) -{ - // Get shape functions and Gauss points - Cache &sCache = we.surUpE->getVCache(); - Gauss &surGauss = sCache.getVGauss(); - Eigen::MatrixXd const &dSfUp = we.volUpE->getVCache().getDsf(0); - // Get Jacobian - Eigen::MatrixXd const &iJUp = we.volUpE->getJinv(0); - Eigen::MatrixXd const &iJLw = we.volLwE->getJinv(0); - std::vector<Eigen::MatrixXd> const &dJUp = we.volUpE->getGradJ(0); - std::vector<Eigen::MatrixXd> const &dJLw = we.volLwE->getGradJ(0); - // Get surface gradient - std::vector<double> const &dSurf = we.surUpE->getGradVol(); - // Get size - size_t nRow = we.nRow; - size_t nDim = we.nDim; - size_t nColUp = we.nColUp; - size_t nColLw = we.nColLw; - size_t nSur = we.surUpE->nodes.size(); - - // Stabilization term - Eigen::VectorXd vi = Eigen::Vector3d(1, 0, 0).block(0, 0, nDim, 1); - double sqSurf = sqrt(we.surUpE->getVol()); - Eigen::MatrixXd dSf(nRow, nDim); - for (size_t i = 0; i < nRow; ++i) - for (size_t m = 0; m < nDim; ++m) - dSf(i, m) = dSfUp(m, we.vsMap.at(we.wkN[i].first)); - Eigen::VectorXd gradSfp = 0.5 * sqSurf * dSf * iJUp.transpose() * vi; - // Gradient of stabilization term (volume and surface) - std::vector<Eigen::VectorXd> dGradSfV(nDim * nColUp); - for (size_t i = 0; i < nColUp; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - dGradSfV[idx] = 0.5 * sqSurf * dSf * (-iJUp * dJUp[idx] * iJUp).transpose() * vi; // S * dgrad_psi - } - } - std::vector<Eigen::VectorXd> dGradSfS(nDim * nSur); - for (size_t i = 0; i < nSur; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - dGradSfS[idx] = 0.5 * 0.5 / sqSurf * dSurf[idx] * dSf * iJUp.transpose() * vi; // dS * grad_psi - } - } - // Gradients of potential - Eigen::VectorXd dPhiUp = we.volUpE->computeGradient(phi, 0); - Eigen::VectorXd dPhiLw = we.volLwE->computeGradient(phi, 0); - - // Build - Eigen::MatrixXd Au = Eigen::MatrixXd::Zero(nRow, nDim * nColUp); - Eigen::MatrixXd Al = Eigen::MatrixXd::Zero(nRow, nDim * nColLw); - Eigen::MatrixXd As = Eigen::MatrixXd::Zero(nRow, nDim * nSur); - for (size_t k = 0; k < surGauss.getN(); ++k) - { - // weight and Jacobian determinant - double w = surGauss.getW(k); - double detJ = we.surUpE->getDetJ(k); - std::vector<double> dDetJ = we.surUpE->getGradDetJ(k); - // shape functions and stabilization - Eigen::VectorXd const &sf = sCache.getSf(k); - Eigen::VectorXd sfp(nRow); - for (size_t i = 0; i < nRow; ++i) - sfp(i) = sf(we.wkN[i].first) + gradSfp(i); - - // Build gradient wrt to upper volume nodes - for (size_t i = 0; i < nColUp; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - // gradient of velocity jump - Au.col(idx) += w * sfp * 2 * dPhiUp.transpose() * (-iJUp * dJUp[idx] * dPhiUp) * detJ; // (psi + grad_psi) * dgrad_phi^2 * detJ - // gradient of stabilization term (volume) - Au.col(idx) += w * dGradSfV[idx] * (dPhiUp.dot(dPhiUp) - dPhiLw.dot(dPhiLw)) * detJ; // dgrad_psi' * grad_phi^2 * detJ - } - } - // Build gradient wrt to lower volume nodes - for (size_t i = 0; i < nColLw; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - // gradient of velocity jump - Al.col(idx) += w * sfp * 2 * dPhiLw.transpose() * (-iJLw * dJLw[idx] * dPhiLw) * detJ; // (psi + grad_psi) * dgrad_phi^2 * detJ - } - } - // Build gradient wrt to (upper) surface nodes - for (size_t i = 0; i < nSur; ++i) - { - for (size_t m = 0; m < nDim; ++m) - { - size_t idx = i * nDim + m; - // gradient of stabilization term (surface) - As.col(idx) += w * dGradSfS[idx] * (dPhiUp.dot(dPhiUp) - dPhiLw.dot(dPhiLw)) * detJ; // dgrad_psi * grad_phi^2 * detJ - // gradient of jacobian determinant - As.col(idx) += w * sfp * (dPhiUp.dot(dPhiUp) - dPhiLw.dot(dPhiLw)) * dDetJ[idx]; // (N + grad_psi) * grad_phi^2 * ddetJ - } - } - } - return std::make_tuple(Au, Al, As); -} diff --git a/flow/src/wWakeResidual.h b/flow/src/wWakeResidual.h deleted file mode 100644 index 4b825766..00000000 --- a/flow/src/wWakeResidual.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WWAKERESIDUAL_H -#define WWAKERESIDUAL_H - -#include "flow.h" - -#include <vector> -#include <Eigen/Dense> - -namespace flow -{ - -/** - * @brief Formulation of wake boundary residuals - */ -class FLOW_API WakeResidual -{ -public: - // Picard - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildFixed(WakeElement const &we, std::vector<double> const &phi); - // Newton - static std::tuple<Eigen::VectorXd, Eigen::VectorXd> build(WakeElement const &we, std::vector<double> const &phi); - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd> buildGradientFlow(WakeElement const &we, std::vector<double> const &phi); - // Adjoint - static std::tuple<Eigen::MatrixXd, Eigen::MatrixXd, Eigen::MatrixXd> buildGradientMesh(WakeElement const &we, std::vector<double> const &phi); -}; - -} // namespace flow -#endif //WWAKERESIDUAL_H diff --git a/flow/tests/adjoint.py b/flow/tests/adjoint.py deleted file mode 100644 index 1ac2a250..00000000 --- a/flow/tests/adjoint.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute adjoint solution of lifting (linear or nonlinear) potential flow around a NACA 0012 -# Adrien Crovato -# -# Test the adjoint solver -# -# CAUTION -# Adjoint solver has NOT been VALDIATED. -# This test is provided to ensure that the adjoint solver runs. -# Mesh refinement may have to be performed to obtain physical results. - -import numpy as np -import flow as flo -import flow.utils as floU -import flow.default as floD -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 2*np.pi/180 - M_inf = 0.7 - c_ref = 1 - dim = 2 - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1., 'msTe' : 0.0075, 'msLe' : 0.0075} - msh, gmshWriter = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - # create mesh deformation handler - morpher = floD.meshMorpher(msh, dim, ['airfoil']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, c_ref, c_ref, 0.25, 0., 0., 'airfoil', te = 'te') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # solve adjoint problem - print(ccolors.ANSI_BLUE + 'PyGradient...' + ccolors.ANSI_RESET) - tms['adjoint'].start() - adjoint = floD.adjoint(solver, morpher) - adjoint.run() - adjoint.save(gmshWriter) - tms['adjoint'].stop() - - # compute norm of gradient wrt to mesh - dClX = 0 - dCdX = 0 - for n in msh.nodes: - dClX += np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1]]).dot(np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1]])) - dCdX += np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1]]).dot(np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1]])) - dClX = np.sqrt(dClX) - dCdX = np.sqrt(dCdX) - - # recover gradient wrt to AoA from gradient wrt mesh - drot = np.array([[-np.sin(alpha), np.cos(alpha)], [-np.cos(alpha), -np.sin(alpha)]]) - dClAoA = 0 - dCdAoA = 0 - for n in bnd.nodes: - dx = drot.dot(np.array([n.pos[0] - 1, n.pos[1]])) - dClAoA += np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1]]).dot(dx) - dCdAoA += np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1]]).dot(dx) - - # extract Cp and drag sensitivities - Cp = floU.extract(bnd.groups[0].tag.elems, solver.Cp) - tboxU.write(Cp, 'Cp_airfoil.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - dCd = floU.extract(bnd.groups[0].tag.elems, adjoint.dCdMsh) - tboxU.write(dCd, 'dCd_airfoil.dat', '%1.5e', ', ', 'x, y, z, dCd_dx, dCd_dy, dCd_dz', '') - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' M alpha Cl Cd dCl_da dCd_da') - print('{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f} {5:8.4f}'.format(M_inf, alpha*180/np.pi, solver.Cl, solver.Cd, adjoint.dClAoa, adjoint.dCdAoa)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if M_inf == 0. and alpha == 0*np.pi/180: - tests.add(CTest('dCl_dAoA', adjoint.dClAoa, 6.9, 1e-2)) - tests.add(CTest('dCd_dAoA', adjoint.dCdAoa, 0.0, 1e-3)) - tests.add(CTest('dCl_dMsh', dClX, 61.302, 1e-3)) - tests.add(CTest('dCd_dMsh', dCdX, 0.0749, 1e-3)) - tests.add(CTest('dCl_dAoA (msh)', dClAoA, 6.9, 1e-2)) - tests.add(CTest('dCd_dAoA (msh)', dCdAoA, 0.0, 1e-3)) - elif M_inf == 0.7 and alpha == 2*np.pi/180: - tests.add(CTest('dCl_dAoA', adjoint.dClAoa, 11.8, 1e-2)) # FD 11.835 (step = 1e-5) - tests.add(CTest('dCd_dAoA', adjoint.dCdAoa, 0.127, 1e-2)) # 0.12692 (step = 1e-5) - tests.add(CTest('dCl_dMsh', dClX, 99.89, 1e-3)) - tests.add(CTest('dCd_dMsh', dCdX, 0.747, 1e-3)) - tests.add(CTest('dCl_dAoA (msh)', dClAoA, 11.8, 1e-2)) - tests.add(CTest('dCd_dAoA (msh)', dCdAoA, 0.127, 1e-2)) - else: - raise Exception('Test not defined for this flow') - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/adjoint3.py b/flow/tests/adjoint3.py deleted file mode 100644 index 2d109e0b..00000000 --- a/flow/tests/adjoint3.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute adjoint solution of lifting (linear or nonlinear) potential flow around a NACA 0012 -# Adrien Crovato -# -# Test the adjoint solver -# -# CAUTION -# Adjoint solver has NOT been VALDIATED. -# This test is provided to ensure that the adjoint solver runs. -# Mesh refinement may have to be performed to obtain physical results. - -import numpy as np -import flow as flo -import flow.utils as floU -import flow.default as floD -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3*np.pi/180 - M_inf = 0.3 - c_ref = 1 - span = 1 - dim = 3 - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'spn' : span, 'lgt' : 3, 'wdt' : 3, 'hgt' : 3, 'msLe' : 0.02, 'msTe' : 0.02, 'msF' : 1.} - msh, gmshWriter = floD.mesh(dim, 'models/n0012_3.geo', pars, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - # create mesh deformation handler - morpher = floD.meshMorpher(msh, dim, ['wing']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, span*c_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # solve adjoint problem - print(ccolors.ANSI_BLUE + 'PyGradient...' + ccolors.ANSI_RESET) - tms['adjoint'].start() - adjoint = floD.adjoint(solver, morpher) - adjoint.run() - adjoint.save(gmshWriter) - tms['adjoint'].stop() - - # compute norm of gradient wrt to mesh - dClX = 0 - dCdX = 0 - for n in msh.nodes: - dClX += np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1], adjoint.dClMsh[n.row][2]]).dot(np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1], adjoint.dClMsh[n.row][2]])) - dCdX += np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1], adjoint.dCdMsh[n.row][2]]).dot(np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1], adjoint.dCdMsh[n.row][2]])) - dClX = np.sqrt(dClX) - dCdX = np.sqrt(dCdX) - - # recover gradient wrt to AoA from mesh gradient - drot = np.array([[-np.sin(alpha), 0, np.cos(alpha)], [0, 0, 0], [-np.cos(alpha), 0, -np.sin(alpha)]]) - dClAoA = 0 - dCdAoA = 0 - for n in bnd.nodes: - dx = drot.dot(np.array([n.pos[0] - 1, n.pos[1], n.pos[2]])) - dClAoA += np.array([adjoint.dClMsh[n.row][0], adjoint.dClMsh[n.row][1], adjoint.dClMsh[n.row][2]]).dot(dx) - dCdAoA += np.array([adjoint.dCdMsh[n.row][0], adjoint.dCdMsh[n.row][1], adjoint.dCdMsh[n.row][2]]).dot(dx) - - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' M alpha Cl Cd dCl_da dCd_da') - print('{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f} {5:8.4f}'.format(M_inf, alpha*180/np.pi, solver.Cl, solver.Cd, adjoint.dClAoa, adjoint.dCdAoa)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if M_inf == 0.3 and alpha == 3*np.pi/180 and span == 1: - tests.add(CTest('dCl/dAoA', adjoint.dClAoa, 2.5, 5e-2)) # FD 2.526 (step 1e-5) - tests.add(CTest('dCd/dAoA', adjoint.dCdAoa, 0.146, 6e-2)) # FD 0.1460 (step 1e-5) - 0.138480 on debian11 - tests.add(CTest('dCl_dMsh', dClX, 3.778, 5e-2)) - tests.add(CTest('dCd_dMsh', dCdX, 0.192, 5e-2)) - tests.add(CTest('dCl/dAoA (msh)', dClAoA, 2.7, 5e-2)) - tests.add(CTest('dCd/dAoA (msh)', dCdAoA, 0.151, 5e-2)) - elif M_inf == 0.7 and alpha == 5*np.pi/180 and span == 2: # mesh size must be 0.01 - tests.add(CTest('dCl/dAoA', adjoint.dClAoa, 5.0, 1e-2)) - tests.add(CTest('dCd/dAoA', adjoint.dCdAoa, 0.427, 1e-2)) - tests.add(CTest('dCl_dMsh', dClX, 4.773, 1e-3)) - tests.add(CTest('dCd_dMsh', dCdX, 0.327, 1e-3)) - tests.add(CTest('dCl/dAoA (msh)', dClAoA, 5.2, 1e-2)) - tests.add(CTest('dCd/dAoA (msh)', dCdAoA, 0.441, 1e-2)) - else: - raise Exception('Test not defined for this flow') - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/bli.py b/flow/tests/bli.py deleted file mode 100644 index 5d69d2b6..00000000 --- a/flow/tests/bli.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute lifting (linear or nonlinear) viscous flow around a NACA 0012 -# Amaury Bilocq -# -# Test the viscous-inviscid interaction scheme -# Reference to the master's thesis: http://hdl.handle.net/2268/252195 -# Reference test cases with Naca0012 (different from master's thesis): -# 1) Incompressible: Re = 1e7, M_inf = 0, alpha = 5°, msTE = 0.01, msLE = 0.01 -# -> nIt = 27, Cl = 0.55, Cd = 0.0058, xtrTop = 0.087, xtrBot = 0.741 -# -> msLe = 0.001, xtrTop = 0.061 -# 2) Compressible: Re = 1e7, M_inf = 5, alpha = 5°, msTE = 0.01, msLE = 0.01 -# -> nIt = 33, Cl = 0.65, Cd = 0.0063, xtrTop = 0.057, xtrBot = 0.740 -# 3) Separated: Re = 1e7, M_inf = 0, alpha = 12°, msTE = 0.01, msLE = 0.001 -# -> nIt = 43, Cl = 1.30 , Cd = 0.0108, xtrTop = 0.010, xtrBot = 1 -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.utils as floU -import flow.default as floD -import flow.viscous.solver as floVS -import flow.viscous.coupler as floVC -import tbox -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - Re = 1e7 - alpha = 5*math.pi/180 - U_inf = [math.cos(alpha), math.sin(alpha)] # norm should be 1 - M_inf = 0.5 - c_ref = 1 - dim = 2 - tol = 1e-4 # tolerance for the VII (usually one drag count) - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1, 'msTe' : 0.01, 'msLe' : 0.01} - msh, gmshWriter = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, blw = floD.problem(msh, dim, alpha, 0., M_inf, c_ref, c_ref, 0.25, 0., 0., 'airfoil', te = 'te', vsc = True, dbc=True) - tms['pre'].stop() - - # solve viscous problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - isolver = floD.newton(pbl) - vsolver = floVS.Solver(Re) - coupler = floVC.Coupler(isolver, vsolver, blw[0], blw[1], tol, gmshWriter) - coupler.run() - tms['solver'].stop() - - # extract Cp - Cp = floU.extract(bnd.groups[0].tag.elems, isolver.Cp) - tboxU.write(Cp, 'Cp_airfoil.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' Re M alpha Cl Cd Cdp Cdf Cm') - print('{0:6.1f}e6 {1:8.2f} {2:8.1f} {3:8.4f} {4:8.4f} {5:8.4f} {6:8.4f} {7:8.4f}'.format(Re/1e6, M_inf, alpha*180/math.pi, isolver.Cl, vsolver.Cd, vsolver.Cdp, vsolver.Cdf, isolver.Cm)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution and plot results - floD.initViewer(pbl) - tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(isolver.Cl, vsolver.Cd, isolver.Cm, 4), True) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if Re == 1e7 and M_inf == 0 and alpha == 5*math.pi/180: - tests.add(CTest('Cl', isolver.Cl, 0.55, 5e-2)) # Xfoil 0.58 - tests.add(CTest('Cd', vsolver.Cd, 0.0062, 1e-3, forceabs=True)) - tests.add(CTest('Cdp', vsolver.Cdp, 0.0018, 1e-3, forceabs=True)) - tests.add(CTest('xtr_top', vsolver.xtr[0], 0.061, 0.03, forceabs=True)) # Xfoil 0.056 - tests.add(CTest('xtr_bot', vsolver.xtr[1], 0.740, 0.03, forceabs=True)) - elif Re == 1e7 and M_inf == 0.5 and alpha == 5*math.pi/180: - tests.add(CTest('Cl', isolver.Cl, 0.65, 5e-2)) # Xfoil 0.69 - tests.add(CTest('Cd', vsolver.Cd, 0.0067, 1e-3, forceabs=True)) - tests.add(CTest('Cdp', vsolver.Cdp, 0.0025, 1e-3, forceabs=True)) - tests.add(CTest('xtr_top', vsolver.xtr[0], 0.049, 0.03, forceabs=True)) # Xfoil 0.038 - tests.add(CTest('xtr_bot', vsolver.xtr[1], 0.736, 0.03, forceabs=True)) - elif Re == 1e7 and M_inf == 0 and alpha == 12*math.pi/180: - tests.add(CTest('Cl', isolver.Cl, 1.30, 5e-2)) # Xfoil 1.39 - tests.add(CTest('Cd', vsolver.Cd, 0.011, 1e-3, forceabs=True)) - tests.add(CTest('Cdp', vsolver.Cdp, 0.0064, 1e-3, forceabs=True)) - tests.add(CTest('xtr_top', vsolver.xtr[0], 0.010, 0.03, forceabs=True)) # Xfoil 0.008 - tests.add(CTest('xtr_bot', vsolver.xtr[1], 1.000, 0.03, forceabs=True)) - else: - raise Exception('Test not defined for this flow') - - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/cylinder.py b/flow/tests/cylinder.py deleted file mode 100644 index f3fba684..00000000 --- a/flow/tests/cylinder.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute the (non)linear flow around cylinder, with various B.C. -# Adrien Crovato -# -# Test solver convergence and boundary conditions -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.default as floD -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3*math.pi/180 - U_inf = [math.cos(alpha), math.sin(alpha)] # norm should be 1 - M_inf = 0.1 - dim = 2 - - # define dimension and mesh size - dmt = 1.0 # cylinder diameter - lgt = 8.0 # channel length - hgt = 6.0 # channel height - l_ref = dmt # reference length - fms = 0.5 # farfield mesh size - nms = 0.1 # nearfield mesh size - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'dmt' : dmt, 'lgt' : lgt, 'hgt' : hgt, 'msN' : nms, 'msF' : fms} - msh, gmshWriter = floD.mesh(dim, 'models/cylinder.geo', pars, ['field', 'cylinder', 'downstream']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, dirichlet, wake, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, l_ref, l_ref, 0., 0., 0., 'cylinder', te = 'te', dbc=True) - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['picard'].start() - solver0 = floD.picard(pbl) - cnvrgd0 = solver0.run() - solver0.save(gmshWriter) - tms['picard'].stop() - tms['newton'].start() - solver1 = floD.newton(pbl) - cnvrgd1 = solver1.run() - solver1.save(gmshWriter) - tms['newton'].stop() - - # compute mean error in Boundary, Neumann boundary condition (works only for Line2 elements) - gradn0 = [] - gradn1 = [] - for e in bnd.groups[0].tag.elems: - gradx0 = 0 - grady0 = 0 - gradx1 = 0 - grady1 = 0 - nx = e.nodes[0].pos[1] - e.nodes[1].pos[1] - ny = e.nodes[1].pos[0] - e.nodes[0].pos[0] - for n in e.nodes: - gradx0 += solver0.U[n.row][0] / e.nodes.size() - grady0 += solver0.U[n.row][1] / e.nodes.size() - gradx1 += solver1.U[n.row][0] / e.nodes.size() - grady1 += solver1.U[n.row][1] / e.nodes.size() - gradn0.append(gradx0 * nx + grady0 * ny) - gradn1.append(gradx1 * nx + grady1 * ny) - errNeu0 = sum(gradn0) / len(gradn0) - errNeu1 = sum(gradn1) / len(gradn1) - # compute largest error in Dirichlet boundary condition - errDir0 = 0. - errDir1 = 0. - for n in dirichlet.nodes: - errCur = solver0.phi[n.row] - (n.pos[0]*U_inf[0] + n.pos[1]*U_inf[1]) - if (abs(errCur) > errDir0): - errDir0 = abs(errCur) - errCur = solver1.phi[n.row] - (n.pos[0]*U_inf[0] + n.pos[1]*U_inf[1]) - if (abs(errCur) > errDir1): - errDir1 = abs(errCur) - # compute largest error in Wake boundary condition - errWak0 = 0. - errWak1 = 0. - for n in wake.nodMap: - errCur = solver0.Cp[n.row] - solver0.Cp[wake.nodMap[n].row] - if (abs(errCur) > errWak0): - errWak0 = abs(errCur) - errCur = solver1.Cp[n.row] - solver1.Cp[wake.nodMap[n].row] - if (abs(errCur) > errWak1): - errWak1 = abs(errCur) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution - floD.initViewer(pbl) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - if not cnvrgd0 or not cnvrgd1: - raise Exception(ccolors.ANSI_RED + 'Flow solver failed to converge!' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('Picard: iteration count', solver0.nIt, 12, 1, forceabs=True)) - tests.add(CTest('Picard: Neumann B.C. mean error', errNeu0, 0., 1e-2)) - tests.add(CTest('Picard: Dirichlet B.C. max error', errDir0, 0., 1e-8)) - tests.add(CTest('Picard: Wake/Kutta B.C. max error', errWak0, 0., 1e-2)) - tests.add(CTest('Newton: iteration count', solver1.nIt, 3, 1, forceabs=True)) - tests.add(CTest('Newton: Neumann B.C. mean error', errNeu1, 0., 1e-2)) - tests.add(CTest('Newton: Dirichlet B.C. max error', errDir1, 0., 1e-8)) - tests.add(CTest('Newton: Wake/Kutta B.C. max error', errWak1, 0., 1e-2)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/cylinder2D5.py b/flow/tests/cylinder2D5.py deleted file mode 100644 index 55dea297..00000000 --- a/flow/tests/cylinder2D5.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute the (non)linear flow around extruded 2D cylinder, with various B.C. -# Adrien Crovato -# -# Test solver convergence and boundary conditions -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.default as floD -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3*math.pi/180 - U_inf = [math.cos(alpha), 0., math.sin(alpha)] # norm should be 1 - M_inf = 0.1 - dim = 3 - - # define dimension and mesh size - dmt = 1.0 # cylinder diameter - lgt = 8.0 # channel length - hgt = 6.0 # channel height - wdt = 3.0 # channel width - l_ref = dmt # reference length - S_ref = dmt*wdt # reference area - fms = 0.5 # farfield mesh size - nms = 0.1 # nearfield mesh size - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms["msh"].start() - pars = {'dmt' : dmt, 'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msN' : nms, 'msF' : fms} - msh, gmshWriter = floD.mesh(dim, 'models/cylinder_2D5.geo', pars, ['field', 'cylinder', 'symmetry', 'downstream']) - tms["msh"].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, dirichlet, wake, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, l_ref, 0., 0., 0., 'cylinder', tp = 'te', dbc=True) - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - cnvrgd = solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # compute mean error in Boundary, Neumann boundary condition (works only for Tri3 elements) - gradn = [] - for e in bnd.groups[0].tag.elems: - gradx = 0 - grady = 0 - gradz = 0 - ux = e.nodes[1].pos[0] - e.nodes[0].pos[0] - uy = e.nodes[1].pos[1] - e.nodes[0].pos[1] - uz = e.nodes[1].pos[2] - e.nodes[0].pos[2] - vx = e.nodes[2].pos[0] - e.nodes[0].pos[0] - vy = e.nodes[2].pos[1] - e.nodes[0].pos[1] - vz = e.nodes[2].pos[2] - e.nodes[0].pos[2] - nx = uy*vz - uz*vy - ny = uz*vx - ux*vz - nz = ux*vy - uy*vx - for n in e.nodes: - gradx += solver.U[n.row][0] / e.nodes.size() - grady += solver.U[n.row][1] / e.nodes.size() - gradz += solver.U[n.row][2] / e.nodes.size() - gradn_ = gradx * nx + grady * ny + gradz * nz - gradn.append(gradn_) - errNeu = sum(gradn) / len(gradn) - # compute largest error in Dirichlet boundary condition - errDir = 0. - for n in dirichlet.nodes: - errCur = solver.phi[n.row] - (n.pos[0]*U_inf[0] + n.pos[1]*U_inf[1] + n.pos[2]*U_inf[2]) - if (abs(errCur) > errDir): - errDir = abs(errCur) - # compute largest error in Wake boundary condition - errWak = 0. - for n in wake.nodMap: - errCur = solver.Cp[n.row] - solver.Cp[wake.nodMap[n].row] - if (abs(errCur) > errWak): - errWak = abs(errCur) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution - floD.initViewer(pbl) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - if (not cnvrgd): - raise Exception(ccolors.ANSI_RED + 'Flow solver failed to converge!' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('iteration count', solver.nIt, 3, 1, forceabs=True)) - tests.add(CTest('Neumann B.C. mean error', errNeu, 0., 1e-2)) - tests.add(CTest('Dirichlet B.C. max error', errDir, 0., 1e-12)) - tests.add(CTest('Wake/Kutta B.C. max error', errWak, 0., 1e-1)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/cylinder3.py b/flow/tests/cylinder3.py deleted file mode 100644 index 01c611fc..00000000 --- a/flow/tests/cylinder3.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute the (non)linear flow around 3D cylinder, with various B.C. -# Adrien Crovato -# -# Test solver convergence and boundary conditions -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.utils as floU -import flow.default as floD -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3*math.pi/180 - U_inf = [math.cos(alpha), 0., math.sin(alpha)] # norm should be 1 - M_inf = 0.1 - dim = 3 - - # define dimension and mesh size - dmt = 1.0 # cylinder diameter - spn = 2.0 # cylinder span - tpt = 5e-2 # cylinder tip thickness (ratio wrt span) - lgt = 8.0 # channel length - hgt = 6.0 # channel height - wdt = 3.0 # channel width - l_ref = dmt # reference length - S_ref = dmt*spn # reference area - fms = 0.5 # farfield mesh size - nms = 0.1 # nearfield mesh size - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'dmt' : dmt, 'spn' : spn, 'tpt' : tpt, 'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msN' : nms, 'msF' : fms} - msh, gmshWriter = floD.mesh(dim, 'models/cylinder_3.geo', pars, ['field', 'cylinder', 'symmetry', 'downstream'], wktp = 'wakeTip') - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, dirichlet, wake, bnd,_ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, l_ref, 0., 0., 0., 'cylinder', tp = 'teTip', dbc=True) - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - cnvrgd = solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # compute mean error in Boundary, Neumann boundary condition (works only for Tri3 elements) - gradn = [] - for e in bnd.groups[0].tag.elems: - gradx = 0 - grady = 0 - gradz = 0 - ux = e.nodes[1].pos[0] - e.nodes[0].pos[0] - uy = e.nodes[1].pos[1] - e.nodes[0].pos[1] - uz = e.nodes[1].pos[2] - e.nodes[0].pos[2] - vx = e.nodes[2].pos[0] - e.nodes[0].pos[0] - vy = e.nodes[2].pos[1] - e.nodes[0].pos[1] - vz = e.nodes[2].pos[2] - e.nodes[0].pos[2] - nx = uy*vz - uz*vy - ny = uz*vx - ux*vz - nz = ux*vy - uy*vx - for n in e.nodes: - gradx += solver.U[n.row][0] / e.nodes.size() - grady += solver.U[n.row][1] / e.nodes.size() - gradz += solver.U[n.row][2] / e.nodes.size() - gradn_ = gradx * nx + grady * ny + gradz * nz - gradn.append(gradn_) - errNeu = sum(gradn) / len(gradn) - # compute largest error in Dirichlet boundary condition - errDir = 0. - for n in dirichlet.nodes: - errCur = solver.phi[n.row] - (n.pos[0]*U_inf[0] + n.pos[1]*U_inf[1] + n.pos[2]*U_inf[2]) - if (abs(errCur) > errDir): - errDir = abs(errCur) - # compute largest error in Wake boundary condition - errWak = 0. - for n in wake.nodMap: - errCur = solver.Cp[n.row] - solver.Cp[wake.nodMap[n].row] - if (abs(errCur) > errWak): - errWak = abs(errCur) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution - floD.initViewer(pbl) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - if (not cnvrgd): - raise Exception(ccolors.ANSI_RED + 'Flow solver failed to converge!' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('iteration count', solver.nIt, 4, 1, forceabs=True)) - tests.add(CTest('Neumann B.C. mean error', errNeu, 0., 1e-2)) - tests.add(CTest('Dirichlet B.C. max error', errDir, 0., 1e-12)) - tests.add(CTest('Wake/Kutta B.C. max error', errWak, 0., 1e-1)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/lift.py b/flow/tests/lift.py deleted file mode 100644 index 86e19995..00000000 --- a/flow/tests/lift.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute lifting (linear or nonlinear) potential flow around a NACA 0012 -# Adrien Crovato -# -# Test the nonlinear shock-capturing capability and the Kutta condition -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.utils as floU -import flow.default as floD -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 2*math.pi/180 - M_inf = 0.7 - c_ref = 1 - dim = 2 - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1., 'msTe' : 0.0075, 'msLe' : 0.0075} - msh, gmshWriter = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, c_ref, c_ref, 0.25, 0., 0., 'airfoil', te = 'te') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # extract Cp - Cp = floU.extract(bnd.groups[0].tag.elems, solver.Cp) - tboxU.write(Cp, 'Cp_airfoil.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' M alpha Cl Cd Cm') - print('{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}'.format(M_inf, alpha*180/math.pi, solver.Cl, solver.Cd, solver.Cm)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution and plot results - floD.initViewer(pbl) - tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if M_inf == 0 and alpha == 3*math.pi/180: - tests.add(CTest('min(Cp)', min(Cp[:,3]), -1.1, 1.5e-1)) - tests.add(CTest('Cl', solver.Cl, 0.36, 5e-2)) - tests.add(CTest('Cm', solver.Cm, 0.0, 1e-2)) - elif M_inf == 0.6 and alpha == 2*math.pi/180: - tests.add(CTest('min(Cp)', min(Cp[:,3]), -1.03, 1e-1)) - tests.add(CTest('Cl', solver.Cl, 0.315, 5e-2)) - tests.add(CTest('Cm', solver.Cm, 0.0, 1e-2)) - elif M_inf == 0.7 and alpha == 2*math.pi/180: - tests.add(CTest('iteration count', solver.nIt, 12, 3, forceabs=True)) - tests.add(CTest('min(Cp)', min(Cp[:,3]), -1.28, 5e-2)) - tests.add(CTest('Cl', solver.Cl, 0.388, 5e-2)) - tests.add(CTest('Cm', solver.Cm, 0.0, 1e-2)) - else: - raise Exception('Test not defined for this flow') - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/lift3.py b/flow/tests/lift3.py deleted file mode 100644 index 9b6e903f..00000000 --- a/flow/tests/lift3.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute lifting (linear or nonlinear) potential flow around a NACA 0012 rectangular wing -# Adrien Crovato -# -# Test the nonlinear shock-capturing capability and the Kutta condition -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import math -import flow.utils as floU -import flow.default as floD -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3*math.pi/180 - M_inf = 0.3 - dim = 3 - - # define dimension and mesh size - spn = 1.0 # wing span - lgt = 3.0 # channel half length - hgt = 3.0 # channel half height - wdt = 3.0 # channel width - S_ref = 1.*spn # reference area - c_ref = 1 # reference chord - fms = 1.0 # farfield mesh size - nms = 0.02 # nearfield mesh size - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'spn' : spn, 'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msLe' : nms, 'msTe' : nms, 'msF' : fms} - msh, gmshWriter = floD.mesh(dim, 'models/n0012_3.geo', pars, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution - floD.initViewer(pbl) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if alpha == 3*math.pi/180 and M_inf == 0.3 and spn == 1.0: - tests.add(CTest('iteration count', solver.nIt, 3, 1, forceabs=True)) - tests.add(CTest('CL', solver.Cl, 0.135, 5e-2)) - tests.add(CTest('CD', solver.Cd, 0.0062, 1e-2)) # Tranair (NF=0.0062, FF=0.0030), Panair 0.0035 - tests.add(CTest('CS', solver.Cs, 0.0121, 5e-2)) - tests.add(CTest('CM', solver.Cm, -0.0278, 2.5e-2)) # gmsh 4.4: -0.0278 ; gmsh 4.8: -0.027147 - else: - raise Exception('Test not defined for this flow') - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/meshDef.py b/flow/tests/meshDef.py deleted file mode 100644 index a89c0ab3..00000000 --- a/flow/tests/meshDef.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute the flow around a NACA 0012 on a deformed mesh -# Adrien Crovato -# -# Test the mesh deformation process -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import numpy as np -import flow.utils as floU -import flow.default as floD -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha0 = 0 # must be zero for this testfile - M_inf = 0.3 - c_ref = 1 - dim = 2 - # parameters for mesh deformation - alfa = 10*np.pi/180 - xc = 0.25 - dx = 0.2 - dy = 0.5 - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1., 'msTe' : 0.01, 'msLe' : 0.01} - msh, gmshWriter = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - # create mesh deformation handler - mshDef = floD.meshMorpher(msh, dim, ['airfoil']) - # mesh the reference geometry - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1., 'msTe' : 0.01, 'msLe' : 0.01, 'angle' : alfa, 'xRot' : xc} - msh_ref, gmshWriter_ref = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha0, 0., M_inf, c_ref, c_ref, xc+dx, dy, 0., 'airfoil', te = 'te') - # set the refrence problem and add medium, initial/boundary conditions - pbl_ref, _, _, bnd_ref, _ = floD.problem(msh_ref, dim, alpha0, 0., M_inf, c_ref, c_ref, xc, 0., 0., 'airfoil', te = 'te') - tms['pre'].stop() - - # solver problem for 0°AOA - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver0'].start() - solver = floD.newton(pbl) - solver.run() - tms['solver0'].stop() - - # deform the mesh (dummy rotation + translation) - print(ccolors.ANSI_BLUE + 'PyDeforming...' + ccolors.ANSI_RESET) - tms['deform'].start() - mshDef.savePos() - rMat = np.matrix([[np.cos(alfa), np.sin(alfa)], [-np.sin(alfa), np.cos(alfa)]]) - vNods = {} - for e in bnd.groups[0].tag.elems: - for n in e.nodes: - if n.no not in vNods: - vNods[n.no] = n - for no in vNods: - nod = np.matrix([[vNods[no].pos[0]-xc], [vNods[no].pos[1]]]) - new = rMat * nod - vNods[no].pos[0] = new[0,0] + dx + xc - vNods[no].pos[1] = new[1,0] + dy - # deform the mesh - mshDef.deform() - gmshWriter.save("n0012_def") - tms['deform'].stop() - - # solve problem for alfa AOA - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver1'].start() - solver.run() - solver.save(gmshWriter) - tms['solver1'].stop() - - # compute reference solution - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver_ref'].start() - solver_ref = floD.newton(pbl_ref) - solver_ref.run() - solver_ref.save(gmshWriter_ref) - tms['solver_ref'].stop() - - # extract Cp - Cp = floU.extract(bnd.groups[0].tag.elems, solver.Cp) - tboxU.write(Cp, 'Cp_airfoil.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - Cp_ref = floU.extract(bnd_ref.groups[0].tag.elems, solver_ref.Cp) - tboxU.write(Cp, 'Cp_airfoil_ref.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' case M alpha Cl Cd Cm') - print(' true {0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}'.format(M_inf, alfa*180/np.pi, solver.Cl, solver.Cd, solver.Cm)) - print(' ref {0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}'.format(M_inf, alfa*180/np.pi, solver_ref.Cl, solver_ref.Cd, solver_ref.Cm)) - - # display timers - tms["total"].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print("CPU statistics") - print(tms) - - # visualize solution and plot results - tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True) - tboxU.plot(Cp_ref[:,0], Cp_ref[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver_ref.Cl, solver_ref.Cd, solver_ref.Cm, 4), True) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('solver: iteration count', solver.nIt, 5, 3, forceabs=True)) # todo: tolerance should be reset to 1 as soon as gmsh4 is used - tests.add(CTest('solver_ref: iteration count', solver_ref.nIt, 5, 1, forceabs=True)) - tests.add(CTest('min(Cp)', min(Cp[:,3]), min(Cp_ref[:,3]), 5e-2)) - tests.add(CTest('Cl', solver.Cl, solver_ref.Cl, 5e-2)) - tests.add(CTest('Cm', solver.Cm, solver_ref.Cm, 5e-2)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/meshDef3.py b/flow/tests/meshDef3.py deleted file mode 100644 index 3e7de932..00000000 --- a/flow/tests/meshDef3.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute the flow around a NACA 0012 wing on a deformed mesh -# Adrien Crovato -# -# Test the mesh deformation process -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. - -import numpy as np -import flow.utils as floU -import flow.default as floD -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha0 = 0 # must be zero for this testfile - M_inf = 0.3 - dim = 3 - - # define dimension and mesh size - spn = 1.0 # wing span - lgt = 3.0 # channel half length - hgt = 3.0 # channel half height - wdt = 3.0 # channel width - S_ref = 1.*spn # reference area - c_ref = 1 # reference chord - fms = 1.0 # farfield mesh size - nms = 0.05 # nearfield mesh size - - # parameters for mesh deformation - alfa = 3*np.pi/180 - xc = 0.25 - dz_max = 0.2*spn - - # mesh an airfoil - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'spn' : spn, 'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msLe' : nms, 'msTe' : nms, 'msF' : fms} - msh, gmshWriter = floD.mesh(dim, 'models/n0012_3.geo', pars, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - tms['msh'].stop() - # create mesh deformation handler - mshDef = floD.meshMorpher(msh, dim, ['wing']) - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha0, 0., M_inf, S_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solver problem for 0°AOA - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver0'].start() - solver = floD.newton(pbl) - solver.run() - tms['solver0'].stop() - - # deform the mesh (dummy rotation + bending) - print(ccolors.ANSI_BLUE + 'PyDeforming...' + ccolors.ANSI_RESET) - tms['deform'].start() - mshDef.savePos() - rMat = np.matrix([[np.cos(alfa), np.sin(alfa)], [-np.sin(alfa), np.cos(alfa)]]) - vNods = {} - for e in bnd.groups[0].tag.elems: - for n in e.nodes: - if n.no not in vNods: - vNods[n.no] = n - for no in vNods: - nod = np.matrix([[vNods[no].pos[0]-xc], [vNods[no].pos[2]]]) - new = rMat * nod - vNods[no].pos[0] = new[0,0] - vNods[no].pos[2] = new[1,0] + dz_max/(spn*spn)*(vNods[no].pos[1]*vNods[no].pos[1]) - # deform the mesh - mshDef.deform() - gmshWriter.save(msh.name+"_def") - tms['deform'].stop() - - # solve problem for alfa AOA - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver1'].start() - solver.run() - solver.save(gmshWriter) - tms['solver1'].stop() - - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' case M alpha Cl Cd Cm') - print(' true {0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}'.format(M_inf, alfa*180/np.pi, solver.Cl, solver.Cd, solver.Cm)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if alfa == 3*np.pi/180 and M_inf == 0.3 and spn == 1.0: - tests.add(CTest('iteration count', solver.nIt, 3, 1, forceabs=True)) - tests.add(CTest('CL', solver.Cl, 0.135, 5e-1)) - tests.add(CTest('CD', solver.Cd, 0.0062, 1e-2)) # Tranair (NF=0.0062, FF=0.0030), Panair 0.0035 - tests.add(CTest('CS', solver.Cs, -0.011, 5e-2)) - tests.add(CTest('CM', solver.Cm, 0.0061, 1e-2)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/tests/nonlift.py b/flow/tests/nonlift.py deleted file mode 100644 index 6a6f0427..00000000 --- a/flow/tests/nonlift.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute non-lifting (linear or nonlinear) potential flow around a NACA 0012 -# Adrien Crovato -# -# Test the nonlinear shock-capturing capability -# -# CAUTION -# This test is provided to ensure that the solver works properly. -# Mesh refinement may have to be performed to obtain physical results. -# The residual might not fully converge if this test is used with gmsh4 - -import math -import flow.utils as floU -import flow.default as floD -import tbox.utils as tboxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 0*math.pi/180 # must be zero for this testfile - M_inf = 0.8 - c_ref = 1 - dim = 2 - - # mesh the geometry - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xLgt' : 5, 'yLgt' : 5, 'msF' : 1.01, 'msTe' : 0.01, 'msLe' : 0.01} - msh, gmshWriter = floD.mesh(dim, 'models/n0012.geo', pars, ['field', 'airfoil', 'downstream']) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, bnd, _ = floD.problem(msh, dim, alpha, 0., M_inf, c_ref, c_ref, 0.25, 0., 0., 'airfoil', te = 'te') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(gmshWriter) - tms['solver'].stop() - - # extract Cp - Cp = floU.extract(bnd.groups[0].tag.elems, solver.Cp) - tboxU.write(Cp, 'Cp_airfoil.dat', '%1.5e', ', ', 'x, y, z, Cp', '') - # display results - print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET) - print(' M alpha Cl Cd Cm') - print('{0:8.2f} {1:8.1f} {2:8.4f} {3:8.4f} {4:8.4f}'.format(M_inf, alpha*180/math.pi, solver.Cl, solver.Cd, solver.Cm)) - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # visualize solution and plot results - floD.initViewer(pbl) - tboxU.plot(Cp[:,0], Cp[:,3], 'x', 'Cp', 'Cl = {0:.{3}f}, Cd = {1:.{3}f}, Cm = {2:.{3}f}'.format(solver.Cl, solver.Cd, solver.Cm, 4), True) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - if M_inf == 0: - tests.add(CTest('min(Cp)', min(Cp[:,3]), -0.405, 5e-2)) - elif M_inf == 0.7: - tests.add(CTest('min(Cp)', min(Cp[:,3]), -0.63, 5e-2)) - elif M_inf == 0.8: - tests.add(CTest('iteration count', solver.nIt, 15, 3, forceabs=True)) - tests.add(CTest('min(Cp)', min(Cp[:,3]), -0.89, 5e-2)) - else: - raise Exception('Test not defined for this flow') - tests.add(CTest('Cl', solver.Cl, 0., 1e-2)) - tests.add(CTest('Cm', solver.Cm, 0., 1e-2)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/utils.py b/flow/utils.py deleted file mode 100644 index 43d9e8ae..00000000 --- a/flow/utils.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Utilities for flow -# Adrien Crovato - -def computeAeroCoef(_x, _y, _Cp, _alpha): - '''Compute 2D aerodynamic coefficients - The coefficients are computed from Cp averaged at nodes, which might leads to innacurate results - For accurate results, use coefficients from solver or boundary objects - ''' - import math - i = 0 - Cy = 0 - Cx = 0 - Cm = 0 # positive nose-up (clockwise) - while i < (len(_x)-1): - dx = -(_x[i+1] - _x[i]) - dy = -(_y[i+1] - _y[i]) - Cy += 0.5 * dx * (_Cp[i+1] + _Cp[i]) - Cx -= 0.5 * dy * (_Cp[i+1] + _Cp[i]) - Cm -= 0.5*(_Cp[i+1]*(_x[i+1]-0.25) + _Cp[i]*(_x[i]-0.25)) * dx + 0.5*(_Cp[i+1]*_y[i+1] + _Cp[i]*_y[i]) * dy - i = i+1 - Cl = Cy*math.cos(_alpha) - Cx*math.sin(_alpha) - Cd = Cy*math.sin(_alpha) + Cx*math.cos(_alpha) - return (Cl, Cd, Cm) - -def convex_sort(vNodes, vData): - '''Sort point cloud data forming a convex hull in counterclowise order, from TE - ''' - import numpy as np - # store map in arrays - data = np.zeros((vNodes.size(),4)) - i = 0 - for n in vNodes: - data[i,0] = n.pos[0] - data[i,1] = n.pos[1] - data[i,2] = n.pos[2] - data[i,3] = vData[i] - i += 1 - # sort array in counterclowise direction, from TE - cg = np.array([np.average(data[:,0]),np.average(data[:,1])]) - angle = np.zeros((vNodes.size())) - i = 0 - while i < len(data[:,0]): - angle[i] = math.atan2(data[i,1]-cg[1],data[i,0]-cg[0]) - if angle[i] < 0: - angle[i] = 2 * np.pi + angle[i] - i+=1 - angleIdx = angle.argsort() - data[:,0] = data[angleIdx,0] - data[:,1] = data[angleIdx,1] - data[:,2] = data[angleIdx,2] - data[:,3] = data[angleIdx,3] - max_x = np.argmax(data[:,0]) - data = np.roll(data, -(max_x+1), axis = 0) - return data - -def extract(vElems, vData): - '''Extract data at first node of elements - ''' - import numpy as np - # check if input is scalar or vector - if isinstance(vData[0], float): - size = 1 - elif vData[0].size() == 3: - size = 3 - else: - raise RuntimeError('flow.utils.extract: unrecognized format for vData!') - # store data (not efficient, but OK since only meant for small 2D cases) - data = np.zeros((vElems.size()+1,3+size)) - i = 0 - while i < vElems.size()+1: - data[i,0] = vElems[i%vElems.size()].nodes[0].pos[0] - data[i,1] = vElems[i%vElems.size()].nodes[0].pos[1] - data[i,2] = vElems[i%vElems.size()].nodes[0].pos[2] - if size == 1: - data[i,3] = vData[vElems[i%vElems.size()].nodes[0].row] - else: - for j in range(size): - data[i,3+j] = vData[vElems[i%vElems.size()].nodes[0].row][j] - i += 1 - return data - -def writeSlices(mshName, ys, wId, n = 0): - '''Write slice data for each ys coordinate along the span (only works with VTK) - ''' - import numpy as np - try: - import vtk - except: - raise Exception('VTK not found!\n') - import tbox.utils as tU - import tboxVtk.reader as vtkR - import tboxVtk.cutter as vtkC - reader = vtkR.Reader() - if n == 0: - reader.open(mshName) - else: - reader.open(mshName+'_'+str(n)) - cutter = vtkC.Cutter(reader.reader.GetOutputPort()) - for i in range(0, len(ys)): - pts, elems, vals = cutter.extract(cutter.cut(wId, [0., ys[i], 0.], [0., 1., 0.]), 2, ['Cp']) - x_c = np.zeros((pts.shape[0],1)) - x_c[:,0] = (pts[:,0] - min(pts[:,0])) / (max(pts[:,0]) - min(pts[:,0])) - data = np.hstack((pts, x_c)) - data = np.hstack((data, vals['Cp'])) - tU.sort(elems, data) - data = np.vstack((data, data[0,:])) - if n == 0: - tU.write(data, 'slice_'+str(i)+'.dat', '%1.5e', ', ', 'x, y, z, x/c, Cp', '') - else: - tU.write(data, 'slice_'+str(n)+'_'+str(i)+'.dat', '%1.5e', ', ', 'x, y, z, x/c, Cp', '') diff --git a/flow/validation/agard.py b/flow/validation/agard.py deleted file mode 100644 index 38655a73..00000000 --- a/flow/validation/agard.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute flow around the Agard 445 wing at 1 degrees AOA and Mach 0.80 -# Adrien Crovato - -import numpy as np -import flow.utils as floU -import flow.default as floD -import tbox.utils as tbxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -try: - import tboxVtk - BestWriter = tboxVtk.VtkExport - canPost = True -except: - BestWriter = tbox.GmshExport - canPost = False - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 1*np.pi/180 - M_inf = 0.8 - M_crit = 5 # Squared critical Mach number (above which density is modified) - dim = 3 - - # define dimension and mesh size - lgt = 7. # box length - hgt = 6. # box height - wdt = 3. # box width - xO = -3. # box x-origin - zO = -3. # box z-origin - S_ref = .35 # reference area - c_ref = .47 # reference chord (MAC) - rlems = 0.0028 # root leading edge mesh size - rtems = 0.0056 # root trailing edge mesh size - tlems = 0.0018 # tip leading mesh size - ttems = 0.0045 # tip trailing mesh size - fms = 1.0 # farfield mesh size - - # mesh the wing - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'xL' : lgt, 'yL' : wdt, 'zL' : hgt, 'xO' : xO, 'zO' : zO, 'msLeRt' : rlems, 'msTeRt' : rtems, 'msLeTp' : tlems, 'msTeTp' : ttems, 'msF' : fms} - msh, _ = floD.mesh(dim, 'models/agard445.geo', pars, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - writer = BestWriter(msh) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, _, _ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(writer) - tms['solver'].stop() - - # post process - tms['post'].start() - if canPost: - floU.writeSlices(msh.name,[0.01, 0.37, 0.75],5) - data = tbxU.read('slice_1.dat') - tbxU.plot(data[:,3], data[:,4], 'x', 'Cp', 'Pressure distribution at MAC', True) - tms['post'].stop() - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('CL', solver.Cl, 0.062, 1e-1)) - tests.add(CTest('CD', solver.Cd, 0.0006, 1e-1)) - tests.add(CTest('CS', solver.Cs, 0.0017, 1e-1)) - tests.add(CTest('CM', solver.Cm, -0.064, 1e-1)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/validation/onera.py b/flow/validation/onera.py deleted file mode 100644 index 71e5bc2c..00000000 --- a/flow/validation/onera.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Compute flow around the Onera M6 wing at 3 degrees AOA and Mach 0.84 -# Adrien Crovato - -import numpy as np -import flow.utils as floU -import flow.default as floD -import tbox.utils as tbxU -import fwk -from fwk.testing import * -from fwk.coloring import ccolors - -try: - import tboxVtk - BestWriter = tboxVtk.VtkExport - canPost = True -except: - BestWriter = tbox.GmshExport - canPost = False - -def main(): - # timer - tms = fwk.Timers() - tms['total'].start() - - # define flow variables - alpha = 3.06*np.pi/180 - M_inf = 0.839 - dim = 3 - - # define dimension and mesh size - lgt = 3.0 # channel half length - hgt = 3.0 # channel half height - wdt = 3.0 # channel width - S_ref = 0.7528 # reference area - c_ref = 0.64 # reference chord (MAC) - fms = 0.5 # farfield mesh size - rlems = 0.004 # root leading edge mesh size - rtems = 0.008 # root trailing edge mesh size - tlems = 0.002 # tip leading mesh size - ttems = 0.008 # tip trailing mesh size - - # mesh the wing - print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - tms['msh'].start() - pars = {'lgt' : lgt, 'wdt' : wdt, 'hgt' : hgt, 'msLeRt' : rlems, 'msTeRt' : rtems, 'msLeTp' : tlems, 'msTeTp' : ttems, 'msF' : fms} - msh, _ = floD.mesh(dim, 'models/oneraM6.geo', pars, ['field', 'wing', 'symmetry', 'downstream'], wktp = 'wakeTip') - writer = BestWriter(msh) - tms['msh'].stop() - - # set the problem and add medium, initial/boundary conditions - tms['pre'].start() - pbl, _, _, _, _ = floD.problem(msh, dim, alpha, 0., M_inf, S_ref, c_ref, 0., 0., 0., 'wing', tp = 'teTip') - tms['pre'].stop() - - # solve problem - print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) - tms['solver'].start() - solver = floD.newton(pbl) - solver.run() - solver.save(writer) - tms['solver'].stop() - - # post process - tms['post'].start() - if canPost: - floU.writeSlices(msh.name,[0.01, 0.239, 0.526, 0.777, 0.957, 1.076, 1.136, 1.184],5) - data = tbxU.read('slice_2.dat') - tbxU.plot(data[:,3], data[:,4], 'x', 'Cp', 'Pressure distribution at MAC', True) - tms['post'].stop() - - # display timers - tms['total'].stop() - print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) - print('CPU statistics') - print(tms) - - # check results - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - tests.add(CTest('CL', solver.Cl, 0.29, 1e-1)) - tests.add(CTest('CD', solver.Cd, 0.011, 1e-1)) - tests.add(CTest('CS', solver.Cs, 0.014, 1e-1)) - tests.add(CTest('CM', solver.Cm, -0.212, 1e-1)) - tests.run() - - # eof - print('') - -if __name__ == "__main__": - main() diff --git a/flow/viscous/__init__.py b/flow/viscous/__init__.py deleted file mode 100644 index 40a96afc..00000000 --- a/flow/viscous/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/flow/viscous/airfoil.py b/flow/viscous/airfoil.py deleted file mode 100644 index c6d0f3f8..00000000 --- a/flow/viscous/airfoil.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Airfoil around which the boundary layer is computed -# Amaury Bilocq - -from flow.viscous.boundary import Boundary -import numpy as np - -class Airfoil(Boundary): - def __init__(self, _boundary): - Boundary.__init__(self, _boundary) - self.name = 'airfoil' # type of boundary - self.T0 = 0 # initial condition for the momentum thickness - self.H0 = 0 - self.n0 = 0 - self.Ct0 = 0 - self.TEnd = [0,0] - self.HEnd = [0,0] - self.CtEnd = [0,0] - self.nEnd = [0,0] - - def initialConditions(self, Re, dv): - if dv > 0: - self.T0 = np.sqrt(0.075/(Re*dv)) - else: - self.T0 = 1e-6 - self.H0 = 2.23 # One parameter family Falkner Skan - self.n0 = 0 - self.Ct0 = 0 - return self.T0, self.H0, self.n0, self.Ct0 - - def connectList(self): - ''' Sort the value read by the viscous solver/ Create list of connectivity - ''' - N1 = np.zeros(self.nN, dtype=int) # Node number - connectListNodes = np.zeros(self.nN, dtype=int) # Index in boundary.nodes - connectListElems = np.zeros(self.nE, dtype=int) # Index in boundary.elems - data = np.zeros((self.boundary.nodes.size(), 10)) - i = 0 - for n in self.boundary.nodes: - data[i,0] = n.no - data[i,1] = n.pos[0] - data[i,2] = n.pos[1] - data[i,3] = n.pos[2] - data[i,4] = self.v[i,0] - data[i,5] = self.v[i,1] - data[i,6] = self.Me[i] - data[i,7] = self.rhoe[i] - data[i,8] = self.deltaStar[i] - data[i,9] = self.xx[i] - i += 1 - # Table containing the element and its nodes - eData = np.zeros((self.nE,3), dtype=int) - for i in range(0, self.nE): - eData[i,0] = self.boundary.tag.elems[i].no - eData[i,1] = self.boundary.tag.elems[i].nodes[0].no - eData[i,2] = self.boundary.tag.elems[i].nodes[1].no - # Find the stagnation point - idxStag = np.argmin(np.sqrt(data[:,4]**2+data[:,5]**2)) - globStag = int(data[idxStag,0]) # position of the stagnation point in boundary.nodes - # Find TE nodes (assuming suction side element is above pressure side element in the y direction) - idxTE = np.where(data[:,1] == np.max(data[:,1]))[0] # TE nodes - idxTEe0 = np.where(np.logical_or(eData[:,1] == data[idxTE[0],0], eData[:,2] == data[idxTE[0],0]))[0] # TE element 1 - idxTEe1 = np.where(np.logical_or(eData[:,1] == data[idxTE[1],0], eData[:,2] == data[idxTE[1],0]))[0] # TE element 2 - ye0 = 0.5 * (data[np.where(data[:,0] == eData[idxTEe0[0],1])[0],2] + data[np.where(data[:,0] == eData[idxTEe0[0],2])[0],2]) # y coordinates of TE element 1 CG - ye1 = 0.5 * (data[np.where(data[:,0] == eData[idxTEe1[0],1])[0],2] + data[np.where(data[:,0] == eData[idxTEe1[0],2])[0],2]) # y coordinates of TE element 2 CG - if ye0 - ye1 > 0: # element 1 containing TE node 1 is above element 2 - upperGlobTE = int(data[idxTE[0],0]) - lowerGlobTE = int(data[idxTE[1],0]) - else: - upperGlobTE = int(data[idxTE[1],0]) - lowerGlobTE = int(data[idxTE[0],0]) - # Connectivity - connectListElems[0] = np.where(eData[:,1] == globStag)[0] - N1[0] = eData[connectListElems[0],1] # number of the stag node elems.nodes -> globStag - connectListNodes[0] = np.where(data[:,0] == N1[0])[0] - i = 1 - upperTE = 0 - lowerTE = 0 - # Sort the suction part - while upperTE == 0: - N1[i] = eData[connectListElems[i-1],2] # Second node of the element - connectListElems[i] = np.where(eData[:,1] == N1[i])[0] # # Index of the first node of the next element in elems.nodes - connectListNodes[i] = np.where(data[:,0] == N1[i])[0] # Index of the node in boundary.nodes - if eData[connectListElems[i],2] == upperGlobTE: - upperTE = 1 - i += 1 - # Sort the pressure side - connectListElems[i] = np.where(eData[:,2] == globStag)[0] - connectListNodes[i] = np.where(data[:,0] == upperGlobTE)[0] - N1[i] = eData[connectListElems[i],2] - while lowerTE == 0: - N1[i+1] = eData[connectListElems[i],1] # First node of the element - connectListElems[i+1] = np.where(eData[:,2] == N1[i+1])[0] # # Index of the second node of the next element in elems.nodes - connectListNodes[i+1] = np.where(data[:,0] == N1[i+1])[0] # Index of the node in boundary.nodes - if eData[connectListElems[i+1],1] == lowerGlobTE: - lowerTE = 1 - i += 1 - connectListNodes[i+1] = np.where(data[:,0] == lowerGlobTE)[0] - data[:,0] = data[connectListNodes,0] - data[:,1] = data[connectListNodes,1] - data[:,2] = data[connectListNodes,2] - data[:,3] = data[connectListNodes,3] - data[:,4] = data[connectListNodes,4] - data[:,5] = data[connectListNodes,5] - data[:,6] = data[connectListNodes,6] - data[:,7] = data[connectListNodes,7] - data[:,8] = data[connectListNodes,8] - data[:,9] = data[connectListNodes,9] - # Separated upper and lower part - data = np.delete(data,0,1) - uData = data[0:np.argmax(data[:,0])+1] - lData = data[np.argmax(data[:,0])+1:None] - lData = np.insert(lData, 0, uData[0,:], axis = 0) #double the stagnation point - return connectListNodes, connectListElems,[uData, lData] diff --git a/flow/viscous/boundary.py b/flow/viscous/boundary.py deleted file mode 100644 index 63a7c013..00000000 --- a/flow/viscous/boundary.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Base class representing a physical boundary -# Amaury Bilocq - -import numpy as np - -class Boundary: - def __init__(self, _boundary): - self.boundary = _boundary # boundary of interest - self.nN = len(self.boundary.nodes) # number of nodes - self.nE = len(self.boundary.tag.elems) # number of elements - self.v = np.zeros((self.nN, 3)) # velocity at edge of BL - self.u = np.zeros(self.nE) # blowing velocity - self.Me = np.zeros(self.nN) # Mach number at the edge of the boundary layer - self.rhoe = np.zeros(self.nN) # density at the edge of the boundary layer - self.connectListnodes = np.zeros(self.nN) # connectivity for nodes - self.connectListElems = np.zeros(self.nE) # connectivity for elements - self.deltaStar = np.zeros(self.nN) # displacement thickness - self.xx = np.zeros(self.nN) # coordinates in the reference of the physical surface. Used to store the values for the interaction law diff --git a/flow/viscous/coupler.py b/flow/viscous/coupler.py deleted file mode 100644 index e5d33818..00000000 --- a/flow/viscous/coupler.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Viscous-inviscid coupler (quasi-simultaneous coupling) -# Amaury Bilocq - -import numpy as np -from fwk.coloring import ccolors -from flow.viscous.airfoil import Airfoil -from flow.viscous.wake import Wake - -class Coupler: - def __init__(self, _isolver, _vsolver, _boundaryAirfoil, _boundaryWake, _tol, _writer): - self.isolver =_isolver # inviscid solver - self.vsolver = _vsolver # viscous solver - self.group = [Airfoil(_boundaryAirfoil), Wake(_boundaryWake)] # airfoil and wake python objects - self.tol = _tol # tolerance of the VII - self.writer = _writer - - def run(self): - ''' Perform coupling - ''' - # initialize loop - it = 0 - converged = 0 # temp - CdOld = self.vsolver.Cd - while converged == 0: - print(ccolors.ANSI_BLUE + 'Iteration: ', it, ccolors.ANSI_RESET) - # run inviscid solver - self.isolver.run() - print('--- Viscous solver parameters ---') - print('Tolerance (drag count):', self.tol * 1000) - print('--- Viscous problem definition ---') - print('Reynolds number:', self.vsolver.Re) - print('') - for n in range(0, len(self.group)): - print('Computing for', self.group[n].name, '...', end = ' ') - for i in range(0, len(self.group[n].boundary.nodes)): - self.group[n].v[i,0] = self.isolver.U[self.group[n].boundary.nodes[i].row][0] - self.group[n].v[i,1] = self.isolver.U[self.group[n].boundary.nodes[i].row][1] - self.group[n].v[i,2] = self.isolver.U[self.group[n].boundary.nodes[i].row][2] - self.group[n].Me[i] = self.isolver.M[self.group[n].boundary.nodes[i].row] - self.group[n].rhoe[i] = self.isolver.rho[self.group[n].boundary.nodes[i].row] - # run viscous solver - self.vsolver.run(self.group[n]) - if self.group[n].name == 'airfoil': - self.group[n+1].T0 = self.group[n].TEnd[0]+self.group[n].TEnd[1] - self.group[n+1].H0 = (self.group[n].HEnd[0]*self.group[n].TEnd[0]+self.group[n].HEnd[1]*self.group[n].TEnd[1])/self.group[n+1].T0 - self.group[n+1].Ct0 = (self.group[n].CtEnd[0]*self.group[n].TEnd[0]+self.group[n].CtEnd[1]*self.group[n].TEnd[1])/self.group[n+1].T0 - # get blowing velocity from viscous solver and update inviscid solver - for i in range(0, self.group[n].nE): - self.group[n].boundary.setU(i, self.group[n].u[i]) - print('done!') - print(' Iter Cd xtr_top xtr_bot Error') - print('{0:8d} {1:12.5f} {2:12.5f} {3:12.5f} {4:12.5f}'.format(it, self.vsolver.Cd, self.vsolver.xtr[0], self.vsolver.xtr[1], abs(self.vsolver.Cd - CdOld)/self.vsolver.Cd)) - print('') - # Converged or not - if abs(self.vsolver.Cd - CdOld)/self.vsolver.Cd < self.tol: - converged = 1 - else: - CdOld = self.vsolver.Cd - it += 1 - self.vsolver.it += 1 - # save results - self.isolver.save(self.writer) - self.vsolver.writeFile() - print('\n') diff --git a/flow/viscous/newton.py b/flow/viscous/newton.py deleted file mode 100644 index 66dac2df..00000000 --- a/flow/viscous/newton.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Newton raphson method coupled with linear solver -# Amaury Bilocq - -import numpy as np -from fwk.coloring import ccolors - -def newton(f, x, maxIt, tol=1.0e-8): - '''Newton procedure to solve the non linear set of boundary layer equations. - Boundary layer equations are parabolic in x -> downstream marching is used - An implicit marching model is applied (Crank Nicolson) -> matrix inversion is performed - ''' - # Numerical Jacobian - def jaco(f, x): - eps = 1.0e-8 - n = len(x) - jac = np.zeros((n,n)) - xp = x.copy() - xm = x.copy() - for j in range(n): - # perturb solution - xTmp = x[j] - xp[j] += eps - xm[j] -= eps - # compute jacobian - jac[:,j] = (f(xp) - f(xm)) / (2 * eps) - # reset - xp[j] = xTmp - xm[j] = xTmp - return jac - # Backtrack line search - def ls(f, x, dx): - a = 1.0 - ires = np.linalg.norm(f(x)) - while a > 1/64: - res = np.linalg.norm(f(x + a * dx)) - if res < ires: - break - else: - a /= 2 - return a - # Solve - for i in range(maxIt): - # solve - jac = jaco(f,x) - dx = np.linalg.solve(jac, -f(x)) - # line search - a = ls(f, x, dx) - x += a * dx - fx = f(x) - err = np.linalg.norm(fx) - # safeguard - x[0] = max(x[0],0.) - x[1] = max(x[1],1.0005) - if i != 0 and err < tol: - return x - # Raise error but return solution and error - raise RuntimeError(ccolors.ANSI_YELLOW + 'Newton solver - too many iterations!\n' + ccolors.ANSI_RESET, x, err) diff --git a/flow/viscous/solver.py b/flow/viscous/solver.py deleted file mode 100644 index f17dfea9..00000000 --- a/flow/viscous/solver.py +++ /dev/null @@ -1,489 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Integral boundary layer equations viscous solver -# Amaury Bilocq -# -# TODO list -# - Improve user-input -# -* let the user define the transition location -# -* let the user define the turbulence intensity (which will affect the amplification factor) -# - Improve the physics (robustness) -# -* wake should start turbulent -# -* use empirical correlations to fix Cteq at transition -# -- split the panel where the transition happens instead of averaging -# -* understand why Ct becomes negative in turbulent solver and prevent it -# - Improve the numerics (robustness) -# -* test the convergence by monitoring the change in the interaction velocity (vt) between 2 VVI iterations -# -- implement a more sophisticated line search (3 points quadratic?) -# -* try to use underrelaxation -# -- compute the jacobian analytically -# -* use an inverse coupling procedure when laminar separation occurs -# - Increase range of validity -# -- split the inviscid and viscous mesh -# -- check transonic predictions -# -- implement quasi-2D method for 3D flows - -from flow.viscous.boundary import Boundary -from flow.viscous.wake import Wake -import flow.viscous.newton as Newton -import numpy as np -from fwk.coloring import ccolors - -class Solver: - def __init__(self, _Re): - '''Initialize the viscous solver - ''' - self.Re = _Re # Reynolds number - self.gamma = 1.4 # heat capacity of air - self.Cd = 0 # drag coefficient - self.it = 0 # viscous inviscid iteration for interaction law - self.xtr = [1, 1] # set transition at TE reference coordinates - - def dictionary(self): - '''Create dictionary with the coordinates and the boundary layer parameters - ''' - wData = {} - wData['x'] = self.data[:,0] - wData['y'] = self.data[:,1] - wData['z'] = self.data[:,2] - wData['x/c'] = self.data[:,0]/max(self.data[:,0]) - wData['Cd'] = self.blScalars[0] - wData['Cdf'] = self.blScalars[1] - wData['Cdp'] = self.blScalars[2] - wData['delta*'] = self.blVectors[0] - wData['theta'] = self.blVectors[1] - wData['H'] = self.blVectors[2] - wData['Hk'] = self.blVectors[3] - wData['H*'] = self.blVectors[4] - wData['H**'] = self.blVectors[5] - wData['Cf'] = self.blVectors[6] - wData['Cdissip'] = self.blVectors[7] - wData['Ctau'] = self.blVectors[8] - wData['delta'] = self.blVectors[9] - wData['xtrTop'] = self.xtr[0] - wData['xtrBot'] = self.xtr[1] - return wData - - def writeFile(self): - '''Write the results in airfoil_viscous.dat - ''' - wData = self.dictionary() - toW = ['delta*', 'H', 'Cf'] # list of variable to be written (should be a user input) - # Write - print('writing file: airfoil_viscous.dat...', end = '') - f = open('airfoil_viscous.dat', 'w+') - f.write('$Aerodynamic coefficients\n') - f.write(' Re Cd Cdp Cdf xtr_top xtr_bot\n') - f.write('{0:15.6f} {1:15.6f} {2:15.6f} {3:15.6f} {4:15.6f} {5:15.6f}\n'.format(self.Re, wData['Cd'], wData['Cdp'], wData['Cdf'], wData['xtrTop'], wData['xtrBot'])) - f.write('$Boundary layer variables\n') - f.write(' x y z x/c') - for s in toW: - f.write(' {0:>15s}'.format(s)) - f.write('\n') - for i in range(len(self.data[:,0])): - f.write('{0:15.6f} {1:15.6f} {2:15.6f} {3:15.6f}'.format(wData['x'][i], wData['y'][i], wData['z'][i], wData['x/c'][i])) - for s in toW: - f.write(' {0:15.6f}'.format(wData[s][i])) - f.write('\n') - f.close() - print('done!') - - def __getBLcoordinates(self, data): - '''Transform the reference coordinates into airfoil coordinates - ''' - nN = len(data[:,0]) - nE = nN-1 #nbr of element along the surface - vt = np.zeros(nN) - xx = np.zeros(nN) # position along the surface of the airfoil - dx = np.zeros(nE) # distance along two nodes - dv = np.zeros(nE) # speed difference according to element - alpha = np.zeros(nE) # angle of the element for the rotation matrix - for i in range(0,nE): - alpha[i] = np.arctan2((data[i+1,1]-data[i,1]),(data[i+1,0]-data[i,0])) - dx[i] = np.sqrt((data[i+1,0]-data[i,0])**2+(data[i+1,1]-data[i,1])**2) - xx[i+1] = dx[i]+xx[i] - vt[i] = (data[i,3]*np.cos(alpha[i]) + data[i,4]*np.sin(alpha[i])) # tangential speed at node 1 element i - vt[i+1] = (data[i+1,3]*np.cos(alpha[i]) + data[i+1,4]*np.sin(alpha[i])) # tangential speed at node 2 element i - dv[i] = (vt[i+1] - vt[i])/dx[i] #velocity gradient according to element i. central scheme with half point - return xx, dv, vt, nN, alpha - - def __amplRoutine(self, Hk, Ret, theta): - '''Compute the amplitude of the TS waves envelop for the transition - ''' - Dgr = 0.08 - Hk1 = 3.5 - Hk2 = 4 - Hmi = (1/(Hk-1)) - logRet_crit = 2.492*(1/(Hk-1))**0.43 + 0.7*(np.tanh(14*Hmi-9.24)+1.0) # value at which the amplification starts to grow - if Ret <=0: - Ret = 1 - if np.log10(Ret) < logRet_crit - Dgr : - Ax = 0 - else: - Rnorm = (np.log10(Ret) - (logRet_crit-Dgr))/(2*Dgr) - if Rnorm <=0: - Rfac = 0 - if Rnorm >= 1: - Rfac = 1 - else: - Rfac = 3*Rnorm**2 - 2*Rnorm**3 - # normal envelope amplification rate - m = -0.05+2.7*Hmi-5.5*Hmi**2+3*Hmi**3+0.1*np.exp(-20*Hmi) - arg = 3.87*Hmi-2.52 - dndRet = 0.028*(Hk-1)-0.0345*np.exp(-(arg**2)) - Ax = (m*dndRet/theta)*Rfac - # set correction for separated profiles - if Hk > Hk1: - Hnorm = (Hk - Hk1)/(Hk2-Hk1) - if Hnorm >=1: - Hfac = 1 - else: - Hfac = 3*Hnorm**2 - 2*Hnorm**3 - Ax1 = Ax - Gro = 0.3+0.35*np.exp(-0.15*(Hk-5)) - Tnr = np.tanh(1.2*(np.log10(Ret)-Gro)) - Ax2 = (0.086*Tnr - 0.25/(Hk-1)**1.5)/theta - if Ax2 < 0: - Ax2 = 0 - Ax = Hfac*Ax2 + (1-Hfac)*Ax1 - if Ax < 0: - Ax = 0 - return Ax - - def __laminarClosure(self, theta, H, Ret,Me, name): - ''' Laminar closure derived from the Falkner-Skan one-parameter profile family - Nishida and Drela (1996) - ''' - Hk = (H - 0.29*Me**2)/(1+0.113*Me**2) # Kinematic shape factor - if name == "airfoil": - Hk = max(Hk, 1.02) - Hk = min(Hk,6) - else: - Hk = max(Hk, 1.00005) - Hk = min(Hk,6) - Hstar2 = (0.064/(Hk-0.8)+0.251)*Me**2 # Density shape parameter - delta = min((3.15+ H + (1.72/(Hk-1)))*theta, 12*theta) - Hks = Hk - 4.35 - if Hk <= 4.35: - dens = Hk + 1 - Hstar = 0.0111*Hks**2/dens - 0.0278*Hks**3/dens + 1.528 -0.0002*(Hks*Hk)**2 - elif Hk > 4.35: - Hstar = 1.528 + 0.015*Hks**2/Hk - Hstar = (Hstar + 0.028*Me**2)/(1+0.014*Me**2) # Whitfield's minor additional compressibility correction - if Hk < 5.5: - tmp = (5.5-Hk)**3 / (Hk+1) - Cf = (-0.07 + 0.0727*tmp)/Ret - elif Hk >= 5.5: - tmp = 1 - 1/(Hk-4.5) - Cf = (-0.07 + 0.015*tmp**2) /Ret - if Hk < 4: - Cd = ( 0.00205*(4.0-Hk)**5.5 + 0.207 ) * (Hstar/(2*Ret)) - elif Hk >= 4: - HkCd = (Hk-4)**2 - denCd = 1+0.02*HkCd - Cd = ( -0.0016*HkCd/denCd + 0.207) * (Hstar/(2*Ret)) - if name == 'wake': - Cd = 2*(1.10*(1.0-1.0/Hk)**2/Hk)* (Hstar/(2*Ret)) - Cf = 0 - return Cd, Cf, Hstar, Hstar2, Hk, delta - - def __turbulentClosure(self, theta, H, Ct, Ret, Me, name): - ''' Turbulent closure derived from Nishida and Drela (1996) - ''' - # eliminate absurd transients - Ct = min(Ct, 0.30) - Ct = max(Ct, 0.0000001) - Hk = (H - 0.29*Me**2)/(1+0.113*Me**2) - if name == 'wake': - Hk = max(Hk, 1.00005) - Hk = min(Hk,10) - else: - Hk = max(Hk, 1.00005) - Hk = min(Hk,10) - Hstar2 = ((0.064/(Hk-0.8))+0.251)*Me**2 - gam = self.gamma - 1 - Fc = np.sqrt(1+0.5*gam*Me**2) - if Ret <= 400: - H0 = 4 - elif Ret > 400: - H0 = 3 + (400/Ret) - if Ret > 200: - Ret = Ret - elif Ret <= 200: - Ret = 200 - if Hk <= H0: - Hstar = ((0.5-4/Ret)*((H0-Hk)/(H0-1))**2)*(1.5/(Hk+0.5))+1.5+4/Ret - elif Hk > H0: - Hstar = (Hk-H0)**2*(0.007*np.log(Ret)/(Hk-H0+4/np.log(Ret))**2 + 0.015/Hk) + 1.5 + 4/Ret - Hstar = (Hstar + 0.028*Me**2)/(1+0.014*Me**2) # Whitfield's minor additional compressibility correction - logRt = np.log(Ret/Fc) - logRt = np.max((logRt,3)) - arg = np.max((-1.33*Hk, -20)) - Us = (Hstar/2)*(1-4*(Hk-1)/(3*H)) # Equivalent normalized wall slip velocity - delta = min((3.15+ H + (1.72/(Hk-1)))*theta, 12*theta) - Ctcon = 0.5/(6.7**2*0.75) - if name == 'wake': - if Us > 0.99995: - Us = 0.99995 - n = 2 # two wake halves - Cf = 0 # no friction inside the wake - Hkc = Hk - 1 - Cdw = 0 # wall contribution - Cdd = (0.995-Us)*Ct**2 # turbulent outer layer contribution - Cdl = 0.15*(0.995-Us)**2/Ret # laminar stress contribution to outer layer - else: - if Us > 0.95: - Us = 0.98 - n = 1 - Cf = (1/Fc)*(0.3*np.exp(arg)*(logRt/2.3026)**(-1.74-0.31*Hk)+0.00011*(np.tanh(4-(Hk/0.875))-1)) - Hkc = max(Hk-1-18/Ret, 0.01) - # dissipation coefficient - Hmin = 1 + 2.1/np.log(Ret) - Fl = (Hk-1)/(Hmin-1) - Dfac = 0.5+0.5*np.tanh(Fl) - Cdw = 0.5*(Cf*Us) * Dfac - Cdd = (0.995-Us)*Ct**2 - Cdl = 0.15*(0.995-Us)**2/Ret - Cteq = np.sqrt(n*Hstar*Ctcon*((Hk-1)*Hkc**2)/((1-Us)*(Hk**2)*H)) #Here it is Cteq^0.5 - Cd = n*(Cdw+ Cdd + Cdl) - Ueq = 1.25/Hk*(Cf/2-((Hk-1)/(6.432*Hk))**2) - return Cd, Cf, Hstar, Hstar2, Hk, Cteq, delta - - - def __boundaryLayer(self, data, group, savef=False): - '''Discretize and solve the boundary layer equations for laminar/turbulent flows - ''' - xx, dv, vtOld, nN, alpha = self.__getBLcoordinates(data) - Me = data[:,5] - rhoe = data[:,6] - deltaStarOld = data[:,7] - if self.it == 0: - xxOld = xx - else: - xxOld = data[:,8] - #Initialize variables - blwVel = np.zeros(nN-1) # Blowing velocity - vt = np.zeros(nN) # Boundary layer velocity - theta = np.zeros(nN) # Momentum thickness - H = np.zeros(nN) # Shape factor - deltaStar = np.zeros(nN) # Displacement thickness - Hstar = np.zeros(nN) # Kinetic energy shape parameter - Hstar2 = np.zeros(nN) # Density shape parameter - Hk = np.zeros(nN) # Kinematic shape factor - Ret = np.zeros(nN) #Re based on momentum thickness - Cd = np.zeros(nN) # Dissipation coefficient - Cf = np.zeros(nN) # Skin friction - n = np.zeros(nN) # Logarithm of the maximum amplification ratio - Ax = np.zeros(nN) # Amplification factor - Ct = np.zeros(nN) # Shear stress coefficient - Cteq = np.zeros(nN) # Equilibrium shear stress coefficient - delta = np.zeros(nN) # BL thickness - # Boundary conditions - if group.name == 'airfoil': - theta[0], H[0], n[0], Ct[0] = group.initialConditions(self.Re, dv[0]) - elif group.name == 'wake': - theta[0] = group.T0 - H[0] = group.H0 - n[0] = group.n0 - Ct[0] = group.Ct0 - vt[0] = vtOld[0] - Ret[0] = vt[0]*theta[0]*self.Re - if Ret[0] < 1: - Ret[0] = 1 - vt[0] = Ret[0]/(theta[0]*self.Re) - deltaStar[0] = theta[0]*H[0] - # Define transition location ( N = 9) and compute stagnation point - ntr = 9 - Cd[0], Cf[0], Hstar[0], Hstar2[0], Hk[0], delta[0] = self.__laminarClosure( theta[0], H[0], Ret[0],Me[0], group.name) - if n[0] < ntr: - turb = 0 # we begin with laminar flow - else : - turb = 1 # typically for the wake - xtr = 0 # if only turbulent flow - itTurb = 0 - # Solve the boundary layer equations - for i in range(1,nN): - # x[0] = theta; x[1] = H; x[2] = n for laminar/Ct for turbulent; x[3] = vt from interaction law - def f_lam(x): - f = np.zeros(len(x)) - Ret[i] = np.maximum(x[3]*x[0]*self.Re, 1) - Cd[i], Cf[i], Hstar[i], Hstar2[i], Hk[i], delta[i] = self.__laminarClosure(x[0], x[1], Ret[i],Me[i], group.name) - Ta = upw*x[0]+(1-upw)*theta[i-1] - Ha = upw*x[1]+(1-upw)*H[i-1] - uea = upw*x[3]+(1-upw)*vt[i-1] - Reta = upw*Ret[i] + (1-upw)*Ret[i-1] - Mea = upw*Me[i]+(1-upw)*Me[i-1] - Cda, Cfa, Hstara, Hstar2a, Hka, deltaa = self.__laminarClosure(Ta , Ha, Reta, Mea, group.name) - dx = xx[i] - xx[i-1] - Axa = self.__amplRoutine(Hka, Reta, Ta) - dTheta = x[0]-theta[i-1] - due = x[3]-vt[i-1] - dH = x[1]-H[i-1] - dn = x[2] - n[i-1] - dHstar = Hstar[i]-Hstar[i-1] - Hstara = upw*Hstar[i]+(1-upw)*Hstar[i-1] - f[0] = dTheta/dx + (2 + Ha - Mea**2)*(Ta/uea)*due/dx - Cfa/2 - f[1] = Ta*(dHstar/dx) + (2*Hstar2a + Hstara*(1-Ha))*Ta/uea * due/dx - 2*Cda + Hstara*Cfa/2 - f[2] = dn - dx*Axa - f[3] = uea - 4/(np.pi*dx)*Ta*Ha - (upw*vtOld[i]+(1-upw)*vtOld[i-1]) + 4/(np.pi*(xxOld[i]-xxOld[i-1]))*(upw*deltaStarOld[i]+(1-upw)*deltaStarOld[i-1]) - return f - def f_turb(x): - f = np.zeros(len(x)) - if group.name == 'wake': - dissipRatio = 0.9 # wall/wake dissipation length ratio - else: - dissipRatio = 1 - Ret[i] = x[3]*x[0]*self.Re - Ta = upw*x[0]+(1-upw)*theta[i-1] - xxa = upw*xx[i]+(1-upw)*xx[i-1] - Ha = upw*x[1]+(1-upw)*H[i-1] - Cta = upw*x[2]+(1-upw)*Ct[i-1] - uea = upw*x[3]+(1-upw)*vt[i-1] - Reta = np.maximum(upw*(x[3]*x[0]*self.Re)+(1-upw)*(vt[i-1]*theta[i-1]*self.Re), 1) - Mea = upw*Me[i]+(1-upw)*Me[i-1] - Cd[i], Cf[i], Hstar[i], Hstar2[i],Hk[i],Cteq[i], delta[i] = self.__turbulentClosure(x[0], x[1],x[2], Ret[i],Me[i], group.name) - Cda, Cfa, Hstara, Hstar2a, Hka,Cteqa, deltaa = self.__turbulentClosure(Ta, Ha,Cta, Reta,Mea, group.name) - dx = xx[i]-xx[i-1] - dTheta = x[0]-theta[i-1] - due = x[3]-vt[i-1] - dH = x[1]-H[i-1] - dHstar = Hstar[i]-Hstar[i-1] - dCt = x[2]-Ct[i-1] # here it is Ct^1/2 which is represented - Ta = upw*x[0]+(1-upw)*theta[i-1] - Cta = upw*x[2]+(1-upw)*Ct[i-1] - f[0] = dTheta/dx + (2 + Ha - Mea**2)*(Ta/uea)*due/dx - Cfa/2 - f[1] = Ta*(dHstar/dx) + (2*Hstar2a + Hstara*(1-Ha))*Ta/uea * due/dx - 2*Cda + Hstara*Cfa/2 - f[2] = (2*deltaa/Cta)*(dCt/dx) - 5.6*(Cteqa-Cta*dissipRatio)-2*deltaa*(4/(3*Ha*Ta)*(Cfa/2-((Hka-1)/(6.7*Hka*dissipRatio))**2)-1/uea * due/dx) - f[3] = uea - 4/(np.pi*dx)*Ta*Ha - (upw*vtOld[i]+(1-upw)*vtOld[i-1]) + 4/(np.pi*(xxOld[i]-xxOld[i-1]))*(upw*deltaStarOld[i]+(1-upw)*deltaStarOld[i-1]) - return f - # Laminar solver - if turb == 0: - if n[i-1] > 8 or i < 5: - upw = 1 # backward Euler - else: - upw = 0.5 # Trapezoidal scheme - x = np.array([theta[i-1],H[i-1], n[i-1], vt[i-1]]) - try: - sol = Newton.newton(f_lam, x, 200) - except RuntimeError as e: - sol = e.args[1] - print(str(e.args[0]) + ccolors.ANSI_YELLOW + 'Laminar solver not converged at position: {:.3f}, error: {:.1e}'.format(xx[i], e.args[2]) + ccolors.ANSI_RESET) - # Determine if the amplification waves start to grow or not - logRet_crit = 2.492*(1/(Hk[i]-1))**0.43 + 0.7*(np.tanh(14*(1/(Hk[i]-1))-9.24)+1.0) - if np.log10(Ret[i]) <= logRet_crit - 0.08 : - n[i] = 0 - else: - n[i] = sol[2] - xtr = 1 - # Turbulent solver - elif turb == 1: - if i <2 and group.name =='wake': - upw = 1 # begin of the wake - elif itTurb <2 and group.name == 'airfoil': - upw = 1 - itTurb += 1 - else: - upw = 0.5 # trapezoidal scheme - x = np.array([theta[i-1], H[i-1], Ct[i-1], vt[i-1]]) - try: - sol = Newton.newton(f_turb, x, 200) - except RuntimeError as e: - sol = e.args[1] - print(str(e.args[0]) + ccolors.ANSI_YELLOW + 'Turbulent solver not converged at position: {:.3f}, error: {:.1e}'.format(xx[i], e.args[2]) + ccolors.ANSI_RESET) - Ct[i] = sol[2] - theta[i] = sol[0] - H[i] = sol[1] - vt[i] = sol[3] - # Transition solver - if n[i] >= ntr and turb ==0: - turb = 1 - upw = 1 - xtr = (ntr-n[i-1])*((data[i,0]-data[i-1,0])/(n[i]-n[i-1]))+data[i-1,0] - avTurb = (data[i,0]-xtr)/(data[i,0]-data[i-1,0]) # percentage of the subsection corresponding to a turbulent flow - avLam = 1- avTurb # percentage of the subsection corresponding to a laminar flow - # Averaging both solutions - Cteq[i-1]= self.__turbulentClosure(theta[i-1], H[i-1], 0.03, Ret[i-1], Me[i-1], group.name)[5] - Ct[i-1] = avLam*Cteq[i-1] * 0.7 - x_turb = np.array([theta[i-1], 1.515, Ct[i-1] , vt[i-1]]) - try: - sol_turb = Newton.newton(f_turb, x_turb, 200) - except RuntimeError as e: - sol = e.args[1] - print(str(e.args[0]) + ccolors.ANSI_YELLOW + 'Transition solver not converged at position: {:.3f}, error: {:.1e}'.format(xx[i], e.args[2]) + ccolors.ANSI_RESET) - theta[i] = avLam*sol[0]+avTurb*sol_turb[0] - H[i] = avLam*sol[1]+avTurb*sol_turb[1] - if group.name == 'airfoil': - Ct[i] = max(avTurb*sol_turb[2],0.03) - else: - Ct[i] = max(avTurb*sol_turb[2],0.05) - vt[i] = avLam*sol[3]+avTurb*sol_turb[3] - Cd[i-1], Cf[i-1], Hstar[i-1], Hstar2[i-1], Hk[i-1], delta[i-1] = self.__laminarClosure(theta[i-1], H[i-1], Ret[i-1],Me[i-1], group.name) - Cd[i], Cf[i], Hstar[i], Hstar2[i],Hk[i],Cteq[i], delta[i] = self.__turbulentClosure(theta[i], H[i],Ct[i], Ret[i],Me[i], group.name) - deltaStar[i] = H[i]*theta[i] - blwVel[i-1] = (rhoe[i]*vt[i]*deltaStar[i]-rhoe[i-1]*vt[i-1]*deltaStar[i-1])/(rhoe[i]*(xx[i]-xx[i-1])) - # Normalize the friction and dissipation coefficients by the freestream velocity - Cf = vt**2*Cf - Cd = vt**2*Cd - # Compute the various drag coefficients (total, friction, profile) - Cdtot = 2*theta[-1]*(vt[-1]**((H[-1]+5)/2)) - Cdf = np.trapz(Cf, data[:,0]) - Cdp = Cdtot-Cdf - # Outputs - blScalars = [Cdtot, Cdf, Cdp] - blVectors = [deltaStar, theta, H, Hk, Hstar, Hstar2, Cf, Cd, Ct, delta] - return blwVel, xtr, xx, blScalars, blVectors - - - def run(self, group): - ''' Run the viscous solver to solve the BL equations and give the outputs to the coupler - ''' - group.connectListNodes, group.connectListElems, data = group.connectList() - # Compute BLE for the airfoil (upper section(data[0]) and lower section (data[1])) - if len(data) == 2: - ublwVel, xtrTop, uxx, ublScalars, ublVectors = self.__boundaryLayer(data[0], group, True) - lblwVel, xtrBot, lxx, lblScalars, lblVectors = self.__boundaryLayer(data[1], group) - # Put the upper and lower values together - self.data = np.concatenate((data[0], data[1])) - self.blScalars = np.add(ublScalars, lblScalars) - self.blVectors = np.hstack((ublVectors, lblVectors)) - blwVel = np.concatenate((ublwVel, lblwVel)) - self.xtr = [xtrTop, xtrBot] - # Boundary conditions for the wake - group.TEnd = [ublVectors[1][-1], lblVectors[1][-1]] - group.HEnd = [ublVectors[2][-1], lblVectors[2][-1]] - group.CtEnd = [ublVectors[8][-1], lblVectors[8][-1]] - # Delete the stagnation point doublon for variables in the VII loop - lblVectors[0] = np.delete(lblVectors[0],0,0) #deltastar - lxx = np.delete(lxx,0,0) # airfoil coordinates - group.deltaStar = np.concatenate((ublVectors[0], lblVectors[0])) - group.xx = np.concatenate((uxx, lxx)) - # Compute BLE for the wake - else: - blwVel, _, group.xx, blScalars, blVectors = self.__boundaryLayer(data, group) - group.deltaStar = blVectors[0] - # The drag is measured at the end of the wake - self.Cd = blScalars[0] - self.Cdp = self.Cd-self.blScalars[1] # Cdf comes from the airfoil as there is no friction in the wake - self.blScalars[0] = self.Cd - self.blScalars[2] = self.Cdp - self.Cdf = self.blScalars[1] - # Sort the following results in reference frame - group.deltaStar = group.deltaStar[group.connectListNodes.argsort()] - group.xx = group.xx[group.connectListNodes.argsort()] - group.u = blwVel[group.connectListElems.argsort()] diff --git a/flow/viscous/wake.py b/flow/viscous/wake.py deleted file mode 100644 index 7bef95f1..00000000 --- a/flow/viscous/wake.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## Wake behind airfoil (around which the boundary layer is computed) -# Amaury Bilocq - -from flow.viscous.boundary import Boundary -from flow.viscous.airfoil import Airfoil -import numpy as np - -class Wake(Boundary): - def __init__(self, _boundary): - Boundary.__init__(self, _boundary) - self.name = 'wake' # type of boundary - self.T0 = 0 # initial condition for the momentum thickness - self.H0 = 0 - self.n0 = 9 # wake is always turbulent - self.Ct0 = 0 - - - def connectList(self): - ''' Sort the value read by the viscous solver/ Create list of connectivity - ''' - N1 = np.zeros(self.nN, dtype=int) # Node number - connectListNodes = np.zeros(self.nN, dtype=int) # Index in boundary.nodes - connectListElems = np.zeros(self.nE, dtype=int) # Index in boundary.elems - data = np.zeros((self.boundary.nodes.size(), 10)) - i = 0 - for n in self.boundary.nodes: - data[i,0] = n.no - data[i,1] = n.pos[0] - data[i,2] = n.pos[1] - data[i,3] = n.pos[2] - data[i,4] = self.v[i,0] - data[i,5] = self.v[i,1] - data[i,6] = self.Me[i] - data[i,7] = self.rhoe[i] - data[i,8] = self.deltaStar[i] - data[i,9] = self.xx[i] - i += 1 - # Table containing the element and its nodes - eData = np.zeros((self.nE,3), dtype=int) - for i in range(0, self.nE): - eData[i,0] = self.boundary.tag.elems[i].no - eData[i,1] = self.boundary.tag.elems[i].nodes[0].no - eData[i,2] = self.boundary.tag.elems[i].nodes[1].no - connectListNodes = data[:,1].argsort() - connectListElems[0] = np.where(eData[:,1] == min(data[:,1]))[0] - for i in range(1, len(eData[:,0])): - connectListElems[i] = np.where(eData[:,1] == eData[connectListElems[i-1],2])[0] - data[:,0] = data[connectListNodes,0] - data[:,1] = data[connectListNodes,1] - data[:,2] = data[connectListNodes,2] - data[:,3] = data[connectListNodes,3] - data[:,4] = data[connectListNodes,4] - data[:,5] = data[connectListNodes,5] - data[:,6] = data[connectListNodes,6] - data[:,7] = data[connectListNodes,7] - data[:,8] = data[connectListNodes,8] - data[:,9] = data[connectListNodes,9] - # Separated upper and lower part - data = np.delete(data,0,1) - return connectListNodes, connectListElems, data diff --git a/heat/src/wSolver.cpp b/heat/src/wSolver.cpp index 4c201877..0148904f 100644 --- a/heat/src/wSolver.cpp +++ b/heat/src/wSolver.cpp @@ -257,7 +257,7 @@ void Solver::start(MshExport *mshWriter) for (auto mat : pbl->media) { tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; //std::cout << "processing element #" << e->no << "\n"; @@ -372,7 +372,7 @@ void Solver::buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map if (verbose > 1) std::cout << "\tprocessing " << *mat << '\n'; tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; //std::cout << "processing element #" << e->no << "\n"; @@ -407,7 +407,7 @@ void Solver::buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map std::cout << "\tprocessing " << *mat << '\n'; std::for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; Eigen::MatrixXd Ke = HeatTerm::build(*e, T1, *mat->k, true); // bidon }); @@ -431,7 +431,7 @@ void Solver::buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map std::cout << "\tprocessing " << *mat << '\n'; std::for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { // devrait pouvoir etre fait en TBB... - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; Eigen::MatrixXd Ke = HeatTerm::build(*e, T1, *mat->k, false); @@ -522,7 +522,7 @@ void Solver::buildK(Eigen::SparseMatrix<double, Eigen::RowMajor> &K2, Eigen::Map { //std::cout << "\tprocessing " << *mat << '\n'; tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; //std::cout << "processing element #" << e->no << "\n"; @@ -593,7 +593,7 @@ void Solver::buildqint(Eigen::VectorXd &qint) if (verbose > 1) std::cout << "\tprocessing " << *mat << '\n'; tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3) + if (e->type() != ElType::TRI3) return; //std::cout << "processing element #" << e->no << "\n"; @@ -642,7 +642,7 @@ void Solver::builds(Eigen::Map<Eigen::VectorXd> &s) { //std::cout << "\tprocessing " << *src << '\n'; tbb::parallel_for_each(src->tag->elems.begin(), src->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::TRI3 && e->type() != ELTYPE::LINE2) + if (e->type() != ElType::TRI3 && e->type() != ElType::LINE2) return; //std::cout << "processing element #" << e->no << "\n"; @@ -681,7 +681,7 @@ void Solver::buildq(Eigen::Map<Eigen::VectorXd> &q) { //std::cout << "\tprocessing " << *src << '\n'; tbb::parallel_for_each(bnd->tag->elems.begin(), bnd->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::LINE2) + if (e->type() != ElType::LINE2) return; //std::cout << "processing element #" << e->no << "\n"; diff --git a/katoptron/src/ContactsList.cpp b/katoptron/src/ContactsList.cpp index 01f0b212..ed239f19 100644 --- a/katoptron/src/ContactsList.cpp +++ b/katoptron/src/ContactsList.cpp @@ -57,9 +57,9 @@ ContactsList::ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Ele for (auto j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j) { local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->slave_elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::QUAD4)) + if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::TRI3)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3)) ; else continue; @@ -83,11 +83,11 @@ ContactsList::ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Ele for (auto j = 0; j < pbl.Contacts[i]->master_elems.size(); ++j) { local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->master_elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::QUAD4)) + if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::TRI3)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::LINE2)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::LINE2)) ; else continue; @@ -174,9 +174,9 @@ ContactsList::ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Ele for (auto j = 0; j < pbl.Contacts[i]->slave_elems.size(); ++j) { local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->slave_elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::QUAD4)) + if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::TRI3)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3)) ; else continue; @@ -206,11 +206,11 @@ ContactsList::ContactsList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::RCP<Ele for (auto j = 0; j < pbl.Contacts[i]->master_elems.size(); ++j) { local_ordinal_type e = map->mapElems->getLocalElement(pbl.Contacts[i]->master_elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::QUAD4)) + if (elementsList->getElementType(e) == static_cast<int>(ElType::QUAD4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::TRI3)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::TRI3)) ; - else if (elementsList->getElementType(e) == static_cast<int>(ELTYPE::LINE2)) + else if (elementsList->getElementType(e) == static_cast<int>(ElType::LINE2)) ; else continue; diff --git a/katoptron/src/DiscreteProblem.hpp b/katoptron/src/DiscreteProblem.hpp index 431a33ba..3a0332c0 100644 --- a/katoptron/src/DiscreteProblem.hpp +++ b/katoptron/src/DiscreteProblem.hpp @@ -874,12 +874,12 @@ void DiscreteProblem<scalar>::computeMatrices(void) for (int i_elem = 0; i_elem < numMyElems; ++i_elem) { - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::HEX8)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8)) { max_element_size = 8; break; } - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::TETRA4)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4)) { max_element_size = 4; break; @@ -899,10 +899,10 @@ void DiscreteProblem<scalar>::computeMatrices(void) 3 * max_element_size, max_element_size); - ElementMatrices<scalar, static_cast<int>(tbox::ELTYPE::HEX8), 8> *elementMatrices_HEX8 = - new ElementMatrices<scalar, static_cast<int>(tbox::ELTYPE::HEX8), 8>(domain, numPrimalDPN, pool_size); - ElementMatrices<scalar, static_cast<int>(tbox::ELTYPE::TETRA4), 4> *elementMatrices_TETRA4 = - new ElementMatrices<scalar, static_cast<int>(tbox::ELTYPE::TETRA4), 4>(domain, numPrimalDPN, pool_size); + ElementMatrices<scalar, static_cast<int>(tbox::ElType::HEX8), 8> *elementMatrices_HEX8 = + new ElementMatrices<scalar, static_cast<int>(tbox::ElType::HEX8), 8>(domain, numPrimalDPN, pool_size); + ElementMatrices<scalar, static_cast<int>(tbox::ElType::TETRA4), 4> *elementMatrices_TETRA4 = + new ElementMatrices<scalar, static_cast<int>(tbox::ElType::TETRA4), 4>(domain, numPrimalDPN, pool_size); Kokkos::parallel_for( numMyElems, KOKKOS_LAMBDA(const int i_elem) { @@ -919,7 +919,7 @@ void DiscreteProblem<scalar>::computeMatrices(void) auto L_e = subview(L, i_thread, make_pair(0, e_size), make_pair(0, e_size)); auto S_e = subview(S, i_thread, make_pair(0, 3 * e_size), make_pair(0, e_size)); - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::HEX8)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8)) { elementMatrices_HEX8->compute(i_elem, i_thread); Kokkos::deep_copy(K_e, elementMatrices_HEX8->getK(i_thread)); @@ -927,7 +927,7 @@ void DiscreteProblem<scalar>::computeMatrices(void) Kokkos::deep_copy(S_e, elementMatrices_HEX8->getS(i_thread)); } - else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4)) { elementMatrices_TETRA4->compute(i_elem, i_thread); Kokkos::deep_copy(K_e, elementMatrices_TETRA4->getK(i_thread)); @@ -1061,13 +1061,13 @@ void DiscreteProblem<scalar>::computeLoads(bool scaled) for (int i_elem = 0; i_elem < numMyElems; ++i_elem) { - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::HEX8)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8)) { max_element_size = 8; max_element_size_S = 4; break; } - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::TETRA4)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4)) { max_element_size = 4; max_element_size_S = 3; @@ -1077,14 +1077,14 @@ void DiscreteProblem<scalar>::computeLoads(bool scaled) N = elem_matrix_view_type("A", pool_size, max_element_size, max_element_size); N_S = elem_matrix_view_type("A", pool_size, max_element_size_S, max_element_size_S); - ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::TRI3), 3> *elementVectors_TRI3 = - new ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::TRI3), 3>(domain, numPrimalDPN, pool_size); - ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::QUAD4), 4> *elementVectors_QUAD4 = - new ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::QUAD4), 4>(domain, numPrimalDPN, pool_size); - ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::TETRA4), 4> *elementVectors_TETRA4 = - new ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::TETRA4), 4>(domain, numPrimalDPN, pool_size); - ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::HEX8), 8> *elementVectors_HEX8 = - new ElementVectors<scalar, static_cast<int>(tbox::ELTYPE::HEX8), 8>(domain, numPrimalDPN, pool_size); + ElementVectors<scalar, static_cast<int>(tbox::ElType::TRI3), 3> *elementVectors_TRI3 = + new ElementVectors<scalar, static_cast<int>(tbox::ElType::TRI3), 3>(domain, numPrimalDPN, pool_size); + ElementVectors<scalar, static_cast<int>(tbox::ElType::QUAD4), 4> *elementVectors_QUAD4 = + new ElementVectors<scalar, static_cast<int>(tbox::ElType::QUAD4), 4>(domain, numPrimalDPN, pool_size); + ElementVectors<scalar, static_cast<int>(tbox::ElType::TETRA4), 4> *elementVectors_TETRA4 = + new ElementVectors<scalar, static_cast<int>(tbox::ElType::TETRA4), 4>(domain, numPrimalDPN, pool_size); + ElementVectors<scalar, static_cast<int>(tbox::ElType::HEX8), 8> *elementVectors_HEX8 = + new ElementVectors<scalar, static_cast<int>(tbox::ElType::HEX8), 8>(domain, numPrimalDPN, pool_size); RCP<tpetra_vector_type> bWO = rcp(new tpetra_vector_type(algebraic->map->mapDofsWO, true)); @@ -1115,12 +1115,12 @@ void DiscreteProblem<scalar>::computeLoads(bool scaled) bool bContinue = true; - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::HEX8)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::HEX8)) { elementVectors_HEX8->compute(i_elem, i_thread); Kokkos::deep_copy(N_e, elementVectors_HEX8->getN(i_thread)); } - else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TETRA4)) { elementVectors_TETRA4->compute(i_elem, i_thread); Kokkos::deep_copy(N_e, elementVectors_TETRA4->getN(i_thread)); @@ -1182,12 +1182,12 @@ void DiscreteProblem<scalar>::computeLoads(bool scaled) bool bContinue = true; - if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::TRI3)) + if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::TRI3)) { elementVectors_TRI3->compute(i_elem, i_thread); Kokkos::deep_copy(N_e, elementVectors_TRI3->getN(i_thread)); } - else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ELTYPE::QUAD4)) + else if (domain->elementsList->getElementType(i_elem) == static_cast<int>(tbox::ElType::QUAD4)) { elementVectors_QUAD4->compute(i_elem, i_thread); Kokkos::deep_copy(N_e, elementVectors_QUAD4->getN(i_thread)); diff --git a/katoptron/src/ElementComputation.hpp b/katoptron/src/ElementComputation.hpp index 1982b94b..e1062eb1 100644 --- a/katoptron/src/ElementComputation.hpp +++ b/katoptron/src/ElementComputation.hpp @@ -11,19 +11,19 @@ double ElementComputation<scalar, element_type>::buildJ(int k, tbox::Cache *cache; size_t element_size; - if (element_type == static_cast<int>(tbox::ELTYPE::HEX8)) + if (element_type == static_cast<int>(tbox::ElType::HEX8)) { tbox::CacheHex8 &cachehex8 = trilinosHex8GetCache(); cache = &cachehex8; element_size = 8; } - else if (element_type == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (element_type == static_cast<int>(tbox::ElType::TETRA4)) { tbox::CacheTetra4 &cachetetra4 = trilinosTetra4GetCache(); cache = &cachetetra4; element_size = 4; } - else if (element_type == static_cast<int>(tbox::ELTYPE::TRI3)) + else if (element_type == static_cast<int>(tbox::ElType::TRI3)) { tbox::CacheTri3 &cachetri3 = trilinosTri3GetCache(); cache = &cachetri3; @@ -49,7 +49,7 @@ double ElementComputation<scalar, element_type>::buildJ(int k, double detJ = sqrt(pow(n(0), 2) + pow(n(1), 2) + pow(n(2), 2)); return detJ; } - else if (element_type == static_cast<int>(tbox::ELTYPE::QUAD4)) + else if (element_type == static_cast<int>(tbox::ElType::QUAD4)) { tbox::CacheQuad4 &cachequad4 = trilinosQuad4GetCache(); cache = &cachequad4; @@ -87,9 +87,9 @@ double ElementComputation<scalar, element_type>::buildJ(int k, for (auto j = 0; j < 3; ++j) { tmp(j) = nodesList.nodes(elementsList.getElementNode(e, n1), j); - if (element_type == static_cast<int>(tbox::ELTYPE::HEX8)) + if (element_type == static_cast<int>(tbox::ElType::HEX8)) tmp2(j) = (static_cast<tbox::CacheHex8 *>(cache)->getDsf(k))(j, i); - else if (element_type == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (element_type == static_cast<int>(tbox::ElType::TETRA4)) tmp2(j) = (static_cast<tbox::CacheTetra4 *>(cache)->getDsf(k))(j, i); } diff --git a/katoptron/src/ElementMatrices.hpp b/katoptron/src/ElementMatrices.hpp index b8241a81..208932cc 100644 --- a/katoptron/src/ElementMatrices.hpp +++ b/katoptron/src/ElementMatrices.hpp @@ -46,12 +46,12 @@ void ElementMatrices<scalar, element_type, element_size>::compute(int e, int i_t tbox::Cache *cache; /* @todo could probably be refactored into cache = element->getVCache(); */ - if (element_type == static_cast<int>(tbox::ELTYPE::HEX8)) + if (element_type == static_cast<int>(tbox::ElType::HEX8)) { tbox::CacheHex8 &cachehex8 = this->trilinosHex8GetCache(); cache = &cachehex8; } - else if (element_type == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (element_type == static_cast<int>(tbox::ElType::TETRA4)) { tbox::CacheTetra4 &cachetetra4 = this->trilinosTetra4GetCache(); cache = &cachetetra4; diff --git a/katoptron/src/ElementVectors.hpp b/katoptron/src/ElementVectors.hpp index fcd087fa..f89101de 100644 --- a/katoptron/src/ElementVectors.hpp +++ b/katoptron/src/ElementVectors.hpp @@ -36,22 +36,22 @@ void ElementVectors<scalar, element_type, element_size>::compute(int e, int i_th std::vector<double> gauss_w; /* @todo could probably be refactored into cache = element->getVCache(); */ - if (element_type == static_cast<int>(tbox::ELTYPE::HEX8)) + if (element_type == static_cast<int>(tbox::ElType::HEX8)) { tbox::CacheHex8 &cachehex8 = this->trilinosHex8GetCache(); cache = &cachehex8; } - else if (element_type == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (element_type == static_cast<int>(tbox::ElType::TETRA4)) { tbox::CacheTetra4 &cachetetra4 = this->trilinosTetra4GetCache(); cache = &cachetetra4; } - else if (element_type == static_cast<int>(tbox::ELTYPE::TRI3)) + else if (element_type == static_cast<int>(tbox::ElType::TRI3)) { tbox::CacheTri3 &cachetri3 = this->trilinosTri3GetCache(); cache = &cachetri3; } - else if (element_type == static_cast<int>(tbox::ELTYPE::QUAD4)) + else if (element_type == static_cast<int>(tbox::ElType::QUAD4)) { tbox::CacheQuad4 &cachequad4 = this->trilinosQuad4GetCache(); cache = &cachequad4; @@ -74,13 +74,13 @@ void ElementVectors<scalar, element_type, element_size>::compute(int e, int i_th for (auto a = 0; a < gauss_p.size(); ++a) { for (auto j = 0; j < element_size; ++j) - if (element_type == static_cast<int>(tbox::ELTYPE::HEX8)) + if (element_type == static_cast<int>(tbox::ElType::HEX8)) ff(j) = (static_cast<tbox::CacheHex8 *>(cache)->getSf(a))(j); - else if (element_type == static_cast<int>(tbox::ELTYPE::TETRA4)) + else if (element_type == static_cast<int>(tbox::ElType::TETRA4)) ff(j) = (static_cast<tbox::CacheTetra4 *>(cache)->getSf(a))(j); - else if (element_type == static_cast<int>(tbox::ELTYPE::TRI3)) + else if (element_type == static_cast<int>(tbox::ElType::TRI3)) ff(j) = (static_cast<tbox::CacheTri3 *>(cache)->getSf(a))(j); - else if (element_type == static_cast<int>(tbox::ELTYPE::QUAD4)) + else if (element_type == static_cast<int>(tbox::ElType::QUAD4)) ff(j) = (static_cast<tbox::CacheQuad4 *>(cache)->getSf(a))(j); double detJ = this->buildJ(a, J, e, *(domain->elementsList), *(domain->nodesList)); diff --git a/katoptron/src/ElementVectorsETI.cpp b/katoptron/src/ElementVectorsETI.cpp index b7161bfb..445a934b 100644 --- a/katoptron/src/ElementVectorsETI.cpp +++ b/katoptron/src/ElementVectorsETI.cpp @@ -2,42 +2,42 @@ #include "ElementVectors.hpp" using namespace tbox; -template class ElementVectors<double, static_cast<int>(ELTYPE::TRI3), 3>; +template class ElementVectors<double, static_cast<int>(ElType::TRI3), 3>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TRI3), 3>; + static_cast<int>(ElType::TRI3), 3>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TRI3), 3>; + static_cast<int>(ElType::TRI3), 3>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TRI3), 3>; + static_cast<int>(ElType::TRI3), 3>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TRI3), 3>; + static_cast<int>(ElType::TRI3), 3>; -template class ElementVectors<double, static_cast<int>(ELTYPE::QUAD4), 4>; +template class ElementVectors<double, static_cast<int>(ElType::QUAD4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::QUAD4), 4>; + static_cast<int>(ElType::QUAD4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::QUAD4), 4>; + static_cast<int>(ElType::QUAD4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::QUAD4), 4>; + static_cast<int>(ElType::QUAD4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::QUAD4), 4>; + static_cast<int>(ElType::QUAD4), 4>; -template class ElementVectors<double, static_cast<int>(ELTYPE::TETRA4), 4>; +template class ElementVectors<double, static_cast<int>(ElType::TETRA4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TETRA4), 4>; + static_cast<int>(ElType::TETRA4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TETRA4), 4>; + static_cast<int>(ElType::TETRA4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TETRA4), 4>; + static_cast<int>(ElType::TETRA4), 4>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::TETRA4), 4>; + static_cast<int>(ElType::TETRA4), 4>; -template class ElementVectors<double, static_cast<int>(ELTYPE::HEX8), 8>; +template class ElementVectors<double, static_cast<int>(ElType::HEX8), 8>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 8, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::HEX8), 8>; + static_cast<int>(ElType::HEX8), 8>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 16, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::HEX8), 8>; + static_cast<int>(ElType::HEX8), 8>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 24, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::HEX8), 8>; + static_cast<int>(ElType::HEX8), 8>; template class ElementVectors<Sacado::MP::Vector<Stokhos::StaticFixedStorage<int, double, 32, Kokkos::OpenMP>>, - static_cast<int>(ELTYPE::HEX8), 8>; + static_cast<int>(ElType::HEX8), 8>; diff --git a/katoptron/src/Map.cpp b/katoptron/src/Map.cpp index f4fba57d..50321d34 100644 --- a/katoptron/src/Map.cpp +++ b/katoptron/src/Map.cpp @@ -77,7 +77,7 @@ Map::Map(Problem &pbl, size_t _numPrimalDPN) if (numtasks == 1) { for (auto e : msh->elems) - if (e->type() != ELTYPE::POINT1) + if (e->type() != ElType::POINT1) myElems.push_back(e->no - 1); for (auto n : msh->nodes) @@ -94,13 +94,13 @@ Map::Map(Problem &pbl, size_t _numPrimalDPN) { for (auto e : p.second->elems) { - if (e->type() == ELTYPE::HEX8 || e->type() == ELTYPE::TETRA4) + if (e->type() == ElType::HEX8 || e->type() == ElType::TETRA4) for (auto n1 : e->nodes) { tmpMyNodesWO1.push_back(n1->row); tmpMyNodesWO2.push_back(n1->row); } - if (e->type() != ELTYPE::POINT1) + if (e->type() != ElType::POINT1) myElems.push_back(e->no - 1); } } @@ -108,11 +108,11 @@ Map::Map(Problem &pbl, size_t _numPrimalDPN) { for (auto e : p.second->elems) { - if (e->type() == ELTYPE::HEX8 || e->type() == ELTYPE::TETRA4) + if (e->type() == ElType::HEX8 || e->type() == ElType::TETRA4) for (auto n1 : e->nodes) tmpMyNodesWO1.push_back(n1->row); - if (e->type() != ELTYPE::POINT1) + if (e->type() != ElType::POINT1) myElems.push_back(e->no - 1); } } diff --git a/katoptron/src/NeumannList.h b/katoptron/src/NeumannList.h index 6d1bc71f..08aaf001 100644 --- a/katoptron/src/NeumannList.h +++ b/katoptron/src/NeumannList.h @@ -145,9 +145,9 @@ NeumannList<scalar>::NeumannList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::R { local_ordinal_type e = map->mapElems->getLocalElement(pbl.nBCs[i]->tag->elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(tbox::ELTYPE::QUAD4)) + if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::QUAD4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(tbox::ELTYPE::TRI3)) + else if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::TRI3)) ; else continue; diff --git a/katoptron/src/ResultsDef.hpp b/katoptron/src/ResultsDef.hpp index 985cfa13..28b6389b 100644 --- a/katoptron/src/ResultsDef.hpp +++ b/katoptron/src/ResultsDef.hpp @@ -24,7 +24,7 @@ void writeResultsVTK( /* @todo [AC] temporary fix for initializing Mem in katoptron */ for (auto e : pbl.msh->elems) { - if (e->type() == tbox::ELTYPE::HEX8 || e->type() == tbox::ELTYPE::TETRA4) // 3D + if (e->type() == tbox::ElType::HEX8 || e->type() == tbox::ElType::TETRA4) // 3D e->initValues(true); //else // 2D // e->initValues(false); @@ -59,7 +59,7 @@ void writeResultsVTK( for (LocalOrdinal i = 0; i < map->mapElems->getNodeNumElements(); ++i) { - if (pbl.msh->elems[i]->type() == tbox::ELTYPE::HEX8 || pbl.msh->elems[i]->type() == tbox::ELTYPE::TETRA4) + if (pbl.msh->elems[i]->type() == tbox::ElType::HEX8 || pbl.msh->elems[i]->type() == tbox::ElType::TETRA4) { GlobalOrdinal global_i = map->mapElems->getGlobalElement(i); elements_GO_to_LO[global_i] = index; @@ -83,7 +83,7 @@ void writeResultsVTK( for (GlobalOrdinal i = 0; i < pbl.msh->elems.size(); ++i) { - if (pbl.msh->elems[i]->type() == tbox::ELTYPE::HEX8 || pbl.msh->elems[i]->type() == tbox::ELTYPE::TETRA4) + if (pbl.msh->elems[i]->type() == tbox::ElType::HEX8 || pbl.msh->elems[i]->type() == tbox::ElType::TETRA4) { LocalOrdinal local_i = pbl.msh->elems[i]->no - 1; elems_LO_to_GO[local_i] = i; @@ -302,7 +302,7 @@ void writeResultsVTK( for (auto &k : Sigma_at_node) k = Eigen::MatrixXd::Zero(3, 3); - if (e->type() == tbox::ELTYPE::HEX8 || e->type() == tbox::ELTYPE::TETRA4) + if (e->type() == tbox::ElType::HEX8 || e->type() == tbox::ElType::TETRA4) { for (size_t i = 0; i < e->nodes.size(); ++i) { diff --git a/katoptron/src/SourcesList.h b/katoptron/src/SourcesList.h index 29e503d0..2c262ff6 100644 --- a/katoptron/src/SourcesList.h +++ b/katoptron/src/SourcesList.h @@ -122,9 +122,9 @@ SourcesList<scalar>::SourcesList(Problem &pbl, Teuchos::RCP<Map> map, Teuchos::R { local_ordinal_type e = map->mapElems->getLocalElement(pbl.Sources[i]->tag->elems[j]->no - 1); - if (elementsList->getElementType(e) == static_cast<int>(tbox::ELTYPE::TETRA4)) + if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::TETRA4)) ; - else if (elementsList->getElementType(e) == static_cast<int>(tbox::ELTYPE::HEX8)) + else if (elementsList->getElementType(e) == static_cast<int>(tbox::ElType::HEX8)) ; else continue; diff --git a/katoptron/src/wContact.cpp b/katoptron/src/wContact.cpp index c189f70c..b6b78817 100644 --- a/katoptron/src/wContact.cpp +++ b/katoptron/src/wContact.cpp @@ -85,17 +85,17 @@ void readGMSH(std::string const &file_name, std::string const &name, std::vector int n = 0; // read nodes - if (type == static_cast<int>(ELTYPE::HEX8)) // 8-node hexa + if (type == static_cast<int>(ElType::HEX8)) // 8-node hexa n = 8; - else if (type == static_cast<int>(ELTYPE::QUAD4)) // 4-node quad + else if (type == static_cast<int>(ElType::QUAD4)) // 4-node quad n = 4; - else if (type == static_cast<int>(ELTYPE::TETRA4)) // 4-node tetra + else if (type == static_cast<int>(ElType::TETRA4)) // 4-node tetra n = 4; - else if (type == static_cast<int>(ELTYPE::LINE2)) // 2-node line + else if (type == static_cast<int>(ElType::LINE2)) // 2-node line n = 2; - else if (type == static_cast<int>(ELTYPE::POINT1)) // 1-node point + else if (type == static_cast<int>(ElType::POINT1)) // 1-node point n = 1; - else if (type == static_cast<int>(ELTYPE::TRI3)) // 3-node triangle + else if (type == static_cast<int>(ElType::TRI3)) // 3-node triangle n = 3; else { diff --git a/katoptron/src/wVtkExport_KIM2CLEAN.cpp b/katoptron/src/wVtkExport_KIM2CLEAN.cpp index 24382bd7..dcba910b 100644 --- a/katoptron/src/wVtkExport_KIM2CLEAN.cpp +++ b/katoptron/src/wVtkExport_KIM2CLEAN.cpp @@ -72,12 +72,12 @@ void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, s for (int ii = 0; ii < numberOfElems; ++ii) { int elemID = contactElementID[ii]; - if (msh->elems[elemID]->type() == ELTYPE::QUAD4) + if (msh->elems[elemID]->type() == ElType::QUAD4) { CellArraySize += ((msh->elems[elemID]->nodes.size()) + 1); ++numberOfCells; } - else if (msh->elems[elemID]->type() == ELTYPE::TRI3) + else if (msh->elems[elemID]->type() == ElType::TRI3) { CellArraySize += ((msh->elems[elemID]->nodes.size()) + 1); ++numberOfCells; @@ -92,13 +92,13 @@ void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, s for (int ii = 0; ii < numberOfElems; ++ii) { int elemID = contactElementID[ii]; - if (msh->elems[elemID]->type() == ELTYPE::QUAD4) + if (msh->elems[elemID]->type() == ElType::QUAD4) { vtkCells[CellOffset++] = msh->elems[elemID]->nodes.size(); for (int jj = 0; jj < msh->elems[elemID]->nodes.size(); ++jj) vtkCells[CellOffset++] = nodes_GO_to_lagrange_LO[msh->elems[elemID]->nodes[jj]->row]; } - else if (msh->elems[elemID]->type() == ELTYPE::TRI3) + else if (msh->elems[elemID]->type() == ElType::TRI3) { vtkCells[CellOffset++] = msh->elems[elemID]->nodes.size(); for (int jj = 0; jj < msh->elems[elemID]->nodes.size(); ++jj) @@ -197,7 +197,7 @@ void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, s for (int ii = 0; ii < numberOfElems; ++ii) { - if (msh->elems[ii]->type() == ELTYPE::HEX8) + if (msh->elems[ii]->type() == ElType::HEX8) { CellArraySize += ((msh->elems[ii]->nodes.size()) + 1); @@ -206,7 +206,7 @@ void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, s ++numberOfCells; } - else if (msh->elems[ii]->type() == ELTYPE::TETRA4) + else if (msh->elems[ii]->type() == ElType::TETRA4) { CellArraySize += ((msh->elems[ii]->nodes.size()) + 1); @@ -225,13 +225,13 @@ void VtkExport_KIM2CLEAN::save_MPI(std::string const &fname, Results const &r, s int CellOffset = 0; for (int ii = 0; ii < numberOfElems; ++ii) { - if (msh->elems[ii]->type() == ELTYPE::HEX8) + if (msh->elems[ii]->type() == ElType::HEX8) { vtkCells[CellOffset++] = msh->elems[ii]->nodes.size(); for (int jj = 0; jj < msh->elems[ii]->nodes.size(); ++jj) vtkCells[CellOffset++] = nodesWO_GO_to_LO[msh->elems[ii]->nodes[jj]->row]; } - else if (msh->elems[ii]->type() == ELTYPE::TETRA4) + else if (msh->elems[ii]->type() == ElType::TETRA4) { vtkCells[CellOffset++] = msh->elems[ii]->nodes.size(); for (int jj = 0; jj < msh->elems[ii]->nodes.size(); ++jj) diff --git a/mirrors/ANSYS/meshes/M1_S1_lfs.apdl b/mirrors/ANSYS/meshes/M1_S1_lfs.apdl deleted file mode 100644 index baac02e8..00000000 --- a/mirrors/ANSYS/meshes/M1_S1_lfs.apdl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:055aab70951dab277de5c585697324f0c8800524ab044e74de682086813ee61f -size 5179878 diff --git a/mirrors/ANSYS/meshes/M1_all_lfs.apdl b/mirrors/ANSYS/meshes/M1_all_lfs.apdl deleted file mode 100644 index 832766b3..00000000 --- a/mirrors/ANSYS/meshes/M1_all_lfs.apdl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f8649784c955bf4367f7cd33a9e21b794cc47d86b1f2dcf6db3529f6035d5b5 -size 11174216 diff --git a/mirrors/ANSYS/meshes/ansys_mesh.py b/mirrors/ANSYS/meshes/ansys_mesh.py deleted file mode 100755 index ceff345d..00000000 --- a/mirrors/ANSYS/meshes/ansys_mesh.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import tbox.gmsh as gmsh -import fwk.wutils as wu - -def main(): - loader = gmsh.MeshLoader("M1_all.msh",__file__) - loader.convert_from_APDL(wu.pth("M1_all.apdl",__file__)) - -if __name__ == "__main__": - main() diff --git a/mirrors/ANSYS/meshes/mirrors01_ansys_lfs.apdl b/mirrors/ANSYS/meshes/mirrors01_ansys_lfs.apdl deleted file mode 100644 index f85ac654..00000000 --- a/mirrors/ANSYS/meshes/mirrors01_ansys_lfs.apdl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3fbd00e5a7d777be51819380d116ccbe4923c2142f219606fef9fbe56f40a422 -size 5039915 diff --git a/mirrors/ANSYS/meshes/small_mesh_lfs.apdl b/mirrors/ANSYS/meshes/small_mesh_lfs.apdl deleted file mode 100644 index 41fb8e49..00000000 --- a/mirrors/ANSYS/meshes/small_mesh_lfs.apdl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:79280ea22a7d92d91b080cd912a818f919840bb116af83903ca66dabf65a6131 -size 618959 diff --git a/mirrors/ANSYS/res/mirrors01_T_lfs.ansys b/mirrors/ANSYS/res/mirrors01_T_lfs.ansys deleted file mode 100644 index d0ed0d06..00000000 --- a/mirrors/ANSYS/res/mirrors01_T_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5113f8b9378af0415cd632d491114fddb81a4328a7ec61556e5e4d3416cc814e -size 99360 diff --git a/mirrors/ANSYS/res/mirrors01_u_lfs.ansys b/mirrors/ANSYS/res/mirrors01_u_lfs.ansys deleted file mode 100644 index 86a42d49..00000000 --- a/mirrors/ANSYS/res/mirrors01_u_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2769a2d121bbec4f3ab93047696030537e0ff260fd97db1d70cd0fa6979adb1 -size 137577 diff --git a/mirrors/ANSYS/res/mirrors01_u_thermo_lfs.ansys b/mirrors/ANSYS/res/mirrors01_u_thermo_lfs.ansys deleted file mode 100644 index 93c29c3b..00000000 --- a/mirrors/ANSYS/res/mirrors01_u_thermo_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8fa0107acc979b4f5d73c296bce045f99f5fb6a5f1bfe212bc6aafa748258d7d -size 122961 diff --git a/mirrors/ANSYS/res/mirrors01_x_lfs.ansys b/mirrors/ANSYS/res/mirrors01_x_lfs.ansys deleted file mode 100644 index 3334721c..00000000 --- a/mirrors/ANSYS/res/mirrors01_x_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:573d298b1ba61eaab9cac7adc539d659ef06dda451627c55faa96952566476b8 -size 143310 diff --git a/mirrors/ANSYS/res/mirrors01_x_thermo_lfs.ansys b/mirrors/ANSYS/res/mirrors01_x_thermo_lfs.ansys deleted file mode 100644 index 46d11cfe..00000000 --- a/mirrors/ANSYS/res/mirrors01_x_thermo_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9bda00e1712c5b7da9a158bc5e5b42d478b1686d14f173987bee3f6207fc0dcc -size 135923 diff --git a/mirrors/ANSYS/res/mirrors01_y_lfs.ansys b/mirrors/ANSYS/res/mirrors01_y_lfs.ansys deleted file mode 100644 index bd5a8f26..00000000 --- a/mirrors/ANSYS/res/mirrors01_y_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:27caf6c351f84046f70b326494902457105f07ab05a0b9385184d90a8fd28865 -size 139978 diff --git a/mirrors/ANSYS/res/mirrors01_y_thermo_lfs.ansys b/mirrors/ANSYS/res/mirrors01_y_thermo_lfs.ansys deleted file mode 100644 index df62e10a..00000000 --- a/mirrors/ANSYS/res/mirrors01_y_thermo_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37043d5af9d765f3328d8e1221063a015317688504261696635ed647137931f5 -size 129635 diff --git a/mirrors/ANSYS/res/mirrors01_z_lfs.ansys b/mirrors/ANSYS/res/mirrors01_z_lfs.ansys deleted file mode 100644 index 3ec1f92e..00000000 --- a/mirrors/ANSYS/res/mirrors01_z_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24b12bfa15c7869342182740549f7e35cf4745dcf1d53044a46ccb6141cb1259 -size 139317 diff --git a/mirrors/ANSYS/res/mirrors01_z_thermo_lfs.ansys b/mirrors/ANSYS/res/mirrors01_z_thermo_lfs.ansys deleted file mode 100644 index c715958c..00000000 --- a/mirrors/ANSYS/res/mirrors01_z_thermo_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22f035f74ecda7723f2da63792f88fd674ce379343426dd82987e077ccf64bc9 -size 139790 diff --git a/mirrors/ANSYS/res/small2_T_lfs.ansys b/mirrors/ANSYS/res/small2_T_lfs.ansys deleted file mode 100644 index 130cf438..00000000 --- a/mirrors/ANSYS/res/small2_T_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d6ac2435b62430480342a6811e155c7db644d2107a7f9e6d889502c521ed4cf8 -size 12046 diff --git a/mirrors/ANSYS/res/small2_u_lfs.ansys b/mirrors/ANSYS/res/small2_u_lfs.ansys deleted file mode 100644 index 1e0fd9d2..00000000 --- a/mirrors/ANSYS/res/small2_u_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b40da67428bcc98be69051f075912d8cef51e87fb97239485c848ee4b8e2fc41 -size 20128 diff --git a/mirrors/ANSYS/res/small2_x_lfs.ansys b/mirrors/ANSYS/res/small2_x_lfs.ansys deleted file mode 100644 index 781038d9..00000000 --- a/mirrors/ANSYS/res/small2_x_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a094fec73ff8aeded69d5380cba8e54ad103b794dba305f87c4afae595bc4bff -size 18227 diff --git a/mirrors/ANSYS/res/small2_y_lfs.ansys b/mirrors/ANSYS/res/small2_y_lfs.ansys deleted file mode 100644 index 57c3004f..00000000 --- a/mirrors/ANSYS/res/small2_y_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65be423c24896503b5286cb3fd14d26fbd5aebc4e38ffae613b57be9912c4e0d -size 18217 diff --git a/mirrors/ANSYS/res/small2_z_lfs.ansys b/mirrors/ANSYS/res/small2_z_lfs.ansys deleted file mode 100644 index 1cf1800a..00000000 --- a/mirrors/ANSYS/res/small2_z_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fbf2f95ef57dd21f9af22ad7c773965538614b827d7548d0d8d36025b238767 -size 18284 diff --git a/mirrors/ANSYS/res/small_T_lfs.ansys b/mirrors/ANSYS/res/small_T_lfs.ansys deleted file mode 100644 index 636c7c97..00000000 --- a/mirrors/ANSYS/res/small_T_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7aaaa5f481f496ec7d653ccdded041d462ab39e49c6f70696a9be80e1486b6a -size 13326 diff --git a/mirrors/ANSYS/res/small_u_lfs.ansys b/mirrors/ANSYS/res/small_u_lfs.ansys deleted file mode 100644 index d3f08a8f..00000000 --- a/mirrors/ANSYS/res/small_u_lfs.ansys +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a62babd9d52d5f0da9fc652434363feef588ca950247172315e76e585eb20f9 -size 18717 diff --git a/mirrors/CMakeLists.txt b/mirrors/CMakeLists.txt deleted file mode 100644 index 3fc1d71d..00000000 --- a/mirrors/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Add source dir -ADD_SUBDIRECTORY( src ) -ADD_SUBDIRECTORY( _src ) - -# Add test dir -MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests) diff --git a/mirrors/__init__.py b/mirrors/__init__.py deleted file mode 100644 index 4acbd22e..00000000 --- a/mirrors/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# mirrors MODULE initialization file - -import fwk -import tbox -from mirrorsw import * diff --git a/mirrors/_src/CMakeLists.txt b/mirrors/_src/CMakeLists.txt deleted file mode 100644 index ec018ece..00000000 --- a/mirrors/_src/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# CMake input file of the SWIG wrapper around "mirrors.so" - -INCLUDE(${SWIG_USE_FILE}) - -FILE(GLOB SRCS *.h *.cpp *.inl *.swg) -FILE(GLOB ISRCS *.i) - -SET(CMAKE_SWIG_FLAGS "") -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON) - -SET(SWINCFLAGS --I${PROJECT_SOURCE_DIR}/mirrors/src --I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/src --I${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src --I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/src --I${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src -) -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}") - -if (${CMAKE_VERSION} VERSION_LESS "3.8.0") - SWIG_ADD_MODULE(mirrorsw python ${ISRCS} ${SRCS}) -else() - SWIG_ADD_LIBRARY(mirrorsw LANGUAGE python SOURCES ${ISRCS} ${SRCS}) -endif() -MACRO_DebugPostfix(_mirrorsw) - -TARGET_INCLUDE_DIRECTORIES(_mirrorsw PRIVATE ${PROJECT_SOURCE_DIR}/ext/amfe/fwk/_src - ${PROJECT_SOURCE_DIR}/ext/amfe/tbox/_src - ${PYTHON_INCLUDE_PATH} -) - -SWIG_LINK_LIBRARIES(mirrorsw - mirrors tbox fwk ${PYTHON_LIBRARIES} -) - -INSTALL(FILES ${CMAKE_SWIG_OUTDIR}/mirrorsw.py DESTINATION ${CMAKE_INSTALL_PREFIX}) -INSTALL(TARGETS _mirrorsw DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/mirrors/_src/mirrorsw.i b/mirrors/_src/mirrorsw.i deleted file mode 100644 index d0367531..00000000 --- a/mirrors/_src/mirrorsw.i +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// SWIG input file of the 'mirrors' module - -%feature("autodoc","1"); - -%module(docstring= -"'mirrorsw' module -(c) ULg - A&M", -directors="1", -threads="1" -) mirrorsw -%{ - -#include <string> -#include <sstream> -#include <typeinfo> -#include "mirrors.h" - -#include "fwkw.h" -#include "tboxw.h" - -#include "wProblem.h" -#include "wSolver.h" -#include "wMedium.h" -#include "wuDirichlet.h" -#include "wuNeumann.h" -#include "wTDirichlet.h" -#include "wTNeumann.h" -#include "wTSource.h" -#include "wMSurface.h" -#include "wANSYSSolution.h" - -//Fix for missing SWIGPY_SLICE_ARG with some versions of swig. -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj)) -#else -# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj)) -#endif - -%} - - -%include "fwkw.swg" - -// ----------- MODULES UTILISES ------------ -%import "fwkw.i" -%import "tboxw.i" - -// ----------- MIRRORS CLASSES ---------------- -%include "mirrors.h" - -%shared_ptr(mirrors::Medium); -%shared_ptr(mirrors::TDirichlet); -%shared_ptr(mirrors::TNeumann); -%shared_ptr(mirrors::uDirichlet); -%shared_ptr(mirrors::uNeumann); -%shared_ptr(mirrors::TSource); -%shared_ptr(mirrors::MSurface); - - -%immutable mirrors::Problem::msh; // avoid the creation of the setter method -%include "wProblem.h" -%immutable mirrors::Solver::tms; // avoid the creation of the setter method -%include "wSolver.h" - -%pythonappend mirrors::Medium::Medium "self.thisown=0" -%include "wMedium.h" -%pythonappend mirrors::uDirichlet::uDirichlet "self.thisown=0" -%include "wuDirichlet.h" -%pythonappend mirrors::uNeumann::uNeumann "self.thisown=0" -%include "wuNeumann.h" - -%pythonappend mirrors::TDirichlet::TDirichlet "self.thisown=0" -%include "wTDirichlet.h" -%pythonappend mirrors::TNeumann::TNeumann "self.thisown=0" -%include "wTNeumann.h" - -%pythonappend mirrors::TSource::TSource "self.thisown=0" -%include "wTSource.h" - -%pythonappend mirrors::MSurface::MSurface "self.thisown=0" -%include "wMSurface.h" - -%pythonappend mirrors::ANSYSSolution::ANSYSSolution "self.thisown=0" -%include "wANSYSSolution.h" - -// Instantiate some std templates -%include "std_vector.i" - -namespace std { - %template(std_vector_ANSYSSolution) std::vector<mirrors::ANSYSSolution*>; - %template(std_vector_MirrorsProblem) std::vector<mirrors::Problem*>; -} - diff --git a/mirrors/attic/imported_10x10.py b/mirrors/attic/imported_10x10.py deleted file mode 100755 index 52c88c0b..00000000 --- a/mirrors/attic/imported_10x10.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import numpy as np - - - -def import_sol(): - - tmp = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - return tmp - diff --git a/mirrors/attic/imported_30x30.py b/mirrors/attic/imported_30x30.py deleted file mode 100755 index a403beb0..00000000 --- a/mirrors/attic/imported_30x30.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import numpy as np - - - -def import_sol(): - - tmp = np.array([ 35.45819624, 36.05702593, 37.12770234, 38.6591168 , 40.63506558, 43.03461026, 45.83231747, 48.99853179, 52.49969104, 56.2986823 , 60.35523548, 64.62635018, 69.06675159, 73.62937038, 78.2658417 , 82.92701781, 87.56348913, 92.12610792, 96.56650932,100.83762403,104.8941772 ,108.69316847,112.19432772,115.36054204,118.15824924,120.55779393,122.53374271,124.06515717,125.13583357,125.73466327, 35.34200729, 35.93887475, 37.00604278, 38.53243912, 40.50191314, 42.89359503, 45.68213474, 48.83797405, 52.32766075, 56.11420353, 60.15746425, 64.41458342, 68.84043458, 73.38810264, 78.00938123, 82.65528367, 87.27656226, 91.82423032, 96.25008148,100.50720065,104.55046137,108.33700415,111.82669085,114.98253016,117.77106987,120.16275176,122.13222578,123.65862212,124.72579015,125.32265761, 35.1358186 , 35.72920388, 36.79014594, 38.30763714, 40.26562106, 42.64334964, 45.41562074, 48.55304858, 52.02237611, 55.78682784, 59.80649978, 64.03878251, 68.43881282, 72.95994935, 77.55426695, 82.17306474, 86.76738234, 91.28851887, 95.68854919, 99.92083191,103.94050385,107.70495558,111.17428311,114.31171095,117.08398205,119.46171063,121.41969455,122.93718575,123.99812781,124.59151309, 34.84433479, 35.43279739, 36.48493797, 37.98984018, 39.93158083, 42.28958398, 45.03885655, 48.15025655, 51.59080283, 55.32402498, 59.31035006, 63.50752212, 67.87105015, 72.35467971, 76.91088323, 81.49136386, 86.04756739, 90.53119695, 94.89472498, 99.09189704,103.07822212,106.81144427,110.25199055,113.36339055,116.11266312,118.47066626,120.41240691,121.91730913,122.96944971,123.55791231, 34.50894427, 35.09174269, 36.133756 , 37.62417294, 39.54722356, 41.88252999, 44.60533973, 47.68679127, 51.09422093, 54.79150934, 58.73946446, 62.89623708, 67.21776443, 71.65823727, 76.17058554, 80.70697723, 85.21932549, 89.65979834, 93.98132569, 98.13809831,102.08605343,105.78334184,109.1907715 ,112.27222304,114.99503278,117.33033921,119.25338983,120.74380677,121.78582008,122.3686185 , 34.13482126, 34.71130136, 35.74201785, 37.21627669, 39.11847887, 41.42846747, 44.12175831, 47.16980281, 50.54029138, 54.19749625, 58.10265027, 62.21435793, 66.48903415, 70.88136634, 75.34479473, 79.83200588, 84.29543427, 88.68776646, 92.96244268, 97.07415034,100.97930436,104.63650923,108.0069978 ,111.0550423 ,113.74833314,116.05832173,117.96052392,119.43478275,120.46549924,121.04197935, 33.71860844, 34.28805941, 35.30620817, 36.76249106, 38.64149931, 40.92332174, 43.58377274, 46.59465182, 49.92404333, 53.53665516, 57.39419285, 61.45576561, 65.67831984, 70.01709544, 74.42610033, 78.85859801, 83.2676029 , 87.6063785 , 91.82893272, 95.89050549, 99.74804318,103.360655 ,106.69004652,109.70092559,112.3613766 ,114.64319903,116.52220728,117.97849017,118.99663893,119.56608989, 33.2717031 , 33.83360658, 34.83826082, 36.27524219, 38.12934613, 40.38092536, 43.00611483, 45.9770878 , 49.26235167, 52.82708206, 56.63349206, 60.64123288, 64.80782151, 69.08909111, 73.4396592 , 77.81340869, 82.16397678, 86.44524638, 90.61183501, 94.61957583, 98.42598583,101.99071622,105.27598009,108.24695306,110.87214253,113.12372176,114.9778257 ,116.41480707,117.41946131,117.98136479, 32.8049243 , 33.35894466, 34.34950431, 35.76632583, 37.59441798, 39.81440912, 42.40276902, 45.33206131, 48.57123522, 52.08595493, 55.83896365, 59.79047866, 63.89861295, 68.11981933, 72.40935198, 76.72174081, 81.01127346, 85.23247984, 89.34061413, 93.29212914, 97.04513786,100.55985757,103.79903148,106.72832377,109.31668367,111.53667481,113.36476696,114.78158848,115.77214813,116.32616849, 32.32802254, 32.87398883, 33.85014821, 35.24637268, 37.04788894, 39.23560695, 41.78633854, 44.67304624, 47.86513064, 51.32875509, 55.02720443, 58.92127426, 62.96968653, 67.1295271 , 71.35670065, 75.60639811, 79.83357166, 83.99341222, 88.04182449, 91.93589433, 95.63434367, 99.09796812,102.29005252,105.17676022,107.72749181,109.91520982,111.71672608,113.11295055,114.08910993,114.63507622, 31.84938619, 32.38726912, 33.34897585, 34.72452836, 36.49937205, 38.65469954, 41.16766598, 44.01163419, 47.15645781, 50.56880115, 54.21249267, 58.04890839, 62.03738142, 66.13563298, 70.30022061, 74.48699867, 78.6515863 , 82.74983786, 86.73831089, 90.57472661, 94.21841813, 97.63076147,100.77558509,103.6195533 ,106.13251974,108.28784723,110.06269092,111.43824343,112.39995016,112.93783309, 31.37594228, 31.90582952, 32.85324041, 34.2083452 , 35.95680569, 38.08009405, 40.55570502, 43.35739739, 46.45547293, 49.8170915 , 53.40661922, 57.18600628, 61.11519031, 65.152521 , 69.25520167, 73.37974291, 77.48242358, 81.51975427, 85.4489383 , 89.22832536, 92.81785309, 96.17947165, 99.27754719,102.07923956,104.55485053,106.67813889,108.42659938,109.78170417,110.72911506,111.25900231, 30.91321738, 31.43528997, 32.36872867, 33.7038487 , 35.42652331, 37.51849792, 39.95759917, 42.71797285, 45.77035872, 49.08240093, 52.61899116, 56.34264073, 60.21387809, 64.19166719, 68.2338425 , 72.297556 , 76.33973131, 80.31752041, 84.18875777, 87.91240734, 91.44899757, 94.76103978, 97.81342565,100.57379933,103.01290058,105.10487519,106.8275498 ,108.16266983,109.09610853,109.61818113, 30.46550571, 30.9800172 , 31.89993704, 33.21572072, 34.91344608, 36.97512293, 39.37889903, 42.09929461, 45.10747321, 48.3715476 , 51.8569179 , 55.52663839, 59.34180918, 63.26198853, 67.24562161, 71.25048092, 75.234114 , 79.15429335, 82.96946414, 86.63918463, 90.12455493, 93.38862932, 96.39680792, 99.1172035 ,101.5209796 ,103.58265645,105.28038181,106.59616549,107.51608533,108.03059682, 30.03608805, 30.5433474 , 31.45030078, 32.74753821, 34.42133378, 36.45395086, 38.82384524, 41.50589628, 44.47167398, 47.68974055, 51.12598383, 54.74397885, 58.50537401, 62.37029762, 66.29778055, 70.24619054, 74.17367348, 78.03859709, 81.79999225, 85.41798726, 88.85423054, 92.07229712, 95.03807481, 97.72012585,100.09002023,102.12263731,103.79643288,105.09367032,106.00062369,106.50788304, 29.62745443, 30.12781264, 31.02242714, 32.30201598, 33.95303996, 35.95800379, 38.29565633, 40.94121873, 43.86664774, 47.04093331, 50.43042734, 53.99920042, 57.70942272, 61.52176499, 65.39581548, 69.29050832, 73.16455881, 76.97690109, 80.68712338, 84.25589646, 87.64539049, 90.81967606, 93.74510508, 96.39066747, 98.72832002,100.73328384,102.38430783,103.66389667,104.55851116,105.05886937, 29.24149934, 29.73533942, 30.61829982, 31.88121953, 33.51073573, 35.48958101, 37.79678109, 40.4078799 , 43.29519953, 46.42813387, 49.77347316, 53.29575605, 56.9576455 , 60.72032461, 64.54390808, 68.38786499, 72.21144846, 75.97412757, 79.63601702, 83.15829991, 86.5036392 , 89.63657354, 92.52389317, 95.13499198, 97.44219206, 99.42103734,101.05055354,102.31347325,103.19643365,103.69027373, 28.8796751 , 29.36740457, 30.23943953, 31.48673231, 33.09608543, 35.05044516, 37.32909674, 39.90788672, 42.75947964, 45.85364814, 49.15759335, 52.63629272, 56.25287121, 59.96899223, 63.745264 , 67.5416571 , 71.31792887, 75.03404989, 78.65062838, 82.12932775, 85.43327297, 88.52744146, 91.37903438, 93.95782436, 96.23647594, 98.19083567, 99.80018879,101.04748157,101.91951653,102.407246 , 28.54310206, 29.02514737, 29.88701936, 31.11977578, 32.71037299, 34.64195598, 36.89405142, 39.44278735, 42.26114689, 45.31925494, 48.58469492, 52.0228524 , 55.59728213, 59.27009427, 63.00235615, 66.75450487, 70.48676674, 74.15957889, 77.73400861, 81.1721661 , 84.43760607, 87.49571413, 90.31407367, 92.8628096 , 95.11490504, 97.04648803, 98.63708524, 99.86984166,100.73171364,101.21375895, 28.23264277, 28.70944494, 29.56194246, 30.78129037, 32.35458687, 34.2651603 , 36.49276002, 39.01377371, 41.80147835, 44.8263238 , 48.05624604, 51.45700717, 54.99255833, 58.62542181, 62.3170884 , 66.02842553, 69.72009212, 73.3529556 , 76.88850676, 80.28926789, 83.51919013, 86.54403558, 89.33174022, 91.85275391, 94.08035363, 95.99092706, 97.56422356, 98.78357147, 99.63606899,100.11287116, 27.94895036, 28.42096144, 29.26489274, 30.47198817, 32.02947559, 33.92085085, 36.12606679, 38.62174836, 41.38144109, 44.37589172, 47.57335847, 50.93994745, 54.43997204, 58.03633112, 61.69090243, 65.36494662, 69.01951793, 72.61587701, 76.11590159, 79.48249057, 82.67995732, 85.67440796, 88.43410068, 90.92978225, 93.1349982 , 95.02637346, 96.58386087, 97.79095631, 98.63488761, 99.10689869, 27.69250148, 28.16018156, 28.99636927, 30.19238886, 31.73558537, 33.60960609, 35.79458782, 38.26736997, 41.00174081, 43.96871551, 47.13684353, 50.47254198, 53.94045167, 57.50381194, 61.1248503 , 64.76518286, 68.38622122, 71.94958149, 75.41749119, 78.75318964, 81.92131765, 84.88829236, 87.62266319, 90.09544534, 92.28042707, 94.15444779, 95.6976443 , 96.89366389, 97.7298516 , 98.19753169, 27.48956121, 27.95381398, 28.78387381, 29.97112855, 31.50301598, 33.36330323, 35.53227265, 37.9869334 , 40.70126581, 43.6464975 , 46.79140837, 50.10266166, 53.54515731, 57.08240404, 60.67690617, 64.29056112, 67.88506325, 71.42230998, 74.86480563, 78.17605892, 81.32096979, 84.26620148, 86.98053389, 89.43519464, 91.60416406, 93.46445131, 94.99633874, 96.18359348, 97.01365331, 97.47790608, 27.37792333, 27.84029072, 28.6669796 , 29.84941278, 31.37507906, 33.22781149, 35.38797251, 37.83266463, 40.53597387, 43.46924468, 46.60138375, 49.89918971, 53.32770503, 56.85058665, 60.43049114, 64.02947067, 67.60937517, 71.13225678, 74.56077211, 77.85857807, 80.99071714, 83.92398794, 86.62729718, 89.0719893 , 91.23215032, 93.08488276, 94.61054904, 95.79298222, 96.61967109, 97.08203848, 27.2818953 , 27.74264094, 28.56643021, 29.744716 , 31.26503101, 33.11126499, 35.26384925, 37.69996661, 40.393794 , 43.31677636, 46.43792945, 49.72416836, 53.14065818, 56.65118329, 60.21853127, 63.80488739, 67.37223537, 70.88276048, 74.2992503 , 77.5854892 , 80.7066423 , 83.62962466, 86.32345205, 88.75956941, 90.91215367, 92.75838765, 94.27870266, 95.45698845, 96.28077772, 96.74152336, 27.20127808, 27.66066222, 28.48201722, 29.65682121, 31.17264373, 33.01342214, 35.15964557, 37.58856428, 40.27443148, 43.18877651, 46.30070669, 49.57723486, 52.98362904, 56.48378065, 60.04058723, 63.61634576, 67.17315233, 70.67330394, 74.07969812, 77.35622629, 80.46815647, 83.3825015, 86.0683687, 88.49728741, 90.64351084, 92.48428925, 94.00011177, 95.17491577, 95.99627076, 96.4556549, 27.13598912, 27.59427064, 28.4136542 , 29.58563842, 31.09782263, 32.93418278, 35.07525481, 37.49834358, 40.17776412, 43.08511409, 46.18957497, 49.45823876, 52.85645685, 56.34820734, 59.89647681, 63.46365274, 67.01192221, 70.5036727, 73.9018908, 77.17055459, 80.27501546, 83.18236543, 85.86178597, 88.28487475, 90.42594678, 92.26230692, 93.77449114, 94.94647535, 95.76585891, 96.22414044, 27.08601735, 27.54345494, 28.36132958, 29.53115555, 31.04055503, 32.87353346, 35.01066264, 37.42928922, 40.10377553, 43.00577152, 46.10451543, 49.36715988, 52.75912005, 56.24444037, 59.78617559, 63.34678246, 66.88851768, 70.373838 , 73.76579818, 77.02844262, 80.12718653, 83.02918253, 85.7036688, 88.12229542, 90.2594246, 92.09240303, 93.60180251, 94.7716284, 95.58950312, 96.0469407 , 27.0513867 , 27.50823943, 28.32506839, 29.49339868, 31.00086833, 32.83150322, 34.96589999, 37.38143425, 40.0525011, 42.95078678, 46.04556881, 49.30404182, 52.69166523, 56.17252941, 59.70973637, 63.26579085, 66.80299781, 70.283862 ,73.6714854 , 76.92995841, 80.02474045, 82.92302611, 85.59409297, 88.00962724, 90.144024 , 91.97465889, 93.48212854, 94.65045883, 95.46728779, 95.92414052, 27.03212321, 27.48865061, 28.30489789, 29.47239621, 30.97879238, 32.80812366, 34.94100051, 37.35481465, 40.02397942, 42.9202012, 46.01277941, 49.26893204, 52.6541431 , 56.13252853, 59.66721662, 63.22073881, 66.7554268, 70.23381233, 73.61902338, 76.87517601, 79.96775423, 82.863976 , 85.53314077, 87.94695492, 90.07983176, 91.90916304, 93.41555921, 94.58305753,95.39930481, 95.85583222]) - - return tmp - diff --git a/mirrors/attic/loop_old.py b/mirrors/attic/loop_old.py deleted file mode 100755 index 6a827c54..00000000 --- a/mirrors/attic/loop_old.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - - - -import numpy as np -import time -from params.src.func import grid - -from fwk.wutils import parseargs - -if __name__ == "__main__": - import mirrors.models.mirror_ss as model - - m = 25 - T_min = 100. - T_max = 300. - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - nL0_1 = 31 - nL0 = 31 - nH0 = 21 - nH0_1 = 11 - nW0 = 25 - - #---------- - M = np.zeros((1,)) - M[0] = m - x, w = grid(M) - - t = np.zeros((m,)) - Sol = np.zeros((m,)) - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - f.write('Mesh: mirrors/model/mirror.geo \n') - f.write('T_min = ' + str(T_min) + ', T_max = ' + str(T_max) + ', m = ' + str(m) + '.\n') - f.write('L = ' + str(L0) + ', L_1 = ' + str(L0_1) + ', H = ' + str(H0) + ', H_1 = ' + str(H0_1) + ', W = ' + str(W0) + '.\nnL = ' + str(nL0) + ', nL_1 = ' + str(nL0_1) + ', nH = ' + str(nH0_1) + ', nH_1 = ' + str(nH0_1) + ', nW = ' + str(nW0) + '.\n') - f.write('====================\n') - - for i in range(0,m) : - if i > 0: - f.write('--------------\n') - t[i] = T_min + (T_max - T_min)*(x[i]+1.)/2. - Sol[i] = 1. - #Sol[i] = model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = H0_1, W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = t[i]) - f.write('i = ' + str(i) + '.\n') - f.write('T = ' + str(t[i]) + '.\n') - f.write('Sigma_vm_max = ' + str(Sol[i]) + '.\n') - - f.write('====================\n') - print(w, file=f) - print(t, file=f) - print(Sol, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() diff --git a/mirrors/attic/loop_old2.py b/mirrors/attic/loop_old2.py deleted file mode 100755 index 7d80165d..00000000 --- a/mirrors/attic/loop_old2.py +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - - - -import numpy as np -import time - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - -from matplotlib import cm -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D - -from fwk.wutils import parseargs - - -def model(xi,f,d,fig,ax): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - nL0_1 = 11 - nL0 = 11 - nH0 = 6 - nH0_1 = 6 - nW0 = 5 - - xi[0] = T_min + (T_max - T_min)*(xi[0]+1.)/2. - sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = H0_1, W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0]) - #sol = 1 - - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - -def main(): - - d = 2 - k = 3 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 3 - N[j] = 3 - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, W = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - plt.ion() - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - #f.write('----------\n') - #f.write('i = [') - #for j in range(0,d-1): - # f.write(str(i[j])+ ', ') - #f.write(str(i[d-1])+ '] => ') - - #f.write('xi = [') - #for j in range(0,d-1): - # f.write(str(X[i[j],j])+ ', ') - #f.write(str(X[i[d-1],d-1])+ ']') - - #f.write('\n') - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - #print i - - for j in range(0,d): - xi[j] = X[i[j],j] - - #print xi - - sol[m_i] = model(xi,f,d,fig,ax) - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - W_sr[m_i,m_i] = 1 - for j in range(0,d): - W_sr[m_i,m_i] = W_sr[m_i,m_i]*W[i[j],j] - - m_i = m_i + 1 - - plt.draw() - p,i = next_indices(p,i,M,d) - - - #print sol - #print Z - #print W_sr - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - for j in range(0,n_max): - s_hat = s_hat + np.dot(np.transpose(U[:,j]),np.dot(W_sr,sol))*V[:,j]/S[j,j] - - print(s_hat) - - #------------------ - - m1 = 20 - m2 = 20 - - x = np.linspace(100.,300.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - surrogate[i,j] = np.dot(np.transpose(phi(xi,N,n_max,d)),s_hat) - - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - plt.ioff() - plt.show() - f.close() - -if __name__ == "__main__": - main() diff --git a/mirrors/broken/NISP_Leg_cond.py b/mirrors/broken/NISP_Leg_cond.py deleted file mode 100755 index 28fdd1e2..00000000 --- a/mirrors/broken/NISP_Leg_cond.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import numpy as np -import time -import os -import shutil -import math -from fwk.wutils import parseargs - -def main(): - - m1 = 10 - m2 = 11 - - d = list(range(1,m1+1)) - n = list(range(0,m2)) - - X, Y = np.meshgrid(d, n) - cond = np.zeros((m1,m2)) - - for i in range(0,m1): - for j in range(0,m2): - cond[i,j] = (2**d[i]) / (((2./(2*n[j]+1)))**d[i]) - - args = parseargs() - if not args.nogui: - import matplotlib.pyplot as plt - fig = plt.figure() - ax = fig.gca(projection='3d') # [RB] does not exist in recent versions of matplotlib - ax.view_init(elev=20., azim=-140.) - - ax.scatter(X, Y, cond) - - ax.set_xlabel('d [-]') - ax.set_ylabel('n [-]') - #ax.set_zscale('log') - print(cond) - plt.show() - -if __name__ == "__main__": - main() diff --git a/mirrors/broken/mirrors01.py b/mirrors/broken/mirrors01.py deleted file mode 100755 index f4cc8df0..00000000 --- a/mirrors/broken/mirrors01.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - - -import mirrors as m -import tbox -import tbox.gmsh as gmsh -import fwk.wutils as wu -from fwk.coloring import ccolors - -def main(): - print(ccolors.ANSI_RED + "mirrors01_ansys.msh contains inverted Tri3 elements. Test will fail!" + ccolors.ANSI_RESET) - loader = gmsh.MeshLoader("mirrors01_ansys.msh",__file__) - msh = loader.execute() - #print msh - - pbl = m.Problem(msh,"thermomechanical",22) - #pbl = m.Problem(msh,"thermal",22) - m.ANSYSSolution(pbl,'T','T_ansys',wu.pth('mirrors01_T.ansys',__file__)) - #m.ANSYSSolution(pbl,'u','u_ansys_mech','mirrors07_u.ansys') - #m.ANSYSSolution(pbl,'x','x_ansys_mech','mirrors07_x.ansys') - #m.ANSYSSolution(pbl,'y','y_ansys_mech','mirrors07_y.ansys') - #m.ANSYSSolution(pbl,'z','z_ansys_mech','mirrors07_z.ansys') - m.ANSYSSolution(pbl,'u','u_ansys_thermomech',wu.pth('mirrors01_u_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'x','x_ansys_thermomech',wu.pth('mirrors01_x_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'y','y_ansys_thermomech',wu.pth('mirrors01_y_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'z','z_ansys_thermomech',wu.pth('mirrors01_z_thermo.ansys',__file__)) - #print pbl - - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - #print pbl - clamped = tbox.Vector3d(1,1,1) - values_clamped = tbox.Vector3d(0,0,0) - forces = tbox.Vector3d(-0.2,0,0) - - m.uDirichlet(pbl, "M1_S1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S3", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B3", "Clamped",clamped,values_clamped) - m.TDirichlet(pbl, "M1_S1", "Clamped",70.) - m.TDirichlet(pbl, "M1_S2", "Clamped",70.) - m.TDirichlet(pbl, "M1_S3", "Clamped",70.) - m.TDirichlet(pbl, "M1_B1", "Clamped",70.) - m.TDirichlet(pbl, "M1_B2", "Clamped",70.) - m.TDirichlet(pbl, "M1_B3", "Clamped",70.) - m.TNeumann(pbl, "HF", "HF",1.E-002) - m.MSurface(pbl, "HF", "M1",tbox.Vector3d(-85.853,-244.29,-12.597),tbox.Vector3d(-0.93316,-0.20444,-0.29566),tbox.Vector3d(9.5044E-04,0.8511,-0.57078)) - #m.uNeumann(pbl, "HF", "HF",clamped,forces) - m.TSource(pbl, "Volume", "ihg",1.7E-004) - #m.TDirichlet(pbl, "hf", "Clamped",80.) - #print pbl - - from fwk.wutils import parseargs - args=parseargs() - - solver = m.Solver(pbl,args.k) - solver.start() - - for i in range(0,len(pbl.ANSYSSol)): - print(pbl.ANSYSSol[i].diff_abs) - print(pbl.ANSYSSol[i].diff_rel) - - if not args.nogui: - from mirrors.viewer import GUI - GUI().open( loader.filename ) - -if __name__ == "__main__": - main() diff --git a/mirrors/broken/mirrors01_ansys_lfs.msh b/mirrors/broken/mirrors01_ansys_lfs.msh deleted file mode 100644 index 842cbbc5..00000000 --- a/mirrors/broken/mirrors01_ansys_lfs.msh +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1416e19f04cff620e55b6796df9a3dabfd8669a76501065b87be6560e5f63240 -size 1607284 diff --git a/mirrors/broken/mirrors01_ansys_partition_lfs.msh b/mirrors/broken/mirrors01_ansys_partition_lfs.msh deleted file mode 100644 index 5491a644..00000000 --- a/mirrors/broken/mirrors01_ansys_partition_lfs.msh +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a3022c9412221b3e21ec3d0856b9b941dee4e7828d1839db1cbf3117781ba41f -size 1911609 diff --git a/mirrors/broken/mirrors03.py b/mirrors/broken/mirrors03.py deleted file mode 100755 index ba8e4c06..00000000 --- a/mirrors/broken/mirrors03.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -import mirrors as m -import tbox -import tbox.gmsh as gmsh - -def main(): - - loader = gmsh.MeshLoader("mirrors01_ansys.msh",__file__) - msh = loader.execute() - pbl = m.Problem(msh,"mechanical",22) - m.Medium(pbl, "Volume", "TZM",330000,0.36) - clamped = tbox.Vector3d(1,1,1) - values_clamped = tbox.Vector3d(0,0,0) - values_clamped2 = tbox.Vector3d(0,0,100) - m.uDirichlet(pbl, "M1_S1", "clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S2", "clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S3", "clamped",clamped,values_clamped) - m.uDirichlet(pbl,"HF","moved",clamped,values_clamped2) - - from fwk.wutils import parseargs - args=parseargs() - - solver = m.Solver(pbl,args.k) - solver.start() - - if not args.nogui: - from mirrors.viewer import GUI - GUI().open( loader.filename ) - -if __name__ == "__main__": - main() diff --git a/mirrors/broken/mirrors_test_battery.py b/mirrors/broken/mirrors_test_battery.py deleted file mode 100755 index 563b3e2e..00000000 --- a/mirrors/broken/mirrors_test_battery.py +++ /dev/null @@ -1,201 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - - - -import time -import mirrors as m -import tbox -import tbox.gmsh as gmsh -import fwk.wutils as wu -from fwk.coloring import ccolors - -def main(): - - print(ccolors.ANSI_RED + "One of the meshes contains inverted Tri3 elements. Test will fail!" + ccolors.ANSI_RESET) - - pbl_vector = [] - - #tests descriptions/parameters - - from fwk.wutils import parseargs - args=parseargs() - - nb_of_process = args.k - - print_mesh_info = 0 - print_problem_info = 0 - print_solver_info = 0 - print_tms = 1 - print_diff = 1 - - clamped = tbox.Vector3d(1,1,1) - xclamped = tbox.Vector3d(1,0,0) - yclamped = tbox.Vector3d(0,1,0) - zclamped = tbox.Vector3d(0,0,1) - - values_clamped = tbox.Vector3d(0,0,0) - - forces = tbox.Vector3d(-0.2,0,0) - - #----------------test 0---------------- - - loader = gmsh.MeshLoader("small_mesh.msh",__file__) - msh0 = loader.execute() - - pbl = m.Problem(msh0,'thermomechanical',22.) - #m.Medium(pbl, "Volume", "CuCrZr",2000.,0.,0.114,0.5E-05) - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - - m.ANSYSSolution(pbl,'T','T_ansys',wu.pth('small_T.ansys',__file__)) - m.ANSYSSolution(pbl,'u','u_ansys_thermomech',wu.pth('small_u.ansys',__file__)) - m.uDirichlet(pbl, "X0", "Clamped",clamped,values_clamped) - m.TDirichlet(pbl, "X0", "Clamped",22.) - m.TDirichlet(pbl, "X1", "Clamped",100.) - - pbl_vector.append(pbl) - - #----------------test 1---------------- - - pbl = m.Problem(msh0,'thermomechanical',22.) - #m.Medium(pbl, "Volume", "CuCrZr",2000.,0.,0.114,0.5E-05) - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - - m.ANSYSSolution(pbl,'T','T_ansys',wu.pth('small2_T.ansys',__file__)) - m.ANSYSSolution(pbl,'u','u_ansys_thermomech',wu.pth('small2_u.ansys',__file__)) - m.ANSYSSolution(pbl,'x','x_ansys_thermomech',wu.pth('small2_x.ansys',__file__)) - m.ANSYSSolution(pbl,'y','y_ansys_thermomech',wu.pth('small2_y.ansys',__file__)) - m.ANSYSSolution(pbl,'z','z_ansys_thermomech',wu.pth('small2_z.ansys',__file__)) - m.uDirichlet(pbl, "X0", "xClamped",xclamped,values_clamped) - m.uDirichlet(pbl, "Y0", "yClamped",yclamped,values_clamped) - m.uDirichlet(pbl, "Z0", "zClamped",zclamped,values_clamped) - m.TDirichlet(pbl, "X0", "Clamped",100.) - m.TDirichlet(pbl, "X1", "Clamped",100.) - - pbl_vector.append(pbl) - - #----------------test 2---------------- - - loader = gmsh.MeshLoader("mirrors01_ansys.msh",__file__) - msh2 = loader.execute() - - pbl = m.Problem(msh2,'thermal',22.) - #m.Medium(pbl, "Volume", "CuCrZr",2000.,0.,0.114,0.5E-05) - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - - m.ANSYSSolution(pbl,'T','T_ansys',wu.pth('mirrors01_T.ansys',__file__)) - m.TDirichlet(pbl, "M1_S1", "Clamped",70.) - m.TDirichlet(pbl, "M1_S2", "Clamped",70.) - m.TDirichlet(pbl, "M1_S3", "Clamped",70.) - m.TDirichlet(pbl, "M1_B1", "Clamped",70.) - m.TDirichlet(pbl, "M1_B2", "Clamped",70.) - m.TDirichlet(pbl, "M1_B3", "Clamped",70.) - m.TNeumann(pbl, "HF", "HF",1.E-002) - m.TSource(pbl, "Volume", "ihg",1.7E-004) - - pbl_vector.append(pbl) - - #----------------test 3---------------- - - pbl = m.Problem(msh2,'mechanical',22.) - #m.Medium(pbl, "Volume", "CuCrZr",2000.,0.,0.114,0.5E-05) - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - - m.ANSYSSolution(pbl,'u','u_ansys_mech',wu.pth('mirrors01_u.ansys',__file__)) - m.ANSYSSolution(pbl,'x','x_ansys_mech',wu.pth('mirrors01_x.ansys',__file__)) - m.ANSYSSolution(pbl,'y','y_ansys_mech',wu.pth('mirrors01_y.ansys',__file__)) - m.ANSYSSolution(pbl,'z','z_ansys_mech',wu.pth('mirrors01_z.ansys',__file__)) - m.uDirichlet(pbl, "M1_S1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S3", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B3", "Clamped",clamped,values_clamped) - m.uNeumann(pbl, "HF", "HF",clamped,forces) - - pbl_vector.append(pbl) - - #----------------test 4---------------- - - pbl = m.Problem(msh2,'thermomechanical',22.) - #m.Medium(pbl, "Volume", "CuCrZr",2000.,0.,0.114,0.5E-05) - m.Medium(pbl, "Volume", "TZM",330000,0.36,0.114,0.5E-05) - - m.ANSYSSolution(pbl,'T','T_ansys',wu.pth('mirrors01_T.ansys',__file__)) - m.ANSYSSolution(pbl,'u','u_ansys_thermomech',wu.pth('mirrors01_u_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'x','x_ansys_thermomech',wu.pth('mirrors01_x_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'y','y_ansys_thermomech',wu.pth('mirrors01_y_thermo.ansys',__file__)) - m.ANSYSSolution(pbl,'z','z_ansys_thermomech',wu.pth('mirrors01_z_thermo.ansys',__file__)) - m.uDirichlet(pbl, "M1_S1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_S3", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B1", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B2", "Clamped",clamped,values_clamped) - m.uDirichlet(pbl, "M1_B3", "Clamped",clamped,values_clamped) - m.TDirichlet(pbl, "M1_S1", "Clamped",70.) - m.TDirichlet(pbl, "M1_S2", "Clamped",70.) - m.TDirichlet(pbl, "M1_S3", "Clamped",70.) - m.TDirichlet(pbl, "M1_B1", "Clamped",70.) - m.TDirichlet(pbl, "M1_B2", "Clamped",70.) - m.TDirichlet(pbl, "M1_B3", "Clamped",70.) - m.TNeumann(pbl, "HF", "HF",1.E-002) - m.TSource(pbl, "Volume", "ihg",1.7E-004) - - pbl_vector.append(pbl) - - #tests start - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('mirrors_test_battery.log','w') - f.write('Mirrors test battery\n') - f.write('Tests started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - for i in range(0,len(pbl_vector)): - f.write('Test ' + str(i) + ':\n') - f.write('~~~~~~~\n') - - if print_mesh_info == 1: - f.write('Mesh informations:\n') - print(pbl_vector[i].msh, file=f) - f.write('~ ~ ~ ~ ~ ~ ~\n') - - if print_problem_info == 1: - f.write('Problem informations:\n') - print(pbl_vector[i], file=f) - f.write('~ ~ ~ ~ ~ ~ ~\n') - - solver = m.Solver(pbl_vector[i],nb_of_process) - if print_solver_info == 1: - f.write('Solver informations:\n') - print(solver, file=f) - f.write('~ ~ ~ ~ ~ ~ ~\n') - - solver.start() - - if print_tms == 1: - print(solver.tms, file=f) - f.write('~ ~ ~ ~ ~ ~ ~\n') - - if print_diff ==1: - for j in range(0,len(pbl_vector[i].ANSYSSol)): - f.write('ANSYS Solution name: ' + pbl_vector[i].ANSYSSol[j].solution_name + '\n') - f.write('Absolute error: ' + str(pbl_vector[i].ANSYSSol[j].diff_abs) + '\n') - f.write('Relative error: ' + str(pbl_vector[i].ANSYSSol[j].diff_rel) + '\n') - if j < len(pbl_vector[i].ANSYSSol)-1: - f.write('~ ~ ~ ~\n') - if i < len(pbl_vector)-1: - f.write('--------------------\n') - - #tests are finished - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Tests finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - -if __name__ == "__main__": - main() diff --git a/mirrors/broken/small_mesh_lfs.msh b/mirrors/broken/small_mesh_lfs.msh deleted file mode 100644 index bd152aec..00000000 --- a/mirrors/broken/small_mesh_lfs.msh +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c0f52f9bc0ad07f4d5066bdd15cdf07d47f6b9746d51b2566fa4d86f6ee9896 -size 217328 diff --git a/mirrors/figs/LSP.py b/mirrors/figs/LSP.py deleted file mode 100755 index 02092a8f..00000000 --- a/mirrors/figs/LSP.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - m = 100 - n = 100 - x = 2*(np.arange(0,m) / (m-1.) -0.5) - - Z = np.zeros((m,n)) - - for i in range(0,n): - Z[:,i] = x**i - - U, s, V = np.linalg.svd(Z, full_matrices=True) - - plt.subplot(1,3,1) - for i in range(0,n): - plt.plot(x,Z[:,i]) - - plt.subplot(1,3,2) - plt.semilogy(list(range(1,n+1)),s,'*') - plt.xlabel('i') - plt.ylabel('sigma_i') - - print(V.shape) - print(Z.shape) - plt.subplot(1,3,3) - - ZV = np.dot(Z,np.transpose(V)) - for i in range(0,n): - plt.plot(x,ZV[:,i]) - - plt.show() -if __name__ == "__main__": - main() diff --git a/mirrors/figs/LSP_2.py b/mirrors/figs/LSP_2.py deleted file mode 100755 index d7d5b7bb..00000000 --- a/mirrors/figs/LSP_2.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - m = 100 - n = 100 - x, w = np.polynomial.legendre.leggauss(m) - Z = np.zeros((m,n)) - - for i in range(0,n): - Z[:,i] = x**i - - W = np.zeros((m,m)) - W[:m,:m] = np.diag(w) - - W_sr = np.sqrt(W) - - W_srZ = np.dot(W_sr,Z) - - U, s, V = np.linalg.svd(W_srZ, full_matrices=True) - - plt.subplot(1,3,1) - for i in range(0,n): - plt.plot(x,Z[:,i]) - - plt.subplot(1,3,2) - plt.semilogy(list(range(1,n+1)),s,'*') - plt.xlabel('i') - plt.ylabel('sigma_i') - - print(V.shape) - print(Z.shape) - plt.subplot(1,3,3) - - ZV = np.dot(Z,np.transpose(V)) - for i in range(0,n): - plt.plot(x,ZV[:,i]) - - plt.show() -if __name__ == "__main__": - main() diff --git a/mirrors/figs/LSP_3.py b/mirrors/figs/LSP_3.py deleted file mode 100755 index 20cf2742..00000000 --- a/mirrors/figs/LSP_3.py +++ /dev/null @@ -1,65 +0,0 @@ - -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter - -def main(): - m = 10 - n = 10 - x, w = np.polynomial.legendre.leggauss(m) - - X = np.zeros((m,m)) - Y = np.zeros((m,m)) - phi_1 = np.zeros((m,m)) - - Z_1 = np.zeros((m,n)) - Z_2 = np.zeros((m**2,n**2)) - - for i in range(0,n): - Z_1[:,i] = x**i - - X, Y = np.meshgrid(x, x) - - x_2 = X - y_2 = Y - - x_2 = np.reshape(x_2,(m**2,)) - y_2 = np.reshape(y_2,(m**2,)) - - - for i in range(0,n): - for j in range(0,n): - Z_2[:,j+n*i] = x_2**i*y_2**j - - for i in range(0,m): - for j in range(0,m): - phi_1[i,j] = X[i,j]**1*Y[i,j]**1 - - U_1, s_1, V_1 = np.linalg.svd(Z_1, full_matrices=True) - U_2, s_2, V_2 = np.linalg.svd(Z_2, full_matrices=True) - - plt.figure() - - plt.semilogy(list(range(1,n+1)),s_1,'*') - plt.semilogy(list(range(1,n**2+1)),s_2,'*') - - fig = plt.figure() - ax = fig.gca(projection='3d') - for i in range(0,m): - for j in range(0,m): - ax.scatter(X[i,j], Y[i,j], phi_1[i,j],'*') - - surf = ax.plot_surface(X, Y, phi_1, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - - ax.axis('equal') - plt.show() - -if __name__ == "__main__": - main() diff --git a/mirrors/figs/numpy_matplotlib01.py b/mirrors/figs/numpy_matplotlib01.py deleted file mode 100755 index a3f2a8c6..00000000 --- a/mirrors/figs/numpy_matplotlib01.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - a = np.random.randn(3,3) - print(a) - U, s, V = np.linalg.svd(a, full_matrices=True) - print(U.shape, V.shape, s.shape) - S = np.zeros((3,3)) - S[:3,:3] = np.diag(s) - print(np.allclose(a, np.dot(U, np.dot(S,V)))) - print(a - np.dot(U, np.dot(S,V))) - print(s) - - plt.plot([1,2,3,4]) - plt.ylabel('some numbers') - plt.show() - -if __name__ == "__main__": - main() diff --git a/mirrors/figs/numpy_matplotlib02.py b/mirrors/figs/numpy_matplotlib02.py deleted file mode 100755 index ba877dbe..00000000 --- a/mirrors/figs/numpy_matplotlib02.py +++ /dev/null @@ -1,21 +0,0 @@ - -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import time -import numpy as np -import matplotlib.pyplot as plt - -def main(): - plt.axis([0, 1000, 0, 1]) - plt.ion() - plt.show() - - for i in range(1000): - y = np.random.random() - plt.scatter(i, y) - plt.draw() - #time.sleep(0.005) - -if __name__ == "__main__": - main() diff --git a/mirrors/figs/numpy_matplotlib03.py b/mirrors/figs/numpy_matplotlib03.py deleted file mode 100755 index 3fee85a6..00000000 --- a/mirrors/figs/numpy_matplotlib03.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -import numpy as np -import matplotlib.pyplot as plt - -def main(): - mpl.rcParams['legend.fontsize'] = 10 - - fig = plt.figure() - ax = fig.gca(projection='3d') - theta = np.linspace(-4 * np.pi, 4 * np.pi, 100) - z = np.linspace(-2, 2, 100) - r = z**2 + 1 - x = r * np.sin(theta) - y = r * np.cos(theta) - ax.plot(x, y, z, label='parametric curve') - ax.legend() - - plt.show() - -if __name__ == "__main__": - main() diff --git a/mirrors/models/__init__.py b/mirrors/models/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/mirrors/models/cube_hex.geo b/mirrors/models/cube_hex.geo deleted file mode 100644 index 506ab0fd..00000000 --- a/mirrors/models/cube_hex.geo +++ /dev/null @@ -1,50 +0,0 @@ -// a cube meshed with hex - - -DefineConstant[ Lx = { 1, Min 5, Max 20, Step 1, Name "Lengths/Lx" } ]; -DefineConstant[ Ly = { 1, Min 5, Max 20, Step 1, Name "Lengths/Ly" } ]; -DefineConstant[ Lz = { 1, Min 1, Max 2, Step 1, Name "Lengths/Lz" } ]; - -DefineConstant[ Nx = { 1, Min 1, Max 200, Step 10, Name "Mesh/Nx" } ]; -DefineConstant[ Ny = { 1, Min 1, Max 200, Step 10, Name "Mesh/Ny" } ]; -DefineConstant[ Nz = { 1, Min 1, Max 200, Step 10, Name "Mesh/Nz" } ]; - -lc = 1; // useless -Point(1) = { 0, 0, 0, lc}; -Point(2) = { Lx, 0, 0, lc}; -Point(3) = { Lx, Ly, 0, lc}; -Point(4) = { 0, Ly, 0, lc}; - -Line(1) = {1, 2}; -Line(2) = {2, 3}; -Line(3) = {3, 4}; -Line(4) = {4, 1}; - -Line Loop(5) = {1, 2, 3, 4}; - -Plane Surface(6) = {5}; - -Transfinite Line {1, 3} = Nx+1 Using Progression 1; -Transfinite Line {4, 2} = Ny+1 Using Progression 1; - -Transfinite Surface {6}; -Recombine Surface {6}; -Extrude {0, 0, Lz} { - Surface{6}; Layers{Nz}; Recombine; -} -Physical Volume("Volume") = {1}; - -Physical Surface("FaceZ0") = {6}; -Physical Surface("FaceZ1") = {28}; -Physical Surface("FaceY0") = {15}; -Physical Surface("FaceX1") = {19}; -Physical Surface("FaceY1") = {23}; -Physical Surface("FaceX0") = {27}; - -Physical Line("Line1") = {13}; -Physical Line("Line2") = {14}; -Physical Line("Line3") = {18}; -Physical Line("Line4") = {22}; - - - diff --git a/mirrors/models/cube_hex.py b/mirrors/models/cube_hex.py deleted file mode 100644 index ad5fee5e..00000000 --- a/mirrors/models/cube_hex.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# simplified model of a mirror and a holder -# (two rectangular blocks on top of each other) - -import mirrors as m -import tbox -import tbox.gmsh as gmsh - -def model(p={}): - # configure/build mesh - #pars = {'Lx': p['Lx'], 'Ly': p['Ly'], 'Nx': p['Nx'], 'Ny': p['Ny']} - msh = gmsh.MeshLoader("cube.geo", __file__).execute(**p) - pbl = m.Problem(msh, "thermomechanical", 0.0) - - # configure pbl - m.Medium(pbl, "Volume", "Volume", 330000, 0.36, 0.114, 0.5E-05) - - clamped = tbox.Vector3d(1, 1, 1) - values_clamped = tbox.Vector3d(0, 0, 0) - - XYZ = tbox.Vector3d(1, 1, 1) - X0Y0Z0 = tbox.Vector3d(0., 0., 0.) - - X = tbox.Vector3d(1, 0, 0) - X1Y0Z0 = tbox.Vector3d(1.0, 0.0, 0.0) - - #T = p['T'] - m.uDirichlet(pbl, "FaceX0", - "FaceX0", - XYZ, X0Y0Z0) - m.uDirichlet(pbl, "FaceX1", - "FaceX1", - X, X1Y0Z0) - m.TDirichlet(pbl, "FaceX1", "FaceX1", 0.) - m.TDirichlet(pbl, "FaceX0", "FaceX0", 10.) - - return (pbl, msh) # retourner pbl sinon il semble detruit... - - -def runmodel(**d): - p = {} - p['Lx'] = 10.0 - p['Ly'] = 10.0 - p['Lz'] = 2.0 - p['Nx'] = 10 - p['Ny'] = 10 - p['Nz'] = 3 - p.update(d) - - # builds an instance of the model with given parameters - (pbl, msh) = model(p) - gmshWriter = tbox.GmshExport(msh) - - # retrieves command-line arguments - from fwk.wutils import parseargs - args = parseargs() - - # creates a solver and runs it - from tbox.solvers import LinearSolver - solver = m.Solver(pbl, LinearSolver().mumps(), args.k) - solver.start(gmshWriter) - - if not args.nogui: - from mirrors.viewer import GUI - GUI().open('cube') - - return pbl.Sol - -if __name__ == "__main__": - runmodel() diff --git a/mirrors/models/cube_tri.geo b/mirrors/models/cube_tri.geo deleted file mode 100644 index 44d430c0..00000000 --- a/mirrors/models/cube_tri.geo +++ /dev/null @@ -1,52 +0,0 @@ -// a cube meshed with triangles - - -DefineConstant[ Lx = { 1, Min 5, Max 20, Step 1, Name "Lengths/Lx" } ]; -DefineConstant[ Ly = { 1, Min 5, Max 20, Step 1, Name "Lengths/Ly" } ]; -DefineConstant[ Lz = { 1, Min 1, Max 2, Step 1, Name "Lengths/Lz" } ]; - -DefineConstant[ Nx = { 1, Min 1, Max 200, Step 10, Name "Mesh/Nx" } ]; -DefineConstant[ Ny = { 1, Min 1, Max 200, Step 10, Name "Mesh/Ny" } ]; -DefineConstant[ Nz = { 1, Min 1, Max 200, Step 10, Name "Mesh/Nz" } ]; -//DefineConstant[ lc = { 1, Min 0.1, Max 100, Step 0.1, Name "Mesh/lc" } ]; - -lc = 1; // useless -Point(1) = { 0, 0, 0, lc}; -Point(2) = { Lx, 0, 0, lc}; -Point(3) = { Lx, Ly, 0, lc}; -Point(4) = { 0, Ly, 0, lc}; - -Line(1) = {1, 2}; -Line(2) = {2, 3}; -Line(3) = {3, 4}; -Line(4) = {4, 1}; - -Line Loop(5) = {1, 2, 3, 4}; - -Plane Surface(6) = {5}; - -Transfinite Line {1, 3} = Nx+1 Using Progression 1; -Transfinite Line {4, 2} = Ny+1 Using Progression 1; - -Transfinite Surface {6}; -//Recombine Surface {6}; -Extrude {0, 0, Lz} { - Surface{6}; Layers{Nz}; - //Recombine; -} -Physical Volume("Volume") = {1}; - -Physical Surface("FaceZ0") = {6}; -Physical Surface("FaceZ1") = {28}; -Physical Surface("FaceY0") = {15}; -Physical Surface("FaceX1") = {19}; -Physical Surface("FaceY1") = {23}; -Physical Surface("FaceX0") = {27}; - -Physical Line("Line1") = {13}; -Physical Line("Line2") = {14}; -Physical Line("Line3") = {18}; -Physical Line("Line4") = {22}; - - - diff --git a/mirrors/models/cube_tri.py b/mirrors/models/cube_tri.py deleted file mode 100644 index 1bbb35bd..00000000 --- a/mirrors/models/cube_tri.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# simplified model of a mirror and a holder -# (two rectangular blocks on top of each other) - -import mirrors as m -import tbox -import tbox.gmsh as gmsh - -def model(p={}): - # configure/build mesh - msh = gmsh.MeshLoader("cube_tri.geo", __file__).execute(**p) - pbl = m.Problem(msh, "thermomechanical", 0.0) - - # configure pbl - m.Medium(pbl, "Volume", "Volume", 330000, 0.36, 0.114, 0.5E-05) - - clamped = tbox.Vector3d(1, 1, 1) - values_clamped = tbox.Vector3d(0, 0, 0) - - XYZ = tbox.Vector3d(1, 1, 1) - X0Y0Z0 = tbox.Vector3d(0., 0., 0.) - - X = tbox.Vector3D(1, 0, 0) - X1Y0Z0 = tbox.Vector3d(1.0, 0.0, 0.0) - - #T = p['T'] - m.uDirichlet(pbl, "FaceX0", - "FaceX0", - XYZ, X0Y0Z0) - m.uDirichlet(pbl, "FaceX1", - "FaceX1", - X, X1Y0Z0) - m.TDirichlet(pbl, "FaceX1", "FaceX1", 0.) - m.TDirichlet(pbl, "FaceX0", "FaceX0", 10.) - - return (pbl, msh) # retourner pbl sinon il semble detruit... - - -def runmodel(**d): - p = {} - p['Lx'] = 10.0 - p['Ly'] = 10.0 - p['Lz'] = 2.0 - p['Nx'] = 10 - p['Ny'] = 10 - p['Nz'] = 3 - p.update(d) - - # builds an instance of the model with given parameters - (pbl, msh) = model(p) - gmshWriter = tbox.GmshExport(msh) - - # retrieves command-line arguments - from fwk.wutils import parseargs - args = parseargs() - - # creates a solver and runs it - from tbox.solvers import LinearSolver - solver = m.Solver(pbl, LinearSolver().mumps(), args.k) - solver.start(gmshWriter) - - if not args.nogui: - from mirrors.viewer import GUI - GUI().open('cube_tri') - - return pbl.Sol - -if __name__ == "__main__": - runmodel() diff --git a/mirrors/models/mirror.geo b/mirrors/models/mirror.geo deleted file mode 100644 index 59f67fa0..00000000 --- a/mirrors/models/mirror.geo +++ /dev/null @@ -1,85 +0,0 @@ -// a mirror+holder meshed with hex - - -DefineConstant[ L = { 1, Min 50, Max 500, Step 1, Name "Lengths/L" } ]; -DefineConstant[ L_1 = { 1, Min 50, Max 250, Step 1, Name "Lengths/L_1" } ]; -DefineConstant[ H = { 1, Min 10, Max 100, Step 1, Name "Lengths/H" } ]; -DefineConstant[ H_1 = { 1, Min 1, Max 20, Step 1, Name "Lengths/H_1" } ]; -DefineConstant[ W = { 1, Min 25, Max 250, Step 1, Name "Lengths/W" } ]; - -DefineConstant[ nL = { 1, Min 1, Max 51, Step 1, Name "Mesh/nL" } ]; -DefineConstant[ nL_1 = { 1, Min 1, Max 51, Step 1, Name "Mesh/nL_1" } ]; -DefineConstant[ nH = { 1, Min 1, Max 51, Step 1, Name "Mesh/nH" } ]; -DefineConstant[ nH_1 = { 1, Min 1, Max 51, Step 1, Name "Mesh/nH_1" } ]; -DefineConstant[ nW = { 1, Min 1, Max 51, Step 1, Name "Mesh/nW" } ]; - -lc = 1; // useless - -Point(1) = { 0, 0, 0, lc}; -Point(2) = { 0, 0, H, lc}; -Point(3) = { L_1, 0, 0, lc}; -Point(4) = { L_1, 0, H, lc}; -Point(5) = { L_1, 0, H+H_1, lc}; -Point(6) = { L+L_1, 0, 0, lc}; -Point(7) = { L+L_1, 0, H, lc}; -Point(8) = { L+L_1, 0, H+H_1, lc}; - -Line(1) = {2, 1}; -Line(2) = {1, 3}; -Line(3) = {4, 2}; -Line(4) = {3, 4}; -Line(5) = {4, 5}; -Line(6) = {3, 6}; -Line(7) = {7, 4}; -Line(8) = {5, 8}; -Line(9) = {6, 7}; -Line(10) = {8, 7}; - -Transfinite Line {6,7,8} = nL Using Progression 1; -Transfinite Line {2,3} = nL_1 Using Progression 1; -Transfinite Line {1,4,9} = nH Using Progression 1; -Transfinite Line {5,10} = nH_1 Using Progression 1; - -Line Loop(11) = {2, 4, 3, 1}; -Plane Surface(12) = {11}; -Transfinite Surface {12}; -Recombine Surface {12}; - -Line Loop(13) = {6,9,7,-4}; -Plane Surface(14) = {13}; -Transfinite Surface {14}; -Recombine Surface {14}; - -Line Loop(15) = {7, 10, 8, 5}; -Plane Surface(16) = {15}; -Transfinite Surface {16}; -Recombine Surface {16}; - - -Extrude {0, W, 0} -{ - Surface{12}; Layers{nW}; Recombine; -} - -Extrude {0, W, 0} -{ - Surface{14}; Layers{nW}; Recombine; -} - -Extrude {0, W, 0} -{ - Surface{16}; Layers{nW}; Recombine; -} - -// physical entities - -Physical Line("Vertical clamped line") = {1}; -Physical Line("Horizontal clamped line") = {23}; -Physical Surface("Clamped Side") = {37}; -Physical Surface("Mirror Side") = {77}; -Physical Volume("Holder") = {1, 2}; -Physical Volume("Mirror") = {3}; - - - - diff --git a/mirrors/models/mirror_ss.py b/mirrors/models/mirror_ss.py deleted file mode 100755 index accf03a0..00000000 --- a/mirrors/models/mirror_ss.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# simplified model of a mirror and a holder -# (two rectangular blocks on top of each other) - -import mirrors as m -import tbox -import tbox.gmsh as gmsh - -def model(p={}): - # configure/build mesh - - # [RB] what is the purpose of this dictionnary - # why couldn't we use "p" instead?? - pars = { 'L' : p['L'] , - 'L_1' : p['L_1'], - 'H' : p['H'], - 'H_1' : p['H_1'], - 'W' : p['W'], - 'nL' : p['nL'], - 'nL_1' : p['nL_1'], - 'nH' : p['nH'], - 'nH_1' : p['nH_1'], - 'nW' : p['nW'] } - - msh = gmsh.MeshLoader("mirror.geo", __file__).execute(**pars) - pbl = m.Problem(msh, "thermomechanical", 22) - - # configure pbl - m.Medium(pbl, "Holder", "TZM", 330000, 0.36, 0.114, 0.5E-05) - m.Medium(pbl, "Mirror", "ScMo", 330000, 0.36, 0.114, 0.4E-05) - - clamped = tbox.Vector3d(1, 1, 1) - values_clamped = tbox.Vector3d(0, 0, 0) - - xyclamped = tbox.Vector3d(1, 1, 0) - xzclamped = tbox.Vector3d(1, 0, 1) - - T = p['T'] - m.uDirichlet(pbl, "Vertical clamped line", - "Vertical clamped line_name", - xyclamped, values_clamped) - m.uDirichlet(pbl, "Horizontal clamped line", - "Horizontal clamped line_name", - xzclamped, values_clamped) - m.TDirichlet(pbl, "Clamped Side", "Clamped", T) - - return (pbl, msh) # retourner pbl sinon il semble detruit... - - -def runmodel(**d): - - p={} - p['L'] = 250.0 - p['L_1'] = 250.0 - p['H'] = 50.0 - p['H_1'] = 30.0 - p['W'] = 150.0 - p['nL'] = 21 - p['nL_1'] = 21 - p['nH'] = 6 - p['nH_1'] = 3 - p['nW'] = 25 - p['T'] = 70. - p['nogui'] = False - p.update(d) - - # builds an instance of the model with given parameters - (pbl, msh) = model(p) - gmshWriter = tbox.GmshExport(msh) - - # retrieves command-line arguments - from fwk.wutils import parseargs - args = parseargs() - - # creates a solver and runs it - from tbox.solvers import LinearSolver - solver = m.Solver(pbl, LinearSolver().mumps(), args.k) - solver.start(gmshWriter) - - if not args.nogui and not p['nogui']: - from mirrors.viewer import GUI - GUI().open('mirror') - - return pbl.Sol - -if __name__ == "__main__": - runmodel() diff --git a/mirrors/mparams/mparams.py b/mirrors/mparams/mparams.py deleted file mode 100755 index 6db01c34..00000000 --- a/mirrors/mparams/mparams.py +++ /dev/null @@ -1,341 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - - -import numpy as np -import os -import shutil - - -import params.src.write as write -import params.src.plot as plot -import params.src.indices as indices - - -def model(P): - - import mirrors.models.mirror_ss as mirror_model - - sol = mirror_model.runmodel(L = P[0], L_1 = P[1], H = P[2], H_1 = P[3], W = P[4], nL_1 = P[5], nL = P[6], nH = P[7], nH_1 = P[8], nW = P[9], T = P[10]) - - return sol - -def main(): - #-------------------------------------------------------- - normalisation = True - #-------------------------------------------------------- - fname = 'mparams.log' - #-------------------------------------------------------- - L = 250.0 - L_1 = 250.0 - H = 50 - H_1 = 30 - W = 150 - #-------------------------------------------------------- - nL_1 = 11 - nL = 11 - nH = 6 - nH_1 = 6 - nW = 5 - #-------------------------------------------------------- - T = 70 - #-------------------------------------------------------- - d = 2 - - P = np.array([L, L_1, H, H_1, W, nL_1, nL, nH, nH_1, nW, T]) - P_indices = np.array([10, 3], dtype =np.int) - - M = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 3 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - #-------------------------------------------------------- - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 3 - - k = 9 - #-------------------------------------------------------- - from params.src.monomials import phi # monomials or legendre - import params.src.gauss as tp # just gauss - imported_sol = np.array([]) - imported_c = np.array([]) - imported_cs = np.array([]) - from mirrors.mparams_sols.s30x30 import import_sol # not usefull if recomputed - from mirrors.mparams_sols.s30x30_c_QR_pre_30x30 import import_c - #imported_sol, d, M, Dom_min, Dom_max = import_sol() - #imported_c, imported_cs, N, normalisation = import_c() - solver = 'SVD' # norm_eq, Cholesky, QR, SVD, TSVD - save = False - #-------------------------------------------------------- - m1 = 40 - m2 = 40 - #--------------- - - #d = 1 - #M = np.zeros((d,), dtype =np.int) - #for j in range(0,d): - # M[j] = 30 - #N = np.zeros((d,), dtype =np.int) - #for j in range(0,d): - # N[j] = 30 - #======================================================== - - f = write.init(fname) - - X, w = tp.grid(M) - - m_max = 1 - n_max = 1 - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - fig, ax, current_title = plot.init(d) - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - if normalisation == True: - for j in range(0,d): - xi[j] = X[i[j],j] - elif normalisation == False: - for j in range(0,d): - xi[j] = X[i[j],j] - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - P[P_indices[j]] = xi[j] - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - if normalisation == True: - for j in range(0,d): - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - P[P_indices[j]] = xi[j] - - if imported_sol.size == 0: - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - sol[m_i] = model(P) - os.chdir('..') - plot.scatter(xi,sol[m_i],d,fig,ax, True,m_i) - - elif imported_sol.size != 0: - sol[m_i] = imported_sol[m_i] - #plot.scatter(xi,sol[m_i],d,fig,ax, False,m_i) - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - p,i = indices.my_next(p,i,M,d) - m_i = m_i + 1 - - - - #------------------ - - x = np.linspace(-1.,1.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - #------------------ - for i in range(0,m1): - for j in range(0,m2): - if normalisation == False: - X[i,j] = Dom_min[0] + (Dom_max[0] - Dom_min[0])*(X[i,j]+1.)/2. - Y[i,j] = Dom_min[1] + (Dom_max[1] - Dom_min[1])*(Y[i,j]+1.)/2. - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - phi_tmp[i,j,:] = phi(xi,N,n_max,d) - - if normalisation == True: - for i in range(0,m1): - for j in range(0,m2): - X[i,j] = Dom_min[0] + (Dom_max[0] - Dom_min[0])*(X[i,j]+1.)/2. - Y[i,j] = Dom_min[1] + (Dom_max[1] - Dom_min[1])*(Y[i,j]+1.)/2. - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - V = np.transpose(V_t) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - if solver == 'norm_eq': - ZWZ = np.dot(np.transpose(Z),np.dot(W,Z)) - rhs = np.dot(np.transpose(Z),np.dot(W,sol)) - s_hat = np.linalg.solve(ZWZ, rhs) - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - #plot.surf(X, Y, surrogate, sol, fig, ax, current_title, True, True, 'Surrogate model','surrogate.png',d) - - elif solver == 'Cholesky': - ZWZ = np.dot(np.transpose(Z),np.dot(W,Z)) - rhs = np.dot(np.transpose(Z),np.dot(W,sol)) - R = np.linalg.cholesky(ZWZ) - tmp = np.linalg.solve(np.transpose(R), rhs) - s_hat = np.linalg.solve(R, tmp) - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - #plot.surf(X, Y, surrogate, sol, fig, ax, current_title, True, True, 'Surrogate model','surrogate.png',d) - - elif solver == 'QR': - W_srZ = np.dot(W_sr,Z) - Q, R = np.linalg.qr(W_srZ) - rhs = np.dot(np.transpose(Q),np.dot(W_sr,sol)) - s_hat = np.linalg.solve(R, rhs) - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - #plot.surf(X, Y, surrogate, sol, fig, ax, current_title, True, True, 'Surrogate model','surrogate.png',d) - - - - elif solver == 'SVD': - #W_srZ = np.dot(W_sr,Z) - #U, s, V_t = np.linalg.svd(W_srZ, full_matrices=False) - - - V = np.transpose(V_t) - - rhs = np.dot(np.transpose(U),np.dot(W_sr,sol)) - s_hat = np.dot(V,np.linalg.solve(S, rhs)) - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - #plot.surf(X, Y, surrogate, sol, fig, ax, current_title, True, True, 'Surrogate model','surrogate.png',d) - - elif solver == 'TSVD': - #W_srZ = np.dot(W_sr,Z) - #U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - for jj in range(0,min(n_max,k)): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - plot.surf(X, Y, surrogate, sol, fig, ax, current_title, False, save, 'Surrogate model with $k = ' + str(jj+1) +'$','surrogate' + str(jj+1) + '.png',d) - - #plot.surf(X, Y, surrogate, sol, fig, ax, current_title, True, True, 'Surrogate model with $k = ' + str(jj+1) +'$','surrogate' + str(jj+1) + '.png',d) - - - #---------------------- - #s_1 = np.array([1.56657114908, 1.11460642267, 0.643552021341, 0.352673584151, 0.157153535614, 0.0769603917451, 0.0265674123834, 0.0120471071617, 0.00282921208345, 0.00120678298737]) - s_1 = np.array([1.61820129502, 1.25403803215, 0.852380849704, 0.541995080368, 0.320759977206, 0.188184793223, 0.102611498787, 0.0571855117691, 0.0290259910435, 0.0155199291833, 0.00734487330744, 0.00378954767668, 0.00166939903549, 0.000834429285046, 0.000340818529243, 0.000165534152138, 6.22971490317e-05, 2.94723359133e-05, 1.01274211329e-05, 4.67622340761e-06, 1.44805698661e-06, 6.53687563397e-07, 1.78871573953e-07, 7.90594553641e-08, 1.85213020878e-08, 8.02554270891e-09, 1.51844326981e-09, 6.45791166698e-10, 8.54979264514e-11, 3.57263540233e-11]) - s_2 = np.zeros((900,)) - kk = 0 - for ii in range(0,30): - for jj in range(0,30): - s_2[kk] = s_1[ii]*s_1[jj] - kk = kk + 1 - #plot.SVD(900,-np.sort(-s_2)) - #plot.SVD(n_max,s) - c = np.dot(V_t,s_hat) - #fig, ax = plot.plot2D(range(1,n_max+1),c,'$i [-]$','$c_i [-]$',"c_i.png") - if imported_c.size != 0: - #plot.add2D(range(1,n_max+1),imported_c,'ro',"c_i2.png") - tmp = imported_c - for jj in range(0,n_max): - tmp[jj] = tmp[jj] - c[jj] - #fig, ax = plot.plot2D(range(1,n_max+1),tmp,'$i [-]$','$dc_i [-]$',"dc_i.png") - - cs = np.dot(S,c) - #fig, ax = plot.plot2D(range(1,n_max+1),cs,'$i [-]$','$c_i \sigma_i [-]$',"c_i_s_i.png") - if imported_cs.size != 0: - #plot.add2D(range(1,n_max+1),imported_cs,'ro',"cs_i2.png") - tmp = imported_cs - for jj in range(0,n_max): - tmp[jj] = tmp[jj] - cs[jj] - #fig, ax = plot.plot2D(range(1,n_max+1),tmp,'$i [-]$','$dc_i \sigma_i [-]$',"dc_i_s_i.png") - - ZWZ = np.dot(np.transpose(Z),np.dot(W,Z)) - write.col(f, np.diag(ZWZ), n_max) - - write.col(f, V[:,1], n_max) - print(max(np.diag(ZWZ))) - print(max(s)) - #---------------------- - - write.sol(f, sol, m_max) - write.c(f, c, n_max) - write.c(f, s, n_max) - write.cs(f, cs, n_max) - write.finish(f) - plot.finish() - - -if __name__ == "__main__": - main() diff --git a/mirrors/mparams_sols/__init__.py b/mirrors/mparams_sols/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/mirrors/mparams_sols/s10x10.py b/mirrors/mparams_sols/s10x10.py deleted file mode 100755 index 80f63c27..00000000 --- a/mirrors/mparams_sols/s10x10.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - - - -def import_sol(): - - d = 2 - M = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - tmp = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - return tmp, d, M, Dom_min, Dom_max - diff --git a/mirrors/mparams_sols/s10x10_c_QR_10x10.py b/mirrors/mparams_sols/s10x10_c_QR_10x10.py deleted file mode 100755 index 80b6383f..00000000 --- a/mirrors/mparams_sols/s10x10_c_QR_10x10.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - - - -def import_c(): - normalisation = False - - d = 2 - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 10 - - k = 100 - - c = np.array([-5.82682920324e-17, -1.5713916516e-14, -4.74990860585e-13, -1.10354458529e-12, -3.50252614301e-11, -8.13094642299e-11, -7.02748635902e-10, 1.00017190911e-09, -4.86936104202e-09, 5.44916317234e-09, -2.0686404243e-08, -1.50995895897e-07, 1.83964963883e-07, 8.37369865032e-06, 1.58372987757e-06, 4.68342052458e-06, -5.57888379078e-06, -2.28123716609e-07, 3.52764628055e-05, 0.000196943696423, 2.27855372053e-06, 0.000446613224899, 0.000112738852078, 0.000601295479806, 0.000280927861505, 0.00846974366676, 0.0128614580408, -0.000613648098177, 0.0816222819008, -0.00111039239719, 0.0169630576489, 0.02142324974, -0.0624789472968, -0.079913049397, -0.00176560592372, 0.00189129450242, 0.00230652928733, -0.000695512124507, -0.00107300872596, 6.87106079013e-05, -4.13610771382e-05, 0.000116813511967, -5.91827989618e-05, -6.23650116722e-06, -0.000225431717919, -0.000796807713855, 0.00185816171555, -0.00279820043803, -0.00254410073367, -0.0030455166794, 0.00422038265912, 0.011568069723, -0.0185759416791, -0.0981106569351, 0.0578554914335, -0.0423434888958, 0.0289005210883, -0.0297325028642, -0.136600661067, -0.0534582076645, -0.0173156464507, 0.869729651895, 5.08964696754, 13.8240181543, -13.1065699533, -13.5900008746, -17.5689911927, 0.316669104987, 2.4536848517, -2.12459660817, -1.24555087413, 0.349798917726, -0.688866122596, -0.0741157777147, -0.0442864226889, -0.473846710549, 0.250993706259, 1.45723512065, 8.9818139889, -19.7070659602, -13.1885326692, 9.41225342922, 1.25547260895, -0.267028858142, 0.710784728799, 0.592134367628, 0.312321636281, 0.139053109704, -0.586437080723, 1.16529807049, 1.27466208186, -2.72101315529, -2.0459003238, -4.62723172591, -12.2169102824, -1.42862375173, -1.34464259362, 4.08032670458, 0.148901732091, 3.93150893568]) - - cs = np.array([-1.6624040385e+14, -2.67098732633e+14, -2.65310675591e+14, -2.7006780428e+14, -2.31767664105e+14, -2.70578733905e+14, -2.21160372452e+14, 2.62359112436e+14, -2.33302869943e+14, 1.38814173259e+14, -5.66256506957e+13, -2.35977030763e+14, 2.38326180432e+14, 2.17076974602e+15, 3.59185821475e+14, 2.88559669126e+14, -1.25529976521e+14, -3.96501069572e+12, 1.75935793807e+14, 2.66111258568e+14, 1.62977415441e+12, 2.7171914632e+14, 6.04180886843e+13, 1.86707151198e+14, 1.4257929527e+13, 2.45073173336e+14, 2.50212150477e+14, -2.08818510362e+12, 2.00041280302e+14, -1.91412592609e+12, 7.71854953768e+12, 9.35895316536e+12, -1.7196708084e+13, -2.199527108e+13, -4.85965448769e+11, 5.20559978462e+11, 6.3484921814e+11, -1.91432786427e+11, -2.95334966902e+11, 18911910611.2, -11384224612.6, 32151755951.1, -16289476077.6, -1716534843.79, -62047835529.6, -2.19313388703e+11, 5.11440508808e+11, -7.70176806354e+11, -7.0023839303e+11, -8.3824813904e+11, 1.16161830076e+12, 3.18399599751e+12, -5.11284296971e+12, -2.70039813448e+13, 1.59241478976e+13, -1.16546236661e+13, 7.95458064091e+12, -8.18357533993e+12, -3.75979717023e+13, -1.47138393279e+13, -4.76595925801e+12, 2.39384425999e+14, 1.4008746456e+15, 3.80492333872e+15, -3.60745286567e+15, -3.74051241281e+15, -4.83568987545e+15, 8.71600177869e+13, 6.75352321871e+14, -5.84774059869e+14, -3.42825475028e+14, 9.62786688398e+13, -1.89603540581e+14, -2.03996297781e+13, -1.21893968452e+13, -1.30421588558e+14, 6.90835182763e+13, 4.01089455951e+14, 2.4721548604e+15, -5.42417366447e+15, -3.63001228705e+15, 2.59062903007e+15, 3.45556333736e+14, -7.34970341557e+13, 1.95636418675e+14, 1.62979088272e+14, 8.59634203173e+13, 3.82729837685e+13, -1.61410966784e+14, 3.20736689974e+14, 3.50838045069e+14, -7.48931775404e+14, -5.63113691246e+14, -1.27359945502e+15, -3.3625829004e+15, -3.93214461564e+14, -3.70099484071e+14, 1.12306929393e+15, 3.8582392851e+13, 4.93305562782e+14]) - - return c, cs, N, normalisation - diff --git a/mirrors/mparams_sols/s10x10_c_QR_pre_10x10.py b/mirrors/mparams_sols/s10x10_c_QR_pre_10x10.py deleted file mode 100644 index b41383e6..00000000 --- a/mirrors/mparams_sols/s10x10_c_QR_pre_10x10.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - - - -def import_c(): - normalisation = True - - d = 2 - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 10 - - k = 100 - - c = np.array([-60.6395343375, -12.617111829, 24.0354306606, 0.746989195503, -43.5236105144, 0.292183638664, -13.5045697794, 2.27491271929, 19.4241763369, -16.1409193693, 15.618959293, -0.0192733582025, -1.23164141339, -11.9874035983, 0.157582901452, -5.46483644588, 11.5103415561, 3.65389013766, 0.874302758327, 0.945087984037, 0.46287461314, -11.1796956002, 2.44006089508, -5.57302554943, 0.931556542996, -1.29223178275, -2.88865551773, -1.96863800111, -0.669156333736, -5.61162787579, 1.42208340467, -4.06767420994, -1.60486379946, -0.8002962115, -0.65158052848, -1.35934638968, -1.1848210136, 2.76417697581, 4.16954044662, 0.888226614394, 2.00905634102, -1.24949956089, 1.4128951455, -0.113977908115, -1.54740202373, 0.27323689688, -1.64279288349, -0.56164464093, -2.48267013876, -0.61411608851, 12.9796608272, -18.4642227896, 1.66170236736, 0.556816345604, -0.275688548714, 0.54054725564, -5.48286032615, -8.46328218734, 0.675152669927, -0.216371906902, -0.146975925231, -0.686723553849, -14.2059875132, -33.075436325, 10.9592039314, -3.56238772771, 6.21349126582, 14.8341167315, 2.63425001737, 8.98303240091, 0.655050119131, -0.376082175966, -17.4747719256, 5.69484580738, 0.103954588935, -3.18170350568, -0.174940561639, -10.1418778541, -10.956779408, -0.0652909688205, -0.198375670191, -3.87205892062, -0.805584868953, 4.3046327698, -2.70173790972, 0.187084350759, 4.921339573, 3.94555895942, 0.581541707329, 0.0620755450676, -0.0936568530615, 0.996732391465, 0.615004915942, -0.701523537969, -1.15776009662, 1.09928671477, -0.0667482768719, 0.168589594781, -0.0648581694279, -0.235484366326]) - - cs = np.array([-148.81822001, -22.0308684707, 41.9685121841, 0.92802014272, -43.879199699, 0.29457078763, -9.68692535588, 1.63181131002, 10.7316294246, -8.91766848897, 6.46873575079, -0.0075762075867, -0.484148684529, -2.95120520263, 0.0387956803821, -1.24032003495, 2.61243083531, 0.640031254907, 0.153146665745, 0.117548774161, 0.0558059821471, -1.34786803027, 0.246779158946, -0.563636161969, 0.0799094297546, -0.110848349085, -0.160100556475, -0.109109597022, -0.0331419853835, -0.277932793371, 0.0591867440429, -0.169295550122, -0.0475235614056, -0.0236985382576, -0.0176851317179, -0.0368952399603, -0.0292618015318, 0.0521673460104, 0.0786902796338, 0.015186465146, 0.0343498647809, -0.0167780089835, 0.0189720494396, -0.00137851694135, -0.018715204903, 0.00256012713611, -0.0153923525265, -0.00435439729525, -0.0192479930358, -0.00363734934596, 0.0575279598097, -0.0818364270609, 0.00706006896805, 0.0023657436372, -0.00115104456971, 0.00225687278699, -0.0172899695352, -0.0266886045755, 0.00138044311846, -0.000442402323528, -0.000278261506756, -0.00130013626734, -0.0268565815013, -0.0625294898032, 0.0199539174619, -0.00648620019583, 0.00835769296533, 0.0199531934222, 0.00262842401991, 0.00896316521915, 0.000607329774653, -0.000348684622, -0.0135713907201, 0.00442277460739, 7.33739973037e-05, -0.00141465118234, -7.77821918105e-05, -0.0043163880975, -0.00466321059114, -2.08970577752e-05, -6.34922090461e-05, -0.000843091539708, -0.000175405850338, 0.000816374522469, -0.000512385170545, 2.71520739716e-05, 0.000457066910141, 0.000366441781879, 4.37114917928e-05, 4.66589866996e-06, -3.19218342945e-06, 3.39724485676e-05, 1.97177348994e-05, -2.2491617203e-05, -1.68317987432e-05, 1.5981698452e-05, -5.34282644947e-07, 5.75606182712e-07, -2.21441681325e-07, -3.42941811848e-07]) - - return c, cs, N, normalisation - diff --git a/mirrors/mparams_sols/s30x30.py b/mirrors/mparams_sols/s30x30.py deleted file mode 100755 index 9857817b..00000000 --- a/mirrors/mparams_sols/s30x30.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - - - -def import_sol(): - - d = 2 - M = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 30 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - tmp = np.array([ 35.45819624, 36.05702593, 37.12770234, 38.6591168 , 40.63506558, 43.03461026, 45.83231747, 48.99853179, 52.49969104, 56.2986823 , 60.35523548, 64.62635018, 69.06675159, 73.62937038, 78.2658417 , 82.92701781, 87.56348913, 92.12610792, 96.56650932,100.83762403,104.8941772 ,108.69316847,112.19432772,115.36054204,118.15824924,120.55779393,122.53374271,124.06515717,125.13583357,125.73466327, 35.34200729, 35.93887475, 37.00604278, 38.53243912, 40.50191314, 42.89359503, 45.68213474, 48.83797405, 52.32766075, 56.11420353, 60.15746425, 64.41458342, 68.84043458, 73.38810264, 78.00938123, 82.65528367, 87.27656226, 91.82423032, 96.25008148,100.50720065,104.55046137,108.33700415,111.82669085,114.98253016,117.77106987,120.16275176,122.13222578,123.65862212,124.72579015,125.32265761, 35.1358186 , 35.72920388, 36.79014594, 38.30763714, 40.26562106, 42.64334964, 45.41562074, 48.55304858, 52.02237611, 55.78682784, 59.80649978, 64.03878251, 68.43881282, 72.95994935, 77.55426695, 82.17306474, 86.76738234, 91.28851887, 95.68854919, 99.92083191,103.94050385,107.70495558,111.17428311,114.31171095,117.08398205,119.46171063,121.41969455,122.93718575,123.99812781,124.59151309, 34.84433479, 35.43279739, 36.48493797, 37.98984018, 39.93158083, 42.28958398, 45.03885655, 48.15025655, 51.59080283, 55.32402498, 59.31035006, 63.50752212, 67.87105015, 72.35467971, 76.91088323, 81.49136386, 86.04756739, 90.53119695, 94.89472498, 99.09189704,103.07822212,106.81144427,110.25199055,113.36339055,116.11266312,118.47066626,120.41240691,121.91730913,122.96944971,123.55791231, 34.50894427, 35.09174269, 36.133756 , 37.62417294, 39.54722356, 41.88252999, 44.60533973, 47.68679127, 51.09422093, 54.79150934, 58.73946446, 62.89623708, 67.21776443, 71.65823727, 76.17058554, 80.70697723, 85.21932549, 89.65979834, 93.98132569, 98.13809831,102.08605343,105.78334184,109.1907715 ,112.27222304,114.99503278,117.33033921,119.25338983,120.74380677,121.78582008,122.3686185 , 34.13482126, 34.71130136, 35.74201785, 37.21627669, 39.11847887, 41.42846747, 44.12175831, 47.16980281, 50.54029138, 54.19749625, 58.10265027, 62.21435793, 66.48903415, 70.88136634, 75.34479473, 79.83200588, 84.29543427, 88.68776646, 92.96244268, 97.07415034,100.97930436,104.63650923,108.0069978 ,111.0550423 ,113.74833314,116.05832173,117.96052392,119.43478275,120.46549924,121.04197935, 33.71860844, 34.28805941, 35.30620817, 36.76249106, 38.64149931, 40.92332174, 43.58377274, 46.59465182, 49.92404333, 53.53665516, 57.39419285, 61.45576561, 65.67831984, 70.01709544, 74.42610033, 78.85859801, 83.2676029 , 87.6063785 , 91.82893272, 95.89050549, 99.74804318,103.360655 ,106.69004652,109.70092559,112.3613766 ,114.64319903,116.52220728,117.97849017,118.99663893,119.56608989, 33.2717031 , 33.83360658, 34.83826082, 36.27524219, 38.12934613, 40.38092536, 43.00611483, 45.9770878 , 49.26235167, 52.82708206, 56.63349206, 60.64123288, 64.80782151, 69.08909111, 73.4396592 , 77.81340869, 82.16397678, 86.44524638, 90.61183501, 94.61957583, 98.42598583,101.99071622,105.27598009,108.24695306,110.87214253,113.12372176,114.9778257 ,116.41480707,117.41946131,117.98136479, 32.8049243 , 33.35894466, 34.34950431, 35.76632583, 37.59441798, 39.81440912, 42.40276902, 45.33206131, 48.57123522, 52.08595493, 55.83896365, 59.79047866, 63.89861295, 68.11981933, 72.40935198, 76.72174081, 81.01127346, 85.23247984, 89.34061413, 93.29212914, 97.04513786,100.55985757,103.79903148,106.72832377,109.31668367,111.53667481,113.36476696,114.78158848,115.77214813,116.32616849, 32.32802254, 32.87398883, 33.85014821, 35.24637268, 37.04788894, 39.23560695, 41.78633854, 44.67304624, 47.86513064, 51.32875509, 55.02720443, 58.92127426, 62.96968653, 67.1295271 , 71.35670065, 75.60639811, 79.83357166, 83.99341222, 88.04182449, 91.93589433, 95.63434367, 99.09796812,102.29005252,105.17676022,107.72749181,109.91520982,111.71672608,113.11295055,114.08910993,114.63507622, 31.84938619, 32.38726912, 33.34897585, 34.72452836, 36.49937205, 38.65469954, 41.16766598, 44.01163419, 47.15645781, 50.56880115, 54.21249267, 58.04890839, 62.03738142, 66.13563298, 70.30022061, 74.48699867, 78.6515863 , 82.74983786, 86.73831089, 90.57472661, 94.21841813, 97.63076147,100.77558509,103.6195533 ,106.13251974,108.28784723,110.06269092,111.43824343,112.39995016,112.93783309, 31.37594228, 31.90582952, 32.85324041, 34.2083452 , 35.95680569, 38.08009405, 40.55570502, 43.35739739, 46.45547293, 49.8170915 , 53.40661922, 57.18600628, 61.11519031, 65.152521 , 69.25520167, 73.37974291, 77.48242358, 81.51975427, 85.4489383 , 89.22832536, 92.81785309, 96.17947165, 99.27754719,102.07923956,104.55485053,106.67813889,108.42659938,109.78170417,110.72911506,111.25900231, 30.91321738, 31.43528997, 32.36872867, 33.7038487 , 35.42652331, 37.51849792, 39.95759917, 42.71797285, 45.77035872, 49.08240093, 52.61899116, 56.34264073, 60.21387809, 64.19166719, 68.2338425 , 72.297556 , 76.33973131, 80.31752041, 84.18875777, 87.91240734, 91.44899757, 94.76103978, 97.81342565,100.57379933,103.01290058,105.10487519,106.8275498 ,108.16266983,109.09610853,109.61818113, 30.46550571, 30.9800172 , 31.89993704, 33.21572072, 34.91344608, 36.97512293, 39.37889903, 42.09929461, 45.10747321, 48.3715476 , 51.8569179 , 55.52663839, 59.34180918, 63.26198853, 67.24562161, 71.25048092, 75.234114 , 79.15429335, 82.96946414, 86.63918463, 90.12455493, 93.38862932, 96.39680792, 99.1172035 ,101.5209796 ,103.58265645,105.28038181,106.59616549,107.51608533,108.03059682, 30.03608805, 30.5433474 , 31.45030078, 32.74753821, 34.42133378, 36.45395086, 38.82384524, 41.50589628, 44.47167398, 47.68974055, 51.12598383, 54.74397885, 58.50537401, 62.37029762, 66.29778055, 70.24619054, 74.17367348, 78.03859709, 81.79999225, 85.41798726, 88.85423054, 92.07229712, 95.03807481, 97.72012585,100.09002023,102.12263731,103.79643288,105.09367032,106.00062369,106.50788304, 29.62745443, 30.12781264, 31.02242714, 32.30201598, 33.95303996, 35.95800379, 38.29565633, 40.94121873, 43.86664774, 47.04093331, 50.43042734, 53.99920042, 57.70942272, 61.52176499, 65.39581548, 69.29050832, 73.16455881, 76.97690109, 80.68712338, 84.25589646, 87.64539049, 90.81967606, 93.74510508, 96.39066747, 98.72832002,100.73328384,102.38430783,103.66389667,104.55851116,105.05886937, 29.24149934, 29.73533942, 30.61829982, 31.88121953, 33.51073573, 35.48958101, 37.79678109, 40.4078799 , 43.29519953, 46.42813387, 49.77347316, 53.29575605, 56.9576455 , 60.72032461, 64.54390808, 68.38786499, 72.21144846, 75.97412757, 79.63601702, 83.15829991, 86.5036392 , 89.63657354, 92.52389317, 95.13499198, 97.44219206, 99.42103734,101.05055354,102.31347325,103.19643365,103.69027373, 28.8796751 , 29.36740457, 30.23943953, 31.48673231, 33.09608543, 35.05044516, 37.32909674, 39.90788672, 42.75947964, 45.85364814, 49.15759335, 52.63629272, 56.25287121, 59.96899223, 63.745264 , 67.5416571 , 71.31792887, 75.03404989, 78.65062838, 82.12932775, 85.43327297, 88.52744146, 91.37903438, 93.95782436, 96.23647594, 98.19083567, 99.80018879,101.04748157,101.91951653,102.407246 , 28.54310206, 29.02514737, 29.88701936, 31.11977578, 32.71037299, 34.64195598, 36.89405142, 39.44278735, 42.26114689, 45.31925494, 48.58469492, 52.0228524 , 55.59728213, 59.27009427, 63.00235615, 66.75450487, 70.48676674, 74.15957889, 77.73400861, 81.1721661 , 84.43760607, 87.49571413, 90.31407367, 92.8628096 , 95.11490504, 97.04648803, 98.63708524, 99.86984166,100.73171364,101.21375895, 28.23264277, 28.70944494, 29.56194246, 30.78129037, 32.35458687, 34.2651603 , 36.49276002, 39.01377371, 41.80147835, 44.8263238 , 48.05624604, 51.45700717, 54.99255833, 58.62542181, 62.3170884 , 66.02842553, 69.72009212, 73.3529556 , 76.88850676, 80.28926789, 83.51919013, 86.54403558, 89.33174022, 91.85275391, 94.08035363, 95.99092706, 97.56422356, 98.78357147, 99.63606899,100.11287116, 27.94895036, 28.42096144, 29.26489274, 30.47198817, 32.02947559, 33.92085085, 36.12606679, 38.62174836, 41.38144109, 44.37589172, 47.57335847, 50.93994745, 54.43997204, 58.03633112, 61.69090243, 65.36494662, 69.01951793, 72.61587701, 76.11590159, 79.48249057, 82.67995732, 85.67440796, 88.43410068, 90.92978225, 93.1349982 , 95.02637346, 96.58386087, 97.79095631, 98.63488761, 99.10689869, 27.69250148, 28.16018156, 28.99636927, 30.19238886, 31.73558537, 33.60960609, 35.79458782, 38.26736997, 41.00174081, 43.96871551, 47.13684353, 50.47254198, 53.94045167, 57.50381194, 61.1248503 , 64.76518286, 68.38622122, 71.94958149, 75.41749119, 78.75318964, 81.92131765, 84.88829236, 87.62266319, 90.09544534, 92.28042707, 94.15444779, 95.6976443 , 96.89366389, 97.7298516 , 98.19753169, 27.48956121, 27.95381398, 28.78387381, 29.97112855, 31.50301598, 33.36330323, 35.53227265, 37.9869334 , 40.70126581, 43.6464975 , 46.79140837, 50.10266166, 53.54515731, 57.08240404, 60.67690617, 64.29056112, 67.88506325, 71.42230998, 74.86480563, 78.17605892, 81.32096979, 84.26620148, 86.98053389, 89.43519464, 91.60416406, 93.46445131, 94.99633874, 96.18359348, 97.01365331, 97.47790608, 27.37792333, 27.84029072, 28.6669796 , 29.84941278, 31.37507906, 33.22781149, 35.38797251, 37.83266463, 40.53597387, 43.46924468, 46.60138375, 49.89918971, 53.32770503, 56.85058665, 60.43049114, 64.02947067, 67.60937517, 71.13225678, 74.56077211, 77.85857807, 80.99071714, 83.92398794, 86.62729718, 89.0719893 , 91.23215032, 93.08488276, 94.61054904, 95.79298222, 96.61967109, 97.08203848, 27.2818953 , 27.74264094, 28.56643021, 29.744716 , 31.26503101, 33.11126499, 35.26384925, 37.69996661, 40.393794 , 43.31677636, 46.43792945, 49.72416836, 53.14065818, 56.65118329, 60.21853127, 63.80488739, 67.37223537, 70.88276048, 74.2992503 , 77.5854892 , 80.7066423 , 83.62962466, 86.32345205, 88.75956941, 90.91215367, 92.75838765, 94.27870266, 95.45698845, 96.28077772, 96.74152336, 27.20127808, 27.66066222, 28.48201722, 29.65682121, 31.17264373, 33.01342214, 35.15964557, 37.58856428, 40.27443148, 43.18877651, 46.30070669, 49.57723486, 52.98362904, 56.48378065, 60.04058723, 63.61634576, 67.17315233, 70.67330394, 74.07969812, 77.35622629, 80.46815647, 83.3825015, 86.0683687, 88.49728741, 90.64351084, 92.48428925, 94.00011177, 95.17491577, 95.99627076, 96.4556549, 27.13598912, 27.59427064, 28.4136542 , 29.58563842, 31.09782263, 32.93418278, 35.07525481, 37.49834358, 40.17776412, 43.08511409, 46.18957497, 49.45823876, 52.85645685, 56.34820734, 59.89647681, 63.46365274, 67.01192221, 70.5036727, 73.9018908, 77.17055459, 80.27501546, 83.18236543, 85.86178597, 88.28487475, 90.42594678, 92.26230692, 93.77449114, 94.94647535, 95.76585891, 96.22414044, 27.08601735, 27.54345494, 28.36132958, 29.53115555, 31.04055503, 32.87353346, 35.01066264, 37.42928922, 40.10377553, 43.00577152, 46.10451543, 49.36715988, 52.75912005, 56.24444037, 59.78617559, 63.34678246, 66.88851768, 70.373838 , 73.76579818, 77.02844262, 80.12718653, 83.02918253, 85.7036688, 88.12229542, 90.2594246, 92.09240303, 93.60180251, 94.7716284, 95.58950312, 96.0469407 , 27.0513867 , 27.50823943, 28.32506839, 29.49339868, 31.00086833, 32.83150322, 34.96589999, 37.38143425, 40.0525011, 42.95078678, 46.04556881, 49.30404182, 52.69166523, 56.17252941, 59.70973637, 63.26579085, 66.80299781, 70.283862 ,73.6714854 , 76.92995841, 80.02474045, 82.92302611, 85.59409297, 88.00962724, 90.144024 , 91.97465889, 93.48212854, 94.65045883, 95.46728779, 95.92414052, 27.03212321, 27.48865061, 28.30489789, 29.47239621, 30.97879238, 32.80812366, 34.94100051, 37.35481465, 40.02397942, 42.9202012, 46.01277941, 49.26893204, 52.6541431 , 56.13252853, 59.66721662, 63.22073881, 66.7554268, 70.23381233, 73.61902338, 76.87517601, 79.96775423, 82.863976 , 85.53314077, 87.94695492, 90.07983176, 91.90916304, 93.41555921, 94.58305753,95.39930481, 95.85583222]) - - return tmp, d, M, Dom_min, Dom_max - diff --git a/mirrors/mparams_sols/s30x30_c_QR_pre_30x30.py b/mirrors/mparams_sols/s30x30_c_QR_pre_30x30.py deleted file mode 100644 index 03c145b0..00000000 --- a/mirrors/mparams_sols/s30x30_c_QR_pre_30x30.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - - - -def import_c(): - normalisation = True - - d = 2 - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 30 - - k = 900 - - c = np.array([-47.6121586126, -5.30881310705, -18.4994207581, -1.78762248279, -39.0929309754, 10.6132611306, 9.8873766119, -5.60506433883, -21.1181704785, 6.25074504375, 17.2174268623, 2.29376282284, -1.71250076299, -2.07656720413, 15.8874199008, 12.720607735, 2.70288433736, -2.50712137415, 3.47165100041, 7.41721994581, -11.7062289385, 2.2912100426, 0.486373284154, -9.59884389357, 1.08462695017, -1.40636241856, 0.707960211948, -4.84693796879, -5.22974451944, -0.506580710171, -7.83548389633, -2.35545545578, 1.2610447205, -0.475779685095, -2.66884392041, 1.94796795765, 0.493874523918, -3.43411008347, 5.35267553978, -1.95695506998, 2.4641605066, 0.647874454526, -0.285096494792, 1.76641395372, 2.52389560192, -0.861916248923, 1.27776892277, -3.56864502643, 1.15281357476, -1.6356710614, -0.0792375287919, 0.0285038040377, 0.446623645096, -0.880823760517, -0.404200315487, 1.16248397048, -0.283210783476, -0.745185215131, -1.59247616273, 2.01254476108, 0.9831262607, -0.0132925938282, 0.352547783074, 0.257358766386, 0.834329088763, 0.492779193704, 1.38081284803, -0.271833583467, -0.508844280968, -0.0566507589667, 1.31137696463, 0.770021025387, -1.06041157321, -0.0186795965884, -0.482890070341, -0.0886955480301, -0.28286371399, 0.237702452798, 0.305397761548, -0.00883285366664, -0.398407840504, 0.444332938353, -0.222527552782, -0.571738740402, 0.306440556821, -0.684252590569, 0.829664377891, -0.0668587514803, -0.436188867224, 0.30036434401, -0.116142497816, -0.163742272124, 0.55473788849, 0.0319405305626, -0.302867273389, 0.43081178363, -0.151106478213, -0.125702428588, 0.646574711193, -0.0136994975836, 0.126156439599, -0.0079315619646, 0.0359474197336, 0.308513979924, 2.89211494334, 2.99780488463, -0.132239669785, -0.231502583109, 1.08662795057, 1.22267644259, -0.315488223581, -0.148112594384, 0.133901917065, 0.0614282164456, 0.182329138297, 0.0218565709905, 2.51439530298, -0.463567081234, 0.26984667179, 0.0997601090675, 4.8508424557, -5.77545250597, -0.0247077242685, -0.25430710481, -1.20855290499, -2.70339940507, -1.85793449373, -0.247319933861, -0.132779449059, -0.0179690000474, 0.0280111588961, 0.0474590072545, 0.076410224745, 0.14357340989, 0.1657297471, 1.18823201443, -4.4743832576, 2.47623926032, 17.7009891894, 0.206587160071, 1.03865887264, 0.117246789004, 3.39101304493, -0.0251023262846, 0.0547322669795, -2.56597161504, -6.53394468392, 0.0654386026969, -0.116575193391, -0.0156662857177, -0.0821048711915, 0.743782279269, -0.917850904712, 3.21551716912, 10.4889134971, 0.380321396481, -2.09531867518, 1.26917405929, -1.43698718134, 0.0475372396205, 0.0995355178711, -0.0163280376129, -0.023477431134, 0.0130294160519, 0.339751756742, 0.764376250525, -7.5175065545, 2.86224145237, 0.257181452613, -0.249901422543, -1.78186224896, -1.18234240947, -0.245136280797, -1.28386433521, -0.0441894546536, -0.0257537920225, 0.0175185019452, 0.0187664618872, -3.21115918826, -3.21598520763, -23.2748164276, -23.2785838706, 0.474410308415, -0.28028274571, 0.866334569827, -0.407893590336, -0.021968727686, -0.649971792304, 3.29724642972, -12.5019513137, 0.350909424855, -5.05801019818, 0.00187066212043, 0.0412156911033, -0.00739721221159, 14.2899592261, -14.2859768456, 0.250300964386, 0.479417878355, -0.0758853350285, -0.0736124305336, 0.993557830693, 0.0482359383483, -117.232948842, 45.6351807264, 48.7458870957, 8.06729197388, -1.08640236833, 1.08876410302, -14.7674277183, -1.17173399411, 0.584603550611, -0.150643429672, -0.000895191234489, -0.0143003425891, 0.203288742023, -0.0484870069364, 72.3804183426, 26.9036428116, -0.162021670658, -0.103503048115, 5.91651687411, 5.9147009049, 0.436585590239, -2.32121153454, -0.108618114336, -0.150080163763, -70.1621527814, -349.837343278, 2.84520946809, -56.5459637122, 0.0169819920863, -0.100797434429, -0.363801854339, 54.523974005, -129.098861559, -0.019882807478, -0.0203602603546, -7.63802180161, 5.37490209985, -0.360601369403, -0.277694724915, 0.0291512960006, -0.278690574137, 16.5005929478, 27.4045209382, -164.81551582, -144.22942525, 7.93717275055, 171.366466665, 0.315872295162, -2.82996071394, 0.0683165565196, 0.0375641187617, 0.0351905624094, -0.0386143056806, 5.30040191961, -67.1612288641, -15.8973815742, -31.9514612597, -159.318464608, 19.9618338562, -0.344301246357, -0.82978181321, -0.000608414632841, 0.0552975684464, -39.1699236616, -97.7470264762, 3.62900195922, 2.37912119082, -64.1331509535, 64.1284200313, -0.0581394236861, 0.0854161154734, 5.225627316, -9.47303295883, 0.0116558085355, 0.0854945300037, 0.0513760330075, -76.7655143508, 8.42770779431, -0.0705065801403, 0.0807542349285, 64.9648951008, -64.973079706, -16.9295249592, 99.8013121876, -27.722773519, -23.1492374394, -0.570273598474, 0.609402478039, -14.9239653595, -7.33772866948, -40.2830084675, 16.7717641082, 0.0180193702533, 0.0173132755341, -0.138724943813, 0.289566597886, -39.8990064708, -39.8544930785, -0.0203883462835, -0.0216147673247, 3144.35542955, -1991.72993161, -21.8024388286, -21.781030612, -1.63285199355, 0.0662491777506, 21.9501911654, -43.4303463079, -2.81622698227, 1.5476356179, 577.331948349, 1343.18751867, 22.0696128379, 34.8914751669, 0.00919256966967, 0.00653614460586, -0.0210470683053, -36.8416544974, 29.2687312889, -0.0482819146841, -0.0344961357932, 763.386317797, -2153.31503889, -14.3520175932, 2.98915037375, 16.4536722478, -16.4299160013, 0.235599483509, -0.170459718029, -2.33617461062, 5.97514631091, 967.222941821, -1367.41285536, -6.30626950615, -6.44387936439, 6759.39930222, 6759.4687431, -0.24278336327, -0.0309240229888, -0.0860281827559, -0.0875565912915, 25.1661818636, -6.85885871494, -13.9907205948, 17.957111216, 0.291308622587, -0.228726575526, 3709.59560539, -577.697767221, -0.800483763506, 0.164674482152, -744.276077839, -584.146655285, -0.505488145816, 17.6607606875, 4149.36526011, 4149.19847569, 6.02484366947, 5.92017772791, 0.181533178083, 0.0712567833485, -3.91097894527, 1.92807319329, -14808.4238079, 19637.3407589, 1018.83903987, -277.348069513, 0.243310036059, -0.0148978219352, 2.21948480407, -0.107607657507, -0.252099420547, -9250.71493647, 2784.84478578, -3759.77334528, 2091.4308063, -2.82594442238, 11.8983673543, 1.61752067389, -2.21143944863, 2.12137251029, 9.26354995943, 13643.4024845, 6462.63983597, -223.674119444, -230.911465127, -759.623220747, 2308.87748429, -0.62707720208, -1.96930998697, -0.0487266616444, 0.456739848909, -0.396724794027, 0.209917453101, -10556.4808096, 3324.04055321, -2.14164624269, 0.65511039481, -3.85043087019, -4.15473116971, -465.433151473, -155.813839647, -1.0939044101, -0.885508567619, -2707.31475888, 150.226099016, 25851.6907672, -3341.05661343, -0.0207588079115, 1305.92406071, -6114.43836001, -4.69849581878, -1.18368285695, -7674.1899563, -6772.20021173, -4.42471859593, -0.29172009425, 1.1533863014, -0.0195980052118, 42.4060033873, 83.2125766122, 581.391738268, -581.362219595, -3.82100559334, 1.43723834068, -1.82598772605, 0.787456063158, -11312.7485814, 11312.9388798, 3354.39808631, 6109.46070514, 21196.504953, -28418.2076667, 2.21037912919, -1.62958958365, -0.246131500823, -1.81352963814, -1199.30734555, -405.942834302, -53.5672085997, -174.160591543, -12168.8208902, 6756.11275614, 2.31744760385, 2.15977072145, -11620.4160788, -1627.19994599, 4.51525561771, -1.85911653247, -1959.07317769, 813.182152472, 0.304426109611, 0.28499688905, -6829.91683996, 20667.6516955, -6417.38632426, 1655.74811321, -3.75118263103, -1.27336252859, -177.960836042, -174.20555837, 5.32717704449, -0.0221222354207, 29.0984980994, -11.8353743879, -1737.73924389, -2742.02696387, -3392.96996055, -15592.1699146, -6.0146730655, 0.0243739463759, -6.74933777528, 7266.96301849, -1420.66367028, 4.62624115289, 4.38891915266, -466.729198742, 132.944527083, -8115.64666921, -3907.58606256, 42.9272211005, 46.4457354533, -552030.97003, -552022.078263, -7.51394243635, -3.49458871023, 554.184687852, 270.036748533, -214324.145486, -219317.908185, 1540.02518845, -1608.50371912, -13.0063484009, -16.3748814695, -15.0773160564, 6.36001326003, 1.82147719666, 8.7232393713, -9910.65691612, -1762.07898371, 17.1482370943, 12.9261505981, -338822.044822, -338833.825644, -61.4700365207, -1203.04973298, -25.4654703328, -19.8540858981, -4.69543437103, 21.851389308, -1621.70049844, -3034.26320986, -1823144.47448, 1026933.57967, -51.764097064, 2960.74718745, -739.233834855, 350848.299758, -18254.9063236, 820985.925102, 36600.8301759, 15.6511281112, 13.5155667909, 50.2191740234, 173.23082916, -116.337751478, 18.22708466, 158.915720327, -167.419384791, -96952.0398971, -1280858.48, 41.6835990808, -31.9382764493, 482.806761715, 398.971764652, 73.9419011088, -74.53385108, 140375.873754, 140353.848007, -1977.00157813, 4255.80490536, -49684.1633515, 940374.355036, -419.287619335, 69.4140821372, 88.5450595687, 3.20816299677, 59.1095116749, -23.8703629124, -32.4059437759, 105.512825402, 1232.99945862, 764.191934787, 35362.4991851, 218609.899402, -15.6576227463, -41.0858583496, -266.070714431, 875.085076291, 158.883837694, -65.8716150231, -345528.006104, 404261.18088, 47589.5894137, 47514.1332095, 137.66086033, -350.853290697, -13587867.1913, -8582104.76674, 383.764147433, 172.020904533, -42.325786573, -120.574947298, -160.002290797, 186.511782798, -939.864393241, 1718.60766859, 524179.093392, -278660.515032, -130.625440479, -194.510356366, -958040.708322, 6239232.39679, 208.319469138, -346.741770635, 445.119772303, 53468.9751328, -87745.8468972, -3679484.54989, -9152409.27304, -125.547051568, -832.630119095, 150285.721152, -100120.155683, -204.254131135, 400.065330465, -373.127869529, -986.849113071, 374.872447155, 166.152404357, 18719801.233, 2940156.4968, 595.879089714, 446.673378183, -6974715.40263, 1914716.69315, 211657.971164, -7439194.8439, 14155.3661861, 13784.9692194, 143.475784987, -765.159858225, -83.3801403628, -586.101926359, 98725.5175831, -257810.555515, 957.565014264, 846.81068776, 6894084.40866, -9369094.76347, 928.828350845, 1345.52070913, 1504.97468225, -1218.0908057, -3722684.04427, -1686378.39468, -2318.14171928, -1306.6135511, -37936.6464705, 1816.81826812, -2243.45890501, 8502194.42278, 652110.661694, 994.503297463, 1395.7492819, 11635.8470833, -51764.4471329, -4204663.13537, -1761476.34802, -75.2411959981, -853.544026625, -2555.3360462, -2337.49142714, 517.900828015, 833.162476915, 557.161903053, -2675.48720614, 1554524.53619, -4558873.28909, 3986.31652775, 9802.81449514, -5083.91603427, 2342.21302644, 87014.5735114, -60974.8444771, -978624.82851, -976991.077268, -7934.38499472, 4139.3286545, 3036869.56791, -4439992.46758, -339.730996654, -4031.80114261, -3790.47331604, 1874.24612603, -2039.68787694, -2763.33989185, 8752.00176606, -3042.63412826, -6717.48753617, 2538.45256953, -11925.777866, -1626.49272055, -1427002.75425, 1563609.22515, 8996.36303375, 1263.35343352, -1511383.68763, 612778.456652, -4373.64713258, -5600.47823302, -14734.6847661, -593.223643578, 3211.9584964, -3832.96222514, -20232.4088474, 107.602913536, -280858.579014, -297647.150451, -27782.0956487, 25846.3582939, -11759.7515196, -1682.43759449, 11742.2304791, -1977767.7706, -1524192.72701, 12480.3524392, -1506.71045403, -13890.2591649, 15930.278413, -806443.388077, 10680.3786925, -15676.6250051, -19931.9046625, 18772.1254095, 31180.9985254, -3434.86829475, -21424.0664978, -218318.372236, 446059.807875, -6908.02301892, 28891.8702148, 15663.9229175, 2335.20137238, 13317.0007456, 32162.0506529, -53907.8259972, -116422.185763, -909016.481353, -283637.039592, 15893.3392332, 11928.1625748, 39504.8102558, -2797.70865387, -17599.7691848, 78604.7288889, 18357.7819734, 46731.0972667, 32585.3483682, 12857.5309972, -6146.74796861, 244381.308072, -33417.8868362, 119811.608484, -169712.063785, 20053.6154395, -92109.4360846, 177953.34613, -5335.78089788, 68500.2670019, -79499.1989489, -125917.580984, 65739.5579359, -29852.1154079, -12286.0944957, -106854.971582, -69178.711913, -476610.565405, 158447.144344, 91205.1089709, -26632.1189241, -37132.9304009, 48768.486669, 171563.635544, 49061.496493, 314759.374195, 550891.817639, -111707.770609, -272801.01167, -82527.9377085, 76788.3853943, -32834.4393484, 16023.9603411, 463195.70841, 459355.824366, 190832.640656, 104131.881825, 584689.411114, -792706.158627, -913083.310289, 304991.31345, -57684.0050269, -199463.709243, -247934.129715, 778634.157416, 884987.73752, -388873.907413, 736462.146575, 319355.059759, 1099703.45673, -637770.637437, 1091395.24274, -2236170.35006, -1749578.0435, 1880562.69542, -263596.400316, 638394.976896, -1130031.28941, -1309645.96927, -1250669.08889, 2822184.23796, 490962.894195, 1693754.20699, -704542.272778, -3073537.93337, 1417392.49193, 2751841.62119, -1440576.78815, 4858725.47908, 4032608.61309, 3270059.12795, 2999779.61903, -3936119.77948, 1417809.29238, -4837030.05537, 2702622.47304, 23502735.4273, -6843317.95445, -3143946.27038, -5317289.27693, -5860757.21286, 3175651.13694, 11144767.4325, 254661.304118, -813143.166889, -11906538.8426, -9700423.2851, 16652068.9779, -25666520.3557, 26531086.3057, 11181357.3878, -25826960.0308, -38064692.2442, -4494126.28563, 10221878.2075, 20445429.6862, -18178017.1736, 36519632.7097, -14588744.7758, 28013768.0385, 80949553.7798, 59005920.375, -11707698.8559, -25271447.2781, 12586524.479, -50677951.2178, 456990471.872, 459798449.513, 505949222.985, 19048483.4703, -25583160.732, 61071788.4321, -212476542.73, 170021497.895, -625622577.605, 356399744.389, 57274683.5303, 582392552.416, -817407300.057, -474061964.189, 944726981.887, -164865673.447, 125080740.051, 1806084974.2, 1813424889.18, -2797214812.64, 3427875419.49, 2131158050.7, 1088866283.45, -80727104.3227, 70616198.9136, 620259827.739, -1440282292.27, 2814052489.97, -3453778128.34, -6444702378.44, -759170530.271, -4814022330.34, 3988734051.84, -3284945745.52, -5062506106.19, 961806583.647, 3337022815.84, -11849025785.9, -7641299750.4, -4031795993.04, 5630805100.21, 3256456953.69, 6679248713.58, -4558972101.75, 1135986238.26, -2840236595.84, -6838692700.95, 7278046754.62, -4292894212.11, -168904072.772, 991339377.7, 67017904.6801, 1914537006.0, -19391116.5676, 1420556438.78, 43592051.6795, 33524926.9832, 505852300.331, -430429210.224, 1480697388.35, -1536785154.25]) - cs = np.array([-124.67602877, -10.7730999429, -37.5406149536, -2.81123547044, -53.9218099045, 14.6391236183, 10.5687948669, -5.99135418202, -18.5218422219, 5.48226057686, 12.5093750836, 1.55903032143, -1.16395670398, -1.0778509507, 8.24643219362, 5.87674557441, 1.24869533741, -1.00847756516, 1.39645498782, 2.2586983161, -3.56479109214, 0.67306280826, 0.132979155189, -2.62441666378, 0.255962076875, -0.331888715688, 0.123079116208, -0.842641763546, -0.868378473418, -0.0841157311081, -1.25685168724, -0.377827100786, 0.162269623038, -0.0612227218388, -0.274589245632, 0.198683444017, 0.0503728467087, -0.317784542905, 0.495324118442, -0.171163267998, 0.21552552312, 0.0464608954886, -0.0204450698066, 0.10662454401, 0.152347764869, -0.0479354097224, 0.0710630260422, -0.173949444744, 0.0561925548034, -0.0768273001282, -0.00372177851009, 0.00103752982146, 0.0162569652158, -0.031193066689, -0.0133037125691, 0.038261604499, -0.00877791037049, -0.0230964688122, -0.0399940347755, 0.0505437927711, 0.0243237223688, -0.000328874707921, 0.00686148994383, 0.00500886595319, 0.0161108310293, 0.00951552862231, 0.0253280062912, -0.00498619542976, -0.00800510991017, -0.000891226587356, 0.0173480621704, 0.0101865237694, -0.0126035042543, -0.000222016036998, -0.00519659430896, -0.000954492147245, -0.00297830589868, 0.00221309926527, 0.00284336805844, -8.13572110513e-05, -0.00366963520372, 0.00373760660361, -0.00187184063789, -0.00357944433913, 0.00191851074429, -0.00419600860399, 0.00508771017609, -0.000392319870866, -0.00255950875949, 0.0016406651749, -0.000634399372937, -0.000815137215767, 0.00276158069653, 0.000151788968303, -0.00143929703579, 0.00171501225282, -0.000601537542526, -0.000411069914394, 0.00208852545953, -4.4251265926e-05, 0.00037574439581, -2.3623367683e-05, 0.000104988561214, 0.000901050453875, 0.00781282779649, 0.00809834110676, -0.000311548912064, -0.000545406518521, 0.00227484461929, 0.00255966076072, -0.000647986372558, -0.000304210856672, 0.000222259259882, 0.000101962617282, 0.000290363381783, 3.48070962561e-05, 0.00357789341548, -0.000659639160802, 0.000372980306196, 0.000137887770782, 0.00654996911236, -0.00779844653161, -3.00331092123e-05, -0.000309119244219, -0.00126463708191, -0.00282885351625, -0.00168107039719, -0.000223776576006, -0.000117843765076, -1.59477587475e-05, 2.35996298305e-05, 3.57683568384e-05, 5.75879762955e-05, 0.000102387258973, 0.000118187723959, 0.00084513185371, -0.00318241199596, 0.00136567810699, 0.00976232539218, 0.000110622548053, 0.00055617731039, 5.30256303348e-05, 0.00153360791974, -1.1308129217e-05, 2.46558641748e-05, -0.00109669472286, -0.00279260402272, 2.74855440862e-05, -4.89639522431e-05, -6.09185348119e-06, -3.19265749652e-05, 0.000233663302984, -0.000288347921185, 0.000934130849324, 0.0030471047605, 0.000101875771854, -0.000561267941507, 0.000339696364149, -0.000384611801082, 1.14502094285e-05, 2.1570065694e-05, -3.53840369244e-06, -5.00520582388e-06, 2.77777022249e-06, 7.05277497609e-05, 0.000158673901901, -0.00138864859128, 0.000528718868671, 4.40550637846e-05, -4.28079980035e-05, -0.000279800309576, -0.000185659566213, -3.45882735744e-05, -0.00018115087132, -5.03724049652e-06, -2.93572403488e-06, 1.92695422457e-06, 2.06422404877e-06, -0.00035104695274, -0.000351574537732, -0.00234631858568, -0.00234669837908, 4.52897879752e-05, -2.67573151367e-05, 7.77264079839e-05, -3.65956810691e-05, -1.88100727124e-06, -5.56519105204e-05, 0.00025759076364, -0.000976689869721, 2.25062302169e-05, -0.000324404914479, 1.10020208279e-07, 2.42403952592e-06, -3.99058619599e-07, 0.000758809650511, -0.000758598182536, 1.32901629416e-05, 2.54555220597e-05, -3.67709686891e-06, -3.56696109632e-06, 4.7409862996e-05, 2.30168708648e-06, -0.0055910939769, 0.00217644089494, 0.00180162020831, 0.000298162514059, -3.79935550937e-05, 3.80761494434e-05, -0.000498618479889, -3.95633033811e-05, 1.8210991163e-05, -4.69269501298e-06, -2.49165268545e-08, -3.98032125899e-07, 5.26699883032e-06, -1.25624767156e-06, 0.00181831587871, 0.000675864025652, -3.92418705289e-06, -2.50685800052e-06, 0.000118226396726, 0.000118190109244, 8.50900164327e-06, -4.52401389404e-05, -1.84495551402e-06, -2.54921775592e-06, -0.00114983181266, -0.00573320644549, 4.54489807639e-05, -0.000903257368517, 2.43872811359e-07, -1.30535534309e-06, -4.71133711963e-06, 0.000692463808089, -0.00163957765234, -2.4379352934e-07, -2.49647829433e-07, -8.95434023085e-05, 6.30119988652e-05, -3.56728351211e-06, -2.74712160752e-06, 2.75950692376e-07, -2.63812822902e-06, 0.000155989111089, 0.0002590698937, -0.00142275672719, -0.00124504895064, 6.00611479492e-05, 0.00129674218155, 2.01918327012e-06, -1.80902517131e-05, 4.32188793212e-07, 2.37640653785e-07, 2.15675122979e-07, -2.36658483303e-07, 3.10824155217e-05, -0.000393844326177, -8.81707800582e-05, -0.000177210646302, -0.000874501032696, 0.000109570754179, -1.82117436315e-06, -4.38911383916e-06, -2.92330625783e-09, 2.65693359687e-07, -0.000156128310662, -0.000389612148538, 1.29282989728e-05, 8.4756057982e-06, -0.000208334704852, 0.000208319336586, -1.83843227363e-07, 2.70095115188e-07, 1.58033450597e-05, -2.86483515867e-05, 3.2483492845e-08, 2.1964214339e-07, 1.31989052494e-07, -0.000194561434734, 2.13599418155e-05, -1.76496930588e-07, 2.02149566303e-07, 0.000152228840442, -0.000152248018997, -3.22647398693e-05, 0.00019020400065, -5.03422982448e-05, -4.2037129312e-05, -1.03118952995e-06, 1.10194379778e-06, -2.51527111142e-05, -1.23669390146e-05, -6.04223097706e-05, 2.51567289754e-05, 2.51009006601e-08, 2.41173139334e-08, -1.79169932841e-07, 3.73989179378e-07, -4.92471858728e-05, -4.91922431676e-05, -2.47887095528e-08, -2.62798258286e-08, 0.00332609307857, -0.00210684806088, -2.26568733822e-05, -2.26346261805e-05, -1.57871860869e-06, 6.40528413709e-08, 1.93160394885e-05, -3.82184500332e-05, -2.40918011833e-06, 1.32394618209e-06, 0.000473267325235, 0.00110107671344, 1.73211097055e-05, 2.73842170948e-05, 6.40053099935e-09, 4.10012064612e-09, -1.32028167219e-08, -2.13365406411e-05, 1.69507445628e-05, -2.74705807291e-08, -1.96269946904e-08, 0.00042535180317, -0.00119980724462, -6.88659020809e-06, 1.43429685481e-06, 7.64238072413e-06, -7.63134645298e-06, 1.0780199923e-07, -7.79963441253e-08, -1.06858627913e-06, 2.73308310713e-06, 0.000342682681111, -0.000484468143984, -1.85378111532e-06, -1.8942326939e-06, 0.00195650956537, 0.00195652966502, -6.90449085959e-08, -8.79445078883e-09, -2.37732477318e-08, -2.41956120496e-08, 6.85784255577e-06, -1.86905480672e-06, -3.74128977559e-06, 4.80195113141e-06, 6.87715617736e-08, -5.39973162423e-08, 0.000832105906626, -0.000129584400963, -1.73281179249e-07, 3.56471795683e-08, -0.000156057432228, -0.000122482006046, -7.94510389152e-08, 2.77586288869e-06, 0.000632640045702, 0.000632614616528, 8.95215240094e-07, 8.79663210637e-07, 2.50745505498e-08, 9.84245323612e-09, -5.30845067528e-07, 2.61701266813e-07, -0.00189450256603, 0.00251228577236, 0.000125331525718, -3.41177117726e-05, 2.82622295223e-08, -1.66389038799e-09, 2.47887204431e-07, -1.11910673063e-08, -2.62180373445e-08, -0.000917148846738, 0.000276099436744, -0.00036450067569, 0.000202759015473, -2.3401046621e-07, 9.85278574312e-07, 1.2031866901e-07, -1.64497094435e-07, 1.53957880469e-07, 6.72298952808e-07, 0.00091941205406, 0.0004355093217, -1.50031340615e-05, -1.54885852505e-05, -4.35832622735e-05, 0.000132471480839, -3.53778811519e-08, -1.11102770817e-07, -2.53293688191e-09, 2.37425091249e-08, -1.95192919582e-08, 1.03281673236e-08, -0.000452343470004, 0.0001424345921, -9.0016152426e-08, 2.75351344105e-08, -1.47773165698e-07, -1.59451706612e-07, -1.73985698892e-05, -5.82454842762e-06, -3.75715363053e-08, -3.0413913607e-08, -9.11306788834e-05, 5.05674722247e-06, 0.000774806065769, -0.000100135459238, -5.68823627543e-10, 3.3117070753e-05, -0.000155056709502, -1.15548135185e-07, -2.91098155719e-08, -0.000178243937817, -0.000157293947613, -9.94399836295e-08, -6.55604210018e-09, 2.44887241467e-08, -4.16105291565e-10, 8.04608512731e-07, 1.57886955044e-06, 1.06710269273e-05, -1.06704851286e-05, -6.77111672182e-08, 2.54689722964e-08, -3.08714396029e-08, 1.33132889896e-08, -0.00017859666102, 0.000178599665116, 4.99060211329e-05, 9.08952566506e-05, 0.000275277814, -0.000369065659678, 2.35091395306e-08, -1.73319809228e-08, -2.53818329022e-09, -1.87016721075e-08, -1.22675499332e-05, -4.15233343367e-06, -5.43449224634e-07, -1.76689136704e-06, -0.000122471099505, 6.79957873456e-05, 2.32781080783e-08, 2.16942882264e-08, -0.000116651019417, -1.63345728046e-05, 3.81566948689e-08, -1.57106813513e-08, -1.58928032868e-05, 6.59686637834e-06, 2.37649720358e-09, 2.22482332524e-09, -4.6722224463e-05, 0.000141383662483, -3.81250018936e-05, 9.83662141142e-06, -2.05845433835e-08, -6.98755266731e-09, -9.23959307373e-07, -9.04462097078e-07, 2.59895821854e-08, -1.07927266235e-10, 1.39709231993e-07, -5.68246189158e-08, -7.85641541617e-06, -1.23968558466e-05, -1.4758756567e-05, -6.7822893391e-05, -2.34691205144e-08, 9.51065965062e-11, -2.61937396986e-08, 2.53284720628e-05, -4.95162007996e-06, 1.59679930937e-08, 1.51488494188e-08, -1.29567486881e-06, 3.69063866353e-07, -2.08918892705e-05, -1.00591928279e-05, 1.06338461734e-07, 1.15054455612e-07, -0.00135642117885, -0.0013563993202, -1.8164091264e-08, -8.44776610359e-09, 1.27173140869e-06, 6.19674670554e-07, -0.000408112955659, -0.000417622004811, 2.92681566887e-06, -3.05695901485e-06, -2.38802084773e-08, -3.00649783446e-08, -2.52761263695e-08, 1.06621429282e-08, 2.90296759882e-09, 1.39026067801e-08, -1.49679174117e-05, -2.66124161674e-06, 2.25291660828e-08, 1.69822350705e-08, -0.000438534649135, -0.000438549896895, -7.54235596308e-08, -1.4761385922e-06, -3.07699572682e-08, -2.39897149146e-08, -5.12396501695e-09, 2.38456647817e-08, -1.71762431131e-06, -3.2137402899e-06, -0.00190522264858, 0.00107316622713, -4.49632567252e-08, 2.43821369237e-06, -6.08768642756e-07, 0.00028874421565, -1.50235830851e-05, 0.000664872735272, 2.96410609936e-05, 1.21151419629e-08, 1.04620579611e-08, 3.40406834515e-08, 1.17423193149e-07, -7.33985886667e-08, 1.14996402197e-08, 9.22794484605e-08, -9.72173702049e-08, -5.33682229071e-05, -0.000705061392015, 2.27365711471e-08, -1.7420925908e-08, 2.59556504577e-07, 2.14486881245e-07, 3.64921509395e-08, -3.67842928266e-08, 6.83708878515e-05, 6.83601599403e-05, -9.07334535524e-07, 1.95317939704e-06, -1.73902345798e-05, 0.000329145731972, -1.25618393121e-07, 2.0796429372e-08, 2.64402662656e-08, 9.57983239452e-10, 1.76429337865e-08, -7.12479627261e-09, -9.44035001545e-09, 3.07375093503e-08, 3.54424829557e-07, 2.19666433384e-07, 1.01047611401e-05, 6.24673270387e-05, -3.75317739677e-09, -9.84839873818e-09, -6.19809953746e-08, 2.03850481248e-07, 3.53975448697e-08, -1.46754602374e-08, -7.15740423835e-05, 8.37402606531e-05, 7.41492163135e-06, 7.4031646706e-06, 2.05466653898e-08, -5.23668455112e-08, -0.00187992041295, -0.00118735829254, 5.28900786597e-08, 2.37077880572e-08, -5.75785693469e-09, -1.64026079938e-08, -2.11173871261e-08, 2.46161566403e-08, -1.17065614073e-07, 2.14062644598e-07, 6.37024776327e-05, -3.38650762402e-05, -1.4134667935e-08, -2.1047502083e-08, -0.000102718882086, 0.000668955825024, 2.13662151755e-08, -3.12795132409e-08, 4.01541747026e-08, 4.64286926523e-06, -7.61923112311e-06, -0.000268149082478, -0.000666998173803, -8.81181614098e-09, -5.84401068879e-08, 9.95877370928e-06, -6.63452214202e-06, -1.3474548181e-08, 2.6392119796e-08, -2.27469007664e-08, -6.01610330475e-08, 2.20974543643e-08, 9.79411781278e-09, 0.00108223725415, 0.000169977478441, 2.82196922565e-08, 2.11535949584e-08, -0.0003232045031, 8.87269088939e-05, 9.48274494049e-06, -0.000333292336445, 6.23888167093e-07, 6.07563154591e-07, 6.12320583017e-09, -3.26552023122e-08, -3.39547875422e-09, -2.3867752824e-08, 3.64592359239e-06, -9.52091753571e-06, 2.96073788226e-08, 2.61829135469e-08, 0.00020994188766, -0.000285311940616, 2.82486222397e-08, 4.09215564637e-08, 4.45613308264e-08, -3.60668811157e-08, -0.000102092054593, -4.62477510476e-05, -6.24621615995e-08, -3.52066051345e-08, -8.94020004525e-07, 4.28153776528e-08, -4.90578603748e-08, 0.000164632300089, 1.2627145332e-05, 1.91598032766e-08, 2.68900849151e-08, 2.1811082601e-07, -9.70310536342e-07, -6.76505483062e-05, -2.83411127636e-05, -1.16283146752e-09, -1.31912795846e-08, -3.74742190375e-08, -3.42795061098e-08, 6.9387512284e-09, 1.11625712856e-08, 7.29160041021e-09, -3.50142018203e-08, 1.78142141713e-05, -5.22427909527e-05, 4.44584914332e-08, 1.09328556102e-07, -5.66510428521e-08, 2.60997194442e-08, 8.72115307176e-07, -6.11128279286e-07, -8.58554571955e-06, -8.57121261331e-06, -5.37272233306e-08, 2.80292079292e-08, 2.0417354635e-05, -2.98507532463e-05, -2.27509325793e-09, -2.69999511168e-08, -2.50935810724e-08, 1.24078248878e-08, -1.28753299532e-08, -1.74433095957e-08, 5.03609006446e-08, -1.75079654592e-08, -3.54130105633e-08, 1.33821194073e-08, -5.87365989018e-08, -8.0107650634e-09, -6.97696588416e-06, 7.64486396117e-06, 4.26720410454e-08, 5.9924021714e-09, -5.54063446882e-06, 2.24640425484e-06, -1.34092093394e-08, -1.71705464162e-08, -4.504083105e-08, -1.81335952336e-09, 8.78552518392e-09, -1.04841255144e-08, -5.12869143951e-08, 2.72761389604e-10, -6.96996136769e-07, -7.38659232198e-07, -6.79900307432e-08, 6.32525947745e-08, -2.74010214012e-08, -3.9201911543e-09, 2.46219408417e-08, -4.04064023845e-06, -3.11396966412e-06, 2.26082645055e-08, -2.72941335678e-09, -1.84532607218e-08, 2.11634152597e-08, -1.0700873902e-06, 1.41720072982e-08, -1.98628152156e-08, -2.52542975683e-08, 2.16597581134e-08, 3.59774303731e-08, -3.70307728095e-09, -2.30969205707e-08, -2.26394837781e-07, 4.62560651421e-07, -6.53897913121e-09, 2.7348357586e-08, 1.31020105708e-08, 1.95326315221e-09, 1.06625028245e-08, 2.5751119248e-08, -3.38526213417e-08, -7.31097210158e-08, -5.04023119851e-07, -1.57267756982e-07, 8.6756484812e-09, 6.51114023272e-09, 2.12878653027e-08, -1.50759080207e-09, -9.10813278201e-09, 4.06788939271e-08, 9.17832686159e-09, 2.3364067331e-08, 1.39239507507e-08, 4.75341004108e-09, -2.27244200535e-09, 7.91791034818e-08, -1.08272744734e-08, 3.14392353958e-08, -4.4532786843e-08, 5.19423051876e-09, -2.38578268168e-08, 4.47296981827e-08, -1.34117318252e-09, 1.62025425988e-08, -1.88040637924e-08, -2.77141894405e-08, 1.44690134577e-08, -5.59948281427e-09, -2.3045441826e-09, -1.52514988817e-08, -9.87387036421e-09, -6.45286657826e-08, 2.14515087274e-08, 1.06643493493e-08, -3.11398257286e-09, -4.25116298749e-09, 5.58306338541e-09, 1.83402624818e-08, 5.24467646303e-09, 2.97747135237e-08, 5.21110510793e-08, -9.67504132625e-09, -2.36269070396e-08, -6.70770729169e-09, 6.24118321196e-09, -2.34253617144e-09, 1.14318089123e-09, 2.76260129333e-08, 2.73966867273e-08, 9.86243256572e-09, 5.3815053891e-09, 2.61672723734e-08, -3.54753997992e-08, -3.67345691937e-08, 1.22690929598e-08, -2.16488024345e-09, -7.48550553482e-09, -7.93219980448e-09, 2.32128102337e-08, 2.63797530832e-08, -1.13320536961e-08, 2.14602049569e-08, 8.56539653498e-09, 2.94927369984e-08, -1.21387729345e-08, 2.07723930695e-08, -3.4388373955e-08, -2.69033612167e-08, 2.66142629768e-08, -3.72973943818e-09, 9.02857068302e-09, -1.59808152849e-08, -1.59469673545e-08, -1.52274982602e-08, 3.41730573656e-08, 5.94414960343e-09, 1.96857607856e-08, -8.18703114028e-09, -2.18263875891e-08, 1.00628992156e-08, 1.80020259467e-08, -9.42172609375e-09, 3.03712975333e-08, 2.38540575062e-08, 1.93319147449e-08, 1.59777389323e-08, -2.0961876788e-08, 7.43892492311e-09, -2.53714439136e-08, 8.9623593408e-09, 7.78507147592e-08, -2.06684513513e-08, -9.49236907344e-09, -1.3405510179e-08, -1.47642150063e-08, 7.07163466692e-09, 2.48013261469e-08, 5.60456770048e-10, -1.78619281967e-09, -1.74347914323e-08, -1.4195116351e-08, 2.39046814752e-08, -3.68024880944e-08, 2.79780877473e-08, 1.17678790413e-08, -2.56674467769e-08, -3.77953153449e-08, -4.21644321623e-09, 9.57120988517e-09, 1.77295036005e-08, -1.5737693521e-08, 2.32124297271e-08, -9.25570200582e-09, 1.18447565646e-08, 3.39227137607e-08, 2.3869594777e-08, -4.68640998247e-09, -9.26139399098e-09, 4.31767562374e-09, -1.37993801226e-08, 1.19503191165e-07, 9.91355686862e-08, 1.01108965797e-07, 3.80665168792e-09, -5.11254253572e-09, 1.2204595021e-08, -4.24613429877e-08, 3.39771206959e-08, -1.25024506269e-07, 7.12229763944e-08, 1.1445781029e-08, 1.16385411791e-07, -1.63350792904e-07, -9.47366113935e-08, 1.8879437651e-07, -3.29467799936e-08, 2.49961531575e-08, 3.60928282101e-07, 3.62395091771e-07, -5.58995812167e-07, 6.85027118928e-07, 4.2589093266e-07, 2.17599195353e-07, -1.61325161875e-08, 1.41119513902e-08, 1.23952813561e-07, -2.8782622131e-07, 5.62360656037e-07, -6.90203520006e-07, -1.28791025413e-06, -1.51712748418e-07, -9.62034917796e-07, 7.97109189023e-07, -6.56464032237e-07, -1.01169195145e-06, 1.92207566592e-07, 6.66871121492e-07, -2.36791102443e-06, -1.52703844577e-06, -8.05714693572e-07, 1.1252609045e-06, 6.50770827964e-07, 1.33478202762e-06, -9.11065643278e-07, 2.27015653928e-07, -5.67593291535e-07, -1.36664533709e-06, 1.45444591463e-06, -8.57892599381e-07, -3.37538142981e-08, 1.98109404421e-07, 1.33928677508e-08, 3.826013518e-07, -3.87512353557e-09, 2.83884203901e-07, 7.13737581322e-09, 4.16558257371e-09, 5.54006672796e-08, -4.24930347679e-08, 8.43987599359e-08, -2.59262600964e-08]) - - return c, cs, N, normalisation - diff --git a/mirrors/src/CMakeLists.txt b/mirrors/src/CMakeLists.txt deleted file mode 100644 index 997fe009..00000000 --- a/mirrors/src/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# CMake input file of mirrors.so - -FILE(GLOB SRCS *.h *.cpp *.inl *.hpp) - -ADD_LIBRARY(mirrors SHARED ${SRCS}) -MACRO_DebugPostfix(mirrors) -TARGET_INCLUDE_DIRECTORIES(mirrors PUBLIC ${PROJECT_SOURCE_DIR}/mirrors/src) - -TARGET_LINK_LIBRARIES(mirrors tbox) - -INSTALL(TARGETS mirrors DESTINATION ${CMAKE_INSTALL_PREFIX}) - -SOURCE_GROUP(base REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)") - diff --git a/mirrors/src/mirrors.h b/mirrors/src/mirrors.h deleted file mode 100644 index f0025afe..00000000 --- a/mirrors/src/mirrors.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// global header of the "mirrors" module - -#ifndef MIRRORS_H -#define MIRRORS_H - -#if defined(WIN32) -#ifdef mirrors_EXPORTS -#define MIRRORS_API __declspec(dllexport) -#else -#define MIRRORS_API __declspec(dllimport) -#endif -#else -#define MIRRORS_API -#endif - -#include "tbox.h" - -/** - * @brief this namespace avoids conflicts with similar names in 'waves' - */ -namespace mirrors -{ -class Problem; -class Solver; -class Medium; -class uDirichlet; -class uNeumann; -class TDirichlet; -class TNeumann; -class TSource; -class MSurface; -class ANSYSSolution; -class ThermoMecaTerm; -}; // namespace mirrors - -#endif //MIRRORS_H diff --git a/mirrors/src/wANSYSSolution.cpp b/mirrors/src/wANSYSSolution.cpp deleted file mode 100644 index e5b85b47..00000000 --- a/mirrors/src/wANSYSSolution.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wANSYSSolution.h" -#include "wProblem.h" - -using namespace mirrors; - -ANSYSSolution::ANSYSSolution(mirrors::Problem &pbl, - std::string const &_solution_type, - std::string const &_solution_name, - std::string const &_solution_file) : solution_type(_solution_type), - solution_file(_solution_file), - solution_name(_solution_name) -{ - pbl.ANSYSSol.push_back(this); -} - -void ANSYSSolution::write(std::ostream &out) const -{ - out << "mirrors::ANSYSSolution:\n"; - out << solution_type << "\n"; - out << solution_name << "\n"; - out << solution_file << "\n"; -} diff --git a/mirrors/src/wANSYSSolution.h b/mirrors/src/wANSYSSolution.h deleted file mode 100644 index 125d685e..00000000 --- a/mirrors/src/wANSYSSolution.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WANSYSSOLUTION_H -#define WANSYSSOLUTION_H - -#include "mirrors.h" -#include "wObject.h" -#include <vector> -#include <string> - -namespace mirrors -{ - -/** - * @brief manage ANSYS Solution - */ - -class MIRRORS_API ANSYSSolution : public fwk::wObject -{ -public: -#ifndef SWIG - std::string solution_type; - std::string solution_file; -#endif - std::string solution_name; - - double diff_abs; - double diff_rel; - - ANSYSSolution(mirrors::Problem &pbl, - std::string const &solution_type, - std::string const &solution_name, - std::string const &solution_file); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WANSYSSOLUTION_H diff --git a/mirrors/src/wMSurface.cpp b/mirrors/src/wMSurface.cpp deleted file mode 100644 index 9295be42..00000000 --- a/mirrors/src/wMSurface.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wMSurface.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" - -using namespace mirrors; - -MSurface::MSurface(Problem &pbl, int no, std::string _MS_name, Eigen::Vector3d _x0, Eigen::Vector3d _x1, Eigen::Vector3d _x2) : Group(pbl.msh, no), MS_name(_MS_name), x0(_x0), x1(_x1), x2(_x2) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.MS.push_back(this); -} - -MSurface::MSurface(mirrors::Problem &pbl, std::string const &name, std::string _MS_name, Eigen::Vector3d _x0, Eigen::Vector3d _x1, Eigen::Vector3d _x2) : Group(pbl.msh, name), MS_name(_MS_name), x0(_x0), x1(_x1), x2(_x2) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.MS.push_back(this); -} - -void MSurface::write(std::ostream &out) const -{ - out << "Mirrors surface named ''" << MS_name << "'' on " << *tag << "\n"; -} diff --git a/mirrors/src/wMSurface.h b/mirrors/src/wMSurface.h deleted file mode 100644 index 92b844f7..00000000 --- a/mirrors/src/wMSurface.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WMSURFACE_H -#define WMSURFACE_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> -#include <Eigen/Dense> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage Mirrors surface - */ - -class MIRRORS_API MSurface : public Group -{ -public: - std::string MS_name; - std::vector<Node *> nodes; - - Eigen::Vector3d x0; - Eigen::Vector3d x1; - Eigen::Vector3d x2; - - MSurface(Problem &pbl, int no, std::string _MS_name, Eigen::Vector3d _x0, Eigen::Vector3d _x1, Eigen::Vector3d _x2); - MSurface(Problem &pbl, std::string const &name, std::string _MS_name, Eigen::Vector3d _x0, Eigen::Vector3d _x1, Eigen::Vector3d _x2); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WMSURFACE_H diff --git a/mirrors/src/wMedium.cpp b/mirrors/src/wMedium.cpp deleted file mode 100644 index cf78fa38..00000000 --- a/mirrors/src/wMedium.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wMedium.h" -#include "wProblem.h" -#include "wTag.h" -using namespace mirrors; - -Medium::Medium(Problem &pbl, int no, std::string _medium_name, - double _E, double _nu, double _k, double _beta) : Group(pbl.msh, no), medium_name(_medium_name), - E(_E), nu(_nu), k(_k), beta(_beta) -{ - pbl.media.push_back(this); -} - -Medium::Medium(Problem &pbl, std::string const &name, std::string _medium_name, - double _E, double _nu, double _k, double _beta) : Group(pbl.msh, name), medium_name(_medium_name), - E(_E), nu(_nu), k(_k), beta(_beta) -{ - pbl.media.push_back(this); -} - -void Medium::write(std::ostream &out) const -{ - out << "Medium " << medium_name << " on " << *tag - << " with E=" << this->E << ", nu=" << this->nu - << ", k=" << this->k << " and beta=" << this->beta; -} diff --git a/mirrors/src/wMedium.h b/mirrors/src/wMedium.h deleted file mode 100644 index fb4db0be..00000000 --- a/mirrors/src/wMedium.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WMEDIUM_H -#define WMEDIUM_H - -#include "mirrors.h" -#include "wGroup.h" -#include <string> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief a thermomechanical medium - */ - -class MIRRORS_API Medium : public Group -{ -public: - std::string medium_name; - double E; ///< Young's modulus - double nu; ///< Poisson coefficient - double k; ///< Conductivity - double beta; - Medium(Problem &pbl, int no, std::string _medium_name, - double _E = 1000., double _nu = 0., double _k = 0., double _beta = 0.); - Medium(Problem &pbl, std::string const &name, std::string _medium_name, - double _E = 1000., double _nu = 0., double _k = 0., double _beta = 0.); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WMEDIUM_H diff --git a/mirrors/src/wProblem.cpp b/mirrors/src/wProblem.cpp deleted file mode 100644 index defa8059..00000000 --- a/mirrors/src/wProblem.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wProblem.h" -#include "wMshData.h" -#include "wMedium.h" -#include "wuDirichlet.h" -#include "wuNeumann.h" -#include "wTDirichlet.h" -#include "wTNeumann.h" -#include "wTSource.h" -#include "wElement.h" - -#include "wTag.h" -using namespace mirrors; - -Problem::Problem(std::shared_ptr<MshData> _msh, std::string _problem_type, double _T_ref) : msh(_msh), problem_type(_problem_type), T_ref(_T_ref) -{ -} - -/** - * @brief Initialize the elements precomputed values - */ -void Problem::initElems() -{ - // Update volume Jacobian - for (auto vol : media) - for (auto e : vol->tag->elems) - e->initValues(true); - // Update volume Jacobian (volumic sources) - for (auto vol : Tsrcs) - for (auto e : vol->tag->elems) - e->initValues(true); - // Update surface Jacobian (Neumann B.C.) - for (auto surf : nuBCs) - for (auto e : surf->tag->elems) - e->initValues(false); - for (auto surf : nTBCs) - for (auto e : surf->tag->elems) - e->initValues(false); -} - -void Problem::write(std::ostream &out) const -{ - out << "mirrors::Problem:\n"; - out << problem_type << "\n"; - out << " + mesh:\n"; - out << *msh; //wMshData.h - out << " + media:\n"; - for (auto m : media) - out << *m << '\n'; - out << " + mechanical Dirichlet boundary conditions:\n"; - for (auto b : duBCs) - out << *b << '\n'; - out << " + thermal Dirichlet boundary conditions:\n"; - for (auto b : dTBCs) - out << *b << '\n'; - out << " + volumic heat sources:\n"; - for (auto b : Tsrcs) - out << *b << '\n'; - ; - out << " + mechanical von Neumann boundary conditions:\n"; - for (auto b : nuBCs) - out << *b << '\n'; - out << " + thermal von Neumann boundary conditions:\n"; - for (auto b : nTBCs) - out << *b << '\n'; -} diff --git a/mirrors/src/wProblem.h b/mirrors/src/wProblem.h deleted file mode 100644 index 85e0cc7f..00000000 --- a/mirrors/src/wProblem.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WPROBLEM_H -#define WPROBLEM_H - -#include "mirrors.h" -#include "wObject.h" -#include <iostream> -#include <vector> -#include <string> -#include <memory> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief a class containing the problem parameters - */ - -class MIRRORS_API Problem : public fwk::wObject -{ -public: - std::shared_ptr<MshData> msh; ///< Mesh structure -#ifndef SWIG - std::string problem_type; // [RB] TODO use an enum instead! - std::vector<Medium *> media; ///< Materials - - std::vector<uDirichlet *> duBCs; ///< mechanical Dirichlet boundary conditions - std::vector<TDirichlet *> dTBCs; ///< thermal Dirichlet boundary conditions - - std::vector<TSource *> Tsrcs; ///< volumic heat sources - - std::vector<uNeumann *> nuBCs; ///< mechanical von Neumann boundary conditions - std::vector<TNeumann *> nTBCs; ///< thermal von Neumann boundary conditions - - std::vector<MSurface *> MS; ///< Mirrors surface - - //std::vector<uContact*> uContact; ///< mechanical contact interface - //std::vector<TContact*> TContact; ///< thermal contact interface - - double T_ref; -#endif - double Sol; - std::vector<ANSYSSolution *> ANSYSSol; ///< Ansys sol -public: - Problem(std::shared_ptr<MshData> _msh, std::string problem_type, double T_ref = 0); - -#ifndef SWIG - void initElems(); - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WPROBLEM_H diff --git a/mirrors/src/wSolver.cpp b/mirrors/src/wSolver.cpp deleted file mode 100644 index 412d3031..00000000 --- a/mirrors/src/wSolver.cpp +++ /dev/null @@ -1,903 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wSolver.h" -#include "wTimer.h" -#include "wProblem.h" -#include "wMedium.h" -#include "wuDirichlet.h" -#include "wuNeumann.h" -#include "wTDirichlet.h" -#include "wTNeumann.h" -#include "wTSource.h" -#include "wMSurface.h" -#include "wThermoMecaTerm.h" -#include "wTag.h" -#include "wMshData.h" -#include "wElement.h" -#include "wNode.h" -#include "wANSYSSolution.h" -#include <map> -#include <math.h> -#include "wResults.h" -#include "wMshExport.h" -#include "wLinearSolver.h" - -#include <Eigen/Sparse> -#include <deque> - -#include <tbb/global_control.h> -#include <tbb/parallel_for_each.h> -#include <tbb/spin_mutex.h> - -#include <cstring> -#include <sstream> -#include <iostream> -/* -// [RB] not needed anymore -#ifdef max -#undef max // pour std::numeric_limits<std::streamsize>::max() -#endif -*/ -using namespace fwk; -using namespace tbox; -using namespace mirrors; - -Solver::Solver(Problem &_pbl, std::shared_ptr<tbox::LinearSolver> _linsol, int _nthreads) : pbl(_pbl), linsol(_linsol), nthreads(_nthreads) -{ - // Update element memory - pbl.initElems(); -} - -void Solver::write(std::ostream &out) const -{ - out << "mirrors::Solver:\n"; - out << pbl; -} - -void Solver::start(MshExport *mshWriter) -{ - tms["total"].start(); - - std::cout << "\nSolver::start()...\n"; - - tbb::spin_mutex mutex; - - tbb::global_control control(tbb::global_control::max_allowed_parallelism, nthreads); - - //int a = 0; - //int b = 10; - //tbb::parallel_for_each(a,b, [=](int i) {if(i>5) return; std::cout << i << "\n";}); - - //std::cout << "hi\n"; - //return; - - // ------------------------------------------ - // - // Preprocessing - // - // ------------------------------------------ - tms["prepro"].start(); - std::cout << "\tPreprocessing...\n"; - double T_ref = pbl.T_ref; - - auto msh = pbl.msh; - - size_t pbl_size; - int T_first_index; - - if (pbl.problem_type == "mechanical") - { - pbl_size = 3 * (msh->nodes.size()); - T_first_index = 0; - } - else if (pbl.problem_type == "thermomechanical") - { - pbl_size = 4 * (msh->nodes.size()); - T_first_index = 3 * static_cast<int>(msh->nodes.size()); - } - else if (pbl.problem_type == "thermal") - { - pbl_size = msh->nodes.size(); - T_first_index = 0; - } - else - throw std::runtime_error("Unknown problem type."); - - tms["prepro"].stop(); - - // ------------------------------------------ - // - // Matrices assembly - // - // ------------------------------------------ - tms["Kass"].start(); - std::cout << "\tAssembly...\n"; - - // memory allocation - std::deque<Eigen::Triplet<double>> Trip; // list of triplets to build stiffness matrix - Eigen::SparseMatrix<double, Eigen::RowMajor> K(pbl_size, pbl_size); - std::vector<double> rhs(pbl_size); - std::vector<double> u(pbl_size); - Eigen::Map<Eigen::VectorXd> u_(u.data(), u.size()), rhs_(rhs.data(), rhs.size()); - - // loop on the media - for (auto m : pbl.media) - { - Tag ¤t_tag = *(m->tag); - std::cout << "\t\tProcessing " << current_tag << '\n'; - - if (pbl.problem_type == "mechanical" || pbl.problem_type == "thermomechanical") - { - // H matrix - double E = m->E; - double nu = m->nu; - - Eigen::MatrixXd H = Eigen::MatrixXd::Zero(6, 6); - H(0, 0) = 1 - nu; - H(1, 1) = 1 - nu; - H(2, 2) = 1 - nu; - H(3, 3) = (1 - 2 * nu) / 2; - H(4, 4) = (1 - 2 * nu) / 2; - H(5, 5) = (1 - 2 * nu) / 2; - H(0, 1) = nu; - H(1, 0) = H(0, 1); - H(0, 2) = nu; - H(2, 0) = H(0, 2); - H(1, 2) = nu; - H(2, 1) = H(1, 2); - H *= E / ((1 + nu) * (1 - 2 * nu)); - - // K matrix - //=============================tbb================================== - tbb::parallel_for_each(current_tag.elems.begin(), current_tag.elems.end(), [&](Element *e) { - // Element *e = current_tag.elems[index]; - - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - return; //if the element is not a tetrahedron or a hexahedron, it is not treated - - Eigen::MatrixXd K_e = ThermoMecaTerm::buildK(*e, H); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - { - Node *nodj = e->nodes[jj]; - //=====================================// - tbb::spin_mutex::scoped_lock lock(mutex); - //=====================================// - for (auto iii = 0; iii < 3; ++iii) - for (auto jjj = 0; jjj < 3; ++jjj) - if (K_e(3 * ii + iii, 3 * jj + jjj) != 0) - Trip.push_back(Eigen::Triplet<double>(3 * (nodi->row) + iii, 3 * (nodj->row) + jjj, K_e(3 * ii + iii, 3 * jj + jjj))); - } - } - }); - //=============================tbb================================== - } - - if (pbl.problem_type == "thermal" || pbl.problem_type == "thermomechanical") - { - // K_conductivity matrix - double conductivity = m->k; - Eigen::Matrix3d K_conductivity = Eigen::Matrix3d::Zero(); - for (auto i = 0; i < 3; ++i) - K_conductivity(i, i) = conductivity; - - // L matrix - //=============================tbb================================== - tbb::parallel_for_each(current_tag.elems.begin(), current_tag.elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - return; //if the element is not a tetrahedron or a hexahedron, it is not treated - - Eigen::MatrixXd L_e = ThermoMecaTerm::buildL(*e, K_conductivity); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - { - Node *nodj = e->nodes[jj]; - //=====================================// - tbb::spin_mutex::scoped_lock lock(mutex); - //=====================================// - if (L_e(ii, jj) != 0) - Trip.push_back(Eigen::Triplet<double>(T_first_index + (nodi->row), T_first_index + (nodj->row), L_e(ii, jj))); - } - } - }); - //=============================tbb================================== - } - - if (pbl.problem_type == "thermomechanical") - { - // D matrix - double E = m->E; - double nu = m->nu; - double beta = m->beta; - - double lambda = (nu * E) / ((1 + nu) * (1 - 2 * nu)); - double G = E / (2 * (1 + nu)); - - Eigen::Matrix3d D = Eigen::Matrix3d::Zero(); - //std::cout << "====================\n" << (lambda+(2./3.)*G) << "\n====================\n"; - for (auto i = 0; i < 3; ++i) - D(i, i) = -3 * (lambda + (2. / 3.) * G) * beta; - - // S matrix - //=============================tbb================================== - tbb::parallel_for_each(current_tag.elems.begin(), current_tag.elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - return; //if the element is not a tetrahedron or a hexahedron, it is not treated - - Eigen::MatrixXd S_e = ThermoMecaTerm::buildS(*e, D); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - { - Node *nodj = e->nodes[jj]; - //=====================================// - tbb::spin_mutex::scoped_lock lock(mutex); - //=====================================// - for (int iii = 0; iii < 3; ++iii) - if (S_e(3 * ii + iii, jj) != 0) - Trip.push_back(Eigen::Triplet<double>(3 * (nodi->row) + iii, T_first_index + (nodj->row), S_e(3 * ii + iii, jj))); - } - } - }); - //=============================tbb================================== - } - } - // Build matrix without BCs - K.setFromTriplets(Trip.begin(), Trip.end()); - tms["Kass"].stop(); - - // ------------------------------------------ - // - // volumetric heat sources and forces - // - // ------------------------------------------ - tms["vol_hs_F"].start(); - std::cout << "\tSources...\n"; - - if (pbl.problem_type == "thermal" || pbl.problem_type == "thermomechanical") - { - // loop on the thermal volumetric heat - for (auto b : pbl.Tsrcs) - { - Tag ¤t_tag = *(b->tag); - b->integrated_values = 0; - //loop on the elements - for (auto e : current_tag.elems) - { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - continue; //if the element is not a tetrahedron or a hexahedron, it is not treated - - Eigen::MatrixXd N_e = ThermoMecaTerm::buildM(*e); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - //double tmp_value = 0; - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - if (N_e(ii, jj) != 0) - { - rhs[T_first_index + (nodi->row)] += (b->values) * N_e(ii, jj); - b->integrated_values += (b->values) * N_e(ii, jj); - // tmp_value += N_e(ii,jj); - } - //std::cout << tmp_value << "\n"; - } - - //std::cout << "--------------\nElement " << *e << "\nCurrent integrated values: "<< b->integrated_values << "\n"; - } - std::cout << b->THS_name << " integrated values:" << b->integrated_values << "\n"; - } - } - tms["vol_hs_F"].stop(); - - // ------------------------------------------ - // - // von Neumann boundary conditions - // - // ------------------------------------------ - tms["nBC"].start(); - std::cout << "\tBoundary conditions...\n"; - if (pbl.problem_type == "mechanical" || pbl.problem_type == "thermomechanical") - { - // loop on the mechanical von Neumann BC - for (auto b : pbl.nuBCs) - { - Tag ¤t_tag = *(b->tag); - - //loop on the elements - for (auto e : current_tag.elems) - { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - continue; //if the element is not a triangle or a quadrangle, it is not treated - - Eigen::MatrixXd N_e = ThermoMecaTerm::buildM(*e); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - if (N_e(ii, jj) != 0) - for (auto iii = 0; iii < 3; ++iii) - if (b->which_dof(iii) == 1) - rhs[3 * (nodi->row) + iii] += b->values(iii) * N_e(ii, jj); - } - } - } - } - if (pbl.problem_type == "thermal" || pbl.problem_type == "thermomechanical") - { - // loop on the thermal von Neumann BC - for (auto b : pbl.nTBCs) - { - Tag ¤t_tag = *(b->tag); - b->integrated_values = 0; - //loop on the elements - for (auto e : current_tag.elems) - { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - continue; //if the element is not a triangle or a quadrangle, it is not treated - - Eigen::MatrixXd N_e = ThermoMecaTerm::buildM(*e); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - if (N_e(ii, jj) != 0) - { - rhs[T_first_index + (nodi->row)] += (b->values) * N_e(ii, jj); - b->integrated_values += (b->values) * N_e(ii, jj); - } - } - } - std::cout << b->BC_name << " integrated values:" << b->integrated_values << "\n"; - } - } - tms["nBC"].stop(); - - // ------------------------------------------ - // - // Dirichlet boundary conditions - // - // ------------------------------------------ - tms["dBC"].start(); - if (pbl.problem_type == "mechanical" || pbl.problem_type == "thermomechanical") - { - // loop on the mechanical Dirichlet BC - for (auto b : pbl.duBCs) - { - Tag ¤t_tag = *(b->tag); - - //loop on the elements - for (auto e : current_tag.elems) - { - if (e->type() == ELTYPE::QUAD4) - ; - else if (e->type() == ELTYPE::TRI3) - ; - else if (e->type() == ELTYPE::LINE2) - ; - else - continue; //if the element is not a triangle or a quadrangle, it is not treated - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - for (auto iii = 0; iii < 3; ++iii) - if (b->which_dof(iii) == 1) - { - Node *nodi = e->nodes[ii]; - for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K, 3 * nodi->row + iii); it; ++it) - { - if (it.row() == it.col()) - it.valueRef() = 1.; - else - it.valueRef() = 0.; - } - rhs[3 * (nodi->row) + iii] = b->values(iii); - } - } - } - } - if (pbl.problem_type == "thermal" || pbl.problem_type == "thermomechanical") - { - // loop on the thermal Dirichlet BC - for (auto b : pbl.dTBCs) - { - Tag ¤t_tag = *(b->tag); - - //loop on the elements - for (auto e : current_tag.elems) - { - if (e->type() == ELTYPE::QUAD4) - ; - else if (e->type() == ELTYPE::TRI3) - ; - else - continue; //if the element is not a triangle or a quadrangle, it is not treated - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - for (Eigen::SparseMatrix<double, Eigen::RowMajor>::InnerIterator it(K, T_first_index + nodi->row); it; ++it) - { - if (it.row() == it.col()) - it.valueRef() = 1.; - else - it.valueRef() = 0.; - } - rhs[T_first_index + nodi->row] = b->values - T_ref; - } - } - } - } - tms["dBC"].stop(); - - // ------------------------------------------ - // - // Matrices cleaning - // - // ------------------------------------------ - tms["Kclean"].start(); - std::cout << "\tCleaning matrices...\n"; - // Clean matrix and turn to compressed row format - K.prune(0.); - K.makeCompressed(); - tms["Kclean"].stop(); - - // ------------------------------------------ - // - // Solver - // - // ------------------------------------------ - tms["solve"].start(); - std::cout << "\tSolving linear system...\n"; - linsol->compute(K, rhs_, u_); - tms["solve"].stop(); - - // ------------------------------------------ - // - // Postprocessing - // - // ------------------------------------------ - tms["post"].start(); - std::cout << "\tPostprocessing...\n"; - // setup results - Results results; - - std::vector<double> displacement_x(msh->nodes.size()); - std::vector<double> displacement_y(msh->nodes.size()); - std::vector<double> displacement_z(msh->nodes.size()); - std::vector<double> displacement_u(msh->nodes.size()); - - std::vector<std::vector<double>> ansys_tmp(pbl.ANSYSSol.size(), std::vector<double>(msh->nodes.size(), 0)); - std::vector<std::vector<double>> ansys_tmp2(pbl.ANSYSSol.size(), std::vector<double>(msh->nodes.size(), 0)); - std::vector<std::vector<double>> ansys_tmp3(pbl.ANSYSSol.size(), std::vector<double>(msh->nodes.size(), 0)); - - std::vector<double> n_displacement(msh->nodes.size()); - std::vector<double> r_displacement(msh->nodes.size()); - std::vector<double> distance(msh->nodes.size()); - std::vector<double> rho(msh->nodes.size()); - std::vector<double> theta(msh->nodes.size()); - std::vector<double> surface(msh->nodes.size()); - std::vector<double> x_mirror(msh->nodes.size()); - std::vector<double> y_mirror(msh->nodes.size()); - - std::vector<double> Z_1(msh->nodes.size()); - std::vector<double> Z_2(msh->nodes.size()); - std::vector<double> Z_3(msh->nodes.size()); - std::vector<double> Z_4(msh->nodes.size()); - std::vector<double> Z_5(msh->nodes.size()); - std::vector<double> Z_6(msh->nodes.size()); - std::vector<double> Z_7(msh->nodes.size()); - std::vector<double> Z_8(msh->nodes.size()); - std::vector<double> Z_9(msh->nodes.size()); - std::vector<double> Z_10(msh->nodes.size()); - - std::vector<Eigen::Vector3d> displacement(msh->nodes.size()); - std::vector<Eigen::Vector3d> norm(msh->nodes.size()); - - std::vector<Eigen::MatrixXd> Strain_vector(msh->elems.size()); - for (auto &k : Strain_vector) - k = Eigen::Matrix3d::Zero(); - std::vector<Eigen::MatrixXd> Stress_vector(msh->elems.size()); - for (auto &k : Stress_vector) - k = Eigen::Matrix3d::Zero(); - - std::vector<double> Strain_xx_vector(msh->elems.size()); - std::vector<double> Strain_xy_vector(msh->elems.size()); - std::vector<double> Strain_xz_vector(msh->elems.size()); - std::vector<double> Strain_yy_vector(msh->elems.size()); - std::vector<double> Strain_yz_vector(msh->elems.size()); - std::vector<double> Strain_zz_vector(msh->elems.size()); - - std::vector<double> Stress_xx_vector(msh->elems.size()); - std::vector<double> Stress_xy_vector(msh->elems.size()); - std::vector<double> Stress_xz_vector(msh->elems.size()); - std::vector<double> Stress_yy_vector(msh->elems.size()); - std::vector<double> Stress_yz_vector(msh->elems.size()); - std::vector<double> Stress_zz_vector(msh->elems.size()); - - std::vector<double> T(msh->nodes.size()); - - double T_max = 0., u_max = 0., x_max = 0., y_max = 0., z_max = 0.; - - if (pbl.problem_type == "mechanical" || pbl.problem_type == "thermomechanical") - { - results.scalars_at_nodes["x"] = &displacement_x; - results.scalars_at_nodes["y"] = &displacement_y; - results.scalars_at_nodes["z"] = &displacement_z; - results.scalars_at_nodes["u"] = &displacement_u; - - results.scalars_at_elems["Strain[xx]"] = &Strain_xx_vector; - results.scalars_at_elems["Strain[xy]"] = &Strain_xy_vector; - results.scalars_at_elems["Strain[xz]"] = &Strain_xz_vector; - results.scalars_at_elems["Strain[yy]"] = &Strain_yy_vector; - results.scalars_at_elems["Strain[yz]"] = &Strain_yz_vector; - results.scalars_at_elems["Strain[zz]"] = &Strain_zz_vector; - - results.scalars_at_elems["Stress[xx]"] = &Stress_xx_vector; - results.scalars_at_elems["Stress[xy]"] = &Stress_xy_vector; - results.scalars_at_elems["Stress[xz]"] = &Stress_xz_vector; - results.scalars_at_elems["Stress[yy]"] = &Stress_yy_vector; - results.scalars_at_elems["Stress[yz]"] = &Stress_yz_vector; - results.scalars_at_elems["Stress[zz]"] = &Stress_zz_vector; - - results.vectors_at_nodes["displacement"] = &displacement; - - results.tensors_at_elems["Strain[tensor]"] = &Strain_vector; - results.tensors_at_elems["Stress[tensor]"] = &Stress_vector; - - for (size_t i = 0; i < msh->nodes.size(); ++i) - { - displacement_x[i] = u[i * 3]; - if (x_max < fabs(displacement_x[i])) - x_max = fabs(displacement_x[i]); - displacement_y[i] = u[i * 3 + 1]; - if (y_max < fabs(displacement_y[i])) - y_max = fabs(displacement_y[i]); - displacement_z[i] = u[i * 3 + 2]; - if (z_max < fabs(displacement_z[i])) - z_max = fabs(displacement_z[i]); - displacement_u[i] = sqrt(u[i * 3] * u[i * 3] + u[i * 3 + 1] * u[i * 3 + 1] + u[i * 3 + 2] * u[i * 3 + 2]); - if (u_max < fabs(displacement_u[i])) - u_max = fabs(displacement_u[i]); - - displacement[i] = Eigen::Vector3d(displacement_x[i], displacement_y[i], displacement_z[i]); - } - - // normal displacement of the mirror surface - // + compute an equivalent surface for each of its node - tms["Zernike"].start(); - for (auto ms : pbl.MS) - { - results.scalars_at_nodes["n_displacement"] = &n_displacement; - results.scalars_at_nodes["r_displacement"] = &r_displacement; - results.scalars_at_nodes["surface"] = &surface; - results.scalars_at_nodes["distance"] = &distance; - results.scalars_at_nodes["rho"] = ρ - results.scalars_at_nodes["theta"] = θ - results.scalars_at_nodes["x_mirror"] = &x_mirror; - results.scalars_at_nodes["y_mirror"] = &y_mirror; - results.vectors_at_nodes["norm"] = &norm; - - results.scalars_at_nodes["Z_1"] = &Z_1; - results.scalars_at_nodes["Z_2"] = &Z_2; - results.scalars_at_nodes["Z_3"] = &Z_3; - results.scalars_at_nodes["Z_4"] = &Z_4; - results.scalars_at_nodes["Z_5"] = &Z_5; - results.scalars_at_nodes["Z_6"] = &Z_6; - results.scalars_at_nodes["Z_7"] = &Z_7; - results.scalars_at_nodes["Z_8"] = &Z_8; - results.scalars_at_nodes["Z_9"] = &Z_9; - results.scalars_at_nodes["Z_10"] = &Z_10; - - Tag ¤t_tag = *(ms->tag); - - Eigen::Vector3d normal = current_tag.elems[0]->getNormal(); - - double max_distance = 0.; - - for (auto e : current_tag.elems) - { - if (e->type() != ELTYPE::HEX8 && e->type() != ELTYPE::TETRA4) - continue; //if the element is not a triangle or a quadrangle, it is not treated - - Eigen::MatrixXd N_e = ThermoMecaTerm::buildM(*e); - - for (size_t ii = 0; ii < e->nodes.size(); ++ii) - { - Node *nodi = e->nodes[ii]; - n_displacement[nodi->row] = displacement[nodi->row].dot(normal); - r_displacement[nodi->row] = n_displacement[nodi->row]; - norm[nodi->row] = normal; - distance[nodi->row] = (nodi->pos - ms->x0).norm(); - - if (max_distance < distance[nodi->row]) - max_distance = distance[nodi->row]; - - rho[nodi->row] = (nodi->pos - ms->x0).norm(); - x_mirror[nodi->row] = (nodi->pos - ms->x0).dot(ms->x1) / (ms->x1.norm()); - y_mirror[nodi->row] = (nodi->pos - ms->x0).dot(ms->x2) / (ms->x2.norm()); - - Z_1[nodi->row] = 1.; - - if (x_mirror[nodi->row] >= 0. && y_mirror[nodi->row] >= 0.) - theta[nodi->row] = atan(y_mirror[nodi->row] / x_mirror[nodi->row]); - else if (y_mirror[nodi->row] >= 0.) - theta[nodi->row] = atan(y_mirror[nodi->row] / x_mirror[nodi->row]) + M_PI; - else if (x_mirror[nodi->row] < 0.) - theta[nodi->row] = atan(y_mirror[nodi->row] / x_mirror[nodi->row]) + M_PI; - else - theta[nodi->row] = atan(y_mirror[nodi->row] / x_mirror[nodi->row]) + 2 * M_PI; - - for (size_t jj = 0; jj < e->nodes.size(); ++jj) - surface[nodi->row] += N_e(ii, jj); - } - } - - for (size_t ii = 0; ii < msh->nodes.size(); ++ii) - { - rho[ii] /= max_distance; - - Z_2[ii] = 2 * rho[ii] * cos(theta[ii]); - Z_3[ii] = 2 * rho[ii] * sin(theta[ii]); - Z_4[ii] = sqrt(3) * (2 * pow(rho[ii], 2.) - 1); - Z_5[ii] = sqrt(6) * pow(rho[ii], 2.) * sin(2 * theta[ii]); - Z_6[ii] = sqrt(6) * pow(rho[ii], 2.) * cos(2 * theta[ii]); - Z_7[ii] = sqrt(8) * (3 * pow(rho[ii], 3.) - 2 * rho[ii]) * sin(theta[ii]); - Z_8[ii] = sqrt(8) * (3 * pow(rho[ii], 3.) - 2 * rho[ii]) * cos(theta[ii]); - Z_9[ii] = sqrt(8) * pow(rho[ii], 3.) * sin(3 * theta[ii]); - Z_10[ii] = sqrt(8) * pow(rho[ii], 3.) * cos(3 * theta[ii]); - } - - Eigen::MatrixXd W = Eigen::MatrixXd::Zero(msh->nodes.size(), msh->nodes.size()); - Eigen::MatrixXd Z(msh->nodes.size(), 10); - Eigen::MatrixXd A(10, 10); - Eigen::VectorXd rhs_Z(10); // RHS - - for (size_t ii = 0; ii < msh->nodes.size(); ++ii) - { - W(ii, ii) = surface[ii]; - - Z(ii, 0) = Z_1[ii]; - Z(ii, 1) = Z_2[ii]; - Z(ii, 2) = Z_3[ii]; - Z(ii, 3) = Z_4[ii]; - Z(ii, 4) = Z_5[ii]; - Z(ii, 5) = Z_6[ii]; - Z(ii, 6) = Z_7[ii]; - Z(ii, 7) = Z_8[ii]; - Z(ii, 8) = Z_9[ii]; - Z(ii, 9) = Z_10[ii]; - } - - A = Z.transpose() * W * Z; - rhs_Z = Z.transpose() * W * Eigen::Map<Eigen::VectorXd>(n_displacement.data(), msh->nodes.size()); - Eigen::VectorXd c_Z = A.partialPivLu().solve(rhs_Z); - - std::cout << c_Z; - - for (size_t ii = 0; ii < msh->nodes.size(); ++ii) - for (auto jj = 0; jj < 10; ++jj) - r_displacement[ii] -= c_Z[jj] * Z(ii, jj); - } - tms["Zernike"].stop(); - - Eigen::MatrixXd Strain; - Eigen::MatrixXd Sigma; - - // loop on the medium - double sigma_max = 0.; - double sigma_vm = 0.; - for (auto m : pbl.media) - { - Tag ¤t_tag = *(m->tag); - - double E = m->E; - double nu = m->nu; - - double lambda = (nu * E) / ((1 + nu) * (1 - 2 * nu)); - double G = E / (2 * (1 + nu)); - - Eigen::MatrixXd H = Eigen::MatrixXd::Zero(9, 9); - - for (auto i = 0; i < 3; ++i) - for (auto j = 0; j < 3; ++j) - for (auto k = 0; k < 3; ++k) - for (auto l = 0; l < 3; ++l) - { - if (i == j && k == l) - H(i * 3 + j, k * 3 + l) = lambda; - if (i == k && j == l) - H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G; - if (i == l && j == k) - H(i * 3 + j, k * 3 + l) = H(i * 3 + j, k * 3 + l) + G; - } - - for (auto e : current_tag.elems) - { - if (e->type() == ELTYPE::HEX8 || e->type() == ELTYPE::TETRA4) - ThermoMecaTerm::strain_stress(*e, H, u, Strain, Sigma); - else - continue; - - auto i = e->no - 1; - - Strain_vector[i] = Strain; - Stress_vector[i] = Sigma; - - Stress_xx_vector[i] = Sigma(0, 0); - Stress_xy_vector[i] = Sigma(0, 1); - Stress_xz_vector[i] = Sigma(0, 2); - Stress_yy_vector[i] = Sigma(1, 1); - Stress_yz_vector[i] = Sigma(1, 2); - Stress_zz_vector[i] = Sigma(2, 2); - - Strain_xx_vector[i] = Strain(0, 0); - Strain_xy_vector[i] = Strain(0, 1); - Strain_xz_vector[i] = Strain(0, 2); - Strain_yy_vector[i] = Strain(1, 1); - Strain_yz_vector[i] = Strain(1, 2); - Strain_zz_vector[i] = Strain(2, 2); - - sigma_vm = sqrt((pow(Sigma(0, 0) - Sigma(1, 1), 2.) + pow(Sigma(1, 1) - Sigma(2, 2), 2.) + pow(Sigma(2, 2) - Sigma(0, 0), 2.) + 6 * (pow(Sigma(0, 1), 2.) + pow(Sigma(1, 2), 2.) + pow(Sigma(2, 0), 2.))) / 2); - - if (sigma_max < sigma_vm) - sigma_max = sigma_vm; - } - } - pbl.Sol = sigma_max; - } - if (pbl.problem_type == "thermal" || pbl.problem_type == "thermomechanical") - { - results.scalars_at_nodes["T"] = &T; - - for (size_t i = 0; i < msh->nodes.size(); ++i) - { - T[i] = u[T_first_index + i] + T_ref; - if (T_max < T[i]) - T_max = T[i]; - } - } - - int as_index = 0; - for (auto AS : pbl.ANSYSSol) - { - if (AS->solution_type == "T" && pbl.problem_type == "mechanical") - continue; - if (AS->solution_type == "u" && pbl.problem_type == "thermal") - continue; - if (AS->solution_type == "x" && pbl.problem_type == "thermal") - continue; - if (AS->solution_type == "y" && pbl.problem_type == "thermal") - continue; - if (AS->solution_type == "z" && pbl.problem_type == "thermal") - continue; - - results.scalars_at_nodes[AS->solution_name] = &ansys_tmp[as_index]; - std::string name2 = AS->solution_name + "_diff_abs"; - results.scalars_at_nodes[name2] = &ansys_tmp2[as_index]; - name2 = AS->solution_name + "_diff_rel"; - results.scalars_at_nodes[name2] = &ansys_tmp3[as_index]; - - FILE *read_file = fopen(AS->solution_file.c_str(), "r"); - if (!read_file) - { - std::stringstream str; - str << "Error opening file \"" << AS->solution_file << "\""; - throw std::runtime_error(str.str()); - } - double max_diff_abs = 0; - double max_diff_rel = 0; - - int index; - - while (1) - { - // read next line - char line[128]; - if (fgets(line, sizeof line, read_file) == NULL) - break; - else if (line[0] != 'N') - { - std::istringstream input(line); - - int i = 0; - - int i1 = -1; - double n1; - for (;;) - { - double n; - input >> n; - - if (input.eof() || input.bad()) - break; - else if (input.fail()) - { - input.clear(); // unset failbit - input.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // skip bad input - } - else if (i == 0) - i1 = static_cast<int>(n); // c'est pas beau! (Romain) - else if (i == 1) - n1 = n; - - ++i; - } - if (i1 != -1) - { - index = i1 - 1; - ansys_tmp[as_index][index] = n1; - if (AS->solution_type == "T") - { - ansys_tmp2[as_index][index] = fabs(ansys_tmp[as_index][index] - T[index]); - ansys_tmp3[as_index][index] = ansys_tmp2[as_index][index] / T_max; - } - else if (AS->solution_type == "u") - { - ansys_tmp2[as_index][index] = fabs(ansys_tmp[as_index][index] - displacement_u[index]); - ansys_tmp3[as_index][index] = ansys_tmp2[as_index][index] / u_max; - } - else if (AS->solution_type == "x") - { - ansys_tmp2[as_index][index] = fabs(ansys_tmp[as_index][index] - displacement_x[index]); - ansys_tmp3[as_index][index] = ansys_tmp2[as_index][index] / x_max; - } - else if (AS->solution_type == "y") - { - ansys_tmp2[as_index][index] = fabs(ansys_tmp[as_index][index] - displacement_y[index]); - ansys_tmp3[as_index][index] = ansys_tmp2[as_index][index] / y_max; - } - else if (AS->solution_type == "z") - { - ansys_tmp2[as_index][index] = fabs(ansys_tmp[as_index][index] - displacement_z[index]); - ansys_tmp3[as_index][index] = ansys_tmp2[as_index][index] / z_max; - } - - if (max_diff_abs <= ansys_tmp2[as_index][index]) - max_diff_abs = ansys_tmp2[as_index][index]; - - if (max_diff_rel <= ansys_tmp3[as_index][index]) - max_diff_rel = ansys_tmp3[as_index][index]; - } - } - } - - fclose(read_file); - AS->diff_abs = max_diff_abs; - AS->diff_rel = max_diff_rel; - ++as_index; - } - - mshWriter->save(msh->name, results); - tms["post"].stop(); - std::cout << "\tdone.\n"; - - tms["total"].stop(); - - std::cout << "\n---CPU statistics ---\n"; - std::cout << tms; - std::cout << "---------------------\n"; -} diff --git a/mirrors/src/wSolver.h b/mirrors/src/wSolver.h deleted file mode 100644 index 88b798d3..00000000 --- a/mirrors/src/wSolver.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WSOLVER_H -#define WSOLVER_H - -#include "mirrors.h" -#include "wObject.h" -#include "wTimers.h" -#include <iostream> -#include <memory> - -namespace mirrors -{ - -/** - * @brief a class containing the problem parameters - */ - -class MIRRORS_API Solver : public fwk::wObject -{ -public: -#ifndef SWIG - Problem &pbl; -#endif - std::shared_ptr<tbox::LinearSolver> linsol; ///< linear solver - fwk::Timers tms; ///< timers - int nthreads; ///< nb of threads for the assembly - -public: - Solver(Problem &pbl, std::shared_ptr<tbox::LinearSolver> _linsol, int nthreads = 1); - - void start(tbox::MshExport *mshWriter); -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WSOLVER_H diff --git a/mirrors/src/wTDirichlet.cpp b/mirrors/src/wTDirichlet.cpp deleted file mode 100644 index 938161cb..00000000 --- a/mirrors/src/wTDirichlet.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wTDirichlet.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -//#include <algorithm> -using namespace mirrors; - -TDirichlet::TDirichlet(mirrors::Problem &pbl, int no, std::string _BC_name, double _values) : Group(pbl.msh, no), BC_name(_BC_name), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.dTBCs.push_back(this); -} - -TDirichlet::TDirichlet(mirrors::Problem &pbl, std::string const &name, std::string _BC_name, double _values) : Group(pbl.msh, name), BC_name(_BC_name), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.dTBCs.push_back(this); -} - -void TDirichlet::write(std::ostream &out) const -{ - out << "Thermal Dirichlet BC named ''" << BC_name << "'' on " << *tag << "\n"; - out << "With fixed temperature of :"; - out << values << " .\n"; - for (auto n : nodes) - { - out << '\t' << *n << '\n'; - } -} diff --git a/mirrors/src/wTDirichlet.h b/mirrors/src/wTDirichlet.h deleted file mode 100644 index 680440d1..00000000 --- a/mirrors/src/wTDirichlet.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WTDIRICHLET_H -#define WTDIRICHLET_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage thermal Dirichlet BC - */ - -class MIRRORS_API TDirichlet : public Group -{ -public: - std::string BC_name; - std::vector<Node *> nodes; - double values; - - TDirichlet(Problem &pbl, int no, std::string _BC_name, double _values); - TDirichlet(Problem &pbl, std::string const &name, std::string _BC_name, double _values); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WTDIRICHLET_H diff --git a/mirrors/src/wTNeumann.cpp b/mirrors/src/wTNeumann.cpp deleted file mode 100644 index 6a8087d3..00000000 --- a/mirrors/src/wTNeumann.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wTNeumann.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" - -using namespace mirrors; - -TNeumann::TNeumann(mirrors::Problem &pbl, int no, - std::string _BC_name, double _values) : Group(pbl.msh, no), BC_name(_BC_name), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.nTBCs.push_back(this); -} - -TNeumann::TNeumann(mirrors::Problem &pbl, std::string const &name, - std::string _BC_name, double _values) : Group(pbl.msh, name), BC_name(_BC_name), - values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.nTBCs.push_back(this); -} - -void TNeumann::write(std::ostream &out) const -{ - out << "Thermal von Neumann BC named ''" << BC_name << "'' on " << *tag << "\n"; - out << "With fixed normal heat fluxes :"; - out << values << " .\n"; - for (auto n : nodes) - { - out << '\t' << *n << '\n'; - } -} diff --git a/mirrors/src/wTNeumann.h b/mirrors/src/wTNeumann.h deleted file mode 100644 index 5b340395..00000000 --- a/mirrors/src/wTNeumann.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WTNEUMANN_H -#define WTNEUMANN_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage thermal von Neumann BC - */ - -class MIRRORS_API TNeumann : public Group -{ -public: - std::string BC_name; - std::vector<Node *> nodes; - double values; - double integrated_values; - - TNeumann(Problem &pbl, int no, std::string _BC_name, double _values); - TNeumann(Problem &pbl, std::string const &name, std::string _BC_name, double _values); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WTNEUMANN_H diff --git a/mirrors/src/wTSource.cpp b/mirrors/src/wTSource.cpp deleted file mode 100644 index 77c6e5d9..00000000 --- a/mirrors/src/wTSource.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wTSource.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -//#include <algorithm> -using namespace mirrors; - -TSource::TSource(mirrors::Problem &pbl, int no, std::string _THS_name, double _values) : Group(pbl.msh, no), THS_name(_THS_name), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.Tsrcs.push_back(this); -} - -TSource::TSource(mirrors::Problem &pbl, std::string const &name, std::string _THS_name, double _values) : Group(pbl.msh, name), THS_name(_THS_name), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.Tsrcs.push_back(this); -} - -void TSource::write(std::ostream &out) const -{ - out << "Thermal heat source named ''" << THS_name << "'' on " << *tag << "\n"; - out << "With fixed normal heat fluxes :"; - out << values << " .\n"; - for (auto n : nodes) - { - out << '\t' << *n << '\n'; - } -} diff --git a/mirrors/src/wTSource.h b/mirrors/src/wTSource.h deleted file mode 100644 index 9413fa28..00000000 --- a/mirrors/src/wTSource.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WTSOURCE_H -#define WTSOURCE_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage thermal heat source - */ - -class MIRRORS_API TSource : public Group -{ -public: - std::string THS_name; - std::vector<Node *> nodes; - double values; - double integrated_values; - - TSource(Problem &pbl, int no, std::string _BTHS_name, double _values); - TSource(Problem &pbl, std::string const &name, std::string _THS_name, double _values); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WTSOURCE_H diff --git a/mirrors/src/wThermoMecaTerm.cpp b/mirrors/src/wThermoMecaTerm.cpp deleted file mode 100644 index 08cda9d0..00000000 --- a/mirrors/src/wThermoMecaTerm.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain k copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wThermoMecaTerm.h" - -#include "wElement.h" -#include "wCache.h" -#include "wGauss.h" -#include "wNode.h" - -using namespace mirrors; -using namespace tbox; - -/** - * @brief Build volume/surface mass matrix for the thermo-mechanical equation on one element - */ -Eigen::MatrixXd ThermoMecaTerm::buildM(Element const &e) -{ - // Get precomputed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Mass matrix - Eigen::MatrixXd M = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Shape functions - Eigen::VectorXd const &ff = cache.getSf(k); - M += ff * ff.transpose() * gauss.getW(k) * e.getDetJ(k); - } - return M; -} - -/** - * @brief Build mechanical matrix for the thermo-mechanical equation on one element - */ -Eigen::MatrixXd ThermoMecaTerm::buildK(tbox::Element const &e, Eigen::MatrixXd const &H) -{ - // Get precomputed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - size_t ns = e.nodes.size(); // number of nodes - - // Meca matrix - Eigen::MatrixXd K = Eigen::MatrixXd::Zero(3 * ns, 3 * ns); // 3 dimensions - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Jacobian inverse - Eigen::Matrix3d const &invJ = e.getJinv(k); - // Fill B matrix (shape functions) - Eigen::MatrixXd const &dff = cache.getDsf(k); - Eigen::MatrixXd B = Eigen::MatrixXd::Zero(6, 3 * ns); - for (size_t i = 0; i < ns; ++i) - { - // Compute [Ni,x Ni,y, Ni_z] - Eigen::Vector3d dN = invJ * dff.col(i); - B(0, 3 * i) = dN(0); - B(1, 3 * i + 1) = dN(1); - B(2, 3 * i + 2) = dN(2); - B(3, 3 * i + 1) = dN(2); - B(3, 3 * i + 2) = dN(1); - B(4, 3 * i) = dN(2); - B(4, 3 * i + 2) = dN(0); - B(5, 3 * i) = dN(1); - B(5, 3 * i + 1) = dN(0); - } - - // Compute stiffness matrix - K += B.transpose() * H * B * gauss.getW(k) * e.getDetJ(k); - } - return K; -} - -/** - * @brief Build thermal matrix for the thermo-mechanical equation on one element - */ -Eigen::MatrixXd ThermoMecaTerm::buildL(Element const &e, Eigen::MatrixXd const &C) -{ - // Get precomputed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - - // Thermal matrix - Eigen::MatrixXd L = Eigen::MatrixXd::Zero(e.nodes.size(), e.nodes.size()); - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Jacobian - double detJ = e.getDetJ(k); - Eigen::Matrix3d const &J = e.getJinv(k); - Eigen::MatrixXd const &dff = cache.getDsf(k); - - // [AC] I refactored this from an entry by entry assembly to a full matrix multiplication, - // but as nothing tests this method, I could not check the results. - L += (C * J * dff).transpose() * J * dff * gauss.getW(k) * detJ; - } - return L; -} - -/** - * @brief Build thermo-mechanical matrix for the thermo-mechanical equation on one element - */ -Eigen::MatrixXd ThermoMecaTerm::buildS(Element const &e, Eigen::MatrixXd const &D) -{ - // Get precomputed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - size_t ns = e.nodes.size(); // number of nodes - - // TM matrix - Eigen::MatrixXd S = Eigen::MatrixXd::Zero(3 * ns, ns); // 3 dimensions - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Jacobian and shape functions - double detJ = e.getDetJ(k); - Eigen::Matrix3d const &J = e.getJinv(k); - Eigen::MatrixXd const &dff = cache.getDsf(k); - - // S - for (size_t i = 0; i < ns; ++i) - S.block(i * 3, 0, 3, ns) += D * J * dff.col(i) * cache.getSf(k).transpose() * gauss.getW(k) * detJ; - } - return S; -} - -/** - * @brief Compute strain and stresses on one element - */ -void ThermoMecaTerm::strain_stress(Element const &e, Eigen::MatrixXd const &H, std::vector<double> const &u, Eigen::MatrixXd &Strain, Eigen::MatrixXd &Stress) -{ - // Get precomputed values - Cache &cache = e.getVCache(); - Gauss &gauss = cache.getVGauss(); - size_t ns = e.nodes.size(); // number of nodes - - Strain = Stress = Eigen::Matrix3d::Zero(); // 3 dimensions - Eigen::MatrixXd u_e(3, ns); - // store the solution - for (size_t i = 0; i < ns; ++i) - { - u_e(0, i) = u[3 * (e.nodes[i]->row)]; - u_e(1, i) = u[3 * (e.nodes[i]->row) + 1]; - u_e(2, i) = u[3 * (e.nodes[i]->row) + 2]; - } - for (size_t k = 0; k < gauss.getN(); ++k) - { - // Jacobian and strain - Eigen::Matrix3d const &J = e.getJinv(k); - Eigen::MatrixXd const &dff = cache.getDsf(k); - Eigen::Matrix3d du_d_Phi = Eigen::Matrix3d::Zero(); - for (size_t i = 0; i < ns; ++i) - du_d_Phi += dff.col(i) * u_e.col(i).transpose(); - Strain += ((J * du_d_Phi) + (J * du_d_Phi).transpose()) / ns / 2; - } - // stress - for (size_t i = 0; i < 3; ++i) - for (size_t j = 0; j < 3; ++j) - for (size_t k = 0; k < 3; ++k) - for (size_t l = 0; l < 3; ++l) - Stress(i, j) += H(i * 3 + j, k * 3 + l) * Strain(k, l); -} diff --git a/mirrors/src/wThermoMecaTerm.h b/mirrors/src/wThermoMecaTerm.h deleted file mode 100644 index 09730a94..00000000 --- a/mirrors/src/wThermoMecaTerm.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WTHERMOMECATERM_H -#define WTHERMOMECATERM_H - -#include "mirrors.h" - -#include <vector> -#include <Eigen/Dense> - -namespace mirrors -{ - -/** - * @brief Formulation of thermo-mechanical terms - */ -class MIRRORS_API ThermoMecaTerm -{ -public: - // Mass matrix - static Eigen::MatrixXd buildM(tbox::Element const &e); - // Thermo-mechanical matrices - static Eigen::MatrixXd buildK(tbox::Element const &e, Eigen::MatrixXd const &H); - static Eigen::MatrixXd buildL(tbox::Element const &e, Eigen::MatrixXd const &C); - static Eigen::MatrixXd buildS(tbox::Element const &e, Eigen::MatrixXd const &D); - // Strain/stress computation - static void strain_stress(tbox::Element const &e, Eigen::MatrixXd const &H, std::vector<double> const &u, Eigen::MatrixXd &Strain, Eigen::MatrixXd &Stress); -}; - -} // namespace mirrors -#endif //WTHERMOMECATERM_H diff --git a/mirrors/src/wuDirichlet.cpp b/mirrors/src/wuDirichlet.cpp deleted file mode 100644 index 3ceb032e..00000000 --- a/mirrors/src/wuDirichlet.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wuDirichlet.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -#include <algorithm> -using namespace mirrors; - -uDirichlet::uDirichlet(mirrors::Problem &pbl, - int no, std::string _BC_name, - Eigen::Vector3d _which_dof, Eigen::Vector3d _values) : Group(pbl.msh, no), BC_name(_BC_name), - which_dof(_which_dof), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.duBCs.push_back(this); -} - -uDirichlet::uDirichlet(mirrors::Problem &pbl, - std::string const &name, - std::string _BC_name, - Eigen::Vector3d _which_dof, Eigen::Vector3d _values) : Group(pbl.msh, name), BC_name(_BC_name), - which_dof(_which_dof), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.duBCs.push_back(this); -} - -/** - * @brief default implementation - */ - -/*void -Dirichlet::apply(std::vector<double> &rhs) -{ - for(auto n : nodes) - rhs[n->row] = val; -} -*/ - -void uDirichlet::write(std::ostream &out) const -{ - out << "Mechanical Dirichlet BC named ''" << BC_name << "'' on " << *tag << "\n"; - out << "With fixed displacement of ("; - if (which_dof(0) == 1) - out << values(0) << ", "; - else - out << "-, "; - if (which_dof(1) == 1) - out << values(1) << ", "; - else - out << "-, "; - if (which_dof(2) == 1) - out << values(2) << ")\n"; - else - out << "-)\n"; - out << "a '-' represents an unconstrained componenet of the displacement.\n"; - for (auto n : nodes) - { - out << '\t' << *n << '\n'; - } -} diff --git a/mirrors/src/wuDirichlet.h b/mirrors/src/wuDirichlet.h deleted file mode 100644 index cda4447a..00000000 --- a/mirrors/src/wuDirichlet.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WUDIRICHLET_H -#define WUDIRICHLET_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> -#include <Eigen/Dense> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage mechanical Dirichlet BC - */ - -class MIRRORS_API uDirichlet : public Group -{ -public: - std::string BC_name; - std::vector<Node *> nodes; - Eigen::Vector3d which_dof; - Eigen::Vector3d values; - - uDirichlet(Problem &pbl, int no, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values); - uDirichlet(Problem &pbl, std::string const &name, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values); - //virtual void apply(std::vector<double> &rhs); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WUDIRICHLET_H diff --git a/mirrors/src/wuNeumann.cpp b/mirrors/src/wuNeumann.cpp deleted file mode 100644 index d078fd6b..00000000 --- a/mirrors/src/wuNeumann.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "wuNeumann.h" -#include "wProblem.h" -#include "wTag.h" -#include "wElement.h" -#include "wNode.h" -#include <algorithm> -using namespace mirrors; - -uNeumann::uNeumann(mirrors::Problem &pbl, int no, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values) : Group(pbl.msh, no), BC_name(_BC_name), which_dof(_which_dof), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.nuBCs.push_back(this); -} - -uNeumann::uNeumann(mirrors::Problem &pbl, std::string const &name, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values) : Group(pbl.msh, name), BC_name(_BC_name), which_dof(_which_dof), values(_values) -{ - for (auto e : tag->elems) - for (auto n : e->nodes) - nodes.push_back(n); - - pbl.nuBCs.push_back(this); -} - -void uNeumann::write(std::ostream &out) const -{ - out << "Mechanical von Neumann BC named ''" << BC_name << "'' on " << *tag << "\n"; - out << "With fixed applied surfacic force ("; - if (which_dof(0) == 1) - out << values(0) << ", "; - else - out << "-, "; - if (which_dof(1) == 1) - out << values(1) << ", "; - else - out << "-, "; - if (which_dof(2) == 1) - out << values(2) << ")\n"; - else - out << "-)\n"; - out << "a '-' represents the fact that the associated DOF is not under a given force.\n"; - for (auto n : nodes) - { - out << '\t' << *n << '\n'; - } -} diff --git a/mirrors/src/wuNeumann.h b/mirrors/src/wuNeumann.h deleted file mode 100644 index 27418811..00000000 --- a/mirrors/src/wuNeumann.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WUNEUMANN_H -#define WUNEUMANN_H - -#include "mirrors.h" -#include "wGroup.h" -#include <vector> -#include <string> -#include <Eigen/Dense> - -using namespace tbox; - -namespace mirrors -{ - -/** - * @brief manage mechanical von Neumann BC - */ - -class MIRRORS_API uNeumann : public Group -{ -public: - std::string BC_name; - std::vector<Node *> nodes; - Eigen::Vector3d which_dof; - Eigen::Vector3d values; - - uNeumann(Problem &pbl, int no, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values); - uNeumann(Problem &pbl, std::string const &name, std::string _BC_name, Eigen::Vector3d _which_dof, Eigen::Vector3d _values); - -#ifndef SWIG - virtual void write(std::ostream &out) const override; -#endif -}; - -} // namespace mirrors - -#endif //WUNEUMANN_H diff --git a/mirrors/tests/.gitignore b/mirrors/tests/.gitignore deleted file mode 100644 index a2b87706..00000000 --- a/mirrors/tests/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ - -# do not ignore .msh -!*.msh - - diff --git a/mirrors/tests/__init__.py b/mirrors/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/mirrors/tests/mparams/__init__.py b/mirrors/tests/mparams/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/mirrors/tests/mparams/loop.py b/mirrors/tests/mparams/loop.py deleted file mode 100755 index 25d7969d..00000000 --- a/mirrors/tests/mparams/loop.py +++ /dev/null @@ -1,305 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - -def model(xi,f,d,fig,ax): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - #xi[0] = T_min + (T_max - T_min)*(xi[0]+1.)/2. - #xi[1] = H_1_min + (H_1_max - H_1_min)*(xi[1]+1.)/2. - sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], - W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0], - nogui = True) - #sol = 1 - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 900=30*30 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 30 - N[j] = 5 # [RB] was 30 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - for j in range(0,d): - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - #print xi - - sol[m_i] = model(xi,f,d,fig,ax) - - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - - os.chdir('..') - - if not args.nogui: - plt.draw() - os.chdir('images') - plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - m1 = 5 # [RB] was 100 - m2 = 5 # [RB] was 100 - - x = np.linspace(-1.,1.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - #------------------ - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - phi_tmp[i,j,:] = phi(xi,N,n_max,d) - - for i in range(0,m1): - for j in range(0,m2): - X[i,j] = Dom_min[0] + (Dom_max[0] - Dom_min[0])*(X[i,j]+1.)/2. - Y[i,j] = Dom_min[1] + (Dom_max[1] - Dom_min[1])*(Y[i,j]+1.)/2. - - for jj in range(0,k): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - #ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - surf.remove() - del surf - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - #ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() # [RB] bloque le display - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop2.py b/mirrors/tests/mparams/loop2.py deleted file mode 100755 index bc511dcf..00000000 --- a/mirrors/tests/mparams/loop2.py +++ /dev/null @@ -1,286 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi_2 - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - -def model(xi,f,d,fig,ax): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - xi[0] = T_min + (T_max - T_min)*(xi[0]+1.)/2. - xi[1] = H_1_min + (H_1_max - H_1_min)*(xi[1]+1.)/2. - sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], - W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0], - nogui = True) - #sol = 1 - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 900=30*30 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, W = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = math.factorial(N[0]+d) // (math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - - #print xi - - sol[m_i] = model(xi,f,d,fig,ax) - Z[m_i,:] = np.transpose(phi_2(xi,N,n_max,d)) - - W_sr[m_i,m_i] = 1 - for j in range(0,d): - W_sr[m_i,m_i] = W_sr[m_i,m_i]*W[i[j],j] - - os.chdir('..') - - if not args.nogui: - plt.draw() - os.chdir('images') - plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - m1 = 5 # [RB] was 40 - m2 = 5 # [RB] was 40 - - x = np.linspace(100.,300.,m1) - y = np.linspace(2.,10.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - - #------------------ - - for jj in range(0,n_max): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - surrogate[i,j] = np.dot(np.transpose(phi_2(xi,N,n_max,d)),s_hat) - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - #ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - surf.remove() - del surf - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - #ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() # [RB] bloque le display - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop3.py b/mirrors/tests/mparams/loop3.py deleted file mode 100755 index 78783666..00000000 --- a/mirrors/tests/mparams/loop3.py +++ /dev/null @@ -1,306 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi_3 - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - xi[0] = T_min + (T_max - T_min)*(xi[0]+1.)/2. - xi[1] = H_1_min + (H_1_max - H_1_min)*(xi[1]+1.)/2. - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], - #W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0], - #nogui = True) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 900=30*30 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - imported_sol = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - - #print xi - - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - Z[m_i,:] = np.transpose(phi_3(xi,N,n_max,d,Dom_min,Dom_max)) - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - print(np.dot(np.dot(np.transpose(Z),W),Z)) - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - m1 = 40 - m2 = 40 - - x = np.linspace(100.,300.,m1) - y = np.linspace(2.,10.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - #------------------ - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - phi_tmp[i,j,:] = phi_3(xi,N,n_max,d,Dom_min,Dom_max) - - for jj in range(0,min(n_max,k)): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - - surf.remove() - del surf - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop4.py b/mirrors/tests/mparams/loop4.py deleted file mode 100755 index 00352da3..00000000 --- a/mirrors/tests/mparams/loop4.py +++ /dev/null @@ -1,287 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi_3 - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - xi[0] = T_min + (T_max - T_min)*(xi[0]+1.)/2. - xi[1] = H_1_min + (H_1_max - H_1_min)*(xi[1]+1.)/2. - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], - #W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0], - #nogui = True) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 900=30*30 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - imported_sol = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - - #print xi - - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - Z[m_i,:] = np.transpose(phi_3(xi,N,n_max,d,Dom_min,Dom_max)) - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - A = np.dot(np.dot(np.transpose(Z),W),Z) - b = np.dot(np.dot(np.transpose(Z),W),sol) - s_hat = np.linalg.solve(A,b) - - print(A.shape) - print(b.shape) - print(s_hat.shape) - - #------------------ - - m1 = 40 - m2 = 40 - - x = np.linspace(100.,300.,m1) - y = np.linspace(2.,10.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2,n_max)) - X, Y = np.meshgrid(x, y) - - #------------------ - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - tmp = phi_3(xi,N,n_max,d,Dom_min,Dom_max) - surrogate[i,j,0] = s_hat[0]*tmp[0] - for jj in range(1,min(n_max,k)): - surrogate[i,j,jj] = surrogate[i,j,jj-1] + s_hat[jj]*tmp[jj] - - if not args.nogui: - for jj in range(0,min(n_max,k)): - surf = ax.plot_surface(X, Y, surrogate[:,:,jj], rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - - surf.remove() - del surf - - surf = ax.plot_surface(X, Y, surrogate[:,:,n_max-1], rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() # [RB] bloque le display - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop5.py b/mirrors/tests/mparams/loop5.py deleted file mode 100755 index 6cc4ac72..00000000 --- a/mirrors/tests/mparams/loop5.py +++ /dev/null @@ -1,309 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0]) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 100=10*10 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - imported_sol = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - for j in range(0,d): - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - #print xi - - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - m1 = 40 - m2 = 40 - - x = np.linspace(-1.,1.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - #------------------ - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - phi_tmp[i,j,:] = phi(xi,N,n_max,d) - - for i in range(0,m1): - for j in range(0,m2): - X[i,j] = Dom_min[0] + (Dom_max[0] - Dom_min[0])*(X[i,j]+1.)/2. - Y[i,j] = Dom_min[1] + (Dom_max[1] - Dom_min[1])*(Y[i,j]+1.)/2. - - for jj in range(0,min(n_max,k)): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - - surf.remove() - del surf - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop6.py b/mirrors/tests/mparams/loop6.py deleted file mode 100755 index e9dbc88d..00000000 --- a/mirrors/tests/mparams/loop6.py +++ /dev/null @@ -1,308 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0]) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 900=30*30 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - imported_sol = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.set_zlabel('Max Sigma_VM [MPA]') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - - print(xi) - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - #print sol - #print Z - #print W_sr - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - #print W_srZ - np.dot(U,np.dot(S,V_t)) - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - m1 = 40 - m2 = 40 - - x = np.linspace(-1.,1.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - #------------------ - - for i in range(0,m1): - for j in range(0,m2): - X[i,j] = Dom_min[0] + (Dom_max[0] - Dom_min[0])*(X[i,j]+1.)/2. - Y[i,j] = Dom_min[1] + (Dom_max[1] - Dom_min[1])*(Y[i,j]+1.)/2. - - for i in range(0,m1): - for j in range(0,m2): - xi = np.zeros((2,)) - xi[0] = X[i,j] - xi[1] = Y[i,j] - phi_tmp[i,j,:] = phi(xi,N,n_max,d) - - - - for jj in range(0,min(n_max,k)): - s_hat = s_hat + np.dot(np.transpose(U[:,jj]),np.dot(W_sr,sol))*V[:,jj]/S[jj,jj] - - for i in range(0,m1): - for j in range(0,m2): - surrogate[i,j] = np.dot(np.transpose(phi_tmp[i,j,:]),s_hat) - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - os.chdir('images') - plt.savefig('surrogate' + str(jj+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - - surf.remove() - del surf - - if not args.nogui: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text('Surrogate model with k = ' + str(jj+1)) - ax.set_zlim3d(np.amin(sol)-1.,np.amax(sol)+1.) - - - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - print(s_hat) - - print(M, file=f) - print(Z, file=f) - print(X, file=f) - print(sol, file=f) - print(s_hat, file=f) - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop7.py b/mirrors/tests/mparams/loop7.py deleted file mode 100755 index 9baa16e1..00000000 --- a/mirrors/tests/mparams/loop7.py +++ /dev/null @@ -1,224 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0]) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0]) - elif d == 2: - ax.scatter(xi[0],xi[1]) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] was 100 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 100 - N[j] = 5 # [RB] was 100 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - - imported_sol = np.array([ 36.44895637, 41.37049438, 49.76516253, 60.88913291, 73.75426071, 87.2174991, 100.08262689, 111.20659728, 119.60126543, 124.52280344, 36.27072553, 41.16819784, 49.52181712, 60.59139267, 73.3936116 , 86.79101644, 99.59323537, 110.66281093, 119.01643021, 123.91390251, 36.06881221, 40.93902107, 49.24613709, 60.25409009, 72.98504112, 86.30786475, 99.03881577, 110.04676878, 118.3538848 , 123.22409365, 35.80417517, 40.63865128, 48.8848179, 59.81200555, 72.44954953, 85.67462354, 98.31216752, 109.23935512, 117.48552179, 122.31999791, 35.39444216, 40.17359388, 48.32539372, 59.12753363, 71.62045707, 84.69418702, 97.18711047, 107.98925038, 116.14105022, 120.92020193, 34.84991829, 39.5555454 , 47.58193431, 58.21788929, 70.51861603, 83.39121389, 95.69194063, 106.32789561, 114.35428452, 119.05991164, 34.33755832, 38.97400378, 46.88238954, 57.36197578, 69.48185849, 82.16520472, 94.28508743, 104.76467367, 112.67305943, 117.30950489, 34.34587081, 38.98343867, 46.8937389, 57.37586205, 69.49867876, 82.18509539, 94.3079121, 104.79003525, 112.70033549, 117.33790334, 34.31183825, 38.94481084, 46.84727293, 57.31900958, 69.42981406, 82.10366001, 94.21446448, 104.68620113, 112.58866322, 117.22163582, 34.2781023, 38.90651968, 46.80121194, 57.26265262, 69.36154956, 82.02293438, 94.12183131, 104.58327199,112.47796425, 117.10638163]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca() - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - - print(xi) - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - if not args.nogui: - os.chdir('images') - plt.savefig('training_points.png', bbox_inches = 'tight') - os.chdir('..') - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/loop8.py b/mirrors/tests/mparams/loop8.py deleted file mode 100755 index 5cfb13ae..00000000 --- a/mirrors/tests/mparams/loop8.py +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import time -import os -import shutil -import math - -from params.src.func import grid -from params.src.func import next_indices -from params.src.func import phi - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - from matplotlib import cm - import matplotlib.pyplot as plt - from mpl_toolkits.mplot3d import Axes3D - - -def model(xi,f,d,fig,ax,imported_sol,m_i): - - import mirrors.models.mirror_ss as mirror_model - - T_min = 100. - T_max = 300. - - H_1_min = 2 - H_1_max = 10 - - L0 = 250.0 - L0_1 = 250.0 - H0 = 50 - H0_1 = 30 - W0 = 150 - - nL0_1 = 6 # 31 #11 - nL0 = 6 # 31 #11 - nH0 = 3 # 21 #6 - nH0_1 = 3 # 11 #6 - nW0 = 2 # 25 #5 - - #sol = mirror_model.runmodel(L = L0, L_1 = L0_1, H = H0, H_1 = xi[1], W = W0, nL_1 = nL0_1, nL = nL0, nH = nH0, nH_1 = nH0_1, nW = nW0, T = xi[0]) - #sol = 1 - - sol = imported_sol[m_i] - - - f.write('T = ' + str(xi[0]) + '.\n') - f.write('Sol = ' + str(sol) + '.\n') - if not args.nogui: - plot(xi,sol,d,fig,ax) - - return sol - -def plot(xi,sol,d,fig,ax): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0]) - elif d == 2: - ax.scatter(xi[0],xi[1]) - plt.pause(.001) - -def main(): - - d = 2 - k = 25 # [RB] =5*5? was 100=10*10 - M = np.zeros((d,), dtype =np.int) - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 5 # [RB] was 10 - N[j] = 5 # [RB] was 10 - - Dom_min = np.array([ -1., -1.]) - Dom_max = np.array([ 1., 1.]) - - imported_sol = np.array([ 1 ]) - - - #---------- - - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open('params_sol2.log','w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================\n') - - X, w = grid(M) - - print(M) - print(X) - - m_max = 1 - n_max = 1 #math.factorial(N[0]+d)/(math.factorial(N[0])*math.factorial(d)) - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - print(m_max) - print(n_max) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig = plt.figure() - if d == 1: - ax = fig.gca() - #ax.axis([100, 300, 20, 100]) - elif d == 2: - ax = fig.gca() - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - plt.ion() - - current_title = plt.title("Training points") - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - else: - fig = None - ax = None - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - f.write(name + '\n') - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - - for j in range(0,d): - xi[j] = X[i[j],j] - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - sol[m_i] = model(xi,f,d,fig,ax,imported_sol,m_i) - - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - os.chdir('..') - - if not args.nogui: - plt.draw() - #os.chdir('images') - #plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - #os.chdir('..') - #m_i = m_i + 1 - - p,i = next_indices(p,i,M,d) - - - - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - if not args.nogui: - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('i [-]') - ax.set_ylabel('sigma_i [-]') - os.chdir('images') - plt.savefig('SVD.png', bbox_inches = 'tight') - os.chdir('..') - - date2 = time.strftime("%d/%m/%Y") - hour2 = time.strftime("%H:%M:%S") - f.write('====================\n') - f.write('Simulations finished at: ' + date2 + ' ' + hour2 + '.\n') - - f.close() - - if not args.nogui: - plt.ioff() - plt.show() - - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/mparams/mparams.py b/mirrors/tests/mparams/mparams.py deleted file mode 100755 index 39cc7880..00000000 --- a/mirrors/tests/mparams/mparams.py +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import os -import shutil -import params.src.write as write -import params.src.indices as indices - -from fwk.wutils import parseargs -args = parseargs() -if not args.nogui: - import params.src.plot as plot - -def model(P): - - import mirrors.models.mirror_ss as mirror_model - - sol = mirror_model.runmodel(L = P[0], - L_1 = P[1], - H = P[2], - H_1 = P[3], - W = P[4], - nL_1 = P[5], - nL = P[6], - nH = P[7], - nH_1 = P[8], - nW = P[9], - T = P[10]) - - return sol - -def main(): - #-------------------------------------------------------- - normalisation = True - #-------------------------------------------------------- - fname = 'mparams.log' - #-------------------------------------------------------- - L = 250.0 - L_1 = 250.0 - H = 50 - H_1 = 30 - W = 150 - #-------------------------------------------------------- - nL_1 = 11 - nL = 11 - nH = 6 - nH_1 = 6 - nW = 5 - #-------------------------------------------------------- - T = 70 - #-------------------------------------------------------- - d = 2 - - P = np.array([L, L_1, H, H_1, W, nL_1, nL, nH, nH_1, nW, T]) - P_indices = np.array([10, 3], dtype =np.int) - - M = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 10 - - Dom_min = np.array([ 100., 2.]) - Dom_max = np.array([ 300., 10.]) - #-------------------------------------------------------- - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 10 - - k = 100 - #-------------------------------------------------------- - from params.src.monomials import phi # monomials or legendre - import params.src.gauss as tp # just gauss - imported_sol = np.array([]) - from mirrors.mparams_sols.s30x30 import import_sol # not usefull if recomputed - imported_sol, d, M, Dom_min, Dom_max = import_sol() - solver = 'TSVD' # Cholesky, QR, SVD, TSVD - #-------------------------------------------------------- - m1 = 40 - m2 = 40 - - #======================================================== - - f = write.init(fname) - - X, w = tp.grid(M) - - m_max = 1 - n_max = 1 - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - if not args.nogui: - fig, ax, current_title = plot.init(d) - - if not os.path.exists('images'): - os.mkdir('images') - else: - shutil.rmtree('images') - os.mkdir('images') - - m_i = 0 - sol = np.zeros((m_max,1)) - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - W_sr = np.zeros((m_max,m_max)) - - while np.all(i != -i_one): - - if normalisation == True: - for j in range(0,d): - xi[j] = X[i[j],j] - elif normalisation == False: - for j in range(0,d): - xi[j] = X[i[j],j] - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - P[P_indices[j]] = xi[j] - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - if normalisation == True: - for j in range(0,d): - xi[j] = Dom_min[j] + (Dom_max[j] - Dom_min[j])*(xi[j]+1.)/2. - P[P_indices[j]] = xi[j] - - if imported_sol.size == 0: - name = 'i_' - for j in range(0,d-1): - name = name + str(i[j]) + '_' - name = name + str(i[d-1]) + '_' - name = name + 'M_' - for j in range(0,d-1): - name = name + str(M[j]) + '_' - name = name + str(M[d-1]) - - if not os.path.exists(name): - os.mkdir(name) - else: - shutil.rmtree(name) - os.mkdir(name) - - os.chdir(name) - sol[m_i] = model(P) - os.chdir('..') - if not args.nogui: - plot.scatter(xi,sol[m_i],d,fig,ax, True,m_i) - - elif imported_sol.size != 0: - sol[m_i] = imported_sol[m_i] - if not args.nogui: - plot.scatter(xi,sol[m_i],d,fig,ax, False,m_i) - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - W_sr[m_i,m_i] = np.sqrt(W[m_i,m_i]) - p,i = indices.my_next(p,i,M,d) - m_i = m_i + 1 - - W_srZ = np.dot(W_sr,Z) - U, s, V_t = np.linalg.svd(W_srZ, full_matrices=True) - S = np.zeros((m_max,n_max)) - for j in range(0,n_max): - S[j,j] = s[j] - - s_hat = np.zeros((n_max,)) - - V = np.transpose(V_t) - - #------------------ - - x = np.linspace(-1.,1.,m1) - y = np.linspace(-1.,1.,m2) - X = np.zeros((m1,m2)) - Y = np.zeros((m1,m2)) - surrogate = np.zeros((m1,m2)) - X, Y = np.meshgrid(x, y) - phi_tmp = np.zeros((m1,m2,n_max)) - - if not args.nogui: - plot.SVD(n_max,s) - - write.sol(f, sol, m_max) - - write.finish(f) - - if not args.nogui: - plot.finish() - - -if __name__ == "__main__": - main() diff --git a/mirrors/tests/simple.py b/mirrors/tests/simple.py deleted file mode 100644 index 4324bda1..00000000 --- a/mirrors/tests/simple.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -if __name__ == "__main__": - import mirrors.models.mirror_ss as m - m.runmodel(L = 250.0, - L_1 = 250.0, - H = 50., - H_1 = 30., - W = 200., - nL_1 = 8, - nL = 8, - nH = 6, - nH_1 = 4, - nW = 5, - T = 0.) diff --git a/mirrors/viewer.py b/mirrors/viewer.py deleted file mode 100644 index 132ba290..00000000 --- a/mirrors/viewer.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import os, os.path - -class GUI: - def __init__(self): - pass - def open(self, gmshfile): - pyprefix = os.path.splitext(gmshfile)[0] # could be in python tree (.geo or .msh) - wkprefix = os.path.basename(pyprefix) # in current directory (workspace) - - # check .msh - if os.path.splitext(gmshfile)[1]=='.msh': - mshfile = gmshfile - else: - mshfile = wkprefix+'.msh' - if not os.path.isfile(mshfile): - raise Exception("file not found %s" % mshfile) - - # check results - posfile = wkprefix+".pos" - if not os.path.isfile(posfile): - raise Exception("file not found %s" % posfile) - - # check options - optfile1 = pyprefix+".opt" - optfile2 = wkprefix+".opt" - if os.path.isfile(optfile1): - optfile=optfile1 - else: - if not os.path.isfile(optfile2): - self.defopt(optfile2) - optfile=optfile2 - - cmd="gmsh %s %s %s" % (mshfile, posfile, optfile) - print("cmd=",cmd) - os.system(cmd) - - def defopt(self,fname='default.opt'): - f = open(fname,'w') - f.write("General.Orthographic = 0;\n") - f.write("General.RotationX = 25;\n") - f.write("General.RotationY = 45;\n") - f.write("General.RotationZ = 0;\n") - f.write("Mesh.SurfaceEdges = 0;\n") - f.write("Mesh.VolumeEdges = 0;\n") - - for i in range(0,60): - f.write("View[%d].Visible = 0;\n" % i) - f.write("View[%d].DrawQuadrangles = 0;\n" % i) - f.write("View[%d].DrawTriangles = 0;\n" % i) - f.write("View[%d].IntervalsType = 3;\n" % i) - f.write("View[0].Visible = 1;\n") - f.close() - diff --git a/params/CMakeLists.txt b/params/CMakeLists.txt deleted file mode 100644 index 75f2a2c8..00000000 --- a/params/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -ADD_SUBDIRECTORY( CVT ) - -# Add test dir -MACRO_AddTest(${CMAKE_CURRENT_SOURCE_DIR}/tests) diff --git a/params/CVT/CMakeLists.txt b/params/CVT/CMakeLists.txt deleted file mode 100644 index 9ebd5838..00000000 --- a/params/CVT/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ - -ADD_SUBDIRECTORY( src ) -ADD_SUBDIRECTORY( _src ) diff --git a/params/CVT/Makefile b/params/CVT/Makefile deleted file mode 100644 index d6805641..00000000 --- a/params/CVT/Makefile +++ /dev/null @@ -1,136 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/cmake-gui - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/kliegeois/Codes/waves - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/kliegeois/Codes/waves - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# Special rule for the target test -test: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." - /usr/bin/ctest --force-new-ctest-process $(ARGS) -.PHONY : test - -# Special rule for the target test -test/fast: test -.PHONY : test/fast - -# The main all target -all: cmake_check_build_system - cd /home/kliegeois/Codes/waves && $(CMAKE_COMMAND) -E cmake_progress_start /home/kliegeois/Codes/waves/CMakeFiles /home/kliegeois/Codes/waves/params/CVT/CMakeFiles/progress.marks - cd /home/kliegeois/Codes/waves && $(MAKE) -f CMakeFiles/Makefile2 params/CVT/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/kliegeois/Codes/waves/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/kliegeois/Codes/waves && $(MAKE) -f CMakeFiles/Makefile2 params/CVT/clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/kliegeois/Codes/waves && $(MAKE) -f CMakeFiles/Makefile2 params/CVT/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/kliegeois/Codes/waves && $(MAKE) -f CMakeFiles/Makefile2 params/CVT/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/kliegeois/Codes/waves && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... test" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/kliegeois/Codes/waves && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/params/CVT/__init__.py b/params/CVT/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/params/CVT/_src/CMakeLists.txt b/params/CVT/_src/CMakeLists.txt deleted file mode 100644 index 251350fa..00000000 --- a/params/CVT/_src/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# CMake input file of the SWIG wrapper around "paramsCVT.so" - -INCLUDE(${SWIG_USE_FILE}) - -FILE(GLOB SRCS *.h *.cpp *.inl *.swg) -FILE(GLOB ISRCS *.i) - -SET(CMAKE_SWIG_FLAGS "") -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES CPLUSPLUS ON) - -SET(SWINCFLAGS --I${PROJECT_SOURCE_DIR}/params/CVT/src --I${PROJECT_SOURCE_DIR}/tbox/src --I${PROJECT_SOURCE_DIR}/tbox/_src --I${PROJECT_SOURCE_DIR}/fwk/src --I${PROJECT_SOURCE_DIR}/fwk/_src -) -SET_SOURCE_FILES_PROPERTIES(${ISRCS} PROPERTIES SWIG_FLAGS "${SWINCFLAGS}") - -if (${CMAKE_VERSION} VERSION_LESS "3.8.0") - SWIG_ADD_MODULE(paramsCVTw python ${ISRCS} ${SRCS}) -else() - SWIG_ADD_LIBRARY(paramsCVTw LANGUAGE python SOURCES ${ISRCS} ${SRCS}) -endif() -MACRO_DebugPostfix(_paramsCVTw) - -# --- - -TARGET_INCLUDE_DIRECTORIES(_paramsCVTw PRIVATE ${PROJECT_SOURCE_DIR}/params/CVT/src - ${PYTHON_INCLUDE_PATH} -) - -SWIG_LINK_LIBRARIES(paramsCVTw - paramsCVT ${PYTHON_LIBRARIES} -) - diff --git a/params/CVT/_src/paramsCVTw.i b/params/CVT/_src/paramsCVTw.i deleted file mode 100644 index 49d87d93..00000000 --- a/params/CVT/_src/paramsCVTw.i +++ /dev/null @@ -1,45 +0,0 @@ -// SWIG input file of the 'paramsCVT' module - -%feature("autodoc","1"); - -%module(docstring= -"'paramsCVTw' module -(c) ULg - A&M", -directors="1", -threads="1" -) paramsCVTw -%{ - -#include <string> -#include <sstream> -#include <typeinfo> -#include <memory> -//#include "wGroup.h" -#include "paramsCVT.h" -#include "interface.hpp" - - - -//Fix for missing SWIGPY_SLICE_ARG with some versions of swig. -#if PY_VERSION_HEX >= 0x03020000 -# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj)) -#else -# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj)) -#endif - -%} - - -//%include "fwkw.swg" - -// ----------- MODULES UTILISES ------------ -//%import "fwkw.i" -//%import "tboxw.i" - -// ----------- paramsCVT CLASSES ---------------- -%include "paramsCVT.h" -%include "interface.hpp" - -//%shared_ptr(paramsCVT::Interface); - - diff --git a/params/CVT/python/__init__.py b/params/CVT/python/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/params/CVT/python/cvt_circle.txt b/params/CVT/python/cvt_circle.txt deleted file mode 100644 index 2183ceaf..00000000 --- a/params/CVT/python/cvt_circle.txt +++ /dev/null @@ -1,100 +0,0 @@ - 0.2828702971456529 -0.2091609847560236 - 0.5542653790290903 0.4810177310381479 - -0.8528689192489384 0.3376232571865748 - -0.09223257177512326 0.7366415184715666 - -0.6478944168285741 -0.6407202696803841 - -0.03267231892081109 -0.2994773139343201 - -0.892665784719795 -0.1730342600615951 - -0.6403210864419372 0.6564320046713876 - 0.6513024463830718 -0.3961238578442469 - -0.4072542518498234 0.5989763278843296 - 0.4249448629898269 -0.6439704559476371 - 0.002986278162257444 0.1905313846197395 - -0.2712622039986944 0.4325531977786739 - -0.3029597205560831 0.04164199655589694 - 0.3845673783925466 -0.358688876417124 - 0.2560551983095679 0.8659524543963052 - -0.4624542968351243 0.358605348947994 - -0.4878546582127999 0.771346137481288 - -0.3058072923088176 0.8266772650738684 - -0.756403624197948 0.497417763532858 - -0.3588682253603253 -0.1755495314175194 - 0.2851124911305183 0.3266677388712985 - 0.3690633184351524 0.4838926571759171 - 0.1993735744646651 0.1656929039697139 - 0.5112046125713184 -0.5011312084308176 - -0.6313271385753103 -0.4067112924749235 - 0.7262040120765708 0.5465732629328716 - 0.1509509656074359 -0.600884324054251 - 0.4598051928683273 0.02186036505998669 - -0.9243917904714678 0.01314179294792034 - -0.5155721767425243 -0.7518019681909923 - -0.1923563384312235 -0.1383017953666017 - 0.281639272768583 -0.03483967173455654 - 0.5298400609761601 -0.2766120233750742 - -0.1753204189891659 -0.6190086312850063 - -0.01848064328241212 0.5373998091173736 - -0.6807242940215256 0.1208383346565519 - -0.7737834877326869 -0.02109512016230561 - -0.1348519747943258 -0.7733641236127684 - -0.3420889454783066 -0.6730058705512512 - 0.4287556385738289 -0.1410760366556213 - -0.3357178791685564 0.2449259561878715 - 0.1700634367945581 0.5062635729054046 - -0.4885516564888375 0.1655262188568074 - -0.8845153115236732 0.1723079331202123 - 0.3724776268044515 0.1536707005121546 - -0.199403487432681 -0.8989926926902773 - 0.1000110177192902 0.703041137082532 - 0.08075706072371953 -0.4563162672251321 - 0.7416833280186406 0.1304692334614651 - -0.5323782649717179 -0.234699579372687 - 0.1341304870986246 -0.158364185959806 - -0.617943494600219 -0.06570731332682264 - -0.1036648445019651 -0.4540858356720994 - 0.2893620151654799 -0.5101014668180077 - 0.641639307799066 -0.6418327591849968 - -0.29741035145739 -0.508662485355708 - 0.5207109893266801 -0.7619228113213559 - -0.5735728536728896 0.4881121642650632 - 0.9079181966425052 0.02694413193218292 - -0.1080485351008261 0.04406370515282654 - 0.1016948059683681 0.02661461982350414 - -0.002600904832660977 -0.6085579275863474 - 0.07374743397688727 -0.7664821670312982 - -0.6640793514678952 0.296995923252917 - 0.7643885768961821 -0.5054600365844288 - 0.8936906482341029 0.2039053799882985 - 0.672453140666556 0.3292436158413026 - 0.8501482807091139 -0.34741606946982 - 0.3524567104651763 -0.8502063203010041 - 0.4539957866451093 0.6274345970273012 - -0.7167475138422619 -0.2240724094866041 - 0.7134359635940657 -0.2263749751006319 - -0.4913566723243057 -0.5495034924159241 - 0.254598421918615 -0.7191912883375334 - -0.08370881080579411 0.3898680620859699 - -0.4255583172932013 -0.3692719506791656 - 0.2816370363984803 0.6790168034418484 - -0.8409568421167869 -0.3699833070044923 - -0.02807365701116479 -0.1093473174193598 - -0.01056684620342956 -0.9234117760659044 - 0.9007972297125758 -0.1601373126531974 - -0.181965006928069 0.2182072835478417 - -0.2178061874381318 0.6085008883020032 - 0.175383376813371 -0.3360121703029081 - 0.842144900380826 0.3771559119706856 - 0.1782988147220711 -0.9034103337922581 - -0.3696160442580742 -0.8401670860676113 - 0.4913792364827602 0.3183510312356101 - 0.6097658046503908 0.7039323050342569 - 0.603710524360573 -0.07574889043020117 - 0.7634290301986257 -0.04239062410740677 - -0.2336405627627046 -0.324470809443849 - 0.5699016347544585 0.1515795359876787 - 0.4488086780863618 0.8078113677922019 - 0.06393700392222761 0.9109164823575895 - -0.4536168898076911 -0.0213039463094083 - -0.7588427393127493 -0.5221936199149103 - -0.117783410733357 0.9052747127524029 - 0.09945697079109234 0.3453142454049659 diff --git a/params/CVT/python/cvt_circle3.txt b/params/CVT/python/cvt_circle3.txt deleted file mode 100644 index 30d470b0..00000000 --- a/params/CVT/python/cvt_circle3.txt +++ /dev/null @@ -1,100 +0,0 @@ - 3.883827532395979 -3.765125144962427 - 0.8831313218159746 0.9358033707660407 - -0.07058416841654863 0.1956343915143997 - 0.1621657935986749 1.828417881155318 - -0.01381633396808021 -0.00255009358797246 - -0.9552113133102818 -4.058716978279694 - -0.08637121231672155 -0.151618914943767 - -0.2985864728810076 0.3373041337442155 - 0.9744306411504523 -0.61374269542729 - -0.6269168844189946 1.65963531413413 - 0.5183456395303485 -0.7312164427983908 - -2.32051699338688 4.862628716057294 - -1.722389948055731 3.266198370820328 - -5.244282663908272 -1.06124808175835 - 1.864584735459048 -2.391489162795495 - 0.05835929055141108 0.8214246599418964 - -2.368319655520331 1.714696256944555 - -0.596149575232982 0.4570734680022877 - -0.6927506395861925 1.049216877521899 - -0.2081358292680235 0.04780589655227682 - -3.377378524868312 -2.763753318546448 - 2.786074135276995 1.992960115592194 - 0.8926330573394695 1.64467281516618 - 4.570914281549617 3.072870154336136 - 1.395664737515424 -1.135193415609614 - -1.069650362978584 -0.2383348251850873 - 0.1646340174694586 0.3123610904203676 - 0.5337490214312932 -2.29959343455679 - 2.22379367293872 -0.421345433770667 - -0.8968654796557737 0.1517552826728196 - -0.6899971963756072 -0.5076354991234667 - -2.596357691323504 -4.790557287064093 - 3.983664168758844 0.9460073427487885 - 2.152241179081987 -1.281576343455297 - -0.925943569098694 -1.292691861339999 - -0.4812268671700445 2.637723626859167 - -2.162575325872686 0.5412214592870754 - -1.486766332694226 0.3457526535596253 - -0.2523530355617994 -1.229201690218703 - -1.04526888755424 -0.7438299035870539 - 3.394204280605746 -1.391396527541842 - -3.328125988684061 2.65709588563169 - 2.350084057714168 3.366707208798742 - -3.391151810334394 0.5810760778721186 - 0.07818621427081067 0.0869026094288414 - 3.360020135123194 -0.06349720387312836 - -0.4937916971906605 -0.8573161783031144 - -0.1461986570625701 1.230140924466724 - 0.8016780475041438 -3.438078878419424 - 1.499491712541763 0.9921138187607362 - -2.419039846981757 -0.400918929406574 - 0.3173917027318898 -6.404827763884023 - -1.650160772699724 -0.2736096484664249 - -0.4040854357871383 -2.782471930333655 - 1.162037344693363 -1.853425293317329 - 0.2601471852859887 -0.2780009756418078 - -1.187591749539084 -1.897682125374551 - -0.01889626148228069 -0.3664332234580055 - -1.425829138821426 1.175218117965354 - 0.4414593329501229 -0.0775232005184327 - -5.417875616879255 4.108813562053538 - 6.011570622596236 0.01744269218612005 - -0.3220383988741655 -1.817760984522603 - 0.3184844349535418 -1.59643289161753 - -0.9928925245271623 0.6341838106277512 - 0.1217327783698644 -0.1025186285929168 - 0.6883233218370447 0.5071682753254095 - 1.129164359090114 0.3635423201915469 - 0.603517240729884 -0.3362859962402049 - 0.2198348949792596 -0.5707745838717551 - 0.4176602170601078 1.160847976230166 - -0.6272408430102234 -0.1765740568968605 - 1.531976601168381 -0.4341630716223191 - -1.646478949092162 -0.9707014684218912 - 0.7529363277312366 -1.21739063830245 - 0.05950753468068107 3.750834024637884 - -2.309276186607678 -1.562571394813861 - 0.870461585128818 2.723495180070793 - -0.5002979749101549 0.1145850461964296 - 1.822324348580794 -5.135012223718209 - -0.1090918185087817 -0.7387827262288574 - 0.7216762984472588 0.07570192786391783 - -5.672122103824182 1.596246180020678 - -1.428514848402364 2.090381290686623 - 2.533682898955609 -3.006740222630541 - 0.2618068040694636 0.05767711827692287 - 0.1963451066361999 -1.032593819091312 - -0.3141797275034413 -0.4513383541371406 - 1.725701946187217 1.815149483290902 - 0.4441583370724945 0.2570087681182026 - 1.734070195849477 0.251326686118855 - 1.051884252933041 -0.1306554516476171 - -1.972005684859595 -2.75689867416677 - 2.314401383508188 0.8485430664392628 - 0.3307345345178666 0.6187041419333389 - -0.04758114609104804 0.4880494779636085 - -3.587863324136343 -0.8537159951135134 - -0.3116090485739437 -0.1637922261479131 - -0.3277437099535738 0.7559505947519697 - 0.9209713510244626 4.808805356079615 diff --git a/params/CVT/python/cvt_circle4.txt b/params/CVT/python/cvt_circle4.txt deleted file mode 100644 index 30d470b0..00000000 --- a/params/CVT/python/cvt_circle4.txt +++ /dev/null @@ -1,100 +0,0 @@ - 3.883827532395979 -3.765125144962427 - 0.8831313218159746 0.9358033707660407 - -0.07058416841654863 0.1956343915143997 - 0.1621657935986749 1.828417881155318 - -0.01381633396808021 -0.00255009358797246 - -0.9552113133102818 -4.058716978279694 - -0.08637121231672155 -0.151618914943767 - -0.2985864728810076 0.3373041337442155 - 0.9744306411504523 -0.61374269542729 - -0.6269168844189946 1.65963531413413 - 0.5183456395303485 -0.7312164427983908 - -2.32051699338688 4.862628716057294 - -1.722389948055731 3.266198370820328 - -5.244282663908272 -1.06124808175835 - 1.864584735459048 -2.391489162795495 - 0.05835929055141108 0.8214246599418964 - -2.368319655520331 1.714696256944555 - -0.596149575232982 0.4570734680022877 - -0.6927506395861925 1.049216877521899 - -0.2081358292680235 0.04780589655227682 - -3.377378524868312 -2.763753318546448 - 2.786074135276995 1.992960115592194 - 0.8926330573394695 1.64467281516618 - 4.570914281549617 3.072870154336136 - 1.395664737515424 -1.135193415609614 - -1.069650362978584 -0.2383348251850873 - 0.1646340174694586 0.3123610904203676 - 0.5337490214312932 -2.29959343455679 - 2.22379367293872 -0.421345433770667 - -0.8968654796557737 0.1517552826728196 - -0.6899971963756072 -0.5076354991234667 - -2.596357691323504 -4.790557287064093 - 3.983664168758844 0.9460073427487885 - 2.152241179081987 -1.281576343455297 - -0.925943569098694 -1.292691861339999 - -0.4812268671700445 2.637723626859167 - -2.162575325872686 0.5412214592870754 - -1.486766332694226 0.3457526535596253 - -0.2523530355617994 -1.229201690218703 - -1.04526888755424 -0.7438299035870539 - 3.394204280605746 -1.391396527541842 - -3.328125988684061 2.65709588563169 - 2.350084057714168 3.366707208798742 - -3.391151810334394 0.5810760778721186 - 0.07818621427081067 0.0869026094288414 - 3.360020135123194 -0.06349720387312836 - -0.4937916971906605 -0.8573161783031144 - -0.1461986570625701 1.230140924466724 - 0.8016780475041438 -3.438078878419424 - 1.499491712541763 0.9921138187607362 - -2.419039846981757 -0.400918929406574 - 0.3173917027318898 -6.404827763884023 - -1.650160772699724 -0.2736096484664249 - -0.4040854357871383 -2.782471930333655 - 1.162037344693363 -1.853425293317329 - 0.2601471852859887 -0.2780009756418078 - -1.187591749539084 -1.897682125374551 - -0.01889626148228069 -0.3664332234580055 - -1.425829138821426 1.175218117965354 - 0.4414593329501229 -0.0775232005184327 - -5.417875616879255 4.108813562053538 - 6.011570622596236 0.01744269218612005 - -0.3220383988741655 -1.817760984522603 - 0.3184844349535418 -1.59643289161753 - -0.9928925245271623 0.6341838106277512 - 0.1217327783698644 -0.1025186285929168 - 0.6883233218370447 0.5071682753254095 - 1.129164359090114 0.3635423201915469 - 0.603517240729884 -0.3362859962402049 - 0.2198348949792596 -0.5707745838717551 - 0.4176602170601078 1.160847976230166 - -0.6272408430102234 -0.1765740568968605 - 1.531976601168381 -0.4341630716223191 - -1.646478949092162 -0.9707014684218912 - 0.7529363277312366 -1.21739063830245 - 0.05950753468068107 3.750834024637884 - -2.309276186607678 -1.562571394813861 - 0.870461585128818 2.723495180070793 - -0.5002979749101549 0.1145850461964296 - 1.822324348580794 -5.135012223718209 - -0.1090918185087817 -0.7387827262288574 - 0.7216762984472588 0.07570192786391783 - -5.672122103824182 1.596246180020678 - -1.428514848402364 2.090381290686623 - 2.533682898955609 -3.006740222630541 - 0.2618068040694636 0.05767711827692287 - 0.1963451066361999 -1.032593819091312 - -0.3141797275034413 -0.4513383541371406 - 1.725701946187217 1.815149483290902 - 0.4441583370724945 0.2570087681182026 - 1.734070195849477 0.251326686118855 - 1.051884252933041 -0.1306554516476171 - -1.972005684859595 -2.75689867416677 - 2.314401383508188 0.8485430664392628 - 0.3307345345178666 0.6187041419333389 - -0.04758114609104804 0.4880494779636085 - -3.587863324136343 -0.8537159951135134 - -0.3116090485739437 -0.1637922261479131 - -0.3277437099535738 0.7559505947519697 - 0.9209713510244626 4.808805356079615 diff --git a/params/CVT/python/cvt_circle5.txt b/params/CVT/python/cvt_circle5.txt deleted file mode 100644 index f6bed833..00000000 --- a/params/CVT/python/cvt_circle5.txt +++ /dev/null @@ -1,1000 +0,0 @@ - -0.6779502216324782 0.7157005403436005 - -0.1093393668148959 0.3401770500998343 - -1.448347886835644 0.8716094935175305 - 0.1910235480250283 -0.3997059777331784 - 0.09626450000936175 -0.653943935475595 - 0.5795312217445855 -0.09383730881226354 - 0.6546100853111286 -0.6283348130390844 - -0.3095014729472879 0.04270348670311847 - 0.3437581801280392 0.3349565892029067 - -0.4030120100313533 -0.4581254825325837 - -1.433841610983309 -0.1779729935660897 - -0.2481555909863227 -0.2758901052985642 - -0.6867494683818509 -0.7543712205458533 - -1.530406570452188 -2.492996702583593 - -1.577806755715164 -0.04280413313210967 - 0.3656837862824921 -0.008445233179474283 - 0.8811812489980702 0.6295125472620591 - 0.4778298533168207 0.5411716015639355 - 0.2834397947070305 0.002931033917037044 - 0.145241385556773 -0.3721176258251838 - 0.4462265329550443 0.05898569993947948 - 0.2106087531449191 -0.146291250667853 - 0.2714391723547592 -1.196027707773499 - -0.06448596258991918 0.2244354000681928 - -0.2059059765645166 -0.07983872312263059 - 2.317780615628731 -0.05536392183106454 - -0.2712869636670325 -0.521186871930327 - -0.9284527467690603 0.6857069055895776 - -4.762607798641898 -0.5444991487775376 - 4.948961782053221 -2.020066943130637 - -0.01933404866375374 -0.1732405321344336 - -0.2777203683977414 0.1905035092875364 - 0.129701507279424 -0.8356121253642455 - 0.3122193322228531 -0.2921546758392889 - 0.558746832100379 0.02022564284568676 - 3.826950648349705 0.6461650711959211 - 0.198392890719692 -0.06422386205849417 - -0.5079100666046004 0.1931607175281096 - 0.1496039874313051 -0.4382776831050052 - 0.733798288180009 0.9714515303122384 - 0.6271175447508749 2.4725745169841 - 0.2659140348770027 -0.0981326974772226 - -0.6139708393681953 1.097371212143311 - -0.0592911238454359 -0.3463632256880373 - 0.3201210827872046 -0.3979283668974318 - -0.6930148666017524 0.2093271095162817 - 0.208865440418711 0.2827500729689634 - 0.2386901026858411 -0.05671590380224234 - 0.2696892610179322 -0.2425318024644901 - 0.04978280844683283 0.2484054502566319 - 1.827965323121081 -0.4807379566598142 - -0.2159453576634925 0.02848945296266786 - -0.1475563714500474 -0.1494368631885626 - 0.5500627654143262 0.8688403534298311 - 0.9481144434449366 0.7487439031873856 - -0.3047900836337386 1.554489176418799 - 1.698102252579181 -0.7911415428305886 - -0.3640945127279798 -1.566656122596451 - 0.9962125330133093 0.239259212333207 - -0.1176644138829004 -0.2331629949450204 - -1.67971460290845 -2.084238052892788 - 0.4081762846627436 0.02433232915801475 - -0.1819501705665659 0.005459233906835647 - 0.4426463933653014 1.004157027496916 - -0.04814624885446681 1.170068043238134 - 0.7396856296174582 -1.410733370369205 - 1.514416901416184 0.4509007469572289 - -0.2935984725293507 -0.3660863936416746 - -0.319875942418677 -0.2462742734075007 - -0.2547242401569094 -0.3319557305272737 - -0.2135917120945854 -0.1107512582607539 - -0.7468562204851389 -0.274680793149923 - -0.6841690972515929 -1.362548853401922 - -0.1067667125093185 0.4450417543294156 - 0.08492878131153657 0.15694092991309 - 0.2061722556129108 0.336880575576447 - -2.127956991923415 -1.701942300746622 - 3.301519002637697 -0.3150120281296406 - -1.721773805241545 -0.7137945642954866 - 0.3722974974043034 -0.09097304700858876 - 0.3847155843526631 0.1347286945444944 - -1.520697447447195 -0.6773649429897467 - -1.850437878990296 0.00623664561556812 - -1.699880223765608 1.880625201643191 - -3.351035551279859 0.5515460565522611 - -4.158282480817347 1.709828901021585 - -0.2222228013380711 0.001291274630963584 - 1.352192084878824 0.9967975572987393 - -0.605864593214921 -0.7834194066184622 - -0.362416361561487 0.1567149810994118 - 0.5393644164406273 -0.6089309365927894 - 0.7795094728266851 0.3104526475285913 - 0.5134762803350177 2.995002769844903 - 0.4998759043777685 0.07008915076437998 - 0.06515285131190827 -0.1995848006043386 - 0.243641647557594 0.1383848379899182 - 0.05105420373548169 0.5545036602223383 - -0.4791468865738289 -0.1234474290137208 - -0.1164610773157176 0.1775451423549328 - -0.2502694749197899 0.2812802589457821 - -0.4798705277724034 0.04460329255950852 - -0.1444485607615593 0.08788431679396512 - 0.4245219318333983 0.740996091053604 - -0.1409660454034236 -0.324509541005959 - -2.524302070396649 2.222048703906224 - 0.9728915728223422 1.27889223557205 - 1.201002037541924 1.166295459485649 - 0.2143336970383209 1.305486938825449 - 0.9566069230830448 -1.312522288077317 - -0.5795201687434459 -0.2197612535091319 - -0.1004102874807892 -0.5330158696166892 - 0.225498276247705 0.01559807501128794 - 0.2488235423626856 -0.7711820323322606 - 0.7967727839242883 4.563423964490586 - 0.6297873960590001 -0.1688032282000429 - -0.8635235844154689 0.252130289609431 - 0.2078876643322684 -0.3328434890557226 - 3.523248758508518 -3.689235627138184 - 0.3476241101283409 -0.5495258940990622 - -0.8810208601605042 1.633114593843134 - 0.3081653948420012 0.7637767435910796 - 1.19015786034107 -0.1448280957796396 - 0.5458655555901902 2.078244327776165 - 2.810426084588933 3.94317215650703 - 0.4495875787467301 -0.2238592438712658 - 0.2809498215831384 0.452479151650345 - 1.397209014276188 -2.341644096671027 - 0.4678474478303764 0.2946856239633563 - 0.08162843950995616 1.134992104640241 - -0.1140735993037434 2.186412157640181 - -0.6010316223474754 0.2360416474171745 - 0.721064895527018 1.250118550646097 - 2.655226519386583 -0.0501553457806798 - 0.07130765165242581 -0.3001971523064791 - 1.764341531075384 2.776390905029821 - -0.679827788004905 -0.612965884342953 - 0.621157779186117 0.2502679594847107 - 0.5282588565209122 1.31778214260112 - -0.4350868088224255 1.760567506880549 - 1.462884909473004 -1.595171362764181 - -6.248138690959797 1.666193916819307 - -0.6450844305656465 1.242171458104993 - -0.3564228087117248 -0.7553834188553173 - -0.2651733261833662 0.01598608907132973 - -0.05753268186258487 0.4872013838603081 - -0.449923592952757 -0.39083420332087 - 0.2159423402680141 -0.2364413241095958 - -0.2164904861552539 0.07810364050472683 - -1.051088262816083 1.383404630684923 - -0.274464464001248 0.6969514357555918 - 0.07745824223381174 -0.2628276548739173 - -0.2308635108670859 0.149352410949165 - 0.6740409720207827 -0.08762531914961845 - -0.9177189371833536 -1.241468787512105 - -0.6489856067398394 0.5880129444764859 - 0.278659023545779 -0.04584946901921507 - 1.34531134981023 0.08354745271666253 - -0.2542726900177029 -0.463249595791181 - 0.2680958337766859 2.422732407416145 - 0.6676030772462674 0.5336582894038024 - -0.2737403954177262 0.3903302012410682 - -0.8063408187319261 -1.631173314966822 - 2.767301598301719 -0.4120174097604561 - -0.8315952014012574 -0.8160827816518671 - 0.1604941498025279 -0.2225133581507568 - -0.7580787224780153 0.3852371747149993 - -0.1699497451156846 0.2724110983153974 - 1.097611823645636 -0.05039708389726485 - 0.4798661086210158 -0.2839733918151277 - 1.344673801294932 0.7591344509908808 - -2.016318063061048 -2.729590848165332 - -0.495238705718464 -0.3395599625457814 - 0.9179455543507837 -1.123640801431246 - 1.745528104138814 -2.748333309577751 - 0.1884018216830907 -0.09743786205952085 - 1.109848705779325 0.7803466182317476 - 0.2310564490098402 0.3951054876376714 - 2.294836053137938 -0.4379243747541213 - -0.5344216141274606 0.387751285107044 - 1.721788386996697 -0.008040575189843057 - 0.877729808674097 0.3328700461487486 - -0.5232451596991402 0.8922069887961579 - 0.05908800974354599 -1.547332116729556 - 0.1149141948434287 0.5453909719673266 - -1.147619108481828 0.04718267829657504 - -1.971813489078407 1.46337487246583 - 6.233804815826108 -0.8527188316912858 - -0.1010739828499753 0.3905992425532615 - 0.6089437108420962 -2.611285165381914 - -0.3981831990626485 0.3275384738334506 - -0.8312298208590619 -0.2814529095569606 - -0.5568655763720652 0.03932521223692125 - -0.3044592422692982 -0.8277346313093981 - -3.800400515006729 3.184863150232358 - -0.9754120355270069 -0.5049022760913132 - 0.1780541478551428 -0.5337970082295688 - -0.9239507211378447 1.969538070634089 - -3.555710040299052 -1.542090684153304 - 0.3884667174098573 -0.1480432370508768 - 0.285616234001746 0.8422003042695657 - -0.5304341637353409 -0.4284641789729968 - 0.6634880809447681 0.3293201306517848 - 0.9174869491809693 0.4919124812270561 - 0.1019842894563736 -0.3393869486211381 - 2.054614216283376 -0.7458895539255402 - 0.5120747014167897 0.5023023151813214 - 0.5375588371470407 0.4302592516384549 - -0.04009235020627801 -0.4128224893995951 - -2.764356849816821 -1.791733241718995 - -1.911885888073005 0.8565546416390581 - 1.718010912876896 -0.2463766532085356 - -0.8001594076286001 1.349242268677994 - 0.1782090357573503 -0.2716025481884151 - 0.2408472420853799 -0.2864434061313039 - 2.362343456258052 2.661441027396771 - -0.01057370970351064 -0.3712882067999479 - 0.2508763372169461 0.2866863018300633 - 1.088005544374648 -1.794190130584646 - -0.1714475828677478 -0.6617203266039583 - -0.5802872993184564 -0.2994581255726088 - -0.04348447966955134 0.4278856495062269 - -0.3089534211447053 -0.9715654346381575 - 0.6267362945463103 -0.8979739131229739 - -0.03277890128047085 -1.149815276774742 - 2.422119991143151 0.296589571123582 - 5.138211170717205 -0.3909822372546602 - 0.9460169797041602 -0.9024537526446804 - 0.2059754530091884 -0.4570346077429771 - 0.04353464833929229 -0.5432380647613767 - 0.2463784161478463 0.09887813568901409 - 0.1110954749440417 0.3905864753033572 - 0.3541580343676503 1.407983434441007 - 1.8259939134017 5.115096383967988 - 0.2918403731656605 0.08367041490689733 - 0.3968994627466542 0.4032901921076798 - 0.9747739483697331 -0.001947854401687654 - 0.3533189367497445 -0.3362892146056119 - -0.2612597102120841 0.5017725712712879 - -2.675094144514641 -4.479967652403683 - -0.4776488764337998 -0.187941465485531 - -0.2265943923603909 -0.5868011188675734 - 0.2558453425507888 0.6239941294025052 - -6.657643318713635 -0.9793319653600459 - 0.9428662658762017 -1.579792000878197 - 0.2216273304975527 0.2377996490014252 - -0.6359561254937863 -1.028016667202596 - 0.1371611272076888 0.2543892269164046 - 0.6150698901954728 1.098923555415801 - -1.170907868184439 1.194759977958819 - -0.4762671732308343 -0.673737940138232 - -0.2291203900474842 0.4346662316311219 - -1.400691163802461 1.162358046899036 - 0.4119985743798922 -0.3216571438735354 - -0.5433339351635852 0.4897644182236953 - 0.01196946687325723 0.2623089710977809 - -0.03665784397675258 -0.2159789453761087 - 0.1924184331517265 0.07923949106099275 - 0.7571683833139763 -0.04890532090871737 - -0.38327772326156 0.1098098315065965 - -0.3244146989174429 0.6258404399979224 - 0.05984809235732615 0.1735662546223003 - -1.152393399040665 0.5175795088560859 - -0.6174905528990758 0.3847527233367833 - 0.3081546815136053 0.3006929106683919 - -0.06753800408481457 0.3573046289119226 - 0.03586062889171871 -0.6348891989670903 - 3.003974581658523 -0.8325411800679969 - -0.1024120919841124 0.2977899290292954 - -0.38246080533681 0.3925745280832912 - 0.5747133439250651 -0.3160421981344369 - 0.5002696888558703 0.2070639010077949 - 2.23716569837197 0.7097699815790768 - 3.725267832835177 3.055332928050749 - 0.2152423706008861 0.8093728043389692 - -0.5557234887629172 0.7900377540455384 - -0.6012438706783414 -0.4009906640890147 - 4.150203858199387 0.205043499838222 - -0.4365228486205285 1.037350888245713 - 0.5284650514904912 0.6260565136039049 - -0.5658207206642329 -0.6395269538848474 - 0.02343573864723483 -0.9817661648973875 - -0.5287882079394013 -0.0852612553205217 - 0.3141544311572417 0.1458613212885035 - 0.989574933257237 0.3680021064384579 - 0.200120313812704 -0.01543793396301633 - -2.448771596787328 -0.7629313899441793 - 0.4557315479292903 0.4473735593305528 - -0.56863058297953 -1.958170246152806 - 0.2004935812527671 0.1621626397556942 - 0.07212484934813171 0.7826278609586952 - 0.2979272788170939 -0.2012114392931283 - -0.1704623034883818 0.02927710719562853 - -0.3718838041002249 0.2052250022279916 - 0.3667911428870489 -0.6187290395008574 - -0.08063819299222004 -0.8687826992679875 - -0.7707600379047311 0.3079021941730903 - -0.1550238616640902 0.1242385493713801 - -0.3710934190205263 -0.5601579127705365 - 0.001640794420736048 0.4558282273103474 - -1.066317504053163 1.011279785845488 - -0.0137691405083718 0.1726630024651362 - 0.735607108473488 -1.063346047660923 - 0.6585938858183134 0.1837613438665216 - 1.475595277304732 1.203434348947331 - 1.087376459434039 -0.2313623205245224 - 0.1452589085825858 0.2065321014079622 - -0.1212678669688088 -0.5887151242942232 - -1.313678439790981 2.689437072508881 - 1.276190966434639 -1.431264546102676 - 0.3947558763782861 0.5693838126425909 - 0.3126239830867109 0.6216525978215184 - -0.5252640328980829 -0.1677045652331023 - 1.219661401245362 0.6303746185618651 - -1.257480411782397 -0.09758854920735628 - -0.2562054019275617 -0.02579231555541149 - 0.3205464506971875 0.2414959490977875 - -0.1920198100945414 0.169924655626343 - -0.5032384716798212 -0.8052954754581112 - 0.4047985546136315 -0.04999522081428147 - 0.1162414525438781 0.1378106025872332 - -0.7856557187167722 -1.075612769703547 - -0.8029464166878502 0.7908849435057271 - -0.341894548355225 0.2873279294298018 - 1.578286541056178 -0.5294458263874032 - -2.429742111417845 0.3242895617372084 - -0.4446905262250384 0.4946401795570786 - 0.09068184555325927 0.2604940255315627 - -0.7291569849236816 -1.196521179935519 - -1.063504795012616 -1.738312900911694 - 1.420055847091795 1.608525772283588 - -1.13915587315634 -1.235292400321847 - -1.51041676551936 4.440010024837627 - -0.4824011045668161 -2.712818425589083 - 0.5464880389568557 -0.1450556709289568 - -3.015573589042373 1.722817595641588 - 1.833374380210793 3.581003929320851 - 0.6221076771295764 -0.5346862290373706 - 1.490970040996872 -1.264823391584988 - 0.02376396417793191 -0.2649780388560493 - 1.551818224618939 0.8909568851411767 - -1.009734034801294 -0.2974177386079122 - -0.2124318227509815 0.3710810428299243 - 0.1258409973560818 -0.1353312407671866 - -0.7956142181323361 -0.1735445946709057 - -0.1996499849397096 -0.5239262802137711 - 0.3507759679995081 1.236671488835814 - -0.5550927916684784 0.2943951130951425 - 2.176970095919932 -2.453213414536301 - 0.02639318943818589 0.33567445534052 - 0.1728232537230441 0.5147074236767228 - -1.002069147379788 0.8375048053695466 - -0.09289931524726201 1.624074866032193 - -0.6421293639759037 1.877478330593257 - 3.101584708483112 2.696237517860447 - -1.677721963831679 -1.04665150023868 - 0.3421695896289577 -2.913388382836361 - 3.374287003977724 1.253118345428264 - -0.1834289990341036 0.09927340255151507 - -0.25570709769485 -0.08038811580344755 - 1.397681699215193 -0.707304297600868 - 2.476073651804322 1.745676995492531 - 0.7939324255198216 0.4275452536570097 - -0.0734365008576895 0.1950330732323982 - 0.7948416201328593 0.07289497075437736 - 0.1937294810219867 1.554684439781122 - 0.1119798142637019 -0.5733037482180017 - 4.852821094001 0.8562899221218478 - -1.009241272716136 0.4238765956521853 - -0.2139852955883375 -0.7651306929478102 - 1.260457634300371 -0.9173735134968991 - 0.2398981162492402 0.4834480875242463 - 1.447706369490503 -1.02291187560018 - 0.3515747150867931 1.068533421717729 - -0.06879636115174813 -0.4672605955188743 - 0.05909704927384112 -0.4619387251013598 - -0.3948313753852052 -0.05540172707140893 - -0.5067151095925223 0.5653272201204611 - 0.2963737229044588 -0.4669245495679158 - 0.3069256994307615 0.04532066327255715 - 0.2008238077178432 -1.580392695153672 - -0.7466444577599854 -0.3922177532374241 - -0.6433147595851292 0.4941672991804141 - 0.346651935652875 0.09540462608289162 - -0.5454229782828954 0.1283285004069242 - 0.7668288001857392 -1.250859358405042 - -3.977462165606731 -2.490958353161804 - -0.8440485073589414 0.02704509987724358 - 0.1179555254133295 -0.4988893384394945 - -0.3858983510888985 0.7223245674166644 - 3.649948163701298 -0.7107568054377282 - -0.3917908256830289 -0.6522029678714496 - -2.608554184466948 3.191023371133922 - -1.405632970284414 -0.6678886915280289 - 0.2652617911707941 0.5444231916664926 - -0.1801803279713191 -0.1218510709588538 - -1.282667519034002 1.442837181272874 - 0.4210204173124629 -0.1120703122831208 - -3.21523327381361 5.765374235119287 - 0.3731051401682757 0.2232413641709885 - -0.02359678480639145 0.2460409056579917 - -0.3834176448978194 -0.2607098379159767 - -2.323205900251877 0.7545015780467609 - 0.4874314708701238 -1.553960717816961 - -2.077793379216055 2.870706782461578 - 0.02372666346536157 1.442968527257273 - -0.07752020888480748 -0.1582778584013924 - 0.9866852090445271 3.309186692948567 - -0.3653020536511867 0.003516771154038158 - 0.2549092253248478 -0.3925009458823189 - 0.8432767214304888 -0.3180606147321371 - 0.5562247416994084 0.964548688404263 - 1.679201040431268 1.859322315283922 - -1.132417806046347 -0.4094206237820537 - -0.3639344152003146 -0.3728160657182432 - -0.167015391476154 -0.1776090412893179 - 1.454810185267812 0.6304333596558178 - 0.3682771320372552 0.6726889451310902 - 0.05514221654719802 -0.2334112561811205 - -0.2650431772071771 2.586338811036501 - -0.8252902569954285 -0.07555138348518697 - 1.607658478057924 -1.967737771094879 - 1.880674144861208 -1.124837304203727 - 0.3571476627925016 -0.9431186433335771 - -0.6369222140024183 0.02280403729422763 - -0.4809643083803968 -0.5782325220396517 - -0.4188844633654254 -0.2202902297603333 - -0.1269334407884858 0.5203659126885415 - -0.2885765550210023 0.1283519061696819 - -2.385957107270871 -2.48275235456552 - 2.063854159334098 0.1924380488827324 - -1.995274693600622 0.5563618303509599 - 0.5500375248587094 -0.36954034721877 - 0.3322982525014817 0.4045722536820138 - 0.8773581110712089 0.2459394778845485 - -0.4201525142916657 0.5808652400989177 - -1.621729950679139 0.6414276353789308 - -0.3032541648475023 1.327249889266627 - 2.667626662728284 -1.962054585408994 - -0.512115660701298 1.405143088413994 - 0.02438606603651225 0.2257601381293103 - -0.1413524868026717 0.2416552478795992 - 0.1867729273763817 0.5773468060355216 - 0.6385915216892823 0.02900581395038187 - 0.6932433647089359 0.001407242499871101 - 1.231377654868758 3.793538512129409 - -0.06053201230128244 0.6519106342548303 - -1.258813341529859 -1.44840950373533 - -0.1572868335514949 -0.3721579494960924 - -0.3371530069928957 0.3579607222102418 - -0.1973998815055384 -0.4409570037572733 - 1.079135301352729 -2.489954279594684 - -1.816555458546678 2.220492428610981 - 1.493650141421433 -0.05126977100421551 - -0.2992681399232355 -1.359105217438594 - 0.1160033469187345 0.1836733815118696 - -0.1152278610280149 -0.7396150050845812 - -0.03177621773594148 0.2092941160162828 - -0.881960201243625 -0.927938644100905 - 0.5448179431367516 0.189355377418097 - -0.9451432667015107 1.1112967065107 - 0.3285763604941569 0.529179869091865 - -0.1580859080671126 0.3208174286013494 - -0.1463125859310625 4.152946971129041 - 0.5252423024996462 0.2603892057075075 - 0.001217257442200355 0.3913865588329936 - 1.283500006288008 -3.840489590572063 - -1.53800405493896 1.452411380279763 - -0.5210451409247445 -0.9277752180278919 - 1.127043409120257 -0.5374956714505565 - 1.64892638125151 2.343061226743348 - 0.1166458987767134 -0.2890610011136357 - 2.038545996555211 2.124315433015519 - -0.1520270317560407 0.3722878159177603 - 0.899546893307498 -0.7160552105004868 - 1.19646661780548 -1.157950039226008 - 3.005472400322937 1.423302586249031 - -0.7619582331864352 0.6500662779648667 - -0.4445534075074811 0.3888932524640976 - 0.6924212915552695 -0.1883930807396365 - 0.6823143749619054 -1.690772825143328 - 0.1387527868159998 -0.7366900973055139 - 0.8644074793227602 -2.165567902422138 - -0.05991419467599143 0.9094887346781868 - 1.958004165113983 -0.1975800712939089 - -0.9088470161732773 2.561219571564515 - 0.786137860860323 -1.926996865193766 - -0.3128295830548795 -0.01460045961179025 - 0.1568197094253836 -0.3227661523671324 - 0.3464815723799419 0.471045296992313 - -2.432614393574925 -3.444523803591205 - -0.4118687269170276 0.05116023204049453 - -0.2470210705525636 -0.1798077390538729 - -0.05501661785272417 -0.1804679930571493 - 0.5717861333421543 0.07813921483684957 - 0.3570515851601213 -0.05870161526779148 - -0.4521747154032598 0.2196142694159805 - 1.833132601815421 -1.472057060890782 - -1.309914296481946 1.874945765762293 - 0.4979147619454535 1.117671109954211 - 0.5396441929651375 -0.7184443691449021 - 0.6357529628578313 -0.2685319907937804 - 0.1351013204625269 0.8782307030046497 - 4.069478295083223 5.114103247134848 - 0.4424822878628742 -1.816932846525509 - 0.2490909657793311 0.9657852402461052 - -0.03167406768400304 -0.5988807968699144 - -0.2066149593218848 -1.071798547777818 - 0.9248470841251409 0.1212727829226006 - 3.251174767922991 -2.31664906983934 - -0.3008830756759741 -0.1865709974740785 - -0.1337923431446637 0.1208015892990677 - 1.226496621690853 0.2057025033046886 - -0.4404928817027144 -1.034621215411166 - 0.2956870286363505 -0.1367117495932984 - 0.1524063565897908 0.347888113182211 - 2.015657556876502 -1.978495439542155 - 2.175320670375219 -1.21079215474865 - 0.2092456709658942 0.1136416472686764 - -0.205355976457351 -0.1515871449981247 - -0.1939926503183529 -0.3503201405615068 - 0.406199754124022 -1.106378272480844 - 0.7492694219862133 -0.2467938651975086 - 0.02367204616457794 0.1745483106985151 - -3.596848374335829 -0.3686049070912024 - -3.17894058613732 -0.6665399698646624 - -0.1922519042671208 0.1314564786032841 - -1.145413532051338 -0.2035750961723888 - -0.5463492832450483 -1.577808450192076 - -0.18978802787504 0.6321075726372675 - -0.9159762940648321 -0.3677570112458081 - 0.9272534766998028 -0.5680173959760512 - 0.2748608567084301 0.2350876866858126 - 1.727643342895892 0.6212879741957553 - -0.2379965081731291 0.5842785610163388 - -0.1553111605514362 -0.08463369619031468 - 0.9509942580681593 -0.3026973537789783 - 0.1090194520071689 -0.1847724243049156 - -2.131125592638806 1.105755657245602 - -0.2232647138487439 0.2007943920474013 - -0.07049118279037471 -0.2557576921997281 - -3.701800389166344 1.168978727113893 - -0.07950580943268132 0.154157490137695 - 4.236579788333785 -1.207694842788412 - -0.5426239182347905 -1.190506373048298 - 1.108660307466603 0.9195446502027829 - 0.4731503663706484 3.454606825624777 - 0.2292696983020164 1.087130748148803 - -0.6847342903496779 0.9767138321531176 - 0.5002850474881846 0.1290654272249891 - -0.6358403344086163 0.1586471672646157 - 0.6925952669577045 0.8252017606661408 - -0.1802723188595634 -0.02943051161920995 - 0.205940289947996 -0.1923567710115293 - -1.198342025194847 -0.7428169894713998 - -0.6436615869355294 1.576548590696982 - -0.2272356513173306 -0.388067887096568 - 1.509265629529655 -6.068568147127517 - 0.08668983579236719 0.3303062839072277 - -0.3534076719476191 -0.06137449410981954 - -0.3094951477271591 -0.6029666176697445 - -0.1127351816158294 -0.1440708385935759 - 0.06177288709768269 0.2926509808642082 - 0.17326442552068 -0.6733349236470161 - -0.1545220484972516 -0.2641982703975277 - -0.4618834677529394 -4.263479734923911 - 0.3134505959263893 -0.08966095971848204 - 0.7378839878820702 0.1548213282858025 - -0.1819614206826177 0.2124777639237961 - 0.1579625221346954 -0.1789365861995057 - -0.4661402394013932 -2.193028940065339 - 0.09074320304030273 -1.321267531850949 - -0.6530008494942809 0.2918707122092191 - 0.3810698710149381 -0.4606000864296637 - 1.037257427808438 0.0650654175286922 - 0.4627394220640124 0.008597039355276516 - -0.5957890704043212 -0.1502184989522422 - 0.4122883984668991 0.3362281916366808 - 0.3230409389302347 -0.01650504129080628 - -0.04182039143146281 -0.5290540253206876 - 0.1354048851510242 0.7397647942090865 - -0.385921825744392 2.064857604372865 - 0.5990019674121816 -1.215554524775248 - 0.9938869381734471 1.656418914847998 - 0.2566136073383074 -4.917687958739654 - -0.6481944015120812 -0.5041539707608308 - -0.2022924582000766 -0.9257901309715258 - -1.111285268143849 2.202272091397561 - -2.171384387900054 -0.2559692673227131 - -0.09674780077669538 0.7900106131813184 - 1.382346301913017 0.2674516305800446 - -0.04587312760932252 -0.6654455196881635 - -0.3136948155377983 0.2175494250469122 - -0.09124175149112465 -1.016080190401803 - 0.001496500099764221 0.8440892264634016 - -0.7681452499325223 -0.5330978985522435 - -0.2620463487754692 0.06074399720813878 - 0.791016697048868 1.09501323307033 - -0.170376547548087 -1.220380897967592 - 0.8244854250448377 -0.4670184653443963 - 0.277320242461253 -0.6376968445095572 - -0.7481922363906679 0.5122222765427665 - -0.6203903222075542 0.103034449723832 - 0.1338307315848106 0.1060805955321099 - -0.4290869225813469 1.212158651330751 - 1.197828374384667 0.03206393327791316 - 0.2617969669852944 0.3308080524951664 - -0.5558501258155926 0.6668795755483069 - 1.800759674430054 1.389563850843986 - -1.323542265096936 0.3832298752220757 - 3.905940762697218 1.733945723205853 - -0.3087566449134682 0.8137148903898841 - -0.8647215200769058 0.5434181215556251 - -0.6194823288534272 2.443978886615379 - 0.4678526482830357 1.553667296067909 - 1.072700073131574 6.638039835630335 - -0.4469362300449206 0.7920726123437447 - 0.3512832147719487 0.04073260606229197 - -1.413573363523793 -1.153617821451143 - 0.006621325575739954 0.208735960420751 - 1.163206467023279 0.3127532393307692 - 0.2368259212575284 -2.212430223658866 - -2.735086849174813 -0.4778926564454066 - 0.08284921907391608 0.615188183161156 - -0.1425887560509949 -0.48756909550875 - -0.4191967401294248 0.1704788274673804 - 0.1378825885370168 0.4388685937275886 - 0.264346747257089 -0.5514851805790106 - -0.989429032563501 -2.201422460957355 - -0.05141737961512256 0.2619906148657073 - 0.5530929458536337 -1.082579717293878 - -1.472859940127266 2.336781486612263 - -0.6843801030376353 0.8366403096703201 - -0.1774484869962078 0.05919924689557937 - 0.4187232363880752 0.197410199602208 - -2.227570085059321 1.860399165699462 - -2.502233442311038 0.03603740771653933 - 2.656227637592327 -3.009078089450797 - 0.2242909120231768 -3.906280079165397 - 0.5207270463090699 0.7441255470331445 - 0.1632904087137386 0.6457704772045287 - 0.2414049621285322 -1.040620056485893 - 0.3096122518648071 -0.7296747716818788 - -0.8367529361569109 -0.4345566461825112 - 0.1811108652850708 0.2404295379885595 - 0.05976490975809554 -0.1699202663015826 - 0.08280719382309931 -1.903151767687667 - -2.027308537304148 -2.149686746512281 - 2.98223746893666 0.5954369337183852 - -1.981930901209601 -0.3877607735863121 - -0.05072903094684025 0.1670992404285849 - -0.005243671027627532 -0.4624023804280216 - -0.3358339822335207 -0.493640460635283 - -0.2736376021627704 1.12273466683372 - 0.7723491304405693 0.5407385425392225 - -0.8593471463265213 0.957557611153812 - -1.714857121835328 -0.4461720515266183 - -0.02049525838697808 1.319113621648459 - 0.05219492628979615 0.3738912958250068 - -0.3946351125506779 0.9278154852555131 - 0.09522519804295232 2.953106311683204 - 0.1673678143083335 -0.1388626371205088 - 0.4944214759837239 -0.822044681814272 - -0.2960284720127068 -0.0578688852814708 - 1.878301940778997 0.9187986348593707 - -1.333040794268201 -0.5075074555258938 - -1.040235959119551 -0.855813687073345 - -1.412376480811658 -0.9075076961335848 - -0.2586860397878435 0.2281160413445286 - 0.4256598059606873 0.8375860172273529 - 0.4406120013091583 -0.5499986820774936 - -0.2794206024040752 0.9519122569179124 - 0.08174059647195633 0.6857318766191188 - 0.01614581625605924 0.9377017923917902 - 0.5039994563443353 -0.5142842959686208 - -0.3366366696139013 3.293302612251481 - 0.446805119606789 1.761670648320723 - -2.935167729565809 2.361100450290891 - 1.167275951917921 2.913777052041047 - -1.271517045168444 0.2088037998950927 - -1.918955886676083 -5.597735277313244 - 0.9631771570287059 1.090020005339802 - 0.2799873948803736 -0.3421512737106198 - 1.279335811551178 0.4474827130654804 - 1.250739560564936 1.424031484352369 - -1.606713619014619 3.250959324051409 - -0.1240457349373754 0.7066439238428253 - 0.7901674748352181 -0.569859539630922 - -2.030502788730309 -0.8915743575921226 - -0.8617867830671729 0.3914984768067556 - 0.1704737187613756 0.4001185114788295 - 1.100017917489227 0.185475112787754 - -0.7452005386561047 0.09093800110986748 - 0.4136159979579185 -0.1837129129234907 - 1.078428534804701 0.464900514574042 - -0.4534196609226442 -0.07366282264943554 - 0.5398789879864967 -0.2159715843344251 - -0.3741446578337926 -0.1074907213145444 - 0.5683733533264674 -0.4453023576368622 - -2.90436219557403 -1.320728553033945 - -0.02513873304965358 0.3391552128909586 - -0.6837698319801815 -0.1802381650762575 - 0.6642523550558108 -0.7880211574025835 - -1.028412456693422 -0.1331107966824875 - 0.164837978938837 0.06142578723363455 - -0.833515116206375 1.074829362715927 - 0.1034655600721748 1.01398647956404 - 0.2804144402993773 0.3882155311882413 - -2.673806202219928 0.948917306872507 - 0.7505612891124438 -0.3472992168616638 - 0.8838800411549407 -0.07152469171782233 - 0.01177922157600058 -0.2135390546369195 - -1.113540737503925 -0.5602869293390008 - -0.006999323120810017 1.05635323785749 - -0.2541705006934596 0.3399378221645326 - 0.6051420163480287 -0.03974317350270622 - 0.6232417491707087 0.4027701787712952 - -0.1128481736872711 -0.184724603555504 - -1.746437121487885 0.3664428912627995 - 0.4054381594949218 -0.7216353088077903 - -0.934562573358152 -1.438864508280642 - -0.0554191994462231 0.3093154820503579 - 0.6770553352440259 0.6187146027709031 - 0.741288897083793 0.2424090639188246 - 0.1785479028963756 0.02880389984867504 - -3.199111098066286 -2.485769317831362 - 1.223932394699694 -0.6789531857396287 - -0.7912947655503226 0.1942260527781064 - 0.4205895250098437 0.2628454762266915 - -1.016558597540792 0.02462130181259677 - 0.8264775585523456 0.1641015832355355 - -1.607328452233541 -1.725098142207165 - -1.265138757519979 -0.2995831625459314 - -5.652891523165362 0.5968102228784473 - 0.826921661486912 -0.1801219729829594 - 0.5964993260773047 0.1278438889341678 - 0.781740809483461 0.7080899109242409 - 1.567609780992892 0.1984506559854443 - -2.858268046954699 4.748941347100727 - -0.1449994399048947 1.394689831512093 - -0.313459399764052 -0.1041603598999483 - 0.7379211304541826 -0.7022129662583486 - -0.7040600591713585 -0.8895200896887769 - -0.4330040086257255 -0.008744213573162598 - -0.1670258552378383 -0.05827833011676865 - 0.04460308582950664 -0.7169137263618489 - 0.9729233483739507 -0.1621669415042521 - 0.2508091638926812 0.714620235768474 - 0.3703743819454183 0.2617361511329045 - 2.642311749903631 0.6883945371302316 - -1.27123526338355 -1.919010437828362 - 0.07241363459001064 0.4319157701389504 - 2.482362814150939 -0.7207936323258604 - -1.474262231144938 0.2967436219461699 - 0.0337648310262019 -0.4052965716543023 - 1.038550559568296 0.6247724079072702 - 0.2133179560381799 0.05619303876556341 - -0.1831645308091951 0.4709296296428911 - 0.08601655734546845 -0.4148535596418976 - 1.124264011353771 -0.3885374952223649 - -0.1871606649751613 0.5255513961846308 - -1.134989485520397 0.7111254429263308 - -0.6436313646059989 -0.07378020746059188 - -0.3334155373676244 0.5350974774047936 - 1.065340031483591 -0.9621850110147572 - -0.005482997451758985 0.7259357510635284 - 0.8448930269088067 0.01815884141241671 - 0.02192282847374627 -0.1761275241287808 - 0.8451478619134548 1.441896305251202 - -0.02619931479548471 -0.2551676989887654 - -0.3542381385799007 0.06216299959113802 - 0.234756473274759 -0.9050812188208651 - -0.7252473862668889 2.909462531367121 - -1.007647979679417 -2.647362423923248 - -0.368549622423219 0.4742392762513092 - 0.4644535977492911 -0.3618066210973805 - 0.4395416437286799 -1.288847987944327 - -1.011772448505132 0.5561006075852454 - -0.437981377877842 0.2903684660268462 - -1.472464812247779 0.4904201575623529 - -0.4339485995494002 -0.3182980783097545 - -0.1304937877359608 0.593322475398388 - -3.415309765419306 -5.549940358314462 - 0.2872544140413268 0.1873007054406149 - -0.09952647349325852 -0.3946188772590317 - -0.5872640913187699 2.137526528059048 - 2.68022558248898 2.255198540805418 - 0.3887623008492321 0.9276071430920669 - -0.2907576177111384 -0.1451726098754139 - 0.2531922596861828 -0.02053724460597587 - 0.3472770529604277 -0.1342885479733658 - 0.3941178080037498 0.08019071238484883 - -0.4598330282357058 -0.483956371438335 - -4.259448523399765 -4.532016850086428 - -1.548466903293413 -4.260359446802135 - 0.2724747787527911 -1.419324775638349 - -0.2530090062650143 4.911340728632902 - -0.2254648824762659 0.1133642854640129 - -0.9083670699572619 -0.2072331730145242 - 0.1498199982132755 1.767433874306305 - 0.3574690047635378 -0.833666350431878 - 0.1718776223863293 -0.03459353204709693 - 2.093150139617367 1.150625938172337 - 0.3987479062979407 -0.3813810647444093 - -0.3358267177311689 0.098542362723509 - 0.6356111783669918 0.728088899632136 - 0.7620529616496508 1.895913583888613 - -0.1847297885747021 -0.3093931797535 - 0.6436481498601802 1.468669007697952 - -0.1377851594486218 0.2859150222502169 - 1.076936289145484 -3.362334250447529 - -1.073635578028959 -7.017935876350029 - -1.517708298263791 -1.386289587976432 - -1.7413479663513 1.131601357746683 - 0.3963405864533334 0.4959805318053905 - 0.158341825563913 -0.07302423974855182 - -0.110980306470175 -0.2747248839422613 - -0.5068578070633309 0.103641205797296 - -1.133519340015935 0.2973738802938504 - 0.2521847488001802 -0.1573706124199831 - -0.5201905669351032 -3.28734726761976 - 0.06005131130745926 -0.3532355508046643 - 0.1079698063262673 -1.137495907954522 - 0.08865030383270768 0.2155232395873162 - 0.4529823205409099 0.6478306786169452 - -0.1030853776651101 0.2119399839365991 - 5.629911164341619 1.914192678810782 - -0.5057858730719984 0.2822188018868668 - -0.1035525039071573 -0.3450518210635897 - -0.2118890052935503 0.2524749994801551 - 1.473988365372062 -0.2908581424599046 - -0.3052505706242654 0.4541275499058975 - -0.2906614604331618 -0.2924229239259017 - 3.295478632870232 -1.347499328883059 - -0.2654261027833551 -0.2259194227884512 - -1.369336448503295 0.06943258545027003 - -1.203970836279557 0.9151369967085615 - -0.8518211753510045 -1.940009506416659 - 0.1630167749661902 0.3055852032327027 - -0.9694673654479764 -0.6878748801520339 - 0.1356094781292365 -0.2525470442191857 - -0.02530122367761701 -0.3102700009647961 - -2.108114651511221 0.2658400376950617 - 1.671631323475388 1.080055084993331 - -1.062179019016903 0.1613155400562582 - -0.94173377515165 -0.05863795235694267 - 0.02060671698734747 0.2954165295773335 - -0.2530556251205945 -0.1312874816282135 - 0.5828965248571645 0.543700900298499 - -0.5087201488885802 -0.02969052857456641 - 0.09335565933210847 -0.1511658752193292 - -1.756608346503569 -0.2299215563235445 - -0.1335813625590271 -2.059512277667748 - 0.2269865348558003 -0.1056014633900014 - -0.7198831573176243 -0.07570128120262973 - -0.1095804928377205 -1.35273483199166 - 0.7547367628086942 -0.1277546371002638 - 0.1468133774458288 -0.9542811839485361 - 0.234045314620444 0.191586218062404 - 0.5630789369137109 0.3413558250364936 - 0.1766486711818017 -0.5988178075933895 - -3.754446678730234 0.2613698171493886 - 2.776647269299303 -1.33003641885939 - -2.3814924328249 1.38419148015266 - 0.1518207265738865 0.1603279678379704 - -0.1128309663217666 0.1412041802742811 - -0.2629292050835658 0.1013540602342453 - 0.1284614368558571 -2.467927424747834 - -0.4920043637189041 -0.2491210341212294 - -2.332231519346491 -0.4201047073212212 - -0.1794702260418027 -1.518775489219549 - 0.4920635951432589 -0.09864420239680138 - 0.1174382461516337 0.4884922746969664 - -0.7601229443171608 -0.6853091962597979 - 0.4411626577228272 0.1182496311665606 - -0.2936092165202739 0.08586478695331973 - 0.09799212337482295 -0.2221453644944448 - -0.2901922795179947 0.268027662156219 - -0.3534214002392611 -0.1955114794415216 - -0.2925984243732583 0.3174618630055006 - 0.06365563300748665 0.4637083279511786 - 0.01649106556454991 0.4940331565661871 - 0.1635169514373959 0.09327108866834445 - -0.1746675171785292 0.4215889955332213 - 0.1168933488483663 0.2965193169162286 - -0.1472811989185036 0.2053550717414906 - -1.224751696141201 -0.9606212097982787 - 0.2795673825509771 0.1254976747385548 - -0.5758009503194792 -0.03822479441847656 - -0.2948670612677822 -0.6869400164454872 - 2.324726849467661 -1.664292771500821 - 0.3564230625920798 -0.2726158376086149 - -1.534016469193404 -0.3514677244582262 - 1.771744519644226 0.3682899894336552 - -0.8747343571907387 -0.5946373797531153 - -0.3107015618595461 0.1728938530533332 - -0.3304655514598411 -0.4328049576560433 - 0.4438939539836346 -0.04870770592895716 - 0.8802000108315526 0.8675689909751095 - 1.274474665845351 -0.3132494873308636 - -1.006285411758272 -1.050905002726829 - -0.3232369047630217 -1.847817817490075 - 0.3351700743350037 0.1881780798894309 - -0.6632541873007357 -0.3448120206180441 - 1.328760549382719 -0.5206049967209891 - -0.2221034417966648 -0.206777720717146 - 0.6533863592974782 -0.3578804149876959 - 0.6961117322228028 0.3811782035168919 - -1.031747406247666 3.5715324733689 - 0.1830319759876326 0.1951911789677377 - 0.6906996624512346 0.1009720953905296 - -0.07032627361976683 0.5584292315253173 - -0.4946567159601002 -1.389788390372371 - 0.3453329820701165 -0.2106251228645123 - 0.237906533204654 0.05628670221024339 - -0.3530739118432056 -0.2996948073181667 - -0.3540042345028345 -1.148760921221847 - -0.4498901660881863 0.1100364222076458 - -3.470301165881155 -3.348745127448551 - 0.4481505296292848 -0.6651658651686321 - 0.5022327295941601 -0.9710506648950976 - 0.4100128606296994 -0.2479214230292743 - -4.451719318132045 0.6232017482470934 - -0.07224919741004066 -0.2960011130702285 - -0.2023749988790664 -0.2456977762941527 - -0.02535452043798227 0.5568429645340724 - 0.6896575506537538 -0.4694525822213401 - 0.4637247709144408 -0.4349469983937505 - -0.01720913237446172 0.285566968585292 - 1.078191073173409 -0.7308071338639307 - 0.01092507278697483 0.6250477933234786 - -0.2168846067849126 -0.0402882738844263 - -0.1490564844198082 0.1582746393256223 - 0.04934782575462504 0.2017310418479868 - -2.899006072747897 -0.07656613953121112 - 1.341710027698007 -0.09443751382215597 - 0.2617463666246289 0.03371174788055212 - -0.6560586560686921 -0.2468569375203095 - -1.234465465173284 0.5528733834271732 - 3.964485010441632 -1.827337050632216 - -1.789744230186928 -1.285395236455833 - -0.2151068141242134 0.7467689024192962 - 0.9614884302208235 2.203627606491028 - -0.5519939874227128 -0.5250182406665311 - -0.8548454092453217 0.1092438835908036 - -0.04699475149522602 0.3877645794746437 - -0.4143206127282002 -0.1648297107919175 - 0.1137114537740077 0.2358101663778074 - -0.167743609108144 1.168089055259363 - -0.2042450856368731 0.307919041564938 - 0.9515575827893595 -0.4148208646583551 - -0.1340005865299582 -0.113303165729311 - -0.1545925774925349 -2.495098515496955 - 1.950234277033962 0.5051450201205814 - 0.1415367422823938 -0.1022202231885606 - -0.03308306510817029 -0.7579342742950396 - -4.380972351538235 -3.482539582120217 - -0.3422737926927217 -0.1468337685613991 - -0.01758740864913922 -2.907194902331149 - 0.445115542712731 -2.242598586619937 - 1.039499420548352 2.496587702306496 - -0.3994315874067492 0.2575635690338497 - -0.4424525075942353 0.6777169383106577 - 0.4834386962554829 0.3709473497471276 - -0.9502495846020194 0.1250125932940623 - 0.7879973161553536 -0.8686924340379277 - -0.1640768284973608 1.04290212336456 - 4.802057448327669 -3.457911313504925 - 0.1688568376399128 0.1281234839201523 - -1.404601408242743 -3.282208609615795 - -0.9785940720657811 0.302187827516556 - 2.685160046666486 1.115958597012442 - 0.4884480034391148 -0.1694238005694873 - -0.5051165004028444 0.4411040844213537 - -1.152796807739553 1.689978332410668 - -0.1828265553093017 0.856708607734353 - -0.1320603864047436 -0.4187467852255516 - 1.088207259487191 -2.908579901635356 - 0.01949393901257922 -0.3188836741649373 - 0.6850111221793277 1.62146266173821 - 2.793398390889666 -4.680072299145674 - 2.04771336478579 1.580699901566747 - 0.1681394341191193 0.004000194116273903 - -2.263058827182953 -1.235900204151549 - -1.692648277129299 0.1903327935189319 - -0.1597117502794848 -0.2147417146450992 - 0.2131242757986528 0.4428777242082305 - -2.884459637215878 0.4979538422955783 - 0.249756686170344 -0.1992527316435535 - -0.1512298804252913 1.884712694755596 - -0.7241939903877738 0.02050069488315081 - 0.2202795014433204 2.033494922510646 - -0.08039512899444884 -0.2075702024913912 - 0.02580468865847354 -0.854176903375493 - -0.09097809097828063 0.2564177186663595 - 1.213017055081078 1.875565703124556 - -1.343596551859033 0.7152195116240118 - -0.3977416699679895 -0.8647182069123316 - -0.09972800163662671 -1.727989479659549 - 1.939601371019398 0.06043436899243414 - 0.5183192150143279 -0.02272945327921063 diff --git a/params/CVT/python/cvt_circle6.txt b/params/CVT/python/cvt_circle6.txt deleted file mode 100644 index cbd0a978..00000000 --- a/params/CVT/python/cvt_circle6.txt +++ /dev/null @@ -1,1000 +0,0 @@ - 0.1452014686030918 -0.1982637837883195 - 0.09829554546287569 -0.5036331659590577 - 0.1136139263596576 -0.0578761540600928 - -0.2278165508033114 0.4396737277944582 - -0.08568887148546549 0.3598328081818509 - -0.4140196125496566 0.0505905475382858 - -0.2203865008757738 0.2076560892547024 - 0.5502869444753485 -0.1040272416938877 - -0.3429712734354518 -0.2915613256096523 - 0.2363604688473722 0.278385762352401 - 0.186102383299377 0.02124329678442714 - 0.316587280294272 0.362886388279383 - 0.1652187586690916 0.1915698537523034 - 0.04376121782357736 0.04746337251818107 - 0.1662335848463309 8.301483931325312e-05 - -0.5225713791186463 0.006942363450234427 - -0.1625915878782571 -0.09161221413804785 - -0.2147249053879451 -0.2400942990374704 - -0.5815980872403822 0.03088940555032059 - -0.1291816237177423 0.4448959476189055 - -0.4185362962916733 -0.08999674158454508 - -0.4291041376644154 0.3412406368797603 - -0.04157438176171233 0.2253471350686705 - 0.2091019163753292 -0.5775702678109506 - 0.5703279157877027 0.2286425346701456 - -0.05498867901553153 0.001096727843864938 - 0.1207341701146308 0.3530193931591434 - 0.2020469440238906 -0.119872055234328 - 0.01608218176007284 0.0147318788664321 - -0.04120037003040912 0.02212615456710381 - 0.1132182368610151 0.6025452069631045 - 0.4056383666483635 -0.3274204383152933 - -0.05914257579868711 0.3427804070146583 - -0.317970884596706 0.3582818871101485 - -0.4085455358129579 -0.04823822099192066 - -0.03054597229400858 0.01324538230406129 - -0.5817982953629375 0.2160528870928513 - 0.3761642700612258 -0.1897367051517645 - -0.09422820243979632 0.4718476898928471 - -0.1459851593610682 -0.1603606320666865 - -0.02974736548410777 -0.08955081253561176 - -0.5105481201955566 0.1504709657610268 - 0.1593736764145723 -0.1709047120082377 - 0.1511360354526277 0.5428669032675731 - -0.2359079046343999 0.3630301354770277 - 0.3279726643330392 -0.1095499811696062 - -0.245658120698593 -0.4407529253104591 - -0.5186079476036929 0.2083612786432993 - -0.3681214484659762 0.3249435538505877 - -0.18699862376195 -0.5786034751451111 - -0.1184610707159161 0.02331782461648167 - 0.5740916388420779 -0.1736171518773315 - 0.3251930514490822 0.4460369438760959 - -0.1441105765755473 -0.2073696548393851 - -0.1462835302578532 -0.1182024201969315 - 0.03953892477096906 -0.1784812369284398 - -0.113629328382347 0.06758689868792662 - 0.04455779283846585 0.1407965842605205 - -0.1910154567877864 -0.08364152415644105 - 0.3469379184539902 0.4987624697898295 - 0.06833416745896953 0.03681617691883721 - -0.4908577690567392 -0.016683243932159 - 0.6111500938433905 -0.0739253576706649 - -0.0840910782458462 -0.2000442568867451 - 0.005405981006555998 -0.2246632793284071 - -0.07163109633473322 0.1628768969000779 - -0.1364863803233619 -0.06088160869360848 - 0.2530493366684707 0.3252269745100707 - 0.3574904228727507 0.3323342936583387 - 0.2120818726139855 0.3619210419694802 - 0.5146862456902748 0.2494281698962047 - 0.3330053834809025 0.1105178704418817 - 0.0861627776671554 0.1161186657048354 - 0.144585000874067 -0.4264481257380953 - -0.3212445644091872 -0.5131166517243946 - -0.2751624419192208 -0.4010327097157395 - 0.0762252096991991 0.06791962089956913 - -0.05531255650582054 0.0139671241166306 - 0.1374849092582007 0.04217483744840502 - -0.4511224537236478 0.1224997282968452 - -0.4485381514749459 -0.1766583056570931 - 0.1174394687012706 0.04473600874041848 - 0.1232723331714361 0.01916264149010665 - 0.07441001841913165 -0.06429013422884779 - 0.03739461583855758 -0.008414160512989341 - 0.02851062722579848 -0.0362334575337695 - 0.6096164892106906 -0.0243445370100038 - -0.09458848446610174 -0.05769123060058098 - 0.1234315220093827 0.1899161939748071 - 0.4151935872322981 -0.1991819771422522 - -0.2081191647197676 0.2478686048022773 - -0.2769398995277293 -0.1008789427352538 - -0.03165387357378494 -0.06792440444536656 - -0.4173654366300972 -0.1461641464955016 - -0.1640350501115937 0.5906202841859363 - -0.4628789876516216 -0.3061274761909246 - 0.007346267202993011 -0.3935258455924972 - 0.4183666967203736 0.1100010019499648 - 0.3127327722026454 -0.5276652831277812 - 0.3614970779678373 -0.3226354201037699 - 0.5159873220349486 0.006374058134879289 - 0.501459214627606 -0.3319065734825592 - -0.1481137485389563 -0.2696765323184144 - 0.26049398248692 0.4426870297221167 - 0.03856858808183684 -0.02367151964276391 - -0.0757338082202377 -0.1336554188940862 - -0.09486709460832951 -0.09572222608382946 - -0.04208291757216675 -0.1804722002856705 - -0.1074733589859758 0.1276320757851142 - 0.3517546216040428 0.1823322227184917 - 0.05375801221203721 0.3937991807384154 - -0.6204825369423769 -0.06836013374266116 - -0.06484776089755681 0.293990656087629 - -0.01584699039570742 -0.06503212040423537 - -0.3334899543285217 0.08200729677815297 - 0.2537368718159197 -0.09088692688987429 - -0.2633166783132793 0.4697462623926345 - -0.006746744620716908 0.003298744034013259 - -0.2398080976783776 0.3175012748326259 - 0.07504862977509269 -0.138277269020098 - -0.1084911690287524 -0.2709625192877215 - -0.1671613368271481 0.0311037910683231 - -0.02614939685450667 -0.112887175660109 - -0.03061828407198335 -0.0162950903853344 - -0.343380205241233 0.2425733316358984 - -0.2135322659943543 -0.3654703011210743 - -0.07666206234132117 0.1068373504023072 - -0.3128714710658062 -0.2601646510283578 - -0.02034877256752327 -0.1811369484311391 - 0.01930186918506035 -0.1257231872445112 - 0.3416506212974832 -0.1710838610690081 - -0.09892959491872287 -0.1468086062870589 - -0.06699011575445021 -0.008086578954466218 - -0.04850122524281825 0.5545525469951608 - -0.02345460240678798 -0.05166199297181925 - 0.2024950846695132 0.1392824158049237 - -0.3237850476913745 -0.1529863609414917 - -0.07600749519045157 -0.155757005732294 - 0.04088844926707242 -0.1542576336359234 - -0.04940454764348582 0.1025579726588969 - 0.006063250862890834 0.0002105011978584855 - 0.09872113852298232 -0.1622785275266913 - 0.08932065509289562 0.2309484840012839 - 0.5563579797846103 -0.05688820817563112 - 0.06021647954422851 -0.4336386135802425 - 0.3109917449147012 0.267038371493875 - -0.3663805070646832 0.3834121801089587 - 0.5642400845043529 -0.2303965628279537 - 0.08352254996740792 -0.1060621143125238 - 0.09351806149890489 -0.3004254702034314 - -0.1187555638765356 0.5495903692935792 - 0.476196649101216 -0.2882392557258888 - -0.327707363988562 0.04427636942856433 - 0.06934857141668234 0.1359689373447077 - 0.2161104150654722 -0.2025648797133989 - -0.5335436971010459 0.05844216898613035 - -0.195052301626962 0.008737787612349618 - 0.1779064106268898 0.3428982638712521 - -0.0008666613195304957 -0.0801394093690119 - -0.2528999253522563 -0.1679568905013076 - 0.2363327909336763 -0.3440831309153271 - 0.06699542024570669 0.09949269980267357 - -0.07210471636842929 0.01379044980173656 - 0.1813952160465654 0.1627651046503961 - -0.2704462039807308 0.5131784168964678 - 0.2848997569055323 -0.1474846068087206 - 0.2844130050811225 -0.4276978660928524 - -0.1961965061148865 -0.0237637212330998 - -0.3427338403331529 0.1893297410364412 - -0.1242278836834518 -0.08363884078678306 - 0.03995168716830576 0.03657919370667467 - 0.2987878714253959 0.2262311482338975 - -0.1214152457000157 0.1480807356834344 - -0.03459541123709603 0.05611574899898974 - -0.4727946565234086 0.330926015031973 - -0.1434940801915333 -0.09381918064269303 - -0.2585560639452265 -0.3730636373275039 - -0.09204274794575813 0.01965865060485436 - 0.2513267614500194 -0.2191004917708234 - -0.1247346037342665 -0.01994902232922282 - -0.2424839350819715 -0.0848047841618049 - 0.1233068260312465 -0.1885730444524112 - -0.01533666205944817 0.1938162256072009 - -0.07202183694926077 -0.3919766814233593 - 0.2206319641140155 -0.02561331561787989 - 0.09243698617978252 -0.05196607654145238 - -0.01586229069928241 0.006295747716922816 - 0.1326760195587079 -0.4744557687314168 - -0.02917922744546793 0.08013061632616633 - 0.2768169057438974 -0.3415149053197387 - 0.2723563189238796 0.08679138290287468 - 0.4292453784731604 -0.04970503046269555 - 0.07679345756377799 0.2714897224936303 - 0.04024580028473342 -0.0442213523390832 - 0.208973201959947 0.1091824767062849 - -0.1848048396435641 0.3912285660003353 - 0.02931274901976321 -0.08858478265496023 - 0.04188261481724586 0.01985065781111647 - -0.4034865884025914 0.1437726302187086 - -0.1247213779381735 -0.2426123790961094 - 0.2703694103058338 0.2507590754788073 - -0.3009505373793739 -0.1166861606929316 - -0.1980642381040983 -0.1112334320893093 - -0.1598922573500314 0.480974581861331 - -0.1079384261554791 0.01506327718753265 - -0.2398215112829609 -0.2045000290925758 - -0.2550645457309565 -0.2383166488031465 - 0.05935757839023876 0.4813764234046815 - 0.05877995205365466 0.02307720597290568 - 0.1223295284881295 -0.03863932408844841 - -0.1337981541267416 0.01446730343285669 - 0.1273013823882158 -0.1580419615969285 - -0.3306066062531745 0.4144101485973999 - -0.2744059919073096 0.4157134081723184 - -0.007584453037491772 -0.02547036632826104 - -0.01705176383780366 0.5223676644726295 - -0.3645662167330609 -0.3659322993038523 - -0.06379061824371783 0.1215738146821823 - 0.1461456780200251 0.3155854038918034 - 0.3481298835775637 0.2217076949086357 - 0.08603443996353341 -0.4086570775531794 - 0.06175993804157247 0.2112988106960205 - -0.09677264991557637 0.2089090013393216 - 0.01702443161904862 0.2056438000309397 - -0.08944400487373731 -0.01750270793324532 - -0.007889174531916673 -0.01491078699749412 - -0.1838729815057023 0.1588250137699369 - -0.1715473187002583 0.4336802329378731 - -0.01805642384693654 0.3717347265439631 - -0.5327215301022697 -0.2083215333866792 - -0.1378841208222291 -0.5029737027030017 - -0.06212466939168585 -0.168334065835305 - -0.0007745125353681731 -0.00429559861219644 - -0.5106317808641159 -0.1339505298884988 - -0.2748978568660751 -0.2846270574369468 - -0.2458258295196179 -0.004449828087622731 - -0.2779259510972361 0.3411342299155323 - 0.1409243822522522 -0.3338888689892249 - 0.009043067019159724 0.02684834465156738 - 0.3929042900033798 0.1631964963484829 - 0.1803507484898067 0.3124538913052921 - -0.09738666307022352 -0.2977599517461483 - 0.009249337326684317 -0.007882741219332865 - -0.08281062946933473 0.1338500163279453 - -0.3243720328158425 -0.3764186686983463 - 0.0943566781075004 0.1709312085232118 - -0.2794350044544098 -0.49329031095935 - -0.1201741785749531 -0.1559896759523554 - 0.07808918805430048 -0.08356553287811992 - 0.1769531003279246 0.2442945312837306 - 0.1528949273223052 -0.3686442657044561 - 0.09926961215213399 -0.08872315518378777 - -0.3145008716812537 0.2659105081160529 - 0.2402966477558919 -0.196139877682475 - -0.08821442623073332 -0.6096606801514084 - 0.08541795680912719 0.5422327057558886 - -0.5825007108884381 -0.2014127794542483 - -0.3036608545872976 0.01315148864630271 - 0.4507059002388332 -0.1772749814190544 - 0.1329166678309904 -0.3021501266161287 - -0.3616586268450467 -0.4853731572166133 - 0.1777678430471011 -0.07100212859281245 - 0.2782399429855676 -0.1843504613738988 - -0.3489717543670589 -0.3315112348725989 - 0.02516179470240311 -0.5164718105775435 - -0.06111454617635194 0.391752722442796 - -0.1082244946489131 0.03985599747080755 - 0.1570069906239445 -0.5077504474037555 - 0.2925777649608985 -0.2926768749537921 - -0.2734732836207137 0.1639617205969849 - -0.3233734081126967 -0.2263990026335828 - -0.0780629728117759 -0.01593258794215888 - -0.01991626447059645 -0.009061622493049476 - -0.08403858215081643 -0.2842555529732456 - 0.1766806211064069 -0.2465996130776323 - 0.2636732047815847 0.2234135297922381 - -0.04407489106526926 0.01229687607420084 - 0.1033340367231554 -0.1913271782809188 - -0.1941597907221567 -0.1769310656841188 - 0.1488365579879435 0.2229171768926132 - 0.003733927411673643 0.2386000571048052 - 0.4605740492946266 0.0931410977745316 - -0.4858348117373947 -0.1772212011116728 - -0.2281125123619656 -0.1165816199963453 - -0.6065993732182219 0.08079772033800271 - 0.05340966108881549 0.03178929517464686 - -0.2443787844427693 -0.2738644741748205 - 0.002961848895772898 0.1340882666391035 - -0.4184874953815285 -0.3734456113735352 - -0.03279540489194063 -0.2562876327586259 - -0.4174789879790389 0.2316483969086984 - 0.6054639222061806 -0.1189795681075232 - 0.4226597205826711 -0.2428031431739612 - -0.1340878189994403 0.2881866571614513 - 0.03573849999004845 0.2844055705785925 - 0.3086285439756257 -0.07832516867179069 - 0.4898913542211492 -0.3700037385088419 - 0.101048077213802 0.2516710184676664 - 0.04325784252081098 -0.4895050265413199 - 0.1290920675799392 -0.1100764417211154 - 0.03834611655736589 -0.6129977395159598 - -0.1248610266004605 0.2006185606225281 - -0.3070722323191361 -0.07751011991650349 - -0.08616778382868397 -0.07428869419498579 - -0.1957925479153192 0.04242916017948371 - -0.2969154591199462 -0.4304707010323852 - 0.08966685350918883 0.3696028773441687 - 0.0391125092051179 -0.06028191081171413 - -0.09541143549576957 0.1091867358001954 - -0.1882586946998083 -0.2676026969848728 - -0.1433795366249529 -0.3391213092716753 - 0.3776408120269248 0.129962326241228 - -0.1601856020099155 -0.04648036013498532 - 0.2178524135190709 0.02579091414007878 - 0.5651259069783372 -0.004795359205345031 - -0.4396675705423759 -0.2476482553742674 - 0.3794141868605646 -0.4197050329469477 - 0.1320097907557877 0.2572891123599416 - -0.4989633304046042 0.05093879254857112 - -0.4357516491952117 -0.4318763583030032 - 0.1190109542206176 0.1551352603760305 - 0.1708471331186714 -0.1300314809032533 - 0.3656571094834506 -0.2283806141312676 - -0.1473118185735411 0.02923865281160214 - 0.09059200400422772 -0.03962732927076475 - 0.2333347783125281 -0.2609289323380475 - -0.1206065209895683 -0.5752492146675916 - 0.08537649704398725 0.1466639519049188 - 0.07887417493009762 0.08685421792124376 - -0.06502951777978248 -0.08087380998172027 - 0.1118620647958066 0.1060587070377931 - 0.01844654316065524 -0.01754467545095184 - 0.03301079951837353 0.0769683799934729 - -0.3724060755134778 0.07592929810364282 - 0.05048773602797783 -0.03359768218769953 - -0.0196257178189366 -0.04197283772880495 - -0.2396098686456712 0.1792351217968392 - -0.1454031884647513 0.0995934152238525 - 0.003087034992280818 0.5645083823721996 - -0.1163097204157009 -0.0606194233691944 - 0.2742402273762921 0.05514498646061732 - 0.2331252216384518 -0.3898860198980819 - -0.4181201308410027 0.4542527282265001 - 0.308590634261329 0.06127774438360985 - 0.09048868143831514 0.3251470600057708 - -0.07276734512403825 -0.1860738840194267 - 0.3100451408418013 -0.1745773993024987 - -0.0160290701779841 0.05017308659594968 - -0.01900694670460233 -0.5122099779029966 - -0.1483751943021782 -0.3904197208326032 - 0.1573990013900132 -0.1170370523280397 - 0.00785751001601249 -0.1815218419784064 - 0.05731974549261826 -0.1378277276188372 - -0.04043262614922764 -0.02856505016978731 - 0.1020917148496031 0.05600870631267427 - -0.009969939881851892 0.08111018822069135 - -0.02801765986196978 -0.02648543545085263 - 0.446916042324542 -0.4057860266939563 - 0.5161079030995235 0.1850737902736781 - -0.1331797786186197 0.07483526713581294 - -0.08117818860385476 -0.03953274699972781 - -0.2625516947852661 -0.1288396957825373 - 0.1542474126464904 -0.5473561092501485 - -0.3293584387343167 -0.06832191083468633 - -0.004441819406691287 -0.1337678545036903 - -0.09485036335221132 0.4116742491227203 - -0.02472314281145321 0.00551946369066591 - 0.2036588252124384 -0.08185797538325597 - 0.06240635747688366 0.3042336302653466 - -0.1330005910471748 0.1237820634121016 - -0.1702007713848306 -0.3607849616699045 - -0.1143008103787116 0.08500599157133162 - -0.06133592245716845 -0.2014349103794455 - 0.1235253326811518 0.4536917011193313 - -0.01764176064257463 0.4225714396314038 - 0.5076841080254993 0.04762094246553593 - 0.2149679848005261 -0.3179140250958228 - -0.2057159942547 0.3416718089755416 - -0.5341694573062312 -0.05540775709176519 - -0.0443823333329229 0.1652802679266151 - 0.2896788671421946 0.1567036865577106 - 0.2510762548634352 -0.1526909435231712 - -0.4981877108790585 -0.08967948572651926 - 0.3746684827930338 -0.08655670926613571 - -0.1221697097449395 0.1701459386357064 - 0.01812191029188932 -0.008118139046598118 - 0.3124729287034183 -0.008216912610672377 - -0.1312841330175506 0.4014803105009853 - 0.1481136056430806 -0.2366662792541243 - -0.05960968298394571 0.02736418201728413 - 0.1070258337690565 0.2929943109559176 - 0.02624056178675368 -0.02442705079761277 - 0.1257636836322331 0.06186932115842589 - -0.1062394422263162 -0.3348866653534559 - 0.5129558714656233 0.3359353164785035 - 0.05682669788097046 -0.1164889924320212 - -0.4644706912966318 0.0872553521051673 - 0.007739178867301336 -0.01569682822486855 - -0.3617173572570481 -0.2072696248260242 - -0.05504987512605887 -0.562819765634762 - 0.3826958913189687 0.247426452604842 - 0.07689721612058541 -0.0008765964946625535 - -0.03168685533732617 0.1456902548723762 - 0.02339494982123477 -0.06764334219504961 - 0.005503769496278029 -0.1686941091460603 - 0.2944533632054616 0.5430517383063316 - 0.003873055484949011 -0.06649548347008427 - 0.4930062246458571 -0.108095449970724 - -0.2255950440172176 0.4085976885613104 - -0.2545081054537852 0.06527500686493176 - -0.1245950407727081 -0.1767796823247319 - -0.05817563370191459 -0.06233550683153575 - 0.2364042216987115 0.08450350641770422 - 0.2772627654444252 0.293422293867268 - 0.4382690135233118 0.391303840407276 - -0.1068317919666125 -0.08045985512714504 - -0.1649544141445321 -0.304455341088282 - -0.2101420471861007 0.5772163298457735 - 0.01537249346541624 -0.08116582485298308 - 0.2923424137936446 0.02674574506308761 - -0.08801609042746444 0.09162317898061219 - -0.09412147191210123 0.06436924741510588 - -0.07414883041648436 0.2327265392435929 - 0.3625606678589235 0.007732322436161444 - 0.1963733173641722 0.2218560477484271 - 0.4255431282557703 0.2364849651157858 - 0.1165034489208728 -0.3928993984906255 - 0.5029445293385474 -0.2481028780361439 - 0.02805668915019242 0.01371670808967596 - -0.09877464584781201 -0.001657013513429532 - 0.0998860382586431 -0.02234332933509211 - -0.3073485543697509 0.2035595655791557 - -0.3051623674810104 -0.3119358819674974 - -0.2322435937561717 -0.06591537754858738 - 0.1629127444145117 -0.274340527900891 - 0.1493574322018791 -0.04171510460002746 - 0.060373471285101 -0.2047769207784126 - -0.05391047465714997 0.05577638657178685 - 0.07103321335814969 -0.1793351131363648 - -0.01293294407407154 -0.5663699595050522 - 0.3344203484871355 -0.4515200980378048 - -0.1082024131543859 -0.3722383402844813 - -0.3804376536107866 -0.019091941167672 - -0.3450430800198601 0.00545219976803355 - -0.01596188358916633 -0.01850941948347371 - 0.01263472241700773 -0.348374459755893 - 0.06141628983267751 0.08005457729502589 - 0.1401944496934776 0.4000134784562084 - 0.2886283140074152 -0.3900857431089014 - 0.1523513050007153 0.3688412667727467 - -0.04436631281021933 0.07064593786860626 - 0.05658323878335677 -0.05196577025540191 - -0.159146875800208 0.004003609750753632 - 0.04962265038002949 0.1646981737774892 - -0.2806759596295151 -0.5495131628240582 - 0.02595251823517663 0.3145313074148194 - 0.1607798926822502 -0.5917168937288098 - 0.1252342526200748 0.1270096195016893 - -0.3559897565074845 -0.1815353967401935 - 0.1088238916622365 -0.1075530896937627 - -0.1957947539408074 -0.33587367404255 - 0.1956182579118426 -0.4240145846804148 - 0.01430300313642907 -0.0260408959974477 - -0.3139119696520548 -0.1957542990719159 - -0.03312857904727171 -0.4539903886642986 - -0.02250008663822773 0.06561620623860312 - 0.09065251251417659 -0.0682784692033452 - 0.1468554536847379 0.1652144143213099 - -0.229821851278578 0.1199761658145217 - -0.03994674583015809 -0.05510647762941237 - -0.2063975612543031 0.4928863434881058 - -0.04642555202696064 -0.04554203283287966 - 0.1840474861638584 -0.4648739829127847 - -0.2057600806261308 0.1053356868808085 - -0.1179592582125513 0.1046918305089381 - -0.05220539743760555 -0.03303527029642959 - 0.1917328380889614 -0.1523795065046229 - 0.2724530932019569 -0.2516875022549063 - -0.2987102654214928 0.07283960598244647 - -0.05711634922758752 0.142912138965062 - -0.01062537639154859 0.3392854856769467 - -0.06390048068896971 0.08713098613963975 - 0.02863079429458619 -0.2957966018201226 - -0.1166908201406327 0.00404359078510636 - 0.06053503378841001 -0.09367291865964926 - -0.04388420958115969 0.08538880120860064 - 0.5145779705856651 -0.04531030739552341 - -0.1303250747009149 0.4984390541958905 - -0.2564161900843175 -0.3029409805523224 - 0.01960401822309848 0.03699314987770042 - 0.4734032369746877 -0.03690509490801015 - 0.4131195840350245 0.3387635308859932 - 0.1728785679142598 0.5895553023872881 - -0.3738628379894867 -0.07390002192228262 - -0.5010641002955147 0.1016033941995036 - 0.2964208549082394 -0.2159303604466434 - -0.07739373475486655 0.07476861008658867 - 0.0443729849391103 -0.09214177138957556 - -0.09737204959955273 -0.1738912817690276 - -0.1718627128265628 0.2441076608575605 - -0.3818951902160985 0.1184085929414455 - -0.07539296694925789 -0.2597899751104683 - -0.01717536215856398 -0.0005009671814517382 - -0.04084257503974053 0.1276259788215925 - -0.09736084577267247 -0.2281674715473077 - 0.02304058986204411 0.4089359264813544 - 0.03911929331031554 0.2158529619876294 - -0.2740895357203052 -0.01507501631312306 - -0.0271900884155511 0.04087862514960538 - 0.4353338076976769 0.2953498731654223 - 0.4214852645932697 -0.4533310928882312 - -0.1799415752917101 -0.006198152659624321 - 0.09231091426914473 0.1995148277827557 - -0.468022693535105 0.1969048311345657 - -0.1722505615258935 -0.4346090151419708 - -0.06320805566899192 0.06651942697250483 - -0.07174460496793937 0.02942063571302727 - -0.5265337806249377 -0.3099800625603104 - 0.4656062039872357 0.3427428554841065 - 0.2359385356481518 0.3991003552038577 - -0.06700945930366442 0.2106302976636489 - -0.3355700034857115 0.1318605478440445 - -0.02971377694045263 -0.6124026533816961 - 0.06539110435411197 -0.01172136688494502 - 0.05041435147675678 0.008454005962034127 - 0.4586938029271898 -0.3490265114305015 - 0.2301559242479074 0.06083066319806811 - 0.02364114511834817 0.1318958851729003 - 0.06241125789805018 -0.3423588073609404 - 0.2726537636491786 0.128178308915695 - -0.1930648649097637 0.1294947982733197 - -0.4525791680759595 -0.3444446044583641 - -0.1362909920347601 -0.03669875489319167 - 0.1034175864136367 -0.3346089386300491 - 0.5483469990262143 0.2833940338318834 - -0.226919781265888 0.0549077286185308 - -0.3252380461063905 0.4617488242105189 - 0.06344761302013334 -0.0278227717396071 - 0.4026587917931874 -0.3828729829537067 - 0.2447874639212171 0.5665679481692188 - 0.05161398191437071 -0.01700332532352437 - 0.2336978342689885 -0.5270196491812078 - -0.007679480971801787 -0.00570624591955631 - 0.07049509377659123 0.1668114115157667 - -0.1165072298537162 -0.1020043448972324 - 0.003616111563980345 -0.03242578408117611 - -0.02617847235338575 -0.208024121354859 - 0.1142351884898346 -0.1357015297393208 - -0.388247997322021 -0.1186174160574145 - 0.3624639179205741 -0.1314614073052072 - -0.1617905673233513 -0.181937930167974 - 0.6105107452392202 0.04278449031029839 - -0.3767798235210886 0.4322610187004942 - 0.1527591112832384 0.0631068468995382 - 0.06531481933819194 -0.1605224112350494 - 0.1878237526724173 0.3838477014644945 - -0.01413224123049433 0.02311869422814535 - -0.1514063750337426 -0.5470337160104949 - 0.5530669615401523 0.06853134674751647 - 0.2007887434226704 0.2780208881173905 - 0.4340588372811455 0.4298717926304558 - -0.1840075462404905 -0.5137176139225574 - -0.1121007210809837 0.338187428466554 - 0.2939481073746297 0.4853659150964343 - 0.01103906371425246 0.08698126102625943 - -0.5558884628632164 0.1167786191400807 - -0.2722614380224455 -0.06004828050189179 - 0.3742314945077195 -0.4742114486017691 - -0.469281772122448 0.3912060947719764 - 0.03326320507158637 0.1135200639506329 - -0.00595360264018754 0.2138882098399867 - 0.3185630715634777 -0.1375754458608996 - -0.2039947342044786 0.2915823436859399 - -0.2233699985878967 -0.03449157865272334 - -0.4323827303719587 -0.01010334533853831 - 0.4181881704324791 0.06645087977413265 - -0.3953586576253346 -0.2455528470966649 - -0.5752203692621695 -0.03285776595410706 - 0.03697784057085518 0.4520972106889375 - -0.05181917062859067 -0.2846482484049252 - 0.04124806122985204 -0.1288074505382683 - -0.09538122830633575 0.1558178554279161 - -0.0757063836856104 -0.09069449371136735 - -0.002673244515041685 0.02006916682399166 - 0.2004699846076148 0.1900417426114696 - 0.06233545131157414 0.2415152052403381 - 0.002466843597203461 -0.09592822097959171 - 0.1174885368468278 -0.0008129855077829637 - 1.564433459270697e-05 -0.3153394361380253 - -0.1488491763747559 -0.02695328453627807 - 0.05311806999782891 0.3421206991976339 - 0.3810513953914956 -0.2843583468232087 - 0.02943092623766232 0.2448844885216042 - -0.009543949368488418 -0.2798033935338992 - 0.2517472662758075 0.1864027867880119 - 0.4965889302000396 -0.1573769577424115 - -0.09670868527867028 -0.1224904015718447 - 0.03809878850854102 0.1849295186418982 - -0.2694843133798526 0.09964770135133257 - -0.1352827279606706 0.316484727221277 - 0.2144333299743384 -0.1665543117039983 - 0.3858922356759495 -0.04167714299971984 - -0.3946012683600971 -0.456339861018226 - 0.05432756400621809 -0.2431609508073209 - -0.201050425948976 -0.05820256629301492 - -0.2894830019534486 -0.3480592181987145 - 0.1714492860688734 -0.2144763528438526 - -0.06528254531180845 -0.02953923591882652 - 0.20032111596629 -0.05147543781840322 - -0.02726215444471025 -0.001961084636337307 - 0.1265258467537354 -0.2667555005797519 - 0.2434251515645657 -0.1222884363670681 - 0.01809192698508948 -0.1057010082646025 - -0.0370298370211017 -0.1574143813853867 - 0.0004111994050541869 -0.01251736271526132 - 0.1142644355641241 -0.2290646398235022 - -0.4643017151622619 -0.05960203332975041 - 0.111589241473618 0.07597428029007593 - 0.02017018432180246 -0.547469249950712 - -0.1835492166093857 -0.05263373250408936 - -0.008342298851037898 0.115664006032632 - 0.07419255789667513 0.01714913764999927 - -0.03096303630175299 -0.3699360253234259 - 0.08923448306699265 0.4388575662143632 - 0.4551253370851708 -0.1268945596482272 - -0.08188754888962314 -0.4557595275087945 - -0.1676671299826574 0.3501165934826873 - 0.02290820511927272 0.06455118157580493 - 0.1214721682491207 -0.5947432912873369 - -0.09562061247101283 0.1783680868199008 - 0.0587410995165541 -0.07113471281799599 - 0.1869102177205948 -0.1813361574319744 - 0.5520755479716093 -0.2895671510043837 - -0.3907759708464403 -0.1818481497803148 - 0.07181911451902498 -0.04493798065855757 - 0.1386941409446209 -0.0009871963195931957 - -0.0388245126764355 0.03500514909098348 - -0.01556155084505579 0.03422092092630618 - -0.1794566795874684 -0.2369646343968647 - -0.06753323308691396 -0.3503264081045719 - -0.0609738953699715 0.2599032403382701 - -0.1696520654891319 0.3149518038829949 - 0.2403974718873444 0.1471116122467349 - -0.20911182686959 -0.4677766182015838 - -0.2543347618798051 0.5531303473407476 - -0.01820773880194769 0.1334742599774325 - 0.03065970756517752 0.04803885726376818 - -0.03948012898042583 0.0008714289312902063 - 0.1007086324689014 0.03704665562740585 - 0.07950542483990242 -0.6048770756069036 - -0.004255464785007494 0.4629867334706274 - 0.220982153543495 0.2396887496053823 - 0.09828173721619726 -0.2646564318926529 - -0.199870008961496 -0.1457212548481859 - 0.1459489526125682 -0.1347885014104205 - 0.104431467713941 0.01856771417452524 - -0.005029313889807577 -0.1989985509814318 - -0.08750286594266722 -0.5325052584391504 - 0.08790313272381778 -0.2375675384537212 - -0.0220199240644445 -0.07977683865813176 - -0.4106744687148769 0.3829584061735463 - -0.1106728998819886 0.2280473578912683 - 0.5436357024687715 0.1186962733937001 - -0.06441016315171312 -0.04739382924271492 - 0.2042103766344744 0.07766160565464682 - 0.1591725579242213 0.0904702155365867 - 0.1302168818677414 0.08785362369331907 - 0.3566531482292545 -0.360892152615469 - -0.1577977541854597 -0.2343634551140941 - -0.2444555936233953 0.2691762661244783 - 0.08635008322187411 -0.2078582869036668 - -0.06942570661703697 -0.3134875559683236 - -0.02946713942801832 -0.2298603803499337 - -0.238242685854474 0.2338089660749226 - 0.02434122285541076 -0.05136303723506006 - -0.03135847025642316 -0.1345105639266801 - 0.02726941112776968 -0.01314054508697422 - -0.004780107490749701 -0.03996302483838034 - 0.2029896924957199 0.00060863338337932 - 0.006908537652656085 0.03875001267596284 - -0.1212832357124622 -0.1246233703020652 - -0.2728539626910891 0.369719310368316 - -0.1697177168547534 -0.02564547822364423 - -0.07127811288712159 -0.1181358990626353 - -0.0001738842422317985 0.0004848217982576414 - 0.03402194922100118 -0.3254201984040587 - -0.2056419645448972 0.1752211652342735 - 0.07776883497899292 0.04893351889717319 - 0.2836373377585542 -0.1126065405334173 - -0.1282066758668601 -0.4466407484035422 - -0.2452135080296244 -0.04723207896508274 - 0.3411875474071876 -0.03439933904610375 - -0.3819435782538325 0.1997884153616267 - -0.2145634647220846 -0.08625023387892086 - 0.4621476258662588 0.04390286121015909 - -0.3058291364983757 0.1633826977192313 - 0.5078325640306268 0.09656265136953271 - -0.2670159198618937 0.2082612421331467 - 0.02813988848964559 -0.000101225089935102 - 0.0113457966654497 -0.4666620783806478 - 0.3894366096911241 0.09266129576202951 - -0.1409479962435776 0.221920415288741 - 0.2557790691877223 0.02738748230936081 - -0.5574072265407417 -0.259438346311649 - 0.0904152998821748 -0.1303154685310167 - -0.06206099549919686 -0.2348841241978241 - -0.2356080642299409 -0.3298360247648111 - 0.05022228999513442 -0.004625666590829835 - -0.2970443976918267 0.1131605519479747 - -0.2714615389916361 0.01736239070684424 - -0.09747754201753701 0.5943970993579296 - 0.1831932700542351 0.07245516440331182 - 0.006425767586306468 -0.2564620279151336 - 0.3199253403911611 -0.3738739169228875 - -0.372087707841779 0.04162773570004634 - -0.2909458066063935 -0.166188028641691 - 0.2487673425545098 0.5034392573920825 - 0.1441827582890863 -0.01950213447586005 - -0.1312410657170545 0.2562378270957226 - 0.09243946921237151 0.09507156825592535 - 0.1140424352246353 -0.5359194629949579 - -0.2194720956734114 -0.1741990443121992 - -0.3440070265025773 -0.1020635787033133 - -0.6012934422434542 -0.1152026626655211 - 0.02235586970584785 0.02535749578482364 - -0.1789050753273648 0.1003264008664688 - 0.3453215392973364 -0.07552895318048675 - -0.3510253171557454 -0.2454119137147856 - 0.2711469611448501 -0.03867228837896641 - -0.3471456600884921 -0.0351259832647812 - 0.05878904498679529 0.05157127448729159 - 0.1976353544806358 0.04553498183999401 - 0.01941699675192655 0.006021154053521493 - -0.2459077873368432 0.02813430542943718 - -0.3619742434109146 -0.1387234938787222 - -0.1757418416892194 -0.1239023738114929 - -0.1412947620640068 -0.001410528799978313 - 0.01531002674640356 -0.03715569940841761 - 0.02775095051850357 -0.2039016352671547 - 0.4827932154950382 0.1439064545755753 - -0.1819211760381352 0.2108597676625052 - 0.1539625796153377 0.1404017004026366 - 0.4438773678548537 -0.007976204824868173 - 0.5828749402585884 0.1563703428345411 - 0.02456623203136893 0.359363416182394 - -0.2127799069880517 -0.007407811734786975 - -0.1417500801318981 -0.2953608338558776 - -0.3758847485712955 -0.3019857550062596 - -0.0815432792968189 0.0006570358063542804 - 0.04109830152947319 0.06041866293487937 - -0.08852968884052913 -0.4920739530787846 - -0.1315870909564655 0.04808753419054266 - 0.1902764587933865 -0.01861176303451945 - -0.05996309320141027 0.4444711248984532 - -0.1664941616704178 -0.0721802992582771 - -0.5722703867051262 -0.1541330607472779 - 0.09804188664442551 -0.3610527841487536 - -0.04631180690091286 0.4845992750788346 - -0.2358294174292001 0.08727162058609357 - 0.069736789786739 -0.3867741322099633 - 0.150608364935345 -0.09643780194668458 - 0.3862793527058391 0.05186128506838383 - 0.175043840841236 -0.3132952654758597 - -0.1543523462192638 0.1537239850608043 - -0.03330377861327424 -0.3054197729150589 - -0.3057122906212954 -0.008427421265162955 - -0.04931441098447902 0.6092335651792101 - -0.04770289751196791 -0.1228177727573106 - 0.01128693976623628 0.6152184859574311 - 0.4566586738794001 -0.0790397938630505 - -0.03770434005341464 0.3147894080816804 - 0.008603148619375681 -0.050156969751727 - 0.01651444266466302 0.05246904622510997 - 0.2447756987653319 -0.2947364844029885 - -0.2835327420219091 0.293859314963713 - -0.06935362385835882 0.1856849027938718 - 0.1752422604092969 -0.09214422603623638 - 0.3100724262873169 -0.2546914092310374 - 0.1740324535845867 -0.04844587948487277 - 0.351690502264575 0.2845151157475324 - 0.0314865424722072 -0.3675760115265702 - -0.00864331149780005 0.01181369229263259 - -0.4108958499025824 -0.2944458080740959 - 0.1099464104800439 0.4947088161173379 - -0.001327347583411061 -0.1157597158286267 - -0.01634814084307568 -0.03171005731034487 - -0.1126175221156991 -0.2040252523932031 - 0.3846462528597142 0.2995145063958499 - -0.598370200258219 0.140370686496572 - -0.4586560578944955 0.1550634580545829 - -0.4692203562314206 -0.221328224973914 - 0.2309881304376439 0.2075317174208943 - 0.00823811454049459 0.007313332352907758 - -0.001965847060059543 0.03114821948726016 - -0.03403841705585819 0.1920149057745195 - 0.0009883533058304469 -0.02333606847711675 - 0.5209798312665332 -0.1832424007128635 - 0.3002306641136893 0.1019424359612174 - -0.01124561722016104 -0.1545948095790924 - -0.08148264388800416 0.3162565496181463 - -0.5491911494688578 0.1724826534643698 - -0.05651295901530762 -0.02203390737619433 - -0.3203227324428605 0.3159158525024331 - 0.4472677499992317 -0.2170801067031085 - -0.1696209188557706 -0.1576405318278435 - -0.03715443563732112 -0.1078706212294932 - 0.2866165415772922 0.4043835755355198 - -0.05461430264233955 -0.1426355373768656 - 0.2389265912930802 -0.4749371298736933 - -0.006352353190686014 0.06678359519785983 - -0.0004931435049431396 0.007794038229742253 - 0.05569557549575403 0.06746756964057324 - 0.1050686484216411 -0.03687569663872497 - -0.2117139781025164 -0.303799711581291 - -0.5402603009873508 0.2756462088025771 - 0.2160322745640395 0.4657776105508801 - 0.4121639932387346 -0.09242096951348261 - 0.2385885386826719 -0.05683318828738926 - -0.5018339296512807 0.2533292939513544 - 0.01054054937039225 0.07092708255851329 - -0.08438143605091469 0.5195098609734247 - -0.02402655663529396 0.2506308698048377 - -0.2226058677465835 -0.5532644006013535 - -0.1863766300152009 -0.2057615350255963 - 0.2858977020365389 -0.4792474245260682 - -0.04014552861333277 -0.01554672400362231 - 0.4213496328305843 -0.155838681234355 - 0.1824575468622445 0.43230434305612 - 0.3341616463164392 -0.4039740527516584 - -0.1578409429554971 0.05525495122247671 - 0.1997889545026042 -0.3605629793308266 - 0.2789577320353454 0.351388861750161 - -0.07065645934426829 0.04281680154885228 - 0.3788223207561064 0.3849558173318522 - 0.2348360686369099 -0.004847730107380622 - 0.1260679617005505 -0.08313714472495759 - 0.04633350047991515 0.09394885384423154 - -0.2266760672550055 -0.4223454095054857 - 0.1846600110143391 0.09778098720254762 - -0.1895897608834132 0.5424231522889753 - 0.06686793609087432 0.5935131732937149 - 0.1204915390476042 -0.01734540508941544 - -0.07349809756876301 -0.05714684911319191 - 0.2528886428942524 -0.02256933370782292 - 0.282346589369616 -0.005885110702421764 - -0.04525295346978243 -0.4887275099715496 - 0.4779884199299378 0.2875172793010353 - -0.2082694122298981 -0.2083168882678018 - 0.4162005114954085 0.0227888461385561 - -0.3640668891617618 0.4900806122464983 - 0.154542241728458 0.02326874165816701 - 0.0114572372588635 0.1091556987789381 - -0.4492182960712915 0.2603426397279253 - 0.3449373158931995 0.0652214300763528 - 0.007707688681077744 0.1796000223434515 - -0.2822161008819775 0.04669140002380266 - -0.03746240266030252 0.2815859202226224 - -0.4028738329201584 -0.3353898472599457 - -0.2803369112857305 -0.1925502395562253 - -0.1379207602293289 0.363137500443952 - 0.03863200319797686 0.005052658277216641 - -0.08886928103489003 0.04137411581781998 - 0.0810667626636091 -0.02088816153418654 - -0.3834680007331761 -0.4092585475650711 - 0.2747598991927755 -0.5579816004901523 - 0.5392454867155576 -0.2050292267634939 - -0.02821022555470433 0.09206489896960168 - 0.3934633672105052 0.2070553916367349 - 0.08936495592287381 0.008792062324483291 - 0.00163786323258283 0.1539053371755272 - -0.4126047791973078 0.08412936737590028 - -0.1136615367999907 -0.4204827918124384 - 0.1818980325838225 0.1228806367546262 - -0.4541037351690215 -0.1193997187989549 - 0.4844096037675038 -0.2109157340080695 - -0.3031557338497195 0.5408679172892003 - 0.334385131773683 -0.2815631107598378 - 0.4709689395095397 0.2311111257869852 - 0.3219244638167891 -0.3324581122396246 - -0.06077051976755004 -0.4262949786525532 - -0.02718153658731657 -0.4103886337538548 - -0.5048270674257944 -0.3563835428368868 - 0.1842221724094242 -0.3906328019642893 - -0.1658782093091782 -0.470762437104627 - 0.2666265878387771 -0.5108543122838387 - 0.1445932905720446 0.1109619462461649 - -0.4942334989391283 -0.2634267002145399 - 0.3968571803131019 -0.006224627986948607 - 0.1507398362792846 0.2795669895533702 - -0.07751466777510289 0.05322805107260219 - -0.3597610101466507 0.2837738876595647 - 0.1686679827375782 0.04480185082208763 - -0.1155447771972327 -0.03757521871957826 - 0.2384565981365963 0.1129109641118546 - 0.4315129991352057 -0.28752103984394 - 0.2034941476779048 0.3092036805396827 - -0.4593250072675489 0.03433371899017929 - -0.1490021669881274 -0.1367777983617762 - -0.1724196971769668 0.06702779470084852 - 0.105019564541838 0.1333451874614107 - 0.02702767218306661 0.1523540822323172 - -0.4180948089912268 -0.21051254595739 - 0.3001607685876683 0.1874763465602743 - -0.1608908450866083 0.08051581958795474 - 0.3835924692827138 0.4286414132492196 - -0.2614745333592409 0.1422931921949228 - -0.2314276217225983 -0.1392743288412004 - 0.04292923988484104 -0.07717551390350842 - -0.3362353447218469 -0.4308192531206845 - -0.2975282517781667 -0.03650724149527609 - 0.03507193019411479 -0.3985566931528379 - 0.05300412824902036 0.1171542862206907 - -0.4311467196230752 0.1904705577116164 - -0.5248010336129072 -0.1684838103805776 - 0.3200016780460809 0.3198183456009788 - 0.06859570917357945 0.1874731915692847 - 0.3917445682722677 -0.1285843834545946 - 0.03027591142918106 0.02768432359563643 - -0.172686643876748 0.2702127299173217 - -0.09256184123652661 0.2769892313650311 - -0.3847510256104874 0.2624763477525012 - 0.01329513971573278 0.0001118902332251428 - 0.1592464781673818 0.4825302998054909 - 0.3259543550654895 0.4130572210250777 - 0.02006029387941503 -0.4222542649806055 - -0.2205891056991152 0.1423208390574239 - -0.2714616446415584 0.2438973528104657 - 0.06476183581974181 -0.531989447004281 - -0.1624769823505096 0.1238338037619073 - -0.02200517972061796 -0.3477611907071422 - 0.5946450374702403 0.09699291363936144 - 0.3324697055849133 -0.5073703705256062 - -0.1376050309190368 -0.6110034877343138 - 0.06267597206213911 0.006673171220578038 - -0.2223812149068612 0.02280812554466745 - -0.5341584700745162 -0.110970051776939 - 0.3355322215108669 0.1500605491687179 - 0.1564703177638457 -0.07118338086131112 - -0.04512739705219945 0.04157423176623537 - 0.09388206054787293 0.07132557147531461 - 0.06029562352732978 -0.3085299204662123 - -0.05378955669371446 -0.08247001422320299 - 0.2266842343851965 0.1700620134780045 - 0.3095178740646032 -0.0495950651136344 - 0.08684979091586859 -0.4542604075039569 - 0.4358482206376115 0.1504244871941897 - -0.2349686961146924 -0.5017890799383304 - 0.03400660388561614 -0.2247157075950408 - 0.2396407888717242 -0.4362925075719773 - -0.2011245844351163 0.07603184804515892 - 0.4886124789102044 0.3804397059039091 - -0.007784880272717355 0.09937264352417169 - -0.09897116025996501 -0.02963990773688005 - -0.5179790676038413 0.344174020309919 - -0.00718821782169365 0.296673013386792 - 0.005328894292999963 0.01532434390746932 - 0.4633653968580582 0.1883353417524984 - 0.0267680316932521 0.09040489421588389 - -0.02806011782803294 0.1079401846311373 - -0.004030745736348862 -0.05336471285027217 - 0.3352336087412969 -0.2293602478066842 - 0.204024369828684 -0.2816689024462726 - -0.2842687667556789 -0.2368584989803632 - 0.2780934714402987 -0.05835858225199136 - -0.1552441436764315 0.1810867345019407 - 0.03086650670246806 -0.2604512586605738 - -0.02041528920906838 0.0155034747509595 - -0.4713221354273069 -0.3951075601700234 - -0.006242641467400924 0.04350876670538512 - 0.2265493775138684 -0.09120046995747795 - -0.04973213613920065 -0.0111916128253012 - -0.3728123947872148 0.1539899060653826 - 0.2142677161099478 -0.233731366441538 - 0.03647244033924397 -0.1058561211441356 - 0.06518259433170349 -0.2746921797937943 - 0.1016432698826411 0.3989708536148273 - 0.003355724183027849 0.05625154812290682 - 0.03606444266051667 0.5214372581512257 - -0.05199246514506353 -0.09966634231799452 - -0.02816092837037791 0.02703320833243904 - -0.03683701385370503 -0.03900369054458332 - -0.6262368219392459 -0.002579188447557971 - 0.08225544317805063 0.02754690975441906 - 0.1698364787497367 -0.02020573482083985 - 0.3746516593375974 0.4801599472895129 - -0.1868941407567477 -0.3963172721685007 - 0.09183779598891451 -0.00718541309596051 - -0.4014976185086824 0.3075288864369097 - 0.0123091712868448 -0.1454032915193558 - 0.3267819904877233 0.030630059870049 - -0.01646597580639358 -0.09678704587500357 - 0.2056224885415508 0.5287133073607726 - 0.009597594318600331 0.2733175860732644 - 0.1914041742513383 -0.5162426006670606 - -0.04305660845613839 -0.0736344064773319 - 0.1367640212326626 -0.06116538409490218 - 0.1166994753732191 0.2228449910107255 - -0.02108731208292488 0.1643999751139748 - -0.1047019605166318 -0.01631892249616481 - -0.4069893070366226 0.0148494014087931 diff --git a/params/CVT/python/cvt_circle7.txt b/params/CVT/python/cvt_circle7.txt deleted file mode 100644 index fc83c836..00000000 --- a/params/CVT/python/cvt_circle7.txt +++ /dev/null @@ -1,1000 +0,0 @@ - -0.1865080872250038 0.2800030129973236 - 0.2676656426359409 -0.9804171320212636 - -0.796553308897594 0.4934842575276435 - -0.4251486221661778 0.822783722937206 - -0.07260841502253677 0.2238840824184066 - -0.4169636167675989 0.04558493279758021 - -0.03254695500814473 0.03757654112022574 - 1.858350123678132 -0.3597540193507896 - -0.5366924683476256 -0.5029544431308144 - 0.1904345467882335 0.2147965749242609 - -0.783719613422324 -0.1055809339518494 - 0.6303028984932073 0.7649362849573796 - -0.1689654073382498 -0.2527383410222712 - -1.040060874916255 -1.025231589447568 - -0.838531118307971 -0.02708780993520775 - -1.139737888522686 -0.05744321283330812 - 0.5121583265913967 0.4504699415722287 - -0.09356466601538126 -0.0681500035151904 - -2.232311938029097 0.272001827349671 - -0.3163221389523025 0.8584281077440653 - -0.9127027024226481 -0.114825374656718 - -1.349840314192559 1.100554777036371 - 0.09042159038506446 -0.4217879243661574 - 0.7030170088817781 -1.542844586574367 - 1.829958973234296 0.7220118453809063 - 1.564128265399738 0.1715875977306536 - 0.214460632708636 0.3832216852757145 - -0.3359961606837736 0.304931426283449 - -2.023992480490502 -1.662609495248533 - 2.117203149026959 -0.7070713328286495 - -0.09156036092091045 2.615267662463775 - 1.062619152697825 -0.6808380313477699 - -0.02485207514973808 0.1575030268026434 - -0.624895045673531 0.7212685555190818 - -0.5582852078187798 -0.007747639423654105 - 2.646433402614586 0.3689681736752101 - -2.01906231441329 0.591519942515731 - 0.5847817911098447 -0.3977923978611796 - -0.2175728821667474 0.8915484491707562 - 0.2915712962720004 0.2515872932167731 - 0.5719426227348483 1.010390381356925 - -1.303326122078114 0.5463418903864744 - -0.3223297339090321 0.4986186724132701 - 0.3176838535212055 1.683338245040015 - -0.401161870015879 0.4397596448779483 - 0.2262079226881478 -0.1046987510864434 - -0.7727009353514344 -1.05405123319489 - -1.744308545797538 0.7974819555463752 - -0.8786267890424078 0.7995321021901381 - -0.3339302398337419 -1.759355604060838 - 0.9197310262934079 -0.1183094628163157 - 1.880231087160049 -0.570308171781108 - 0.8235911274438028 1.238107407278796 - 0.1330132559850537 0.2206582445669046 - 0.5978283783656543 0.369857888893065 - -0.1517227226166014 0.6951787327300351 - 0.8864999648302502 -0.3357747177276921 - -0.3231254058080283 -0.6921547148896322 - 0.2784585223035015 0.1052785960827692 - 0.8776345958657696 1.583301999437229 - -1.488938383158652 -0.9319778571241787 - -0.9246508817164604 0.04624684641906122 - 2.125588373917581 -0.3662049264565874 - 0.1972069101560071 0.3202980380494134 - 0.03417593914170774 0.3839838026539676 - 0.3352479722299221 -0.7925158549266256 - 0.7682921772182166 0.3857268366681784 - 0.3535529982848444 0.589941894496063 - 0.7024824812314129 0.6630423629326264 - 0.377879440068649 0.6513396704408686 - 1.887329991607995 0.8870709661449855 - 0.09447741208532945 0.02142623642015498 - -0.3783746590542497 -0.7564342691367701 - 0.2741794975245319 -0.7138988677910544 - -1.578205514674129 -2.538594867768826 - -0.5175485031270495 -0.6550300156723979 - -1.1051639617712 -0.8449589380681517 - 1.749844167762251 0.215464303600279 - -0.9397194029051068 -0.3644081243269392 - -0.8984543682267805 0.2611799372076292 - -0.7615820554303336 -0.3146494445243246 - -1.076793669812596 -0.3003694865825365 - -1.060963452099555 0.06784974065681602 - -1.106949773969763 1.025040002433826 - -1.990589412406455 0.3290101854940988 - -1.359714459463797 1.667268982308579 - 2.327906202214941 0.2482007373974502 - 0.8721337339310957 0.5144021792993686 - -0.2544603501264591 -0.2736572625025401 - 0.9396634933545903 -0.4256178698863017 - -0.1460934555022878 0.1307677979875243 - 0.1476275627077291 0.1153987149792326 - 0.558767411545477 1.358413017782997 - -0.8315737737198106 -0.1962639612320049 - -1.803149690905793 2.790440591613592 - -1.270306162997917 -0.5022091407999961 - 0.04440365097959053 -0.3575761678617914 - 0.6548855900909215 0.1632005593110695 - 0.8825906238823326 -1.682677675272342 - 1.008628683922828 -0.9678145682164727 - 0.8277240823937523 -0.06258371139263551 - 2.271072175419093 -1.000712896257228 - -0.01142212494110696 0.01824760101553325 - 0.5337284788079826 1.174325078400526 - -1.420460712782228 1.372516023210095 - 0.5993337080130859 0.6013592119536358 - 0.6701655430929727 0.547930321645541 - 0.1718404707476623 0.6238072898362772 - 0.551953755536121 -0.824948054561627 - 0.436825822119022 0.1872330978923309 - 0.08787697457614521 0.4477678779645762 - -2.596579219863681 0.3215764416610326 - -0.06328578934743043 0.1572752684492634 - 0.554671064366122 1.691469840279601 - -0.3292289595156382 0.08328371848525015 - -0.1646353560311019 0.05494190452921586 - -0.6066831220622532 1.14832875334794 - 3.51714043271516 0.5531275641561358 - -0.1644667504879046 0.1761576484632131 - -0.3873761433574046 0.7391815324228116 - 0.05923355553998391 0.05626322020732435 - 0.5060665724600547 -0.08201897630370425 - 0.3083839404646106 1.067064482340461 - 1.872864692592286 1.734579811610444 - -0.6084554514549232 0.3093600339242156 - -0.2429791443880712 -0.3530525235862427 - 0.8073960282789063 -0.8789814954181795 - -0.3197733395739519 -0.240815285736487 - -0.009340595938981348 0.5843043242177616 - 0.0107719804939686 1.135310097065499 - 0.4346778522353875 -0.2954880252017366 - 0.4887517311953618 0.6490439033341988 - 1.488016506766883 0.3068387432195397 - -0.1135836753230333 1.407175137479218 - 0.7037987428553704 1.537124730045503 - -0.3796255978628104 -0.2518556262410259 - -0.3095802357688248 -0.0551093688704647 - 0.2644233565218088 0.6690973950230442 - -0.06847459387809894 0.708916411794058 - 0.4320640790698069 -1.023376533281241 - -3.852215105532127 0.7827692764932292 - -0.2261567198286709 0.4983211456826933 - -0.0830132601434469 -0.1750919358913521 - 1.666016452539671 -0.4730013955379801 - 0.1238818359983616 -0.6130047213463992 - 0.3448713622996077 0.387067119575199 - -0.7108627347859876 0.6558322145887401 - 1.877583225459707 -0.9066438242919934 - -0.5467948196787251 0.8680135221585458 - 0.06782835930862154 -0.1654892391549488 - -0.5643269139584515 2.014164466394119 - 1.424274801873655 -0.6462341420605692 - -0.2569180241099204 0.0443533835623741 - -0.4246737634842306 -0.6499752590238134 - -0.03859736915790757 0.01571359402514052 - -1.37291097287966 0.1850087771048549 - 0.6480473400931361 -0.00608739923249366 - 0.2268725310423754 0.5610639792825208 - 0.2074925813654615 1.452651011410482 - 0.02991254975523941 0.02004553618317079 - 0.3777030840373034 -0.5460512372477974 - -0.4645223651897896 -0.8346503668196277 - 1.46807838111691 -0.02814132509426785 - -0.3038581396882277 -0.2971250580463609 - -0.9202569117321096 1.662414993429149 - 0.315335776826807 -0.1494258249779615 - 0.5344550883124197 -1.131207185404557 - 0.4715622328664007 0.09607675421108543 - -0.3182905708236112 0.2177544542427043 - 0.6872748532239802 0.4343621716582216 - -0.9344861438966253 -1.750889274932522 - 0.343226464590269 0.2574936587975773 - 0.3679507321413285 -0.4715029562683575 - 1.05231279784531 -1.432092369193623 - -1.742927461619686 1.375963685322757 - 0.6623961205163271 0.3281877113988851 - -0.5257157562189322 -0.7493796976216172 - 1.261253812131374 -0.137683769453778 - 0.3682665348362581 -0.2630878923558842 - 1.041793438020693 0.0231150347483613 - 0.2751717416935479 0.05103767226653241 - -0.1764697167556687 0.2354474817547318 - -0.002119544055546291 -0.5545398613892574 - -0.03930076259831056 -0.4014383828618983 - -0.5346960856759053 0.06707302535728811 - -0.9939187667753518 0.9270913072899958 - 3.247099036127924 -0.7232621752378561 - 0.2352364891097666 -0.8781151425030324 - 0.5392586170260025 -1.648165085636715 - 0.5067394128554356 -0.6230253333957355 - -0.2207844690961375 -0.05135889042393136 - 0.5828920710031207 -0.04841283425446261 - -0.0418366741737695 -0.1121164773359381 - -0.8912312891215868 1.311588143859708 - -0.3472496477952217 -0.1926693659182257 - -0.198583990647167 0.5814387996414979 - -0.4267547267530465 1.267502581122999 - -1.860053649799115 -0.4791924519594549 - -0.7905030123831746 0.2465869703951528 - 0.08141380337099832 0.2432903821833099 - 0.2457955873143104 0.2072610212831811 - -0.1068705866438669 -0.02050222806489486 - 0.3789878550151765 0.1848343109677097 - -0.5180772532555824 1.53979450579785 - 1.00767427452862 -0.09921494048174884 - -0.07565754538532506 -0.05338259146410192 - -0.2311630906821114 -0.1794187215709487 - 0.1079180298160285 1.328127795702805 - -1.430966279442737 -1.132608629736507 - -0.908271139553089 0.5041113762340391 - 0.8196486591437434 -0.1841126891153053 - -0.3245054668396808 0.6403673111767071 - -0.7432874148763841 1.231150342560056 - -0.4428620631406074 0.9431571933752408 - 1.177438436491798 2.987790296586938 - -0.09178470930990694 0.9505085499100696 - -0.7770280351147436 -0.8775677999873132 - 0.4663681486478835 -0.8751989835798846 - 0.1029999096220842 0.3280946117841879 - 0.3948614028157654 0.3142919730019323 - 0.1567128669735329 -0.7091019463822089 - -0.1372147901836911 -0.3093172979978225 - 0.1132467600466481 -0.1741653942296757 - -0.01079041809743371 -0.3563779277728318 - 1.264443097164366 0.2564184658941793 - 2.320357584770958 0.6638250707092169 - 0.2622966971694031 -0.2638922547527305 - -0.2987248111238815 0.7703742950218019 - -0.07262446016310536 0.4705669277640033 - -1.620987106629726 -0.6081711646253598 - -0.2421065965288811 -1.160771926319849 - 0.1938150338143464 0.6905414583979731 - 1.489648793491116 1.968508061032449 - -1.375069359601023 -0.4236565476769023 - -0.3673267389482565 -0.3104922875382937 - 0.3168988634938736 0.009246225312905542 - -0.4873315829374161 0.5377302882187815 - 0.2265744930559384 -0.533336475867064 - -1.498548191762852 -1.814210480607454 - 0.505832302092557 0.2134969147884293 - 0.1554313499360451 0.3632313844314622 - -0.07859477080223855 -0.2194075493855995 - -2.880138363372076 -0.5229099285653385 - 0.2989438584325556 -0.6079161720041715 - -0.6251910178444999 -1.091089465283092 - -0.2944398783383887 -0.3614969422915294 - -0.544153133173508 -1.174488765050044 - 0.306193383610438 0.5490601134868177 - -0.7440538133071514 0.7679089613795046 - 0.01091804548795543 0.006624197018894392 - 0.3017610524074239 -0.4518704934271135 - -0.8266675451343118 0.6449515629826499 - -0.4446168393594127 0.3246673606146686 - 0.1365339504466886 -0.1068629055656822 - 0.00588975066223269 -2.431225543318224 - 0.2947227768175816 1.878917027787261 - -2.157897035157446 -0.3617997330495237 - -0.204325825217818 0.03582977932007243 - 1.027672543647726 -0.3423507469840245 - 0.08221227921902415 -0.2749335840611672 - -3.050217117874335 -2.291128268822652 - -0.57480309672077 0.2256809918388815 - 0.1951749903214553 -0.1538097987669617 - -0.6115801457427988 -0.6790268646515222 - 0.1794880418423383 -1.100878858175229 - -0.01426906426860837 0.2937195843709397 - 1.173415710223007 -0.295845140949281 - 0.2883787150917252 -1.257134116869696 - 0.2922574085749119 -0.3171547302329747 - -0.3071710981838995 0.1496055057423914 - -0.4009794872451615 -0.1857840205646369 - 1.325640146355153 0.372453439496036 - 2.25703482797181 1.050808070710084 - -0.04140842982910523 -0.06570320020102202 - 0.05079520973349875 -0.02571992139934543 - -0.02684150265932561 -0.02754260130610368 - 2.846547530357913 -1.112877148150792 - -0.1860539088819312 0.3337114173214016 - 0.1276540373409008 0.1796884074356586 - -0.1729441852654121 -0.1873879422808477 - 0.01856428801776697 -0.2632210644723144 - 0.6121637034398637 0.09714553567967531 - -0.9768221243875992 -0.4843883370037189 - 0.1840452030032102 0.07855130848180081 - -2.940236453029266 0.496771494483951 - -1.70346895697714 -0.7876710730776936 - -0.2787761840063139 -0.2156523089315345 - -0.1916373753965915 -1.054952582866525 - -1.139277016965837 -1.079967352213861 - 0.03219303224721921 0.1339608527492734 - -1.040572646470242 0.2845535515632042 - 2.348867195303106 -0.5304531475326555 - 0.7075697689180915 -0.5591217291076245 - -0.09486639984224497 0.1264651056076206 - -0.0205486305757084 -0.09306792007433383 - -0.1253164883328458 0.0574416448916924 - 2.081986346172443 -1.372143476381967 - -0.07792184084918877 -0.1406193941038738 - 0.2078589864883193 -0.7641336915812647 - -0.5875798710398897 0.5821481910296379 - 0.4068775884137345 -2.049448787255028 - 0.172392244938194 -0.2331986833428505 - -0.2166863693112461 -0.08565922994663124 - 0.8154910070258027 0.7094738013416761 - 0.3694922141139527 -0.03177187439634402 - -1.024897859008314 -1.427733757401597 - 0.05116443994708055 0.3393708212939724 - -0.9756333918234383 1.167218548306085 - 0.6799982865660811 -0.7924597688403239 - -0.2088501799984125 -0.236983428714593 - -0.1187159846556594 -0.2519302756224345 - 0.215897405147498 0.03939375966018131 - 0.7013027847071366 0.2376826493432602 - -0.5159761628497554 -0.05191882567973022 - 2.333225539395936 -0.09558017403528529 - -0.8420137126209142 -0.4977963786300313 - 1.61846883930174 -1.406347098488043 - -0.1217147429420907 -0.1164915968853448 - -0.9891877434644936 0.1659075270114452 - -1.53175167729088 -1.504347021860639 - -0.3491614371747321 -0.5082773106543741 - -0.2417518318066095 0.3282331096038313 - 0.6863400185143126 -0.4438602131786801 - 0.6627674737139309 -0.1095139906701601 - -1.360478547767273 0.3778718189522213 - 0.3068806287602396 -0.2569556057632302 - -0.3251404363992224 -2.00922013886248 - -0.2633867137586203 -0.5796307103629532 - -0.5603776158540936 -0.871889119157875 - 0.847024805668637 0.8485614660232061 - -0.7160507881270523 -0.5828666026681196 - -2.30328396813868 1.043141962427413 - -0.7229957323652213 -1.271314056686397 - -0.465137915569249 0.06803649651418278 - -1.390437985142229 0.8822729485120173 - 1.149644782296786 1.899109549788639 - 0.009533960004831392 -0.01432645418075906 - 0.6603632513966941 -0.3242389986331892 - 0.1328422298667258 1.588375216262314 - 1.029138351772502 0.4073859251998048 - -0.2835383428879659 -0.01072936480377428 - 0.4190485587585455 -0.6138678486826606 - -2.519341092956997 1.82127851661754 - 0.1081547723287439 -0.008355932581156156 - 0.1527500609465811 0.4332986324721095 - 0.2119874146430125 0.4733055798207282 - 0.3623543352416195 -0.3320311895882775 - 1.344003615590754 -2.556491525078083 - 0.04135211146153858 -0.9951458192952986 - -0.1084885677120764 -0.5594646524111666 - -0.5155673326876186 0.3099330866630313 - 0.02473322582767546 0.7327808513149754 - -0.3280423171508383 0.9936119987626706 - 1.841598564664852 1.269647513973406 - -1.012286711101113 -0.7168094195574479 - 0.04981847315578852 -1.568149560908556 - 1.702231555940607 1.161454116596691 - 1.856207476760661 -1.211566192424382 - 1.65057745447096 0.421105742222772 - 0.7433198128419393 -0.109162960288053 - 1.026879974629567 0.7096704950913515 - 0.08946600844674579 0.06769146490138338 - 0.6609960134829725 -1.79716032355387 - -0.2988682869955083 0.02311493995313187 - 0.1328453934743652 0.8887150952650412 - -0.01637611573656897 0.4121823423226932 - 2.060415346827059 0.3426709921264171 - -0.2907401696322088 0.2703374642485993 - 0.04982068994934588 0.0921992263800904 - 0.4876509889412699 -0.3251768674941609 - -0.2326623895418943 -0.4302433080947359 - 0.7392793978114975 -0.3323106960682412 - 0.04899085146179819 0.5215361371630293 - 0.1566634514129328 0.7922505817699723 - -0.09880402029731564 0.6283576370835849 - 1.291082388842283 -0.03603559868499989 - 0.1613268409412482 -0.2851112448970586 - -0.2660891688168353 0.5741491611903004 - -1.263182202172584 -0.188898983823626 - -0.08352413584710641 -0.8069704927011736 - 0.06630862539422205 0.02519660710518731 - 0.2439834603454321 -0.1492145074021921 - -0.9851515692427983 -0.1921024660755892 - 0.7029594298749458 -0.2088583151866626 - 0.2197394864256535 -0.3084318321065168 - -2.716020045147717 -0.272688922989919 - -0.04787733400850446 -0.004648901843478317 - -0.2070731106578529 0.7880680162567941 - 0.02732718174249357 -0.03249726907776137 - 1.894662961519228 -0.1155686500356719 - -0.0161016072741832 -0.05862224960591984 - -1.803058096786699 1.055034356904123 - -0.7600488476228543 -0.4587713961842293 - -0.01923807845649263 -0.3080803600310426 - 1.890660457186212 2.780352616648816 - -0.6533177876282644 0.8954983656744395 - -0.7750875717638118 0.05730328936842041 - -0.2629347686208356 2.870080537492466 - -0.6901685077481202 -0.394322859639945 - -0.08214482646396853 -1.834727481553163 - 0.7640372461803421 0.5970547386798416 - -1.546117545539912 0.2698277339834684 - 0.1396166831480037 -0.8210909964100167 - -0.583675597706392 1.736948005841318 - 0.07813602091772638 0.7002667201505786 - 1.042746325159955 1.744193777600374 - -0.1502809188410321 1.699407148408435 - 1.363673408052936 -0.1931597424433139 - -0.3887383302594813 0.5543810777727266 - 0.2304675762012948 -0.05006514405411077 - 0.3355306795948251 0.4472595843506108 - 1.266903537431918 0.5426933927170012 - -0.3976342896206002 -0.1259222162833958 - 0.3205390663641541 0.3307711974514201 - 0.980395543850753 1.029327600572373 - 0.8594519804269025 0.4161724276196202 - -0.06368267961151912 -0.08613761871124798 - -1.162198599872144 3.348157755131541 - -0.2522946413113925 1.547199771765791 - 0.0536010707902248 -5.434968725259304e-05 - 0.6657810218883757 -0.6630334610640973 - 1.264744092868904 -0.3821835509940643 - 0.07738865700082165 -0.207103057132924 - 0.421353842564513 0.04011756530988848 - -0.09021141850335852 -0.1030971631371221 - 0.7669529543531347 0.4913964821845531 - 0.06293710274889983 -0.5834348175099254 - 1.188044855878173 -0.6803080045754261 - -2.468513326357768 -1.29491283129685 - 1.180747318081069 0.1799830776433994 - -1.307360657041722 0.693274483698688 - -0.2703814678227576 0.1877587333176459 - -0.4824550187252758 -0.4046131085173586 - 0.3246383988186416 0.07600671387688188 - 0.1172049201674249 -0.2176435699352202 - -0.7921346698565869 0.3680860185108095 - -0.1012460430876739 0.4080445390652528 - 1.044277242644151 -1.168556332543057 - -0.1475565557537394 0.406626757628862 - -0.0812598701147369 -2.118565518113022 - 0.7414948393691897 -1.083236800041042 - -0.07359725791157927 -0.3668800514354874 - -0.398832193622124 -0.03252984510276845 - -0.3619385694739674 0.02247710248355112 - 0.964445996901366 2.589360487007115 - 0.1142952016329982 -0.3198177285075238 - -0.8860647132422234 -0.9789264564400404 - 0.273855203923682 0.939160055044751 - 0.5752452889831572 -0.7172858431678676 - 0.2774092628950656 0.3925617886891695 - 0.5163328267151244 -1.423204513054955 - -1.154163632520976 1.264269824408335 - 0.7397760152688864 -0.01480098083087122 - -0.1559425788526047 -0.6204260942848675 - -1.166320132687255 -1.638747758215127 - 0.004119111249993026 0.02800714064599638 - 0.9957730130580602 -2.284595067926399 - -0.3246544233247188 -0.4480868789382907 - -0.4483378124633705 -0.0910535269887383 - -0.5069441433859156 0.7566549663939668 - -0.198558048264724 -0.311262919024492 - 0.5384379405486532 -0.9664536938646336 - -0.8419650248859063 2.694450000124618 - -0.319613698736496 -0.1093001121448263 - 0.02802924081077082 -0.8436127589898587 - 0.274805293462233 -1.736616163054173 - -0.8114564227750657 0.8906867436854574 - -0.1725743859608918 -0.3720490714103707 - 0.2791393512533957 -0.1103046648946569 - 1.058846789708466 1.451026418802926 - -0.7638356574687344 1.471317729066 - 1.256049541720833 1.298111767446276 - 0.3502582401633667 -0.6754991338360842 - 0.3569357460168766 -0.2090433851336128 - 0.5731008592454836 -0.4737253695183544 - 1.50376846717948 1.491709296568767 - -0.2216355752079321 0.1463335471816091 - 0.404545643291061 -0.3971705014149334 - 0.1120332926176758 -0.06127020897528412 - 0.3501164302237163 -0.9191700073969613 - 0.02539673149079314 0.2489618127321528 - 0.4547258145695208 -1.273522333643787 - -0.0040668076262087 0.07611786725006803 - 1.137907375344519 -0.08563118273723651 - -0.7564442588938297 0.9990671008556931 - 0.3712415050782171 -1.129802802428236 - 1.654627694142118 -0.04547642472996086 - -0.1908154038888573 1.000667322325887 - -0.2519233827142801 -0.5040448907229996 - -1.09389254183345 -1.885733128501713 - 0.9578983968789758 -0.2433587294493123 - 1.142040179789422 0.8886703486178678 - 0.6139854379342127 2.791729830450622 - -0.5223345476019006 -0.1059704673735379 - -1.202882173905617 0.1098997278829043 - 0.4599606327544465 -0.4639892854152008 - 0.9029052099572716 -0.6877249842557904 - -0.5878116481371656 0.9769296314036503 - 0.2708031018226685 0.4843288871819498 - -0.06811817387885305 0.08782394924898207 - -0.3657522801208486 0.1051327564756086 - 0.1110203891109737 0.137724412976714 - 2.64254739605909 -0.1015487641693004 - 0.1571301293077991 -1.229477000264978 - 0.03858888036480674 0.1974413225735893 - -0.006851968890302871 0.5031212143118988 - -0.09699834393933271 -0.4132339496256395 - 0.2539676806415398 0.005795605921948692 - 1.43166831544194 -1.615613233999445 - 0.9138927924129217 0.6402281852053996 - 1.792184913511554 -1.902929237846355 - 0.5751175911060098 0.1735903557763021 - -0.1654113864796842 -0.4296447929809938 - -1.036766566946761 0.5011993616194451 - -0.3207524472626109 -1.037068908999631 - 1.237586246679317 -1.04909837601743 - 1.532681962544605 -0.8524433775488355 - -1.752977680297897 -1.366935000006063 - 1.117996282400236 1.13574291407729 - 0.4070305214614317 0.9034822353529777 - 0.1205743225930291 -0.2598493837624358 - -0.1063661000231999 0.02712609539823694 - 0.282685663662564 -2.557473899053825 - -1.766287859366655 0.3128510540055734 - -1.96086837451714 -0.2089260077506156 - 1.280214944989754 -1.282671119421795 - -0.2637662513720884 -0.06453481848792599 - -0.3517878660031831 -0.8505630131442398 - 0.1120004121601546 -0.3743653766743563 - -0.1448964010959136 -0.008139844906264262 - 0.1449609456715084 -0.06431697936872319 - -0.9088259670789521 -0.613565084056285 - 0.7832213743770968 0.2454149311686181 - 0.1445759600071989 -0.446642935636145 - 2.076726499804278 0.624175555124617 - 0.3196287310448422 -0.07169634531856799 - -1.526889354924295 1.945578865296123 - -1.203808780490381 0.8573368745727171 - 1.078837351679164 -0.8062154773550665 - 0.5910782299310552 1.993023751542988 - -1.573263955144441 1.106825531143647 - 0.7393385995065104 -2.713663275303951 - 3.019535090483653 -0.3908367864065505 - -0.1773278452185263 -0.5454230163995177 - 0.5905963776302753 0.482789421983637 - 0.02098292790036563 2.247746872909827 - 0.09024225077079087 0.375673896544319 - -0.492537236390432 0.4785116434123045 - -0.5354352435183375 -0.1783050738855396 - 0.3913149294458229 -0.08255726030025805 - 0.2162686445792766 0.1764814624827402 - 3.113200827846645 1.178989602987981 - -1.127415365817719 1.506116752172251 - -0.5511208350050165 -0.3810038441463809 - -0.2257349016492922 0.6566271332297985 - 0.2219180160687405 0.7474456004576978 - 1.885541761583661 -2.266356263421554 - -0.3839331781921029 -1.503203722641709 - 1.401022307323946 0.1288533609936303 - 0.2523935704302871 0.3161169270496912 - 1.337443086738574 1.718789670083237 - -0.606342378909668 -1.393486730026391 - -0.04117529943673939 0.1928867976905344 - 0.6892379025300381 1.101138568103477 - -0.2112850084431807 -1.488463864333244 - -1.19901287917084 0.4105173745774804 - 0.1432198349608354 0.07026009667968837 - 1.154043444508278 -1.65976152320674 - -1.836528873663535 2.049539127177614 - -0.4419621614694013 -0.9317928314602421 - 0.01873327878630315 -0.4240010438488357 - 0.3450704584306551 -0.1337625513492064 - -0.2318583688773651 0.2491057155854403 - 0.4108479132128413 0.1009955332837928 - -0.6426762122499323 -0.02450600434606829 - 0.463916449547876 0.1472938483189032 - -0.4366400296143673 -0.3330278737377331 - -1.649252482328696 -0.1308114623915405 - 0.01419339766632264 0.6399528233345032 - 0.01472145822867095 0.1056077418461779 - -0.131109707204636 1.184897774466868 - 0.2304354617364029 -0.4576860755461859 - 0.742007979305159 0.8303555730975223 - -0.2391642893360038 -2.291368707112246 - -0.1301560935757747 -0.1624688024478675 - -0.1232653965604665 -0.361728258445761 - -0.3903967190637333 1.759520954566598 - -1.46898870473151 -0.1326138049159477 - -0.002299614180266018 -0.1308283403835201 - 0.9401474010359891 0.1314605815089929 - 0.01935585058964891 0.1696605306926874 - 0.8765804183389112 -0.8018985972372643 - -0.03628620088690671 -0.2468276362662579 - 0.03256809135430075 0.07554049780975071 - -0.1347876012787551 -0.0787481518119984 - 1.485413544315895 -0.4136862489210199 - 0.4773748100437428 0.5463960168308495 - -0.2462204848315238 -0.6629008022911376 - 0.174976201810566 -0.09836254524340281 - -0.1257233204422267 0.2757199605470441 - 0.05210350202559272 -0.05466066283957929 - 0.3902487267237384 -0.1552538519853434 - -0.484541899634378 -2.793243602172996 - -0.06700838415499945 0.3702162028235467 - 0.5291290024387534 0.09983279739236282 - -0.5029237035033568 -0.5645275529352292 - 0.1089269665789781 -0.1302048212781742 - 1.41684818388212 0.6703790093988106 - -0.498871173849356 0.1549535694140646 - 2.477489197974899 1.033084168187405 - 0.06897901025205866 -0.1271085104727499 - -0.2572604815807621 0.1219766882450759 - -0.3372548239852255 1.397536652372321 - 0.2517489054318088 0.8617027490716175 - 2.169233754106594 2.192380749168636 - -0.04331761500762468 0.06216620891103963 - -0.9978861803856749 -0.04375666077423909 - -0.7315606073091225 -0.7271947676887031 - 0.137932389473347 -2.005372802219009 - 0.6133294070787028 0.2627426983421293 - 0.07935987710217225 -1.151904823067773 - -1.474647397114245 -0.2639075742708765 - -0.07758953451769304 -0.3131177311630693 - 0.07713495962854529 0.6134530412858288 - 0.8424058621039855 -0.5538304137273596 - -0.1796868347788603 -0.7092953619919949 - -0.1512879936166334 0.4883881116050698 - -0.7973553444857244 -1.443652576973921 - 0.2438264250731352 -1.496408306793035 - 0.1709644490632474 -0.3438130624446797 - -0.8933323876040133 1.017607544941732 - -0.2980791065284611 0.3652746242907843 - 2.409305988161937 -1.521296049979829 - -0.6235769491694366 -0.1808699526113468 - -1.051159065350796 0.7907734908995396 - -1.294483961494938 -0.006528311387618771 - 0.5801261927063522 -2.488385308595787 - 0.7056211703658103 -2.049451528345732 - 0.07192183241563112 0.1199910275581262 - -0.06892705013034667 -0.2547276434755358 - 0.03615574237756958 -0.1983034289455932 - -0.1337707524303433 0.2173403706587015 - -0.1189036793316265 -0.04364425467701154 - -0.4269431504502761 -1.083487157049948 - -0.6130363291400864 3.375757688893429 - -0.110780011231132 -0.9868505043348539 - -1.105897004433627 -1.238766967980689 - 1.582702376641278 0.8141344607943152 - -1.124485524427243 -0.5928660370286944 - 1.24146294302292 -3.484603203782094 - -0.09201480546314535 0.8524041240121355 - 0.076040946543754 0.2034060071626045 - -0.06070492809882293 0.2647469486135784 - 0.1645249447825655 0.1610534793233508 - -0.3865721540690379 0.270118958713974 - -1.12150267232585 -0.1833523903009767 - 0.01490024372125122 0.4565964277258764 - -0.2338271154739862 -1.312865189193541 - -0.1327043660492849 0.3325141592973622 - 0.4348950029365202 1.491207891933974 - -1.741879918055951 1.653278653611895 - -0.01376109840918692 0.05256667770550739 - 1.916420415344167 0.4405436574364052 - 1.459264341011117 0.4977434771623472 - -0.4547497095991188 -0.1584209019592889 - -0.4985552414831411 -0.2143115888949063 - -0.6385198677804397 -0.4954227581645245 - 1.500677325292805 -1.24136348559185 - 0.01556531536621 0.05204245121544433 - -0.1182013051438801 0.1624205382152609 - -0.07360528865644879 0.3164884398221974 - -0.04981996821895772 -0.1964183918769332 - -0.02389523847251333 0.2336278027280903 - -0.1984054960449109 0.09337956492693249 - -1.077031213523042 1.82089570303131 - 0.2092615677538919 1.015175166799825 - -2.350393556101844 -0.05915776382985147 - 0.2815012261109824 2.147865440723932 - -0.5926139925433813 0.131231157497741 - -1.295134045367554 -2.357174909356144 - 0.4263253733090585 0.4460299324568461 - -0.4322933054320464 0.6538082909855336 - 0.8517108640472559 0.2894165600502211 - 0.5565477784083502 0.7049146492844596 - 0.7169972221069403 3.496514895865817 - 0.02663689135214917 -0.1501944621605933 - 0.08775558913154873 -0.09686412837244304 - -1.273769361940862 -0.7800219432013402 - -0.1529930084426707 0.09370571067221829 - -0.3161276063438455 -0.9143779366359801 - 0.3566421746347399 0.131733455295672 - 0.1658957473138211 -0.00978251458664506 - -0.6566126756483472 0.2316006722248583 - 0.3135999767329037 0.1609962675742545 - 0.767297073028122 0.1645754121964108 - -0.3748063797988874 0.1811054433363394 - 1.043075449863618 0.1628360411853199 - -0.1783134612526245 0.1366469842489438 - -2.387098113666782 -0.7460223301415914 - 0.1342695394283797 -0.9779529001629448 - 0.1751290907732235 0.03416455941810898 - 0.1579476550949212 -0.1928732457843677 - -0.3314689048793564 -0.0133793800492261 - -2.154449747013971 -0.9885457367684405 - -0.5330452755282621 0.6469082722073497 - 0.07409277349675675 0.2845473240727879 - -0.4276175746246258 -0.5587657310408409 - -1.591981180342409 0.8672779688453462 - -0.07772137914614077 0.01676974259510156 - 0.2092458950860272 -0.009147701195378078 - -0.2719769778724127 1.973053766544083 - -0.5978853084335791 -0.3227940241460625 - -0.02145304647750527 0.09251883800728455 - 0.6539415490386393 -0.9155642448097649 - -0.4513512519392167 -0.01906744442579071 - -0.1650700274343792 -0.09580150687857408 - 0.743922870493896 1.763773114063564 - -1.124626371641413 0.1876761114292004 - -0.1080083556283833 0.09234397776102705 - -0.6605779569847098 -0.7994713255880674 - 0.3530464935222033 -1.418857234167377 - 0.1926517819145355 0.1212095555629149 - -0.1654825732010704 -0.05426457210950775 - -3.396636304894867 -0.2384883718120291 - -2.774842170815146 -0.9253212102916648 - 0.4943097234486681 -0.2373861408070176 - 0.08666018069887087 -0.04417841020901985 - -0.584992841094315 -0.4291958327248721 - -0.07536884117485673 -0.01994732114008155 - -0.002020744425659127 0.0005523318519766945 - -1.236533336288152 -0.9504569231714346 - -0.5932446492577111 -0.1039592998446674 - -3.04043013915438 -1.230364359839265 - 0.2679770066110654 -0.05114740615980502 - -0.3640596645553049 -0.08857003656393152 - 0.4179814790954751 0.2424678707775473 - 0.9257289696416033 -0.01507547062286305 - -0.9248931224620304 2.131508264003408 - -0.08726792622060171 0.5496552625382137 - 1.194637857398057 0.404546308007911 - 0.07204304340312707 -0.07555546524394691 - -0.3984263277131388 -0.417853993226582 - 0.829322143948299 0.06816542033350532 - 2.897610295149351 0.4994044614597346 - 0.1293850083578455 0.2808833932782456 - 0.4458145341944227 -0.02530321209427931 - -0.04255029848953468 -0.1544146450016297 - -0.6103068999792163 -0.5672127509267152 - 1.596740153399912 0.583714314119219 - -0.9191513810618256 -1.189474108565161 - -0.20099174491045 -0.7930697412427571 - 1.06027377622901 -0.2252435794174753 - -0.6601070957317389 0.1398607974610641 - -0.07443877222309762 0.7671878392399646 - 0.4792382646706172 0.2886279381848052 - -2.155570679697357 -0.6787069693520934 - 0.1580613818108359 -0.5522054592355632 - -0.07974109211848157 1.064731526452102 - 0.4606261672000806 -0.162953534081112 - 0.1013322168924834 -0.4995128595829924 - -0.5015577057750057 0.3824907767542534 - 0.3679889727574031 0.04270401711941976 - 0.1808821593143336 -0.3926195383229657 - 0.2095521983861993 -0.2443701770385939 - -0.006103066074887612 -0.0161225596298894 - 0.1394151136674141 0.009851373859295335 - 0.1516660576897808 2.903746298272225 - 0.3364172418628898 0.7071724507105089 - 0.03436467108021314 1.872525587743497 - 1.160333426921465 -0.4032198327635472 - 0.01117719859718224 -0.07954463929137383 - -0.3499694336845863 2.268369641330911 - -0.7873155079836455 -1.902608025261657 - 0.2533806614255502 -0.3755082630253592 - -0.2858284359326189 0.4309656264006133 - 0.2124907303865338 -0.6190801532755598 - -0.510680183602063 0.2229003578630607 - 0.4775077145498815 -0.537596859555894 - -0.7458915834675842 0.1652776420726625 - 0.4852324743183635 0.3676248338564495 - 0.0412303568118366 -0.3115938573417782 - -1.134532820566496 -2.954872406425717 - -1.0983225416772 -0.4311113124418185 - 0.1714758407502247 1.171266431989176 - -0.3044991790921541 1.136768843326502 - 1.219451918039797 2.346275594275937 - 0.1736710779988773 0.2671729775036044 - 1.217817204893659 0.7195569062060533 - -2.368618999451153 0.5845860504421306 - -1.207789208304847 0.2679328565636395 - -0.8797889645778494 -0.2764232498511066 - -0.04627842030111236 -0.03688471232790523 - -2.374511523926994 -1.748402553766354 - -0.7911186723622325 -2.614410404824496 - 0.03715233967041088 -0.4828895035990596 - 0.3671232785068749 2.34506195502059 - 1.593362340603123 -0.6411955925376778 - 0.02813189474107443 -0.007139088537436592 - 0.04621489360719424 0.8013767462616092 - -0.04611221304384758 0.1262042623810891 - -2.262773158029259 0.8142078363449856 - 1.467976089268281 1.054210986094147 - -0.3767051065745405 0.3664341438558227 - 1.111629487955835 -0.5282326346738198 - 0.3150220887576064 0.200983532205392 - 0.451504639181573 0.9723446643179551 - 0.6575484191781124 0.902064952539252 - 0.3562050737107275 0.8295210012281903 - 0.6287292341590335 -1.275062139668665 - 0.1332893962962842 -1.754991206547876 - -0.2321980407786325 -3.70370638792348 - -0.9347021059436152 -0.8475066155262241 - -1.096071339523913 0.5980358956957126 - -0.3562384457031452 -0.3790942121280606 - -3.31864952178209 1.129788001175778 - 0.6757726850390893 1.258732410469673 - 0.7804440501461037 -0.2714190050471201 - -0.4311380084851655 0.1541570983088624 - -1.506613975866821 0.4584624758615335 - -0.5683443304536672 -1.789463861740385 - -0.2394460523692035 1.28737376693627 - 0.04904821674206211 -0.2372304284657383 - -0.7013954914056805 -1.587304535617267 - 0.04082460291475001 0.04098834100722907 - 0.9308365359502173 -1.895226143313164 - 2.294973690807892 1.51807116377104 - 0.556882916456416 -0.3293179595207452 - 0.4248058522470448 1.096973720939357 - 0.9040815147187676 -1.043375512368124 - 0.5952724491495124 -0.1403663855851391 - 0.3148988939745501 -0.3730002048828363 - 0.4523206362688081 0.7455424950142624 - 1.456197846145361 -0.989465237964313 - 0.9540622521332888 0.8934920206231215 - -0.6858012927025131 0.05347159584848427 - -0.7135137484511996 0.4326045370648401 - -0.6635949686599087 -0.9587874156344609 - -0.5490849561978908 -0.9946133951065625 - -0.5615542373845568 -0.2648389263632658 - -0.7619551601176521 1.870395497662536 - -0.02115278410302162 1.522635331242644 - -1.456044858993884 0.05073801625770653 - 0.9876976882785745 0.5122376164871644 - -0.1587619623726542 0.01511717410835176 - -0.2420211667123513 -0.006667244655182183 - -0.1121880436351311 -1.661908044080246 - 1.377263287166099 0.8371194325944286 - -0.02351027573789762 0.00107328074557019 - 0.6915403696664941 0.09196277882989658 - -1.524339736866876 2.311179149380732 - -0.6899563207052117 -0.1042818443425283 - -0.05671917112348993 -1.112069699017629 - -1.475141900544341 0.6334302071771304 - 0.1201612579929573 0.04295768155942441 - -0.09728021245623845 -0.4820962708941264 - 0.1875206206386178 -0.05075619592621763 - -0.005550324763984861 -0.2188113916103664 - -0.8602988118932168 -0.7706212873588897 - -0.2711661056237388 -0.1186526696026082 - -0.212390411016977 0.4113412715664624 - -2.043421902869701 0.05748298803147646 - 1.595536541054592 -0.2423021737246756 - -1.708179866944574 0.5049279226701089 - -1.747286764651907 -0.959433206089175 - 1.934468889302365 -2.774708724402727 - 1.329108312725255 -0.7741928409833252 - -0.06939997108750598 -1.45799785799783 - 0.5468653875484711 0.2997621041077041 - -1.45945725302845 -0.5456206295153864 - -0.0993246840120697 -0.7202454982152173 - -0.6267328199211545 0.05058779935348694 - -0.07397165508027322 -0.6271317678732954 - -0.4352043556488932 -0.2540098986496231 - -0.7343512336630335 -0.2097576342033748 - 1.286631920846707 -0.5259268537130783 - -1.190682340467587 2.159539943598741 - 0.7707968624923549 -0.6934432686187525 - 1.068039519883528 0.8160386409187346 - 0.5854285719317311 -0.5763188250771947 - -0.01542389258291571 -0.7246002986657553 - -0.03609881207342728 -0.5010792992595881 - -1.995009180206078 -2.998827899323657 - 0.3050240133100028 -0.526474956733628 - -0.447624130329915 -1.331638397696777 - 0.7828859080347258 -1.23809530348513 - -0.5003665614220425 -0.3120909502432385 - -1.268645166202935 -0.3038679682551438 - 0.5668378426163267 0.006934648958660804 - 0.06961713335903774 0.1583412252323549 - 1.248468291037732 -0.9014673788365449 - -0.6158171700681526 0.4932972471562622 - -0.6865913778095848 -0.2872849811515549 - 1.082735039272213 0.3177593481157669 - -0.2221317887486093 -0.1415754985130988 - 0.9759226821999838 -0.5306131467582919 - 0.2162849704783583 0.2593244440232736 - -0.7192828714861276 -0.01814991904978667 - 0.3741023759551343 0.5037433952295685 - 0.5312994487238414 -0.1653175628781187 - -0.4426570092346441 -0.4934530283511426 - -0.1888569086217858 -0.9127278389065077 - -0.833956607141578 -0.3940549464617039 - 0.2359073344539028 0.1314612587107488 - 0.5898901944676653 -0.2235145883755369 - 0.8558861577650363 1.105553506622541 - -0.08021792092962728 0.05997736147920658 - 0.1113603337483994 0.09999154874413278 - -0.5918510270101239 1.345602880582258 - -1.286373093137595 -1.404032495316223 - -0.192791133892032 -0.006651172269644674 - -0.01019188275144567 -0.6180689503800728 - -0.2738611307774763 -0.7830683139732905 - -0.9417901978624632 0.3994444477406402 - -1.59089628889657 -0.4093606244711878 - 0.4205356822797829 0.3832224122004685 - -0.1591943786181241 -0.4819968254358866 - 0.8111013418373284 -0.4379106494151644 - -1.569504287897027 -1.240901368413596 - -0.08707539006646543 0.1833797566628877 - 0.02381755988653936 -0.0555637559791099 - -0.5892358257153946 0.3950046901079892 - -2.487253281957498 -0.4082311882190363 - 0.2862402772032868 1.234593234688407 - 0.7970391955704818 0.9912670320595788 - 0.06177010749842287 -0.6749238332524222 - -0.0587295854087441 0.03868775854351583 - -0.2164479984997134 0.1895049038546961 - 0.142613525868158 -1.40980919047464 - 0.4315476056200003 -0.2219740812384784 - 0.02722780834098937 -0.1135802639295798 - 1.940411415517018 0.1093687665437727 - 1.319116704972938 -1.920587980018092 - -0.5198447853945682 -2.211483345997465 - -1.775743480393146 0.07043372124487095 - 0.49407611465488 0.01171832397720235 - -1.717492622587064 -0.3274698794562768 - 0.2336872978238327 0.07757593719519275 - -0.7195505010374266 0.3187003335153724 - 1.74499278802064 -1.06080942563643 - -0.7983356863412975 -0.6264568817930681 - 0.04387992835441774 -0.08656727531803629 - 0.3965803346972959 1.291362277416729 - -0.1701677278665752 -0.1388927879364434 - 0.07540495042471197 -0.01343013043689095 - 0.08018746417034973 -0.7612319303363505 - 0.8949331923583664 0.1890987040210047 - -0.4638905327321736 -1.592067291398382 - 0.001923976378024379 0.3460346077256037 - 0.4423106358856582 -0.7289506935820328 - 0.4398958063830137 -0.09730578295286262 - 2.870037053773932 1.938399194076697 - -0.1020262598457271 -1.255824654319275 - 1.088889854710259 0.5514485208078523 - -2.053407070318833 1.467594031585368 - -0.001375676259795718 0.193458991801526 - -2.119299147903849 -2.137945021018329 - 0.965936920260431 0.2899106437341352 - -0.337366836978117 -1.204909246018279 - 0.02977193297579224 -1.31148722501321 - 0.8804267988885722 2.100272660207701 - 0.4954411349699679 -0.3974134923335363 - 0.1433113413235684 -0.1398390308112122 - -0.2798005444069414 -0.1638892879489176 - -0.2321337061410242 0.07366109338822721 - 0.2256438417512898 -0.1999191878593218 - -0.001434634671345359 0.1294180773071399 - 2.784647306493029 -1.940246097978611 - -1.953736718245937 -1.219536229722167 - -0.8601911894160854 -2.226326450790747 - -0.2882056054037099 0.084534887745374 - 1.316860137822664 1.004639703621149 - -0.4403250560344382 0.2322690418144574 - 0.2880913407138458 -0.1992175990127933 - -0.4598004329352398 1.117455631904519 - 0.002193031856080475 -0.04157197993891408 - 0.1354541255661361 0.5225396690092045 - -0.4207090937975598 -2.551579936203322 - -0.03845618790479132 1.268951277369693 - 0.5225107403644326 0.8265308430811242 - -0.1491822792815065 -2.845156885476923 - 1.437995605879261 1.299500713802043 - -2.632660200061427 1.11003732549815 - -1.391326086496671 -0.6560044956546587 - -0.8675365789994826 0.1310504362362053 - 0.8134752415364406 1.350307863761989 - -0.3339220195555136 -0.6073528138498635 - -1.6185886595289 0.08054002920277237 - -0.9601515548556905 0.6381037958878164 - 0.008708337120587092 0.908807185221937 - 0.1381362109645221 -0.03204983774463744 - 0.07344481008169866 1.044314213797093 - 0.7011201353863802 2.411446584593444 - -0.00755840182212303 -0.1686900794360349 - 0.7342113928150593 -1.369359446292957 - 1.026928448747043 1.267363100893416 - -0.7177330812232285 0.5501370242310655 - -0.1337240076237628 -0.204337189410133 - -0.0579933303847246 -0.9049802006279601 - 1.203782807366872 0.05780530209012243 - -0.4991228348209257 0.01707964655288882 diff --git a/params/CVT/python/normal.py b/params/CVT/python/normal.py deleted file mode 100644 index 6e3618bb..00000000 --- a/params/CVT/python/normal.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def rho(X,a,b): - - mu = 0. - sigma =1. - rho = np.exp((-(X-mu)**2. / (2.*sigma**2))) / (sigma*np.sqrt(2.*np.pi)) - - return rho - - -def rho_max(a,b): - - sigma = 1. - - return 1. / (sigma*np.sqrt(2.*np.pi)) diff --git a/params/CVT/python/rejection.py b/params/CVT/python/rejection.py deleted file mode 100644 index 28fc231c..00000000 --- a/params/CVT/python/rejection.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def rejection_method(a,b,m,pdf): - - if pdf == 'uniform': - from params.CVT.python.uniform import rho - from params.CVT.python.uniform import rho_max - elif pdf == 'normal': - from params.CVT.python.normal import rho - from params.CVT.python.normal import rho_max - - X = np.zeros((m,)) - - rho_max = rho_max(a,b) - - i = 0 - - while i < m: - Xp = np.random.uniform(0.,1.) - X[i] = a+(b-a)*Xp - U = np.random.uniform(0.,1.) - - if U < rho(X[i],a,b) / rho_max: - i = i + 1 - - return X - -def rejection_method2D(a,b,c,d,m,pdf): - - if pdf == 'uniform': - from params.CVT.python.uniform import rho - from params.CVT.python.uniform import rho_max - elif pdf == 'normal': - from params.CVT.python.normal import rho - from params.CVT.python.normal import rho_max - - X = np.zeros((m,2)) - - tmp = rho_max(a,b) - rho_max = tmp*rho_max(c,d) - i = 0 - - while i < m: - Xp = np.random.uniform(0.,1.) - X[i,0] = a+(b-a)*Xp - Yp = np.random.uniform(0.,1.) - X[i,1] = c+(d-c)*Yp - U = np.random.uniform(0.,1.) - - if U < rho(X[i,0],a,b)*rho(X[i,1],c,d)/rho_max: - i = i + 1 - - return X - diff --git a/params/CVT/python/test.py b/params/CVT/python/test.py deleted file mode 100644 index 615d477f..00000000 --- a/params/CVT/python/test.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def compute_energy(z,a,b,k,pdf): - E = 0. - - for i in range(0,k): - left = np.abs(a-z[i]) - right = np.abs(b-z[i]) - for j in range(0,k): - d_c = np.abs((z[i]-z[j]) / 2.) - if z[j]<z[i]: - if d_c < left: - left = d_c - if z[i]<z[j]: - if d_c < right: - right = d_c - - E = E + left**2 + right**2 - - return E - -def MacQueen(a,b,k,pdf,it_max): - - from params.CVT.python.rejection import rejection_method - - z = rejection_method(a,b,k,pdf) - - j = np.ones(z.shape) - - Energy = np.zeros((it_max,)) - - print(z) - print(j) - - for it in range(0,it_max): - y = rejection_method(a,b,1,pdf) - istar = 0 - d = b-a - for i in range(0,k): - d_c = np.abs(z[i]-y) - if d_c < d: - d = d_c - istar = i - z[istar] = (j[istar]*z[istar]+y) / (j[istar]+1.) - j[istar] = j[istar] + 1. - - Energy[it] = compute_energy(z,a,b,k,pdf) - print(z) - - import matplotlib.pyplot as plt - plt.plot(Energy) - plt.show() - -def new_method(a,b,k,q,alpha,beta,pdf,it_max): - - from params.CVT.python.rejection import rejection_method - - z = rejection_method(a,b,k,pdf) - - j = np.ones(z.shape) - - Energy = np.zeros((it_max,)) - - - print(z) - print(j) - - for it in range(0,it_max): - # 1. - y = rejection_method(a,b,q,pdf) - # 2. - W = np.zeros((k,q)) - for qi in range(0,q): - - istar = 0 - d = b-a - for i in range(0,k): - d_c = np.abs(z[i]-y[qi]) - if d_c < d: - d = d_c - istar = i - - W[istar,qi] = 1. - - #print W - - u = np.zeros((k,)) - for i in range(0,k): - if np.sum(W[i,:]) > 0.: - u[i] = np.dot(W[i,:],y.T) / np.sum(W[i,:]) - - #print u - - for i in range(0,k): - for qi in range(0,q): - if W[i,qi] == 1. : - #C_1 = (alpha[0]*j[i]+beta[0])/(j[i]+1.) - #C_2 = (alpha[1]*j[i]+beta[1])/(j[i]+1.) - #print C_1 - #print C_2 - - z[i] = ((alpha[0]*j[i]+beta[0])*z[i]+(alpha[1]*j[i]+beta[1])*u[i]) / (j[i]+1.) - j[i] = j[i] + 1. - break - #print z - Energy[it] = compute_energy(z,a,b,k,pdf) - - print(it) - print(z) - - import matplotlib.pyplot as plt - plt.plot(Energy) - plt.show() - -def main(): - - it_max = 200 - - k = 128 - a = 0. - b = 1. - pdf = 'uniform' - - alpha = np.array([0.5,0.5]) - beta = np.array([0.5,0.5]) - q = 8000 - - if 0: - MacQueen(a,b,k,pdf,it_max) - - if 1: - new_method(a,b,k,q,alpha,beta,pdf,it_max) -if __name__ == "__main__": - main() diff --git a/params/CVT/python/test2D.py b/params/CVT/python/test2D.py deleted file mode 100644 index c870b82f..00000000 --- a/params/CVT/python/test2D.py +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import matplotlib.pyplot as plt -from scipy.spatial import Voronoi - - - - -def voronoi_finite_polygons_2d(vor, radius=None): - """ - Reconstruct infinite voronoi regions in a 2D diagram to finite - regions. - - Parameters - ---------- - vor : Voronoi - Input diagram - radius : float, optional - Distance to 'points at infinity'. - - Returns - ------- - regions : list of tuples - Indices of vertices in each revised Voronoi regions. - vertices : list of tuples - Coordinates for revised Voronoi vertices. Same as coordinates - of input vertices, with 'points at infinity' appended to the - end. - - """ - - if vor.points.shape[1] != 2: - raise ValueError("Requires 2D input") - - new_regions = [] - new_vertices = vor.vertices.tolist() - - center = vor.points.mean(axis=0) - if radius is None: - radius = vor.points.ptp().max() - - # Construct a map containing all ridges for a given point - all_ridges = {} - for (p1, p2), (v1, v2) in zip(vor.ridge_points, vor.ridge_vertices): - all_ridges.setdefault(p1, []).append((p2, v1, v2)) - all_ridges.setdefault(p2, []).append((p1, v1, v2)) - - # Reconstruct infinite regions - for p1, region in enumerate(vor.point_region): - vertices = vor.regions[region] - - if all(v >= 0 for v in vertices): - # finite region - new_regions.append(vertices) - continue - - # reconstruct a non-finite region - ridges = all_ridges[p1] - new_region = [v for v in vertices if v >= 0] - - for p2, v1, v2 in ridges: - if v2 < 0: - v1, v2 = v2, v1 - if v1 >= 0: - # finite ridge: already in the region - continue - - # Compute the missing endpoint of an infinite ridge - - t = vor.points[p2] - vor.points[p1] # tangent - t /= np.linalg.norm(t) - n = np.array([-t[1], t[0]]) # normal - - midpoint = vor.points[[p1, p2]].mean(axis=0) - direction = np.sign(np.dot(midpoint - center, n)) * n - far_point = vor.vertices[v2] + direction * radius - - new_region.append(len(new_vertices)) - new_vertices.append(far_point.tolist()) - - # sort region counterclockwise - vs = np.asarray([new_vertices[v] for v in new_region]) - c = vs.mean(axis=0) - angles = np.arctan2(vs[:,1] - c[1], vs[:,0] - c[0]) - new_region = np.array(new_region)[np.argsort(angles)] - - # finish - new_regions.append(new_region.tolist()) - - return new_regions, np.asarray(new_vertices) - - - -''' -def compute_energy(z,a,b,k,pdf): - E = 0. - - for i in range(0,k): - left = np.abs(a-z[i]) - right = np.abs(b-z[i]) - for j in range(0,k): - d_c = np.abs((z[i]-z[j])/2.) - if z[j]<z[i]: - if d_c < left: - left = d_c - if z[i]<z[j]: - if d_c < right: - right = d_c - - E = E + left**2 + right**2 - - return E - -def MacQueen(a,b,k,pdf,it_max): - - from params.CVTs.rejection import rejection_method - - z = rejection_method(a,b,k,pdf) - - j = np.ones(z.shape) - - Energy = np.zeros((it_max,)) - - print z - print j - - for it in range(0,it_max): - y = rejection_method(a,b,1,pdf) - istar = 0 - d = b-a - for i in range(0,k): - d_c = np.abs(z[i]-y) - if d_c < d: - d = d_c - istar = i - z[istar] = (j[istar]*z[istar]+y)/(j[istar]+1.) - j[istar] = j[istar] + 1. - - Energy[it] = compute_energy(z,a,b,k,pdf) - print z - - import matplotlib.pyplot as plt - plt.plot(Energy) - plt.show() -''' -def new_method(a,b,c,d,k,q,alpha,beta,pdf,it_max): - - from params.CVT.python.rejection import rejection_method2D - - z = rejection_method2D(a,b,c,d,k,pdf) - - j = np.ones((k,)) - - #Energy = np.zeros((it_max,)) - - - print(z) - print(j) - - for it in range(0,it_max): - # 1. - y = rejection_method2D(a,b,c,d,q,pdf) - # 2. - W = np.zeros((k,q)) - for qi in range(0,q): - - istar = 0 - dist = b-a - for i in range(0,k): - dist_c = np.linalg.norm(z[i,:]-y[qi,:]) - if dist_c < dist: - dist = dist_c - istar = i - - W[istar,qi] = 1. - - #print W - - u = np.zeros((k,2)) - for i in range(0,k): - if np.sum(W[i,:]) > 0.: - u[i,0] = np.dot(W[i,:],y[:,0].T) / np.sum(W[i,:]) - u[i,1] = np.dot(W[i,:],y[:,1].T) / np.sum(W[i,:]) - - #print u - - for i in range(0,k): - for qi in range(0,q): - if W[i,qi] == 1. : - #C_1 = (alpha[0]*j[i]+beta[0])/(j[i]+1.) - #C_2 = (alpha[1]*j[i]+beta[1])/(j[i]+1.) - #print C_1 - #print C_2 - - z[i,:] = ((alpha[0]*j[i]+beta[0])*z[i,:]+(alpha[1]*j[i]+beta[1])*u[i,:]) / (j[i]+1.) - j[i] = j[i] + 1. - break - #print z - #Energy[it] = compute_energy(z,a,b,k,pdf) - - print(it) - print(z) - - ''' - plt.scatter(z[:,0],z[:,1]) - - plt.axis('equal') - plt.xlim([a, b]) - plt.ylim([c, d]) - - plt.show() - ''' - - # make up data points - points = z - - # compute Voronoi tesselation - vor = Voronoi(points) - - # plot - regions, vertices = voronoi_finite_polygons_2d(vor) - print("--") - print(regions) - print("--") - print(vertices) - - # colorize - for region in regions: - polygon = vertices[region] - plt.fill(*list(zip(*polygon)), alpha=0.4) - - plt.plot(points[:,0], points[:,1], 'ko') - if pdf == 'uniform': - plt.axis('equal') - plt.xlim([a, b]) - plt.ylim([c, d]) - elif pdf == 'normal': - plt.axis('equal') - plt.xlim([a / 2., b / 2.]) - plt.ylim([c / 2., d / 2.]) - plt.savefig('test', - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - - plt.show() - - -def main(): - - it_max = 1000 - - k = 256 - a = -10. - b = 10. - c = -10. - d = 10. - pdf = 'normal' - - alpha = np.array([0.5,0.5]) - beta = np.array([0.5,0.5]) - q = 800 - - new_method(a,b,c,d,k,q,alpha,beta,pdf,it_max) - - - -if __name__ == "__main__": - main() - - - - - -# --------------------- - - - diff --git a/params/CVT/python/test2D2.py b/params/CVT/python/test2D2.py deleted file mode 100644 index 5f9b90aa..00000000 --- a/params/CVT/python/test2D2.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - -import numpy as np -import matplotlib.pyplot as plt -from scipy.spatial import Voronoi - -def voronoi_finite_polygons_2d(vor, radius=None): - """ - Reconstruct infinite voronoi regions in a 2D diagram to finite - regions. - - Parameters - ---------- - vor : Voronoi - Input diagram - radius : float, optional - Distance to 'points at infinity'. - - Returns - ------- - regions : list of tuples - Indices of vertices in each revised Voronoi regions. - vertices : list of tuples - Coordinates for revised Voronoi vertices. Same as coordinates - of input vertices, with 'points at infinity' appended to the - end. - - """ - - if vor.points.shape[1] != 2: - raise ValueError("Requires 2D input") - - new_regions = [] - new_vertices = vor.vertices.tolist() - - center = vor.points.mean(axis=0) - if radius is None: - radius = vor.points.ptp().max() - - # Construct a map containing all ridges for a given point - all_ridges = {} - for (p1, p2), (v1, v2) in zip(vor.ridge_points, vor.ridge_vertices): - all_ridges.setdefault(p1, []).append((p2, v1, v2)) - all_ridges.setdefault(p2, []).append((p1, v1, v2)) - - # Reconstruct infinite regions - for p1, region in enumerate(vor.point_region): - vertices = vor.regions[region] - - if all(v >= 0 for v in vertices): - # finite region - new_regions.append(vertices) - continue - - # reconstruct a non-finite region - ridges = all_ridges[p1] - new_region = [v for v in vertices if v >= 0] - - for p2, v1, v2 in ridges: - if v2 < 0: - v1, v2 = v2, v1 - if v1 >= 0: - # finite ridge: already in the region - continue - - # Compute the missing endpoint of an infinite ridge - - t = vor.points[p2] - vor.points[p1] # tangent - t /= np.linalg.norm(t) - n = np.array([-t[1], t[0]]) # normal - - midpoint = vor.points[[p1, p2]].mean(axis=0) - direction = np.sign(np.dot(midpoint - center, n)) * n - far_point = vor.vertices[v2] + direction * radius - - new_region.append(len(new_vertices)) - new_vertices.append(far_point.tolist()) - - # sort region counterclockwise - vs = np.asarray([new_vertices[v] for v in new_region]) - c = vs.mean(axis=0) - angles = np.arctan2(vs[:,1] - c[1], vs[:,0] - c[0]) - new_region = np.array(new_region)[np.argsort(angles)] - - # finish - new_regions.append(new_region.tolist()) - - return new_regions, np.asarray(new_vertices) - -# make up data points -np.random.seed(1234) -points = np.loadtxt('/home/kliegeois/Codes/waves/params/CVT/python/cvt_circle7.txt') - - -# compute Voronoi tesselation -vor = Voronoi(points) - -# plot -regions, vertices = voronoi_finite_polygons_2d(vor) -print("--") -print(regions) -print("--") -print(vertices) - -# colorize -for region in regions: - polygon = vertices[region] - plt.fill(*list(zip(*polygon)), alpha=0.4) - -plt.plot(points[:,0], points[:,1], 'ko') -plt.xlim(vor.min_bound[0] - 0.1, vor.max_bound[0] + 0.1) -plt.ylim(vor.min_bound[1] - 0.1, vor.max_bound[1] + 0.1) - -plt.show() diff --git a/params/CVT/python/test3.py b/params/CVT/python/test3.py deleted file mode 100644 index 0a8c1571..00000000 --- a/params/CVT/python/test3.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - -import numpy as np -import matplotlib.pyplot as plt -from scipy.spatial import Voronoi - -def voronoi_finite_polygons_2d(vor, radius=None): - """ - Reconstruct infinite voronoi regions in a 2D diagram to finite - regions. - - Parameters - ---------- - vor : Voronoi - Input diagram - radius : float, optional - Distance to 'points at infinity'. - - Returns - ------- - regions : list of tuples - Indices of vertices in each revised Voronoi regions. - vertices : list of tuples - Coordinates for revised Voronoi vertices. Same as coordinates - of input vertices, with 'points at infinity' appended to the - end. - - """ - - if vor.points.shape[1] != 2: - raise ValueError("Requires 2D input") - - new_regions = [] - new_vertices = vor.vertices.tolist() - - center = vor.points.mean(axis=0) - if radius is None: - radius = vor.points.ptp().max() - - # Construct a map containing all ridges for a given point - all_ridges = {} - for (p1, p2), (v1, v2) in zip(vor.ridge_points, vor.ridge_vertices): - all_ridges.setdefault(p1, []).append((p2, v1, v2)) - all_ridges.setdefault(p2, []).append((p1, v1, v2)) - - # Reconstruct infinite regions - for p1, region in enumerate(vor.point_region): - vertices = vor.regions[region] - - if all(v >= 0 for v in vertices): - # finite region - new_regions.append(vertices) - continue - - # reconstruct a non-finite region - ridges = all_ridges[p1] - new_region = [v for v in vertices if v >= 0] - - for p2, v1, v2 in ridges: - if v2 < 0: - v1, v2 = v2, v1 - if v1 >= 0: - # finite ridge: already in the region - continue - - # Compute the missing endpoint of an infinite ridge - - t = vor.points[p2] - vor.points[p1] # tangent - t /= np.linalg.norm(t) - n = np.array([-t[1], t[0]]) # normal - - midpoint = vor.points[[p1, p2]].mean(axis=0) - direction = np.sign(np.dot(midpoint - center, n)) * n - far_point = vor.vertices[v2] + direction * radius - - new_region.append(len(new_vertices)) - new_vertices.append(far_point.tolist()) - - # sort region counterclockwise - vs = np.asarray([new_vertices[v] for v in new_region]) - c = vs.mean(axis=0) - angles = np.arctan2(vs[:,1] - c[1], vs[:,0] - c[0]) - new_region = np.array(new_region)[np.argsort(angles)] - - # finish - new_regions.append(new_region.tolist()) - - return new_regions, np.asarray(new_vertices) - -# make up data points -np.random.seed(1234) -points = np.random.rand(15, 2) - -# compute Voronoi tesselation -vor = Voronoi(points) - -# plot -regions, vertices = voronoi_finite_polygons_2d(vor) -print("--") -print(regions) -print("--") -print(vertices) - -# colorize -for region in regions: - polygon = vertices[region] - plt.fill(*list(zip(*polygon)), alpha=0.4) - -plt.plot(points[:,0], points[:,1], 'ko') -plt.xlim(vor.min_bound[0] - 0.1, vor.max_bound[0] + 0.1) -plt.ylim(vor.min_bound[1] - 0.1, vor.max_bound[1] + 0.1) - -plt.show() diff --git a/params/CVT/python/uniform.py b/params/CVT/python/uniform.py deleted file mode 100644 index dc0d5f05..00000000 --- a/params/CVT/python/uniform.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def rho(X,a,b): - - rho = 1. / (b-a) - - return rho - - -def rho_max(a,b): - - return rho(0.,a,b) diff --git a/params/CVT/src/CMakeLists.txt b/params/CVT/src/CMakeLists.txt deleted file mode 100644 index de909d58..00000000 --- a/params/CVT/src/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# CMake input file of paramsCVT.so - -FILE(GLOB SRCS *.h *.cpp *.inl *.hpp) - -ADD_LIBRARY(paramsCVT SHARED ${SRCS}) -MACRO_DebugPostfix(paramsCVT) - -#TARGET_LINK_LIBRARIES(paramsCVT tbox) - -SOURCE_GROUP(base REGULAR_EXPRESSION ".*\\.(cpp|inl|hpp|h)") - diff --git a/params/CVT/src/cvt.cpp b/params/CVT/src/cvt.cpp deleted file mode 100644 index b04dc532..00000000 --- a/params/CVT/src/cvt.cpp +++ /dev/null @@ -1,3239 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <cstdlib> -#include <cmath> -#include <ctime> -#include <iostream> -#include <iomanip> -#include <fstream> -#include <cstring> -//# include <boost/math/special_functions/erf.hpp> -using namespace std; - -#include "cvt.hpp" - -//****************************************************************************80 - -char ch_cap(char c) - -//****************************************************************************80 -// -// Purpose: -// -// CH_CAP capitalizes a single character. -// -// Discussion: -// -// This routine should be equivalent to the library "toupper" function. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 19 July 1998 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char C, the character to capitalize. -// -// Output, char CH_CAP, the capitalized character. -// -{ - if (97 <= c && c <= 122) - { - c = c - 32; - } - - return c; -} -//****************************************************************************80 - -bool ch_eqi(char c1, char c2) - -//****************************************************************************80 -// -// Purpose: -// -// CH_EQI is true if two characters are equal, disregarding case. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 13 June 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char C1, char C2, the characters to compare. -// -// Output, bool CH_EQI, is true if the two characters are equal, -// disregarding case. -// -{ - if (97 <= c1 && c1 <= 122) - { - c1 = c1 - 32; - } - if (97 <= c2 && c2 <= 122) - { - c2 = c2 - 32; - } - - return (c1 == c2); -} -//****************************************************************************80 - -int ch_to_digit(char c) - -//****************************************************************************80 -// -// Purpose: -// -// CH_TO_DIGIT returns the integer value of a base 10 digit. -// -// Example: -// -// C DIGIT -// --- ----- -// '0' 0 -// '1' 1 -// ... ... -// '9' 9 -// ' ' 0 -// 'X' -1 -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 13 June 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char C, the decimal digit, '0' through '9' or blank are legal. -// -// Output, int CH_TO_DIGIT, the corresponding integer value. If C was -// 'illegal', then DIGIT is -1. -// -{ - int digit; - - if ('0' <= c && c <= '9') - { - digit = c - '0'; - } - else if (c == ' ') - { - digit = 0; - } - else - { - digit = -1; - } - - return digit; -} -//****************************************************************************80 - -void cvt(int dim_num, int n, int batch, int init, int sample, int sample_num, - int it_max, int it_fixed, int *seed, double r[], int *it_num, double *it_diff, - double *energy) - -//****************************************************************************80 -// -// Purpose: -// -// CVT computes a Centroidal Voronoi Tessellation. -// -// Discussion: -// -// This routine initializes the data, and carries out the -// CVT iteration. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 23 June 2005 -// -// Author: -// -// John Burkardt -// -// Reference: -// -// Qiang Du, Vance Faber, and Max Gunzburger, -// Centroidal Voronoi Tessellations: Applications and Algorithms, -// SIAM Review, Volume 41, 1999, pages 637-676. -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of Voronoi cells. -// -// Input, int BATCH, sets the maximum number of sample points -// generated at one time. It is inefficient to generate the sample -// points 1 at a time, but memory intensive to generate them all -// at once. You might set BATCH to min ( SAMPLE_NUM, 10000 ), for instance. -// BATCH must be at least 1. -// -// Input, int INIT, specifies how the points are to be initialized. -// -1, 'RANDOM', using C++ RANDOM function; -// 0, 'UNIFORM', using a simple uniform RNG; -// 1, 'HALTON', from a Halton sequence; -// 2, 'GRID', points from a grid; -// 3, 'USER', call "user" routine; -// 4, points are already initialized on input. -// -// Input, int SAMPLE, specifies how the sampling is done. -// -1, 'RANDOM', using C++ RANDOM function; -// 0, 'UNIFORM', using a simple uniform RNG; -// 1, 'HALTON', from a Halton sequence; -// 2, 'GRID', points from a grid; -// 3, 'USER', call "user" routine. -// -// Input, int SAMPLE_NUM, the number of sample points. -// -// Input, int IT_MAX, the maximum number of iterations. -// -// Input, int IT_FIXED, the maximum number of iterations to take -// with a fixed set of sample points. -// -// Input/output, int *SEED, the random number seed. -// -// Input/output, double R[DIM_NUM*N], the approximate CVT points. -// If INIT = 4 on input, then it is assumed that these values have been -// initialized. On output, the CVT iteration has been applied to improve -// the value of the points. -// -// Output, int *IT_NUM, the number of iterations taken. Generally, -// this will be equal to IT_MAX, unless the iteration tolerance was -// satisfied early. -// -// Output, double *IT_DIFF, the L2 norm of the difference -// between the iterates. -// -// Output, double *ENERGY, the discrete "energy", divided -// by the number of sample points. -// -{ - bool DEBUG = true; - //int i; // unused - bool initialize; - int seed_base; - int seed_init; - - if (batch < 1) - { - cout << "\n"; - cout << "CVT - Fatal error!\n"; - cout << " The input value BATCH < 1.\n"; - exit(1); - } - - if (*seed <= 0) - { - cout << "\n"; - cout << "CVT - Fatal error!\n"; - cout << " The input value SEED <= 0.\n"; - exit(1); - } - - if (DEBUG) - { - cout << "\n"; - cout << " Step SEED L2-Change Energy\n"; - cout << "\n"; - } - - *it_num = 0; - *it_diff = 0.0; - *energy = 0.0; - seed_init = *seed; - // - // Initialize the data, unless the user has already done that. - // - if (init != 4) - { - initialize = true; - cvt_sample(dim_num, n, n, init, initialize, seed, r); - } - if (DEBUG) - { - cout << " " - << setw(4) << *it_num << " " - << setw(12) << seed_init << "\n"; - } - // - // If the initialization and sampling steps use the same random number - // scheme, then the sampling scheme does not have to be initialized. - // - if (init == sample) - { - initialize = false; - } - else - { - initialize = true; - } - // - // Carry out the iteration. - // - while (*it_num < it_max) - { - // - // If it's time to update the seed, save its current value - // as the starting value for all iterations in this cycle. - // If it's not time to update the seed, restore it to its initial - // value for this cycle. - // - if (((*it_num) % it_fixed) == 0) - { - seed_base = *seed; - } - else - { - *seed = seed_base; - } - - *it_num = *it_num + 1; - seed_init = *seed; - - cvt_iterate(dim_num, n, batch, sample, initialize, sample_num, seed, - r, it_diff, energy); - - initialize = false; - - if (DEBUG) - { - cout << " " - << setw(4) << *it_num << " " - << setw(12) << seed_init << " " - << setw(14) << *it_diff << " " - << setw(14) << *energy << "\n"; - } - } - return; -} -//****************************************************************************80 - -double cvt_energy(int dim_num, int n, int batch, int sample, bool initialize, - int sample_num, int *seed, double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// CVT_ENERGY computes the CVT energy of a dataset. -// -// Discussion: -// -// For a given number of generators, a CVT is a minimizer (or at least -// a local minimizer) of the CVT energy. During a CVT iteration, -// it should generally be the case that the CVT energy decreases from -// step to step, and that perturbations or adjustments of an -// approximate CVT will almost always have higher CVT energy. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 03 December 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of generators. -// -// Input, int BATCH, the maximum number of sample points to generate -// at one time. -// -// Input, int SAMPLE, specifies how the sampling is done. -// -1, 'RANDOM', using C++ RANDOM function; -// 0, 'UNIFORM', using a simple uniform RNG; -// 1, 'HALTON', from a Halton sequence; -// 2, 'GRID', points from a grid; -// 3, 'USER', call "user" routine. -// -// Input, bool INITIALIZE, is TRUE if the pseudorandom process -// should be reinitialized. -// -// Input, int SAMPLE_NUM, the number of sample points to use. -// -// Input/output, int *SEED, a seed for the random number generator. -// -// Input, double R[DIM_NUM*N], the coordinates of the points. -// -// Output, double CVT_ENERGY, the estimated CVT energy. -// -{ - double energy; - int get; - int have; - int i; - int j; - int *nearest; - double *s; - - nearest = new int[batch]; - s = new double[dim_num * batch]; - - have = 0; - energy = 0.0; - - while (have < sample_num) - { - get = i4_min(sample_num - have, batch); - - cvt_sample(dim_num, sample_num, get, sample, initialize, seed, s); - - have = have + get; - - find_closest(dim_num, n, get, s, r, nearest); - - for (j = 0; j < get; j++) - { - for (i = 0; i < dim_num; i++) - { - energy = energy + (s[i + j * dim_num] - r[i + nearest[j] * dim_num]) * (s[i + j * dim_num] - r[i + nearest[j] * dim_num]); - } - } - } - - energy = energy / (double)(sample_num); - - delete[] nearest; - delete[] s; - - return energy; -} -//****************************************************************************80 - -void cvt_iterate(int dim_num, int n, int batch, int sample, bool initialize, - int sample_num, int *seed, double r[], double *it_diff, double *energy) - -//****************************************************************************80 -// -// Purpose: -// -// CVT_ITERATE takes one step of the CVT iteration. -// -// Discussion: -// -// The routine is given a set of points, called "generators", which -// define a tessellation of the region into Voronoi cells. Each point -// defines a cell. Each cell, in turn, has a centroid, but it is -// unlikely that the centroid and the generator coincide. -// -// Each time this CVT iteration is carried out, an attempt is made -// to modify the generators in such a way that they are closer and -// closer to being the centroids of the Voronoi cells they generate. -// -// A large number of sample points are generated, and the nearest generator -// is determined. A count is kept of how many points were nearest to each -// generator. Once the sampling is completed, the location of all the -// generators is adjusted. This step should decrease the discrepancy -// between the generators and the centroids. -// -// The centroidal Voronoi tessellation minimizes the "energy", -// defined to be the integral, over the region, of the square of -// the distance between each point in the region and its nearest generator. -// The sampling technique supplies a discrete estimate of this -// energy. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 20 September 2004 -// -// Author: -// -// John Burkardt -// -// Reference: -// -// Qiang Du, Vance Faber, and Max Gunzburger, -// Centroidal Voronoi Tessellations: Applications and Algorithms, -// SIAM Review, Volume 41, 1999, pages 637-676. -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of Voronoi cells. -// -// Input, int BATCH, sets the maximum number of sample points -// generated at one time. It is inefficient to generate the sample -// points 1 at a time, but memory intensive to generate them all -// at once. You might set BATCH to min ( SAMPLE_NUM, 10000 ), for instance. -// BATCH must be at least 1. -// -// Input, int SAMPLE, specifies how the sampling is done. -// -1, 'RANDOM', using C++ RANDOM function; -// 0, 'UNIFORM', using a simple uniform RNG; -// 1, 'HALTON', from a Halton sequence; -// 2, 'GRID', points from a grid; -// 3, 'USER', call "user" routine. -// -// Input, bool INITIALIZE, is TRUE if the SEED must be reset to SEED_INIT -// before computation. Also, the pseudorandom process may need to be -// reinitialized. -// -// Input, int SAMPLE_NUM, the number of sample points. -// -// Input/output, int *SEED, the random number seed. -// -// Input/output, double R[DIM_NUM*N], the Voronoi -// cell generators. On output, these have been modified -// -// Output, double *IT_DIFF, the L2 norm of the difference -// between the iterates. -// -// Output, double *ENERGY, the discrete "energy", divided -// by the number of sample points. -// -{ - int *count; - int get; - int have; - int i; - int j; - int j2; - int *nearest; - double *r2; - double *s; - //bool success; //unused - double term; - // - // Take each generator as the first sample point for its region. - // This can slightly slow the convergence, but it simplifies the - // algorithm by guaranteeing that no region is completely missed - // by the sampling. - // - *energy = 0.0; - r2 = new double[dim_num * n]; - count = new int[n]; - nearest = new int[sample_num]; - s = new double[dim_num * sample_num]; - - for (j = 0; j < n; j++) - { - for (i = 0; i < dim_num; i++) - { - r2[i + j * dim_num] = r[i + j * dim_num]; - } - } - for (j = 0; j < n; j++) - { - count[j] = 1; - } - // - // Generate the sampling points S. - // - have = 0; - - while (have < sample_num) - { - get = i4_min(sample_num - have, batch); - - cvt_sample(dim_num, sample_num, get, sample, initialize, seed, s); - - initialize = false; - have = have + get; - // - // Find the index N of the nearest cell generator to each sample point S. - // - find_closest(dim_num, n, get, s, r, nearest); - // - // Add S to the centroid associated with generator N. - // - for (j = 0; j < get; j++) - { - j2 = nearest[j]; - for (i = 0; i < dim_num; i++) - { - r2[i + j2 * dim_num] = r2[i + j2 * dim_num] + s[i + j * dim_num]; - } - for (i = 0; i < dim_num; i++) - { - *energy = *energy + pow(r[i + j2 * dim_num] - s[i + j * dim_num], 2); - } - count[j2] = count[j2] + 1; - } - } - // - // Estimate the centroids. - // - for (j = 0; j < n; j++) - { - for (i = 0; i < dim_num; i++) - { - r2[i + j * dim_num] = r2[i + j * dim_num] / (double)(count[j]); - } - } - // - // Determine the sum of the distances between generators and centroids. - // - *it_diff = 0.0; - - for (j = 0; j < n; j++) - { - term = 0.0; - for (i = 0; i < dim_num; i++) - { - term = term + (r2[i + j * dim_num] - r[i + j * dim_num]) * (r2[i + j * dim_num] - r[i + j * dim_num]); - } - *it_diff = *it_diff + sqrt(term); - } - // - // Replace the generators by the centroids. - // - for (j = 0; j < n; j++) - { - for (i = 0; i < dim_num; i++) - { - r[i + j * dim_num] = r2[i + j * dim_num]; - } - } - // - // Normalize the discrete energy estimate. - // - *energy = *energy / sample_num; - - delete[] count; - delete[] nearest; - delete[] r2; - delete[] s; - - return; -} -//****************************************************************************80 - -void cvt_sample(int dim_num, int n, int n_now, int sample, bool initialize, - int *seed, double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// CVT_SAMPLE returns sample points. -// -// Discussion: -// -// N sample points are to be taken from the unit box of dimension DIM_NUM. -// -// These sample points are usually created by a pseudorandom process -// for which the points are essentially indexed by a quantity called -// SEED. To get N sample points, we generate values with indices -// SEED through SEED+N-1. -// -// It may not be practical to generate all the sample points in a -// single call. For that reason, the routine allows the user to -// request a total of N points, but to require that only N_NOW be -// generated now (on this call). -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 23 June 2005 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of Voronoi cells. -// -// Input, int N_NOW, the number of sample points to be generated -// on this call. N_NOW must be at least 1. -// -// Input, int SAMPLE, specifies how the sampling is done. -// -1, 'RANDOM', using C++ RANDOM function; -// 0, 'UNIFORM', using a simple uniform RNG; -// 1, 'HALTON', from a Halton sequence; -// 2, 'GRID', points from a grid; -// 3, 'USER', call "user" routine. -// -// Input, bool INITIALIZE, is TRUE if the pseudorandom process should be -// reinitialized. -// -// Input/output, int *SEED, the random number seed. -// -// Output, double R[DIM_NUM*N_NOW], the sample points. -// -{ - double exponent; - static int *halton_base = NULL; - static int *halton_leap = NULL; - static int *halton_seed = NULL; - int halton_step; - int i; - int j; - //int k; // unused - static int ngrid; - static int rank; - int rank_max; - static int *tuple = NULL; - - if (n_now < 1) - { - cout << "\n"; - cout << "CVT_SAMPLE - Fatal error!\n"; - cout << " N_NOW < 1.\n"; - exit(1); - } - - if (sample == -1) - { - if (initialize) - { - random_initialize(*seed); - } - - for (j = 0; j < n_now; j++) - { - for (i = 0; i < dim_num; i++) - { - r[i + j * dim_num] = (double)rand() / (double)RAND_MAX; - } - } - *seed = (*seed) + n_now * dim_num; - } - else if (sample == 0) - { - r8mat_uniform_01(dim_num, n_now, seed, r); - } - else if (sample == 1) - { - halton_seed = new int[dim_num]; - halton_leap = new int[dim_num]; - halton_base = new int[dim_num]; - - halton_step = *seed; - - for (i = 0; i < dim_num; i++) - { - halton_seed[i] = 0; - } - - for (i = 0; i < dim_num; i++) - { - halton_leap[i] = 1; - } - - for (i = 0; i < dim_num; i++) - { - halton_base[i] = prime(i + 1); - } - - i4_to_halton_sequence(dim_num, n_now, halton_step, halton_seed, - halton_leap, halton_base, r); - - delete[] halton_seed; - delete[] halton_leap; - delete[] halton_base; - - *seed = *seed + n_now; - } - else if (sample == 2) - { - exponent = 1.0 / (double)(dim_num); - ngrid = (int)pow((double)n, exponent); - rank_max = (int)pow((double)ngrid, (double)dim_num); - tuple = new int[dim_num]; - - if (rank_max < n) - { - ngrid = ngrid + 1; - rank_max = (int)pow((double)ngrid, (double)dim_num); - } - - if (initialize) - { - rank = -1; - tuple_next_fast(ngrid, dim_num, rank, tuple); - } - - rank = (*seed) % rank_max; - - for (j = 0; j < n_now; j++) - { - tuple_next_fast(ngrid, dim_num, rank, tuple); - rank = rank + 1; - rank = rank % rank_max; - for (i = 0; i < dim_num; i++) - { - r[i + j * dim_num] = double(2 * tuple[i] - 1) / double(2 * ngrid); - } - } - delete[] tuple; - *seed = *seed + n_now; - } - else if (sample == 3) - { - user(dim_num, n_now, seed, r); - } - else - { - cout << "\n"; - cout << "CVT_SAMPLE - Fatal error!\n"; - cout << " The value of SAMPLE = " << sample << " is illegal.\n"; - exit(1); - } - - return; -} -//****************************************************************************80 - -void data_read(char *file_in_name, int dim_num, int n, double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// DATA_READ reads generator coordinate data from a file. -// -// Discussion: -// -// The file is assumed to contain one record per line. -// -// Records beginning with the '#' character are comments, and are ignored. -// Blank lines are also ignored. -// -// Each line that is not ignored is assumed to contain exactly (or at least) -// M real numbers, representing the coordinates of a point. -// -// There are assumed to be exactly (or at least) N such records. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 03 August 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char *FILE_IN_NAME, the name of the input file. -// -// Input, int DIM_NUM, the number of spatial dimensions. -// -// Input, int N, the number of points. The program -// will stop reading data once N values have been read. -// -// Output, double R[DIM_NUM*N], the point coordinates. -// -{ - bool error; - ifstream file_in; - int i; - int j; - char line[255]; - double *x; - - file_in.open(file_in_name); - - if (!file_in) - { - cout << "\n"; - cout << "DATA_READ - Fatal error!\n"; - cout << " Could not open the input file: \"" << file_in_name << "\"\n"; - exit(1); - } - - x = new double[dim_num]; - - j = 0; - - while (j < n) - { - file_in.getline(line, sizeof(line)); - - if (file_in.eof()) - { - break; - } - - if (line[0] == '#' || s_len_trim(line) == 0) - { - continue; - } - - error = s_to_r8vec(line, dim_num, x); - - if (error) - { - continue; - } - - for (i = 0; i < dim_num; i++) - { - r[i + j * dim_num] = x[i]; - } - j = j + 1; - } - - file_in.close(); - - delete[] x; - - cout << "\n"; - cout << "DATA_READ:\n"; - cout << " Read coordinate data from file.\n"; - - return; -} -//****************************************************************************80 - -char digit_to_ch(int i) - -//****************************************************************************80 -// -// Purpose: -// -// DIGIT_TO_CH returns the base 10 digit character corresponding to a digit. -// -// Example: -// -// I C -// ----- --- -// 0 '0' -// 1 '1' -// ... ... -// 9 '9' -// 10 '*' -// -83 '*' -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 June 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int I, the digit, which should be between 0 and 9. -// -// Output, char DIGIT_TO_CH, the appropriate character '0' through '9' or '*'. -// -{ - char c; - - if (0 <= i && i <= 9) - { - c = '0' + i; - } - else - { - c = '*'; - } - - return c; -} -//****************************************************************************80 - -void find_closest(int dim_num, int n, int sample_num, double s[], double r[], - int nearest[]) - -//****************************************************************************80 -// -// Purpose: -// -// FIND_CLOSEST finds the nearest R point to each S point. -// -// Discussion: -// -// This routine finds the closest Voronoi cell generator by checking every -// one. For problems with many cells, this process can take the bulk -// of the CPU time. Other approaches, which group the cell generators into -// bins, can run faster by a large factor. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 21 October 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of cell generators. -// -// Input, int SAMPLE_NUM, the number of sample points. -// -// Input, double S[DIM_NUM*SAMPLE_NUM], the points to be checked. -// -// Input, double R[DIM_NUM*N], the cell generators. -// -// Output, int NEAREST[SAMPLE_NUM], the (0-based) index of the nearest -// cell generator. -// -{ - double dist_sq_min; - double dist_sq; - int i; - int jr; - int js; - - for (js = 0; js < sample_num; js++) - { - dist_sq_min = r8_huge(); - nearest[js] = -1; - - for (jr = 0; jr < n; jr++) - { - dist_sq = 0.0; - for (i = 0; i < dim_num; i++) - { - dist_sq = dist_sq + (s[i + js * dim_num] - r[i + jr * dim_num]) * (s[i + js * dim_num] - r[i + jr * dim_num]); - } - - if (jr == 0 || dist_sq < dist_sq_min) - { - dist_sq_min = dist_sq; - nearest[js] = jr; - } - } - } - - return; -} -//****************************************************************************80 - -int get_seed(void) - -//****************************************************************************80 -// -// Purpose: -// -// GET_SEED returns a random seed for the random number generator. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 15 September 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Output, int GET_SEED, a random seed value. -// -{ -#define I_MAX 2147483647 - - time_t clock; - //int i; // unused - int ihour; - int imin; - int isec; - int seed; - struct tm *lt; - time_t tloc; - // - // If the internal seed is 0, generate a value based on the time. - // - clock = time(&tloc); - lt = localtime(&clock); - // - // Hours is 1, 2, ..., 12. - // - ihour = lt->tm_hour; - - if (12 < ihour) - { - ihour = ihour - 12; - } - // - // Move Hours to 0, 1, ..., 11 - // - ihour = ihour - 1; - - imin = lt->tm_min; - - isec = lt->tm_sec; - - seed = isec + 60 * (imin + 60 * ihour); - // - // We want values in [1,43200], not [0,43199]. - // - seed = seed + 1; - // - // Remap ISEED from [1,43200] to [1,IMAX]. - // - seed = (int)(((double)seed) * ((double)I_MAX) / (60.0 * 60.0 * 12.0)); - // - // Never use a seed of 0. - // - if (seed == 0) - { - seed = 1; - } - - return seed; -#undef I_MAX -} -//****************************************************************************80 - -bool halham_leap_check(int dim_num, int leap[]) - -//****************************************************************************80 -// -// Purpose: -// -// HALHAM_LEAP_CHECK checks LEAP for a Halton or Hammersley sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int LEAP[DIM_NUM], the successive jumps in the sequence. -// Each entry must be greater than 0. -// -// Output, bool HALHAM_LEAP_CHECK, is true if LEAP is legal. -// -{ - int i; - bool value; - - value = true; - - for (i = 0; i < dim_num; i++) - { - if (leap[i] < 1) - { - cout << "\n"; - cout << "HALHAM_LEAP_CHECK - Fatal error!\n"; - cout << " Leap entries must be greater than 0.\n"; - cout << " leap[" << i << "] = " << leap[i] << "\n"; - value = false; - break; - } - } - - return value; -} -//****************************************************************************80 - -bool halham_n_check(int n) - -//****************************************************************************80 -// -// Purpose: -// -// HALHAM_N_CHECK checks N for a Halton or Hammersley sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int N, the number of elements of the subsequence. -// N must be positive. -// -// Output, bool HALHAM_N_CHECK, is true if N is legal. -// -{ - bool value; - - if (n < 1) - { - cout << "\n"; - cout << "HALHAM_N_CHECK - Fatal error!\n"; - cout << " N < 0."; - cout << " N = " << n << "\n"; - value = false; - } - else - { - value = true; - } - - return value; -} -//****************************************************************************80 - -bool halham_dim_num_check(int dim_num) - -//****************************************************************************80 -// -// Purpose: -// -// HALHAM_DIM_NUM_CHECK checks DIM_NUM for a Halton or Hammersley sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// DIM_NUM must be positive. -// -// Output, bool HALHAM_DIM_NUM_CHECK, is true if DIM_NUM is legal. -// -{ - bool value; - - if (dim_num < 1) - { - cout << "\n"; - cout << "HALHAM_DIM_NUM_CHECK - Fatal error!\n"; - cout << " DIM_NUM < 0."; - cout << " DIM_NUM = " << dim_num << "\n"; - value = false; - } - else - { - value = true; - } - - return value; -} -//****************************************************************************80 - -bool halham_seed_check(int dim_num, int seed[]) - -//****************************************************************************80 -// -// Purpose: -// -// HALHAM_SEED_CHECK checks SEED for a Halton or Hammersley sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int SEED[DIM_NUM], the sequence index -// corresponding to STEP = 0. Each entry must be 0 or greater. -// -// Output, bool HALHAM_SEED_CHECK, is true if SEED is legal. -// -{ - int i; - bool value; - - value = true; - - for (i = 0; i < dim_num; i++) - { - if (seed[i] < 0) - { - cout << "\n"; - cout << "HALHAM_SEED_CHECK - Fatal error!\n"; - cout << " SEED entries must be nonnegative.\n"; - cout << " seed[" << i << "] = " << seed[i] << "\n"; - value = false; - break; - } - } - - return value; -} -//****************************************************************************80 - -bool halham_step_check(int step) - -//****************************************************************************80 -// -// Purpose: -// -// HALHAM_STEP_CHECK checks STEP for a Halton or Hammersley sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int STEP, the index of the subsequence element. -// STEP must be 1 or greater. -// -// Output, bool HALHAM_STEP_CHECK, is true if STEP is legal. -// -{ - //int i; // unused - bool value; - - if (step < 0) - { - cout << "\n"; - cout << "HALHAM_STEP_CHECK - Fatal error!\n"; - cout << " STEP < 0."; - cout << " STEP = " << step << "\n"; - value = false; - } - else - { - value = true; - } - - return value; -} -//****************************************************************************80 - -bool halton_base_check(int dim_num, int base[]) - -//****************************************************************************80 -// -// Purpose: -// -// HALTON_BASE_CHECK checks BASE for a Halton sequence. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 21 September 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int BASE[DIM_NUM], the bases. -// -// Output, bool HALTON_BASE_CHECK, is true if BASE is legal. -// -{ - int i; - bool value; - - value = true; - - for (i = 0; i < dim_num; i++) - { - if (base[i] <= 1) - { - cout << "\n"; - cout << "HALTON_BASE_CHECK - Fatal error!\n"; - cout << " Bases must be greater than 1.\n"; - cout << " base[" << i << "] = " << base[i] << "\n"; - value = false; - break; - } - } - - return value; -} -//****************************************************************************80 - -int i4_log_10(int i) - -//****************************************************************************80 -// -// Purpose: -// -// I4_LOG_10 returns the whole part of the logarithm base 10 of an I4. -// -// Discussion: -// -// It should be the case that 10^I4_LOG_10(I) <= |I| < 10^(I4_LOG_10(I)+1). -// (except for I = 0). -// -// The number of decimal digits in I is I4_LOG_10(I) + 1. -// -// Example: -// -// I I4_LOG_10(I) -// -// 0 0 -// 1 0 -// 2 0 -// -// 9 0 -// 10 1 -// 11 1 -// -// 99 1 -// 100 2 -// 101 2 -// -// 999 2 -// 1000 3 -// 1001 3 -// -// 9999 3 -// 10000 4 -// 10001 4 -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 17 June 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int I, the integer. -// -// Output, int I4_LOG_10, the whole part of the logarithm of abs ( I ). -// -{ - int ten_pow; - int value; - - i = abs(i); - - ten_pow = 10; - value = 0; - - while (ten_pow <= i) - { - ten_pow = ten_pow * 10; - value = value + 1; - } - - return value; -} -//****************************************************************************80 - -int i4_max(int i1, int i2) - -//****************************************************************************80 -// -// Purpose: -// -// I4_MAX returns the maximum of two I4's. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 13 October 1998 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int I1, I2, are two integers to be compared. -// -// Output, int I4_MAX, the larger of I1 and I2. -// -// -{ - if (i2 < i1) - { - return i1; - } - else - { - return i2; - } -} -//****************************************************************************80 - -int i4_min(int i1, int i2) - -//****************************************************************************80 -// -// Purpose: -// -// I4_MIN returns the smaller of two I4's. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 11 September 1998 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int I1 and I2, two integers to be compared. -// -// Output, int I4_MIN, the smaller of i1 and i2. -// -{ - if (i1 < i2) - { - return i1; - } - else - { - return i2; - } -} -//********************************************************************** - -void i4_to_halton_sequence(int dim_num, int n, int step, int seed[], int leap[], - int base[], double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// I4_TO_HALTON_SEQUENCE computes N elements of a leaped Halton subsequence. -// -// Discussion: -// -// The DIM_NUM-dimensional Halton sequence is really DIM_NUM separate -// sequences, each generated by a particular base. -// -// This routine selects elements of a "leaped" subsequence of the -// Halton sequence. The subsequence elements are indexed by a -// quantity called STEP, which starts at 0. The STEP-th subsequence -// element is simply element -// -// SEED(1:DIM_NUM) + STEP * LEAP(1:DIM_NUM) -// -// of the original Halton sequence. -// -// -// The data to be computed has two dimensions. -// -// The number of data items is DIM_NUM * N, where DIM_NUM is the spatial dimension -// of each element of the sequence, and N is the number of elements of the sequence. -// -// The data is stored in a one dimensional array R. The first element of the -// sequence is stored in the first DIM_NUM entries of R, followed by the DIM_NUM entries -// of the second element, and so on. -// -// In particular, the J-th element of the sequence is stored in entries -// 0+(J-1)*DIM_NUM through (DIM_NUM-1) + (J-1)*DIM_NUM. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 16 July 2004 -// -// Author: -// -// John Burkardt -// -// Reference: -// -// J H Halton, -// On the efficiency of certain quasi-random sequences of points -// in evaluating multi-dimensional integrals, -// Numerische Mathematik, -// Volume 2, 1960, pages 84-90. -// -// J H Halton and G B Smith, -// Algorithm 247: Radical-Inverse Quasi-Random Point Sequence, -// Communications of the ACM, -// Volume 7, 1964, pages 701-702. -// -// Ladislav Kocis and William Whiten, -// Computational Investigations of Low-Discrepancy Sequences, -// ACM Transactions on Mathematical Software, -// Volume 23, Number 2, 1997, pages 266-294. -// -// Parameters: -// -// Input, int DIM_NUM, the spatial dimension. -// -// Input, int N, the number of elements of the sequence. -// -// Input, int STEP, the index of the subsequence element. -// 0 <= STEP is required -// -// Input, int SEED[DIM_NUM], the Halton sequence index corresponding -// to STEP = 0. -// -// Input, int LEAP[DIM_NUM], the succesive jumps in the Halton sequence. -// -// Input, int BASE[DIM_NUM], the Halton bases. -// -// Output, double R[DIM_NUM*N], the next N elements of the -// leaped Halton subsequence, beginning with element STEP. -// -{ - double base_inv; - int digit; - int i; - int j; - int *seed2; - // - // Check the input. - // - if (!halham_dim_num_check(dim_num)) - { - exit(1); - } - - if (!halham_n_check(n)) - { - exit(1); - } - - if (!halham_step_check(step)) - { - exit(1); - } - - if (!halham_seed_check(dim_num, seed)) - { - exit(1); - } - - if (!halham_leap_check(dim_num, leap)) - { - exit(1); - } - - if (!halton_base_check(dim_num, base)) - { - exit(1); - } - // - // Calculate the data. - // - seed2 = new int[n]; - - for (i = 0; i < dim_num; i++) - { - for (j = 0; j < n; j++) - { - seed2[j] = seed[i] + (step + j) * leap[i]; - } - - for (j = 0; j < n; j++) - { - r[i + j * dim_num] = 0.0; - } - - for (j = 0; j < n; j++) - { - base_inv = 1.0 / ((double)base[i]); - - while (seed2[j] != 0) - { - digit = seed2[j] % base[i]; - r[i + j * dim_num] = r[i + j * dim_num] + ((double)digit) * base_inv; - base_inv = base_inv / ((double)base[i]); - seed2[j] = seed2[j] / base[i]; - } - } - } - - delete[] seed2; - - return; -} -//****************************************************************************80 - -char *i4_to_s(int i) - -//****************************************************************************80 -// -// Purpose: -// -// I4_TO_S converts an I4 to a string. -// -// Example: -// -// INTVAL S -// -// 1 1 -// -1 -1 -// 0 0 -// 1952 1952 -// 123456 123456 -// 1234567 1234567 -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 13 March 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int I, an integer to be converted. -// -// Output, char *I4_TO_S, the representation of the integer. -// -{ - int digit; - int j; - int length; - int ten_power; - char *s; - - length = i4_log_10(i); - - ten_power = (int)pow((double)10, (double)length); - - if (i < 0) - { - length = length + 1; - } - // - // Add one position for the trailing null. - // - length = length + 1; - - s = new char[length]; - - if (i == 0) - { - s[0] = '0'; - s[1] = '\0'; - return s; - } - // - // Now take care of the sign. - // - j = 0; - if (i < 0) - { - s[j] = '-'; - j = j + 1; - i = abs(i); - } - // - // Find the leading digit of I, strip it off, and stick it into the string. - // - while (0 < ten_power) - { - digit = i / ten_power; - s[j] = digit_to_ch(digit); - j = j + 1; - i = i - digit * ten_power; - ten_power = ten_power / 10; - } - // - // Tack on the trailing NULL. - // - s[j] = '\0'; - j = j + 1; - - return s; -} -//****************************************************************************80 - -int prime(int n) - -//****************************************************************************80 -// -// Purpose: -// -// PRIME returns any of the first PRIME_MAX prime numbers. -// -// Discussion: -// -// PRIME_MAX is 1600, and the largest prime stored is 13499. -// -// Thanks to Bart Vandewoestyne for pointing out a typo, 18 February 2005. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 18 February 2005 -// -// Author: -// -// John Burkardt -// -// Reference: -// -// Milton Abramowitz and Irene Stegun, -// Handbook of Mathematical Functions, -// US Department of Commerce, 1964, pages 870-873. -// -// Daniel Zwillinger, -// CRC Standard Mathematical Tables and Formulae, -// 30th Edition, -// CRC Press, 1996, pages 95-98. -// -// Parameters: -// -// Input, int N, the index of the desired prime number. -// In general, is should be true that 0 <= N <= PRIME_MAX. -// N = -1 returns PRIME_MAX, the index of the largest prime available. -// N = 0 is legal, returning PRIME = 1. -// -// Output, int PRIME, the N-th prime. If N is out of range, PRIME -// is returned as -1. -// -{ -#define PRIME_MAX 1600 - - int npvec[PRIME_MAX] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, - 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, - 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, - 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, - 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, - 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, - 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, - 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, - 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, - 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, - 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, - 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, - 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, - 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, - 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, - 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, - 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, - 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, - 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, - 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, - 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, - 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, - 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, - 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, - 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, - 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, - 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, - 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, - 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, - 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, - 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, - 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, - 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, - 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, - 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, - 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, - 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, - 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, - 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, - 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, - 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, - 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, - 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, - 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, - 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, - 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, - 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, - 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, - 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, - 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, - 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, - 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, - 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, - 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, - 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, - 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, - 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, - 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, - 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, - 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, - 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, - 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, - 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, - 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, - 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, - 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, - 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, - 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, - 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, - 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, - 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, - 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, - 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, - 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, - 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, - 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, - 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, - 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, - 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, - 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, - 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, - 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, - 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, - 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, - 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, - 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, - 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, - 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, - 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, - 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, - 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, - 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, - 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, - 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, - 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, - 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, - 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, - 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, - 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, - 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, - 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, - 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, - 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, - 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, - 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, - 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, - 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, - 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, - 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, - 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, - 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, - 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, - 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, - 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, - 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, - 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, - 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, - 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, - 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, - 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, - 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, - 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, - 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, - 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, - 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, - 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, - 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, - 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, - 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, - 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, - 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, 10739, - 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, - 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, - 10957, 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, - 11069, 11071, 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, - 11159, 11161, 11171, 11173, 11177, 11197, 11213, 11239, 11243, 11251, - 11257, 11261, 11273, 11279, 11287, 11299, 11311, 11317, 11321, 11329, - 11351, 11353, 11369, 11383, 11393, 11399, 11411, 11423, 11437, 11443, - 11447, 11467, 11471, 11483, 11489, 11491, 11497, 11503, 11519, 11527, - 11549, 11551, 11579, 11587, 11593, 11597, 11617, 11621, 11633, 11657, - 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, 11743, 11777, - 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, 11833, - 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, - 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, - 12037, 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, - 12113, 12119, 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, - 12227, 12239, 12241, 12251, 12253, 12263, 12269, 12277, 12281, 12289, - 12301, 12323, 12329, 12343, 12347, 12373, 12377, 12379, 12391, 12401, - 12409, 12413, 12421, 12433, 12437, 12451, 12457, 12473, 12479, 12487, - 12491, 12497, 12503, 12511, 12517, 12527, 12539, 12541, 12547, 12553, - 12569, 12577, 12583, 12589, 12601, 12611, 12613, 12619, 12637, 12641, - 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, 12721, 12739, - 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, 12829, - 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, - 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, - 13009, 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, - 13121, 13127, 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, - 13217, 13219, 13229, 13241, 13249, 13259, 13267, 13291, 13297, 13309, - 13313, 13327, 13331, 13337, 13339, 13367, 13381, 13397, 13399, 13411, - 13417, 13421, 13441, 13451, 13457, 13463, 13469, 13477, 13487, 13499}; - - if (n == -1) - { - return PRIME_MAX; - } - else if (n == 0) - { - return 1; - } - else if (n <= PRIME_MAX) - { - return npvec[n - 1]; - } - else - { - cout << "\n"; - cout << "PRIME - Fatal error!\n"; - cout << " Unexpected input value of n = " << n << "\n"; - exit(1); - } - - return 0; -#undef PRIME_MAX -} -//****************************************************************************80 - -double r8_epsilon() - -//****************************************************************************80 -// -// Purpose: -// -// R8_EPSILON returns the R8 roundoff unit. -// -// Discussion: -// -// The roundoff unit is a number R which is a power of 2 with the -// property that, to the precision of the computer's arithmetic, -// 1 < 1 + R -// but -// 1 = ( 1 + R / 2 ) -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 01 September 2012 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Output, double R8_EPSILON, the R8 round-off unit. -// -{ - const double value = 2.220446049250313E-016; - - return value; -} -//****************************************************************************80 - -double r8_huge() - -//****************************************************************************80 -// -// Purpose: -// -// R8_HUGE returns a "huge" R8. -// -// Discussion: -// -// HUGE_VAL is the largest representable legal real number, and is usually -// defined in math.h, or sometimes in stdlib.h. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 08 May 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Output, double R8_HUGE, a "huge" R8. -// -{ - return HUGE_VAL; -} -//****************************************************************************80 - -void r8mat_transpose_print(int m, int n, double a[], char *title) - -//****************************************************************************80 -// -// Purpose: -// -// R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 11 August 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int M, N, the number of rows and columns. -// -// Input, double A[M*N], an M by N matrix to be printed. -// -// Input, char *TITLE, an optional title. -// -{ - r8mat_transpose_print_some(m, n, a, 1, 1, m, n, title); - - return; -} -//****************************************************************************80 - -void r8mat_transpose_print_some(int m, int n, double a[], int ilo, int jlo, - int ihi, int jhi, char *title) - -//****************************************************************************80 -// -// Purpose: -// -// R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 11 August 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int M, N, the number of rows and columns. -// -// Input, double A[M*N], an M by N matrix to be printed. -// -// Input, int ILO, JLO, the first row and column to print. -// -// Input, int IHI, JHI, the last row and column to print. -// -// Input, char *TITLE, an optional title. -// -{ -#define INCX 5 - - int i; - int i2; - int i2hi; - int i2lo; - int inc; - int j; - int j2hi; - int j2lo; - - if (0 < s_len_trim(title)) - { - cout << "\n"; - cout << title << "\n"; - } - - for (i2lo = i4_max(ilo, 1); i2lo <= i4_min(ihi, m); i2lo = i2lo + INCX) - { - i2hi = i2lo + INCX - 1; - i2hi = i4_min(i2hi, m); - i2hi = i4_min(i2hi, ihi); - - inc = i2hi + 1 - i2lo; - - cout << "\n"; - cout << " Row: "; - for (i = i2lo; i <= i2hi; i++) - { - cout << setw(7) << i << " "; - } - cout << "\n"; - cout << " Col\n"; - - j2lo = i4_max(jlo, 1); - j2hi = i4_min(jhi, n); - - for (j = j2lo; j <= j2hi; j++) - { - cout << setw(5) << j << " "; - for (i2 = 1; i2 <= inc; i2++) - { - i = i2lo - 1 + i2; - cout << setw(14) << a[(i - 1) + (j - 1) * m]; - } - cout << "\n"; - } - } - cout << "\n"; - - return; -#undef INCX -} -//****************************************************************************80 - -void r8mat_uniform_01(int m, int n, int *seed, double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// R8MAT_UNIFORM_01 returns a unit pseudorandom R8MAT. -// -// Discussion: -// -// This routine implements the recursion -// -// seed = 16807 * seed mod ( 2**31 - 1 ) -// unif = seed / ( 2**31 - 1 ) -// -// The integer arithmetic never requires more than 32 bits, -// including a sign bit. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 11 August 2004 -// -// Author: -// -// John Burkardt -// -// Reference: -// -// Paul Bratley, Bennett Fox, L E Schrage, -// A Guide to Simulation, -// Springer Verlag, pages 201-202, 1983. -// -// Bennett Fox, -// Algorithm 647: -// Implementation and Relative Efficiency of Quasirandom -// Sequence Generators, -// ACM Transactions on Mathematical Software, -// Volume 12, Number 4, pages 362-376, 1986. -// -// Parameters: -// -// Input, int M, N, the number of rows and columns. -// -// Input/output, int *SEED, the "seed" value. On output, SEED has -// been updated. -// -// Output, double R[M*N], a matrix of pseudorandom values. -// -{ - int i; - int j; - int k; - - for (j = 0; j < n; j++) - { - for (i = 0; i < m; i++) - { - k = *seed / 127773; - - *seed = 16807 * (*seed - k * 127773) - k * 2836; - - if (*seed < 0) - { - *seed = *seed + 2147483647; - } - - r[i + j * m] = (double)(*seed) * 4.656612875E-10; - } - } - - return; -} -//****************************************************************************80 - -void r8mat_write(string output_filename, int m, int n, double table[]) - -//****************************************************************************80 -// -// Purpose: -// -// R8MAT_WRITE writes an R8MAT file. -// -// Discussion: -// -// An R8MAT is an array of R8's. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 29 June 2009 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, string OUTPUT_FILENAME, the output filename. -// -// Input, int M, the spatial dimension. -// -// Input, int N, the number of points. -// -// Input, double TABLE[M*N], the table data. -// -{ - int i; - int j; - ofstream output; - // - // Open the file. - // - output.open(output_filename.c_str()); - - if (!output) - { - cerr << "\n"; - cerr << "R8MAT_WRITE - Fatal error!\n"; - cerr << " Could not open the output file.\n"; - return; - } - // - // Write the data. - // - for (j = 0; j < n; j++) - { - for (i = 0; i < m; i++) - { - output << " " << setw(24) << setprecision(16) << table[i + j * m]; - } - output << "\n"; - } - // - // Close the file. - // - output.close(); - - return; -} -//****************************************************************************80 - -unsigned long random_initialize(int seed) - -//****************************************************************************80 -// -// Purpose: -// -// RANDOM_INITIALIZE initializes the RANDOM random number generator. -// -// Discussion: -// -// If you don't initialize RANDOM, the random number generator, -// it will behave as though it were seeded with value 1. -// This routine will either take a user-specified seed, or -// (if the user passes a 0) make up a "random" one. In either -// case, the seed is passed to SRAND (the appropriate routine -// to call when setting the seed for RANDOM). The seed is also -// returned to the user as the value of the function. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 07 December 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int SEED, is either 0, which means that the user -// wants this routine to come up with a seed, or nonzero, in which -// case the user has supplied the seed. -// -// Output, unsigned long RANDOM_INITIALIZE, is the value of the seed -// passed to SRAND, which is either the user's input value, or if -// that was zero, the value selected by this routine. -// -{ -#define DEBUG 0 - - unsigned long ul_seed; - - if (seed != 0) - { - if (DEBUG) - { - cout << "\n"; - cout << "RANDOM_INITIALIZE\n"; - cout << " Initialize RANDOM with user SEED = " << seed << "\n"; - } - } - else - { - seed = get_seed(); - if (DEBUG) - { - cout << "\n"; - cout << "RANDOM_INITIALIZE\n"; - cout << " Initialize RAND with arbitrary SEED = " << seed << "\n"; - } - } - // - // Now set the seed. - // - ul_seed = (unsigned long)seed; - srand(ul_seed); - - return ul_seed; -#undef DEBUG -} -//****************************************************************************80 - -bool s_eqi(char *s1, char *s2) - -//****************************************************************************80 -// -// Purpose: -// -// S_EQI reports whether two strings are equal, ignoring case. -// -// Modified: -// -// 05 May 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char *S1, char *S2, pointers to two strings. -// -// Output, bool S_EQI, is true if the strings are equal. -// -{ - int i; - int nchar; - int nchar1; - int nchar2; - - nchar1 = static_cast<int>(strlen(s1)); - nchar2 = static_cast<int>(strlen(s2)); - nchar = i4_min(nchar1, nchar2); - - // - // The strings are not equal if they differ over their common length. - // - for (i = 0; i < nchar; i++) - { - - if (ch_cap(s1[i]) != ch_cap(s2[i])) - { - return false; - } - } - // - // The strings are not equal if the longer one includes nonblanks - // in the tail. - // - if (nchar < nchar1) - { - for (i = nchar; i < nchar1; i++) - { - if (s1[i] != ' ') - { - return false; - } - } - } - else if (nchar < nchar2) - { - for (i = nchar; i < nchar2; i++) - { - if (s2[i] != ' ') - { - return false; - } - } - } - - return true; -} -//****************************************************************************80 - -int s_len_trim(char *s) - -//****************************************************************************80 -// -// Purpose: -// -// S_LEN_TRIM returns the length of a string to the last nonblank. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 26 April 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char *S, a pointer to a string. -// -// Output, int S_LEN_TRIM, the length of the string to the last nonblank. -// If S_LEN_TRIM is 0, then the string is entirely blank. -// -{ - int n; - char *t; - - n = static_cast<int>(strlen(s)); - t = s + strlen(s) - 1; - - while (0 < n) - { - if (*t != ' ') - { - return n; - } - t--; - n--; - } - - return n; -} -//****************************************************************************80 - -double s_to_r8(char *s, int *lchar, bool *error) - -//****************************************************************************80 -// -// Purpose: -// -// S_TO_R8 reads an R8 from a string. -// -// Discussion: -// -// This routine will read as many characters as possible until it reaches -// the end of the string, or encounters a character which cannot be -// part of the real number. -// -// Legal input is: -// -// 1 blanks, -// 2 '+' or '-' sign, -// 2.5 spaces -// 3 integer part, -// 4 decimal point, -// 5 fraction part, -// 6 'E' or 'e' or 'D' or 'd', exponent marker, -// 7 exponent sign, -// 8 exponent integer part, -// 9 exponent decimal point, -// 10 exponent fraction part, -// 11 blanks, -// 12 final comma or semicolon. -// -// with most quantities optional. -// -// Example: -// -// S R -// -// '1' 1.0 -// ' 1 ' 1.0 -// '1A' 1.0 -// '12,34,56' 12.0 -// ' 34 7' 34.0 -// '-1E2ABCD' -100.0 -// '-1X2ABCD' -1.0 -// ' 2E-1' 0.2 -// '23.45' 23.45 -// '-4.2E+2' -420.0 -// '17d2' 1700.0 -// '-14e-2' -0.14 -// 'e2' 100.0 -// '-12.73e-9.23' -12.73 * 10.0**(-9.23) -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 07 August 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char *S, the string containing the -// data to be read. Reading will begin at position 1 and -// terminate at the end of the string, or when no more -// characters can be read to form a legal real. Blanks, -// commas, or other nonnumeric data will, in particular, -// cause the conversion to halt. -// -// Output, int *LCHAR, the number of characters read from -// the string to form the number, including any terminating -// characters such as a trailing comma or blanks. -// -// Output, bool *ERROR, is true if an error occurred. -// -// Output, double S_TO_R8, the real value that was read from the string. -// -{ - char c; - int ihave; - int isgn; - int iterm; - int jbot; - int jsgn; - int jtop; - int nchar; - int ndig; - double r; - double rbot; - double rexp; - double rtop; - char TAB = 9; - - nchar = s_len_trim(s); - *error = false; - r = 0.0; - *lchar = -1; - isgn = 1; - rtop = 0.0; - rbot = 1.0; - jsgn = 1; - jtop = 0; - jbot = 1; - ihave = 1; - iterm = 0; - - for (;;) - { - c = s[*lchar + 1]; - *lchar = *lchar + 1; - // - // Blank or TAB character. - // - if (c == ' ' || c == TAB) - { - if (ihave == 2) - { - } - else if (ihave == 6 || ihave == 7) - { - iterm = 1; - } - else if (1 < ihave) - { - ihave = 11; - } - } - // - // Comma. - // - else if (c == ',' || c == ';') - { - if (ihave != 1) - { - iterm = 1; - ihave = 12; - *lchar = *lchar + 1; - } - } - // - // Minus sign. - // - else if (c == '-') - { - if (ihave == 1) - { - ihave = 2; - isgn = -1; - } - else if (ihave == 6) - { - ihave = 7; - jsgn = -1; - } - else - { - iterm = 1; - } - } - // - // Plus sign. - // - else if (c == '+') - { - if (ihave == 1) - { - ihave = 2; - } - else if (ihave == 6) - { - ihave = 7; - } - else - { - iterm = 1; - } - } - // - // Decimal point. - // - else if (c == '.') - { - if (ihave < 4) - { - ihave = 4; - } - else if (6 <= ihave && ihave <= 8) - { - ihave = 9; - } - else - { - iterm = 1; - } - } - // - // Exponent marker. - // - else if (ch_eqi(c, 'E') || ch_eqi(c, 'D')) - { - if (ihave < 6) - { - ihave = 6; - } - else - { - iterm = 1; - } - } - // - // Digit. - // - else if (ihave < 11 && '0' <= c && c <= '9') - { - if (ihave <= 2) - { - ihave = 3; - } - else if (ihave == 4) - { - ihave = 5; - } - else if (ihave == 6 || ihave == 7) - { - ihave = 8; - } - else if (ihave == 9) - { - ihave = 10; - } - - ndig = ch_to_digit(c); - - if (ihave == 3) - { - rtop = 10.0 * rtop + (double)ndig; - } - else if (ihave == 5) - { - rtop = 10.0 * rtop + (double)ndig; - rbot = 10.0 * rbot; - } - else if (ihave == 8) - { - jtop = 10 * jtop + ndig; - } - else if (ihave == 10) - { - jtop = 10 * jtop + ndig; - jbot = 10 * jbot; - } - } - // - // Anything else is regarded as a terminator. - // - else - { - iterm = 1; - } - // - // If we haven't seen a terminator, and we haven't examined the - // entire string, go get the next character. - // - if (iterm == 1 || nchar <= *lchar + 1) - { - break; - } - } - // - // If we haven't seen a terminator, and we have examined the - // entire string, then we're done, and LCHAR is equal to NCHAR. - // - if (iterm != 1 && (*lchar) + 1 == nchar) - { - *lchar = nchar; - } - // - // Number seems to have terminated. Have we got a legal number? - // Not if we terminated in states 1, 2, 6 or 7! - // - if (ihave == 1 || ihave == 2 || ihave == 6 || ihave == 7) - { - *error = true; - return r; - } - // - // Number seems OK. Form it. - // - if (jtop == 0) - { - rexp = 1.0; - } - else - { - if (jbot == 1) - { - rexp = pow(10.0, jsgn * jtop); - } - else - { - rexp = jsgn * jtop; - rexp = rexp / jbot; - rexp = pow(10.0, rexp); - } - } - - r = isgn * rexp * rtop / rbot; - - return r; -} -//****************************************************************************80 - -bool s_to_r8vec(char *s, int n, double rvec[]) - -//****************************************************************************80 -// -// Purpose: -// -// S_TO_R8VEC reads an R8VEC from a string. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 19 February 2001 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, char *S, the string to be read. -// -// Input, int N, the number of values expected. -// -// Output, double RVEC[N], the values read from the string. -// -// Output, bool S_TO_R8VEC, is true if an error occurred. -// -{ - bool error; - int i; - int lchar; - //double x; // unused - - for (i = 0; i < n; i++) - { - rvec[i] = s_to_r8(s, &lchar, &error); - - if (error) - { - return error; - } - - s = s + lchar; - } - - return error; -} -//****************************************************************************80 - -void timestamp(void) - -//****************************************************************************80 -// -// Purpose: -// -// TIMESTAMP prints the current YMDHMS date as a time stamp. -// -// Example: -// -// May 31 2001 09:45:54 AM -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 02 October 2003 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// None -// -{ -#define TIME_SIZE 40 - - static char time_buffer[TIME_SIZE]; - const struct tm *tm; - //size_t len; // unused - time_t now; - - now = time(NULL); - tm = localtime(&now); - - //len = strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm ); - strftime(time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm); - - cout << time_buffer << "\n"; - - return; -#undef TIME_SIZE -} -//****************************************************************************80 - -void tuple_next_fast(int m, int n, int rank, int x[]) - -//****************************************************************************80 -// -// Purpose: -// -// TUPLE_NEXT_FAST computes the next element of a tuple space, "fast". -// -// Discussion: -// -// The elements are N vectors. Each entry is constrained to lie -// between 1 and M. The elements are produced one at a time. -// The first element is -// (1,1,...,1) -// and the last element is -// (M,M,...,M) -// Intermediate elements are produced in lexicographic order. -// -// Example: -// -// N = 2, -// M = 3 -// -// INPUT OUTPUT -// ------- ------- -// Rank X -// ---- ---- -// -1 -1 -1 -// -// 0 1 1 -// 1 1 2 -// 2 1 3 -// 3 2 1 -// 4 2 2 -// 5 2 3 -// 6 3 1 -// 7 3 2 -// 8 3 3 -// 9 1 1 -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 11 August 2004 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, int M, the maximum entry in each component. -// M must be greater than 0. -// -// Input, int N, the number of components. -// N must be greater than 0. -// -// Input, integer RANK, indicates the rank of the tuples. -// Typically, 0 <= RANK < N**M; values larger than this are legal -// and meaningful, and are equivalent to the corresponding value -// MOD N**M. If RANK < 0, this indicates that this is the first -// call for the given values of (M,N). Initialization is done, -// and X is set to a dummy value. -// -// Output, int X[N], the next tuple, or a dummy value if initialization -// is being done. -// -{ - static int *base = NULL; - int i; - // - if (rank < 0) - { - if (m <= 0) - { - cout << "\n"; - cout << "TUPLE_NEXT_FAST - Fatal error!\n"; - cout << " The value M <= 0 is not legal.\n"; - cout << " M = " << m << "\n"; - exit(1); - } - if (n <= 0) - { - cout << "\n"; - cout << "TUPLE_NEXT_FAST - Fatal error!\n"; - cout << " The value N <= 0 is not legal.\n"; - cout << " N = " << n << "\n"; - exit(1); - } - - if (base) - { - delete[] base; - } - base = new int[n]; - - base[n - 1] = 1; - for (i = n - 2; 0 <= i; i--) - { - base[i] = base[i + 1] * m; - } - for (i = 0; i < n; i++) - { - x[i] = -1; - } - } - else - { - for (i = 0; i < n; i++) - { - x[i] = ((rank / base[i]) % m) + 1; - } - } - return; -} -//****************************************************************************80 - -void user(int dim_num, int n, int *seed, double r[]) - -//****************************************************************************80 -// -// Purpose: -// -// USER samples points in a user-specified region with given density. -// -// Discussion: -// -// This routine can be used to -// -// * specify an interesting initial configuration for the data, -// by specifing that USER be used for initialization (INIT = 3); -// -// * specify the shape of the computational region, by specifying -// that sample points are to be generated by this routine, -// (SAMPLE = 3) and then returning sample points uniformly at random. -// -// * specify the distribution or density function, by specifying -// that sample points are to be generated by this routine, -// (SAMPLE = 3 ) and then returning sample points according to a -// given probability density function. -// -// Licensing: -// -// This code is distributed under the GNU LGPL license. -// -// Modified: -// -// 23 June 2005 -// -// Author: -// -// John Burkardt -// -// Parameters: -// -// Input, integer DIM_NUM, the spatial dimension. -// -// Input, integer N, the number of sample points desired. -// -// Input/output, int *SEED, the "seed" value. On output, SEED has -// been updated. -// -// Output, double R[DIM_NUM*N], the sample values. -// -{ -#define PI 3.141592653589793 - - double angle; - int j; - double radius; - //double rand; - for (j = 0; j < n; j++) - { - angle = 2.0 * PI * (double)rand() / (double)RAND_MAX; - radius = sqrt((double)rand() / (double)RAND_MAX); - //rand = abs(( double ) rand ( ) / ( double ) RAND_MAX); - //if ( rand >= 1. ) - // cout << rand << "\n"; - //radius = boost::math::erf_inv(2.*rand-1.)*sqrt(2.); - r[0 + j * 2] = radius * cos(angle); - r[1 + j * 2] = radius * sin(angle); - } - - return; -#undef PI -} diff --git a/params/CVT/src/cvt.hpp b/params/CVT/src/cvt.hpp deleted file mode 100644 index cd8a62d3..00000000 --- a/params/CVT/src/cvt.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using namespace std; - -char ch_cap(char c); -bool ch_eqi(char c1, char c2); -int ch_to_digit(char c); -void cvt(int dim_num, int n, int batch, int init, int sample, int sample_num, - int it_max, int it_fixed, int *seed, double r[], int *it_num, - double *it_diff, double *energy); -double cvt_energy(int dim_num, int n, int batch, int sample, bool initialize, - int sample_num, int *seed, double r[]); -void cvt_iterate(int dim_num, int n, int batch, int sample, bool initialize, - int sample_num, int *seed, double r[], double *it_diff, double *energy); -void cvt_sample(int dim_num, int n, int n_now, int sample, bool initialize, - int *seed, double r[]); -void data_read(char *file_in_name, int dim_num, int n, double r[]); -char digit_to_ch(int i); -void find_closest(int dim_num, int n, int sample_num, double s[], double r[], - int nearest[]); -int get_seed(void); -bool halham_leap_check(int dim_num, int leap[]); -bool halham_n_check(int n); -bool halham_dim_num_check(int dim_num); -bool halham_seed_check(int dim_num, int seed[]); -bool halham_step_check(int step); -bool halton_base_check(int dim_num, int base[]); -int i4_log_10(int i); -int i4_max(int i1, int i2); -int i4_min(int i1, int i2); -void i4_to_halton_sequence(int dim_num, int n, int step, int seed[], int leap[], - int base[], double r[]); -char *i4_to_s(int i); -int prime(int n); -double r8_epsilon(void); -double r8_huge(void); -void r8mat_transpose_print(int m, int n, double a[], char *title); -void r8mat_transpose_print_some(int m, int n, double a[], int ilo, int jlo, - int ihi, int jhi, char *title); -void r8mat_uniform_01(int m, int n, int *seed, double r[]); -void r8mat_write(string output_filename, int m, int n, double table[]); -unsigned long random_initialize(int seed); -void s_blank_delete(char *s); -void s_cap(char *s); -bool s_eqi(char *s1, char *s2); -int s_len_trim(char *s); -double s_to_r8(char *s, int *lchar, bool *error); -bool s_to_r8vec(char *s, int n, double rvec[]); -void timestamp(void); -void tuple_next_fast(int m, int n, int rank, int x[]); -void user(int dim_num, int n, int *seed, double r[]); diff --git a/params/CVT/src/interface.cpp b/params/CVT/src/interface.cpp deleted file mode 100644 index ad6142f2..00000000 --- a/params/CVT/src/interface.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <cstdlib> -#include <cmath> -#include <ctime> -#include <iostream> -#include <iomanip> -#include <cstring> - -#include "interface.hpp" -#include "cvt.hpp" - -using namespace std; -using namespace paramsCVT; -/* -Interface::Interface(int _DIM_NUM, int _N, int _batch, int _init, int _sample, int _sample_num, int _it_max, int _it_fixed) : DIM_NUM(_DIM_NUM), N(_N), batch(_batch), init(_init), sample(_sample), sample_num(_sample_num), it_max(_it_max), it_fixed(_it_fixed) -{ -} - -int Interface::call() -{ - timestamp ( ); - cout << "\n"; - cout << "CVT_PRB\n"; - cout << " C++ version\n"; - cout << " Test the CVT library.\n"; - - //int batch; - double energy; - string file_out_name = "cvt_circle.txt"; - //int init; - char init_string[80]; - double it_diff; - //int it_fixed; - //int it_max; - int it_num; - double r[DIM_NUM*N]; - //int sample; - //int sample_num; - char sample_string[80]; - int seed; - int seed_init; - - cout << "\n"; - cout << "TEST13\n"; - cout << " CVT computes a Centroidal Voronoi Tessellation.\n"; - cout << " In this example, we call the \"USER\" routine,\n"; - cout << " which allows the user to define the geometry and\n"; - cout << " density implicitly, by returning sample points.\n"; - - //batch = 1000; - //init = 3; - strcpy ( init_string, "uniform" ); - //it_max = 40; - //it_fixed = 1; - //sample = 3; - //sample_num = 10000; - strcpy ( sample_string, "uniform" ); - seed = 123456789; - - seed_init = seed; - - cvt ( DIM_NUM, N, batch, init, sample, sample_num, it_max, it_fixed, - &seed, r, &it_num, &it_diff, &energy ); - - cout << "\n"; - cout << " Dimension DIM_NUM = " << DIM_NUM << "\n"; - cout << " Number of points N = " << N << "\n"; - cout << " Initial SEED = " << seed_init << "\n"; - cout << " Current SEED = " << seed << "\n"; - cout << " INIT = \"" << init_string << "\".\n"; - cout << " Max iterations IT_MAX = " << it_max << "\n"; - cout << " IT_FIXED (fixed samples) = " << it_fixed << "\n"; - cout << " Iterations IT_NUM = " << it_num << "\n"; - cout << " Difference IT_DIFF = " << it_diff << "\n"; - cout << " CVT ENERGY = " << energy << "\n"; - cout << " SAMPLE = \"" << sample_string << "\".\n"; - cout << " Samples SAMPLE_NUM = " << sample_num << "\n"; - cout << " Sampling BATCH size = " << batch << "\n"; - cout << " EPSILON (unit roundoff) = " << r8_epsilon ( ) << "\n"; - - r8mat_write ( file_out_name, DIM_NUM, N, r ); - -// -// Terminate. -// - cout << "\n"; - cout << "CVT_PRB\n"; - cout << " Normal end of execution.\n"; - cout << "\n"; - timestamp ( ); - - return 0; -} -*/ diff --git a/params/CVT/src/interface.hpp b/params/CVT/src/interface.hpp deleted file mode 100644 index 7a3b9192..00000000 --- a/params/CVT/src/interface.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef PINTERFACE_H -#define PINTERFACE_H - -#include "paramsCVT.h" -//#include "wGroup.h" -#include <vector> -#include <string> - -namespace paramsCVT -{ - -/** - * @brief manage CVT interface - */ - -class paramsCVT_API Interface -{ -public: - //Interface(int DIM_NUM, int N, int batch, int init, int sample, int sample_num, int it_max, int it_fixed); - - int DIM_NUM; - int N; - int batch; - int init; - int sample; - int sample_num; - int it_max; - int it_fixed; - - //int call(); -}; - -} // namespace paramsCVT - -#endif //PINTERFACE_H diff --git a/params/CVT/src/paramsCVT.h b/params/CVT/src/paramsCVT.h deleted file mode 100644 index 1de32ff2..00000000 --- a/params/CVT/src/paramsCVT.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 University of Liège - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// global header of the "paramsCVT" module - -#ifndef paramsCVT_H -#define paramsCVT_H - -#if defined(WIN32) -#ifdef paramsCVT_EXPORTS -#define paramsCVT_API __declspec(dllexport) -#else -#define paramsCVT_API __declspec(dllimport) -#endif -#else -#define paramsCVT_API -#endif - -/** - * @brief this namespace avoids conflicts with similar names in 'waves' - */ - -namespace paramsCVT -{ -class Interface; -}; - -#endif //paramsCVT_H diff --git a/params/CVT/test/test.py b/params/CVT/test/test.py deleted file mode 100644 index b5f62a7c..00000000 --- a/params/CVT/test/test.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import paramsCVT - - -def main(): - print("hi") - -if __name__ == "__main__": - main() diff --git a/params/__init__.py b/params/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/params/arnst_ponthot/__init__.py b/params/arnst_ponthot/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/params/arnst_ponthot/src/__init__.py b/params/arnst_ponthot/src/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/params/arnst_ponthot/src/gamma.py b/params/arnst_ponthot/src/gamma.py deleted file mode 100644 index d6c8cc5e..00000000 --- a/params/arnst_ponthot/src/gamma.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -from scipy.stats import gamma -from scipy.stats import norm - -def grid(M): - - M = M.astype(int) - TMP = M.shape - - d = TMP[0] - - m_max = 0 - for i in range(0,d): - if m_max < M[i]: - m_max = M[i] - - X = np.zeros((m_max,d)) - W = np.zeros((m_max,d)) - - for i in range(0,d): - x, w = np.polynomial.hermite.hermgauss(M[i]) - for j in range(0,M[i]): - X[j,i] = np.sqrt(2.)*x[j] - W[j,i] = w[j] - return X, W - -def rho_gamma(g,m_gamma,sigmaS_gamma): - k = m_gamma**2 / sigmaS_gamma - theta = sigmaS_gamma / m_gamma - - out_shape = np.shape(g) - - out = np.zeros(out_shape) - - loc = 0. - - length = len(g) - - for i in range(0,length): - out[i] = gamma.pdf(g[i], k, loc, theta) - - return out - -def c_gamma(g,m_gamma,sigmaS_gamma): - k = m_gamma**2 / sigmaS_gamma - theta = sigmaS_gamma / m_gamma - - out_shape = np.shape(g) - - out = np.zeros(out_shape) - - loc = 0. - - length = len(g) - - for i in range(0,length): - out[i] = gamma.cdf(g[i], k, loc, theta) - - return out - -def c_inv_gamma(g,m_gamma,sigmaS_gamma): - k = m_gamma**2 / sigmaS_gamma - theta = sigmaS_gamma / m_gamma - - out_shape = np.shape(g) - - out = np.zeros(out_shape) - - loc = 0. - - length = len(g) - - for i in range(0,length): - out[i] = gamma.isf(1.-g[i], k, loc, theta) - - return out - -def c_xi(g): - - out = norm.cdf(g) - - return out - -def c_inv_xi(g): - out = norm.isf(1.-g) - - return out - -def sigma(c1,c2,rho): - - c = 1. / (np.sqrt(1-rho**2)) - - tmp1 = c_inv_xi(c1) - tmp2 = c_inv_xi(c2) - - if tmp1 == float('Inf'): - out = 0. - elif tmp2 == float('Inf'): - out = 0. - elif (rho*tmp1)**2 - (2*rho*tmp1*tmp2) + (rho*tmp2)**2 == float('Inf'): - out = 0. - else: - out = c*np.exp((-((rho*tmp1)**2 - (2*rho*tmp1*tmp2) + (rho*tmp2)**2) / (2.*(1.-rho**2)))) - - return out - -def rho_gamma_gamma(g1,m_gamma1,sigmaS_gamma1,g2,m_gamma2,sigmaS_gamma2,rho): - - length1 = len(g1) - length2 = len(g2) - - out = np.zeros((length1,length2)) - - - rho_gamma1 = rho_gamma(g1,m_gamma1,sigmaS_gamma1) - rho_gamma2 = rho_gamma(g2,m_gamma2,sigmaS_gamma2) - - c_gamma1 = c_gamma(g1,m_gamma1,sigmaS_gamma1) - c_gamma2 = c_gamma(g2,m_gamma2,sigmaS_gamma2) - - for i in range(0,length1): - for j in range(0,length2): - out[i,j] = rho_gamma1[i]*rho_gamma2[j]*sigma(c_gamma1[i],c_gamma2[j],rho) - - return out - - -def f_mapping(xi,d,means,variances,P,method): - out = np.zeros((d,1)) - tmp = np.zeros((d,1)) - if method == 'Cholesky': - L = np.linalg.cholesky(P) - #print P - #print L - #print np.dot(L,L.T) - tmp = np.dot(L,xi) - elif method == 'PCA': - V = np.diag(variances) - V_sr = np.sqrt(V) - Sigma = np.dot(V_sr,np.dot(P,V_sr)) - invV_sr = np.linalg.inv(V_sr) - eig_val, U = np.linalg.eig(Sigma) - Lambda = np.diag(eig_val) - Lambda_sr = np.sqrt(Lambda) - tmp = np.dot(np.dot(invV_sr,np.dot(U,Lambda_sr)),xi) - for i in range(0,d): - out[i] = c_inv_gamma(np.array([c_xi(tmp[i])]),means[i],variances[i]) - - return out - -''' -def f_mapping_old(xi1,m_gamma1,sigmaS_gamma1,xi2,m_gamma2,sigmaS_gamma2,rho): - - out = np.zeros((2,1)) - out[0] = c_inv_gamma(np.array([c_xi(xi1)]),m_gamma1,sigmaS_gamma1) - out[1] = c_inv_gamma(np.array([c_xi(rho*xi1+np.sqrt(1-rho**2)*xi2)]),m_gamma2,sigmaS_gamma2) - - return out - - -def f_mapping_PCA(xi1,m_gamma1,sigmaS_gamma1,xi2,m_gamma2,sigmaS_gamma2,rho): - - Sigma = np.array([[sigmaS_gamma1,rho*np.sqrt(sigmaS_gamma1)*np.sqrt(sigmaS_gamma2)],[rho*np.sqrt(sigmaS_gamma1)*np.sqrt(sigmaS_gamma2),sigmaS_gamma2]]) - invV_sr = np.linalg.inv(np.sqrt(np.diag([sigmaS_gamma1,sigmaS_gamma2]))) - eig_val, U = np.linalg.eig(Sigma) - Lambda = np.diag(eig_val) - Lambda_sr = np.sqrt(Lambda) - xi_array = np.array([[xi1],[xi2]]) - tmp = np.dot(np.dot(invV_sr,np.dot(U,Lambda_sr)),xi_array) - out = np.zeros((2,1)) - out[0] = c_inv_gamma(np.array([c_xi(xi1)]),m_gamma1,sigmaS_gamma1) - out[1] = c_inv_gamma(np.array([c_xi(rho*xi1+np.sqrt(1-rho**2)*xi2)]),m_gamma2,sigmaS_gamma2) - - return out -''' diff --git a/params/arnst_ponthot/tests/test.py b/params/arnst_ponthot/tests/test.py deleted file mode 100644 index 37c52c20..00000000 --- a/params/arnst_ponthot/tests/test.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from scipy.stats import norm - import matplotlib.pyplot as plt - fig, ax = plt.subplots(1, 1) - mean, var, skew, kurt = norm.stats(moments='mvsk') - x = np.linspace(norm.ppf(0.01),norm.ppf(0.99), 100) - ax.plot(x, norm.pdf(x),'r-', lw=5, alpha=0.6, label='norm pdf') - rv = norm() - ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf') - vals = norm.ppf([0.001, 0.5, 0.999]) - np.allclose([0.001, 0.5, 0.999], norm.cdf(vals)) - r = norm.rvs(size=1000) - ax.hist(r, normed=True, histtype='stepfilled', alpha=0.2) - ax.legend(loc='best', frameon=False) - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test1.py b/params/arnst_ponthot/tests/test1.py deleted file mode 100644 index 340ee94e..00000000 --- a/params/arnst_ponthot/tests/test1.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from scipy.stats import norm - import matplotlib.pyplot as plt - fig, ax = plt.subplots(1, 1) - x = np.linspace(-4,4, 100) - loc = 0. # moyenne - scale = 1. # lie a ecart type - ax.plot(x, norm.pdf(x, loc, scale),'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test10.py b/params/arnst_ponthot/tests/test10.py deleted file mode 100644 index ca9cfca4..00000000 --- a/params/arnst_ponthot/tests/test10.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - - import matplotlib.pyplot as plt - - xi_tp = np.array([[-2.02018,-2.02018], - [-2.02018,-0.958572], - [-2.02018,0], - [-2.02018,0.958572], - [-2.02018,2.02018], - [-0.958572,-2.02018], - [-0.958572,-0.958572], - [-0.958572,0], - [-0.958572,0.958572], - [-0.958572,2.02018], - [0,-2.02018], - [0,-0.958572], - [0,0], - [0,0.958572], - [0,2.02018], - [0.958572,-2.02018], - [0.958572,-0.958572], - [0.958572,0], - [0.958572,0.958572], - [0.958572,2.02018], - [2.02018,-2.02018], - [2.02018,-0.958572], - [2.02018,0], - [2.02018,0.958572], - [2.02018,2.02018]], dtype=float) - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396. - sigmaS_S = 660. - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - loc = 0. - - PDF = gamma.rho_gamma_gamma(g_H,m_H,sigmaS_H,g_S,m_S,sigmaS_S,rho) - - G_H, G_S = np.meshgrid(g_H, g_S) - - fig, ax = plt.subplots() - plt.contour(G_H, G_S, PDF) - - for i in range(0,25): - tmp = gamma.f_mapping(xi_tp[i,1],m_S,sigmaS_S,xi_tp[i,0],m_H,sigmaS_H,rho) - plt.scatter(tmp[1],tmp[0]) - ax.grid(True) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test11.py b/params/arnst_ponthot/tests/test11.py deleted file mode 100644 index dc5fb980..00000000 --- a/params/arnst_ponthot/tests/test11.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - - import matplotlib.pyplot as plt - ''' - xi_tp = np.array([[-2.02018,-2.02018], - [-2.02018,-0.958572], - [-2.02018,0], - [-2.02018,0.958572], - [-2.02018,2.02018], - [-0.958572,-2.02018], - [-0.958572,-0.958572], - [-0.958572,0], - [-0.958572,0.958572], - [-0.958572,2.02018], - [0,-2.02018], - [0,-0.958572], - [0,0], - [0,0.958572], - [0,2.02018], - [0.958572,-2.02018], - [0.958572,-0.958572], - [0.958572,0], - [0.958572,0.958572], - [0.958572,2.02018], - [2.02018,-2.02018], - [2.02018,-0.958572], - [2.02018,0], - [2.02018,0.958572], - [2.02018,2.02018]], dtype=float) - - ''' - - M = np.array([5,5],dtype=int) - - # - X,W = gamma.grid(M) - # - - m = M[0]*M[1] - - xi_tp = np.zeros([m,2]) - - index = 0 - for i in range(0,M[0]): - for j in range(0,M[1]): - xi_tp[index,0] = X[i,0] - xi_tp[index,1] = X[j,1] - index = index + 1 - - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396. - sigmaS_S = 660. - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - loc = 0. - - PDF = gamma.rho_gamma_gamma(g_H,m_H,sigmaS_H,g_S,m_S,sigmaS_S,rho) - - G_H, G_S = np.meshgrid(g_H, g_S) - - fig, ax = plt.subplots() - plt.contour(G_H, G_S, PDF) - - for i in range(0,m): - tmp = gamma.f_mapping(xi_tp[i,0],m_H,sigmaS_H,xi_tp[i,1],m_S,sigmaS_S,rho) - plt.scatter(tmp[0],tmp[1]) - ax.grid(True) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test2.py b/params/arnst_ponthot/tests/test2.py deleted file mode 100644 index a17ce129..00000000 --- a/params/arnst_ponthot/tests/test2.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from scipy.stats import gamma - import matplotlib.pyplot as plt - fig, ax = plt.subplots(1, 1) - - m_H = 1495. - sigmaS_H = 1390. - k = m_H**2 / sigmaS_H - theta = sigmaS_H / m_H - x = np.linspace(1200,1800, 100) - loc = 0. - ax.plot(x, gamma.pdf(x, k, loc, theta),'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test3.py b/params/arnst_ponthot/tests/test3.py deleted file mode 100644 index 35383a7f..00000000 --- a/params/arnst_ponthot/tests/test3.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from scipy.stats import gamma - import matplotlib.pyplot as plt - fig, ax = plt.subplots(1, 1) - - m_H = 1495. - sigmaS_H = 1390. - k = m_H**2 / sigmaS_H - theta = sigmaS_H / m_H - x = np.linspace(1200,1800, 100) - loc = 0. - ax.plot(x, gamma.cdf(x, k, loc, theta),'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test4.py b/params/arnst_ponthot/tests/test4.py deleted file mode 100644 index ce7cfe48..00000000 --- a/params/arnst_ponthot/tests/test4.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from scipy.stats import gamma - import matplotlib.pyplot as plt - fig, ax = plt.subplots(1, 1) - - m_H = 1495. - sigmaS_H = 1390. - k = m_H**2 / sigmaS_H - theta = sigmaS_H / m_H - x = np.linspace(0,1, 100) - loc = 0. - ax.plot(x,gamma.isf(1-x, k, loc, theta),'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test5.py b/params/arnst_ponthot/tests/test5.py deleted file mode 100644 index b3754926..00000000 --- a/params/arnst_ponthot/tests/test5.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - import matplotlib.pyplot as plt - - - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396 - sigmaS_S = 660 - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - loc = 0. - - PDF = gamma.rho_gamma(g_H,m_H,sigmaS_H) - - fig, ax = plt.subplots(1, 1) - ax.plot(g_H, PDF,'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test6.py b/params/arnst_ponthot/tests/test6.py deleted file mode 100644 index 0507bb3e..00000000 --- a/params/arnst_ponthot/tests/test6.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - import matplotlib.pyplot as plt - - - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396 - sigmaS_S = 660 - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - y = np.linspace(0,1, 100) - loc = 0. - - x = gamma.c_inv_gamma(y,m_H,sigmaS_H) - - fig, ax = plt.subplots(1, 1) - ax.plot(y, x,'r-', lw=5, alpha=0.6, label='norm pdf') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test7.py b/params/arnst_ponthot/tests/test7.py deleted file mode 100644 index eaa9905f..00000000 --- a/params/arnst_ponthot/tests/test7.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - import matplotlib.pyplot as plt - - - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396 - sigmaS_S = 660 - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - y = np.linspace(0,1, 100) - loc = 0. - - x = gamma.sigma(0.5,0.5,rho) - - print(x) - -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test8.py b/params/arnst_ponthot/tests/test8.py deleted file mode 100644 index ac521b1d..00000000 --- a/params/arnst_ponthot/tests/test8.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - from mpl_toolkits.mplot3d import Axes3D - from matplotlib import cm - from matplotlib.ticker import LinearLocator, FormatStrFormatter - import matplotlib.pyplot as plt - fig = plt.figure() - ax = fig.gca(projection='3d') - - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396. - sigmaS_S = 660. - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - loc = 0. - - PDF = gamma.rho_gamma_gamma(g_H,m_H,sigmaS_H,g_S,m_S,sigmaS_S,rho) - - G_H, G_S = np.meshgrid(g_H, g_S) - #plt.contour(G_H, G_S, PDF) - ax.contourf(G_H, G_S, PDF, cmap=cm.coolwarm) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/arnst_ponthot/tests/test9.py b/params/arnst_ponthot/tests/test9.py deleted file mode 100644 index 993534e6..00000000 --- a/params/arnst_ponthot/tests/test9.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - -def main(): - - from params.arnst_ponthot.src import gamma - - import matplotlib.pyplot as plt - - xi_tp = np.array([[-2.02018,-2.02018], - [-2.02018,-0.958572], - [-2.02018,0], - [-2.02018,0.958572], - [-2.02018,2.02018], - [-0.958572,-2.02018], - [-0.958572,-0.958572], - [-0.958572,0], - [-0.958572,0.958572], - [-0.958572,2.02018], - [0,-2.02018], - [0,-0.958572], - [0,0], - [0,0.958572], - [0,2.02018], - [0.958572,-2.02018], - [0.958572,-0.958572], - [0.958572,0], - [0.958572,0.958572], - [0.958572,2.02018], - [2.02018,-2.02018], - [2.02018,-0.958572], - [2.02018,0], - [2.02018,0.958572], - [2.02018,2.02018]], dtype=float) - m_H = 1495. - sigmaS_H = 1390. - - m_S = 396. - sigmaS_S = 660. - - rho = -0.223 - - g_H = np.linspace(1200,1800, 100) - g_S = np.linspace(250,550, 100) - loc = 0. - - PDF = gamma.rho_gamma_gamma(g_H,m_H,sigmaS_H,g_S,m_S,sigmaS_S,rho) - - G_H, G_S = np.meshgrid(g_H, g_S) - - fig, ax = plt.subplots() - plt.contour(G_H, G_S, PDF) - - for i in range(0,25): - tmp = gamma.f_mapping(xi_tp[i,0],m_H,sigmaS_H,xi_tp[i,1],m_S,sigmaS_S,rho) - plt.scatter(tmp[0],tmp[1]) - ax.grid(True) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LSP.py b/params/dev_tests/LSP.py deleted file mode 100755 index 58c63a6a..00000000 --- a/params/dev_tests/LSP.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - m = 100 - n = 100 - x = 2*(np.arange(0,m) / (m-1.) -0.5) - - Z = np.zeros((m,n)) - - for i in range(0,n): - Z[:,i] = x**i - - U, s, V = np.linalg.svd(Z, full_matrices=True) - - plt.subplot(1,3,1) - for i in range(0,n): - plt.plot(x,Z[:,i]) - - plt.subplot(1,3,2) - plt.semilogy(list(range(1,n+1)),s,'*') - plt.xlabel('i') - plt.ylabel('sigma_i') - - print(V.shape) - print(Z.shape) - plt.subplot(1,3,3) - - ZV = np.dot(Z,np.transpose(V)) - for i in range(0,n): - plt.plot(x,ZV[:,i]) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LSP_2.py b/params/dev_tests/LSP_2.py deleted file mode 100755 index c4b51ac5..00000000 --- a/params/dev_tests/LSP_2.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - m = 100 - n = 100 - x, w = np.polynomial.legendre.leggauss(m) - Z = np.zeros((m,n)) - - for i in range(0,n): - Z[:,i] = x**i - - W = np.zeros((m,m)) - W[:m,:m] = np.diag(w) - - W_sr = np.sqrt(W) - - W_srZ = np.dot(W_sr,Z) - - U, s, V = np.linalg.svd(W_srZ, full_matrices=True) - - plt.subplot(1,3,1) - for i in range(0,n): - plt.plot(x,Z[:,i]) - - plt.subplot(1,3,2) - plt.semilogy(list(range(1,n+1)),s,'*') - plt.xlabel('i') - plt.ylabel('sigma_i') - - print(V.shape) - print(Z.shape) - plt.subplot(1,3,3) - - ZV = np.dot(Z,np.transpose(V)) - for i in range(0,n): - plt.plot(x,ZV[:,i]) - - plt.show() -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LSP_3.py b/params/dev_tests/LSP_3.py deleted file mode 100755 index 9017a9db..00000000 --- a/params/dev_tests/LSP_3.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter - -def main(): - m = 20 - n = 20 - x, w = np.polynomial.legendre.leggauss(m) - - X = np.zeros((m,m)) - Y = np.zeros((m,m)) - phi_1 = np.zeros((m,m)) - - Z_1 = np.zeros((m,n)) - Z_2 = np.zeros((m**2,n**2)) - - for i in range(0,n): - Z_1[:,i] = x**i - - X, Y = np.meshgrid(x, x) - - x_2 = X - y_2 = Y - - x_2 = np.reshape(x_2,(m**2,)) - y_2 = np.reshape(y_2,(m**2,)) - - - for i in range(0,n): - for j in range(0,n): - Z_2[:,j+n*i] = x_2**i*y_2**j - - #for i in range(0,m): - # for j in range(0,m): - # phi_1[i,j] = X[i,j]**1*Y[i,j]**1 - - U_1, s_1, V_1 = np.linalg.svd(Z_1, full_matrices=True) - U_2, s_2, V_2 = np.linalg.svd(Z_2, full_matrices=True) - - plt.figure() - - plt.semilogy(list(range(1,n+1)),s_1**2,'ro') - plt.semilogy(list(range(1,n**2+1)),s_2,'ko') - for i in range(0,n): - plt.semilogy([1,n**2+1],[s_1[i]**2,s_1[i]**2],'b') - - fig = plt.figure() - ax = fig.gca(projection='3d') - #for i in range(0,m): - # for j in range(0,m): - # ax.scatter(X[i,j], Y[i,j], phi_1[i,j],'*') - - Z_2V_2 = np.dot(Z_2,np.transpose(V_2)) - - phi_1 = np.reshape(Z_2V_2[:,0],(m,m)) - phi_3 = np.reshape(Z_2V_2[:,2],(m,m)) - phi_5 = np.reshape(Z_2V_2[:,4],(m,m)) - - surf = ax.plot_surface(X, Y, phi_1, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_3, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_5, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - - ax.axis('equal') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LSP_4.py b/params/dev_tests/LSP_4.py deleted file mode 100755 index bc93b7a3..00000000 --- a/params/dev_tests/LSP_4.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter -#from func import grid - -def grid(M): - - M = M.astype(int) - TMP = M.shape - - d = TMP[0] - - m_max = 0 - for i in range(0,d): - if m_max < M[i]: - m_max = M[i] - - X = np.zeros((m_max,d)) - W = np.zeros((m_max,d)) - - for i in range(0,d): - x, w = np.polynomial.legendre.leggauss(M[i]) - for j in range(0,M[i]): - X[j,i] = x[j] - W[j,i] = w[j] - return X, W - -def main(): - m = 20 - n = 20 - - M = np.zeros((2,)) - M[0] = m - M[1] = m - X_0, W_0 = grid(M) - - X = np.zeros((m,m)) - Y = np.zeros((m,m)) - - Z_1 = np.zeros((m,n)) - Z_2 = np.zeros((m**2,n**2)) - - X, Y = np.meshgrid(X_0[:,0], X_0[:,1]) - - x_2 = X - y_2 = Y - - x_2 = np.reshape(x_2,(m**2,)) - y_2 = np.reshape(y_2,(m**2,)) - - for i in range(0,n): - Z_1[:,i] = X_0[:,0]**i - - W_1 = np.zeros((m,m)) - W_1[:m,:m] = np.diag(W_0[:,0]) - - W_1_sr = np.sqrt(W_1) - - W_1_srZ_1 = np.dot(W_1_sr,Z_1) - - for i in range(0,n): - for j in range(0,n): - Z_2[:,j+n*i] = x_2**i*y_2**j - - W_2 = np.zeros((m**2,m**2)) - - tmp = np.zeros((m**2,)) - for i in range(0,m): - for j in range(0,m): - tmp[j+m*i] = W_0[i,0]*W_0[j,1] - - W_2[:m**2,:m**2] = np.diag(tmp) - - W_2_sr = np.sqrt(W_2) - - W_2_srZ_2 = np.dot(W_2_sr,Z_2) - - U_1, s_1, V_1 = np.linalg.svd(W_1_srZ_1, full_matrices=True) - U_2, s_2, V_2 = np.linalg.svd(W_2_srZ_2, full_matrices=True) - - plt.figure() - - plt.semilogy(list(range(1,n+1)),s_1**2,'ro') - plt.semilogy(list(range(1,n**2+1)),s_2,'ko') - for i in range(0,n): - plt.semilogy([1,n**2+1],[s_1[i]**2,s_1[i]**2],'b') - - fig = plt.figure() - ax = fig.gca(projection='3d') - - Z_2V_2 = np.dot(Z_2,np.transpose(V_2)) - - phi_1 = np.reshape(Z_2V_2[:,0],(m,m)) - phi_3 = np.reshape(Z_2V_2[:,2],(m,m)) - phi_5 = np.reshape(Z_2V_2[:,4],(m,m)) - - surf = ax.plot_surface(X, Y, phi_1, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_3, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_5, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - - ax.axis('equal') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LegPol.py b/params/dev_tests/LegPol.py deleted file mode 100755 index e3535394..00000000 --- a/params/dev_tests/LegPol.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter -from numpy.polynomial import Polynomial, Legendre -def main(): - m = 100 - n = 10 - - x_min = -1 - x_max = 1 - - for i in range(0,n): - p = Legendre.basis(i).convert(kind=Polynomial) - print(p.coef) - - x = np.linspace(x_min,x_max,m) - - fig = plt.figure() - ax = fig.gca() - ax.set_xlabel('x') - ax.set_ylabel('P_i(x)') - plt.title("The first ten Legendre polynomials") - - for i in range(0,n): - y = Legendre.basis(i, [x_min,x_max])(x) - plt.plot(x,y,linewidth=2.0) - plt.grid(True) - - plt.savefig('Leg.png', bbox_inches = 'tight') - - - #y = Legendre([2.1,1,1], [x_min,x_max])(x) - plt.plot(x,y) - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/LegPol2.py b/params/dev_tests/LegPol2.py deleted file mode 100755 index 6d0a9788..00000000 --- a/params/dev_tests/LegPol2.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter -from numpy.polynomial import Polynomial, Legendre -def main(): - m = 100 - n = 10 - - x_min = 100 - x_max = 300 - - y_min = 2 - y_max = 8 - - x = np.linspace(x_min,x_max,m) - y = np.linspace(y_min,y_max,m) - - Z = np.zeros((m,m)) - - X, Y = np.meshgrid(x, y) - - fig = plt.figure() - ax = fig.gca(projection='3d') - ax.set_xlabel('T [C]') - ax.set_ylabel('H_1 [mm]') - ax.view_init(elev=20., azim=-140.) - current_title = plt.title(" ") - - index = 1 - - for i in range(0,n): - for j in range(0,n): - z_x = Legendre.basis(i, [x_min,x_max])(x) - z_y = Legendre.basis(j, [y_min,y_max])(y) - for ii in range(0,m): - for jj in range(0,m): - Z[ii,jj] = z_x[ii] * z_y[jj] - - surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - - current_title.set_text('i = ' + str(i) + ', j = ' + str(j)) - plt.savefig('Leg_' + str(index) + '.png', bbox_inches = 'tight') - index = index + 1 - surf.remove() - del surf - - surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) -if __name__ == "__main__": - main() diff --git a/params/dev_tests/numpy_matplotlib01.py b/params/dev_tests/numpy_matplotlib01.py deleted file mode 100755 index e646627e..00000000 --- a/params/dev_tests/numpy_matplotlib01.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np -import matplotlib.pyplot as plt - -def main(): - a = np.random.randn(3,3) - print(a) - U, s, V = np.linalg.svd(a, full_matrices=True) - print(U.shape, V.shape, s.shape) - S = np.zeros((3,3)) - S[:3,:3] = np.diag(s) - print(np.allclose(a, np.dot(U, np.dot(S,V)))) - print(a - np.dot(U, np.dot(S,V))) - print(s) - - plt.plot([1,2,3,4]) - plt.ylabel('some numbers') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/numpy_matplotlib02.py b/params/dev_tests/numpy_matplotlib02.py deleted file mode 100755 index 750def95..00000000 --- a/params/dev_tests/numpy_matplotlib02.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import time -import numpy as np -import matplotlib.pyplot as plt - -def main(): - plt.axis([0, 100, 0, 1]) - plt.ion() - - - for i in range(100): - y = np.random.random() - plt.scatter(i, y) - plt.draw() - #time.sleep(0.005) - - plt.ioff() - plt.show() -if __name__ == "__main__": - main() diff --git a/params/dev_tests/numpy_matplotlib03.py b/params/dev_tests/numpy_matplotlib03.py deleted file mode 100755 index 851a3320..00000000 --- a/params/dev_tests/numpy_matplotlib03.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -import numpy as np -import matplotlib.pyplot as plt - -def main(): - mpl.rcParams['legend.fontsize'] = 10 - - fig = plt.figure() - ax = fig.gca(projection='3d') - theta = np.linspace(-4 * np.pi, 4 * np.pi, 100) - z = np.linspace(-2, 2, 100) - r = z**2 + 1 - x = r * np.sin(theta) - y = r * np.cos(theta) - ax.plot(x, y, z, label='parametric curve') - ax.legend() - - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/numpy_matplotlib04.py b/params/dev_tests/numpy_matplotlib04.py deleted file mode 100755 index fce211cc..00000000 --- a/params/dev_tests/numpy_matplotlib04.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -from matplotlib import rc -import matplotlib.pyplot as plt - -def main(): - import numpy as np - from matplotlib import pyplot as plt - - tmpData = np.random.random( 300 ) - - ##Create a plot with a tex title - ax = plt.subplot(211) - plt.plot(np.arange(300), tmpData) - plt.title(r'$W_y(\tau, j=3)$') - plt.setp(ax.get_xticklabels(), visible = False) - - ##Create another plot without a tex title - plt.subplot(212) - plt.plot(np.arange(300), tmpData ) - plt.title(r'Some random numbers') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/dev_tests/numpy_matplotlib05.py b/params/dev_tests/numpy_matplotlib05.py deleted file mode 100644 index d22c0bc0..00000000 --- a/params/dev_tests/numpy_matplotlib05.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -from matplotlib import rc -import matplotlib.pyplot as plt - -def main(): - import matplotlib.pyplot as plt - - #Direct input - plt.rcParams['text.latex.preamble']=[r"\usepackage{lmodern}"] - #Options - params = {'text.usetex' : True, - 'font.size' : 11, - 'font.family' : 'lmodern', - 'text.latex.unicode': True, - } - plt.rcParams.update(params) - - fig = plt.figure() - - #You must select the correct size of the plot in advance - fig.set_size_inches(3.54,3.54) - - plt.plot([1,2,3,4]) - plt.xlabel("Excitation-Energy") - plt.ylabel("Intensitat") - plt.savefig("graph.pdf", - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - -if __name__ == "__main__": - main() diff --git a/params/src/LSP_3.py b/params/src/LSP_3.py deleted file mode 100755 index bc93b7a3..00000000 --- a/params/src/LSP_3.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import matplotlib as mpl -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import cm -import numpy as np -import matplotlib.pyplot as plt -from matplotlib.ticker import LinearLocator, FormatStrFormatter -#from func import grid - -def grid(M): - - M = M.astype(int) - TMP = M.shape - - d = TMP[0] - - m_max = 0 - for i in range(0,d): - if m_max < M[i]: - m_max = M[i] - - X = np.zeros((m_max,d)) - W = np.zeros((m_max,d)) - - for i in range(0,d): - x, w = np.polynomial.legendre.leggauss(M[i]) - for j in range(0,M[i]): - X[j,i] = x[j] - W[j,i] = w[j] - return X, W - -def main(): - m = 20 - n = 20 - - M = np.zeros((2,)) - M[0] = m - M[1] = m - X_0, W_0 = grid(M) - - X = np.zeros((m,m)) - Y = np.zeros((m,m)) - - Z_1 = np.zeros((m,n)) - Z_2 = np.zeros((m**2,n**2)) - - X, Y = np.meshgrid(X_0[:,0], X_0[:,1]) - - x_2 = X - y_2 = Y - - x_2 = np.reshape(x_2,(m**2,)) - y_2 = np.reshape(y_2,(m**2,)) - - for i in range(0,n): - Z_1[:,i] = X_0[:,0]**i - - W_1 = np.zeros((m,m)) - W_1[:m,:m] = np.diag(W_0[:,0]) - - W_1_sr = np.sqrt(W_1) - - W_1_srZ_1 = np.dot(W_1_sr,Z_1) - - for i in range(0,n): - for j in range(0,n): - Z_2[:,j+n*i] = x_2**i*y_2**j - - W_2 = np.zeros((m**2,m**2)) - - tmp = np.zeros((m**2,)) - for i in range(0,m): - for j in range(0,m): - tmp[j+m*i] = W_0[i,0]*W_0[j,1] - - W_2[:m**2,:m**2] = np.diag(tmp) - - W_2_sr = np.sqrt(W_2) - - W_2_srZ_2 = np.dot(W_2_sr,Z_2) - - U_1, s_1, V_1 = np.linalg.svd(W_1_srZ_1, full_matrices=True) - U_2, s_2, V_2 = np.linalg.svd(W_2_srZ_2, full_matrices=True) - - plt.figure() - - plt.semilogy(list(range(1,n+1)),s_1**2,'ro') - plt.semilogy(list(range(1,n**2+1)),s_2,'ko') - for i in range(0,n): - plt.semilogy([1,n**2+1],[s_1[i]**2,s_1[i]**2],'b') - - fig = plt.figure() - ax = fig.gca(projection='3d') - - Z_2V_2 = np.dot(Z_2,np.transpose(V_2)) - - phi_1 = np.reshape(Z_2V_2[:,0],(m,m)) - phi_3 = np.reshape(Z_2V_2[:,2],(m,m)) - phi_5 = np.reshape(Z_2V_2[:,4],(m,m)) - - surf = ax.plot_surface(X, Y, phi_1, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_3, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - surf = ax.plot_surface(X, Y, phi_5, rstride=1, cstride=1, cmap=cm.jet, - linewidth=0, antialiased=False) - - ax.axis('equal') - plt.show() - -if __name__ == "__main__": - main() diff --git a/params/src/__init__.py b/params/src/__init__.py deleted file mode 100644 index 07227489..00000000 --- a/params/src/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- -# params MODULE initialization file - diff --git a/params/src/func.py b/params/src/func.py deleted file mode 100755 index ea674f5b..00000000 --- a/params/src/func.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np -from numpy.polynomial import Polynomial, Legendre - -def next_indices(p,i,M,d): - - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - - i = i + i_one - - while np.all(i != i_zero): - i[p] = i[p] + 1; - if i[p] > M[p]: - if p==(d-1): - i= - i_one - return p, i - i[p] = 1 - p = p+1 - else: - p = 0 - return p, i-i_one - -def phi(xi,N,n_max,d): - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - for j in range(0,d): - phi[n_i] = phi[n_i]*xi[j]**i[j] - n_i = n_i + 1 - p,i = next_indices(p,i,N,d) - return phi - - -def phi_2(xi,N,n_max,d): - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - tmp = 0 - for j in range(0,d): - tmp = tmp + i[j] - if tmp <= N[0]: - for j in range(0,d): - phi[n_i] = phi[n_i]*xi[j]**i[j] - n_i = n_i + 1 - p,i = next_indices(p,i,N,d) - return phi - - -def phi_3(xi,N,n_max,d,Dom_min,Dom_max): - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - for j in range(0,d): - phi[n_i] = phi[n_i]*Legendre.basis(i[j], [Dom_min[j],Dom_max[j]])(xi[j]) - n_i = n_i + 1 - p,i = next_indices(p,i,N,d) - return phi - -def grid(M): - - M = M.astype(int) - TMP = M.shape - - d = TMP[0] - - m_max = 0 - for i in range(0,d): - if m_max < M[i]: - m_max = M[i] - - X = np.zeros((m_max,d)) - W = np.zeros((m_max,d)) - - for i in range(0,d): - x, w = np.polynomial.legendre.leggauss(M[i]) - for j in range(0,M[i]): - X[j,i] = x[j] - W[j,i] = w[j] - return X, W diff --git a/params/src/gauss.py b/params/src/gauss.py deleted file mode 100644 index 4f53efae..00000000 --- a/params/src/gauss.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np - -def grid(M): - - M = M.astype(int) - TMP = M.shape - - d = TMP[0] - - m_max = 0 - for i in range(0,d): - if m_max < M[i]: - m_max = M[i] - - X = np.zeros((m_max,d)) - W = np.zeros((m_max,d)) - - for i in range(0,d): - x, w = np.polynomial.legendre.leggauss(M[i]) - for j in range(0,M[i]): - X[j,i] = x[j] - W[j,i] = w[j] - return X, W diff --git a/params/src/indices.py b/params/src/indices.py deleted file mode 100755 index b4c5feab..00000000 --- a/params/src/indices.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np - -def my_next(p,i,M,d): - - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - - i = i + i_one - - while np.all(i != i_zero): - i[p] = i[p] + 1; - if i[p] > M[p]: - if p==(d-1): - i= - i_one - return p, i - i[p] = 1 - p = p+1 - else: - p = 0 - return p, i-i_one diff --git a/params/src/legendre.py b/params/src/legendre.py deleted file mode 100755 index 4fe5ea88..00000000 --- a/params/src/legendre.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np -import params.src.indices as indices -from numpy.polynomial import Polynomial, Legendre - -def phi(xi,N,n_max,d): - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - for j in range(0,d): - phi[n_i] = phi[n_i]*Legendre.basis(i[j])(xi[j]) - n_i = n_i + 1 - p,i = indices.my_next(p,i,N,d) - return phi diff --git a/params/src/legendre_norm.py b/params/src/legendre_norm.py deleted file mode 100755 index ff00d962..00000000 --- a/params/src/legendre_norm.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -import params.src.indices as indices -from numpy.polynomial import Polynomial, Legendre - -def phi(xi,N,n_max,d): - - N_max = max(N) - - L = np.zeros((d,N_max)) - for j in range(0,d): - for i in range(0,N_max): - L[j,i] = Legendre.basis(i)(xi[j]) - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - for j in range(0,d): - phi[n_i] = phi[n_i]*L[j,i[j]] / np.sqrt(2. / (2*i[j]+1)) - n_i = n_i + 1 - p,i = indices.my_next(p,i,N,d) - return phi diff --git a/params/src/monomials.py b/params/src/monomials.py deleted file mode 100755 index 5e4db377..00000000 --- a/params/src/monomials.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np -import params.src.indices as indices - -def phi(xi,N,n_max,d): - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - for j in range(0,d): - phi[n_i] = phi[n_i]*xi[j]**i[j] - n_i = n_i + 1 - p,i = indices.my_next(p,i,N,d) - return phi - -def compute_n_max(N,d): - - n_max = 1 - for j in range(0,d): - n_max = n_max*N[j] - - return n_max diff --git a/params/src/monomials_1norm.py b/params/src/monomials_1norm.py deleted file mode 100755 index 52f01db8..00000000 --- a/params/src/monomials_1norm.py +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -import numpy as np -import params.src.indices as indices - -def phi_old(xi,N,n_max,d): - - n = N[0] - N = n*np.ones((d,), dtype =np.int) - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - phi = np.ones((n_max,)) - n_i = 0 - while np.all(i != -i_one): - tmp = 0 - for j in range(0,d): - tmp = tmp+i[j] - if tmp < n: - for j in range(0,d): - phi[n_i] = phi[n_i]*xi[j]**i[j] - n_i = n_i + 1 - p,i = indices.my_next(p,i,N,d) - return phi - - -def phi(xi,N,n_max,d): - if d == 2: - n = N[0] - phi = np.ones((n_max,)) - - n_i = 0 - - for n_c in range(0, n): - - for i in range(0,n_c+1): - j = n_c-i - phi[n_i] = (xi[0]**j)*(xi[1]**i) - n_i = n_i + 1 - else: - n = N[0] - N = n*np.ones((d,), dtype =np.int) - - - n_c = 0 - - phi = np.ones((n_max,)) - n_i = 0 - - while n_c < n: - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - while np.all(i != -i_one): - tmp = 0 - for j in range(0,d): - tmp = tmp+i[j] - if tmp == n_c: - for j in range(0,d): - phi[n_i] = phi[n_i]*xi[j]**i[j] - n_i = n_i + 1 - p,i = indices.my_next(p,i,N,d) - - n_c = n_c + 1 - return phi - -def compute_n_max(N,d): - - n = N[0] - N = n*np.ones((d,), dtype =np.int) - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - n_max = 0 - while np.all(i != -i_one): - tmp = 0 - for j in range(0,d): - tmp = tmp+i[j] - if tmp < n: - n_max = n_max + 1 - p,i = indices.my_next(p,i,N,d) - - return n_max diff --git a/params/src/plot.py b/params/src/plot.py deleted file mode 100755 index bc99857c..00000000 --- a/params/src/plot.py +++ /dev/null @@ -1,256 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import numpy as np -from matplotlib import cm -import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D -from matplotlib import rc -from matplotlib.ticker import MultipleLocator -import os - -def scatter(xi,sol,d,fig,ax,display,m_i): - plt.figure(fig.number) - if d == 1: - plt.scatter(xi[0], sol) - elif d == 2: - ax.scatter(xi[0],xi[1], sol) - elif d == 3: - ax.scatter(xi[0],xi[1], xi[2]) - - if display == True: - plt.draw() - os.chdir('images') - plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - -def scatters(xi,sol,d,fig,ax,display,m_i): - plt.figure(fig.number) - if d == 2: - ax.scatter(xi[:,0],xi[:,1], sol[:]) - elif d == 3: - c = np.ones(len(xi[:,0])) - s = ax.scatter(xi[:,0],xi[:,1], xi[:,2],c=sol, cmap=cm.jet, lw = 0) - s.set_edgecolors = s.set_facecolors = lambda *args:None - - if display == True: - plt.draw() - os.chdir('images') - plt.savefig('training_point' + str(m_i+1) + '.png', bbox_inches = 'tight') - os.chdir('..') - -def surf(X, Y, surrogate, sol, fixed_value, fig, ax, current_title, keep, save, new_title, name,d): - if d == 1: - surf = ax.plot(X,surrogate) - current_title.set_text(new_title) - ax.set_ylim(np.amin(sol)-1.,np.amax(sol)+1.) - elif d == 2: - surf = ax.plot_surface(X, Y, surrogate, rstride=1, cstride=1, cmap=cm.jet, alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text(new_title) - ax.set_zlim3d(np.amin(sol),np.amax(sol)) - ''' - elif d == 3: - tmp = fixed_value[0]*np.ones(X.shape) - surrogate = surrogate-surrogate.min() - surrogate = surrogate/surrogate.max() - surf = ax.plot_surface(X, Y, tmp, rstride=1, cstride=1, facecolors=cm.jet(surrogate), alpha=0.4, - linewidth=0, antialiased=False) - current_title.set_text(new_title) - ''' - if save == True: - os.chdir('images') - #plt.savefig(name, bbox_inches = 'tight') - plt.savefig(name, - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - os.chdir('..') - if keep == False: - surf.remove() - del surf - - -def surf4d(X, Y, Z, surrogate, c_min, c_max, fig, ax, current_title, keep, save, new_title, name,d): - if d == 3: - surrogate = surrogate-c_min - surrogate = surrogate / (c_max-c_min) - surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=cm.jet(surrogate), alpha=0.5, - linewidth=0, antialiased=False) - current_title.set_text(new_title) - - if save == True: - os.chdir('images') - #plt.savefig(name, bbox_inches = 'tight') - plt.savefig(name, - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - os.chdir('..') - if keep == False: - surf.remove() - del surf - - -def init(d): - fig = plt.figure() - if d == 1: - ax = fig.gca() - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel('$T [$C$]$') - ax.set_ylabel('$H_1 [$mm$]$') - ax.set_zlabel('max $\sigma_{VM} [$MPa$]$') - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - #------------------------- - rc('font',size=16) - rc('font',family='serif') - rc('axes',labelsize=16) - - #Direct input - #plt.rcParams['text.latex.preamble']=[r"\usepackage{lmodern}"] - #Options - #rc('text',usetex = True) - #params = {'text.usetex' : True, - # 'font.size' : 11, - # 'font.family' : 'lmodern', - # 'text.latex.unicode': True, - # } - #plt.rcParams.update(params) - - #------------------------- - return fig, ax, current_title - - -def init2(d, images_parameters): - fig = plt.figure() - if d == 1: - ax = fig.gca() - elif d == 2: - ax = fig.gca(projection='3d') - ax.set_xlabel(images_parameters['xlabel']) - ax.set_ylabel(images_parameters['ylabel']) - ax.set_zlabel(images_parameters['zlabel']) - ax.view_init(elev=20., azim=-140.) - elif d == 3: - ax = fig.gca(projection='3d') - ax.set_xlabel(images_parameters['xlabel']) - ax.set_ylabel(images_parameters['ylabel']) - ax.set_zlabel(images_parameters['zlabel']) - - ax.view_init(elev=20., azim=-140.) - plt.ion() - - current_title = plt.title("Training points") - - #------------------------- - #rc('font',size=16) - #rc('font',family='serif') - #rc('axes',labelsize=16) - - - if d == 3: - [t.set_va('center') for t in ax1.get_yticklabels()] - [t.set_ha('left') for t in ax1.get_yticklabels()] - [t.set_va('center') for t in ax1.get_xticklabels()] - [t.set_ha('right') for t in ax1.get_xticklabels()] - [t.set_va('center') for t in ax1.get_zticklabels()] - [t.set_ha('left') for t in ax1.get_zticklabels()] - - ax.xaxis._axinfo['tick']['inward_factor'] = 0 - ax.xaxis._axinfo['tick']['outward_factor'] = 0.4 - ax.yaxis._axinfo['tick']['inward_factor'] = 0 - ax.yaxis._axinfo['tick']['outward_factor'] = 0.4 - ax.zaxis._axinfo['tick']['inward_factor'] = 0 - ax.zaxis._axinfo['tick']['outward_factor'] = 0.4 - ax.zaxis._axinfo['tick']['outward_factor'] = 0.4 - - ax.xaxis.set_major_locator(MultipleLocator(5)) - ax.yaxis.set_major_locator(MultipleLocator(5)) - ax.zaxis.set_major_locator(MultipleLocator(0.01)) - #Direct input - #plt.rcParams['text.latex.preamble']=[r"\usepackage{lmodern}"] - #Options - #rc('text',usetex = True) - #params = {'text.usetex' : True, - # 'font.size' : 11, - # 'font.family' : 'lmodern', - # 'text.latex.unicode': True, - # } - #plt.rcParams.update(params) - - #------------------------- - return fig, ax, current_title - -def finish(): - plt.ioff() - plt.show() - -def SVD(n_max,s): - fig = plt.figure() - plt.semilogy(list(range(1,n_max+1)),s,'ko') - ax = fig.gca() - ax.set_xlabel('$i [-]$') - ax.set_ylabel('$\sigma_i [-]$') - os.chdir('images') - #plt.savefig('SVD.png', bbox_inches = 'tight') - plt.savefig("SVD.png", - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - os.chdir('..') - -def plot2D(x,y,xlabel,ylabel,name): - fig = plt.figure() - plt.plot(x,y,'ko') - ax = fig.gca() - ax.set_xlabel(xlabel) - ax.set_ylabel(ylabel) - os.chdir('images') - #plt.savefig('SVD.png', bbox_inches = 'tight') - plt.savefig(name, - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - os.chdir('..') - - return fig, ax - -def add2D(x,y,param,name): - plt.plot(x,y,param) - os.chdir('images') - #plt.savefig('SVD.png', bbox_inches = 'tight') - plt.savefig(name, - #This is simple recomendation for publication plots - dpi=1000, - # Plot will be occupy a maximum of available space - bbox_inches='tight', - ) - os.chdir('..') diff --git a/params/src/voronoi.py b/params/src/voronoi.py deleted file mode 100644 index cee48858..00000000 --- a/params/src/voronoi.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8; -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - -from PIL import Image -import random -import math - -def generate_voronoi_diagram(width, height, num_cells): - image = Image.new("RGB", (width, height)) - putpixel = image.putpixel - imgx, imgy = image.size - nx = [] - ny = [] - nr = [] - ng = [] - nb = [] - for i in range(num_cells): - nx.append(random.randrange(imgx)) - ny.append(random.randrange(imgy)) - nr.append(random.randrange(256)) - ng.append(random.randrange(256)) - nb.append(random.randrange(256)) - for y in range(imgy): - for x in range(imgx): - dmin = math.hypot(imgx-1, imgy-1) - j = -1 - for i in range(num_cells): - d = math.hypot(nx[i]-x, ny[i]-y) - if d < dmin: - dmin = d - j = i - putpixel((x, y), (nr[j], ng[j], nb[j])) - image.save("VoronoiDiagram.png", "PNG") - image.show() - - - - -if __name__ == "__main__": - generate_voronoi_diagram(500, 500, 25) \ No newline at end of file diff --git a/params/src/write.py b/params/src/write.py deleted file mode 100755 index 9760a9c0..00000000 --- a/params/src/write.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - -import numpy as np -import time - -def init(fname): - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f = open(fname,'w') - f.write('Parametric loop\n') - f.write('Simulations started at: ' + date + ' ' + hour + '.\n') - f.write('====================================================================================\n') - - return f - -def sol(f, sol, m_max): - f.write('sol = np.array([') - for i in range(0,m_max-1): - f.write(str(sol.item(i))+', ') - f.write(str(sol.item(m_max-1))+'])\n') - -def c(f, c, n_max): - f.write('c = np.array([') - for i in range(0,n_max-1): - f.write(str(c.item(i))+', ') - f.write(str(c.item(n_max-1))+'])\n') - -def cs(f, cs, n_max): - f.write('cs = np.array([') - for i in range(0,n_max-1): - f.write(str(cs.item(i))+', ') - f.write(str(cs.item(n_max-1))+'])\n') - -def col(f, col, n_max): - f.write('-----------') - for i in range(0,n_max): - f.write(str(col.item(i))+', \n') - -def w_list(f, list1, name): - f.write(name+':\n') - for k,v in list(list1.items()): - line = '{}: {}'.format(k,v) - data = line.split() - for word in data: - f.writelines('%20s ' % word) - f.write('\n') - f.write('------------------------------------------------------------------------------------\n') - -def w_vector(f, cv, name): - f.write(name+':\n') - for i in cv: - f.write(str(i)+' ') - f.write('\n------------------------------------------------------------------------------------\n') - -def w_MPI_info(f, name, siz): - f.write('Name: ' + name +'\n') - f.write('Size: ' + str(siz) +'\n') - f.write('------------------------------------------------------------------------------------\n') - -def w_timers(f, timers): - f.write(str(timers)) - -def finish(f): - date = time.strftime("%d/%m/%Y") - hour = time.strftime("%H:%M:%S") - - f.write('====================================================================================\n') - f.write('Simulations finished at: ' + date + ' ' + hour + '.\n') - - f.close() diff --git a/params/test/leg_lim.py b/params/test/leg_lim.py deleted file mode 100755 index a0f9ed6a..00000000 --- a/params/test/leg_lim.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Copyright 2022 University of Liège -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - - - -import numpy as np -import os -import shutil - -import sys - -import matplotlib.pylab as plt - -import params.src.indices as indices - - -def main(): - d = 1 - - M = np.zeros((d,), dtype =np.int) - for j in range(0,d): - M[j] = 10 - - #-------------------------------------------------------- - N = np.zeros((d,), dtype =np.int) - for j in range(0,d): - N[j] = 10 - - #-------------------------------------------------------- - from params.src.legendre_norm import phi # monomials or legendre - import params.src.gauss as tp # just gauss - #======================================================== - - X, w = tp.grid(M) - - m_max = 1 - n_max = 1 - for j in range(0,d): - m_max = m_max*M[j] - n_max = n_max*N[j] - - i = np.zeros((d,), dtype =np.int) - i_zero = np.zeros((d,), dtype =np.int) - i_one = np.ones((d,), dtype =np.int) - p = 0 - - xi = np.zeros((d,)) - - m_i = 0 - - Z = np.zeros((m_max,n_max)) - W = np.zeros((m_max,m_max)) - - - while np.all(i != -i_one): - - for j in range(0,d): - xi[j] = X[i[j],j] - - Z[m_i,:] = np.transpose(phi(xi,N,n_max,d)) - - W[m_i,m_i] = 1 - for j in range(0,d): - W[m_i,m_i] = W[m_i,m_i]*w[i[j],j] - - p,i = indices.my_next(p,i,M,d) - m_i = m_i + 1 - text = str(m_i)+' / '+str(m_max) - sys.stdout.write("\r"+text) - sys.stdout.flush() - - sys.stdout.write("\n") - ZWZ = np.dot(np.transpose(Z),np.dot(W,Z)) - - tmp = np.abs(ZWZ-np.diag(np.diag(ZWZ))) - - print(np.amax(np.abs(tmp))) - - from fwk.wutils import parseargs - args = parseargs() - if not args.nogui: - fig = plt.figure() - ax = fig.add_subplot(1,1,1) - ax.set_aspect('equal') - plt.imshow(tmp, interpolation='nearest', cmap='Greys') - plt.colorbar() - plt.show() - - -if __name__ == "__main__": - main() diff --git a/waves/src/wTimeIntegration.cpp b/waves/src/wTimeIntegration.cpp index 44eea461..7f13762b 100644 --- a/waves/src/wTimeIntegration.cpp +++ b/waves/src/wTimeIntegration.cpp @@ -103,7 +103,7 @@ void TimeIntegration::buildS(Eigen::SparseMatrix<double, Eigen::RowMajor> &S2) std::cout << "\tprocessing " << *bnd << '\n'; std::cout << "normal=" << static_cast<Quad4 *>(bnd->tag->elems[0])->getNormal() << '\n'; tbb::parallel_for_each(bnd->tag->elems.begin(), bnd->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::QUAD4) + if (e->type() != ElType::QUAD4) return; //std::cout << "processing element #" << e->no << "\n"; @@ -159,7 +159,7 @@ void TimeIntegration::buildKM_tbb_lambda(Eigen::SparseMatrix<double, Eigen::RowM { std::cout << "\tprocessing " << *mat << '\n'; tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::HEX8) + if (e->type() != ElType::HEX8) return; //std::cout << "processing element #" << e->no << "\n"; @@ -209,7 +209,7 @@ void TimeIntegration::buildKM_tbb_lambda(Eigen::SparseMatrix<double, Eigen::RowM std::cout << "\tprocessing " << *mat << '\n'; tbb::parallel_for_each(mat->tag->elems.begin(), mat->tag->elems.end(), [&](Element *e) { - if (e->type() != ELTYPE::HEX8) + if (e->type() != ElType::HEX8) return; Eigen::MatrixXd Ae = e->build(type); -- GitLab