diff --git a/examples/BUG/AERO/ADd1c7F3Scao-50p5.npy b/examples/BUG/AERO/ADd1c7F3Scao-50p5.npy new file mode 100644 index 0000000..f4dbea8 Binary files /dev/null and b/examples/BUG/AERO/ADd1c7F3Scao-50p5.npy differ diff --git a/examples/BUG/AERO/ADd1c7F3Seao-50p5.npy b/examples/BUG/AERO/ADd1c7F3Seao-50p5.npy new file mode 100644 index 0000000..93ca826 Binary files /dev/null and b/examples/BUG/AERO/ADd1c7F3Seao-50p5.npy differ diff --git a/examples/BUG/AERO/Collocation_d1c7.npy b/examples/BUG/AERO/Collocation_d1c7.npy new file mode 100644 index 0000000..8da3c9b Binary files /dev/null and b/examples/BUG/AERO/Collocation_d1c7.npy differ diff --git a/examples/BUG/AERO/DDd1c7F3Scao-50p5.npy b/examples/BUG/AERO/DDd1c7F3Scao-50p5.npy new file mode 100644 index 0000000..b0916f7 Binary files /dev/null and b/examples/BUG/AERO/DDd1c7F3Scao-50p5.npy differ diff --git a/examples/BUG/AERO/DDd1c7F3Seao-50p5.npy b/examples/BUG/AERO/DDd1c7F3Seao-50p5.npy new file mode 100644 index 0000000..e6e4f9b Binary files /dev/null and b/examples/BUG/AERO/DDd1c7F3Seao-50p5.npy differ diff --git a/examples/BUG/AERO/Dihedral_d1c7.npy b/examples/BUG/AERO/Dihedral_d1c7.npy new file mode 100644 index 0000000..6069c22 Binary files /dev/null and b/examples/BUG/AERO/Dihedral_d1c7.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F1Scao-50p10.npy b/examples/BUG/AERO/PolesDd1c7F1Scao-50p10.npy new file mode 100644 index 0000000..f17ca63 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F1Scao-50p10.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F1Scao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F1Scao-50p5.npy new file mode 100644 index 0000000..0f9bd87 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F1Scao-50p5.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F1Seao-50p10.npy b/examples/BUG/AERO/PolesDd1c7F1Seao-50p10.npy new file mode 100644 index 0000000..f17ca63 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F1Seao-50p10.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F1Seao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F1Seao-50p5.npy new file mode 100644 index 0000000..ae8d1ef Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F1Seao-50p5.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F2Scao-50p10.npy b/examples/BUG/AERO/PolesDd1c7F2Scao-50p10.npy new file mode 100644 index 0000000..f17ca63 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F2Scao-50p10.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F2Scao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F2Scao-50p5.npy new file mode 100644 index 0000000..fcccfe1 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F2Scao-50p5.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F2Seao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F2Seao-50p5.npy new file mode 100644 index 0000000..ae8d1ef Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F2Seao-50p5.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F3Scao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F3Scao-50p5.npy new file mode 100644 index 0000000..fcccfe1 Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F3Scao-50p5.npy differ diff --git a/examples/BUG/AERO/PolesDd1c7F3Seao-50p5.npy b/examples/BUG/AERO/PolesDd1c7F3Seao-50p5.npy new file mode 100644 index 0000000..ae8d1ef Binary files /dev/null and b/examples/BUG/AERO/PolesDd1c7F3Seao-50p5.npy differ diff --git a/examples/BUG/AERO/QahDd1c7F2Scao-50.npy b/examples/BUG/AERO/QahDd1c7F2Scao-50.npy new file mode 100644 index 0000000..b9ddbe0 Binary files /dev/null and b/examples/BUG/AERO/QahDd1c7F2Scao-50.npy differ diff --git a/examples/BUG/AERO/QahDd1c7F3Scao-50.npy b/examples/BUG/AERO/QahDd1c7F3Scao-50.npy new file mode 100644 index 0000000..ebed8cb Binary files /dev/null and b/examples/BUG/AERO/QahDd1c7F3Scao-50.npy differ diff --git a/examples/BUG/AERO/QaxDd1c7F2Scao-50.npy b/examples/BUG/AERO/QaxDd1c7F2Scao-50.npy new file mode 100644 index 0000000..877ee6a Binary files /dev/null and b/examples/BUG/AERO/QaxDd1c7F2Scao-50.npy differ diff --git a/examples/BUG/AERO/QaxDd1c7F3Scao-50.npy b/examples/BUG/AERO/QaxDd1c7F3Scao-50.npy new file mode 100644 index 0000000..6775257 Binary files /dev/null and b/examples/BUG/AERO/QaxDd1c7F3Scao-50.npy differ diff --git a/examples/BUG/AERO/QhxDd1c7F2Scao-50.npy b/examples/BUG/AERO/QhxDd1c7F2Scao-50.npy new file mode 100644 index 0000000..237e80c Binary files /dev/null and b/examples/BUG/AERO/QhxDd1c7F2Scao-50.npy differ diff --git a/examples/BUG/AERO/QhxDd1c7F3Scao-50.npy b/examples/BUG/AERO/QhxDd1c7F3Scao-50.npy new file mode 100644 index 0000000..dfcc7f7 Binary files /dev/null and b/examples/BUG/AERO/QhxDd1c7F3Scao-50.npy differ diff --git a/examples/BUG/FEM/structuralGrid_ca b/examples/BUG/FEM/structuralGrid_ca new file mode 100644 index 0000000..2621270 --- /dev/null +++ b/examples/BUG/FEM/structuralGrid_ca @@ -0,0 +1,100 @@ +# VARIABLES = x y z fe_order components +16.5335 0.0 0.0 -1 FusBack +22.8143 0.0 0.0 5 FusBack +27.4511 0.0 0.0 6 FusBack +30.419 0.0 0.2989 7 FusBack +34.1749 0.0 0.6771 8 FusBack +15.6286 0.0 0.0 4 FusFront +11.4071 0.0 0.0 3 FusFront +7.6048 0.0 0.0 2 FusFront +3.8062 0.0 0.0 1 FusFront +0.0 0.0 -0.6028 0 FusFront +16.5335 1.00156 2.11455 10 RWing +16.6244 2.45678 2.10285 11 RWing +16.8062 3.36411 2.07944 12 RWing +17.079 4.7251 2.04434 13 RWing +17.2676 5.6656 2.02122 14 RWing +17.4629 6.63927 1.99839 15 RWing +17.6582 7.61294 1.97556 16 RWing +17.8535 8.58661 1.95273 17 RWing +18.0488 9.56028 1.92989 18 RWing +18.2441 10.5339 1.90706 19 RWing +18.4394 11.5076 1.88423 20 RWing +18.6347 12.4813 1.8614 21 RWing +18.83 13.455 1.83857 22 RWing +19.0253 14.4286 1.81574 23 RWing +19.2359 15.3927 1.79321 24 RWing +19.4617 16.3472 1.771 25 RWing +19.6876 17.3018 1.74878 26 RWing +19.9134 18.2563 1.72656 27 RWing +20.1393 19.2108 1.70434 28 RWing +20.3651 20.1653 1.68212 29 RWing +20.591 21.1198 1.65991 30 RWing +20.8168 22.0744 1.63769 31 RWing +21.0427 23.0289 1.61547 32 RWing +21.2685 23.9834 1.59325 33 RWing +21.4944 24.9379 1.57104 34 RWing +21.7202 25.8924 1.54882 35 RWing +16.5335 -1.00156 2.11455 59 LWing +16.6244 -2.45678 2.10285 60 LWing +16.8062 -3.36411 2.07944 61 LWing +17.079 -4.7251 2.04434 62 LWing +17.2676 -5.6656 2.02122 63 LWing +17.4629 -6.63927 1.99839 64 LWing +17.6582 -7.61294 1.97556 65 LWing +17.8535 -8.58661 1.95273 66 LWing +18.0488 -9.56028 1.92989 67 LWing +18.2441 -10.5339 1.90706 68 LWing +18.4394 -11.5076 1.88423 69 LWing +18.6347 -12.4813 1.8614 70 LWing +18.83 -13.455 1.83857 71 LWing +19.0253 -14.4286 1.81574 72 LWing +19.2359 -15.3927 1.79321 73 LWing +19.4617 -16.3472 1.771 74 LWing +19.6876 -17.3018 1.74878 75 LWing +19.9134 -18.2563 1.72656 76 LWing +20.1393 -19.2108 1.70434 77 LWing +20.3651 -20.1653 1.68212 78 LWing +20.591 -21.1198 1.65991 79 LWing +20.8168 -22.0744 1.63769 80 LWing +21.0427 -23.0289 1.61547 81 LWing +21.2685 -23.9834 1.59325 82 LWing +21.4944 -24.9379 1.57104 83 LWing +21.7202 -25.8924 1.54882 84 LWing +38.0238 0.0 1.0646 9 FusTail +34.6321 0.0 1.7946 36 VTP +35.0892 0.0 2.3205 37 VTP +35.5464 0.0 2.8464 38 VTP +36.0036 0.0 3.3723 39 VTP +36.4607 0.0 3.8982 40 VTP +36.9003 0.0 4.4039 41 VTP +37.3398 0.0 4.9095 42 VTP +37.7793 0.0 5.4151 43 VTP +38.3537 0.0 5.9207 45 HTP +38.7465 0.0 6.5277 44 VTPTail +38.3537 0.1261 5.9207 46 RHTP +38.3537 0.2522 5.9207 47 RHTP +38.5245 0.7876 5.8927 48 RHTP +38.6953 1.323 5.8646 49 RHTP +38.8661 1.8583 5.8366 50 RHTP +39.037 2.3937 5.8085 51 RHTP +39.2078 2.9291 5.7805 52 RHTP +39.3635 3.4172 5.7549 53 RHTP +39.5193 3.9053 5.7293 54 RHTP +39.675 4.3934 5.7037 55 RHTP +39.8308 4.8816 5.6781 56 RHTP +39.9865 5.3697 5.6525 57 RHTP +40.1423 5.8578 5.627 58 RHTP +38.3537 -0.1261 5.9207 85 LHTP +38.3537 -0.2522 5.9207 86 LHTP +38.5245 -0.7876 5.8927 87 LHTP +38.6953 -1.323 5.8646 88 LHTP +38.8661 -1.8583 5.8366 89 LHTP +39.037 -2.3937 5.8085 90 LHTP +39.2078 -2.9291 5.7805 91 LHTP +39.3635 -3.4172 5.7549 92 LHTP +39.5193 -3.9053 5.7293 93 LHTP +39.675 -4.3934 5.7037 94 LHTP +39.8308 -4.8816 5.6781 95 LHTP +39.9865 -5.3697 5.6525 96 LHTP +40.1423 -5.8578 5.627 97 LHTP diff --git a/examples/BUG/FEM/structuralGrid_ea b/examples/BUG/FEM/structuralGrid_ea new file mode 100644 index 0000000..47a53a7 --- /dev/null +++ b/examples/BUG/FEM/structuralGrid_ea @@ -0,0 +1,100 @@ +# VARIABLES = x y z fe_order components +16.5335 0.0 0.0 5 FusBack +22.8143 0.0 0.0 6 FusBack +27.4511 0.0 0.0 7 FusBack +30.419 0.0 0.2989 8 FusBack +34.1749 0.0 0.6771 9 FusBack +15.6286 0.0 0.0 4 FusFront +11.4071 0.0 0.0 3 FusFront +7.6048 0.0 0.0 2 FusFront +3.8062 0.0 0.0 1 FusFront +0.0 0.0 -0.6028 0 FusFront +16.5335 1.00156 2.11455 11 RWing +16.6244 2.45678 2.10285 12 RWing +16.8062 3.36411 2.07944 13 RWing +17.079 4.7251 2.04434 14 RWing +17.2676 5.6656 2.02122 15 RWing +17.4629 6.63927 1.99839 16 RWing +17.6582 7.61294 1.97556 17 RWing +17.8535 8.58661 1.95273 18 RWing +18.0488 9.56028 1.92989 19 RWing +18.2441 10.5339 1.90706 20 RWing +18.4394 11.5076 1.88423 21 RWing +18.6347 12.4813 1.8614 22 RWing +18.83 13.455 1.83857 23 RWing +19.0253 14.4286 1.81574 24 RWing +19.2359 15.3927 1.79321 25 RWing +19.4617 16.3472 1.771 26 RWing +19.6876 17.3018 1.74878 27 RWing +19.9134 18.2563 1.72656 28 RWing +20.1393 19.2108 1.70434 29 RWing +20.3651 20.1653 1.68212 30 RWing +20.591 21.1198 1.65991 31 RWing +20.8168 22.0744 1.63769 32 RWing +21.0427 23.0289 1.61547 33 RWing +21.2685 23.9834 1.59325 34 RWing +21.4944 24.9379 1.57104 35 RWing +21.7202 25.8924 1.54882 36 RWing +16.5335 -1.00156 2.11455 60 LWing +16.6244 -2.45678 2.10285 61 LWing +16.8062 -3.36411 2.07944 62 LWing +17.079 -4.7251 2.04434 63 LWing +17.2676 -5.6656 2.02122 64 LWing +17.4629 -6.63927 1.99839 65 LWing +17.6582 -7.61294 1.97556 66 LWing +17.8535 -8.58661 1.95273 67 LWing +18.0488 -9.56028 1.92989 68 LWing +18.2441 -10.5339 1.90706 69 LWing +18.4394 -11.5076 1.88423 70 LWing +18.6347 -12.4813 1.8614 71 LWing +18.83 -13.455 1.83857 72 LWing +19.0253 -14.4286 1.81574 73 LWing +19.2359 -15.3927 1.79321 74 LWing +19.4617 -16.3472 1.771 75 LWing +19.6876 -17.3018 1.74878 76 LWing +19.9134 -18.2563 1.72656 77 LWing +20.1393 -19.2108 1.70434 78 LWing +20.3651 -20.1653 1.68212 79 LWing +20.591 -21.1198 1.65991 80 LWing +20.8168 -22.0744 1.63769 81 LWing +21.0427 -23.0289 1.61547 82 LWing +21.2685 -23.9834 1.59325 83 LWing +21.4944 -24.9379 1.57104 84 LWing +21.7202 -25.8924 1.54882 85 LWing +38.0238 0.0 1.0646 10 FusTail +34.6321 0.0 1.7946 37 VTP +35.0892 0.0 2.3205 38 VTP +35.5464 0.0 2.8464 39 VTP +36.0036 0.0 3.3723 40 VTP +36.4607 0.0 3.8982 41 VTP +36.9003 0.0 4.4039 42 VTP +37.3398 0.0 4.9095 43 VTP +37.7793 0.0 5.4151 44 VTP +38.3537 0.0 5.9207 46 HTP +38.7465 0.0 6.5277 45 VTPTail +38.3537 0.1261 5.9207 47 RHTP +38.3537 0.2522 5.9207 48 RHTP +38.5245 0.7876 5.8927 49 RHTP +38.6953 1.323 5.8646 50 RHTP +38.8661 1.8583 5.8366 51 RHTP +39.037 2.3937 5.8085 52 RHTP +39.2078 2.9291 5.7805 53 RHTP +39.3635 3.4172 5.7549 54 RHTP +39.5193 3.9053 5.7293 55 RHTP +39.675 4.3934 5.7037 56 RHTP +39.8308 4.8816 5.6781 57 RHTP +39.9865 5.3697 5.6525 58 RHTP +40.1423 5.8578 5.627 59 RHTP +38.3537 -0.1261 5.9207 86 LHTP +38.3537 -0.2522 5.9207 87 LHTP +38.5245 -0.7876 5.8927 88 LHTP +38.6953 -1.323 5.8646 89 LHTP +38.8661 -1.8583 5.8366 90 LHTP +39.037 -2.3937 5.8085 91 LHTP +39.2078 -2.9291 5.7805 92 LHTP +39.3635 -3.4172 5.7549 93 LHTP +39.5193 -3.9053 5.7293 94 LHTP +39.675 -4.3934 5.7037 95 LHTP +39.8308 -4.8816 5.6781 96 LHTP +39.9865 -5.3697 5.6525 97 LHTP +40.1423 -5.8578 5.627 98 LHTP diff --git a/examples/BUG/settings_DiscreteLoads.py b/examples/BUG/settings_DiscreteLoads.py new file mode 100644 index 0000000..7992b10 --- /dev/null +++ b/examples/BUG/settings_DiscreteLoads.py @@ -0,0 +1,123 @@ +# [[file:modelgeneration.org::DiscreteLoads][DiscreteLoads]] +import pathlib +import time +#import jax.numpy as jnp +import numpy as np +from feniax.preprocessor.inputs import Inputs +import feniax.feniax_shardmain +sol = "cao" +num_modes = 300 +inp = Inputs() +inp.engine = "intrinsicmodal" +inp.fem.eig_type = "inputs" + +inp.fem.connectivity = dict(# FusWing=['RWing', + # 'LWing'], + FusBack=['FusTail', + 'VTP'], + FusFront=None, + RWing=None, + LWing=None, + FusTail=None, + VTP=['HTP', 'VTPTail'], + HTP=['RHTP', 'LHTP'], + VTPTail=None, + RHTP=None, + LHTP=None, + ) +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes +inp.driver.typeof = "intrinsic" +inp.driver.sol_path = pathlib.Path( + "./results/DiscreteLoads1") + +inp.simulation.typeof = "single" +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, + atol=1e-6, + max_steps=100, + norm="linalg_norm", + kappa=0.01) +inp.system.xloads.follower_forces = True +inp.system.xloads.x = [0, 1, 2, 3, 4, 5] +inp.system.t = [0.5, 1, 1.5, 2, 2.5, 3, 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5.] +lz1 = 5e4 * 0.5 +lz2 = 9e4 * 0.5 +lz3 = 2e5 * 0.5 +lz4 = 4e5 * 0.5 +lz5 = 5e5 * 0.5 +lx1 = lz1 * 5 +lx2 = lz2 * 5 +lx3 = lz3 * 5 +lx4 = lz4 * 5 +lx5 = lz5 * 5 +ly1 = lz1 * 7 +ly2 = lz2 * 7 +ly3 = lz3 * 7 +ly4 = lz4 * 7 +ly5 = lz5 * 7 + +# rwing: 14-35 +# lwing: 40-61 + # [[[node_i, component_j]..(total_forces per run)],...(parallel forces)[[node_i, component_j]..]] +inputforces = dict(follower_points=[[[35, 0], [61, 0], [35, 1], [61, 1]], + [[35, 1], [61, 1], [35, 0], [61, 0]], + [[35, 2], [61, 2], [35, 0], [61, 0]], + [[35, 3], [61, 3], [35, 0], [61, 0]], + [[35, 4], [61, 4], [35, 0], [61, 0]], + [[35, 5], [61, 5], [35, 0], [61, 0]], + [[35, 0], [61, 0], [35, 4], [61, 4]], + [[35, 2], [61, 2], [35, 4], [61, 4]], + ], + # [[[0,...interpolation points]..(total_forces per run)],...(parallel forces)[[0,...]..]] + follower_interpolation= [[[0., lx1, lx2, lx3, lx4, lx5], + [0., lx1, lx2, lx3, lx4, lx5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., ly1, ly2, ly3, ly4, ly5], + [0., ly1, ly2, ly3, ly4, ly5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., lz1, lz2, lz3, lz4, lz5], + [0., lz1, lz2, lz3, lz4, lz5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., lz1, lz2, lz3, lz4, lz5], + [0., lz1, lz2, lz3, lz4, lz5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., lx1, lx2, lx3, lx4, lx5], + [0., lx1, lx2, lx3, lx4, lx5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., lx1, lx2, lx3, lx4, lx5], + [0., lx1, lx2, lx3, lx4, lx5], + [0., 0., 0., 0., 0., 0.], + [0., 0., 0., 0., 0., 0.]], + [[0., lz1, lz2, lz3, lz4, lz5], + [0., lz1, lz2, lz3, lz4, lz5], + [0., lx1, lx2, lx3, lx4, lx5], + [0., lx1, lx2, lx3, lx4, lx5] + ], + [[0., lz1, lz2, lz3, lz4, lz5], + [0., lz1, lz2, lz3, lz4, lz5], + [0., lx1, lx2, lx3, lx4, lx5], + [0., lx1, lx2, lx3, lx4, lx5]] + ] + ) +inp.system.shard = dict(input_type="pointforces", + inputs=inputforces) +t1 = time.time() +sol = feniax.feniax_shardmain.main(input_dict=inp, device_count=8) +t2 = time.time() +print(f"Time DiscreteLoads: {t2 - t1}") +# DiscreteLoads ends here diff --git a/examples/BUG/settings_DiscreteLoadsMC.py b/examples/BUG/settings_DiscreteLoadsMC.py new file mode 100644 index 0000000..5785d6a --- /dev/null +++ b/examples/BUG/settings_DiscreteLoadsMC.py @@ -0,0 +1,324 @@ +# [[file:modelgeneration.org::*High loading][High loading:1]] +import pathlib +import time +#import jax.numpy as jnp +import numpy as np +from feniax.preprocessor.inputs import Inputs +import feniax.feniax_shardmain +sol = "cao" +num_modes = 100 +inp = Inputs() +inp.engine = "intrinsicmodal" +inp.fem.eig_type = "inputs" + +inp.fem.connectivity = dict(# FusWing=['RWing', + # 'LWing'], + FusBack=['FusTail', + 'VTP'], + FusFront=None, + RWing=None, + LWing=None, + FusTail=None, + VTP=['HTP', 'VTPTail'], + HTP=['RHTP', 'LHTP'], + VTPTail=None, + RHTP=None, + LHTP=None, + ) +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes +inp.driver.typeof = "intrinsic" +inp.driver.sol_path = pathlib.Path( + f"./results/DiscreteMC1high{num_modes}") + +inp.simulation.typeof = "single" +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, + atol=1e-6, + max_steps=50, + norm="linalg_norm", + kappa=0.01) +inp.system.xloads.follower_forces = True +inp.system.xloads.x = [0, 1, 2, 3, 4, 5] +inp.system.t = [1, 2, 3, 4, 5] +# rwing: 14-35 +# lwing: 40-61 +points = [] +interpolation = [] +_interpolation = [0., 3.e3, 7e3, 9e3, 1e4, 1.5e4] # 1.5e4, 2e4..4e4] #[0., 0., 0., 0.] +_interpolation_torsion = [i*2 for i in _interpolation] #[0., 4e3, 1e4, 2e4, 4e4, 5e4] +for ri,li in zip(range(14, 36),range(40,62)): + points.append([ri, 2]) + points.append([ri, 4]) + points.append([li, 2]) + points.append([li, 4]) +for i, _ in enumerate(range(len(points))): + + if i % 2 == 0: + interpolation.append(_interpolation) + else: + interpolation.append(_interpolation_torsion) + +interpolation = np.array(interpolation) # num_pointforces x num_interpolation +paths = 8*200 +sigma0 = 0.15 # percentage of mu for sigma +mu = _interpolation[-1] +sigma = (sigma0) * _interpolation[-1] +rand = np.random.normal(mu, sigma, paths) +mu_torsion = _interpolation_torsion[-1] +sigma_torsion = (sigma0) * _interpolation_torsion[-1] +rand_torsion = np.random.normal(mu_torsion, sigma_torsion, paths) +follower_interpolation = [] +for i, ri in enumerate(rand): + interpolationrand = np.copy(interpolation) + interpolationrand[::2, -1] = ri + interpolationrand[1::2, -1] = rand_torsion[i] + follower_interpolation.append(interpolationrand) +#follower_interpolation = [interpolation * ri for ri in rand] +follower_points = [points]*paths +inputforces = dict(follower_points=follower_points, + follower_interpolation=follower_interpolation + ) +inp.system.shard = dict(input_type="pointforces", + inputs=inputforces) + +t1 = time.time() +sol1 = feniax.feniax_shardmain.main(input_dict=inp, device_count=8) +t2 = time.time() +print(f"Time DiscreteLoads MC: {t2 - t1}") + +# np.mean(sol.staticsystem_sys1.ra[:,-1,2,35]) +# np.std(sol.staticsystem_sys1.ra[:,-1,2,35]) +# High loading:1 ends here + +# [[file:modelgeneration.org::*Small loading][Small loading:1]] +import pathlib +import time +#import jax.numpy as jnp +import numpy as np +from feniax.preprocessor.inputs import Inputs +import feniax.feniax_shardmain +sol = "cao" +num_modes = 50 +inp = Inputs() +inp.engine = "intrinsicmodal" +inp.fem.eig_type = "inputs" + +inp.fem.connectivity = dict(# FusWing=['RWing', + # 'LWing'], + FusBack=['FusTail', + 'VTP'], + FusFront=None, + RWing=None, + LWing=None, + FusTail=None, + VTP=['HTP', 'VTPTail'], + HTP=['RHTP', 'LHTP'], + VTPTail=None, + RHTP=None, + LHTP=None, + ) +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes +inp.driver.typeof = "intrinsic" +inp.driver.sol_path = pathlib.Path( + "./results/DiscreteMC1small") + +inp.simulation.typeof = "single" +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, + atol=1e-6, + max_steps=50, + norm="linalg_norm", + kappa=0.01) +inp.system.xloads.follower_forces = True +inp.system.xloads.x = [0, 1, 2, 3, 4, 5] +inp.system.t = [1, 2, 3, 4, 5] +# rwing: 14-35 +# lwing: 40-61 +points = [] +interpolation = [] +_interpolationsmall = [i*1e-2 for i in _interpolation] +_interpolationsmall_torsion = [i*1e-2 for i in _interpolation_torsion] +for ri,li in zip(range(14, 36),range(40,62)): + points.append([ri, 2]) + points.append([ri, 4]) + points.append([li, 2]) + points.append([li, 4]) +for i, _ in enumerate(range(len(points))): + + if i % 2 == 0: + interpolation.append(_interpolationsmall) + else: + interpolation.append(_interpolationsmall_torsion) + +interpolation = np.array(interpolation) # num_pointforces x num_interpolation +paths = 8*10 +sigma0 = 0.15 # percentage of mu for sigma +mu = _interpolationsmall[-1] +sigma = (sigma0) * _interpolationsmall[-1] +rand = np.random.normal(mu, sigma, paths) +mu_torsion = _interpolationsmall_torsion[-1] +sigma_torsion = (sigma0) * _interpolationsmall_torsion[-1] +rand_torsion = np.random.normal(mu_torsion, sigma_torsion, paths) +follower_interpolation = [] +for i, ri in enumerate(rand): + interpolationrand = np.copy(interpolation) + interpolationrand[::2, -1] = ri + interpolationrand[1::2, -1] = rand_torsion[i] + follower_interpolation.append(interpolationrand) +#follower_interpolation = [interpolation * ri for ri in rand] +follower_points = [points]*paths +inputforces = dict(follower_points=follower_points, + follower_interpolation=follower_interpolation + ) +inp.system.shard = dict(input_type="pointforces", + inputs=inputforces) + +sol2 = feniax.feniax_shardmain.main(input_dict=inp, device_count=8) +# np.mean(sol.staticsystem_sys1.ra[:,-1,2,35]) +# np.std(sol.staticsystem_sys1.ra[:,-1,2,35]) +# Small loading:1 ends here + +# [[file:modelgeneration.org::*Very Small loading][Very Small loading:1]] +import pathlib +import time +#import jax.numpy as jnp +import numpy as np +from feniax.preprocessor.inputs import Inputs +import feniax.feniax_shardmain +sol = "cao" +num_modes = 50 +inp = Inputs() +inp.engine = "intrinsicmodal" +inp.fem.eig_type = "inputs" + +inp.fem.connectivity = dict(# FusWing=['RWing', + # 'LWing'], + FusBack=['FusTail', + 'VTP'], + FusFront=None, + RWing=None, + LWing=None, + FusTail=None, + VTP=['HTP', 'VTPTail'], + HTP=['RHTP', 'LHTP'], + VTPTail=None, + RHTP=None, + LHTP=None, + ) +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes +inp.driver.typeof = "intrinsic" +inp.driver.sol_path = pathlib.Path( + "./results/DiscreteMC1verysmall") + +inp.simulation.typeof = "single" +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, + atol=1e-6, + max_steps=50, + norm="linalg_norm", + kappa=0.01) +inp.system.xloads.follower_forces = True +inp.system.xloads.x = [0, 1, 2, 3, 4, 5] +inp.system.t = [1, 2, 3, 4, 5] +# rwing: 14-35 +# lwing: 40-61 +points = [] +interpolation = [] +_interpolationverysmall = [i*1e-3 for i in _interpolation] +_interpolationverysmall_torsion = [i*1e-3 for i in _interpolation_torsion] + +for ri,li in zip(range(14, 36),range(40,62)): + points.append([ri, 2]) + points.append([ri, 4]) + points.append([li, 2]) + points.append([li, 4]) +for i, _ in enumerate(range(len(points))): + + if i % 2 == 0: + interpolation.append(_interpolationverysmall) + else: + interpolation.append(_interpolationverysmall_torsion) + +interpolation = np.array(interpolation) # num_pointforces x num_interpolationverysmall +paths = 8*10 +sigma0 = 0.15 # percentage of mu for sigma +mu = _interpolationverysmall[-1] +sigma = (sigma0) * _interpolationverysmall[-1] +rand = np.random.normal(mu, sigma, paths) +mu_torsion = _interpolationverysmall_torsion[-1] +sigma_torsion = (sigma0) * _interpolationverysmall_torsion[-1] +rand_torsion = np.random.normal(mu_torsion, sigma_torsion, paths) +follower_interpolation = [] +for i, ri in enumerate(rand): + interpolationrand = np.copy(interpolation) + interpolationrand[::2, -1] = ri + interpolationrand[1::2, -1] = rand_torsion[i] + follower_interpolation.append(interpolationrand) +#follower_interpolation = [interpolation * ri for ri in rand] +follower_points = [points]*paths +inputforces = dict(follower_points=follower_points, + follower_interpolation=follower_interpolation + ) +inp.system.shard = dict(input_type="pointforces", + inputs=inputforces) + +sol3 = feniax.feniax_shardmain.main(input_dict=inp, device_count=8) +# np.mean(sol.staticsystem_sys1.ra[:,-1,2,35]) +# np.std(sol.staticsystem_sys1.ra[:,-1,2,35]) +# Very Small loading:1 ends here + +# [[file:modelgeneration.org::*Statistics][Statistics:1]] +u_mean = np.mean(sol1.staticsystem_sys1.ra[:,-1,2,35] - config.fem.X[35,2]) +u_std = np.std(sol1.staticsystem_sys1.ra[:,-1,2,35]) + +print(f"Mean displacement node 35: {u_mean}") +print(f"std displacement node 35: {u_std}") +print(f"Ratio displacement node 35: {u_mean/u_std}") +print("***************") + +u_mean2 = np.mean(sol2.staticsystem_sys1.ra[:,-1,2,35] - config.fem.X[35,2]) +u_std2 = np.std(sol2.staticsystem_sys1.ra[:,-1,2,35]) + +print(f"Mean displacement node 35: {u_mean2}") +print(f"std displacement node 35: {u_std2}") +print(f"ratio displacement node 35: {u_mean2/u_std2}") +print("***************") + +u_mean3 = np.mean(sol3.staticsystem_sys1.ra[:,-1,2,35] - config.fem.X[35,2]) +u_std3 = np.std(sol3.staticsystem_sys1.ra[:,-1,2,35]) + +print(f"Mean displacement node 35: {u_mean3}") +print(f"std displacement node 35: {u_std3}") +print(f"ratio displacement node 35: {u_mean3/u_std3}") +print("***************") +# Statistics:1 ends here diff --git a/examples/BUG/settings_gust1.py b/examples/BUG/settings_gust1.py index 957deab..7d2c227 100644 --- a/examples/BUG/settings_gust1.py +++ b/examples/BUG/settings_gust1.py @@ -1,16 +1,23 @@ # [[file:modelgeneration.org::*Run][Run:1]] import pathlib +import time import jax.numpy as jnp +import numpy as np import feniax.preprocessor.configuration as configuration # import Config, dump_to_yaml from feniax.preprocessor.inputs import Inputs import feniax.feniax_main - -label_gaf = "Dd1c7F1Scao-50" +import feniax.plotools.reconstruction as reconstruction +label_dlm = "d1c7" +sol = "cao" +label_gaf = "Dd1c7F3Scao-50" +num_modes = 50 +c_ref = 3.0 +u_inf = 209.62786434059765 +rho_inf = 0.41275511341689247 num_poles = 5 Dhj_file = f"D{label_gaf}p{num_poles}" Ahh_file = f"A{label_gaf}p{num_poles}" Poles_file = f"Poles{label_gaf}p{num_poles}" - inp = Inputs() inp.engine = "intrinsicmodal" inp.fem.eig_type = "inputs" @@ -29,42 +36,43 @@ RHTP=None, LHTP=None, ) - -inp.fem.grid = "structuralGridclamped" -inp.fem.folder = pathlib.Path('./FEM/') -inp.fem.eig_names = ["eigenvals_50.npy", "eigenvecs_50.npy"] -inp.fem.num_modes = 50 +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes inp.driver.typeof = "intrinsic" - -#inp.driver.sol_path = pathlib.Path( -# f"./results_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}") -inp.driver.sol_path = pathlib.Path( - "./resultsgust3") inp.simulation.typeof = "single" inp.system.name = "s1" +if sol[0] == "e": # free model, otherwise clamped + inp.system.bc1 = 'free' + inp.system.q0treatment = 1 inp.system.solution = "dynamic" -inp.system.t1 = 2.5 -inp.system.tn = 2001 +inp.system.t1 = 2 +inp.system.tn = 2501 inp.system.solver_library = "runge_kutta" inp.system.solver_function = "ode" inp.system.solver_settings = dict(solver_name="rk4") inp.system.xloads.modalaero_forces = True -inp.system.q0treatment = 2 -inp.system.aero.c_ref = 3.0 -inp.system.aero.u_inf = 180. -inp.system.aero.rho_inf = 1. +inp.system.aero.c_ref = c_ref +inp.system.aero.u_inf = u_inf +inp.system.aero.rho_inf = rho_inf inp.system.aero.poles = f"./AERO/{Poles_file}.npy" inp.system.aero.A = f"./AERO/{Ahh_file}.npy" inp.system.aero.D = f"./AERO/{Dhj_file}.npy" inp.system.aero.gust_profile = "mc" -inp.system.aero.gust.intensity = 0.2 # 14.0732311562*0.001 -inp.system.aero.gust.length = 67 -inp.system.aero.gust.step = 0.5 +inp.system.aero.gust.intensity = 20 +inp.system.aero.gust.length = 150. +inp.system.aero.gust.step = 0.1 inp.system.aero.gust.shift = 0. -inp.system.aero.gust.panels_dihedral = jnp.load("./AERO/Dihedral_d1c7.npy") -inp.system.aero.gust.collocation_points = "./AERO/Collocation_d1c7.npy" +inp.system.aero.gust.panels_dihedral = f"./AERO/Dihedral_{label_dlm}.npy" +inp.system.aero.gust.collocation_points = f"./AERO/Collocation_{label_dlm}.npy" +inp.driver.sol_path = pathlib.Path( + f"./results/gust2_{sol}") config = configuration.Config(inp) sol1 = feniax.feniax_main.main(input_obj=config) - # Run:1 ends here diff --git a/examples/BUG/settings_gust1shard.py b/examples/BUG/settings_gust1shard.py index 5dc0b53..40fb6c7 100644 --- a/examples/BUG/settings_gust1shard.py +++ b/examples/BUG/settings_gust1shard.py @@ -1,15 +1,21 @@ -# [[file:modelgeneration.org::*Run][Run:1]] +# [[file:modelgeneration.org::*Gust][Gust:2]] import pathlib +import time #import jax.numpy as jnp +import numpy as np from feniax.preprocessor.inputs import Inputs import feniax.feniax_shardmain - -label_gaf = "Dd1c7F1Scao-50" +label_dlm = "d1c7" +sol = "cao" +label_gaf = "Dd1c7F3Scao-50" +num_modes = 50 +c_ref = 3.0 +u_inf = 209.62786434059765 +rho_inf = 0.41275511341689247 num_poles = 5 Dhj_file = f"D{label_gaf}p{num_poles}" Ahh_file = f"A{label_gaf}p{num_poles}" Poles_file = f"Poles{label_gaf}p{num_poles}" - inp = Inputs() inp.engine = "intrinsicmodal" inp.fem.eig_type = "inputs" @@ -28,87 +34,52 @@ RHTP=None, LHTP=None, ) - -inp.fem.grid = "structuralGridclamped" -inp.fem.folder = pathlib.Path('./FEM/') -inp.fem.eig_names = ["eigenvals_50.npy", "eigenvecs_50.npy"] -inp.fem.num_modes = 50 +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes inp.driver.typeof = "intrinsic" - -#inp.driver.sol_path = pathlib.Path( -# f"./results_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}") -inp.driver.sol_path = pathlib.Path( - "./results_shardgust1") inp.simulation.typeof = "single" inp.system.name = "s1" +if sol[0] == "e": # free model, otherwise clamped + inp.system.bc1 = 'free' + inp.system.q0treatment = 1 inp.system.solution = "dynamic" -inp.system.t1 = 2.5 -inp.system.tn = 2001 +inp.system.t1 = 2 +inp.system.tn = 2501 inp.system.solver_library = "runge_kutta" inp.system.solver_function = "ode" inp.system.solver_settings = dict(solver_name="rk4") inp.system.xloads.modalaero_forces = True -inp.system.q0treatment = 2 -inp.system.aero.c_ref = 3.0 -inp.system.aero.u_inf = 180. -inp.system.aero.rho_inf = 1. +inp.system.aero.c_ref = c_ref +inp.system.aero.u_inf = u_inf +inp.system.aero.rho_inf = rho_inf inp.system.aero.poles = f"./AERO/{Poles_file}.npy" inp.system.aero.A = f"./AERO/{Ahh_file}.npy" inp.system.aero.D = f"./AERO/{Dhj_file}.npy" inp.system.aero.gust_profile = "mc" -#inp.system.aero.gust.intensity = 14.0732311562*0.001 -inp.system.aero.gust.fixed_discretisation = [50, 180] -#inp.system.aero.gust.length = 67. -inp.system.aero.gust.step = 0.5 +inp.system.aero.gust.intensity = 20 +inp.system.aero.gust.length = 150. +inp.system.aero.gust.step = 0.1 inp.system.aero.gust.shift = 0. -inp.system.aero.gust.panels_dihedral = "./AERO/Dihedral_d1c7.npy" -inp.system.aero.gust.collocation_points = "./AERO/Collocation_d1c7.npy" +inp.system.aero.gust.panels_dihedral = f"./AERO/Dihedral_{label_dlm}.npy" +inp.system.aero.gust.collocation_points = f"./AERO/Collocation_{label_dlm}.npy" - -inputflow = dict(length=[30,67], - intensity= [0.01,0.08, 0.2, 0.7], - #u_inf = [inp.system.aero.u_inf], - # rho_inf = [inp.system.aero.rho_inf] - ) +inp.driver.sol_path = pathlib.Path( + f"./results/gust2_{sol}Shard") +inp.system.aero.gust.fixed_discretisation = [150, u_inf] +# Shard inputs +inputflow = dict(length=np.linspace(25,265,13), + intensity=np.linspace(0.1, 3, 11), + rho_inf = np.linspace(0.34,0.48,8) + ) inp.system.shard = dict(input_type="gust1", - inputs=inputflow) - -sol = feniax.feniax_shardmain.main(input_dict=inp, device_count=8) - -# import jax -# import jax.numpy as jnp -# from functools import partial -# @partial(jax.jit, static_argnames=["a","d"]) -# def r(a,d): -# amin = min(a) -# amax = max(a) -# out = jnp.arange(amin,amax,d) -# return out - - -# import jax -# import jax.numpy as jnp -# from jax import lax - -# def compute_range_params(start, stop, step): -# # Compute range parameters outside the jitted function -# num_elements = (stop - start + step - 1) // step -# return num_elements - -# @jax.jit -# def dynamic_range_fn(start, step, num_elements): -# # Convert num_elements to a static integer -# num_elements = lax.convert_element_type(num_elements, jnp.int32) - -# # Use lax.iota to create a range -# return start + lax.iota(jnp.int32, num_elements) * step - -# # Example usage with precomputed num_elements -# start = 0 -# stop = 10 -# step = 2 -# num_elements = compute_range_params(start, stop, step) -# result = dynamic_range_fn(start, step, num_elements) -# print(result) - + inputs=inputflow) +num_gpus = 8 +solgust21shard = feniax.feniax_shardmain.main(input_dict=inp, device_count=num_gpus) +# Gust:2 ends here diff --git a/examples/BUG/settings_manoeuvre.py b/examples/BUG/settings_manoeuvre1.py similarity index 51% rename from examples/BUG/settings_manoeuvre.py rename to examples/BUG/settings_manoeuvre1.py index d9dadec..0657680 100644 --- a/examples/BUG/settings_manoeuvre.py +++ b/examples/BUG/settings_manoeuvre1.py @@ -1,17 +1,23 @@ # [[file:modelgeneration.org::*Run][Run:1]] import pathlib +import time import jax.numpy as jnp +import numpy as np import feniax.preprocessor.configuration as configuration # import Config, dump_to_yaml from feniax.preprocessor.inputs import Inputs import feniax.feniax_main import feniax.plotools.reconstruction as reconstruction - -label_gaf = "Dd1c7F1Scao-50" +label_dlm = "d1c7" +sol = "cao" +label_gaf = "Dd1c7F3Scao-50" +num_modes = 50 +c_ref = 3.0 +u_inf = 209.62786434059765 +rho_inf = 0.41275511341689247 num_poles = 5 Dhj_file = f"D{label_gaf}p{num_poles}" Ahh_file = f"A{label_gaf}p{num_poles}" Poles_file = f"Poles{label_gaf}p{num_poles}" - inp = Inputs() inp.engine = "intrinsicmodal" inp.fem.eig_type = "inputs" @@ -30,54 +36,56 @@ RHTP=None, LHTP=None, ) - -inp.fem.folder = pathlib.Path('./FEM/') -inp.fem.eig_names = ["eigenvals_50.npy", "eigenvecs_50.npy"] -inp.fem.num_modes = 50 +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes inp.driver.typeof = "intrinsic" - -#inp.driver.sol_path = pathlib.Path( -# f"./results_{datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')}") -inp.driver.sol_path = pathlib.Path( - "./results1manoeuvre") inp.simulation.typeof = "single" -inp.systems.sett.s1.solution = "static" -inp.systems.sett.s1.solver_library = "diffrax" -inp.systems.sett.s1.solver_function = "newton" -inp.systems.sett.s1.solver_settings = dict(rtol=1e-6, +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, atol=1e-6, max_steps=100, norm="linalg_norm", kappa=0.01) -inp.systems.sett.s1.xloads.modalaero_forces = True -inp.systems.sett.s1.xloads.x = [0.,1.] -inp.systems.sett.s1.t = [0.25, 0.5, 0.75, 1] -inp.systems.sett.s1.aero.c_ref = 3.0 -inp.systems.sett.s1.aero.u_inf = 170. -inp.systems.sett.s1.aero.rho_inf = 0.778 -inp.systems.sett.s1.aero.poles = f"./AERO/{Poles_file}.npy" -inp.systems.sett.s1.aero.A = f"./AERO/{Ahh_file}.npy" -inp.systems.sett.s1.aero.Q0_rigid = f"./AERO/Qhx{label_gaf}.npy" -inp.systems.sett.s1.aero.qalpha = jnp.array(([0., 0., 0, 0, 0, 0], - [0., 6 * jnp.pi / 180, 0, 0, 0, 0])) - - +inp.system.xloads.modalaero_forces = True +inp.system.xloads.x = [0.,1.] +inp.system.t = [1/3, 2/3, 1]#[0.25, 0.5, 0.75, 1] +inp.system.aero.c_ref = c_ref +inp.system.aero.u_inf = u_inf # a0(7000) =312 +inp.system.aero.rho_inf = rho_inf +inp.system.aero.poles = f"./AERO/{Poles_file}.npy" +inp.system.aero.A = f"./AERO/{Ahh_file}.npy" +inp.system.aero.Q0_rigid = f"./AERO/Qhx{label_gaf}.npy" +inp.system.aero.qalpha = [[0., 0., 0, 0, 0, 0], + [0., 6 * np.pi / 180, 0, 0, 0, 0]] # interpolation: x=0 => qalpha=0 + # x=1 => qalpha = 4 +inp.driver.sol_path = pathlib.Path( + "./results/manoeuvre2") config = configuration.Config(inp) solstatic1 = feniax.feniax_main.main(input_obj=config) # Run:1 ends here -plot3D= False -if plot3D: - reconstruction.rbf_based( + +# [[file:modelgeneration.org::3Dstatic][3Dstatic]] +rintrinsic, uintrinsic = reconstruction.rbf_based( nastran_bdf="./NASTRAN/BUG103.bdf", X=config.fem.X, - time=range(len(inp.systems.sett.s1.t)), - ra=solstatic1.staticsystem_s1.ra, - Rab=solstatic1.staticsystem_s1.Cab, + time=range(len(inp.system.t)), + ra=solstatic1.staticsystem_sys1.ra, + Rab=solstatic1.staticsystem_sys1.Cab, R0ab=solstatic1.modes.C0ab, - vtkpath="./paraview/solstatic1", + vtkpath=inp.driver.sol_path / "paraview/solstatic1/bug", plot_timeinterval=1, - plot_ref=True, + plot_ref=False, tolerance=1e-3, size_cards=8, rbe3s_full=False, ra_movie=None) +# 3Dstatic ends here diff --git a/examples/BUG/settings_manoeuvre1shard.py b/examples/BUG/settings_manoeuvre1shard.py new file mode 100644 index 0000000..22037bf --- /dev/null +++ b/examples/BUG/settings_manoeuvre1shard.py @@ -0,0 +1,78 @@ +# [[file:modelgeneration.org::*Manoeuvre][Manoeuvre:1]] +import pathlib +import time +#import jax.numpy as jnp +import numpy as np +from feniax.preprocessor.inputs import Inputs +import feniax.feniax_shardmain +label_dlm = "d1c7" +sol = "cao" +label_gaf = "Dd1c7F3Scao-50" +num_modes = 50 +c_ref = 3.0 +u_inf = 209.62786434059765 +rho_inf = 0.41275511341689247 +num_poles = 5 +Dhj_file = f"D{label_gaf}p{num_poles}" +Ahh_file = f"A{label_gaf}p{num_poles}" +Poles_file = f"Poles{label_gaf}p{num_poles}" +inp = Inputs() +inp.engine = "intrinsicmodal" +inp.fem.eig_type = "inputs" + +inp.fem.connectivity = dict(# FusWing=['RWing', + # 'LWing'], + FusBack=['FusTail', + 'VTP'], + FusFront=None, + RWing=None, + LWing=None, + FusTail=None, + VTP=['HTP', 'VTPTail'], + HTP=['RHTP', 'LHTP'], + VTPTail=None, + RHTP=None, + LHTP=None, + ) +inp.fem.grid = f"./FEM/structuralGrid_{sol[:-1]}" +#inp.fem.folder = pathlib.Path('./FEM/') +inp.fem.Ka_name = f"./FEM/Ka_{sol[:-1]}.npy" +inp.fem.Ma_name = f"./FEM/Ma_{sol[:-1]}.npy" +inp.fem.eig_names = [f"./FEM/eigenvals_{sol}{num_modes}.npy", + f"./FEM/eigenvecs_{sol}{num_modes}.npy"] +inp.driver.typeof = "intrinsic" +inp.fem.num_modes = num_modes +inp.driver.typeof = "intrinsic" +inp.simulation.typeof = "single" +inp.system.name = "s1" +inp.system.solution = "static" +inp.system.solver_library = "diffrax" +inp.system.solver_function = "newton" +inp.system.solver_settings = dict(rtol=1e-6, + atol=1e-6, + max_steps=100, + norm="linalg_norm", + kappa=0.01) +inp.system.xloads.modalaero_forces = True +inp.system.xloads.x = [0.,1.] +inp.system.t = [1/3, 2/3, 1]#[0.25, 0.5, 0.75, 1] +inp.system.aero.c_ref = c_ref +inp.system.aero.u_inf = u_inf # a0(7000) =312 +inp.system.aero.rho_inf = rho_inf +inp.system.aero.poles = f"./AERO/{Poles_file}.npy" +inp.system.aero.A = f"./AERO/{Ahh_file}.npy" +inp.system.aero.Q0_rigid = f"./AERO/Qhx{label_gaf}.npy" +inp.system.aero.qalpha = [[0., 0., 0, 0, 0, 0], + [0., 6 * np.pi / 180, 0, 0, 0, 0]] # interpolation: x=0 => qalpha=0 + # x=1 => qalpha = 4 + +#rho_rand = np.random.normal(0.6, 0.6*0.15, 500) +inp.driver.sol_path = pathlib.Path( + "./results/manoeuvre1Shard") +inputflow = dict(u_inf=np.linspace(190, 240, 8), + rho_inf=np.linspace(0.41, 0.81, 8)) +inp.system.shard = dict(input_type="steadyalpha", + inputs=inputflow) +num_gpus = 8 +solstatic1shard = feniax.feniax_shardmain.main(input_dict=inp, device_count=num_gpus) +# Manoeuvre:1 ends here