diff --git a/.github/workflows/rustbca_compile_check.yml b/.github/workflows/rustbca_compile_check.yml index 2bff114..9c57900 100644 --- a/.github/workflows/rustbca_compile_check.yml +++ b/.github/workflows/rustbca_compile_check.yml @@ -37,7 +37,7 @@ jobs: sudo apt install libhdf5-dev - name: Test RustBCA run: | - cargo test --features cpr_rootfinder_netlib,hdf5_input,distributions + cargo test --features cpr_rootfinder_netlib,hdf5_input,distributions,parry3d - name: Run Examples run: | cargo run --release 0D examples/boron_nitride_0D.toml @@ -48,4 +48,4 @@ jobs: ./target/release/rustBCA examples/layered_geometry.toml cat 2000.0eV_0.0001deg_He_TiO2_Al_Sisummary.output ./target/release/rustBCA SPHERE examples/boron_nitride_sphere.toml - + cargo run --release --features parry3d TRIMESH examples/tungsten_twist_trimesh.toml diff --git a/Cargo.toml b/Cargo.toml index 258a56e..06a44b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustBCA" -version = "0.1.0" +version = "1.1.0" authors = ["Jon Drobny "] edition = "2018" @@ -22,6 +22,7 @@ netlib-src = {version = "0.8", optional = true} intel-mkl-src = {version = "0.6.0", optional = true} rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true} ndarray = {version = "0.14.0", features = ["serde"], optional = true} +parry3d-f64 = {version = "0.2.0", optional = true} [dev-dependencies] float-cmp = "0.8.0" @@ -39,3 +40,5 @@ cpr_rootfinder_netlib = ["rcpr", "netlib-src"] cpr_rootfinder_intel_mkl = ["rcpr", "intel-mkl-src"] distributions = ["ndarray"] no_list_output = [] +parry3d = ["parry3d-f64"] +accelerated_ions = [] diff --git a/examples/tungsten_tiles_trimesh.toml b/examples/tungsten_tiles_trimesh.toml new file mode 100644 index 0000000..43e5644 --- /dev/null +++ b/examples/tungsten_tiles_trimesh.toml @@ -0,0 +1,105 @@ +[options] +name = "tungsten_tiles_" +track_trajectories = true +track_recoils = true +track_recoil_trajectories = true +write_buffer_size = 8000 +weak_collision_order = 0 +suppress_deep_recoils = false +high_energy_free_flight_paths = false +num_threads = 4 +num_chunks = 5 +use_hdf5 = false +electronic_stopping_mode = "LOW_ENERGY_NONLOCAL" +mean_free_path_model = "LIQUID" +interaction_potential = [["KR_C"]] +scattering_integral = [["MENDENHALL_WELLER"]] +root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-3}}]] +track_displacements = false +track_energy_losses = false + +[material_parameters] +energy_unit = "EV" +mass_unit = "AMU" +Eb = [ 3.0,] +Es = [ 8.79,] +Ec = [ 1.0,] +Z = [ 74 ] +m = [ 183.84 ] +interaction_index = [0] +surface_binding_model = {"PLANAR"={calculation="TARGET"}} +bulk_binding_model = "AVERAGE" + +[particle_parameters] +length_unit = "1e-8" +energy_unit = "EV" +mass_unit = "AMU" +N = [ 10 ] +m = [ 4.008 ] +Z = [ 2 ] +E = [ 250.0 ] +Ec = [ 1.0 ] +Es = [ 0.0 ] +pos = [ [ 0.35, 1.0, 0.5,] ] +dir = [ [ 0.98, -0.3, 0.0,] ] +interaction_index = [ 0 ] + +[geometry_input] +length_unit = "1e-8" +electronic_stopping_correction_factor = 1.0 +densities = [60000] +vertices = [ + [0.00000000, 0.00000000, 0.00000000], + [0.00000000, 0.00000000, 0.20000000], + [0.00000000, 0.00000000, 0.40000000], + [0.00000000, 0.00000000, 0.60000000], + [0.00000000, 0.00000000, 0.80000000], + [0.00000000, 0.00000000, 1.00000000], + [0.00000000, 1.00000000, 0.00000000], + [0.00000000, 1.00000000, 0.20000000], + [0.00000000, 1.00000000, 0.40000000], + [0.00000000, 1.00000000, 0.60000000], + [0.00000000, 1.00000000, 0.80000000], + [0.00000000, 1.00000000, 1.00000000], + [0.20000000, 0.55000000, 0.00000000], + [0.20000000, 0.55000000, 1.00000000], + [0.40000000, 0.20000000, 0.00000000], + [0.40000000, 0.20000000, 0.20000000], + [0.40000000, 0.20000000, 0.40000000], + [0.40000000, 0.20000000, 0.60000000], + [0.40000000, 0.20000000, 0.80000000], + [0.40000000, 0.20000000, 1.00000000], + [0.40000000, 1.00000000, 0.00000000], + [0.40000000, 1.00000000, 0.20000000], + [0.40000000, 1.00000000, 0.40000000], + [0.40000000, 1.00000000, 0.60000000], + [0.40000000, 1.00000000, 0.80000000], + [0.40000000, 1.00000000, 1.00000000], + [0.60000000, 0.20000000, 0.00000000], + [0.60000000, 0.20000000, 0.20000000], + [0.60000000, 0.20000000, 0.40000000], + [0.60000000, 0.20000000, 0.60000000], + [0.60000000, 0.20000000, 0.80000000], + [0.60000000, 0.20000000, 1.00000000], + [0.60000000, 1.00000000, 0.00000000], + [0.60000000, 1.00000000, 0.20000000], + [0.60000000, 1.00000000, 0.40000000], + [0.60000000, 1.00000000, 0.60000000], + [0.60000000, 1.00000000, 0.80000000], + [0.60000000, 1.00000000, 1.00000000], + [0.80000000, 0.55000000, 0.00000000], + [0.80000000, 0.55000000, 1.00000000], + [1.00000000, 0.00000000, 0.00000000], + [1.00000000, 0.00000000, 0.20000000], + [1.00000000, 0.00000000, 0.40000000], + [1.00000000, 0.00000000, 0.60000000], + [1.00000000, 0.00000000, 0.80000000], + [1.00000000, 0.00000000, 1.00000000], + [1.00000000, 1.00000000, 0.00000000], + [1.00000000, 1.00000000, 0.20000000], + [1.00000000, 1.00000000, 0.40000000], + [1.00000000, 1.00000000, 0.60000000], + [1.00000000, 1.00000000, 0.80000000], + [1.00000000, 1.00000000, 1.00000000], +] +indices = [[0, 14, 12], [26, 40, 38], [46, 32, 38], [20, 6, 12], [0, 40, 14], [6, 0, 12], [40, 46, 38], [40, 26, 14], [32, 26, 38], [14, 20, 12], [1, 0, 40], [1, 40, 41], [2, 1, 41], [2, 41, 42], [3, 2, 42], [3, 42, 43], [4, 3, 43], [4, 43, 44], [5, 4, 44], [5, 44, 45], [41, 40, 46], [41, 46, 47], [42, 41, 47], [42, 47, 48], [43, 42, 48], [43, 48, 49], [44, 43, 49], [44, 49, 50], [45, 44, 50], [45, 50, 51], [47, 46, 32], [47, 32, 33], [48, 47, 33], [48, 33, 34], [49, 48, 34], [49, 34, 35], [50, 49, 35], [50, 35, 36], [51, 50, 36], [51, 36, 37], [33, 32, 26], [33, 26, 27], [34, 33, 27], [34, 27, 28], [35, 34, 28], [35, 28, 29], [36, 35, 29], [36, 29, 30], [37, 36, 30], [37, 30, 31], [27, 26, 15], [26, 14, 15], [28, 27, 16], [27, 15, 16], [29, 28, 17], [28, 16, 17], [30, 29, 18], [29, 17, 18], [31, 30, 19], [30, 18, 19], [15, 14, 20], [15, 20, 21], [16, 15, 21], [16, 21, 22], [17, 16, 22], [17, 22, 23], [18, 17, 23], [18, 23, 24], [19, 18, 24], [19, 24, 25], [21, 20, 6], [21, 6, 7], [22, 21, 7], [22, 7, 8], [23, 22, 8], [23, 8, 9], [24, 23, 9], [24, 9, 10], [25, 24, 10], [25, 10, 11], [7, 6, 0], [7, 0, 1], [8, 7, 1], [8, 1, 2], [9, 8, 2], [9, 2, 3], [10, 9, 3], [10, 3, 4], [11, 10, 4], [11, 4, 5], [5, 19, 13], [31, 45, 39], [51, 37, 39], [25, 11, 13], [5, 45, 19], [11, 5, 13], [45, 51, 39], [45, 31, 19], [37, 31, 39], [19, 25, 13]] diff --git a/examples/tungsten_twist_trimesh.toml b/examples/tungsten_twist_trimesh.toml new file mode 100644 index 0000000..01051d9 --- /dev/null +++ b/examples/tungsten_twist_trimesh.toml @@ -0,0 +1,52 @@ +[options] +name = "tungsten_twist_" +track_trajectories = true +track_recoils = true +track_recoil_trajectories = true +write_buffer_size = 8000 +weak_collision_order = 0 +suppress_deep_recoils = false +high_energy_free_flight_paths = false +num_threads = 4 +num_chunks = 5 +use_hdf5 = false +electronic_stopping_mode = "LOW_ENERGY_NONLOCAL" +mean_free_path_model = "LIQUID" +interaction_potential = [["KR_C"]] +scattering_integral = [["MENDENHALL_WELLER"]] +root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-3}}]] +track_displacements = false +track_energy_losses = false + +[material_parameters] +energy_unit = "EV" +mass_unit = "AMU" +Eb = [ 3.0,] +Es = [ 8.79,] +Ec = [ 1.0,] +Z = [ 74 ] +m = [ 183.84 ] +interaction_index = [0] +surface_binding_model = {"ISOTROPIC"={calculation="TARGET"}} +bulk_binding_model = "AVERAGE" + +[particle_parameters] +length_unit = "5e-8" +energy_unit = "EV" +mass_unit = "AMU" +N = [ 10 ] +m = [ 4.008 ] +Z = [ 2 ] +E = [ 2000.0 ] +Ec = [ 1.0 ] +Es = [ 0.0 ] +pos = [ [ 0.0, 0.0, 1.0,] ] +dir = [ [ 0.0, 0.0001, -0.9999,] ] +interaction_index = [ 0 ] + +[geometry_input] +length_unit = "5e-8" +electronic_stopping_correction_factor = 1.0 +densities = [7.8e6] +vertices = [ [ 4.572626999266305e-13, -0.3725000000004647, 0.0,], [ 0.0, -0.5, 0.0,], [ 0.0, 0.5, 0.0,], [ -4.572522915857746e-13, 0.37250000000046457, 0.0,], [ 0.039999999999889777, -0.3400000000004409, 0.0,], [ 0.040000000000105985, 0.3399999999995761, 0.0,], [ 0.07999999999994536, -0.18000000000021854, 0.0,], [ 0.08000000000004716, 0.1799999999998114, 0.0,], [ -0.08000000000004716, -0.1799999999998114, 0.0,], [ -0.07999999999994536, 0.18000000000021854, 0.0,], [ -0.040000000000105985, -0.3399999999995761, 0.0,], [ -0.039999999999889777, 0.3400000000004409, 0.0,], [ 0.3460761710126883, 0.2383022164555415, 0.5302073804909463,], [ 0.1282022509828264, 0.04280900393084118, 0.0,], [ -0.43299324531432326, -0.2499887675338708, 0.500000001309108,], [ 0.3830425941522091, 0.3213419137658031, 0.6666744211770179,], [ 0.03319300091782479, -0.261138630970263, 0.34397232458352234,], [ 0.1905075625186843, 0.2752945886840013, 0.8019241769361253,], [ 0.40559107737231626, 0.11085127653671033, 0.3002129631402097,], [ 0.29879556015359177, 0.295826539010757, 0.6997870384432034,], [ 0.11035141320596037, 0.23272151617106032, 0.8429745430544462,], [ -0.14439163046688128, 0.39236667705674766, 0.28964912334810244,], [ -0.10547450024114946, 0.16880936970747587, 0.1416705253853082,], [ 0.20163077877213748, 0.0029129171295438736, 0.0,], [ -0.11283194123344073, -0.16008067191774167, 0.5100226041806184,], [ -0.22937079846756286, -0.3750829832922387, 0.9429751416480727,], [ -0.3213106369533618, -0.3827575233600255, 0.8333496137776426,], [ -0.25038069608229085, -0.08273282305366661, 0.5271339135345402,], [ -0.02071796769739012, -0.19588457268134912, 1.0,], [ 0.3535130717427297, 0.35357582625438827, 0.7499473440345463,], [ 0.35373066958927196, -0.2273205080756338, 1.0,], [ -0.2614910947890534, -0.006880508491315662, 0.25150521267141857,], [ -0.19516660498354385, 0.181961524226949, 1.0,], [ 0.3709159571262127, 0.22043239723385152, 0.5501605407292253,], [ 0.12411149131306203, -0.06778494104304725, 0.27273135859688163,], [ 0.2960820548324385, 0.15641449633222393, 0.34417989389567694,], [ -0.2752945886840013, 0.1905075625186843, 0.8019241769361253,], [ -0.05866480459113656, 0.3308844032338997, 0.2861861058936483,], [ 0.03004175741525734, 0.1381895881369778, 0.545451303246514,], [ -0.23272176204453937, 0.22078329046522133, 0.9113919236888627,], [ 0.3010996919956904, 0.15159605858926453, 0.5628566923390071,], [ 0.24286481344394953, -0.3432420605913338, 0.6334689430732575,], [ 0.14137617490461166, -0.003352264536796283, 0.72726864263183,], [ -0.3432420605913338, -0.24286481344394953, 0.6334689430732575,], [ 0.2273205080756338, 0.35373066958927196, 1.0,], [ -0.12787948411898845, 0.3108406104852018, 0.25416242928053256,], [ 0.1087490092177436, -0.08974623900537222, 0.09090575668150692,], [ 0.13670424174988352, 0.22301767654486787, 0.7484947884303376,], [ -0.18624999999986297, -0.32259446291024796, 1.0,], [ -0.12811751323706685, 0.23011555754610388, 0.7080989021609679,], [ -0.036175109197266464, 0.41539876138478526, 0.13080822198027475,], [ 0.1699177047710262, -0.09665987855212022, 0.6010258456660696,], [ -0.20464101615125777, -0.27444863728629026, 1.0,], [ 0.48296218339593283, 0.1293633882265425, 0.2500526572589161,], [ 0.24651802646263324, 0.22200893429460314, 0.8234997710274429,], [ 0.32551962977214255, 0.08896668353784273, 0.37184078929925374,], [ -0.18862051535932128, 0.03858336894564142, 0.22406819693318994,], [ 0.13522716241926555, -0.2260108006336161, 0.29190109927669305,], [ -0.23011555752253832, -0.12811751319348708, 0.708098902143065,], [ -0.20955618780481172, 0.15931529634386715, 0.6560276772075244,], [ 0.2374249272571373, -0.23980722172969998, 0.6281592127404793,], [ 0.3108406104624231, 0.12787948417138995, 0.25416242944159334,], [ 0.11558684565855919, -0.3963506814153268, 0.22022101032899222,], [ 0.18055964838790206, -0.3794138581587593, 0.46979262196489335,], [ -0.01006819038779251, 0.1410389588765214, 0.8181816111750334,], [ 0.15027997906385604, -0.21920406776930185, 0.7924145492839705,], [ 0.05789725911480256, -0.257440370300532, 0.4333004886929356,], [ 0.22322973536694926, 0.0843115695710863, 0.06971816333933709,], [ 0.13965854583061185, 0.24306086394145443, 1.0,], [ -0.11964640244198879, 0.31297468504697246, 0.46838952889172525,], [ 0.016809283713724213, 0.14041656779181083, 0.6363653307983118,], [ 0.08900127910614036, -0.07727166349257321, 1.0,], [ 0.08974623900537222, 0.1087490092177436, 0.09090575668150692,], [ -0.1562492738841116, 0.2118330558531523, 0.3836095383159287,], [ -0.09581023169714559, 0.25523159087166986, 0.13666343649704626,], [ -0.0012489414339721533, -0.19548298841643938, 0.39897415629239585,], [ -0.03660254037844385, 0.13660254037844388, 1.0,], [ 0.01990434120847588, 0.19379044745542848, 0.3099640249851412,], [ 0.21122082708205525, -0.26010416453506197, 0.5316104738645642,], [ -0.2499887675338708, 0.43299324531432326, 0.500000001309108,], [ -0.0854754928913008, 0.1596702181964385, 0.9359984715878263,], [ 0.2818358839968427, 0.18496195406024268, 0.4371433105784621,], [ 0.4153987613811732, 0.03617510920507221, 0.13080822200083506,], [ 0.46981155738148817, 0.17105366125509808, 0.3333255805881006,], [ 0.2112771694579553, -0.4531664806011405, 0.41669435422853884,], [ -0.37635803387282524, -0.2110064439789368, 0.4498394619076902,], [ -0.12177881919208919, 0.15247695769075534, 0.23713344789406382,], [ 0.2868151005492483, -0.4095546356373149, 0.5833056479573179,], [ -0.1346965726697516, 0.04307786866862426, 0.4545486989047308,], [ 0.4082435857975277, -0.2859631405720417, 0.9166961793728162,], [ -0.17607383516628242, 0.09829272915276606, 1.0,], [ 0.4531664806011405, 0.2112771694579553, 0.41669435422853884,], [ -0.23272151617106032, 0.11035141320596037, 0.8429745430544462,], [ -0.25523159090841296, -0.09581023169261282, 0.13666343649402357,], [ 0.1688093698172481, 0.10547450022816708, 0.1416705253712006,], [ 0.17777962111750606, -0.07965755805049436, 0.6900359766182131,], [ -0.17105366125509808, 0.46981155738148817, 0.3333255805881006,], [ 0.2834999527553662, 0.17820733151557788, 0.655820108458231,], [ 0.20525612252234304, -0.26616718601562606, 0.7458375725885337,], [ -0.17546963249217945, 0.19683907432227515, 0.47286608902670724,], [ -0.1324309081388907, 0.027027440576591358, 1.0,], [ 0.1596702181964385, 0.0854754928913008, 0.9359984715878263,], [ -0.32430800579064517, -0.26646629080978856, 0.6108572497083525,], [ -0.10532817077836558, 0.24123236767263964, 0.6163904640753997,], [ 0.3213419137658031, -0.3830425941522091, 0.6666744211770179,], [ 0.3275678261876392, -0.1812594487445165, 0.9363009295050629,], [ -0.3725000000004646, -4.572522915857746e-13, 0.0,], [ 0.26010416441144346, 0.2112208270303067, 0.531610473829892,], [ 0.03999280726046196, 0.18143090635394693, 0.8476301642343661,], [ -0.23830221644295485, 0.3460761709759009, 0.5302073804891553,], [ 0.15385905715184453, 0.09554071879135333, 0.0640015285287694,], [ 0.32265267464874814, -0.27428991476805276, 0.7838020564428306,], [ -0.41657037006101477, -0.07621569761639421, 0.2161979453086568,], [ -0.11710922616794303, 0.07923878801083857, 0.18181838943427378,], [ 0.084311569574439, -0.2232297353773739, 0.06971816336297523,], [ -0.18793929950246036, -0.05401477923550248, 0.6720908582586579,], [ 0.15159605858926453, -0.3010996919956904, 0.5628566923390071,], [ -0.3750829832922387, 0.22937079846756286, 0.9429751416480727,], [ -0.0780384757732574, -0.2551666049842888, 1.0,], [ 0.14041656779181083, -0.016809283713724213, 0.6363653307983118,], [ 0.0868844127991979, -0.49213305714063227, 0.16665038694353176,], [ 0.17582393811226835, -0.3819481276563166, 0.3665310588577555,], [ 0.09345595207411436, -0.1757482812467558, 0.8583294751625014,], [ -0.3801773319632138, -0.08550076925677855, 0.1429869277252464,], [ -0.09665987855212022, -0.1699177047710262, 0.6010258456660696,], [ 0.07965755805049436, 0.17777962111750606, 0.6900359766182131,], [ 0.3923666770180675, 0.1443916304528351, 0.28964912332001924,], [ 0.20566587649344237, -0.05126815202734319, 0.919003579087715,], [ 0.33366588879888825, 0.027337094910558295, 0.19807582414808178,], [ 0.2868844483634396, -0.16467071281208057, 0.877902428113227,], [ 0.22200893429460314, -0.24651802646263324, 0.8234997710274429,], [ -0.18496195406024266, 0.28183588399684256, 0.4371433105784621,], [ 0.17820733151557788, -0.2834999527553662, 0.655820108458231,], [ 0.11469630200353009, -0.23974831403367877, 0.20758545172877368,], [ 0.295826539010757, -0.29879556015359177, 0.6997870384432034,], [ -0.07621569761639414, 0.4165703700610147, 0.21619794530865677,], [ 0.07727166349256004, 0.08900127910614056, 1.0,], [ -0.10248640655529279, 0.3155243904999129, 0.17650022993985037,], [ 0.43951679070003674, 0.01109944656979172, 0.05702485844436234,], [ -0.03100865480332172, -0.2929523584797162, 0.07050258724554687,], [ 0.29827648464678935, 0.2854563356907578, 0.7797789907804049,], [ 0.25000000000000006, 0.4330127018922193, 1.0,], [ -0.1300089567816845, 0.05565101693579122, 0.36363467100030356,], [ -0.19400127130953645, 0.17886068133656935, 0.5666995135909063,], [ 0.12713281853260583, 0.14850215890206264, 0.418815368519463,], [ 0.1968390743222751, 0.17546963249217945, 0.47286608902670724,], [ -0.3129746850508658, -0.11964640244771335, 0.46838952889671664,], [ -0.08550076923451833, 0.38017733199895054, 0.14298692767686907,], [ 0.20374594984238775, -0.058433416135664565, 0.08099642100680052,], [ 0.2864928434919832, -0.2641345041765258, 0.8570130730791857,], [ 0.04280900393084118, -0.1282022509828264, 0.0,], [ -0.04352955150691354, 0.4965308865097226, 0.08330382086471845,], [ -0.330784575153691, 0.0008332040654743036, 0.12209757229950059,], [ -0.011099446572985262, 0.43951679068520993, 0.05702485846129726,], [ 0.26113863093263984, 0.03319300090094479, 0.343972324614267,], [ 0.4056301486161195, 0.054547229799177394, 0.07433309329000042,], [ -0.33088440334778824, -0.05866480464249037, 0.28618610584767795,], [ 0.11085127653671033, -0.40559107737231626, 0.3002129631402097,], [ 0.22301767654486787, -0.13670424174988352, 0.7484947884303376,], [ -0.181961524226949, -0.19516660498354385, 1.0,], [ 0.4095546356373149, 0.2868151005492483, 0.5833056479573179,], [ 0.34165832587637174, -0.23902794414550274, 0.8691917789440509,], [ -0.31552439046269243, -0.1024864065390655, 0.17650022988283992,], [ 0.21183305585315232, 0.15624927388411164, 0.38360953831592876,], [ 0.23902794414550274, 0.34165832587637174, 0.8691917789440509,], [ 0.04307786866862426, 0.1346965726697516, 0.4545486989047308,], [ 0.01767499190728805, -0.19504989901600386, 0.48997739820370295,], [ -0.006880508595382258, 0.26149109494923667, 0.2515052127247301,], [ -0.23980722167376378, -0.23742492724531375, 0.6281592127756889,], [ 0.257221896874944, -0.21624741204257814, 0.7138138957504989,], [ 0.11962189625900777, 0.2692085120118234, 0.9294974133710218,], [ -0.26760369432653197, 0.32123015750876655, 0.710350878355716,], [ 0.1381895881369778, -0.03004175741525734, 0.545451303246514,], [ 0.15247695769075534, 0.12177881919208919, 0.23713344789406382,], [ -0.23974831398128404, -0.1146963020270878, 0.20758545181802338,], [ -0.07115950897192602, 0.1817020295604646, 0.7628665530933992,], [ -0.05565101693579122, -0.1300089567816845, 0.36363467100030356,], [ 0.02334801827980766, -0.13905252411862765, 0.9090942434276862,], [ -0.00044204692535520785, 0.2804079665921417, 0.0,], [ -0.2105898896120768, -0.1731319251222549, 0.8633365640709225,], [ -0.1757482812467558, -0.09345595207411436, 0.8583294751625014,], [ 0.14762582728527868, -0.3929205799237823, 0.38914275232054196,], [ -0.17313192511541192, 0.21058988960682495, 0.8633365640787076,], [ 0.1410389588765214, 0.01006819038779251, 0.8181816111750334,], [ -0.14850215888411922, 0.12713281842348526, 0.41881536854055246,], [ 0.3240123985313803, -0.25005436085245025, 0.9256669072548005,], [ -0.3827575233600255, 0.3213106369533618, 0.8333496137776426,], [ -0.07923878801083857, -0.11710922616794303, 0.18181838943427378,], [ -0.01307301892783809, 0.05805612402181283, 1.0,], [ -0.2430608639414823, 0.13965854583062795, 1.0,], [ 0.2859631405720417, 0.4082435857975277, 0.9166961793728162,], [ -0.2162474120374094, -0.2572218968731536, 0.7138138957533035,], [ -0.257440370300532, -0.05789725911480256, 0.4333004886929356,], [ 0.1817020295604646, 0.07115950897192602, 0.7628665530933992,], [ -0.256718451919196, 0.020793630656624283, 0.1570254573956425,], [ -0.13982115942903242, -0.24306144595498963, 1.0,], [ 0.13660254037844388, 0.03660254037844385, 1.0,], [ 0.19504989901600386, 0.01767499190728805, 0.48997739820370295,], [ -0.03858336894564142, -0.18862051535932128, 0.22406819693318994,], [ -0.006808625571027564, -0.3743117830034124, 0.06369907135175619,], [ 0.4965308865097226, 0.04352955150691354, 0.08330382086471845,], [ -0.05126815202734319, -0.20566587649344237, 0.919003579087715,], [ -0.1407478210833046, -0.1357528184326633, 0.3279091434686116,], [ 0.2854563356907578, -0.29827648464678935, 0.7797789907804049,], [ 0.13905252411862765, 0.02334801827980766, 0.9090942434276862,], [ -0.0889666834825325, 0.3255196297121406, 0.37184078927199904,], [ 0.2110064439721351, -0.3763580338536665, 0.44983946190230817,], [ 0.24123236767263953, 0.10532817077836548, 0.6163904640753997,], [ 0.2664662908066769, -0.3243080057816075, 0.6108572497097852,], [ 0.19379044745542848, -0.01990434120847588, 0.3099640249851412,], [ -0.3929205799406444, -0.14762582730040072, 0.38914275232476603,], [ -0.13535898384890976, -0.3144486372870062, 1.0,], [ -0.192173051021227, -0.03584917116861537, 0.5811846336959405,], [ -0.09554071879135331, 0.15385905715184459, 0.0640015285287694,], [ 0.22043239723385152, -0.3709159571262127, 0.5501605407292253,], [ 0.2803261557544342, 0.0005825834258224174, 0.0,], [ -0.027027440576591358, -0.1324309081388907, 1.0,], [ 0.05845352640182483, 0.011562442225933231, 1.0,], [ -0.21920406776930185, -0.15027997906385604, 0.7924145492839705,], [ 0.11588457268102555, -0.15928203230270552, 1.0,], [ 0.19588457268134912, -0.02071796769739012, 1.0,], [ -0.4330127018922193, 0.25000000000000006, 1.0,], [ 0.15641449632757393, -0.2960820548709696, 0.3441798938679665,], [ -0.035849171209017025, 0.192173051051974, 0.5811846337170081,], [ 0.18463082872875658, 0.15116683692070118, 0.9302818368160787,], [ 0.1926794919244359, 0.3737306695895931, 1.0,], [ -0.2692085120118234, 0.11962189625900777, 0.9294974133710218,], [ -0.1293633882265425, 0.48296218339593283, 0.2500526572589161,], [ -0.17712017748552306, 0.05608066608938753, 0.15236983617188293,], [ -0.07484305753576045, 0.31193460312490323, 0.08860807718863248,], [ -0.35357582625438827, 0.3535130717427297, 0.7499473440345463,], [ -0.26616718601562606, -0.20525612252234304, 0.7458375725885337,], [ 0.13575281841339892, -0.14074782099317457, 0.327909143404395,], [ -0.05843341609373548, -0.20374594996532658, 0.08099642100600661,], [ -0.02733709481324227, 0.33366588860446383, 0.1980758241403164,], [ 0.18143090635394693, -0.03999280726046196, 0.8476301642343661,], [ -0.15116683692070118, 0.18463082872875658, 0.9302818368160787,], [ 0.2551666049842888, -0.0780384757732574, 1.0,], [ 0.17886068133656935, 0.19400127130953645, 0.5666995135909063,], [ 0.31193460305271925, 0.07484305755995456, 0.08860807723034066,], [ -0.19548298841643938, 0.0012489414339721533, 0.39897415629239585,], [ -0.3737306695895931, 0.1926794919244359, 1.0,], [ -0.15928203230270552, -0.11588457268102555, 1.0,], [ -0.3794138581587593, -0.18055964838790206, 0.46979262196489335,], [ 0.3225944629095305, -0.18624999999944872, 1.0,], [ -0.37431178312384833, 0.006808625529926414, 0.06369907135765435,], [ -0.15931529634386715, -0.20955618780481172, 0.6560276772075244,], [ -0.2641345041765258, -0.2864928434919832, 0.8570130730791857,], [ -0.06089607975244819, -0.18264184245282067, 0.7759318039691542,], [ 0.0008332040654743036, 0.33078457515369103, 0.12209757229950056,], [ 0.11571320042150712, -0.022418584024176152, 0.0,], [ 0.18264184245282067, -0.06089607975244819, 0.7759318039691542,], [ -0.32123015741992306, -0.26760369419654917, 0.7103508783623392,], [ 0.22601080062813186, 0.13522716242389238, 0.2919010992969149,], [ 0.1812594487445165, 0.3275678261876392, 0.9363009295050629,], [ 0.22078329046522133, 0.23272176204453937, 0.9113919236888627,], [ 0.003352264536796283, 0.14137617490461166, 0.72726864263183,], [ -0.054014779227268196, 0.18793929950112703, 0.6720908582355372,], [ 0.49213305714063227, 0.0868844127991979, 0.16665038694353176,], [ 0.25005436085245025, 0.3240123985313803, 0.9256669072548005,], [ 0.3963506815068328, 0.11558684569349488, 0.22022101041669728,], [ -0.2929523584693378, 0.031008654810814267, 0.07050258723180984,], [ -0.02079363066184354, -0.25671845192747356, 0.15702545736167312,], [ 0.02315901413613517, 0.11678553464223565, 0.0,], [ -0.056080666071232854, -0.17712017752614487, 0.15236983617663716,], [ -0.16008067190168807, 0.11283194115031796, 0.5100226042322266,], [ -0.054547229779268395, 0.4056301486386689, 0.07433309325120684,], [ 0.3819481276563166, 0.17582393811226835, 0.3665310588577555,], [ 0.06778494104304725, 0.12411149131306203, 0.27273135859688163,], [ -0.08273282305366661, 0.25038069608229085, 0.5271339135345402,], [ 0.16467071281208057, 0.2868844483634396, 0.877902428113227,], [ 0.27428991476805276, 0.32265267464874814, 0.7838020564428306,], [ -0.5, 0.0, 0.0,], [ -0.4200000000002186, -0.01999999999994535, 0.0,], [ -0.4199999999997881, 0.020000000000052975, 0.0,], [ -0.3144486372870062, 0.13535898384890976, 1.0,], [ -0.3399999999995761, 0.040000000000105985, 0.0,], [ -0.3400000000004409, -0.039999999999889777, 0.0,], [ -0.27444863728629026, 0.20464101615125777, 1.0,], [ -0.2600000000004393, -0.059999999999890176, 0.0,], [ -0.259999999999577, 0.06000000000010575, 0.0,], [ -0.1799999999998114, 0.08000000000004716, 0.0,], [ -0.18000000000021854, -0.07999999999994536, 0.0,], [ -0.1, -0.1, 0.0,], [ -0.1, 0.1, 0.0,], [ -0.06000000000010575, -0.259999999999577, 0.0,], [ -0.059999999999890176, 0.2600000000004393, 0.0,], [ -0.020000000000052975, -0.4199999999997881, 0.0,], [ -0.01999999999994535, 0.4200000000002186, 0.0,], [ 0.01999999999994535, -0.4200000000002186, 0.0,], [ 0.020000000000052975, 0.4199999999997881, 0.0,], [ 0.059999999999890176, -0.2600000000004393, 0.0,], [ 0.06000000000010575, 0.259999999999577, 0.0,], [ 0.1, -0.1, 0.0,], [ 0.1, 0.1, 0.0,], [ 0.18000000000021854, 0.07999999999994536, 0.0,], [ 0.1799999999998114, -0.08000000000004716, 0.0,], [ 0.259999999999577, -0.06000000000010575, 0.0,], [ 0.2600000000004393, 0.059999999999890176, 0.0,], [ 0.27444863728629026, -0.20464101615125777, 1.0,], [ 0.3400000000004409, 0.039999999999889777, 0.0,], [ 0.3399999999995761, -0.040000000000105985, 0.0,], [ 0.3144486372870062, -0.13535898384890976, 1.0,], [ 0.4199999999997881, -0.020000000000052975, 0.0,], [ 0.4200000000002186, 0.01999999999994535, 0.0,], [ 0.5, 0.0, 0.0,], [ -0.27428991476805276, -0.32265267464874814, 0.7838020564428306,], [ -0.16467071281208057, -0.2868844483634396, 0.877902428113227,], [ 0.08273282305366661, -0.25038069608229085, 0.5271339135345402,], [ -0.06778494104304725, -0.12411149131306203, 0.27273135859688163,], [ -0.3819481276563166, -0.17582393811226835, 0.3665310588577555,], [ 0.054547229779268395, -0.4056301486386689, 0.07433309325120684,], [ 0.16008067190168807, -0.11283194115031796, 0.5100226042322266,], [ 0.056080666071232854, 0.17712017752614487, 0.15236983617663716,], [ 0.02079363066184354, 0.25671845192747356, 0.15702545736167312,], [ 0.2929523584693378, -0.031008654810814267, 0.07050258723180984,], [ -0.3963506815068328, -0.11558684569349488, 0.22022101041669728,], [ -0.25005436085245025, -0.3240123985313803, 0.9256669072548005,], [ -0.49213305714063227, -0.0868844127991979, 0.16665038694353176,], [ 0.05401477923550248, -0.18793929950246036, 0.6720908582586579,], [ -0.003352264536796283, -0.14137617490461166, 0.72726864263183,], [ -0.22078329046522133, -0.23272176204453937, 0.9113919236888627,], [ -0.1812594487445165, -0.3275678261876392, 0.9363009295050629,], [ -0.22601080062813186, -0.13522716242389238, 0.2919010992969149,], [ 0.32123015741992306, 0.26760369419654917, 0.7103508783623392,], [ -0.18264184245282067, 0.06089607975244819, 0.7759318039691542,], [ -0.11571320042151381, 0.02241858402418742, 0.0,], [ -0.0008332040654743036, -0.33078457515369103, 0.12209757229950056,], [ 0.06089607975244819, 0.18264184245282067, 0.7759318039691542,], [ 0.2641345041765258, 0.2864928434919832, 0.8570130730791857,], [ 0.15931529634386715, 0.20955618780481172, 0.6560276772075244,], [ 0.37431178312384833, -0.006808625529926414, 0.06369907135765435,], [ -0.322594462910248, 0.18624999999986297, 1.0,], [ 0.3794138581587593, 0.18055964838790206, 0.46979262196489335,], [ 0.15928203230270552, 0.11588457268102555, 1.0,], [ 0.3737306695895931, -0.1926794919244359, 1.0,], [ 0.19548298841643938, -0.0012489414339721533, 0.39897415629239585,], [ -0.31193460305271925, -0.07484305755995456, 0.08860807723034066,], [ -0.17886068133656935, -0.19400127130953645, 0.5666995135909063,], [ -0.2551666049842888, 0.0780384757732574, 1.0,], [ 0.15116683692070118, -0.18463082872875658, 0.9302818368160787,], [ -0.18143090635394693, 0.03999280726046196, 0.8476301642343661,], [ 0.02733709481324227, -0.33366588860446383, 0.1980758241403164,], [ 0.05843341609373548, 0.20374594996532658, 0.08099642100600661,], [ -0.13575281841339892, 0.14074782099317457, 0.327909143404395,], [ 0.26616718601562606, 0.20525612252234304, 0.7458375725885337,], [ 0.35357582625438827, -0.3535130717427297, 0.7499473440345463,], [ 0.07484305753576045, -0.31193460312490323, 0.08860807718863248,], [ 0.17712017748552306, -0.05608066608938753, 0.15236983617188293,], [ -0.05979502403710553, -0.009863657322112196, 1.0,], [ 0.000582583425822173, -0.28032615575440123, 0.0,], [ 0.1293633882265425, -0.48296218339593283, 0.2500526572589161,], [ 0.04034962850653133, -0.043741568784226206, 0.0,], [ 0.2692085120118234, -0.11962189625900777, 0.9294974133710218,], [ -0.1926794919244359, -0.3737306695895931, 1.0,], [ -0.18463082872875658, -0.15116683692070118, 0.9302818368160787,], [ 0.03584917116861537, -0.192173051021227, 0.5811846336959405,], [ -0.15641449632757393, 0.2960820548709696, 0.3441798938679665,], [ 0.4330127018922193, -0.25000000000000006, 1.0,], [ -0.19588457268134912, 0.02071796769739012, 1.0,], [ -0.11588457268102555, 0.15928203230270552, 1.0,], [ 0.21920406776930185, 0.15027997906385604, 0.7924145492839705,], [ 0.027027440576591358, 0.13243090813889066, 1.0,], [ -0.2803261557544015, -0.0005825834258220982, 0.0,], [ -0.22043239712810567, 0.37091595700126195, 0.5501605407739526,], [ 0.09554071879135331, -0.15385905715184459, 0.0640015285287694,], [ 0.192173051021227, 0.03584917116861537, 0.5811846336959405,], [ 0.09829272915268539, 0.17607383516614336, 1.0,], [ 0.13535898384890976, 0.3144486372870062, 1.0,], [ 0.3929205799406444, 0.14762582730040072, 0.38914275232476603,], [ -0.19379044745542848, 0.01990434120847588, 0.3099640249851412,], [ -0.2664662908066769, 0.3243080057816075, 0.6108572497097852,], [ -0.24123236767263953, -0.10532817077836548, 0.6163904640753997,], [ -0.2110064439721351, 0.3763580338536665, 0.44983946190230817,], [ 0.0889666834825325, -0.3255196297121406, 0.37184078927199904,], [ -0.13905252411862765, -0.02334801827980766, 0.9090942434276862,], [ -0.2854563356907578, 0.29827648464678935, 0.7797789907804049,], [ 0.1407478210833046, 0.1357528184326633, 0.3279091434686116,], [ 0.05126815202734319, 0.20566587649344237, 0.919003579087715,], [ -0.4965308865097226, -0.04352955150691354, 0.08330382086471845,], [ 0.006808625571027564, 0.3743117830034124, 0.06369907135175619,], [ -0.0022102346272078258, 0.20203983296067513, 0.0,], [ 0.03858336894564142, 0.18862051535932128, 0.22406819693318994,], [ -0.19504989901600386, -0.01767499190728805, 0.48997739820370295,], [ 0.04685218117497973, 0.03843968983372776, 0.0,], [ -0.13660254037844388, -0.03660254037844385, 1.0,], [ 0.256718451919196, -0.020793630656624283, 0.1570254573956425,], [ -0.1817020295604646, -0.07115950897192602, 0.7628665530933992,], [ 0.257440370300532, 0.05789725911480256, 0.4333004886929356,], [ 0.2162474120374094, 0.2572218968731536, 0.7138138957533035,], [ -0.2859631405720417, -0.4082435857975277, 0.9166961793728162,], [ 0.24306086394145443, -0.13965854583061224, 1.0,], [ 0.07923878801083857, 0.11710922616794303, 0.18181838943427378,], [ 0.3827575233600255, -0.3213106369533618, 0.8333496137776426,], [ -0.3240123985313803, 0.25005436085245025, 0.9256669072548005,], [ 0.14850215888411922, -0.12713281842348526, 0.41881536854055246,], [ -0.1410389588765214, -0.01006819038779251, 0.8181816111750334,], [ 0.0007364072744616131, 0.00046606467373267634, 0.0,], [ 0.1731319251222549, -0.2105898896120768, 0.8633365640709225,], [ -0.1476258272776477, 0.39292057992223023, 0.3891427523083724,], [ 0.1757482812467558, 0.09345595207411436, 0.8583294751625014,], [ 0.2105898896120768, 0.1731319251222549, 0.8633365640709225,], [ -0.02334801827980766, 0.13905252411862765, 0.9090942434276862,], [ 0.05565101693579122, 0.1300089567816845, 0.36363467100030356,], [ 0.07115950897192602, -0.1817020295604646, 0.7628665530933992,], [ 0.23974831398128404, 0.1146963020270878, 0.20758545181802338,], [ -0.15247695769075534, -0.12177881919208919, 0.23713344789406382,], [ -0.1381895881369778, 0.03004175741525734, 0.545451303246514,], [ 0.26760369419654917, -0.32123015741992306, 0.7103508783623392,], [ -0.11962189625900777, -0.2692085120118234, 0.9294974133710218,], [ -0.257221896874944, 0.21624741204257814, 0.7138138957504989,], [ 0.23980722167376378, 0.23742492724531375, 0.6281592127756889,], [ 0.006880508595382258, -0.26149109494923667, 0.2515052127247301,], [ -0.017674991916865515, 0.1950498990250472, 0.48997739820828046,], [ -0.04307786866862426, -0.1346965726697516, 0.4545486989047308,], [ -0.038236911252714396, 0.04715197302170622, 0.0,], [ -0.23902794414550274, -0.34165832587637174, 0.8691917789440509,], [ -0.21183305585315232, -0.15624927388411164, 0.38360953831592876,], [ 0.31552439046269243, 0.1024864065390655, 0.17650022988283992,], [ -0.34165832587637174, 0.23902794414550274, 0.8691917789440509,], [ -0.4095546356373149, -0.2868151005492483, 0.5833056479573179,], [ 0.181961524226949, 0.19516660498354385, 1.0,], [ -0.22301767654486787, 0.13670424174988352, 0.7484947884303376,], [ -0.11085127653671033, 0.40559107737231626, 0.3002129631402097,], [ 0.33088440334778824, 0.05866480464249037, 0.28618610584767795,], [ -0.4056301486161195, -0.054547229799177394, 0.07433309329000042,], [ -0.26113863093263984, -0.03319300090094479, 0.343972324614267,], [ 0.011099446572985262, -0.43951679068520993, 0.05702485846129726,], [ 0.330784575153691, -0.0008332040654743036, 0.12209757229950059,], [ 0.04352955150691354, -0.4965308865097226, 0.08330382086471845,], [ -0.04280900393084118, 0.1282022509828264, 0.0,], [ -0.2864928434919832, 0.2641345041765258, 0.8570130730791857,], [ -0.20374594984238775, 0.058433416135664565, 0.08099642100680052,], [ 0.08550076923451833, -0.38017733199895054, 0.14298692767686907,], [ 0.3129746850508658, 0.11964640244771335, 0.46838952889671664,], [ -0.1968390743222751, -0.17546963249217945, 0.47286608902670724,], [ -0.12713281853260583, -0.14850215890206264, 0.418815368519463,], [ -0.022418584024184802, -0.11571320042150464, 0.0,], [ 0.19400127130953645, -0.17886068133656935, 0.5666995135909063,], [ 0.1300089567816845, -0.05565101693579122, 0.36363467100030356,], [ -0.25000000000000006, -0.4330127018922193, 1.0,], [ -0.29827648464678935, -0.2854563356907578, 0.7797789907804049,], [ 0.03100865480332172, 0.2929523584797162, 0.07050258724554687,], [ -0.43951679070003674, -0.01109944656979172, 0.05702485844436234,], [ 0.10248640655529279, -0.3155243904999129, 0.17650022993985037,], [ 0.07621569761639414, -0.4165703700610147, 0.21619794530865677,], [ -0.295826539010757, 0.29879556015359177, 0.6997870384432034,], [ -0.11469630200353009, 0.23974831403367877, 0.20758545172877368,], [ -0.17820733280432927, 0.2834999538094197, 0.6558201082214182,], [ 0.18496195406024266, -0.28183588399684256, 0.4371433105784621,], [ -0.22200893445325406, 0.2465180265414618, 0.8234997710287095,], [ -0.2868844483634396, 0.16467071281208057, 0.877902428113227,], [ -0.33366588879888825, -0.027337094910558295, 0.19807582414808178,], [ -0.20566587649344237, 0.05126815202734319, 0.919003579087715,], [ -0.3923666770180675, -0.1443916304528351, 0.28964912332001924,], [ -0.07965755805049436, -0.17777962111750606, 0.6900359766182131,], [ 0.09665987855212022, 0.1699177047710262, 0.6010258456660696,], [ 0.3801773319632138, 0.08550076925677855, 0.1429869277252464,], [ -0.09345595207411436, 0.1757482812467558, 0.8583294751625014,], [ -0.17582393811226835, 0.3819481276563166, 0.3665310588577555,], [ -0.0868844127991979, 0.49213305714063227, 0.16665038694353176,], [ -0.14041656779181083, 0.016809283713724213, 0.6363653307983118,], [ 0.0780384757732574, 0.2551666049842888, 1.0,], [ 0.3750829832922387, -0.22937079846756286, 0.9429751416480727,], [ -0.15159605858926462, 0.3010996919956906, 0.562856692339007,], [ 0.18793929950246036, 0.05401477923550248, 0.6720908582586579,], [ -0.084311569574439, 0.2232297353773739, 0.06971816336297523,], [ 0.11710922616794303, -0.07923878801083857, 0.18181838943427378,], [ -0.0991057971447882, -0.1760767452338191, 1.0,], [ 0.41657037006101477, 0.07621569761639421, 0.2161979453086568,], [ -0.32265267464874814, 0.27428991476805276, 0.7838020564428306,], [ -0.15385905715184453, -0.09554071879135333, 0.0640015285287694,], [ 0.23830221644295485, -0.3460761709759009, 0.5302073804891553,], [ -0.03999280726046196, -0.18143090635394693, 0.8476301642343661,], [ -0.26010416441144346, -0.2112208270303067, 0.531610473829892,], [ 0.3725000000004647, 4.572626999266305e-13, 0.0,], [ -0.3275678261876392, 0.1812594487445165, 0.9363009295050629,], [ -0.3213419137658031, 0.3830425941522091, 0.6666744211770179,], [ 0.10532817077836548, -0.24123236767263953, 0.6163904640753997,], [ 0.32430800579064517, 0.26646629080978856, 0.6108572497083525,], [ -0.1596702181964385, -0.0854754928913008, 0.9359984715878263,], [ 0.1324309081388907, -0.027027440576591358, 1.0,], [ 0.17546963249217945, -0.19683907432227515, 0.47286608902670724,], [ -0.20525612305547106, 0.2661671863656952, 0.7458375725181301,], [ -0.2834999527553662, -0.17820733151557788, 0.655820108458231,], [ 0.17105366125509808, -0.46981155738148817, 0.3333255805881006,], [ -0.07844906188960828, -0.08955973272666004, 1.0,], [ -0.17777962111750606, 0.07965755805049436, 0.6900359766182131,], [ -0.1688093698172481, -0.10547450022816708, 0.1416705253712006,], [ 0.25523159090841296, 0.09581023169261282, 0.13666343649402357,], [ 0.009538149996248965, -0.0599532621017078, 1.0,], [ 0.23272151617106032, -0.11035141320596037, 0.8429745430544462,], [ -0.4531664806011405, -0.2112771694579553, 0.41669435422853884,], [ 0.17607383516614336, -0.09829272915268725, 1.0,], [ -0.4082435857975277, 0.2859631405720417, 0.9166961793728162,], [ 0.1346965726697516, -0.04307786866862426, 0.4545486989047308,], [ -0.2868151005492483, 0.4095546356373149, 0.5833056479573179,], [ -0.0008707797440886906, -3.542021002197375e-5, 1.0,], [ 0.12177881919208919, -0.15247695769075534, 0.23713344789406382,], [ 0.37635803387282524, 0.2110064439789368, 0.4498394619076902,], [ -0.2112771694579553, 0.4531664806011405, 0.41669435422853884,], [ -0.46981155738148817, -0.17105366125509808, 0.3333255805881006,], [ -0.4153987613811732, -0.03617510920507221, 0.13080822200083506,], [ 0.002912917129542638, -0.20163077877197322, 0.0,], [ -0.2818358839968427, -0.18496195406024268, 0.4371433105784621,], [ 0.0854754928913008, -0.1596702181964385, 0.9359984715878263,], [ 0.2499887675338708, -0.43299324531432326, 0.500000001309108,], [ -0.21122082708205525, 0.26010416453506197, 0.5316104738645642,], [ -0.01990434120847588, -0.19379044745542848, 0.3099640249851412,], [ 0.03660254037844385, -0.13660254037844388, 1.0,], [ 0.0012489414339721533, 0.19548298841643938, 0.39897415629239585,], [ 0.09581023169714559, -0.25523159087166986, 0.13666343649704626,], [ 0.1562492738841116, -0.2118330558531523, 0.3836095383159287,], [ -0.08974623900537222, -0.1087490092177436, 0.09090575668150692,], [ -0.08900127910614704, 0.07727166349256673, 1.0,], [ -0.016809283713724213, -0.14041656779181083, 0.6363653307983118,], [ 0.11964640244229122, -0.31297468504755493, 0.4683895288912161,], [ -0.22322973536694926, -0.0843115695710863, 0.06971816333933709,], [ -0.05789725911480256, 0.257440370300532, 0.4333004886929356,], [ -0.15027997906385604, 0.21920406776930185, 0.7924145492839705,], [ 0.01006819038779251, -0.1410389588765214, 0.8181816111750334,], [ -0.180559648379687, 0.3794138581406193, 0.4697926219793894,], [ -0.11558684565855919, 0.3963506814153268, 0.22022101032899222,], [ -0.3108406104624231, -0.12787948417138995, 0.25416242944159334,], [ -0.2374249272571373, 0.23980722172969998, 0.6281592127404793,], [ 0.20955618780481172, -0.15931529634386715, 0.6560276772075244,], [ 0.23011555752253832, 0.12811751319348708, 0.708098902143065,], [ -0.13522716241926555, 0.2260108006336161, 0.29190109927669305,], [ 0.18862051535932128, -0.03858336894564142, 0.22406819693318994,], [ -0.32551962977214255, -0.08896668353784273, 0.37184078929925374,], [ -0.24651802646263324, -0.22200893429460314, 0.8234997710274429,], [ -0.48296218339593283, -0.1293633882265425, 0.2500526572589161,], [ 0.20464101615125777, 0.27444863728629026, 1.0,], [ -0.1699177047710262, 0.09665987855212022, 0.6010258456660696,], [ 0.036175109197266464, -0.41539876138478526, 0.13080822198027475,], [ 0.12811751319348708, -0.23011555752253832, 0.708098902143065,], [ 0.18624999999944872, 0.3225944629095305, 1.0,], [ -0.13670424174988352, -0.22301767654486787, 0.7484947884303376,], [ -0.1087490092177436, 0.08974623900537222, 0.09090575668150692,], [ 0.12787948411898845, -0.3108406104852018, 0.25416242928053256,], [ -0.2273205080756338, -0.35373066958927196, 1.0,], [ 0.3432420605913338, 0.24286481344394953, 0.6334689430732575,], [ -0.14137617490461166, 0.003352264536796283, 0.72726864263183,], [ -0.24286481344394953, 0.3432420605913338, 0.6334689430732575,], [ -0.3010996919956904, -0.15159605858926453, 0.5628566923390071,], [ 0.23272176204453937, -0.22078329046522133, 0.9113919236888627,], [ -0.03004175741525734, -0.1381895881369778, 0.545451303246514,], [ 0.05866480459113656, -0.3308844032338997, 0.2861861058936483,], [ 0.2752945886840013, -0.1905075625186843, 0.8019241769361253,], [ -0.2960820548324385, -0.15641449633222393, 0.34417989389567694,], [ -0.12411149131306203, 0.06778494104304725, 0.27273135859688163,], [ -0.3709159571262127, -0.22043239723385152, 0.5501605407292253,], [ 0.19516660498354385, -0.181961524226949, 1.0,], [ 0.2614910947890534, 0.006880508491315662, 0.25150521267141857,], [ -0.35373066958927196, 0.2273205080756338, 1.0,], [ -0.3535130717427297, -0.35357582625438827, 0.7499473440345463,], [ 0.02071796769739012, 0.19588457268134912, 1.0,], [ 0.25038069608229085, 0.08273282305366661, 0.5271339135345402,], [ 0.3213106369533618, 0.3827575233600255, 0.8333496137776426,], [ 0.22937079846756286, 0.3750829832922387, 0.9429751416480727,], [ 0.11283194123344073, 0.16008067191774167, 0.5100226041806184,], [ -0.20163077877197452, -0.0029129171295422637, 0.0,], [ -0.04484101769180693, -0.039240131898362104, 0.0,], [ 0.10547450024114946, -0.16880936970747587, 0.1416705253853082,], [ 0.14439163046688128, -0.39236667705674766, 0.28964912334810244,], [ -0.11035141320596037, -0.23272151617106032, 0.8429745430544462,], [ -0.29879556015359177, -0.295826539010757, 0.6997870384432034,], [ -0.40559107737231626, -0.11085127653671033, 0.3002129631402097,], [ -0.1905075625186843, -0.2752945886840013, 0.8019241769361253,], [ -0.03319300091782479, 0.261138630970263, 0.34397232458352234,], [ -0.3830425941522091, -0.3213419137658031, 0.6666744211770179,], [ 0.43299324531432326, 0.2499887675338708, 0.500000001309108,], [ -0.1282022509828264, -0.04280900393084118, 0.0,], [ -0.3460761710126883, -0.2383022164555415, 0.5302073804909463,],] +indices = [ [ 2, 288, 290,], [ 284, 430, 9,], [ 281, 326, 284,], [ 326, 415, 284,], [ 415, 430, 284,], [ 274, 272, 273,], [ 283, 572, 282,], [ 8, 437, 283,], [ 437, 562, 283,], [ 562, 572, 283,], [ 287, 1, 289,], [ 293, 150, 6,], [ 296, 250, 293,], [ 250, 352, 293,], [ 352, 150, 293,], [ 304, 303, 305,], [ 294, 13, 295,], [ 7, 263, 294,], [ 263, 384, 294,], [ 384, 13, 294,], [ 11, 3, 288,], [ 288, 3, 290,], [ 286, 178, 11,], [ 5, 3, 11,], [ 11, 178, 5,], [ 9, 381, 286,], [ 381, 178, 286,], [ 9, 430, 381,], [ 280, 561, 281,], [ 281, 561, 326,], [ 276, 363, 280,], [ 280, 363, 561,], [ 274, 106, 276,], [ 276, 106, 277,], [ 277, 363, 276,], [ 273, 106, 274,], [ 277, 106, 273,], [ 279, 363, 277,], [ 282, 561, 279,], [ 561, 363, 279,], [ 282, 572, 561,], [ 285, 503, 8,], [ 8, 503, 437,], [ 10, 350, 285,], [ 285, 350, 503,], [ 287, 0, 10,], [ 10, 0, 4,], [ 4, 350, 10,], [ 289, 0, 287,], [ 4, 0, 289,], [ 291, 350, 4,], [ 6, 503, 291,], [ 503, 350, 291,], [ 6, 150, 503,], [ 297, 23, 296,], [ 296, 23, 250,], [ 301, 215, 297,], [ 297, 215, 23,], [ 303, 475, 301,], [ 301, 475, 300,], [ 300, 215, 301,], [ 304, 475, 303,], [ 300, 475, 304,], [ 298, 215, 300,], [ 295, 23, 298,], [ 23, 215, 298,], [ 295, 13, 23,], [ 292, 381, 7,], [ 7, 381, 263,], [ 5, 178, 292,], [ 292, 178, 381,], [ 290, 3, 5,], [ 326, 562, 415,], [ 326, 572, 562,], [ 561, 572, 326,], [ 415, 384, 263,], [ 263, 430, 415,], [ 562, 397, 415,], [ 415, 397, 384,], [ 250, 384, 352,], [ 250, 13, 384,], [ 23, 13, 250,], [ 352, 562, 437,], [ 437, 150, 352,], [ 503, 150, 437,], [ 352, 397, 562,], [ 384, 397, 352,], [ 381, 430, 263,], [ 2, 288, 151,], [ 284, 213, 9,], [ 538, 213, 284,], [ 221, 117, 241,], [ 494, 117, 221,], [ 359, 375, 385,], [ 11, 266, 288,], [ 288, 266, 151,], [ 286, 229, 11,], [ 229, 266, 11,], [ 9, 466, 286,], [ 286, 466, 229,], [ 9, 213, 466,], [ 241, 476, 275,], [ 241, 117, 476,], [ 275, 226, 339,], [ 275, 476, 226,], [ 339, 453, 359,], [ 226, 453, 339,], [ 359, 453, 375,], [ 151, 266, 460,], [ 460, 522, 227,], [ 460, 147, 522,], [ 266, 147, 460,], [ 227, 21, 96,], [ 522, 21, 227,], [ 96, 459, 500,], [ 96, 21, 459,], [ 500, 373, 79,], [ 459, 373, 500,], [ 79, 109, 496,], [ 79, 373, 109,], [ 496, 371, 477,], [ 109, 371, 496,], [ 477, 446, 230,], [ 477, 371, 446,], [ 230, 470, 186,], [ 446, 470, 230,], [ 186, 419, 494,], [ 186, 470, 419,], [ 419, 117, 494,], [ 113, 22, 538,], [ 22, 213, 538,], [ 550, 86, 113,], [ 86, 22, 113,], [ 142, 344, 550,], [ 550, 344, 86,], [ 88, 184, 142,], [ 184, 344, 142,], [ 407, 265, 88,], [ 88, 265, 184,], [ 461, 533, 407,], [ 533, 265, 407,], [ 542, 487, 461,], [ 461, 487, 533,], [ 396, 325, 542,], [ 325, 487, 542,], [ 375, 341, 396,], [ 396, 341, 325,], [ 453, 341, 375,], [ 265, 99, 184,], [ 99, 73, 184,], [ 73, 344, 184,], [ 86, 447, 22,], [ 86, 527, 447,], [ 86, 344, 527,], [ 487, 59, 533,], [ 59, 143, 533,], [ 143, 265, 533,], [ 92, 422, 325,], [ 325, 341, 92,], [ 325, 422, 487,], [ 229, 147, 266,], [ 229, 74, 137,], [ 137, 147, 229,], [ 466, 74, 229,], [ 131, 507, 109,], [ 109, 373, 131,], [ 507, 371, 109,], [ 459, 357, 131,], [ 131, 373, 459,], [ 21, 357, 459,], [ 524, 410, 446,], [ 446, 371, 524,], [ 410, 470, 446,], [ 419, 470, 36,], [ 36, 451, 419,], [ 419, 451, 476,], [ 476, 117, 419,], [ 226, 92, 453,], [ 226, 451, 92,], [ 476, 451, 226,], [ 522, 137, 45,], [ 45, 21, 522,], [ 522, 147, 137,], [ 92, 341, 453,], [ 92, 36, 422,], [ 92, 451, 36,], [ 447, 74, 22,], [ 22, 74, 466,], [ 466, 213, 22,], [ 527, 45, 447,], [ 45, 137, 447,], [ 137, 74, 447,], [ 527, 357, 45,], [ 527, 344, 73,], [ 73, 357, 527,], [ 45, 357, 21,], [ 487, 422, 59,], [ 59, 524, 143,], [ 59, 410, 524,], [ 422, 410, 59,], [ 524, 507, 143,], [ 143, 99, 265,], [ 143, 507, 99,], [ 524, 371, 507,], [ 36, 410, 422,], [ 36, 470, 410,], [ 99, 131, 73,], [ 99, 507, 131,], [ 131, 357, 73,], [ 538, 284, 281,], [ 272, 443, 274,], [ 379, 443, 272,], [ 385, 480, 242,], [ 375, 480, 385,], [ 540, 390, 440,], [ 280, 432, 281,], [ 281, 432, 538,], [ 276, 261, 280,], [ 261, 432, 280,], [ 274, 245, 276,], [ 276, 245, 261,], [ 274, 443, 245,], [ 242, 355, 159,], [ 242, 480, 355,], [ 159, 321, 52,], [ 159, 355, 321,], [ 52, 317, 540,], [ 321, 317, 52,], [ 540, 317, 390,], [ 538, 228, 113,], [ 432, 228, 538,], [ 113, 56, 550,], [ 113, 228, 56,], [ 550, 370, 142,], [ 56, 370, 550,], [ 142, 240, 88,], [ 142, 370, 240,], [ 88, 383, 407,], [ 240, 383, 88,], [ 407, 212, 461,], [ 407, 383, 212,], [ 461, 115, 542,], [ 212, 115, 461,], [ 542, 387, 396,], [ 542, 115, 387,], [ 396, 180, 375,], [ 387, 180, 396,], [ 180, 480, 375,], [ 318, 502, 379,], [ 502, 443, 379,], [ 531, 112, 318,], [ 318, 112, 502,], [ 501, 567, 531,], [ 567, 112, 531,], [ 492, 210, 501,], [ 501, 210, 567,], [ 14, 243, 492,], [ 243, 210, 492,], [ 420, 551, 14,], [ 14, 551, 243,], [ 570, 43, 420,], [ 43, 551, 420,], [ 555, 252, 570,], [ 570, 252, 43,], [ 26, 441, 555,], [ 441, 252, 555,], [ 390, 317, 26,], [ 26, 247, 441,], [ 317, 247, 26,], [ 383, 27, 212,], [ 27, 372, 212,], [ 372, 115, 212,], [ 387, 218, 180,], [ 387, 58, 218,], [ 387, 115, 58,], [ 370, 426, 240,], [ 426, 192, 240,], [ 192, 383, 240,], [ 194, 31, 56,], [ 56, 228, 194,], [ 56, 31, 370,], [ 321, 247, 317,], [ 321, 179, 530,], [ 530, 247, 321,], [ 355, 179, 321,], [ 544, 146, 243,], [ 243, 551, 544,], [ 146, 210, 243,], [ 43, 484, 544,], [ 544, 551, 43,], [ 252, 484, 43,], [ 529, 156, 567,], [ 567, 210, 529,], [ 156, 112, 567,], [ 502, 112, 452,], [ 452, 152, 502,], [ 502, 152, 245,], [ 245, 443, 502,], [ 261, 194, 432,], [ 261, 152, 194,], [ 245, 152, 261,], [ 441, 530, 231,], [ 231, 252, 441,], [ 441, 247, 530,], [ 194, 228, 432,], [ 194, 452, 31,], [ 194, 152, 452,], [ 218, 179, 180,], [ 180, 179, 355,], [ 355, 480, 180,], [ 58, 231, 218,], [ 231, 530, 218,], [ 530, 179, 218,], [ 58, 484, 231,], [ 58, 115, 372,], [ 372, 484, 58,], [ 231, 484, 252,], [ 370, 31, 426,], [ 426, 529, 192,], [ 426, 156, 529,], [ 31, 156, 426,], [ 529, 146, 192,], [ 192, 27, 383,], [ 192, 146, 27,], [ 529, 210, 146,], [ 452, 156, 31,], [ 452, 112, 156,], [ 27, 544, 372,], [ 27, 146, 544,], [ 544, 484, 372,], [ 272, 273, 379,], [ 283, 471, 282,], [ 513, 471, 283,], [ 440, 25, 354,], [ 390, 25, 440,], [ 28, 177, 509,], [ 277, 425, 273,], [ 273, 425, 379,], [ 279, 337, 277,], [ 337, 425, 277,], [ 282, 517, 279,], [ 279, 517, 337,], [ 282, 471, 517,], [ 354, 322, 211,], [ 354, 25, 322,], [ 211, 409, 118,], [ 211, 322, 409,], [ 118, 201, 28,], [ 409, 201, 118,], [ 28, 201, 177,], [ 379, 425, 318,], [ 318, 316, 531,], [ 318, 123, 316,], [ 425, 123, 318,], [ 531, 454, 501,], [ 316, 454, 531,], [ 501, 310, 492,], [ 501, 454, 310,], [ 492, 85, 14,], [ 310, 85, 492,], [ 14, 573, 420,], [ 14, 85, 573,], [ 420, 102, 570,], [ 573, 102, 420,], [ 570, 566, 555,], [ 570, 102, 566,], [ 555, 306, 26,], [ 566, 306, 555,], [ 26, 416, 390,], [ 26, 306, 416,], [ 416, 25, 390,], [ 187, 488, 513,], [ 488, 471, 513,], [ 309, 406, 187,], [ 406, 488, 187,], [ 176, 202, 309,], [ 309, 202, 406,], [ 414, 436, 176,], [ 436, 202, 176,], [ 546, 24, 414,], [ 414, 24, 436,], [ 515, 124, 546,], [ 124, 24, 546,], [ 320, 455, 515,], [ 515, 455, 124,], [ 520, 248, 320,], [ 248, 455, 320,], [ 177, 473, 520,], [ 520, 473, 248,], [ 201, 473, 177,], [ 24, 435, 436,], [ 435, 417, 436,], [ 417, 202, 436,], [ 406, 174, 488,], [ 406, 323, 174,], [ 406, 202, 323,], [ 455, 246, 124,], [ 246, 338, 124,], [ 338, 24, 124,], [ 565, 537, 248,], [ 248, 473, 565,], [ 248, 537, 455,], [ 337, 123, 425,], [ 337, 93, 162,], [ 162, 123, 337,], [ 517, 93, 337,], [ 504, 474, 573,], [ 573, 85, 504,], [ 474, 102, 573,], [ 310, 549, 504,], [ 504, 85, 310,], [ 454, 549, 310,], [ 168, 191, 566,], [ 566, 102, 168,], [ 191, 306, 566,], [ 416, 306, 568,], [ 568, 307, 416,], [ 416, 307, 322,], [ 322, 25, 416,], [ 409, 565, 201,], [ 409, 307, 565,], [ 322, 307, 409,], [ 316, 162, 523,], [ 523, 454, 316,], [ 316, 123, 162,], [ 565, 473, 201,], [ 565, 568, 537,], [ 565, 307, 568,], [ 174, 93, 488,], [ 488, 93, 517,], [ 517, 471, 488,], [ 323, 523, 174,], [ 523, 162, 174,], [ 162, 93, 174,], [ 323, 549, 523,], [ 323, 202, 417,], [ 417, 549, 323,], [ 523, 549, 454,], [ 455, 537, 246,], [ 246, 168, 338,], [ 246, 191, 168,], [ 537, 191, 246,], [ 168, 474, 338,], [ 338, 435, 24,], [ 338, 474, 435,], [ 168, 102, 474,], [ 568, 191, 537,], [ 568, 306, 191,], [ 435, 504, 417,], [ 435, 474, 504,], [ 504, 549, 417,], [ 513, 283, 8,], [ 1, 427, 287,], [ 429, 427, 1,], [ 509, 505, 219,], [ 177, 505, 509,], [ 30, 89, 358,], [ 285, 233, 8,], [ 8, 233, 513,], [ 10, 139, 285,], [ 139, 233, 285,], [ 287, 199, 10,], [ 10, 199, 139,], [ 287, 427, 199,], [ 219, 340, 552,], [ 219, 505, 340,], [ 552, 545, 299,], [ 552, 340, 545,], [ 299, 185, 30,], [ 545, 185, 299,], [ 30, 185, 89,], [ 513, 264, 187,], [ 233, 264, 513,], [ 187, 198, 309,], [ 187, 264, 198,], [ 309, 508, 176,], [ 198, 508, 309,], [ 176, 75, 414,], [ 176, 508, 75,], [ 414, 166, 546,], [ 75, 166, 414,], [ 546, 356, 515,], [ 546, 166, 356,], [ 515, 319, 320,], [ 356, 319, 515,], [ 320, 404, 520,], [ 320, 319, 404,], [ 520, 122, 177,], [ 404, 122, 520,], [ 122, 505, 177,], [ 120, 534, 429,], [ 534, 427, 429,], [ 351, 445, 120,], [ 120, 445, 534,], [ 485, 157, 351,], [ 157, 445, 351,], [ 84, 181, 485,], [ 485, 181, 157,], [ 506, 63, 84,], [ 63, 181, 84,], [ 87, 214, 506,], [ 506, 214, 63,], [ 104, 41, 87,], [ 41, 214, 87,], [ 346, 408, 104,], [ 104, 408, 41,], [ 393, 203, 346,], [ 203, 408, 346,], [ 89, 185, 393,], [ 393, 149, 203,], [ 185, 149, 393,], [ 166, 308, 356,], [ 308, 478, 356,], [ 478, 319, 356,], [ 404, 65, 122,], [ 404, 535, 65,], [ 404, 319, 535,], [ 508, 16, 75,], [ 16, 66, 75,], [ 66, 166, 75,], [ 262, 412, 198,], [ 198, 264, 262,], [ 198, 412, 508,], [ 545, 149, 185,], [ 545, 398, 130,], [ 130, 149, 545,], [ 340, 398, 545,], [ 116, 516, 63,], [ 63, 214, 116,], [ 516, 181, 63,], [ 41, 132, 116,], [ 116, 214, 41,], [ 408, 132, 41,], [ 374, 547, 157,], [ 157, 181, 374,], [ 547, 445, 157,], [ 534, 445, 342,], [ 342, 327, 534,], [ 534, 327, 199,], [ 199, 427, 534,], [ 139, 262, 233,], [ 139, 327, 262,], [ 199, 327, 139,], [ 203, 130, 98,], [ 98, 408, 203,], [ 203, 149, 130,], [ 262, 264, 233,], [ 262, 342, 412,], [ 262, 327, 342,], [ 65, 398, 122,], [ 122, 398, 340,], [ 340, 505, 122,], [ 535, 98, 65,], [ 98, 130, 65,], [ 130, 398, 65,], [ 535, 132, 98,], [ 535, 319, 478,], [ 478, 132, 535,], [ 98, 132, 408,], [ 508, 412, 16,], [ 16, 374, 66,], [ 16, 547, 374,], [ 412, 547, 16,], [ 374, 516, 66,], [ 66, 308, 166,], [ 66, 516, 308,], [ 374, 181, 516,], [ 342, 547, 412,], [ 342, 445, 547,], [ 308, 116, 478,], [ 308, 516, 116,], [ 116, 132, 478,], [ 1, 289, 429,], [ 293, 365, 6,], [ 46, 365, 293,], [ 358, 463, 335,], [ 89, 463, 358,], [ 220, 204, 196,], [ 4, 311, 289,], [ 289, 311, 429,], [ 291, 347, 4,], [ 347, 311, 4,], [ 6, 114, 291,], [ 291, 114, 347,], [ 6, 365, 114,], [ 335, 105, 302,], [ 335, 463, 105,], [ 302, 353, 237,], [ 302, 105, 353,], [ 237, 127, 220,], [ 353, 127, 237,], [ 220, 127, 204,], [ 429, 311, 120,], [ 120, 62, 351,], [ 120, 433, 62,], [ 311, 433, 120,], [ 351, 564, 485,], [ 62, 564, 351,], [ 485, 121, 84,], [ 485, 564, 121,], [ 84, 206, 506,], [ 121, 206, 84,], [ 506, 472, 87,], [ 506, 206, 472,], [ 87, 208, 104,], [ 472, 208, 87,], [ 104, 134, 346,], [ 104, 208, 134,], [ 346, 111, 393,], [ 134, 111, 346,], [ 393, 161, 89,], [ 393, 111, 161,], [ 161, 463, 89,], [ 467, 563, 46,], [ 563, 365, 46,], [ 34, 498, 467,], [ 498, 563, 467,], [ 439, 232, 34,], [ 34, 232, 498,], [ 495, 395, 439,], [ 395, 232, 439,], [ 172, 312, 495,], [ 495, 312, 395,], [ 119, 51, 172,], [ 51, 312, 172,], [ 42, 95, 119,], [ 119, 95, 51,], [ 183, 251, 42,], [ 251, 95, 42,], [ 204, 235, 183,], [ 183, 235, 251,], [ 127, 235, 204,], [ 312, 482, 395,], [ 482, 512, 395,], [ 512, 232, 395,], [ 498, 133, 563,], [ 498, 57, 133,], [ 498, 232, 57,], [ 95, 525, 51,], [ 525, 438, 51,], [ 438, 312, 51,], [ 491, 158, 251,], [ 251, 235, 491,], [ 251, 158, 95,], [ 347, 433, 311,], [ 347, 511, 444,], [ 444, 433, 347,], [ 114, 511, 347,], [ 449, 78, 472,], [ 472, 206, 449,], [ 78, 208, 472,], [ 121, 222, 449,], [ 449, 206, 121,], [ 564, 222, 121,], [ 60, 169, 134,], [ 134, 208, 60,], [ 169, 111, 134,], [ 161, 111, 548,], [ 548, 129, 161,], [ 161, 129, 105,], [ 105, 463, 161,], [ 353, 491, 127,], [ 353, 129, 491,], [ 105, 129, 353,], [ 62, 444, 539,], [ 539, 564, 62,], [ 62, 433, 444,], [ 491, 235, 127,], [ 491, 548, 158,], [ 491, 129, 548,], [ 133, 511, 563,], [ 563, 511, 114,], [ 114, 365, 563,], [ 57, 539, 133,], [ 539, 444, 133,], [ 444, 511, 133,], [ 57, 222, 539,], [ 57, 232, 512,], [ 512, 222, 57,], [ 539, 222, 564,], [ 95, 158, 525,], [ 525, 60, 438,], [ 525, 169, 60,], [ 158, 169, 525,], [ 60, 78, 438,], [ 438, 482, 312,], [ 438, 78, 482,], [ 60, 208, 78,], [ 548, 169, 158,], [ 548, 111, 169,], [ 482, 449, 512,], [ 482, 78, 449,], [ 449, 222, 512,], [ 293, 296, 46,], [ 305, 138, 303,], [ 200, 138, 305,], [ 196, 101, 334,], [ 204, 101, 196,], [ 44, 190, 141,], [ 297, 148, 296,], [ 296, 148, 46,], [ 301, 315, 297,], [ 315, 148, 297,], [ 303, 331, 301,], [ 301, 331, 315,], [ 303, 138, 331,], [ 334, 224, 421,], [ 334, 101, 224,], [ 421, 255, 532,], [ 421, 224, 255,], [ 532, 259, 44,], [ 255, 259, 532,], [ 44, 259, 190,], [ 46, 348, 467,], [ 148, 348, 46,], [ 467, 528, 34,], [ 467, 348, 528,], [ 34, 209, 439,], [ 528, 209, 34,], [ 439, 336, 495,], [ 439, 209, 336,], [ 495, 197, 172,], [ 336, 197, 495,], [ 172, 366, 119,], [ 172, 197, 366,], [ 119, 465, 42,], [ 366, 465, 119,], [ 42, 193, 183,], [ 42, 465, 193,], [ 183, 400, 204,], [ 193, 400, 183,], [ 400, 101, 204,], [ 258, 82, 200,], [ 82, 138, 200,], [ 53, 469, 258,], [ 258, 469, 82,], [ 83, 18, 53,], [ 18, 469, 53,], [ 91, 369, 83,], [ 83, 369, 18,], [ 571, 333, 91,], [ 333, 369, 91,], [ 160, 33, 571,], [ 571, 33, 333,], [ 15, 541, 160,], [ 541, 33, 160,], [ 29, 324, 15,], [ 15, 324, 541,], [ 558, 140, 29,], [ 140, 324, 29,], [ 190, 259, 558,], [ 558, 329, 140,], [ 259, 329, 558,], [ 197, 557, 366,], [ 557, 207, 366,], [ 207, 465, 366,], [ 193, 361, 400,], [ 193, 526, 361,], [ 193, 465, 526,], [ 209, 154, 336,], [ 154, 388, 336,], [ 388, 197, 336,], [ 386, 553, 528,], [ 528, 348, 386,], [ 528, 553, 209,], [ 255, 329, 259,], [ 255, 401, 54,], [ 54, 329, 255,], [ 224, 401, 255,], [ 40, 434, 333,], [ 333, 33, 40,], [ 434, 369, 333,], [ 541, 97, 40,], [ 40, 33, 541,], [ 324, 97, 541,], [ 55, 424, 18,], [ 18, 369, 55,], [ 424, 469, 18,], [ 82, 469, 128,], [ 128, 428, 82,], [ 82, 428, 331,], [ 331, 138, 82,], [ 315, 386, 148,], [ 315, 428, 386,], [ 331, 428, 315,], [ 140, 54, 345,], [ 345, 324, 140,], [ 140, 329, 54,], [ 386, 348, 148,], [ 386, 128, 553,], [ 386, 428, 128,], [ 361, 401, 400,], [ 400, 401, 224,], [ 224, 101, 400,], [ 526, 345, 361,], [ 345, 54, 361,], [ 54, 401, 361,], [ 526, 97, 345,], [ 526, 465, 207,], [ 207, 97, 526,], [ 345, 97, 324,], [ 209, 553, 154,], [ 154, 55, 388,], [ 154, 424, 55,], [ 553, 424, 154,], [ 55, 434, 388,], [ 388, 557, 197,], [ 388, 434, 557,], [ 55, 369, 434,], [ 128, 424, 553,], [ 128, 469, 424,], [ 557, 40, 207,], [ 557, 434, 40,], [ 40, 97, 207,], [ 200, 305, 304,], [ 294, 110, 295,], [ 72, 110, 294,], [ 141, 559, 225,], [ 190, 559, 141,], [ 556, 402, 76,], [ 300, 155, 304,], [ 304, 155, 200,], [ 298, 239, 300,], [ 239, 155, 300,], [ 295, 67, 298,], [ 298, 67, 239,], [ 295, 110, 67,], [ 225, 254, 368,], [ 225, 559, 254,], [ 368, 170, 462,], [ 368, 254, 170,], [ 462, 378, 556,], [ 170, 378, 462,], [ 556, 378, 402,], [ 200, 155, 258,], [ 258, 260, 53,], [ 258, 457, 260,], [ 155, 457, 258,], [ 53, 126, 83,], [ 260, 126, 53,], [ 83, 267, 91,], [ 83, 126, 267,], [ 91, 499, 571,], [ 267, 499, 91,], [ 571, 12, 160,], [ 571, 499, 12,], [ 160, 479, 15,], [ 12, 479, 160,], [ 15, 19, 29,], [ 15, 479, 19,], [ 29, 271, 558,], [ 19, 271, 29,], [ 558, 164, 190,], [ 558, 271, 164,], [ 164, 559, 190,], [ 392, 94, 72,], [ 94, 110, 72,], [ 268, 173, 392,], [ 173, 94, 392,], [ 403, 377, 268,], [ 268, 377, 173,], [ 165, 144, 403,], [ 144, 377, 403,], [ 38, 560, 165,], [ 165, 560, 144,], [ 70, 456, 38,], [ 456, 560, 38,], [ 256, 125, 70,], [ 70, 125, 456,], [ 64, 328, 256,], [ 328, 125, 256,], [ 402, 108, 64,], [ 64, 108, 328,], [ 378, 108, 402,], [ 560, 145, 144,], [ 145, 163, 144,], [ 163, 377, 144,], [ 173, 405, 94,], [ 173, 253, 405,], [ 173, 377, 253,], [ 125, 330, 456,], [ 330, 238, 456,], [ 238, 560, 456,], [ 20, 47, 328,], [ 328, 108, 20,], [ 328, 47, 125,], [ 239, 457, 155,], [ 239, 489, 418,], [ 418, 457, 239,], [ 67, 489, 239,], [ 81, 107, 12,], [ 12, 499, 81,], [ 107, 479, 12,], [ 267, 35, 81,], [ 81, 499, 267,], [ 126, 35, 267,], [ 411, 389, 19,], [ 19, 479, 411,], [ 389, 271, 19,], [ 164, 271, 17,], [ 17, 270, 164,], [ 164, 270, 254,], [ 254, 559, 164,], [ 170, 20, 378,], [ 170, 270, 20,], [ 254, 270, 170,], [ 260, 418, 61,], [ 61, 126, 260,], [ 260, 457, 418,], [ 20, 108, 378,], [ 20, 17, 47,], [ 20, 270, 17,], [ 405, 489, 94,], [ 94, 489, 67,], [ 67, 110, 94,], [ 253, 61, 405,], [ 61, 418, 405,], [ 418, 489, 405,], [ 253, 35, 61,], [ 253, 377, 163,], [ 163, 35, 253,], [ 61, 35, 126,], [ 125, 47, 330,], [ 330, 411, 238,], [ 330, 389, 411,], [ 47, 389, 330,], [ 411, 107, 238,], [ 238, 145, 560,], [ 238, 107, 145,], [ 411, 479, 107,], [ 17, 389, 47,], [ 17, 271, 389,], [ 145, 81, 163,], [ 145, 107, 81,], [ 81, 35, 163,], [ 2, 153, 290,], [ 151, 153, 2,], [ 294, 7, 72,], [ 554, 494, 221,], [ 76, 80, 360,], [ 402, 80, 76,], [ 292, 343, 7,], [ 7, 343, 72,], [ 5, 442, 292,], [ 442, 343, 292,], [ 290, 380, 5,], [ 5, 380, 442,], [ 290, 153, 380,], [ 360, 236, 32,], [ 360, 80, 236,], [ 32, 39, 278,], [ 32, 236, 39,], [ 278, 394, 554,], [ 39, 394, 278,], [ 554, 394, 494,], [ 460, 50, 151,], [ 50, 153, 151,], [ 227, 135, 460,], [ 460, 135, 50,], [ 96, 423, 227,], [ 423, 135, 227,], [ 500, 399, 96,], [ 96, 399, 423,], [ 79, 521, 500,], [ 521, 399, 500,], [ 496, 364, 79,], [ 79, 364, 521,], [ 477, 543, 496,], [ 543, 364, 496,], [ 230, 171, 477,], [ 477, 171, 543,], [ 186, 376, 230,], [ 376, 171, 230,], [ 494, 394, 186,], [ 186, 431, 376,], [ 394, 431, 186,], [ 72, 313, 392,], [ 343, 313, 72,], [ 392, 382, 268,], [ 392, 313, 382,], [ 268, 77, 403,], [ 382, 77, 268,], [ 403, 510, 165,], [ 403, 77, 510,], [ 165, 413, 38,], [ 510, 413, 165,], [ 38, 223, 70,], [ 38, 413, 223,], [ 70, 257, 256,], [ 223, 257, 70,], [ 256, 175, 64,], [ 256, 257, 175,], [ 64, 458, 402,], [ 175, 458, 64,], [ 458, 80, 402,], [ 413, 269, 223,], [ 269, 103, 223,], [ 103, 257, 223,], [ 175, 519, 458,], [ 175, 49, 519,], [ 175, 257, 49,], [ 77, 569, 510,], [ 569, 518, 510,], [ 518, 413, 510,], [ 314, 167, 382,], [ 382, 313, 314,], [ 382, 167, 77,], [ 39, 431, 394,], [ 39, 182, 450,], [ 450, 431, 39,], [ 236, 182, 39,], [ 464, 69, 521,], [ 521, 364, 464,], [ 69, 399, 521,], [ 543, 448, 464,], [ 464, 364, 543,], [ 171, 448, 543,], [ 205, 37, 423,], [ 423, 399, 205,], [ 37, 135, 423,], [ 50, 135, 234,], [ 234, 249, 50,], [ 50, 249, 380,], [ 380, 153, 50,], [ 442, 314, 343,], [ 442, 249, 314,], [ 380, 249, 442,], [ 376, 450, 483,], [ 483, 171, 376,], [ 376, 431, 450,], [ 314, 313, 343,], [ 314, 234, 167,], [ 314, 249, 234,], [ 519, 182, 458,], [ 458, 182, 236,], [ 236, 80, 458,], [ 49, 483, 519,], [ 483, 450, 519,], [ 450, 182, 519,], [ 49, 448, 483,], [ 49, 257, 103,], [ 103, 448, 49,], [ 483, 448, 171,], [ 77, 167, 569,], [ 569, 205, 518,], [ 569, 37, 205,], [ 167, 37, 569,], [ 205, 69, 518,], [ 518, 269, 413,], [ 518, 69, 269,], [ 205, 399, 69,], [ 234, 37, 167,], [ 234, 135, 37,], [ 269, 464, 103,], [ 269, 69, 464,], [ 464, 448, 103,], [ 221, 241, 554,], [ 385, 100, 359,], [ 242, 486, 385,], [ 486, 349, 385,], [ 349, 100, 385,], [ 540, 440, 354,], [ 509, 216, 28,], [ 219, 71, 509,], [ 71, 490, 509,], [ 490, 216, 509,], [ 335, 30, 358,], [ 196, 481, 220,], [ 334, 136, 196,], [ 136, 217, 196,], [ 217, 481, 196,], [ 141, 225, 44,], [ 76, 362, 556,], [ 360, 514, 76,], [ 514, 188, 76,], [ 188, 362, 76,], [ 275, 332, 241,], [ 241, 332, 554,], [ 339, 189, 275,], [ 278, 332, 275,], [ 275, 189, 278,], [ 359, 90, 339,], [ 90, 189, 339,], [ 359, 100, 90,], [ 159, 468, 242,], [ 242, 468, 486,], [ 52, 195, 159,], [ 159, 195, 468,], [ 540, 48, 52,], [ 52, 48, 211,], [ 211, 195, 52,], [ 354, 48, 540,], [ 211, 48, 354,], [ 118, 195, 211,], [ 28, 468, 118,], [ 468, 195, 118,], [ 28, 216, 468,], [ 552, 493, 219,], [ 219, 493, 71,], [ 299, 391, 552,], [ 552, 391, 493,], [ 30, 244, 299,], [ 299, 244, 302,], [ 302, 391, 299,], [ 335, 244, 30,], [ 302, 244, 335,], [ 237, 391, 302,], [ 220, 493, 237,], [ 493, 391, 237,], [ 220, 481, 493,], [ 421, 367, 334,], [ 334, 367, 136,], [ 532, 68, 421,], [ 421, 68, 367,], [ 44, 536, 532,], [ 532, 536, 368,], [ 368, 68, 532,], [ 225, 536, 44,], [ 368, 536, 225,], [ 462, 68, 368,], [ 556, 367, 462,], [ 367, 68, 462,], [ 556, 362, 367,], [ 32, 90, 360,], [ 360, 90, 514,], [ 278, 189, 32,], [ 32, 189, 90,], [ 554, 332, 278,], [ 71, 217, 490,], [ 71, 481, 217,], [ 493, 481, 71,], [ 490, 349, 486,], [ 486, 216, 490,], [ 490, 497, 349,], [ 217, 497, 490,], [ 514, 349, 188,], [ 514, 100, 349,], [ 90, 100, 514,], [ 188, 217, 136,], [ 136, 362, 188,], [ 367, 362, 136,], [ 349, 497, 188,], [ 188, 497, 217,], [ 468, 216, 486,],] diff --git a/scripts/rustbca.py b/scripts/rustbca.py index ac6afc1..2654c97 100644 --- a/scripts/rustbca.py +++ b/scripts/rustbca.py @@ -136,7 +136,7 @@ def do_trajectory_plot(name, thickness=None, depth=None, boundary=None, plot_fin plt.savefig(name+'trajectories_.png') plt.close() -def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_final_positions=True, plot_origins=True, radius=None): +def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_final_positions=True, plot_origins=True, radius=None, cube_length=None, input_file=None): ''' Plots trajectories of ions and recoils from [name]trajectories.output. Optionally marks final positions/origins and draws material geometry. @@ -154,7 +154,7 @@ def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_ ''' - from mayavi.mlab import points3d, plot3d, mesh + from mayavi.mlab import points3d, plot3d, mesh, triangular_mesh reflected = np.atleast_2d(np.genfromtxt(name+'reflected.output', delimiter=',')) sputtered = np.atleast_2d(np.genfromtxt(name+'sputtered.output', delimiter=',')) @@ -169,16 +169,17 @@ def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_ index = 0 x_max = 0 - min_length = 3 + min_length = 1 + scale_factor = 200.0 if np.size(trajectories) > 0: for trajectory_length in trajectory_data: M = trajectories[index, 0] Z = trajectories[index, 1] E = trajectories[index:(trajectory_length + index), 2] - x = trajectories[index:(trajectory_length + index), 3] - y = trajectories[index:(trajectory_length + index), 4] - z = trajectories[index:(trajectory_length + index), 5] + x = trajectories[index:(trajectory_length + index), 3]*scale_factor + y = trajectories[index:(trajectory_length + index), 4]*scale_factor + z = trajectories[index:(trajectory_length + index), 5]*scale_factor if np.max(x) > x_max: x_max = np.max(x) @@ -193,17 +194,17 @@ def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_ if np.size(sputtered) > 0: sputtered_colors = [colormap.to_rgba(Z)[:3] for Z in sputtered[:,1]] for x, y, z, c in zip(sputtered[:,3], sputtered[:,4], sputtered[:,5], sputtered_colors): - points3d(x, y, z, color=c, scale_factor=2) + points3d(x*scale_factor, y*scale_factor, z*scale_factor, color=c, scale_factor=2) if np.size(reflected) > 0: reflected_colors = [colormap.to_rgba(Z)[:3] for Z in reflected[:,1]] for x, y, z, c in zip(reflected[:,3], reflected[:,4], reflected[:,5], reflected_colors): - points3d(x, y, z, color=c, scale_factor=2) + points3d(x*scale_factor, y*scale_factor, z*scale_factor, color=c, scale_factor=2) if np.size(deposited) > 0: deposited_colors = [colormap.to_rgba(Z)[:3] for Z in deposited[:,1]] for x, y, z, c in zip(deposited[:,2], deposited[:,3], deposited[:,4], deposited_colors): - points3d(x, y, z, color=c, scale_factor=2) + points3d(x*scale_factor, y*scale_factor, z*scale_factor, color=c, scale_factor=2) if boundary: x = [x_ for (x_, y_) in boundary] @@ -221,6 +222,53 @@ def do_trajectory_plot_3d(name, thickness=None, depth=None, boundary=None, plot_ z = np.cos(theta) mesh(radius*x, radius*y, radius*z, color=(0.1,0.7,0.3), opacity=0.2) + if cube_length: + faces = [] + + xmin = -cube_length/2.*scale_factor + xmax = cube_length/2.*scale_factor + ymin = -cube_length/2.*scale_factor + ymax = cube_length/2.*scale_factor + zmin = -cube_length/2.*scale_factor + zmax = cube_length/2.*scale_factor + + x,y = np.mgrid[xmin:xmax:3j,ymin:ymax:3j] + z = np.ones(y.shape)*zmin + faces.append((x,y,z)) + + x,y = np.mgrid[xmin:xmax:3j,ymin:ymax:3j] + z = np.ones(y.shape)*zmax + faces.append((x,y,z)) + + x,z = np.mgrid[xmin:xmax:3j,zmin:zmax:3j] + y = np.ones(z.shape)*ymin + faces.append((x,y,z)) + + x,z = np.mgrid[xmin:xmax:3j,zmin:zmax:3j] + y = np.ones(z.shape)*ymax + faces.append((x,y,z)) + + y,z = np.mgrid[ymin:ymax:3j,zmin:zmax:3j] + x = np.ones(z.shape)*xmin + faces.append((x,y,z)) + + y,z = np.mgrid[ymin:ymax:3j,zmin:zmax:3j] + x = np.ones(z.shape)*xmax + faces.append((x,y,z)) + + for grid in faces: + x,y,z = grid + mesh(x, y, z, opacity=0.4, color=(0.1,0.7,0.3)) + + if input_file: + input = toml.load(input_file) + vertices = input['geometry_input']['vertices'] + triangles = input['geometry_input']['indices'] + x = [vertex[0]*scale_factor for vertex in vertices] + y = [vertex[1]*scale_factor for vertex in vertices] + z = [vertex[2]*scale_factor for vertex in vertices] + triangular_mesh(x, y, z, triangles, opacity=0.3, color=(0.1, 0.7, 0.3), representation='surface') + def generate_rustbca_input(Zb, Mb, n, Eca, Ecb, Esa, Esb, Eb, Ma, Za, E0, N, N_, theta, thickness, depth, track_trajectories=True, track_recoils=True, diff --git a/src/bca.rs b/src/bca.rs index 771acb7..d6b7f97 100644 --- a/src/bca.rs +++ b/src/bca.rs @@ -84,6 +84,13 @@ pub fn single_ion_bca(particle: particle::Particle, material: &mate //Choose impact parameters and azimuthal angles for all collisions, and determine mean free path let binary_collision_geometries = bca::determine_mfp_phi_impact_parameter(&mut particle_1, &material, &options); + #[cfg(feature = "accelerated_ions")] + if !material.inside(particle_1.pos.x, particle_1.pos.y, particle_1.pos.z) { + let (x, y, z) = material.geometry.closest_point(particle_1.pos.x, particle_1.pos.y, particle_1.pos.z); + let distance_to = ((x - particle_1.pos.x).powi(2) + (y - particle_1.pos.y).powi(2) + (z - particle_1.pos.z).powi(2)).sqrt(); + mfp += distance_to; + } + let mut total_energy_loss = 0.; let mut total_asymptotic_deflection = 0.; let mut normalized_distance_of_closest_approach = 0.; @@ -330,9 +337,11 @@ pub fn determine_mfp_phi_impact_parameter(particle_1: &mut particle mfp *= -rand::random::().ln(); } + for k in 0..(options.weak_collision_order + 1) { binary_collision_geometries.push(BinaryCollisionGeometry::new(phis_azimuthal[k], impact_parameters[k], mfp)) } + return binary_collision_geometries; } } diff --git a/src/enums.rs b/src/enums.rs index 012b5a2..c3aa849 100644 --- a/src/enums.rs +++ b/src/enums.rs @@ -5,6 +5,10 @@ pub enum MaterialType { MESH1D(material::Material), MESH2D(material::Material), SPHERE(material::Material), + #[cfg(feature = "parry3d")] + BALL(material::Material), + #[cfg(feature = "parry3d")] + TRIMESH(material::Material) } #[derive(Deserialize)] @@ -13,6 +17,10 @@ pub enum GeometryType { MESH1D, MESH2D, SPHERE, + #[cfg(feature = "parry3d")] + BALL, + #[cfg(feature = "parry3d")] + TRIMESH, } /// Mode of electronic stopping to use. diff --git a/src/geometry.rs b/src/geometry.rs index 0d59108..0cce49e 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -427,7 +427,7 @@ impl Geometry for Mesh2D { fn get_densities_nearest_to(&self, x: f64, y: f64, z: f64) -> &Vec { self.nearest_to(x, y, z).get_densities() } - + fn inside_simulation_boundary(&self, x: f64, y: f64, z: f64) -> bool { self.simulation_boundary.contains(&point!(x: x, y: y)) } diff --git a/src/main.rs b/src/main.rs index 9e08cd2..64b8bd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,9 @@ pub mod consts; pub mod structs; pub mod sphere; +#[cfg(feature = "parry3d")] +pub mod parry; + pub use crate::enums::*; pub use crate::consts::*; pub use crate::structs::*; @@ -68,6 +71,9 @@ pub use crate::output::{OutputUnits}; pub use crate::geometry::{Geometry, GeometryElement, Mesh0D, Mesh1D, Mesh2D}; pub use crate::sphere::{Sphere, SphereInput, InputSphere}; +#[cfg(feature = "parry3d")] +pub use crate::parry::{ParryBall, ParryBallInput, InputParryBall, ParryTriMesh, ParryTriMeshInput, InputParryTriMesh}; + fn physics_loop(particle_input_array: Vec, material: material::Material, options: Options, output_units: OutputUnits) { println!("Processing {} ions...", particle_input_array.len()); @@ -158,6 +164,10 @@ fn main() { "1D" => GeometryType::MESH1D, "2D" => GeometryType::MESH2D, "SPHERE" => GeometryType::SPHERE, + #[cfg(feature = "parry3d")] + "BALL" => GeometryType::BALL, + #[cfg(feature = "parry3d")] + "TRIMESH" => GeometryType::TRIMESH, _ => panic!("Unimplemented geometry {}.", args[1].clone()) }), _ => panic!("Too many command line arguments. RustBCA accepts 0 (use 'input.toml') 1 () or 2 ( )"), @@ -179,6 +189,16 @@ fn main() { GeometryType::SPHERE => { let (particle_input_array, material, options, output_units) = input::input::(input_file); physics_loop::(particle_input_array, material, options, output_units); + }, + #[cfg(feature = "parry3d")] + GeometryType::BALL => { + let (particle_input_array, material, options, output_units) = input::input::(input_file); + physics_loop::(particle_input_array, material, options, output_units); + } + #[cfg(feature = "parry3d")] + GeometryType::TRIMESH => { + let (particle_input_array, material, options, output_units) = input::input::(input_file); + physics_loop::(particle_input_array, material, options, output_units); } } } diff --git a/src/parry.rs b/src/parry.rs new file mode 100644 index 0000000..39748d7 --- /dev/null +++ b/src/parry.rs @@ -0,0 +1,312 @@ +use super::*; +use parry3d_f64::shape::{Ball, TriMesh}; +use parry3d_f64::query::{PointQuery, Ray, RayCast}; +use parry3d_f64::math::{Isometry, Point, Vector}; +use parry3d_f64::bounding_volume::AABB; + +#[derive(Deserialize, Clone)] +pub struct InputParryBall { + pub options: Options, + pub material_parameters: material::MaterialParameters, + pub particle_parameters: particle::ParticleParameters, + pub geometry_input: ParryBallInput, +} + +impl GeometryInput for InputParryBall { + type GeometryInput = ParryBallInput; +} + +impl InputFile for InputParryBall { + + fn new(string: &str) -> InputParryBall { + toml::from_str(string).expect("Could not parse TOML file.") + } + + fn get_options(&self) -> &Options{ + &self.options + } + fn get_material_parameters(&self) -> &material::MaterialParameters{ + &self.material_parameters + } + fn get_particle_parameters(&self) ->& particle::ParticleParameters{ + &self.particle_parameters + } + fn get_geometry_input(&self) -> &Self::GeometryInput{ + &self.geometry_input + } +} + +#[derive(Deserialize, Clone)] +pub struct ParryBallInput { + pub length_unit: String, + pub radius: f64, + pub densities: Vec, + pub electronic_stopping_correction_factor: f64, +} + +#[derive(Clone)] +pub struct ParryBall { + pub densities: Vec, + pub concentrations: Vec, + pub radius: f64, + pub electronic_stopping_correction_factor: f64, + pub energy_barrier_thickness: f64, + pub ball: Ball, +} + +impl GeometryInput for ParryBall { + type GeometryInput = ParryBallInput; +} + +impl Geometry for ParryBall { + + type InputFileFormat = InputParryBall; + + fn new(input: &::GeometryInput) -> ParryBall { + + let length_unit: f64 = match input.length_unit.as_str() { + "MICRON" => MICRON, + "CM" => CM, + "ANGSTROM" => ANGSTROM, + "NM" => NM, + "M" => 1., + _ => input.length_unit.parse() + .expect(format!( + "Input errror: could nor parse length unit {}. Use a valid float or one of ANGSTROM, NM, MICRON, CM, MM, M", + &input.length_unit.as_str() + ).as_str()), + }; + + let electronic_stopping_correction_factor = input.electronic_stopping_correction_factor; + let densities: Vec = input.densities.iter().map(|element| element/(length_unit).powi(3)).collect(); + let total_density: f64 = densities.iter().sum(); + let energy_barrier_thickness = total_density.powf(-1./3.)/SQRTPI*2.; + let concentrations: Vec = densities.iter().map(|&density| density/total_density).collect::>(); + let radius = input.radius*length_unit; + + ParryBall { + densities, + concentrations, + radius, + electronic_stopping_correction_factor, + energy_barrier_thickness, + ball: Ball::new(radius) + } + } + + fn get_densities(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.densities + } + fn get_ck(&self, x: f64, y: f64, z: f64) -> f64 { + self.electronic_stopping_correction_factor + } + fn get_total_density(&self, x: f64, y: f64, z: f64) -> f64{ + self.densities.iter().sum() + } + fn get_concentrations(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.concentrations + } + fn get_densities_nearest_to(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.densities + } + fn get_ck_nearest_to(&self, x: f64, y: f64, z: f64) -> f64 { + self.electronic_stopping_correction_factor + } + fn inside(&self, x: f64, y: f64, z: f64) -> bool { + let p = Point::new(x , y , z ); + self.ball.contains_local_point(&p) + } + + fn inside_simulation_boundary(&self, x: f64, y: f64, z: f64) -> bool { + let p = Point::new(x , y , z ); + (self.ball.distance_to_local_point(&p, true) as f64) < 10.*self.energy_barrier_thickness + } + + fn inside_energy_barrier(&self, x: f64, y: f64, z: f64) -> bool { + let p = Point::new(x , y , z ); + (self.ball.distance_to_local_point(&p, true) as f64) < self.energy_barrier_thickness + } + + fn closest_point(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64) { + let p = Point::new(x , y , z ); + let point_projection = self.ball.project_point(&Isometry::identity(), &p, false); + let (x_, y_, z_) = (point_projection.point.x, point_projection.point.y, point_projection.point.z); + (x_ as f64, y_ as f64, z_ as f64) + } +} + + +#[derive(Deserialize, Clone)] +pub struct InputParryTriMesh { + pub options: Options, + pub material_parameters: material::MaterialParameters, + pub particle_parameters: particle::ParticleParameters, + pub geometry_input: ParryTriMeshInput, +} + +impl GeometryInput for InputParryTriMesh { + type GeometryInput = ParryTriMeshInput; +} + +impl InputFile for InputParryTriMesh { + + fn new(string: &str) -> InputParryTriMesh { + toml::from_str(string).expect("Could not parse TOML file.") + } + + fn get_options(&self) -> &Options{ + &self.options + } + fn get_material_parameters(&self) -> &material::MaterialParameters{ + &self.material_parameters + } + fn get_particle_parameters(&self) ->& particle::ParticleParameters{ + &self.particle_parameters + } + fn get_geometry_input(&self) -> &Self::GeometryInput{ + &self.geometry_input + } +} + +#[derive(Deserialize, Clone)] +pub struct ParryTriMeshInput { + pub length_unit: String, + pub densities: Vec, + pub electronic_stopping_correction_factor: f64, + pub vertices: Vec<[f64; 3]>, + pub indices: Vec<[u32; 3]>, +} + +#[derive(Clone)] +pub struct ParryTriMesh { + pub densities: Vec, + pub concentrations: Vec, + pub electronic_stopping_correction_factor: f64, + pub energy_barrier_thickness: f64, + pub trimesh: TriMesh, + pub boundary: AABB, +} + +impl GeometryInput for ParryTriMesh { + type GeometryInput = ParryTriMeshInput; +} + +impl Geometry for ParryTriMesh { + + type InputFileFormat = InputParryTriMesh; + + fn new(input: &::GeometryInput) -> ParryTriMesh { + + let length_unit: f64 = match input.length_unit.as_str() { + "MICRON" => MICRON, + "CM" => CM, + "ANGSTROM" => ANGSTROM, + "NM" => NM, + "M" => 1., + _ => input.length_unit.parse() + .expect(format!( + "Input errror: could nor parse length unit {}. Use a valid float or one of ANGSTROM, NM, MICRON, CM, MM, M", + &input.length_unit.as_str() + ).as_str()), + }; + + let electronic_stopping_correction_factor = input.electronic_stopping_correction_factor; + let densities: Vec = input.densities.iter().map(|element| element/(length_unit).powi(3)).collect(); + let total_density: f64 = densities.iter().sum(); + let energy_barrier_thickness = total_density.powf(-1./3.)/SQRTPI*2.; + let concentrations: Vec = densities.iter().map(|&density| density/total_density).collect::>(); + let points = input.vertices.iter().map(|p| Point::new(p[0]*length_unit , p[1]*length_unit , p[2]*length_unit)).collect(); + let trimesh = TriMesh::new(points, input.indices.clone()); + let boundary = trimesh.aabb(&Isometry::identity()); + + ParryTriMesh { + densities, + concentrations, + electronic_stopping_correction_factor, + energy_barrier_thickness, + trimesh, + boundary, + } + } + + fn get_densities(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.densities + } + fn get_ck(&self, x: f64, y: f64, z: f64) -> f64 { + self.electronic_stopping_correction_factor + } + fn get_total_density(&self, x: f64, y: f64, z: f64) -> f64{ + self.densities.iter().sum() + } + fn get_concentrations(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.concentrations + } + fn get_densities_nearest_to(&self, x: f64, y: f64, z: f64) -> &Vec { + &self.densities + } + fn get_ck_nearest_to(&self, x: f64, y: f64, z: f64) -> f64 { + self.electronic_stopping_correction_factor + } + fn inside(&self, x: f64, y: f64, z: f64) -> bool { + inside_trimesh(&self.trimesh, x, y, z) + } + + fn inside_simulation_boundary(&self, x: f64, y: f64, z: f64) -> bool { + if self.inside(x, y, z) { + true + } else { + let p = Point::new(x , y , z ); + let distance = self.boundary.distance_to_local_point(&p, true); + //dbg!(distance); + distance < 10.*self.energy_barrier_thickness + } + } + + fn inside_energy_barrier(&self, x: f64, y: f64, z: f64) -> bool { + if self.inside(x, y, z) { + true + } else { + let p = Point::new(x , y , z ); + let distance = self.trimesh.distance_to_local_point(&p, true); + //dbg!(distance/ANGSTROM); + //dbg!(self.energy_barrier_thickness/ANGSTROM); + //dbg!(distance < self.energy_barrier_thickness); + distance < self.energy_barrier_thickness + } + } + + fn closest_point(&self, x: f64, y: f64, z: f64) -> (f64, f64, f64) { + let p = Point::new(x , y , z ); + let point_projection = self.trimesh.project_local_point(&p, false); + let (x_, y_, z_) = (point_projection.point.x, point_projection.point.y, point_projection.point.z); + (x_ as f64, y_ as f64, z_ as f64) + } +} + +fn inside_trimesh(trimesh: &TriMesh, x: f64, y: f64, z: f64) -> bool { + let p = Point::new(x , y , z ); + + if !trimesh.aabb(&Isometry::identity()) + .contains_local_point(&p) { + return false; + } + + let dir = Vector::new(1.0, 0.0, 0.0); + + let result = trimesh.cast_ray_and_get_normal( + &Isometry::identity(), + &Ray::new(p, dir), + 1.0, + false + ); + + //dbg!(result); + + match result { + Some(intersection) => { + //dbg!(intersection.feature); + trimesh.is_backface(intersection.feature) + }, + None => false, + } +} diff --git a/src/tests.rs b/src/tests.rs index a3b327b..1a5bedc 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -3,6 +3,193 @@ use super::*; #[cfg(test)] use float_cmp::*; +#[test] +#[cfg(feature = "parry3d")] +fn test_parry_cuboid() { + let mass = 1.; + let Z = 1.; + let E = 10.*EV; + let Ec = 1.*EV; + let Es = 5.76*EV; + let x = 0.; + let y = 0.; + let z = 0.; + let cosx = 1./(2.0_f64).sqrt(); + let cosy = 1./(2.0_f64).sqrt(); + let cosz = 0.; + let particle_1 = particle::Particle::new(mass, Z, E, Ec, Es, x, y, z, cosx, cosy, cosz, false, false, 0); + + let material_parameters = material::MaterialParameters{ + energy_unit: "EV".to_string(), + mass_unit: "AMU".to_string(), + Eb: vec![0.0, 0.0], + Es: vec![2.0, 4.0], + Ec: vec![1.0, 1.0], + Z: vec![29., 1.], + m: vec![63.54, 1.0008], + interaction_index: vec![0, 0], + surface_binding_model: SurfaceBindingModel::PLANAR{calculation: SurfaceBindingCalculation::TARGET}, + bulk_binding_model: BulkBindingModel::INDIVIDUAL, + }; + + let radius = 1000.*ANGSTROM; + + //cuboid centered at (0, 0, 0) with l=w=h=1 Angstrom + let geometry_input = parry::ParryTriMeshInput { + length_unit: "ANGSTROM".to_string(), + densities: vec![0.03, 0.03], + electronic_stopping_correction_factor: 1.0, + vertices: vec![ + [-0.5, -0.5, 0.5], + [0.5, -0.5, 0.5], + [-0.5, 0.5, 0.5], + [0.5, 0.5, 0.5], + [-0.5, 0.5, -0.5], + [0.5, 0.5, -0.5], + [-0.5, -0.5, -0.5], + [0.5, -0.5, -0.5], + ], + indices: vec![ + [0, 1, 3], + [0, 3, 2], + [2, 3, 5], + [2, 5, 4], + [4, 5, 7], + [4, 7, 6], + [6, 7, 1], + [6, 1, 0], + [1, 7, 5], + [1, 5, 3], + [6, 0, 2], + [6, 2, 4] + ] + }; + + let mut material_cuboid: material::Material = material::Material::::new(&material_parameters, &geometry_input); + material_cuboid.geometry.energy_barrier_thickness = 10.*ANGSTROM; + + let surface_binding_energy = material_cuboid.actual_surface_binding_energy(&particle_1, particle_1.pos.x, particle_1.pos.y, particle_1.pos.z); + assert!(approx_eq!(f64, surface_binding_energy/EV, (2. + 4.)/2., epsilon=1E-24)); + + //Test origin is inside + assert!(material_cuboid.geometry.inside(0., 0., 0.)); + + //Test all outside areas for containment + assert!(!material_cuboid.geometry.inside(0., 1., 0.)); + assert!(!material_cuboid.geometry.inside(0., -1., 0.)); + assert!(!material_cuboid.geometry.inside(1., 0., 0.)); + assert!(!material_cuboid.geometry.inside(-1., 0., 0.)); + assert!(!material_cuboid.geometry.inside(0., 0., -1.)); + assert!(!material_cuboid.geometry.inside(0., 0., -1.)); + + //distance to origin + let (x, y, z) = material_cuboid.geometry.closest_point(0., 0., 0.); + assert!(approx_eq!(f64, (x.powi(2) + y.powi(2) + z.powi(2)).sqrt(), 0.5*ANGSTROM, epsilon=1E-24)); + + //distance to wall should be zero at wall + let (x, y, z) = material_cuboid.geometry.closest_point(0.5*ANGSTROM, 0., 0.); + assert!(approx_eq!(f64, ((x - 0.5*ANGSTROM).powi(2) + y.powi(2) + z.powi(2)).sqrt(), 0.0, epsilon=1E-24)); +} + +#[test] +#[cfg(feature = "parry3d")] +fn test_parry_sphere() { + let mass = 1.; + let Z = 1.; + let E = 10.*EV; + let Ec = 1.*EV; + let Es = 5.76*EV; + let x = 0.; + let y = 0.; + let z = 0.; + let cosx = 1./(2.0_f64).sqrt(); + let cosy = 1./(2.0_f64).sqrt(); + let cosz = 0.; + let mut particle_1 = particle::Particle::new(mass, Z, E, Ec, Es, x, y, z, cosx, cosy, cosz, false, false, 0); + + let material_parameters = material::MaterialParameters{ + energy_unit: "EV".to_string(), + mass_unit: "AMU".to_string(), + Eb: vec![0.0, 0.0], + Es: vec![2.0, 4.0], + Ec: vec![1.0, 1.0], + Z: vec![29., 1.], + m: vec![63.54, 1.0008], + interaction_index: vec![0, 0], + surface_binding_model: SurfaceBindingModel::PLANAR{calculation: SurfaceBindingCalculation::TARGET}, + bulk_binding_model: BulkBindingModel::INDIVIDUAL, + }; + + let radius = 1000.*ANGSTROM; + + let geometry_input_sphere = parry::ParryBallInput { + length_unit: "ANGSTROM".to_string(), + radius: 1000.0, + densities: vec![0.03, 0.03], + electronic_stopping_correction_factor: 1.0 + }; + + let mut material_sphere: material::Material = material::Material::::new(&material_parameters, &geometry_input_sphere); + material_sphere.geometry.energy_barrier_thickness = 10.*ANGSTROM; + + particle_1.pos.x = 500.*ANGSTROM; + particle_1.pos.y = 0.; + + particle_1.pos_old.x = -1500.*ANGSTROM; + particle_1.pos_old.y = 0.; + + let inside_sphere = material_sphere.inside(particle_1.pos.x, particle_1.pos.y, particle_1.pos.z); + let inside_old_sphere = material_sphere.inside(particle_1.pos_old.x, particle_1.pos_old.y, particle_1.pos_old.z); + + //println!("{} {}", inside, inside_old); + assert!(inside_sphere); + assert!(!inside_old_sphere); + + //Test concentration-dependent surface binding energy + let surface_binding_energy = material_sphere.actual_surface_binding_energy(&particle_1, particle_1.pos.x, particle_1.pos.y, particle_1.pos.z); + assert!(approx_eq!(f64, surface_binding_energy/EV, (2. + 4.)/2., epsilon=1E-24)); + + assert!(material_sphere.inside_energy_barrier(0., 0., 0.)); + assert!(material_sphere.inside_simulation_boundary(0., 0., 0.)); + assert!(material_sphere.inside(0., 0., 0.)); + + let ux = 1214.0*ANGSTROM; + let uy = 123123.0*ANGSTROM; + let uz = 1239.0*ANGSTROM; + let r = (ux.powi(2) + uy.powi(2) + uz.powi(2)).sqrt(); + let R = 1001.0*ANGSTROM; + let u = (ux/r*R, uy/r*R, uz/r*R); + assert!(!material_sphere.inside(u.0, u.1, u.2)); + assert!(material_sphere.inside_energy_barrier(u.0, u.1, u.2)); + assert!(material_sphere.inside_simulation_boundary(u.0, u.1, u.2)); + + assert!(material_sphere.inside_energy_barrier(0., 0., 0.)); + assert!(material_sphere.inside_simulation_boundary(0., 0., 0.)); + assert!(material_sphere.inside(0., 0., 0.)); + + assert!(material_sphere.inside_energy_barrier(-1000.0*ANGSTROM - 1.0*ANGSTROM, 0., 0.)); + assert!(!material_sphere.inside_energy_barrier(-1000.0*ANGSTROM - 11.0*ANGSTROM, 0., 0.)); + + assert!(material_sphere.inside_energy_barrier(0., -1000.0*ANGSTROM - 1.0*ANGSTROM, 0.)); + assert!(!material_sphere.inside_energy_barrier(0., -1000.0*ANGSTROM - 11.0*ANGSTROM, 0.)); + + assert!(material_sphere.inside_energy_barrier(0., 0., -1000.0*ANGSTROM - 1.0*ANGSTROM)); + assert!(!material_sphere.inside_energy_barrier(0., 0., -1000.0*ANGSTROM - 11.0*ANGSTROM)); + + assert!(material_sphere.inside(-1000.0*ANGSTROM + 1.0*ANGSTROM, 0., 0.)); + assert!(!material_sphere.inside(-1000.0*ANGSTROM - 1.0*ANGSTROM, 0., 0.)); + + assert!(material_sphere.inside(0., -1000.0*ANGSTROM + 1.0*ANGSTROM, 0.)); + assert!(!material_sphere.inside(0., -1000.0*ANGSTROM - 1.0*ANGSTROM, 0.)); + + assert!(material_sphere.inside(0., 0., -1000.0*ANGSTROM + 1.0*ANGSTROM)); + assert!(!material_sphere.inside(0., 0., -1000.0*ANGSTROM - 1.0*ANGSTROM)); + + assert!(approx_eq!(f64, material_sphere.closest_point(-2000.*ANGSTROM, 0., 0.).0, (-1000.*ANGSTROM, 0., 0.).0, epsilon=1E-12)); + assert!(approx_eq!(f64, material_sphere.closest_point(0., -2000.*ANGSTROM, 0.).1, (0., -1000.*ANGSTROM, 0.).1, epsilon=1E-12)); + assert!(approx_eq!(f64, material_sphere.closest_point(0., 0., -2000.*ANGSTROM).2, (0., 0., -1000.*ANGSTROM).2, epsilon=1E-12)); +} + #[test] #[cfg(feature = "distributions")] fn test_distributions() {