├── .gitignore
├── Dockerfile
├── LICENSE.txt
├── README.md
├── backend
├── data
│ ├── .log
│ ├── .mail
│ ├── .msh
│ ├── ASTMG173.txt
│ ├── Ag_JC.txt
│ ├── Ag_Palik.txt
│ ├── Al.txt
│ ├── Al2O3.txt
│ ├── Al2O3_PV.txt
│ ├── AlGaAs.txt
│ ├── AlN.txt
│ ├── AlN_PV.txt
│ ├── Al_CRC.txt
│ ├── Al_Palik.txt
│ ├── Au_CRC.txt
│ ├── Au_JC.txt
│ ├── Au_Palik.txt
│ ├── CH3NH3PbI3.txt
│ ├── CdTe.txt
│ ├── CuO.txt
│ ├── Cu_JC.txt
│ ├── Cu_Palik.txt
│ ├── FTO_Wenger.txt
│ ├── FTO_Wengerk5.txt
│ ├── FeS2.txt
│ ├── GO_2014.txt
│ ├── GO_2015.txt
│ ├── GaAs.txt
│ ├── GaN.txt
│ ├── GaP.txt
│ ├── Ge.txt
│ ├── Ge_Doped.txt
│ ├── H2O.txt
│ ├── ITO.txt
│ ├── ITO_anneal_Gen_Osc.txt
│ ├── InAs.txt
│ ├── InGaAs.txt
│ ├── InP.txt
│ ├── Low_Fe_Glass_Pil.txt
│ ├── MgF2.txt
│ ├── MoO3.txt
│ ├── Perovskite_E_u_00.txt
│ ├── Perovskite_Loper_E_u_080.txt
│ ├── Perovskite_b2b_nk.txt
│ ├── Sb2S3.txt
│ ├── Sb2S3_ANU2014.txt
│ ├── Sb2S3_ANU2015.txt
│ ├── Si3N4.txt
│ ├── SiO2.txt
│ ├── SiON_High.txt
│ ├── SiON_Low.txt
│ ├── Si_a.txt
│ ├── Si_c.txt
│ ├── SnO2.txt
│ ├── Soda_lime_glass_nk_Pil.txt
│ ├── Spiro.txt
│ ├── Spiro_nk_Filipic.txt
│ ├── TiO2.txt
│ ├── TiO2_anatase.txt
│ ├── Zn3P2.txt
│ ├── ZnO.txt
│ ├── ZnS.txt
│ └── rGO_2015.txt
├── fortran
│ ├── Completeness.f
│ ├── J_dagger_overlap.f
│ ├── J_dagger_overlap_1d.f
│ ├── J_overlap.f
│ ├── J_overlap_1d.f
│ ├── K_overlap.f.bak
│ ├── Makefile
│ ├── Makefile-pre_compiled_libs
│ ├── Makefile-silliac
│ ├── __init__.py
│ ├── array_sol.f
│ ├── array_sol_1d.f
│ ├── array_sol_P2_1d.f
│ ├── asmbly.f
│ ├── asmbly_1d.f
│ ├── basis_ls.f
│ ├── basis_vec.f
│ ├── bound_cond.f
│ ├── conv_gmsh.f
│ ├── conv_gmsh_subroutines.f
│ ├── csr_length.f
│ ├── csr_max_length.f
│ ├── curved_elem_tri.f
│ ├── debug.h
│ ├── field_value_plane.f
│ ├── geometry.f
│ ├── geometry_1d.f.bak
│ ├── get_coord_p3.f
│ ├── gmsh_interface_c4.f
│ ├── gmsh_interface_cyl.f
│ ├── gmsh_plot_PW.f
│ ├── gmsh_plot_field.f
│ ├── gmsh_plot_field_3d.f
│ ├── gmsh_plot_slice.f
│ ├── gmsh_plot_slice_1d.f.bak
│ ├── gmsh_post_process.f
│ ├── gmsh_post_process_1d.f.bak
│ ├── interp_nod_2d.f
│ ├── ivalue.f
│ ├── jacobian_p1_2d.f
│ ├── jacobian_p2_2d.f
│ ├── lattice_vec.f
│ ├── lib
│ │ ├── libamd.a
│ │ ├── libcamd.a
│ │ ├── libccolamd.a
│ │ ├── libcholmod.a
│ │ ├── libcolamd.a
│ │ ├── libmetis.a
│ │ ├── libsuitesparseconfig.a
│ │ ├── libumfpack.a
│ │ ├── umf4_f77zwrapper64.o
│ │ ├── umf4_f77zwrapper_SS_3.7.1.c
│ │ └── umf4_f77zwrapper_SS_4.2.0.c
│ ├── list_edge.f
│ ├── list_face.f
│ ├── list_node_P3.f
│ ├── mail_to_gmsh.f.bak
│ ├── matrix_kxy_1d.f
│ ├── matrix_kyx_1d.f
│ ├── matrix_kyy_1d.f
│ ├── matrix_mxx_1d.f
│ ├── matrix_myy_1d.f
│ ├── mesh_1d_p2.f.bak
│ ├── mode_energy.f
│ ├── msh
│ │ ├── 16_msh_template.geo
│ │ ├── 1D_1_msh_template-horizontal.geo.bak
│ │ ├── 1D_1_msh_template-vertical.geo.bak
│ │ ├── 1D_1_msh_template.geo.bak
│ │ ├── 1D_2_msh_template-horizontal.geo.bak
│ │ ├── 1D_2_msh_template.geo.bak
│ │ ├── 1_2strip_msh_template.geo
│ │ ├── 1_msh_template.geo
│ │ ├── 1_strip_msh_template.geo
│ │ ├── 2_msh_template.geo
│ │ ├── 3_msh_template.geo
│ │ ├── 4_msh_template.geo
│ │ ├── 4testing-600_120.geo
│ │ ├── 4testing-600_120.mail
│ │ ├── 4testing-940_266_sq.geo
│ │ ├── 4testing-940_266_sq.mail
│ │ ├── 9_msh_template.geo
│ │ ├── L_msh_template.geo
│ │ ├── SRR_msh_template.geo
│ │ ├── chiral_slits_msh_template.geo
│ │ ├── cross1_msh_template.geo
│ │ ├── cross_shell1_msh_template.geo
│ │ ├── dimer1_msh_template.geo
│ │ ├── egg_inclusion_msh_template.geo
│ │ ├── egg_msh_template.geo
│ │ ├── elle_msh_template.geo
│ │ ├── ellipse_msh_template.geo
│ │ ├── hex_msh_template.geo
│ │ ├── rect1_msh_template.geo
│ │ ├── rect_shell1_msh_template.geo
│ │ ├── ring1_msh_template.geo
│ │ ├── row_2_msh_template.geo
│ │ ├── row_5_msh_template.geo
│ │ ├── square_dimer1_msh_template.geo
│ │ └── square_shell_dimer1_msh_template.geo
│ ├── normalisation.f
│ ├── normalisation_1d.f
│ ├── orthogonal.f
│ ├── orthogonal_1d.f
│ ├── periodic_N_E_F.f
│ ├── periodic_cond.f
│ ├── periodic_cond_1d.f
│ ├── periodic_node.f
│ ├── phi1_2d_mat.f
│ ├── phi2_2d_mat.f
│ ├── phi2_2d_mat_J.f
│ ├── phi3_2d_mat.f
│ ├── pw_matrix_1d_to_2d.f
│ ├── pw_ordering.f
│ ├── pw_ordering_1d.f
│ ├── py_calc_modes.f
│ ├── py_calc_modes_1d.f
│ ├── py_plot_field.f.bak
│ ├── quad_triangle.f
│ ├── slice_interp.f
│ ├── sort_csr.f
│ ├── sort_int.f
│ ├── sort_n.f
│ ├── stat.h
│ ├── type_node_edge_face.f
│ ├── valpr_lapack_1d.f
│ ├── valpr_umf_64.f
│ ├── vector_p2_exp_1d.f
│ ├── vector_p3_exp_1d.f
│ ├── write_param.f.bak
│ ├── write_sol.f
│ ├── write_sol_P2_1d.f
│ ├── z_indexx.f
│ ├── z_mxv_csc_64.f
│ ├── zarpack.f
│ └── zarpack_util.f
├── materials.py
├── mode_calcs.py
├── objects.py
├── paths.py
├── plotting.py
└── stack.py
├── dependencies.txt
├── docker_install.md
├── docs
├── Makefile
├── build
│ └── latex
│ │ └── EMUstack.pdf
├── requirements.txt
└── source
│ ├── conf.py
│ ├── fem_1d.rst
│ ├── fem_2d.rst
│ ├── index.rst
│ ├── install.rst
│ ├── intro.rst
│ ├── materials.rst
│ ├── mode_calcs.rst
│ ├── objects.rst
│ ├── plotting.rst
│ ├── screen_sesh.rst
│ ├── stack.rst
│ └── tutorial.rst
├── examples
├── Au Nanodisk Array with Interpolators.ipynb
├── Elliptical Nanohole Array (custom target interface).ipynb
├── simo_010-single_interface.py
├── simo_011-single_interface-dispersive.py
├── simo_020-thin_film_multilayered_stack.py
├── simo_021-thin_film_mirror.py
├── simo_030-1D_grating.py
├── simo_031-1D_grating-2_inclusions.py
├── simo_032-1D_grating-3_inclusions.py
├── simo_040-2D_array.py
├── simo_041-combining_1D_and_2D_array.py
├── simo_042-eliptical_holes-CD.py
├── simo_050-plotting_fields_1d.py
├── simo_051-plotting_fields_2d.py
├── simo_052-plotting_amplitudes.py
├── simo_053-plotting_k_space_amps.py
├── simo_060-shear_transformations.py
├── simo_070-ultrathin_limit.py
├── simo_071-many_substrates.py
├── simo_080-convergence-stacked_gratings.py
├── simo_090-EOT.py
└── simo_091-slab_mode_finding.py
├── overrides.json
├── reload_simo
└── simo_reload.py
├── setup.sh
└── tests
├── ref
├── case_0.npz
├── case_0
│ ├── Absorptance_stack0001.txt
│ ├── Efficiency_stack0001.txt
│ ├── Lay_Absorb_0_stack0001.txt
│ ├── Lay_Absorb_1_stack0001.txt
│ ├── Lay_Absorb_2_stack0001.txt
│ ├── Lay_Absorb_3_stack0001.txt
│ ├── Lay_Absorb_4_stack0001.txt
│ ├── Lay_Trans_0_stack0001.txt
│ ├── Lay_Trans_1_stack0001.txt
│ ├── Lay_Trans_2_stack0001.txt
│ ├── Lay_Trans_3_stack0001.txt
│ ├── Lay_Trans_4_stack0001.txt
│ ├── Reflectance_stack0001.txt
│ └── Transmittance_stack0001.txt
├── case_1.npz
├── case_1
│ ├── Absorptance_stack0001.txt
│ ├── Efficiency_stack0001.txt
│ ├── Lay_Absorb_0_stack0001.txt
│ ├── Lay_Trans_0_stack0001.txt
│ ├── Reflectance_stack0001.txt
│ └── Transmittance_stack0001.txt
├── case_2.npz
├── case_2
│ ├── Absorptance_stack0001.txt
│ ├── Lay_Absorb_0_stack0001.txt
│ ├── Lay_Trans_0_stack0001.txt
│ ├── Reflectance_stack0001.txt
│ └── Transmittance_stack0001.txt
├── case_3.npz
├── case_3
│ ├── Absorptance_stack0001.txt
│ ├── Efficiency_stack0001.txt
│ ├── Lay_Absorb_0_stack0001.txt
│ ├── Lay_Trans_0_stack0001.txt
│ ├── Reflectance_stack0001.txt
│ └── Transmittance_stack0001.txt
├── case_4.npz
├── case_4
│ ├── Absorptance_stack0001.txt
│ ├── Lay_Absorb_0_stack0001.txt
│ ├── Lay_Absorb_1_stack0001.txt
│ ├── Lay_Trans_0_stack0001.txt
│ ├── Lay_Trans_1_stack0001.txt
│ ├── Reflectance_stack0001.txt
│ └── Transmittance_stack0001.txt
└── case_5.npz
├── test_case_0_thin_film_multistack.py
├── test_case_1_simple_struct.py
├── test_case_2_simple_non_norm_inc.py
├── test_case_3_simple_mk_msh.py
├── test_case_4_EOT.py.bak
├── test_case_4_stacked_gratings.py
├── test_case_5_EOT_5_degrees.py.bak
├── test_case_6_TW_replication.py.bak
└── testing.py
/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.pyc
3 | *.mail
4 | *.pyf
5 | *.exe
6 | backend/Data/*.geo
7 | backend/Data/*.log
8 | backend/Data/*.mail
9 | backend/Data/*.msh
10 | examples/*.txt
11 | examples/*.pdf
12 | examples/*.log
13 | docs/*.tex
14 | docs/*.aux
15 | docs/*.log
16 | docs/*.fdb_latexmk
17 | docs/*.gz
18 | docs/*.out
19 | docs/*.toc
20 | test*/*.txt
21 | test*/*.pdf
22 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Latest fedora image. It works well with the new compilation flags.
2 | FROM fedora:39
3 |
4 | # Install Fedora package dependencies, needed to add an explicit timezone
5 | RUN dnf -y update
6 | RUN dnf -y install make gmsh python3-numpy python3-devel python3-scipy python3-nose python3-pip python3-matplotlib gfortran
7 | RUN dnf -y install suitesparse-devel blas-devel lapack-devel atlas-devel
8 | RUN dnf -y install nano micro openssh
9 | RUN dnf -y install jupyterlab
10 |
11 | # Add the NumBAT source code -> Will be overwritten when used with mounted volumes! (which is good)
12 | COPY ./ /home/EMUstack/
13 |
14 | # Compile the Fortran code, only use when running tests or copying compiled source to host
15 | WORKDIR /home/EMUstack/backend/fortran/
16 | RUN make
17 |
18 | # create useful folder
19 | WORKDIR /home
20 | RUN mkdir host
21 |
22 | # getting code and setup env vars
23 | ENV PYTHONPATH "${PYTHONPATH}:/home/EMUstack/backend/"
24 | ENV OPENBLAS_NUM_THREADS=1
25 | ENV OMP_NUM_THREADS=1
26 | RUN echo -e "ulimit -s unlimited" >> /root/.bashrc
27 | RUN source /root/.bashrc
28 |
29 | # expose port
30 | EXPOSE 8888
31 |
--------------------------------------------------------------------------------
/backend/data/.log:
--------------------------------------------------------------------------------
1 | conv_gmsh_m: debug = 1
2 | gmsh_version = 2
3 | i_mesh = -1 -1 -1
4 | file1_mesh =
5 | ../PCPV/Data/.msh
6 |
7 | file2_mesh =
8 | ../PCPV/Data/.mail
9 |
10 | i_sym = 0
11 | Number of points = 0
12 | Number of elements = 0
13 | The program terminates normally
14 | Symmetry code = 0
15 | CPU time (sec.) = 0.000000000000000E+000
16 |
--------------------------------------------------------------------------------
/backend/data/.mail:
--------------------------------------------------------------------------------
1 | 0 0
2 |
--------------------------------------------------------------------------------
/backend/data/.msh:
--------------------------------------------------------------------------------
1 | $MeshFormat
2 | 2.2 0 8
3 | $EndMeshFormat
4 | $Nodes
5 | 0
6 | $EndNodes
7 | $Elements
8 | 0
9 | $EndElements
10 |
--------------------------------------------------------------------------------
/backend/data/Ag_JC.txt:
--------------------------------------------------------------------------------
1 | 0187.9 1.07 1.212
2 | 0191.6 1.10 1.232
3 | 0195.3 1.12 1.255
4 | 0199.3 1.14 1.277
5 | 0203.3 1.15 1.296
6 | 0207.3 1.18 1.312
7 | 0211.9 1.20 1.325
8 | 0216.4 1.22 1.336
9 | 0221.4 1.25 1.342
10 | 0226.2 1.26 1.344
11 | 0231.3 1.28 1.357
12 | 0237.1 1.28 1.367
13 | 0242.6 1.30 1.378
14 | 0249.0 1.31 1.389
15 | 0255.1 1.33 1.393
16 | 0261.6 1.35 1.387
17 | 0268.9 1.38 1.372
18 | 0276.1 1.41 1.331
19 | 0284.4 1.41 1.264
20 | 0292.4 1.39 1.161
21 | 0300.9 1.34 0.964
22 | 0310.7 1.13 0.616
23 | 0320.4 0.81 0.392
24 | 0331.5 0.17 0.829
25 | 0342.5 0.14 1.142
26 | 0354.2 0.10 1.419
27 | 0367.9 0.07 1.657
28 | 0381.5 0.05 1.864
29 | 0397.4 0.05 2.070
30 | 0413.3 0.05 2.275
31 | 0430.5 0.04 2.462
32 | 0450.9 0.04 2.657
33 | 0471.4 0.05 2.869
34 | 0495.9 0.05 3.093
35 | 0520.9 0.05 3.324
36 | 0548.6 0.06 3.586
37 | 0582.1 0.05 3.858
38 | 0616.8 0.06 4.152
39 | 0659.5 0.05 4.483
40 | 0704.5 0.04 4.838
41 | 0756.0 0.03 5.242
42 | 0821.1 0.04 5.727
43 | 0892.0 0.04 6.312
44 | 0984.0 0.04 6.992
45 | 1088. 0.04 7.795
46 | 1216. 0.09 8.828
47 | 1393. 0.13 10.10
48 | 1610. 0.15 11.85
49 | 1937. 0.624 11.8
50 | 2000. 0.650 12.2
51 | 2066. 0.668 12.6
52 | 2066. 1.064 14.4
53 | 2138. 0.729 13.0
54 | 2214. 0.774 13.5
55 | 2296. 0.823 14.0
56 | 2384. 0.878 14.5
57 | 2480. 0.939 15.1
58 | 2583. 1.007 15.7
59 | 2695. 1.083 16.4
--------------------------------------------------------------------------------
/backend/data/Al2O3.txt:
--------------------------------------------------------------------------------
1 | 265.2 1.8336541907713
2 | 273.4 1.8283379443249
3 | 281.9 1.8233958712912
4 | 290.6 1.8188529122407
5 | 299.6 1.8146259396683
6 | 308.8 1.8107340392221
7 | 318.4 1.8070727867561
8 | 328.2 1.8037001710246
9 | 338.4 1.8005294046665
10 | 348.8 1.797606193218
11 | 359.6 1.7948583556898
12 | 370.8 1.7922783218287
13 | 382.2 1.7898977875771
14 | 394.0 1.7876612957134
15 | 406.2 1.7855614982672
16 | 418.8 1.7835909341355
17 | 431.7 1.7817557136737
18 | 445.1 1.7800201232304
19 | 458.9 1.7783918674129
20 | 473.1 1.7768639548492
21 | 487.7 1.7754296515526
22 | 502.8 1.7740739197944
23 | 518.3 1.7728006409159
24 | 534.3 1.77159654957
25 | 550.9 1.7704510850267
26 | 567.9 1.7693740391953
27 | 585.5 1.7683486912363
28 | 603.6 1.7673776426943
29 | 622.3 1.7664522407927
30 | 641.5 1.7655741862642
31 | 661.3 1.7647356706479
32 | 681.8 1.7639302071173
33 | 702.9 1.7631593986536
34 | 724.6 1.7624204775967
35 | 747.0 1.7617076460235
36 | 770.1 1.7610188167222
37 | 793.9 1.7603518573411
38 | 818.5 1.7597020477251
39 | 843.8 1.7590700727377
40 | 869.9 1.7584514371955
41 | 896.8 1.7578443092689
42 | 924.6 1.7572447108131
43 | 953.1 1.7566550609993
44 | 982.6 1.7560673503734
45 | 1013. 1.7554819607026
46 | 1044. 1.7549026543964
47 | 1077. 1.7543020577053
48 | 1110. 1.7537148809896
49 | 1144. 1.7531210173803
50 | 1180. 1.7525016445033
51 | 1216. 1.7518893622591
52 | 1254. 1.7512482407284
53 | 1293. 1.7505934052563
54 | 1333. 1.749922881336
55 | 1374. 1.7492346937408
56 | 1416. 1.7485268669904
57 | 1460. 1.7477803908933
58 | 1505. 1.7470099775698
59 | 1552. 1.7461961108847
60 | 1600. 1.7453536287432
61 | 1649. 1.7444803447938
62 | 1700. 1.743555787332
63 | 1753. 1.7425767059656
64 | 1807. 1.7415587017862
65 | 1863. 1.7404799368839
66 | 1920. 1.7393566150212
67 | 1980. 1.7381454202897
68 | 2041. 1.7368826706183
69 | 2104. 1.7355442036937
70 | 2169. 1.7341255993504
71 | 2236. 1.7326222339546
72 | 2306. 1.731005850038
73 | 2377. 1.7293175502403
74 | 2450. 1.727529303643
75 | 2526. 1.7256099652811
76 | 2604. 1.7235778051244
77 | 2685. 1.7213993872004
78 | 2768. 1.7190938533712
79 | 2854. 1.7166252350906
80 | 2942. 1.7140136328789
81 | 3033. 1.7112202738027
82 | 3127. 1.7082339743157
83 | 3223. 1.705076334027
84 | 3323. 1.7016690128845
85 | 3426. 1.6980309233711
86 | 3532. 1.6941478071484
87 | 3641. 1.6900044803924
88 | 3753. 1.6855847551813
89 | 3870. 1.6807877819469
90 | 3989. 1.6757154863655
91 | 4113. 1.6702171734744
92 | 4240. 1.6643543616017
93 | 4371. 1.6580542633635
94 | 4506. 1.6512850557716
95 | 4645. 1.6440121306278
96 | 4789. 1.6361419049799
97 | 4937. 1.6276838864869
98 | 5090. 1.6185311814552
99 | 5247. 1.6086888727066
100 | 5410. 1.5979661889615
101 | 5577. 1.5864221732106
102 |
--------------------------------------------------------------------------------
/backend/data/AlN.txt:
--------------------------------------------------------------------------------
1 | 225.45 2.522 0.0269
2 | 248 2.406 0.0013
3 | 275.56 2.324 0.0013
4 | 310 2.262 0.0002
5 | 354.29 2.225 0
6 | 413.33 2.188 0
7 | 496 2.171 0
8 | 620 2.164 0
9 | 826.67 2.175 0
10 | 1240 2.193 0
11 | 1377.56 2.192 0
12 | 1549.75 2.189 0
13 | 1771.14 2.186 0.0001
14 | 2066.33 2.181 0.0001
15 |
--------------------------------------------------------------------------------
/backend/data/AlN_PV.txt:
--------------------------------------------------------------------------------
1 | 225.45 2.522 0.0269
2 | 248 2.406 0.0013
3 | 275.56 2.324 0.0013
4 | 310 2.262 0.0002
5 | 354.29 2.225 0
6 | 413.33 2.188 0
7 | 496 2.171 0
8 | 620 2.164 0
9 | 826.67 2.175 0
10 | 1240 2.193 0
11 | 1377.56 2.192 0
12 | 1549.75 2.189 0
13 | 1771.14 2.186 0.0001
14 | 2066.33 2.181 0.0001
15 |
--------------------------------------------------------------------------------
/backend/data/Al_Palik.txt:
--------------------------------------------------------------------------------
1 | # Al_Palik taken from Ansys-Lumerical database
2 | # Handbook of Optical Constants of Solids I - III by E. Palik
3 | # lambda Re(n) Im(n)
4 | 1999.99997 2.15000 20.69999
5 | 1907.00033 1.99000 19.80000
6 | 1771.00043 1.77000 18.30000
7 | 1652.99922 1.59000 17.10000
8 | 1550.00011 1.44000 15.99999
9 | 1500.00059 1.38000 15.40001
10 | 1458.99980 1.33000 14.90000
11 | 1378.00029 1.26000 13.99999
12 | 1304.99929 1.23000 13.20000
13 | 1239.99946 1.21000 12.50000
14 | 1200.00192 1.21000 12.00000
15 | 1181.00435 1.21000 11.80000
16 | 1126.99589 1.20000 11.20000
17 | 1078.00160 1.21000 10.60000
18 | 1033.00366 1.26000 10.00000
19 | 1000.00160 1.35000 9.58000
20 | 991.89739 1.37000 9.49000
21 | 953.70259 1.58000 8.95000
22 | 949.99769 1.49000 8.88000
23 | 924.99980 1.77000 8.49000
24 | 918.40147 1.86000 8.44000
25 | 900.00144 2.06000 8.30000
26 | 885.60142 2.24000 8.21000
27 | 875.00140 2.38000 8.18000
28 | 855.09882 2.58000 8.21000
29 | 849.99862 2.61000 8.22000
30 | 826.59990 2.74000 8.31000
31 | 824.99932 2.75000 8.31000
32 | 799.89805 2.80000 8.45000
33 | 774.90124 2.63000 8.60000
34 | 751.40117 2.41000 8.62000
35 | 750.00120 2.40000 8.62000
36 | 729.30165 2.14000 8.57000
37 | 708.50138 1.91000 8.39000
38 | 700.00112 1.83000 8.31000
39 | 688.80110 1.74000 8.21000
40 | 670.19935 1.60000 8.01000
41 | 652.59993 1.49000 7.82000
42 | 649.99973 1.47000 7.79000
43 | 635.80010 1.39000 7.65000
44 | 619.89930 1.30000 7.48000
45 | 604.80097 1.22000 7.31000
46 | 600.00096 1.20000 7.26000
47 | 590.40094 1.15000 7.15000
48 | 576.70020 1.08000 7.00000
49 | 563.60040 1.02000 6.85000
50 | 550.99925 0.96300 6.70000
51 | 549.99955 0.95800 6.69000
52 | 539.09923 0.91200 6.55000
53 | 527.59907 0.86700 6.42000
54 | 516.60083 0.82600 6.28000
55 | 506.09927 0.78900 6.15000
56 | 500.00080 0.76900 6.08000
57 | 495.89911 0.75500 6.03000
58 | 476.90082 0.69500 5.80000
59 | 459.20073 0.64400 5.58000
60 | 450.00072 0.61800 5.47000
61 | 442.80071 0.59800 5.38000
62 | 427.49929 0.55800 5.20000
63 | 413.29995 0.52300 5.02000
64 | 399.99935 0.49000 4.86000
65 | 387.50027 0.46000 4.71000
66 | 375.69945 0.43200 4.56000
67 | 364.70017 0.40700 4.43001
68 | 354.20009 0.38500 4.30000
69 | 349.99957 0.37500 4.24000
70 | 344.39959 0.36400 4.17000
71 | 335.09967 0.34400 4.06000
72 | 326.29997 0.32600 3.95000
73 | 317.90005 0.31000 3.84000
74 | 310.00002 0.29400 3.74000
75 | 299.99975 0.27600 3.61000
76 | 291.70007 0.26100 3.51000
77 | 275.50024 0.23300 3.30000
78 | 261.00013 0.20900 3.11000
79 | 248.00014 0.19000 2.94000
80 | 236.19997 0.17200 2.79000
81 | 225.40000 0.15500 2.64000
82 | 215.59995 0.14100 2.51000
83 | 206.60004 0.13000 2.39000
84 | 198.40011 0.11900 2.28000
85 |
--------------------------------------------------------------------------------
/backend/data/Au_JC.txt:
--------------------------------------------------------------------------------
1 | 187.9 1.28 1.188
2 | 191.6 1.32 1.203
3 | 195.3 1.34 1.226
4 | 199.3 1.33 1.251
5 | 203.3 1.33 1.277
6 | 207.3 1.30 1.304
7 | 211.9 1.30 1.350
8 | 216.4 1.30 1.387
9 | 221.4 1.30 1.427
10 | 226.2 1.31 1.460
11 | 231.3 1.30 1.497
12 | 237.1 1.32 1.536
13 | 242.6 1.32 1.577
14 | 249.0 1.33 1.631
15 | 255.1 1.33 1.688
16 | 261.6 1.35 1.749
17 | 268.9 1.38 1.803
18 | 276.1 1.43 1.847
19 | 284.4 1.47 1.869
20 | 292.4 1.49 1.878
21 | 300.9 1.53 1.889
22 | 310.7 1.53 1.893
23 | 320.4 1.54 1.898
24 | 331.5 1.48 1.883
25 | 342.5 1.48 1.871
26 | 354.2 1.50 1.866
27 | 367.9 1.48 1.895
28 | 381.5 1.46 1.933
29 | 397.4 1.47 1.952
30 | 413.3 1.46 1.958
31 | 430.5 1.45 1.948
32 | 450.9 1.38 1.914
33 | 471.4 1.31 1.849
34 | 495.9 1.04 1.833
35 | 520.9 0.62 2.081
36 | 548.6 0.43 2.455
37 | 582.1 0.29 2.863
38 | 616.8 0.21 3.272
39 | 659.5 0.14 3.697
40 | 704.5 0.13 4.103
41 | 756.0 0.14 4.542
42 | 821.1 0.16 5.083
43 | 892.0 0.17 5.663
44 | 984.0 0.22 6.350
45 | 1088.0 0.27 7.150
46 | 1216.0 0.35 8.145
47 | 1393.0 0.43 9.519
48 | 1610.0 0.56 11.21
49 | 1937.0 0.92 13.78
--------------------------------------------------------------------------------
/backend/data/CH3NH3PbI3.txt:
--------------------------------------------------------------------------------
1 | 309.9814 1.67921 0.91875
2 | 313.9053 1.68747 0.96281
3 | 317.9297 1.70069 1.01071
4 | 322.0586 1.7203 1.06226
5 | 326.2963 1.748 1.1169
6 | 330.6469 1.78568 1.17347
7 | 335.1151 1.83528 1.22998
8 | 339.7057 1.89844 1.28343
9 | 344.4238 1.97596 1.3297
10 | 349.2749 2.0671 1.36379
11 | 354.2645 2.16892 1.38052
12 | 359.3988 2.27604 1.37571
13 | 364.684 2.38113 1.34757
14 | 370.1271 2.47639 1.29769
15 | 375.7351 2.55534 1.23087
16 | 381.5156 2.61431 1.15401
17 | 387.4768 2.65284 1.07431
18 | 393.6272 2.67308 0.99789
19 | 399.9761 2.6787 0.92901
20 | 406.533 2.67389 0.87006
21 | 413.3086 2.66265 0.82191
22 | 420.3138 2.64847 0.78439
23 | 427.5606 2.63425 0.75666
24 | 435.0617 2.62242 0.73746
25 | 442.8306 2.61502 0.72522
26 | 450.8821 2.61377 0.71801
27 | 459.2318 2.62005 0.71345
28 | 467.8965 2.63467 0.70859
29 | 476.8945 2.65749 0.69994
30 | 486.2454 2.68694 0.68378
31 | 495.9703 2.71962 0.65697
32 | 506.0921 2.75061 0.61806
33 | 516.6357 2.7745 0.56823
34 | 527.628 2.78709 0.51126
35 | 539.0982 2.78669 0.45236
36 | 551.0781 2.77426 0.39647
37 | 563.6026 2.75256 0.34705
38 | 576.7096 2.72493 0.30574
39 | 590.4409 2.69444 0.27275
40 | 604.8418 2.66348 0.24743
41 | 619.9629 2.63378 0.22873
42 | 635.8593 2.60655 0.2156
43 | 652.5925 2.58282 0.20705
44 | 670.2301 2.5637 0.20221
45 | 688.8477 2.55093 0.20005
46 | 708.529 2.5478 0.19846
47 | 729.3681 2.56012 0.19041
48 | 751.4702 2.58908 0.15114
49 | 774.9536 2.57527 0.05034
50 | 799.9521 2.46784 0
51 | 826.6172 2.39175 0
52 | 855.1212 2.35608 0
53 | 885.6613 2.336 0
54 | 918.4635 2.32177 0
55 | 953.7891 2.31011 0
56 | 991.9406 2.29984 0
57 | 1033.2714 2.29047 0
58 | 1078.1963 2.28176 0
59 | 1127.2052 2.2736 0
60 | 1180.8817 2.2659 0
61 | 1239.9258 2.25861 0
62 | 1305.185 2.25171 0
63 | 1377.6953 2.24515 0
64 | 1458.7361 2.23891 0
65 | 1549.9072 2.23297 0
66 | 1653.2343 2.2273 0
67 | 1771.3225 2.22189 0
68 | 1907.5782 2.21672 0
69 | 2066.5429 2.21178 0
70 |
--------------------------------------------------------------------------------
/backend/data/CdTe.txt:
--------------------------------------------------------------------------------
1 | 253.0 2.48 2.04
2 | 258.3 2.49 1.89
3 | 263.8 2.48 1.80
4 | 269.5 2.45 1.73
5 | 275.5 2.43 1.67
6 | 281.8 2.41 1.64
7 | 288.3 2.38 1.60
8 | 295.2 2.36 1.57
9 | 302.4 2.33 1.59
10 | 310.0 2.39 1.71
11 | 317.9 2.57 1.90
12 | 326.3 2.80 1.77
13 | 335.1 2.92 1.61
14 | 344.4 2.93 1.54
15 | 354.2 2.89 1.52
16 | 364.7 2.91 1.67
17 | 375.7 3.30 1.67
18 | 387.5 3.44 1.16
19 | 400.0 3.43 1.02
20 | 413.3 3.37 0.861
21 | 450. 3.080 0.485
22 | 450.9 3.23 0.636
23 | 495.9 3.14 0.525
24 | 500. 3.010 0.380
25 | 550. 2.945 0.300
26 | 551.0 3.05 0.411
27 | 600. 2.894 0.261
28 | 619.9 2.99 0.351
29 | 650. 2.860 0.238
30 | 700. 2.861 0.210
31 | 708.5 2.95 0.338
32 | 750. 2.870 0.185
33 | 800. 2.876 0.125
34 | 820. 2.880 0.04
35 | 840.0 2.905 0.00134
36 | 855.1 2.9565 0.000051
37 | 861.0 2.9479 0.0000137
38 |
--------------------------------------------------------------------------------
/backend/data/CuO.txt:
--------------------------------------------------------------------------------
1 | 300.0 2.18 1.50
2 | 350.0 2.24 1.03
3 | 400.0 2.34 0.87
4 | 450.0 2.45 0.77
5 | 500.0 2.54 0.68
6 | 550.0 2.58 0.59
7 | 600.0 2.65 0.50
8 | 650.0 2.72 0.40
9 | 700.0 2.88 0.31
10 | 750.0 2.97 0.22
11 | 800.0 2.94 0.11
12 | 850.0 2.81 0.04
13 | 900.0 2.74 0.03
14 | 950.0 2.69 0.02
15 | 1000.0 2.65 0.01
16 | 1100.0 2.61 0.00
17 | 1200.0 2.58 0.00
18 | 1300.0 2.57 0.00
19 | 1400.0 2.56 0.00
20 | 1500.0 2.56 0.00
21 | 2000.0 2.55 0.00
22 | 2500.0 2.55 0.00
23 |
--------------------------------------------------------------------------------
/backend/data/Cu_JC.txt:
--------------------------------------------------------------------------------
1 | 187.9 0.94 1.337
2 | 191.6 0.95 1.388
3 | 195.3 0.97 1.440
4 | 199.3 0.98 1.493
5 | 203.3 0.99 1.550
6 | 207.3 1.01 1.599
7 | 211.9 1.04 1.651
8 | 216.4 1.08 1.699
9 | 221.4 1.13 1.737
10 | 226.2 1.18 1.768
11 | 231.3 1.23 1.792
12 | 237.1 1.28 1.802
13 | 242.6 1.34 1.799
14 | 249.0 1.37 1.783
15 | 255.1 1.41 1.741
16 | 261.6 1.41 1.691
17 | 268.9 1.45 1.668
18 | 276.1 1.46 1.646
19 | 284.4 1.45 1.633
20 | 292.4 1.42 1.633
21 | 300.9 1.40 1.679
22 | 310.7 1.38 1.729
23 | 320.4 1.38 1.783
24 | 331.5 1.34 1.821
25 | 342.5 1.36 1.864
26 | 354.2 1.37 1.916
27 | 367.9 1.36 1.975
28 | 381.5 1.33 2.045
29 | 397.4 1.32 2.116
30 | 413.3 1.28 2.207
31 | 430.5 1.25 2.305
32 | 450.9 1.24 2.397
33 | 471.4 1.25 2.483
34 | 495.9 1.22 2.564
35 | 520.9 1.18 2.608
36 | 548.6 1.02 2.577
37 | 582.1 0.70 2.704
38 | 616.8 0.30 3.205
39 | 659.5 0.22 3.747
40 | 704.5 0.21 4.205
41 | 756.0 0.24 4.665
42 | 821.1 0.26 5.180
43 | 892.0 0.30 5.768
44 | 984.0 0.32 6.421
45 | 1088.0 0.36 7.217
46 | 1216.0 0.48 8.245
47 | 1393.0 0.60 9.439
48 | 1610.0 0.76 11.12
49 | 1937.0 1.09 13.43
50 |
--------------------------------------------------------------------------------
/backend/data/FeS2.txt:
--------------------------------------------------------------------------------
1 | 310.0 2.12 2.6
2 | 330.6 2.59 2.65
3 | 354.2 2.65 2.248
4 | 381.5 2.44 2.08
5 | 413.3 2.38 2.1
6 | 450.8 2.35 2.348
7 | 495.9 2.4 2.678
8 | 551.0 2.6 3.128
9 | 619.9 3.38 3.4683
10 | 708.5 4.2 4.308
11 | 826.5 6.65 4.09
12 | 991.9 5.9 1
13 | 1240.0 5.45 0.51
14 |
--------------------------------------------------------------------------------
/backend/data/GaAs.txt:
--------------------------------------------------------------------------------
1 | 206.63 1.264 2.472
2 | 210.14 1.288 2.557
3 | 213.76 1.311 2.625
4 | 217.51 1.325 2.71
5 | 221.39 1.349 2.815
6 | 225.42 1.383 2.936
7 | 229.59 1.43 3.079
8 | 233.92 1.499 3.255
9 | 238.42 1.599 3.484
10 | 243.1 1.802 3.795
11 | 247.96 2.273 4.084
12 | 253.02 2.89 4.047
13 | 258.29 3.342 3.77
14 | 263.79 3.598 3.452
15 | 269.52 3.769 3.169
16 | 275.51 3.913 2.919
17 | 281.77 4.015 2.563
18 | 288.33 3.939 2.26
19 | 295.19 3.81 2.069
20 | 302.39 3.692 1.969
21 | 309.95 3.601 1.92
22 | 317.9 3.538 1.904
23 | 326.26 3.501 1.909
24 | 335.08 3.485 1.931
25 | 344.39 3.495 1.965
26 | 354.23 3.531 2.013
27 | 364.65 3.596 2.076
28 | 375.7 3.709 2.162
29 | 387.44 3.938 2.288
30 | 399.94 4.373 2.146
31 | 413.27 4.509 1.948
32 | 427.52 5.052 1.721
33 | 442.79 4.959 0.991
34 | 459.19 4.694 0.696
35 | 476.85 4.492 0.539
36 | 495.92 4.333 0.441
37 | 516.58 4.205 0.371
38 | 539.04 4.1 0.32
39 | 563.55 4.013 0.276
40 | 590.38 3.94 0.24
41 | 619.9 3.878 0.211
42 | 652.53 3.826 0.179
43 | 688.78 3.785 0.151
44 | 729.29 3.742 0.112
45 | 774.87 3.7 0.091
46 | 826.53 3.666 0.08
47 | 885.57 3.614 0.0017
48 | 953.69 3.5388 0.0
49 | 1033.17 3.492 0.0
50 | 1127.09 3.4546 0.0
51 | 1239.8 3.4232 0.0
52 | 1377.56 3.3965 0.0
53 | 1549.75 3.3737 0.0
54 | 1771.14 3.3543 0.0
55 | 2066.33 3.3378 0.0
56 |
57 |
--------------------------------------------------------------------------------
/backend/data/GaN.txt:
--------------------------------------------------------------------------------
1 | 203.28 2.804 1.233
2 | 210.17 2.813 1.095
3 | 217.54 2.817 0.976
4 | 225.45 2.808 0.856
5 | 233.96 2.787 0.74
6 | 243.14 2.764 0.63
7 | 253.06 2.722 0.544
8 | 263.83 2.674 0.479
9 | 275.56 2.629 0.43
10 | 288.37 2.597 0.402
11 | 302.44 2.572 0.376
12 | 317.95 2.555 0.361
13 | 335.14 2.56 0.349
14 | 354.29 2.615 0.339
15 | 364.71 2.716 0.261
16 | 370.15 2.664 0.167
17 | 375.76 2.675 0.0
18 | 400.0 2.565 0.0
19 | 427.59 2.51 0.0
20 | 459.26 2.471 0.0
21 | 496.0 2.436 0.0
22 | 539.13 2.408 0.0
23 | 590.48 2.393 0.0
24 | 620.0 2.383 0.0
25 | 688.89 2.365 0.0
26 | 729.41 2.359 0.0
27 | 775.0 2.351 0.0
28 | 826.67 2.346 0.0
29 | 885.71 2.34 0.0
30 | 953.85 2.336 0.0
31 | 2480.0 2.264 0.0001
32 | 3100.0 2.255 0.0002
33 |
--------------------------------------------------------------------------------
/backend/data/Ge.txt:
--------------------------------------------------------------------------------
1 | 206.64 1.02 2.77
2 | 208.38 1.06 2.8
3 | 210.14 1.11 2.83
4 | 211.94 1.16 2.86
5 | 213.77 1.21 2.87
6 | 215.63 1.26 2.87
7 | 217.52 1.31 2.87
8 | 219.44 1.34 2.86
9 | 221.4 1.36 2.85
10 | 223.4 1.37 2.84
11 | 225.43 1.38 2.84
12 | 227.5 1.38 2.85
13 | 229.6 1.38 2.85
14 | 231.75 1.38 2.87
15 | 233.93 1.37 2.9
16 | 236.16 1.37 2.93
17 | 238.43 1.36 2.97
18 | 240.75 1.37 3.02
19 | 243.11 1.37 3.07
20 | 245.52 1.38 3.13
21 | 247.97 1.39 3.2
22 | 250.48 1.41 3.27
23 | 253.03 1.44 3.34
24 | 255.64 1.46 3.42
25 | 258.3 1.5 3.51
26 | 261.02 1.54 3.6
27 | 263.8 1.59 3.71
28 | 266.63 1.64 3.83
29 | 269.53 1.72 3.96
30 | 272.49 1.81 4.12
31 | 275.52 1.95 4.3
32 | 278.62 2.2 4.51
33 | 281.78 2.52 4.67
34 | 285.02 2.94 4.64
35 | 288.34 3.34 4.51
36 | 291.73 3.59 4.27
37 | 295.2 3.75 4.01
38 | 298.76 3.83 3.8
39 | 302.4 3.87 3.61
40 | 306.14 3.89 3.46
41 | 309.96 3.91 3.34
42 | 313.89 3.91 3.23
43 | 317.91 3.92 3.14
44 | 322.04 3.93 3.06
45 | 326.28 3.94 2.99
46 | 330.63 3.95 2.92
47 | 335.1 3.96 2.86
48 | 339.69 3.97 2.81
49 | 344.4 3.99 2.76
50 | 349.25 4 2.71
51 | 354.24 4.02 2.67
52 | 359.38 4.04 2.62
53 | 364.66 4.07 2.58
54 | 370.11 4.1 2.53
55 | 375.71 4.13 2.47
56 | 381.49 4.15 2.41
57 | 387.45 4.16 2.34
58 | 393.6 4.15 2.27
59 | 399.95 4.14 2.22
60 | 406.51 4.11 2.17
61 | 413.28 4.08 2.15
62 | 420.29 4.06 2.14
63 | 427.54 4.04 2.14
64 | 435.04 4.03 2.16
65 | 442.8 4.04 2.18
66 | 450.86 4.05 2.21
67 | 459.2 4.08 2.24
68 | 467.87 4.12 2.27
69 | 476.87 4.18 2.31
70 | 486.22 4.25 2.35
71 | 495.94 4.34 2.38
72 | 506.06 4.46 2.43
73 | 516.6 4.61 2.46
74 | 527.6 4.84 2.41
75 | 539.07 5.06 2.32
76 | 551.05 5.17 2.2
77 | 563.57 5.28 2.05
78 | 576.68 5.54 1.87
79 | 590.41 5.75 1.63
80 | 604.81 5.72 1.28
81 | 619.93 5.59 0.93
82 | 635.82 5.45 0.75
83 | 652.55 5.29 0.64
84 | 670.19 5.17 0.56
85 | 688.81 5.07 0.5
86 | 708.49 4.98 0.45
87 | 729.32 4.9 0.4
88 | 751.43 4.83 0.37
89 | 774.91 4.76 0.35
90 | 799.9 4.71 0.32
91 | 826.57 4.65 0.3
92 | 855.07 4.6 0.24
93 | 885.61 4.56 0.19
94 | 918.41 4.53 0.17
95 | 953.73 4.5 0.17
96 | 991.88 4.46 0.14
97 | 1033.21 4.42 0.12
98 | 1078.13 4.4 0.11
99 | 1127.14 4.39 0.1
100 | 1180.81 4.36 0.09
101 | 1239.85 4.33 0.08
102 | 1305.11 4.3 0.08
103 | 1377.61 4.29 0.07
104 | 1458.65 4.28 0.04
105 | 1549.81 4.28 0.01
106 | 1653.14 4.23 0
107 | 1771.22 4.18 0
108 | 1907.46 4.13 0
109 | 2066.42 4.1 0
110 | 2254.28 4.09 0
111 | 2479.7 4.07 0
112 |
113 |
--------------------------------------------------------------------------------
/backend/data/ITO.txt:
--------------------------------------------------------------------------------
1 | 250.0 2.3505 0.2113379
2 | 260.0 2.3552 0.1801257
3 | 270.0 2.3513 0.1544102
4 | 280.0 2.3414 0.1331719
5 | 290.0 2.3274 0.1156021
6 | 300.0 2.3105 0.1010547
7 | 310.0 2.2918 0.08900975
8 | 320.0 2.272 0.07904635
9 | 330.0 2.2516 0.07082141
10 | 340.0 2.231 0.06405398
11 | 350.0 2.2106 0.05851254
12 | 360.0 2.1904 0.05400554
13 | 370.0 2.1708 0.05037373
14 | 380.0 2.1516 0.04748415
15 | 390.0 2.1331 0.04522533
16 | 400.0 2.1152 0.04350352
17 | 410.0 2.098 0.04223955
18 | 420.0 2.0815 0.04136638
19 | 430.0 2.0657 0.04082706
20 | 440.0 2.0505 0.04057307
21 | 450.0 2.036 0.04056298
22 | 460.0 2.0221 0.0407613
23 | 470.0 2.0088 0.04113761
24 | 480.0 1.9961 0.04166571
25 | 490.0 1.9839 0.04232306
26 | 500.0 1.9723 0.04309022
27 | 510.0 1.9613 0.04395034
28 | 520.0 1.9507 0.04488888
29 | 530.0 1.9405 0.04589323
30 | 540.0 1.9308 0.04695242
31 | 550.0 1.9216 0.04805696
32 | 560.0 1.9127 0.04919859
33 | 570.0 1.9042 0.05037013
34 | 580.0 1.8961 0.05156533
35 | 590.0 1.8883 0.05277875
36 | 600.0 1.8808 0.05400567
37 | 610.0 1.8737 0.05524196
38 | 620.0 1.8668 0.05648406
39 | 630.0 1.8602 0.05772886
40 | 640.0 1.8539 0.05897364
41 | 650.0 1.8478 0.06021609
42 | 660.0 1.842 0.06145417
43 | 670.0 1.8364 0.06268614
44 | 680.0 1.831 0.06391049
45 | 690.0 1.8259 0.06512594
46 | 700.0 1.8209 0.06633137
47 | 710.0 1.8161 0.06752584
48 | 720.0 1.8115 0.06870857
49 | 730.0 1.807 0.06987888
50 | 740.0 1.8028 0.07103622
51 | 750.0 1.7986 0.07218014
52 | 760.0 1.7946 0.07331026
53 | 770.0 1.7908 0.07442628
54 | 780.0 1.7871 0.07552799
55 | 790.0 1.7835 0.07661521
56 | 800.0 1.7801 0.07768784
57 | 810.0 1.7767 0.0787458
58 | 820.0 1.7735 0.07978907
59 | 830.0 1.7704 0.08081765
60 | 840.0 1.7674 0.08183157
61 | 850.0 1.7645 0.0828309
62 |
--------------------------------------------------------------------------------
/backend/data/InAs.txt:
--------------------------------------------------------------------------------
1 | 195.3 1.583 2.12
2 | 206.6 1.4342 2.112
3 | 208.7 1.401 2.085
4 | 210.1 1.383 2.084
5 | 212.3 1.35 2.089
6 | 213.8 1.333 2.102
7 | 216 1.306 2.135
8 | 221.4 1.276 2.248
9 | 225.4 1.282 2.344
10 | 227.9 1.297 2.407
11 | 229.6 1.312 2.449
12 | 232.2 1.341 2.514
13 | 233.9 1.366 2.555
14 | 236.6 1.408 2.612
15 | 238.4 1.436 2.646
16 | 241.2 1.469 2.694
17 | 243.1 1.484 2.732
18 | 246 1.505 2.807
19 | 248 1.524 2.871
20 | 249 1.535 2.907
21 | 250 1.55 2.946
22 | 251 1.566 2.988
23 | 253 1.608 3.081
24 | 255.1 1.668 3.182
25 | 257.2 1.751 3.291
26 | 259.4 1.866 3.404
27 | 261.6 2.019 3.504
28 | 263.8 2.204 3.575
29 | 266.1 2.407 3.604
30 | 268.4 2.609 3.596
31 | 270.7 2.799 3.564
32 | 273.1 2.99 3.519
33 | 275.5 3.194 3.445
34 | 278 3.399 3.32
35 | 281.8 3.644 3.042
36 | 284.4 3.742 2.814
37 | 287 3.77 2.584
38 | 288.3 3.761 2.478
39 | 291 3.715 2.297
40 | 295.2 3.615 2.099
41 | 298 3.545 2.005
42 | 300.9 3.48 1.933
43 | 303.9 3.419 1.877
44 | 306.9 3.364 1.833
45 | 314.7 3.246 1.761
46 | 322.9 3.158 1.726
47 | 335.1 3.069 1.715
48 | 350.2 3.015 1.742
49 | 364.7 3.004 1.79
50 | 382.7 3.035 1.868
51 | 394.9 3.083 1.929
52 | 413.3 3.197 2.034
53 | 418.9 3.244 2.069
54 | 424.6 3.302 2.108
55 | 433.5 3.425 2.174
56 | 442.8 3.626 2.208
57 | 449.2 3.776 2.153
58 | 455.8 3.878 2.06
59 | 466.1 3.956 1.943
60 | 476.9 4.021 1.885
61 | 488.1 4.168 1.879
62 | 499.9 4.437 1.686
63 | 516.6 4.466 1.283
64 | 529.9 4.389 1.086
65 | 543.8 4.303 0.951
66 | 558.5 4.224 0.85
67 | 579.4 4.131 0.75
68 | 596.1 4.068 0.694
69 | 607.8 4.031 0.661
70 | 626.2 3.979 0.619
71 | 645.8 3.932 0.582
72 | 659.5 3.902 0.564
73 | 681.2 3.862 0.539
74 | 696.5 3.839 0.523
75 | 712.6 3.817 0.508
76 | 738 3.788 0.486
77 | 756 3.77 0.475
78 | 774.9 3.755 0.463
79 | 794.8 3.735 0.458
80 | 815.7 3.72 0.444
81 | 826.6 3.714 0.432
82 | 885.6 3.696 0.4
83 | 1033 3.613 0.33
84 | 1240 3.548 0.265
85 | 1378 3.516 0.237
86 | 1459 3.513 0.232
87 | 1550 3.512 0.21
88 | 1653 3.51 0.191
89 | 1771 3.5 0.183
90 | 1907 3.495 0.167
91 |
--------------------------------------------------------------------------------
/backend/data/Low_Fe_Glass_Pil.txt:
--------------------------------------------------------------------------------
1 | 300 1.381 9.50E-06
2 | 305 1.4 6.98E-06
3 | 310 1.431 5.01E-06
4 | 315 1.458 3.54E-06
5 | 320 1.492 2.40E-06
6 | 325 1.513 1.65E-06
7 | 330 1.53 1.10E-06
8 | 335 1.546 7.22E-07
9 | 340 1.555 4.53E-07
10 | 345 1.559 2.98E-07
11 | 350 1.563 1.78E-07
12 | 355 1.563 1.14E-07
13 | 360 1.563 6.71E-08
14 | 365 1.563 5.83E-08
15 | 370 1.559 4.92E-08
16 | 375 1.559 4.99E-08
17 | 380 1.559 4.04E-08
18 | 385 1.555 4.09E-08
19 | 390 1.555 4.15E-08
20 | 395 1.555 1.05E-08
21 | 400 1.55 2.12E-08
22 | 410 1.55 3.27E-08
23 | 420 1.546 5.58E-08
24 | 430 1.546 3.43E-08
25 | 440 1.546 3.51E-08
26 | 450 1.542 3.59E-08
27 | 460 1.542 2.44E-08
28 | 470 1.542 1.25E-08
29 | 480 1.538 3.83E-08
30 | 490 1.538 2.60E-08
31 | 500 1.538 1.33E-08
32 | 510 1.538 2.71E-08
33 | 520 1.534 4.14E-08
34 | 530 1.534 2.82E-08
35 | 540 1.534 2.87E-08
36 | 550 1.534 2.92E-08
37 | 560 1.53 4.46E-08
38 | 570 1.53 3.03E-08
39 | 580 1.53 7.71E-08
40 | 590 1.53 7.85E-08
41 | 600 1.53 7.98E-08
42 | 610 1.526 9.74E-08
43 | 620 1.526 1.16E-07
44 | 630 1.526 1.17E-07
45 | 640 1.521 1.54E-07
46 | 650 1.521 1.56E-07
47 | 660 1.521 1.41E-07
48 | 670 1.521 1.61E-07
49 | 680 1.521 1.63E-07
50 | 690 1.521 1.84E-07
51 | 700 1.521 1.87E-07
52 | 710 1.517 2.27E-07
53 | 720 1.517 2.11E-07
54 | 730 1.517 2.73E-07
55 | 740 1.517 2.77E-07
56 | 750 1.517 2.81E-07
57 | 760 1.517 3.05E-07
58 | 770 1.517 3.50E-07
59 | 780 1.517 3.13E-07
60 | 790 1.513 3.81E-07
61 | 800 1.517 3.21E-07
62 | 810 1.517 4.12E-07
63 | 820 1.513 4.62E-07
64 | 830 1.513 4.45E-07
65 | 840 1.513 3.82E-07
66 | 850 1.509 4.33E-07
67 | 860 1.513 4.38E-07
68 | 870 1.538 3.25E-07
69 | 880 1.509 5.91E-07
70 | 890 1.5 5.74E-07
71 | 900 1.505 5.80E-07
72 | 910 1.517 5.86E-07
73 | 920 1.5 6.43E-07
74 | 930 1.47 8.53E-07
75 | 940 1.517 6.83E-07
76 | 950 1.5 6.90E-07
77 | 960 1.5 7.23E-07
78 | 970 1.483 7.57E-07
79 | 980 1.509 5.78E-07
80 | 990 1.5 7.19E-07
81 | 1000 1.492 7.26E-07
82 | 1050 1.5 8.48E-07
83 | 1100 1.509 7.09E-07
84 | 1150 1.53 5.23E-07
85 | 1200 1.517 6.11E-07
86 | 1250 1.492 9.76E-07
87 | 1300 1.517 6.97E-07
88 | 1350 1.526 5.41E-07
89 | 1400 1.488 8.26E-07
90 | 1450 1.505 6.60E-07
91 | 1500 1.505 8.04E-07
92 | 1550 1.479 7.47E-07
93 | 1600 1.496 8.14E-07
94 | 1650 1.513 3.52E-07
95 | 1700 1.479 5.90E-07
96 | 1750 1.509 4.20E-07
97 | 1800 1.488 9.16E-07
98 | 1850 1.483 8.91E-07
99 | 1900 1.5 1.02E-06
100 | 1950 1.5 1.10E-06
101 | 2000 1.5 1.29E-06
102 | 2050 1.517 1.10E-06
103 | 2100 1.488 1.75E-06
104 | 2150 1.5 1.68E-06
105 | 2200 1.488 2.75E-06
106 | 2250 1.462 3.19E-06
107 | 2300 1.462 3.00E-06
108 | 2350 1.5 2.22E-06
109 | 2400 1.47 2.93E-06
110 | 2450 1.492 4.23E-06
111 | 2500 1.492 3.33E-06
112 |
113 |
114 |
--------------------------------------------------------------------------------
/backend/data/MgF2.txt:
--------------------------------------------------------------------------------
1 | 250.0 1.4117 0.0
2 | 275.0 1.4044 0.0
3 | 300.0 1.3996 0.0
4 | 325.0 1.3961 0.0
5 | 350.0 1.3935 0.0
6 | 375.0 1.3915 0.0
7 | 400.0 1.3899 0.0
8 | 425.0 1.3886 0.0
9 | 450.0 1.3875 0.0
10 | 475.0 1.3865 0.0
11 | 500.0 1.3857 0.0
12 | 525.0 1.385 0.0
13 | 550.0 1.3844 0.0
14 | 575.0 1.3839 0.0
15 | 600.0 1.3834 0.0
16 | 625.0 1.383 0.0
17 | 650.0 1.3826 0.0
18 | 675.0 1.3823 0.0
19 | 700.0 1.3819 0.0
20 | 725.0 1.3816 0.0
21 | 750.0 1.3814 0.0
22 | 775.0 1.3811 0.0
23 | 800.0 1.3809 0.0
24 | 825.0 1.3807 0.0
25 | 850.0 1.3805 0.0
26 | 875.0 1.3803 0.0
27 | 900.0 1.3802 0.0
--------------------------------------------------------------------------------
/backend/data/Perovskite_b2b_nk.txt:
--------------------------------------------------------------------------------
1 | 675 2.56042824039999983 0.272871149931054546
2 | 680 2.55699874040000008 0.269481149643197249
3 | 685 2.55356914040000005 0.261650726443075909
4 | 690 2.55074674259999989 0.255324317455173144
5 | 695 2.54995154260000012 0.245007098269240997
6 | 700 2.54915644260000018 0.242313400857410655
7 | 705 2.54836124259999997 0.247410337909928585
8 | 710 2.54866969259999987 0.255380021685255254
9 | 715 2.55162561119999998 0.270833966659478287
10 | 730 2.56094796600000008 0.226557061491313022
11 | 735 2.56749936599999984 0.267881642465123637
12 | 740 2.57405078460000025 0.270881713142405889
13 | 750 2.58715366599999985 0.283494742382438603
14 | 755 2.58700424460000011 0.24392882352979342
15 | 760 2.58406386319999992 0.179622268773513089
16 | 765 2.58112346319999997 0.132102581639850447
17 | 770 2.57818306320000001 0.0931374726973771688
18 | 775 2.57507057579999987 0.0629059912570716362
19 | 780 2.55358327579999989 0.0406561302128246663
20 | 785 2.53209605720000042 0.0241752379683011741
21 | 790 2.51060875720000043 0.0133905011370366121
22 | 795 2.4891214572 0.00733863442596729542
23 | 800 2.46770331560000011 0.0035841693184294832
24 | 805 2.45343561560000012 0.00172961634405117276
25 | 810 2.43916791560000012 0.000837950775378828918
26 | 815 2.42490021560000013 0.00040080785093547463
27 | 820 2.41063243420000006 0.000187930156802910037
28 | 825 2.39636473420000007 8.66598665135370283e-05
29 | 830 2.38751673139999987 3.8903038514667438e-05
30 | 835 2.38125973139999969 1.90038959798877636e-05
31 | 840 2.37500273139999996 9.0240852733104655e-06
32 | 845 2.36874571280000001 4.36406832831554323e-06
33 | 850 2.36248871280000028 2.07657411999150456e-06
34 | 860 2.3528721798000003 5.02324831386640169e-07
35 | 870 2.34629726119999971 1.32233884467901233e-07
36 | 880 2.33972227980000014 3.49440593052565467e-08
37 | 890 2.33411782760000008 1.10485361494393754e-08
38 | 900 2.32977972760000007 4.08232429030711552e-09
39 | 910 2.32544154619999999 1.52796703115374123e-09
40 | 920 2.3212628620000002 5.89350754269288488e-10
41 | 930 2.31796216200000016 2.3756262580611761e-10
42 | 940 2.31466136200000028 1.01731839624339527e-10
43 | 950 2.31136066200000023 4.61151447608766771e-11
44 | 960 2.30843809659999977 2.15432130969189566e-11
45 | 970 2.30574619659999991 1.04978600463414156e-11
46 | 980 2.30305429660000005 4.97550183093883105e-12
47 | 990 2.30036239659999975 2.64706501350440355e-12
48 | 1000 2.29801287780000019 1.50401421221841102e-12
49 | 1015 2.29461227780000021 5.62167089989192705e-13
50 | 1030 2.29121167780000023 2.16387060627740924e-13
51 | 1045 2.2881960915999997 9.06427189644116971e-14
52 | 1060 2.2852878915999999 3.99829048035459531e-14
53 | 1075 2.28237969159999965 1.7365793728114431e-14
54 | 1090 2.27979469379999999 6.99987312959619484e-15
55 | 1105 2.27729719379999995 3.06007209082787132e-15
56 | 1120 2.27479969379999991 1.38146490603765173e-15
57 | 1135 2.27248182160000001 6.01534065162972936e-16
58 | 1150 2.27033004019999973 3.38602141428007379e-16
59 | 1165 2.2681782401999997 2.0581121465928448e-16
60 | 1180 2.2660264402000001 1.38974096307843024e-16
61 | 1195 2.26415689360000005 7.03703580880815263e-17
62 | 1210 2.26230481220000001 3.45676578648442025e-17
63 | 1225 2.26045281220000005 1.93989981261133941e-17
64 | 1240 2.25860212839999974 1.32225926720746644e-17
65 | 1255 2.25701614699999986 7.26052913764494711e-18
66 | 1270 2.25543022839999985 4.8611490043273052e-18
67 | 1285 2.25384422839999976 3.04726011790897397e-18
68 | 1300 2.25225822839999967 2.04832411759269325e-18
69 | 1315 2.25082202600000025 1.41269906361943617e-18
70 | 1330 2.24946500739999999 9.57834236262799361e-19
71 | 1345 2.24810792599999987 7.08549848897963562e-19
72 | 1360 2.24675090740000005 4.17749894627606886e-19
73 | 1375 2.24539382599999993 2.95431363114330749e-19
74 | 1390 2.24420256779999994 2.16800863479779835e-19
75 | 1400 2.24343256780000022 1.2923381379061904e-19
76 |
--------------------------------------------------------------------------------
/backend/data/Si_a.txt:
--------------------------------------------------------------------------------
1 | 248.0 0.995 2.35E-2
2 | 253.0 0.992 2.42E-2
3 | 258.3 0.990 2.50E-2
4 | 263.8 0.988 2.58E-2
5 | 269.5 0.986 2.67E-2
6 | 275.5 0.984 2.75E-2
7 | 281.8 0.981 2.85E-2
8 | 288.3 0.979 2.94E-2
9 | 295.2 0.976 3.04E-2
10 | 302.4 0.973 3.14E-2
11 | 310.0 0.970 3.26E-2
12 | 317.9 0.967 3.37E-2
13 | 326.3 0.963 3.50E-2
14 | 335.1 0.959 3.64E-2
15 | 344.4 0.955 3.79E-2
16 | 354.2 0.950 3.95E-2
17 | 364.7 0.945 4.13E-2
18 | 375.7 0.939 4.33E-2
19 | 387.5 0.933 4.55E-2
20 | 400.0 0.926 4.80E-2
21 | 413.3 0.918 5.08E-2
22 | 427.5 0.909 5.41E-2
23 | 442.8 0.899 5.79E-2
24 | 459.2 0.888 6.23E-2
25 | 476.9 0.876 6.75E-2
26 | 495.9 0.862 7.37E-2
27 | 516.6 0.846 8.12E-2
28 | 539.1 0.828 9.03E-2
29 | 563.6 0.808 0.101
30 | 590.4 0.785 0.115
31 | 619.9 0.758 0.132
32 | 652.6 0.727 0.154
33 | 688.8 0.691 0.181
34 | 729.3 0.651 0.216
35 | 774.9 0.603 0.261
36 | 826.6 0.549 0.321
37 | 885.6 0.485 0.403
38 | 953.7 0.410 0.519
39 | 1033. 0.327 0.726
40 | 1078. 0.363 0.847
41 | 1127. 0.392 0.946
42 | 1240. 0.459 1.14
43 | 1305. 0.497 1.24
44 | 1459. 0.597 1.47
45 | 1653. 0.735 1.74
46 | 1907. 0.951 2.07
47 | 2254. 1.35 2.51
48 | 2583. 1.86 2.85
49 | 2695. 2.07 2.93
50 | 2818. 2.30 2.99
51 | 2952. 2.56 3.04
52 | 3100. 2.87 3.06
53 | 3263. 3.21 3.00
54 | 3444. 3.55 2.88
55 | 3543. 3.73 2.79
56 | 3647. 3.90 2.66
57 | 3875. 4.17 2.38
58 | 4133. 4.38 2.02
59 | 4428. 4.47 1.64
60 | 4769. 4.49 1.28
61 | 4960. 4.47 1.12
62 | 5166. 4.46 0.969
63 | 6199. 4.23 0.461
64 | 6888. 4.09 0.271
65 | 7293. 4.01 0.199
66 | 7749. 3.93 0.136
67 | 8266. 3.86 8.12E-2
68 | 8856. 3.77 4.01E-2
--------------------------------------------------------------------------------
/backend/data/Si_c.txt:
--------------------------------------------------------------------------------
1 | 250 1.694 3.666
2 | 260 1.8 4.072
3 | 270 2.129 4.69
4 | 280 3.052 5.258
5 | 290 4.426 5.16
6 | 300 5.055 4.128
7 | 310 5.074 3.559
8 | 320 5.102 3.269
9 | 330 5.179 3.085
10 | 340 5.293 2.951
11 | 350 5.483 2.904
12 | 360 6.014 2.912
13 | 370 6.863 2.051
14 | 380 6.548 0.885
15 | 390 5.976 0.465
16 | 400 5.587 0.303
17 | 410 5.305 0.22
18 | 420 5.091 0.167
19 | 430 4.925 0.134
20 | 440 4.793 0.109
21 | 450 4.676 0.091
22 | 460 4.577 0.077
23 | 470 4.491 0.064
24 | 480 4.416 0.057
25 | 490 4.348 0.05
26 | 500 4.293 0.045
27 | 510 4.239 0.039
28 | 520 4.192 0.036
29 | 530 4.15 0.033
30 | 540 4.11 0.03
31 | 550 4.077 0.028
32 | 560 4.044 0.026
33 | 570 4.015 0.024
34 | 580 3.986 0.023
35 | 590 3.962 0.021
36 | 600 3.939 0.02
37 | 610 3.916 0.018
38 | 620 3.895 0.017
39 | 630 3.879 0.016
40 | 640 3.861 0.015
41 | 650 3.844 0.015
42 | 660 3.83 0.014
43 | 670 3.815 0.013
44 | 680 3.8 0.012
45 | 690 3.787 0.011
46 | 700 3.774 0.011
47 | 710 3.762 0.011
48 | 720 3.751 0.01
49 | 730 3.741 0.009
50 | 740 3.732 0.008
51 | 750 3.723 0.008
52 | 760 3.714 0.007
53 | 770 3.705 0.007
54 | 780 3.696 0.006
55 | 790 3.688 0.006
56 | 800 3.681 0.005
57 | 810 3.674 0.005
58 | 820 3.668 0.005
59 | 830 3.662 0.004
60 | 840 3.656 0.004
61 | 850 3.65 0.004
62 | 860 3.644 0.003
63 | 870 3.638 0.003
64 | 880 3.632 0.003
65 | 890 3.626 0.002
66 | 900 3.62 0.002
67 | 910 3.614 0.002
68 | 920 3.608 0.002
69 | 930 3.602 0.002
70 | 940 3.597 0.001
71 | 950 3.592 0.001
72 | 960 3.587 0.001
73 | 970 3.582 0.001
74 | 980 3.578 0.001
75 | 990 3.574 0.001
76 | 1000 3.57 0.001
77 | 1010 3.566 0.0004107073
78 | 1020 3.563 0.0003238644
79 | 1030 3.56 0.0002475337
80 | 1040 3.557 0.0001870389
81 | 1050 3.554 0.0001361968
82 | 1060 3.551 9.36309E-005
83 | 1070 3.548 6.81183E-005
84 | 1080 3.546 5.32851E-005
85 | 1090 3.544 4.07675E-005
86 | 1100 3.541 3.06373E-005
87 | 1110 3.539 2.38494E-005
88 | 1120 3.537 1.78253E-005
89 | 1130 3.534 1.34884E-005
90 | 1140 3.532 9.07183E-006
91 | 1150 3.53 0.000006223
92 | 1160 3.528 0.000003877
93 | 1170 3.526 2.04832E-006
94 | 1180 3.524 6.10359E-007
95 | 1190 3.522 3.40910E-007
96 | 1200 3.52 2.10085E-007
97 | 1210 3.528 1.25175E-007
98 | 1220 3.516 7.96093E-008
99 | 1230 3.515 0.000000046
100 | 1240 3.513 2.36823E-008
101 | 1250 3.511 9.94718E-009
102 | 1260 3.51 3.60963E-009
103 | 1270 3.508 0.000000002
104 | 1280 3.507 1.22231E-009
105 | 1290 3.506 7.28850E-010
106 | 1300 3.504 4.65528E-010
107 | 1310 3.503 2.81466E-010
108 | 1320 3.501 1.68068E-010
109 | 1330 3.5 8.46704E-011
110 | 1340 3.498 3.73218E-011
111 | 1350 3.497 1.82630E-011
112 | 1360 3.496 1.08225E-011
113 | 1370 3.495 7.30442E-012
114 | 1380 3.493 4.94176E-012
115 | 1390 3.492 2.76532E-012
116 | 1400 3.491 2.22817E-012
117 | 1410 3.49 1.68306E-012
118 | 1420 3.489 9.60500E-013
119 | 1430 3.488 8.76228E-013
120 | 1440 3.487 4.81285E-013
121 | 1450 3.486 3.69239E-013
--------------------------------------------------------------------------------
/backend/data/Soda_lime_glass_nk_Pil.txt:
--------------------------------------------------------------------------------
1 |
2 | 300 1.381 9.50E-06
3 | 305 1.4 6.98E-06
4 | 310 1.431 5.01E-06
5 | 315 1.458 3.54E-06
6 | 320 1.492 2.40E-06
7 | 325 1.513 1.65E-06
8 | 330 1.53 1.10E-06
9 | 335 1.546 7.22E-07
10 | 340 1.555 4.53E-07
11 | 345 1.559 2.98E-07
12 | 350 1.563 1.78E-07
13 | 355 1.563 1.14E-07
14 | 360 1.563 6.71E-08
15 | 365 1.563 5.83E-08
16 | 370 1.559 4.92E-08
17 | 375 1.559 4.99E-08
18 | 380 1.559 4.04E-08
19 | 385 1.555 4.09E-08
20 | 390 1.555 4.15E-08
21 | 395 1.555 1.05E-08
22 | 400 1.55 2.12E-08
23 | 410 1.55 3.27E-08
24 | 420 1.546 5.58E-08
25 | 430 1.546 3.43E-08
26 | 440 1.546 3.51E-08
27 | 450 1.542 3.59E-08
28 | 460 1.542 2.44E-08
29 | 470 1.542 1.25E-08
30 | 480 1.538 3.83E-08
31 | 490 1.538 2.60E-08
32 | 500 1.538 1.33E-08
33 | 510 1.538 2.71E-08
34 | 520 1.534 4.14E-08
35 | 530 1.534 2.82E-08
36 | 540 1.534 2.87E-08
37 | 550 1.534 2.92E-08
38 | 560 1.53 4.46E-08
39 | 570 1.53 3.03E-08
40 | 580 1.53 7.71E-08
41 | 590 1.53 7.85E-08
42 | 600 1.53 7.98E-08
43 | 610 1.526 9.74E-08
44 | 620 1.526 1.16E-07
45 | 630 1.526 1.17E-07
46 | 640 1.521 1.54E-07
47 | 650 1.521 1.56E-07
48 | 660 1.521 1.41E-07
49 | 670 1.521 1.61E-07
50 | 680 1.521 1.63E-07
51 | 690 1.521 1.84E-07
52 | 700 1.521 1.87E-07
53 | 710 1.517 2.27E-07
54 | 720 1.517 2.11E-07
55 | 730 1.517 2.73E-07
56 | 740 1.517 2.77E-07
57 | 750 1.517 2.81E-07
58 | 760 1.517 3.05E-07
59 | 770 1.517 3.50E-07
60 | 780 1.517 3.13E-07
61 | 790 1.513 3.81E-07
62 | 800 1.517 3.21E-07
63 | 810 1.517 4.12E-07
64 | 820 1.513 4.62E-07
65 | 830 1.513 4.45E-07
66 | 840 1.513 3.82E-07
67 | 850 1.509 4.33E-07
68 | 860 1.513 4.38E-07
69 | 870 1.538 3.25E-07
70 | 880 1.509 5.91E-07
71 | 890 1.5 5.74E-07
72 | 900 1.505 5.80E-07
73 | 910 1.517 5.86E-07
74 | 920 1.5 6.43E-07
75 | 930 1.47 8.53E-07
76 | 940 1.517 6.83E-07
77 | 950 1.5 6.90E-07
78 | 960 1.5 7.23E-07
79 | 970 1.483 7.57E-07
80 | 980 1.509 5.78E-07
81 | 990 1.5 7.19E-07
82 | 1000 1.492 7.26E-07
83 | 1050 1.5 8.48E-07
84 | 1100 1.509 7.09E-07
85 | 1150 1.53 5.23E-07
86 | 1200 1.517 6.11E-07
87 | 1250 1.492 9.76E-07
88 | 1300 1.517 6.97E-07
89 | 1350 1.526 5.41E-07
90 | 1400 1.488 8.26E-07
91 | 1450 1.505 6.60E-07
92 | 1500 1.505 8.04E-07
93 | 1550 1.479 7.47E-07
94 | 1600 1.496 8.14E-07
95 | 1650 1.513 3.52E-07
96 | 1700 1.479 5.90E-07
97 | 1750 1.509 4.20E-07
98 | 1800 1.488 9.16E-07
99 | 1850 1.483 8.91E-07
100 | 1900 1.5 1.02E-06
101 | 1950 1.5 1.10E-06
102 | 2000 1.5 1.29E-06
103 | 2050 1.517 1.10E-06
104 | 2100 1.488 1.75E-06
105 | 2150 1.5 1.68E-06
106 | 2200 1.488 2.75E-06
107 | 2250 1.462 3.19E-06
108 | 2300 1.462 3.00E-06
109 | 2350 1.5 2.22E-06
110 | 2400 1.47 2.93E-06
111 | 2450 1.492 4.23E-06
112 | 2500 1.492 3.33E-06
113 |
--------------------------------------------------------------------------------
/backend/data/Zn3P2.txt:
--------------------------------------------------------------------------------
1 | 310 3.645 2.548
2 | 320 3.751 2.271
3 | 330 3.775 2.078
4 | 340 3.793 1.943
5 | 350 3.821 1.837
6 | 360 3.85 1.733
7 | 370 3.87 1.641
8 | 380 3.886 1.558
9 | 389.9 3.914 1.483
10 | 400 3.935 1.411
11 | 410 3.954 1.356
12 | 420 3.981 1.304
13 | 430 4.013 1.254
14 | 440 4.069 1.207
15 | 450 4.145 1.139
16 | 460 4.215 1.031
17 | 470 4.265 0.889
18 | 480 4.275 0.748
19 | 490 4.226 0.59
20 | 499.9 4.166 0.482
21 | 520 4.032 0.356
22 | 560 3.846 0.214
23 | 574 3.786 0.185
24 | 582.1 3.76 0.183
25 | 593.2 3.731 0.161
26 | 610.8 3.701 0.146
27 | 619.9 3.681 0.113
28 | 629.4 3.649 0.095
29 | 642.4 3.611 0.077
30 | 685 3.576 0.057
31 | 729.3 3.503 0.045
32 | 774.9 3.462 0.0302
33 | 784.7 3.459 0.0231
34 | 794.8 3.458 0.0164
35 | 805.1 3.457 0.0103
36 | 815.7 3.455 0.00519
37 | 826.6 3.452 0.00237
38 | 837.7 3.448 0.00120
39 | 849.2 3.441 0.000541
40 | 861.0 3.429 0.000274
41 | 885.6 3.42 0.0000479
42 | 911.7 3.408 0.0000254
--------------------------------------------------------------------------------
/backend/fortran/Completeness.f:
--------------------------------------------------------------------------------
1 | C Carry out matrix multiplication for Completeness Check
2 | C
3 | subroutine Completeness (nval, neq_PW,
4 | * K_overlap_mat, overlap_J)
5 | C
6 | implicit none
7 | C
8 | integer*8 nval, neq_PW
9 | c 32-but integers for BLAS and LAPACK
10 | integer*8 nval_max_32, PW_max_32
11 | parameter (nval_max_32 = 1000)
12 | parameter (PW_max_32 = 200)
13 | complex*16 K_overlap_mat(nval,2*neq_PW)
14 | complex*16 overlap_J(2*neq_PW,nval)
15 | complex*16 JK_sumN(2*PW_max_32,2*PW_max_32)
16 | complex*16 KJ_sumS(nval_max_32,nval_max_32)
17 | complex*16 ZERO, ONE
18 | integer*8 n, s
19 | c 32-but integers for BLAS and LAPACK
20 | integer*8 neq_PW_32, nval_32
21 |
22 | ZERO = 0.0d0
23 | ONE = 1.0d0
24 | C
25 | CCCCCCCCCCCCCCCCCCCC Start Program CCCCCCCCCCCCCCCCCCCCCCCCC
26 | C
27 | nval_32 = nval
28 | neq_PW_32 = neq_PW
29 | call ZGEMM('N','N', nval_32, nval_32, 2*neq_PW_32,
30 | * ONE, K_overlap_mat, nval_32, overlap_J, 2*neq_PW_32,
31 | * ZERO, KJ_sumS, nval_max_32)
32 |
33 | call ZGEMM('N','N', 2*neq_PW_32, 2*neq_PW_32, nval_32,
34 | * ONE, overlap_J, 2*neq_PW_32, K_overlap_mat, nval_32,
35 | * ZERO, JK_sumN, 2*PW_max_32)
36 |
37 | open (unit=33, file="Normed/KJ_sumS.txt",
38 | * status='unknown')
39 | open (unit=32, file="Normed/JK_sumN.txt",
40 | * status='unknown')
41 | do n=1,nval
42 | do s=1,nval
43 | write(33,132) n, s, KJ_sumS(n,s), abs(KJ_sumS(n,s))
44 | enddo
45 | enddo
46 | do n=1,2*neq_PW
47 | do s=1,2*neq_PW
48 | write(32,132) n, s, JK_sumN(n,s), abs(JK_sumN(n,s))
49 | enddo
50 | enddo
51 | close(33)
52 | close(32)
53 | C
54 | 132 format(2(I4),2(g25.17),g18.10)
55 | C
56 | return
57 | end
58 |
--------------------------------------------------------------------------------
/backend/fortran/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for EMUstack. Requires some adjustment to reflect your installation.
2 |
3 | COMPILER_VENDOR = gnu95
4 | #COMPILER_VENDOR = intelem
5 |
6 | SUBROUTINES_FOR_PYTHON = py_calc_modes.f py_calc_modes_1d.f conv_gmsh.f \
7 | gmsh_plot_field_3d.f gmsh_plot_field.f gmsh_plot_PW.f field_value_plane.f \
8 | gmsh_plot_slice.f
9 |
10 | LIB_LOCATION = lib
11 | UMFPACK_NAME = umf4_f77zwrapper64.o
12 |
13 |
14 |
15 | ### --- IF using Fedora SuiteSparse --------------------------------------
16 | EMUstack.so: EMUstack.pyf *.f
17 | f2py3 -c EMUstack.pyf *.f --f77flags='-fallow-argument-mismatch' --fcompiler=$(COMPILER_VENDOR) \
18 | --link-lapack_opt --link-blas_opt \
19 | $(LIB_LOCATION)/$(UMFPACK_NAME) --link-umfpack
20 |
21 | ### With installed libsuitesparse v. < 4.0.0
22 | lib/umf4_f77zwrapper64.o: lib/umf4_f77zwrapper_SS_3.7.1.c
23 | gcc -O5 -DZLONG -I/usr/include/suitesparse -c lib/umf4_f77zwrapper_SS_3.7.1.c \
24 | -fPIC -o lib/umf4_f77zwrapper64.o
25 | ### With installed libsuitesparse v. >= 4.0.0
26 | ### 12/2014 libsuitesparse >= 4.0.0 does not support 64 bit linux umf4_f77zwrapper64
27 | #lib/umf4_f77zwrapper64.o: lib/umf4_f77zwrapper_SS_4.2.0.c
28 | # gcc -O5 -DZLONG -I/usr/include/suitesparse -c lib/umf4_f77zwrapper_SS_4.2.0.c \
29 | # -fPIC -o lib/umf4_f77zwrapper64.o
30 |
31 | EMUstack.pyf: $(SUBROUTINES_FOR_PYTHON)
32 | f2py3 -m EMUstack -h EMUstack.pyf $(SUBROUTINES_FOR_PYTHON) --overwrite-signature
33 |
34 | purge:
35 | -rm EMUstack.pyf
36 | -rm EMUstack.so
37 | -rm lib/umf4_f77zwrapper64.o
38 | clean:
39 | -rm EMUstack.so
40 | ###------------------------------------------------------------------
41 |
42 |
43 | # ### --- ELSE IF using self built SuiteSparse ------------------------
44 | # EMUstack.so: EMUstack.pyf *.f
45 | # f2py -c EMUstack.pyf *.f --fcompiler=$(COMPILER_VENDOR) \
46 | # --link-lapack_opt --link-blas_opt \
47 | # $(LIB_LOCATION)/$(UMFPACK_NAME) \
48 | # -L$(LIB_LOCATION) -lumfpack -lamd -lcholmod \
49 | # -lcolamd -lcamd -lmetis -lccolamd -lamd -lsuitesparseconfig -lrt
50 |
51 | # EMUstack.pyf: $(SUBROUTINES_FOR_PYTHON)
52 | # f2py -m EMUstack -h EMUstack.pyf $(SUBROUTINES_FOR_PYTHON) --overwrite-signature
53 |
54 | # purge:
55 | # -rm EMUstack.pyf
56 | # -rm EMUstack.so
57 | # clean:
58 | # -rm EMUstack.so
59 | # ###------------------------------------------------------------------
60 |
--------------------------------------------------------------------------------
/backend/fortran/Makefile-pre_compiled_libs:
--------------------------------------------------------------------------------
1 | # Makefile for EMUstack. Requires some adjustment to reflect your installation.
2 |
3 | COMPILER_VENDOR = gnu95
4 | #COMPILER_VENDOR = intelem
5 |
6 | SUBROUTINES_FOR_PYTHON = py_calc_modes.f py_calc_modes_1d.f conv_gmsh.f \
7 | gmsh_plot_field_3d.f gmsh_plot_field.f gmsh_plot_PW.f field_value_plane.f \
8 | gmsh_plot_slice.f
9 |
10 | LIB_LOCATION = lib
11 | UMFPACK_NAME = umf4_f77zwrapper64.o
12 |
13 |
14 |
15 | ### --- IF using self built SuiteSparse -----------------------------
16 | EMUstack.so: EMUstack.pyf *.f
17 | f2py -c EMUstack.pyf *.f --fcompiler=$(COMPILER_VENDOR) \
18 | --link-lapack_opt --link-blas_opt \
19 | $(LIB_LOCATION)/$(UMFPACK_NAME) \
20 | -L$(LIB_LOCATION) -lumfpack -lamd -lcholmod \
21 | -lcolamd -lcamd -lmetis -lccolamd -lamd -lsuitesparseconfig -lrt
22 |
23 | EMUstack.pyf: $(SUBROUTINES_FOR_PYTHON)
24 | f2py -m EMUstack -h EMUstack.pyf $(SUBROUTINES_FOR_PYTHON) --overwrite-signature
25 |
26 | purge:
27 | -rm EMUstack.pyf
28 | -rm EMUstack.so
29 | clean:
30 | -rm EMUstack.so
31 | ###------------------------------------------------------------------
32 |
--------------------------------------------------------------------------------
/backend/fortran/Makefile-silliac:
--------------------------------------------------------------------------------
1 | # Makefile for EMUstack. Requires some adjustment to reflect your installation.
2 |
3 | # COMPILER_VENDOR = gnu95
4 | COMPILER_VENDOR = intelem
5 |
6 | SUBROUTINES_FOR_PYTHON = py_calc_modes.f py_calc_modes_1d.f conv_gmsh.f \
7 | gmsh_plot_field_3d.f gmsh_plot_field.f gmsh_plot_PW.f field_value_plane.f \
8 | gmsh_plot_slice.f
9 |
10 | LIB_LOCATION = lib
11 | UMFPACK_NAME = umf4_f77zwrapper64.o
12 |
13 |
14 |
15 |
16 |
17 | #------------------------------------------------------------------
18 | # IF using Ubuntu SuiteSparse and full ARPACK install
19 | #EMUstack.so: EMUstack.pyf lib/umf4_f77zwrapper64.o *.f
20 | # f2py -c EMUstack.pyf *.f $(LIB_LOCATION)/$(UMFPACK_NAME) -larpack \
21 | # --link-lapack_opt --link-umfpack --link-blas_opt --fcompiler=$(COMPILER_VENDOR)
22 | ## With installed libsuitesparse v. < 4.0.0
23 | #lib/umf4_f77zwrapper64.o: lib/umf4_f77zwrapper_SS_3.7.1.c
24 | # gcc -O5 -DZLONG -I/usr/include/suitesparse -c lib/umf4_f77zwrapper_SS_3.7.1.c \
25 | # -fPIC -o lib/umf4_f77zwrapper64.o
26 | ## With installed libsuitesparse v. >= 4.0.0
27 | ## lib/umf4_f77zwrapper64.o: lib/umf4_f77zwrapper_SS_4.2.0.c
28 | ## gcc -DZLONG -I/usr/include/suitesparse -c lib/umf4_f77zwrapper_SS_4.2.0.c \
29 | ## -fPIC -o umf4_f77zwrapper64.o
30 | #EMUstack.pyf: $(SUBROUTINES_FOR_PYTHON)
31 | # f2py -m EMUstack -h EMUstack.pyf $(SUBROUTINES_FOR_PYTHON) --overwrite-signature
32 | #purge:
33 | # -rm EMUstack.pyf
34 | # -rm EMUstack.so
35 | # -rm lib/umf4_f77zwrapper64.o
36 | #clean:
37 | # -rm EMUstack.so
38 | #------------------------------------------------------------------
39 |
40 |
41 |
42 | #------------------------------------------------------------------
43 | # ELSE IF using self built SuiteSparse and Fortran_EMUstack/zarpack.f
44 | EMUstack.so: EMUstack.pyf *.f
45 | f2py -c EMUstack.pyf *.f --fcompiler=$(COMPILER_VENDOR) \
46 | --link-lapack_opt --link-blas_opt \
47 | -lrt $(LIB_LOCATION)/$(UMFPACK_NAME) \
48 | -L$(LIB_LOCATION) -lumfpack -lamd -lcholmod \
49 | -lcolamd -lcamd -lmetis -lccolamd -lamd -lsuitesparseconfig
50 | # OR if using both self built SuiteSparse and self built ARPACK (where you cannot ??? add to path?)
51 | # ARPACK_LIB_LOCATION = /suphys/bjorn/Usyd_Running/f2py-EMUstack/EMUstack/Fortran_EMUstack/ARPACK
52 | # EMUstack.so: EMUstack.pyf *.f
53 | # f2py -c EMUstack.pyf *.f --fcompiler=$(COMPILER_VENDOR) \
54 | # --link-lapack_opt --link-blas_opt \
55 | # $(LDADD) -L$(ARPACK_LIB_LOCATION) -larpack \
56 | # $(SS_LIB_LOCATION)/$(UMFPACK_NAME) \
57 | # -L$(SS_LIB_LOCATION) -lumfpack -lamd -lcholmod \
58 | # -lcolamd -lcamd -lmetis -lccolamd -lamd -lsuitesparseconfig
59 | EMUstack.pyf: $(SUBROUTINES_FOR_PYTHON)
60 | f2py -m EMUstack -h EMUstack.pyf $(SUBROUTINES_FOR_PYTHON) --overwrite-signature
61 | purge:
62 | -rm EMUstack.pyf
63 | -rm EMUstack.so
64 | clean:
65 | -rm EMUstack.so
66 | #------------------------------------------------------------------
67 |
--------------------------------------------------------------------------------
/backend/fortran/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/__init__.py
--------------------------------------------------------------------------------
/backend/fortran/array_sol_P2_1d.f:
--------------------------------------------------------------------------------
1 | c
2 | cccccccccccccccccccccccccccccccccccccccccccccccccc
3 | c
4 | c sol_1(1..3,nval, nel) contains the values of Ex component at P2 interpolation nodes
5 | c sol_1(4..7,nval, nel) contains the values of Ey component at P3 interpolation nodes
6 | c sol_1(8..11,nval, nel) contains the values of Ez component at P3 interpolation nodes
7 |
8 | c sol_P2(1,1..3,nval, nel) contains the values of Ex component at P2 interpolation nodes (3 nodes)
9 | c sol_P2(2,1..3,nval, nel) contains the values of Ey component at P2 interpolation nodes
10 | c sol_P2(3,1..3,nval, nel) contains the values of Ez component at P2 interpolation nodes
11 | c
12 | cccccccccccccccccccccccccccccccccccccccccccccccccc
13 | c
14 | subroutine array_sol_P2_1d (nval, nel, sol_1, sol_P2)
15 | c
16 | cccccccccccccccccccccccccccccccccccccccccccccccccc
17 | c
18 | implicit none
19 | integer*8 nval, nel
20 | complex*16 sol_1(3+4+4,nval,nel)
21 | complex*16 sol_P2(3,3,nval,nel)
22 |
23 | c Local variables
24 | integer*8 j, inod, iel, ival, debug
25 | double precision P3_mid_mode_value(4)
26 | complex*16 z_tmp1, z_tmp2
27 |
28 | c
29 | cccccccccccccccccccccccccccccccccccccccccccccccccc
30 | c
31 | c
32 | debug = 0
33 |
34 | c Values of the P3 basis function at the mid-point
35 | P3_mid_mode_value(1) = -1.0d0 / 16.0d0
36 | P3_mid_mode_value(2) = -1.0d0 / 16.0d0
37 | P3_mid_mode_value(3) = 9.0d0 / 16.0d0
38 | P3_mid_mode_value(4) = 9.0d0 / 16.0d0
39 |
40 | do iel=1,nel
41 | do ival=1,nval
42 | do inod=1,3
43 | sol_P2(1,inod,ival,iel) = sol_1(inod,ival,iel) ! x-component
44 | enddo
45 | inod = 1
46 | sol_P2(2,inod,ival,iel) = sol_1(inod+3,ival,iel) ! y-component
47 | sol_P2(3,inod,ival,iel) = sol_1(inod+3+4,ival,iel) ! z-component
48 | inod = 2
49 | sol_P2(2,inod,ival,iel) = sol_1(inod+3,ival,iel) ! y-component
50 | sol_P2(3,inod,ival,iel) = sol_1(inod+3+4,ival,iel) ! z-component
51 | c Interpolated value for the mid-node
52 | c The initial P3 value of Ey is interpolated to obtain the value at the mid-node
53 | z_tmp1 = 0
54 | z_tmp2 = 0
55 | do j=1,4
56 | z_tmp1 = z_tmp1 + sol_1(j+3,ival,iel) * P3_mid_mode_value(j)
57 | z_tmp2 = z_tmp2 + sol_1(j+3+4,ival,iel)*P3_mid_mode_value(j)
58 | enddo
59 | inod = 3 ! Mid-node
60 | sol_P2(2,inod,ival,iel) = z_tmp1 ! y-component
61 | sol_P2(3,inod,ival,iel) = z_tmp2 ! z-component
62 | enddo
63 | enddo
64 | c
65 | return
66 | end
67 |
--------------------------------------------------------------------------------
/backend/fortran/basis_ls.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c P2 basis function over the unit Tetrahedron
5 | c
6 | c Quadradic basis function = P2 * Grad P1
7 | c
8 | c basis_list(1,j,i) = k : number on data to be stored: if k=3 only one gradient will be used; k=4 => 2 gradients
9 | c basis_list(2,j,i) = m : corresponds to the P2 Lagrange polynomial phi_m
10 | c basis_list(3,j,i) = n : corresponds to the gradient of the P1 Lagrange polynomial phi_n
11 | c basis_list(4,j,i) : it will be used only if k=4
12 | c
13 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
14 | c
15 | subroutine basis_ls (nod_el, basis_list)
16 | c
17 | implicit none
18 | integer*8 nnodes, nddl_t
19 | parameter (nnodes = 6, nddl_t=4)
20 | integer*8 nod_el(nnodes), basis_list(4,3,nddl_t)
21 | c Local variables
22 | integer*8 i, j, j1, j2, j3, list_end(2,3)
23 | integer*8 ls_n(3), ls_n_sorted(3)
24 | c
25 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
26 | c
27 | c Endpoints of the 6 edges (mid-point) of the reference tetrahedron
28 | c
29 | i = 1
30 | list_end(1,i) = 1
31 | list_end(2,i) = 2
32 | i = 2
33 | list_end(1,i) = 2
34 | list_end(2,i) = 3
35 | i = 3
36 | list_end(1,i) = 1
37 | list_end(2,i) = 3
38 | c
39 | do i=1,1 ! scan the element face
40 | c The mid-edge nodes of the face
41 | do j=1,3 ! scan the mid-edge nodes of the face
42 | basis_list(1,j,i) = 3 ! number on data to be stored
43 | basis_list(2,j,i) = j+3 ! the mid-edge number
44 | j2 = mod(j+2,3) ! give the node opposite to the mid-edge node (j+3)
45 | if( j2 .eq. 0 ) j2 = 3
46 | basis_list(3,j,i) = j2
47 | basis_list(4,j,i) = 0 ! actually, it will not be used
48 | enddo
49 | enddo
50 | do i=2,4 ! scan the 3 element edges
51 | c 2 end-point basis vectors are attached to the edge i
52 | do j=1,2 ! scan the end nodes of the edge
53 | j1 = list_end(j,i-1)
54 | ls_n(j) = nod_el(j1)
55 | enddo
56 | ls_n(3) = 0
57 | j3 = 2
58 | call sort_n(j3, ls_n, ls_n_sorted)
59 | j1 = ls_n_sorted(1)
60 | j1 = list_end(j1,i-1)
61 | j2 = ls_n_sorted(2)
62 | j2 = list_end(j2,i-1)
63 | j = 1
64 | basis_list(1,j,i) = 3 ! number on data to be stored
65 | basis_list(2,j,i) = j1
66 | basis_list(3,j,i) = j2
67 | basis_list(4,j,i) = 0
68 | j = 2
69 | basis_list(1,j,i) = 3 ! number on data to be stored
70 | basis_list(2,j,i) = j2
71 | basis_list(3,j,i) = j1
72 | basis_list(4,j,i) = 0
73 | j = 3
74 | basis_list(1,j,i) = 4 ! number on data to be stored
75 | basis_list(2,j,i) = i+2 ! add 2 to get the correct edge number
76 | basis_list(3,j,i) = j1
77 | basis_list(4,j,i) = j2
78 | if (j1 .eq. j2) then
79 | write(*,*) "basis_ls: j1 = j2:"
80 | write(*,*) "basis_ls: ", i, j, j1, j2
81 | write(*,*) "basis_ls: Aborting..."
82 | stop
83 | endif
84 | enddo
85 | c
86 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
87 | c
88 | return
89 | end
90 |
--------------------------------------------------------------------------------
/backend/fortran/basis_vec.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c P2 basis function over the unit Tetrahedron
5 | c
6 | c Compute:
7 | c a quadradic basis function (vec_phi = P2 * Grad P1) and
8 | c and its transverse curl (curl_t_phi)
9 | c
10 | c basis_list(1,j,i) = k : number on data to be stored: if k=3 only one gradient will be used; k=4 => 2 gradients
11 | c basis_list(2,j,i) = m : corresponds to the P2 Lagrange polynomial phi_m
12 | c basis_list(3,j,i) = n : corresponds to the gradient of the P1 Lagrange polynomial phi_n
13 | c basis_list(4,j,i) : it will be used only if k=4
14 | c
15 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
16 | c
17 | subroutine basis_vec (i_eq, i_ddl, basis_list, p2_list,
18 | * grad_p1_mat, grad_p2_mat, vec_phi, curl_t_phi)
19 | c
20 | implicit none
21 | integer*8 i_eq, i_ddl
22 | integer*8 nnodes, nddl_t, dim
23 | parameter (nnodes = 6, nddl_t=4, dim=2)
24 | integer*8 basis_list(4,3,nddl_t)
25 | double precision p2_list(nnodes)
26 | double precision grad_p1_mat(dim,3), grad_p2_mat(dim,nnodes)
27 | double precision vec_phi(dim), curl_t_phi
28 | c Local variables
29 | integer*8 i, k, m, n1, n2
30 | double precision grad_p1(dim), grad_p2(dim), phi
31 | c
32 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
33 | c
34 | k = basis_list(1, i_eq, i_ddl)
35 | m = basis_list(2, i_eq, i_ddl)
36 | n1 = basis_list(3, i_eq, i_ddl)
37 | n2 = basis_list(4, i_eq, i_ddl)
38 | if (k .eq. 3) then
39 | phi = p2_list(m)
40 | do i=1,dim
41 | grad_p2(i) = grad_p2_mat(i,m)
42 | grad_p1(i) = grad_p1_mat(i,n1)
43 | vec_phi(i) = phi * grad_p1(i)
44 | enddo
45 | elseif (k .eq. 4) then
46 | if (n2 .lt. 1) then
47 | write(*,*) "basis_vec: problem n2 < 1 for k = 4 "
48 | write(*,*) "basis_vec: n2 should >= 1 for k=4 !"
49 | write(*,*) "basis_vec: k, m, n1, n2 = ", k, m, n1, n2
50 | write(*,*) "basis_vec: Aborting..."
51 | stop
52 | endif
53 | phi = p2_list(m)
54 | do i=1,dim
55 | grad_p2(i) = grad_p2_mat(i,m)
56 | grad_p1(i) = grad_p1_mat(i,n1) - grad_p1_mat(i,n2)
57 | vec_phi(i) = phi * grad_p1(i)
58 | enddo
59 | else
60 | write(*,*) "basis_vec: no action is defined when k = ", k
61 | write(*,*) "basis_vec: k should be equal to 3 or 4"
62 | write(*,*) "basis_vec: Aborting..."
63 | stop
64 | endif
65 | c Curl_t E = Det( grad_p2, grad_p1)
66 | curl_t_phi = grad_p2(1)*grad_p1(2) - grad_p2(2)*grad_p1(1)
67 | c
68 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
69 | c
70 | return
71 | end
72 |
--------------------------------------------------------------------------------
/backend/fortran/bound_cond.f:
--------------------------------------------------------------------------------
1 |
2 | c
3 | c type_N_E_F = 0 => interiour ddl (ddl = Degree Of Freedom)
4 | c type_N_E_F != 0 => boundary ddl
5 | c
6 | c i_cond = 0 => Dirichlet boundary condition (E-field: electric wall condition)
7 | c i_cond = 1 => Neumann boundary condition (E-field: magnetic wall condition)
8 | c i_cond = 2 => Periodic boundary condition
9 | c
10 | c
11 |
12 | c This subroutine set the boundary condition parameters
13 |
14 | subroutine bound_cond (i_cond, n_ddl, neq, type_N_E_F, ineq)
15 |
16 | implicit none
17 | integer*8 i_cond, n_ddl, neq
18 | integer*8 ineq(3,n_ddl), type_N_E_F(2,n_ddl)
19 |
20 | integer*8 i, i_boundary, i_dim
21 | c
22 | if(i_cond .eq. 0) then
23 | c Dirichlet boundary condition: all points have a degree of freedom
24 | write(*,*) "bound_cond: Dirichlet boundary condition"
25 | neq = 0
26 | do i=1,n_ddl
27 | i_boundary = type_N_E_F(1,i)
28 | i_dim = type_N_E_F(2,i)
29 | if (i_dim .eq. 2) then ! each element is associated to 3 interior Degrees Of Freedom (DOF)
30 | ineq(1,i) = neq + 1
31 | ineq(2,i) = neq + 2
32 | ineq(3,i) = neq + 3
33 | neq = neq + 3
34 | elseif (i_dim .eq. 1) then ! each edge is associated to 3 Degrees Of Freedom (DOF)
35 | if (i_boundary .eq. 0) then
36 | ineq(1,i) = neq + 1
37 | ineq(2,i) = neq + 2
38 | ineq(3,i) = neq + 3
39 | neq = neq + 3
40 | else
41 | ineq(1,i) = 0
42 | ineq(2,i) = 0
43 | ineq(3,i) = 0
44 | endif
45 | elseif (i_dim .eq. 0) then ! each nodee is associated to 1 Degree Of Freedom (DOF)
46 | if (i_boundary .eq. 0) then
47 | ineq(1,i) = neq + 1
48 | ineq(2,i) = 0
49 | ineq(3,i) = 0
50 | neq = neq + 1
51 | else
52 | ineq(1,i) = 0
53 | ineq(2,i) = 0
54 | ineq(3,i) = 0
55 | endif
56 | else
57 | write(*,*) "bound_cond: i_dim has invalid value : ", i_dim
58 | write(*,*) "bound_cond: i_cond = ", i_cond
59 | write(*,*) "bound_cond: i = ", i
60 | write(*,*) "bound_cond: Aborting..."
61 | stop
62 | endif
63 | enddo
64 | elseif(i_cond .eq. 1) then
65 | c Neumann boundary condition: all points have a degree of freedom
66 | write(*,*) "bound_cond: Neumann boundary condition"
67 | neq = 0
68 | do i=1,n_ddl
69 | i_dim = type_N_E_F(2,i)
70 | c Each element or edge is associated to 3 Degrees Of Freedom (DOF)
71 | if (i_dim .eq. 2 .or. i_dim .eq. 1) then
72 | ineq(1,i) = neq + 1
73 | ineq(2,i) = neq + 2
74 | ineq(3,i) = neq + 3
75 | neq = neq + 3
76 | elseif (i_dim .eq. 0) then
77 | ineq(1,i) = neq + 1
78 | ineq(2,i) = 0
79 | ineq(3,i) = 0
80 | neq = neq + 1
81 | else
82 | write(*,*) "bound_cond: i_dim has invalid value : ", i_dim
83 | write(*,*) "bound_cond: i_cond = ", i_cond
84 | write(*,*) "bound_cond: i = ", i
85 | write(*,*) "bound_cond: Aborting..."
86 | stop
87 | endif
88 | enddo
89 | else
90 | write(*,*) "bound_cond: i_cond has invalid value : ", i_cond
91 | write(*,*) "bound_cond: Aborting..."
92 | stop
93 | endif
94 | c
95 | return
96 | end
97 |
--------------------------------------------------------------------------------
/backend/fortran/csr_max_length.f:
--------------------------------------------------------------------------------
1 |
2 | c
3 | c***********************************************************************
4 | c
5 | subroutine csr_max_length (nel, n_ddl, neq, nnodes,
6 | * table_N_E_F, ineq, lb, nonz)
7 | c
8 | implicit none
9 | integer*8 nel, neq, n_ddl, nnodes, nonz
10 | integer*8 table_N_E_F (14,nel)
11 | integer*8 ineq(3,n_ddl), lb(neq+1)
12 |
13 | c Local variables
14 | integer*8 nddl_0
15 | parameter (nddl_0 = 14)
16 |
17 | integer*8 i, k, iel, ind_ip, ip
18 | integer*8 k_copy1, k_copy2
19 | c
20 | if ( nnodes .ne. 6 ) then
21 | write(*,*) "csr_max_length: problem nnodes = ", nnodes
22 | write(*,*) "csr_max_length: nnodes should be equal to 6 !"
23 | write(*,*) "csr_max_length: Aborting..."
24 | stop
25 | endif
26 | c
27 | do i=1,neq+1
28 | lb(i) = 0
29 | enddo
30 | c
31 | c Determination of the bandwidths
32 | c
33 | do 20 iel=1,nel
34 | do i=1,nddl_0
35 | ip = table_N_E_F(i,iel)
36 | do k=1,3
37 | ind_ip = ineq(k,ip)
38 | if (ind_ip .ne. 0) lb(ind_ip) = lb(ind_ip)+1
39 | enddo
40 | enddo
41 | 20 continue
42 | c
43 | nonz = 0
44 | do i=1,neq
45 | nonz = nonz + 3*nddl_0 + 3*(nddl_0-1)*(lb(i)-1)
46 | enddo
47 | c
48 | c print*
49 | c do i=1,neq
50 | c print*, "csr_max_length: i, lb(i) = ", i, lb(i)
51 | c enddo
52 | c print*, "csr_max_length: neq, n_ddl nonz, = ", neq, n_ddl, nonz
53 | c print*
54 | c
55 |
56 | c Compressed Row Storage (CRS): determine the row pointer
57 | c
58 | k_copy1 = lb(1)
59 | lb(1) = 1
60 | do i=2,neq+1
61 | k_copy2 = lb(i)
62 | lb(i) = lb(i-1) + 3*nddl_0 + 3*(nddl_0-1)*(k_copy1-1)
63 | k_copy1 = k_copy2
64 | enddo
65 |
66 | nonz = lb(neq+1) - 1
67 | c
68 | c
69 | return
70 | end
71 |
--------------------------------------------------------------------------------
/backend/fortran/curved_elem_tri.f:
--------------------------------------------------------------------------------
1 | c
2 | ccccccccccccccccccccccccccccccccccccccc
3 | c
4 | c Check if an element (triangle) has a curved face
5 | c
6 | ccccccccccccccccccccccccccccccccccccccc
7 | c
8 | subroutine curved_elem_tri (nnodes, xel, info_curved, tmp)
9 | c
10 | ccccccccccccccccccccccccccccccccccccccc
11 | c
12 | implicit none
13 | integer*8 nnodes, info_curved
14 | double precision xel(2,nnodes)
15 |
16 | integer*8 nnd_triangle
17 | parameter (nnd_triangle = 6)
18 | double precision xel_triangle(2,nnd_triangle)
19 |
20 | integer*8 i, j, i2
21 | double precision tol, tmp
22 | c
23 | ccccccccccccccccccccccccccccccccccccccc
24 | c
25 | if (nnodes .ne. nnd_triangle) then
26 | write(*,*)
27 | write(*,*) " ???"
28 | write(*,*) "curved_elem_tri: nnodes != nnd_triangle : ",
29 | * nnodes, nnd_triangle
30 | write(*,*) "curved_elem_tri: Aborting..."
31 | stop
32 | endif
33 | c Vertices
34 | do i=1,3
35 | do j=1,2
36 | xel_triangle(j,i) = xel(j,i)
37 | enddo
38 | enddo
39 |
40 | c Mid-points
41 | do i=1,3
42 | i2 = Mod(i+1,3)
43 | if(i2 .eq. 0) i2 = 3
44 | do j=1,2
45 | xel_triangle(j,i+3) = (xel(j,i)+xel(j,i2))/2.0d0
46 | enddo
47 | enddo
48 | c
49 | tmp = 0.0d0
50 | do i=1,nnodes
51 | do j=1,2
52 | tmp = tmp + (xel_triangle(j,i) - xel(j,i))**2
53 | enddo
54 | enddo
55 |
56 | tol = 1.0d-14
57 | if(abs(tmp) .lt. tol) then
58 | info_curved = 0
59 | else
60 | info_curved = 1
61 | endif
62 |
63 | info_curved = 0
64 |
65 | return
66 | end
67 |
--------------------------------------------------------------------------------
/backend/fortran/debug.h:
--------------------------------------------------------------------------------
1 | c
2 | c\SCCS Information: @(#)
3 | c FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2
4 | c
5 | c %---------------------------------%
6 | c | See debug.doc for documentation |
7 | c %---------------------------------%
8 | integer logfil, ndigit, mgetv0,
9 | & msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
10 | & mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
11 | & mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
12 | common /debug/
13 | & logfil, ndigit, mgetv0,
14 | & msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
15 | & mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
16 | & mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
17 |
--------------------------------------------------------------------------------
/backend/fortran/geometry.f:
--------------------------------------------------------------------------------
1 |
2 | c Construct the FEM mesh
3 | c
4 | c type_nod = 0 => interiour point
5 | c type_nod != 0 => boundary point
6 | c
7 | c
8 | subroutine geometry (nel, npt, nnodes, nb_typ_el,
9 | * lx, ly, type_nod, type_el, table_nod, x,
10 | * mesh_file)
11 | c
12 | implicit none
13 | integer*8 nel, npt, nnodes, nb_typ_el, max_typ_el
14 | integer*8 type_nod(npt), type_el(nel)
15 | integer*8 table_nod(nnodes,nel), nb_typ_el2
16 | double precision lx, ly
17 | parameter (max_typ_el=10)
18 | double precision x(2,npt), xx(2)
19 |
20 | character mesh_file*500
21 |
22 | integer*8 npt2, nel2, ui
23 | integer*8 i, j, k
24 | c
25 | ui = 6
26 | c
27 | open (unit=24,file=mesh_file,
28 | * status='old')
29 | read(24,*) npt2, nel2
30 | c
31 | if(npt .ne. npt2) then
32 | write(ui,*) "geometry: npt != npt2 : ",
33 | * npt, npt2
34 | endif
35 | if(nel .ne. nel2) then
36 | write(ui,*) "geometry: nel != nel2 : ",
37 | * nel, nel2
38 | endif
39 |
40 | c Coordinate of the FEM points
41 | do i=1,npt
42 | read(24,*) k, (xx(j),j=1,2), type_nod(i)
43 | x(1,i) = xx(1)*lx
44 | x(2,i) = xx(2)*ly
45 | enddo
46 | c Connectivity table
47 | nb_typ_el2 = 1
48 | do i=1,nel
49 | read(24,*) k, (table_nod(j,i),j=1,nnodes), type_el(i)
50 | j = type_el(i)
51 | if(nb_typ_el2 .lt. j) nb_typ_el2 = j
52 | if(j .lt. 0) then
53 | write(ui,*)
54 | write(ui,*) " ???"
55 | write(ui,*) "geometry: type_el(i) < 0 : ",
56 | * i, type_el(i)
57 | write(ui,*) "geometry: Aborting..."
58 | stop
59 | endif
60 | enddo
61 | close(24)
62 |
63 | if(nb_typ_el2 .gt. nb_typ_el) then
64 | write(ui,*)
65 | write(ui,*) " ???"
66 | write(ui,*) "geometry: nb_typ_el2 > nb_typ_el : ",
67 | * nb_typ_el2, nb_typ_el
68 | write(ui,*) "geometry: Aborting..."
69 | stop
70 | endif
71 |
72 | return
73 | end
74 |
--------------------------------------------------------------------------------
/backend/fortran/geometry_1d.f.bak:
--------------------------------------------------------------------------------
1 |
2 | c Construct the FEM mesh
3 | c
4 | c type_nod = 0 => interiour point
5 | c type_nod != 0 => boundary point
6 | c
7 | c
8 | subroutine geometry_1d (nel, npt, nnodes, nb_typ_el,
9 | * lx, type_el, table_nod, x,
10 | * mesh_file)
11 | c
12 | implicit none
13 | integer*8 nel, npt, nnodes, nb_typ_el
14 | integer*8 type_nod(npt), type_el(nel)
15 | integer*8 table_nod(nnodes,nel), nb_typ_el2
16 | double precision lx, x(npt)
17 | c complex*16 x(npt)
18 | c double precision xx, re_tmp, im_tmp
19 |
20 | character mesh_file*500
21 |
22 | integer*8 npt2, nel2, ui
23 | integer*8 i, j, k, debug
24 | c
25 | ui = 6
26 | debug = 0
27 | c
28 | open (unit=24,file="../backend/fortran/msh/"//mesh_file,
29 | * status='old')
30 | read(24,*) npt2, nel2
31 | c
32 | if(npt .ne. npt2) then
33 | write(ui,*) "geometry_1d: npt != npt2 : ",
34 | * npt, npt2
35 | endif
36 | if(nel .ne. nel2) then
37 | write(ui,*) "geometry_1d: nel != nel2 : ",
38 | * nel, nel2
39 | endif
40 |
41 | c Coordinate of the FEM points
42 | do i=1,npt
43 | read(24,*) k, x(i), type_nod(i)
44 | C x(i) = x(i) * lx
45 | enddo
46 | c Connectivity table
47 | nb_typ_el2 = 1
48 | do i=1,nel
49 | read(24,*) k, (table_nod(j,i),j=1,nnodes), type_el(i)
50 | j = type_el(i)
51 | if(nb_typ_el2 .lt. j) nb_typ_el2 = j
52 | if(j .lt. 0) then
53 | write(ui,*)
54 | write(ui,*) " ???"
55 | write(ui,*) "geometry_1d: type_el(i) < 0 : ",
56 | * i, type_el(i)
57 | write(ui,*) "geometry_1d: Aborting..."
58 | stop
59 | endif
60 | enddo
61 | close(24)
62 |
63 | nb_typ_el = nb_typ_el2
64 |
65 | if (debug .eq. 1) then
66 | write(*,*) "geometry_1d: nb_typ_el = ", nb_typ_el
67 | endif
68 |
69 | return
70 | end
71 |
72 |
--------------------------------------------------------------------------------
/backend/fortran/gmsh_interface_cyl.f:
--------------------------------------------------------------------------------
1 | c*******************************************************
2 | c
3 | c gmsh_interface_cyl: covert the GMSH mesh format to the FEM mesh format
4 | c
5 | c*******************************************************
6 | c
7 | c nnodes : Number of nodes per element (10-node second order tetrahedron)
8 | c
9 | c*******************************************************
10 | c
11 | subroutine gmsh_interface_cyl (nel, npt, nnodes, type_el,
12 | * table_nod, x)
13 |
14 | c
15 | implicit none
16 | integer*8 nel, npt, nnodes
17 | integer*8 type_el(nel)
18 | integer*8 table_nod(nnodes,nel)
19 | double precision x(2,npt)
20 | c
21 | double precision x_min, y_min, x_r
22 | double precision x_max, y_max, y_r
23 | c
24 | integer*8 i, j, j1, iel, type_cyl
25 | integer*8 ui, debug
26 | double precision centre(2), rad_cyl, r_tmp1
27 | double precision xx(2)
28 | c
29 | ccccccccccccccccccccccccccccccccccccc
30 | c
31 | ui = 6
32 | debug = 1
33 | type_cyl = 4 ! Cylinder type
34 | c
35 | x_min = x(1,1)
36 | x_max = x(1,1)
37 | do i=1,npt
38 | x_r = x(1,i)
39 | if(x_r .lt. x_min) x_min = x_r
40 | if(x_r .gt. x_max) x_max = x_r
41 | enddo
42 | y_min = x(2,1)
43 | y_max = x(2,1)
44 | do i=1,npt
45 | y_r = x(2,i)
46 | if(y_r .lt. y_min) y_min = y_r
47 | if(y_r .gt. y_max) y_max = y_r
48 | enddo
49 | c
50 | c Determination of the cylinder centre (center of the unit cell)
51 | centre(1) = (x_max + x_min)/2.0d0
52 | centre(2) = (y_max + y_min)/2.0d0
53 | c
54 | cccccc
55 | c Determination of the cylinder radius
56 | rad_cyl = 0.0d0
57 | do iel=1,nel
58 | if (type_el(iel) .eq. type_cyl) then
59 | do j=1,nnodes
60 | j1 = table_nod(j,iel)
61 | xx(1) = x(1,j1) - centre(1)
62 | xx(2) = x(2,j1) - centre(2)
63 | r_tmp1 = xx(1)**2 + xx(2)**2
64 | if (r_tmp1 .gt. rad_cyl) rad_cyl = r_tmp1
65 | enddo
66 | endif
67 | enddo
68 | rad_cyl = sqrt(rad_cyl) ! Cylinder radius
69 | c
70 | ccccccccccccccccccccccccccccccccccccc
71 | c
72 | open (unit=26,file="Bloch_fields/interface_cyl.geo")
73 | write(26,*) "lc = 0.101;"
74 | write(26,*) "radius = ", rad_cyl, ";"
75 | write(26,*) "x_cent = ", centre(1), ";"
76 | write(26,*) "y_cent = ", centre(2), ";"
77 | write(26,*) "x_max = ", x_max, ";"
78 | write(26,*) "y_max = ", y_max, ";"
79 | write(26,*) "x_min = ", x_min, ";"
80 | write(26,*) "y_min = ", y_min, ";"
81 | write(26,*) "zz = 0;"
82 | write(26,*) "Point(1) = {x_cent, y_cent, zz, lc};"
83 | write(26,*) "Point(2) = {x_cent + radius, y_cent, zz, lc};"
84 | write(26,*) "Point(3) = {x_cent, y_cent + radius, zz, lc};"
85 | write(26,*) "Point(4) = {x_cent - radius, y_cent, zz, lc};"
86 | write(26,*) "Point(5) = {x_cent, y_cent - radius, zz, lc};"
87 | write(26,*) "Point(6) = {x_min, y_min, zz, lc};"
88 | write(26,*) "Point(7) = {x_max, y_max, lc};"
89 | write(26,*) "Circle(1) = {2, 1, 3};"
90 | write(26,*) "Circle(2) = {3, 1, 4};"
91 | write(26,*) "Circle(3) = {4, 1, 5};"
92 | write(26,*) "Circle(4) = {5, 1, 2};"
93 | write(26,*) "Geometry.LineWidth = 2;"
94 | write(26,*) "Geometry.Color.Lines = White;"
95 | write(26,*) "Geometry.Points = 0;"
96 | close(26)
97 | c
98 | ccccccccccccccccccccccccccccccccccccc
99 | c
100 | return
101 | end
102 |
--------------------------------------------------------------------------------
/backend/fortran/interp_nod_2d.f:
--------------------------------------------------------------------------------
1 |
2 | c
3 | c P2 Lagrange Interpolation nodes for the unit triangle
4 | c
5 | c unit triangle = triangle whose vertices are:
6 | c (0,0,0), (1,0,0), (0,1,0).
7 | c
8 | subroutine interp_nod_2d (nnodes, xn)
9 |
10 | integer*8 nnodes
11 | double precision xn(2,nnodes)
12 | integer*8 i
13 |
14 |
15 | i = 1
16 | xn(1,i) = 0
17 | xn(2,i) = 0
18 |
19 | i = 2
20 | xn(1,i) = 1
21 | xn(2,i) = 0
22 |
23 | i = 3
24 | xn(1,i) = 0
25 | xn(2,i) = 1
26 |
27 | i = 4
28 | xn(1,i) = 0.5
29 | xn(2,i) = 0
30 |
31 | i = 5
32 | xn(1,i) = 0.5
33 | xn(2,i) = 0.5
34 |
35 | i = 6
36 | xn(1,i) = 0
37 | xn(2,i) = 0.5
38 | c
39 | return
40 | end
41 |
--------------------------------------------------------------------------------
/backend/fortran/ivalue.f:
--------------------------------------------------------------------------------
1 | c ------------------------------------------------------------------
2 |
3 | character*11 function ivalue(n)
4 |
5 | c ------------------------------------------------------------------
6 |
7 | integer*8 i, j, n
8 |
9 | character buf*11
10 |
11 | c ------------------------------------------------------------------
12 |
13 | write(buf,'(i11)') n
14 | j = 1
15 | do i = 1,11
16 | if(buf(i:i) .ne. ' ') go to 1
17 | j = j + 1
18 | enddo
19 | 1 continue
20 | ivalue = buf(j:11)
21 |
22 |
23 | end
24 |
--------------------------------------------------------------------------------
/backend/fortran/jacobian_p1_2d.f:
--------------------------------------------------------------------------------
1 | c
2 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
3 | c
4 | c x=[x0,y0] = coordinatate in the reference tetrahedron
5 | c x_g = Corresponding coordinatate in the actual tetrahedron
6 | c
7 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
8 | c
9 | subroutine jacobian_p1_2d (x, xel, nnodes,
10 | * x_g, det_jacobian, mat_B_0, mat_T)
11 | c
12 | implicit none
13 | integer*8 nnodes
14 | double precision x(2), xel(2,nnodes)
15 | double precision mat_B(2,2), mat_T(2,2), mat_B_0(2,2)
16 | double precision det_jacobian, x_g(2)
17 | integer*8 i, j
18 | c
19 | double precision ZERO, ONE
20 | parameter ( ZERO = 0.0D0, ONE = 1.0D0)
21 | c 32-but integers for BLAS and LAPACK
22 | integer*4 INFO_32, LDB_32, LDT_32
23 | integer*4 IPIV_32(2), NRHS_32, N_32
24 | c
25 | c
26 | c
27 | c Compute the Affine mappings from the current Tetrahedron to the
28 | c reference unit Tetrahedron N. Integration will be performed on that
29 | c Tetrahedron by Gaussian quadrature.
30 | c
31 | c X_g = B X + (x_0, y_0, z_0)^t
32 | c
33 | do i=1,2
34 | do j=1,2
35 | mat_B(j,i) = xel(j,i+1) - xel(j,1)
36 | enddo
37 | enddo
38 |
39 | do i=1,2
40 | do j=1,2
41 | mat_B_0(j,i) = mat_B(j,i)
42 | enddo
43 | enddo
44 | c
45 | ccccccccccccccccccccccccccccc
46 | c mat_T = mat_B
47 | c
48 | N_32 = 2 ! The order of the matrix mat_B
49 | NRHS_32 = N_32 ! The number of right hand sides
50 | LDB_32 = N_32 ! The leading dimension of the array mat_B
51 | LDT_32 = N_32 ! The leading dimension of the array mat_T
52 | c
53 | c X_g = B X + (x_0, y_0, z_0)^t
54 | c Initialisation for DGEMV X_g = xel(1:2,1)
55 | do i=1,2
56 | X_g(i) = xel(i,1)
57 | enddo
58 | c DGEMV performs one of the matrix-vector operations
59 | call DGEMV('No transpose', N_32, N_32, ONE, mat_B,
60 | * LDB_32, X, 1, ONE, X_g, 1)
61 | c
62 | c Initialisation for DGESV: mat_T = identity
63 | do i=1,2
64 | do j=1,2
65 | mat_T(i,j) = 0.0d0
66 | enddo
67 | mat_T(i,i) = 1.0d0
68 | enddo
69 | call DGESV( N_32, NRHS_32, mat_B, LDB_32, IPIV_32,
70 | * mat_T, LDT_32, INFO_32 )
71 | c
72 | if(INFO_32 .ne. 0) then
73 | write(*,*)
74 | write(*,*) "jacobian_p1_2d: TRANSF_MAT: ATTENTION, INFO_32 = ",
75 | * INFO_32
76 | stop
77 | endif
78 |
79 | c The value determinant can be obtained from the factorization P*L*U
80 | det_jacobian = 1
81 | do i=1,2
82 | if( (IPIV_32(i)-i) .eq. 0) then
83 | det_jacobian = det_jacobian*mat_B(i,i)
84 | else
85 | det_jacobian = -det_jacobian*mat_B(i,i)
86 | endif
87 | enddo
88 |
89 | if(abs(det_jacobian) .lt. 1.0d-10) then
90 | write(*,*)
91 | write(*,*) " ???"
92 | write(*,*) "jacobian_p1_2d: det = 0 : det = ", det_jacobian
93 | do i=1,nnodes
94 | write(*,*) "i, x, y, x, = ", i, (xel(j,i),j=1,2)
95 | enddo
96 | write(*,*) "jacobian_p1_2d: Aborting..."
97 | stop
98 | endif
99 |
100 | c
101 | return
102 | end
103 |
--------------------------------------------------------------------------------
/backend/fortran/jacobian_p2_2d.f:
--------------------------------------------------------------------------------
1 | c
2 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
3 | c
4 | c x=[x0,y0] = coordinatate in the reference tetrahedron
5 | c x_g = Corresponding coordinatate in the actual tetrahedron
6 | c
7 | c Matrix B: Compute the Affine mappings from the current Tetrahedron to the
8 | c reference unit Tetrahedron N. Integration will be performed on that
9 | c Tetrahedron by Gaussian quadrature.
10 | c
11 | c X_g = B X + (x_0, y_0)^t
12 | c
13 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
14 | c
15 | c
16 | subroutine jacobian_p2_2d (xel, nnodes, p2_list,
17 | * grad_p2_mat, x_g, det_jacobian, mat_B_0, mat_T)
18 | c
19 | implicit none
20 | integer*8 nnodes
21 | double precision xel(2,nnodes)
22 | double precision p2_list(nnodes), grad_p2_mat(2,nnodes)
23 | double precision mat_B(2,2), mat_T(2,2), mat_B_0(2,2)
24 | double precision det_jacobian, x_g(2)
25 | integer*8 inode, i, j
26 | double precision phi, grad_phi
27 | c
28 | double precision ZERO, ONE
29 | parameter ( ZERO = 0.0D0, ONE = 1.0D0)
30 | c 32-but integers for BLAS and LAPACK
31 | integer*4 INFO_32, LDB_32, LDT_32
32 | integer*4 IPIV_32(2), NRHS_32, N_32
33 |
34 | c
35 | do i=1,2
36 | x_g(i) = 0.0d0
37 | do j=1,2
38 | mat_B(i,j) = 0.0d0
39 | enddo
40 | enddo
41 |
42 | do inode=1,nnodes
43 | do i=1,2
44 | phi = p2_list(inode)
45 | x_g(i) = x_g(i) + xel(i,inode)*phi
46 | do j=1,2
47 | grad_phi = grad_p2_mat(j,inode)
48 | mat_B(i,j) = mat_B(i,j) + xel(i,inode)*grad_phi
49 | enddo
50 | enddo
51 | enddo
52 |
53 | do i=1,2
54 | do j=1,2
55 | mat_B_0(j,i) = mat_B(j,i)
56 | enddo
57 | enddo
58 | c
59 | ccccccccccccccccccccccccccccc
60 | c mat_T = mat_B
61 | c
62 | N_32 = 2 ! The order of the matrix mat_B
63 | NRHS_32 = N_32 ! The number of right hand sides
64 | LDB_32 = N_32 ! The leading dimension of the array mat_B
65 | LDT_32 = N_32 ! The leading dimension of the array mat_T
66 | c
67 | c Initialisation for DGESV: mat_T = identity
68 | do i=1,2
69 | do j=1,2
70 | mat_T(i,j) = 0.0d0
71 | enddo
72 | mat_T(i,i) = 1.0d0
73 | enddo
74 | call DGESV( N_32, NRHS_32, mat_B, LDB_32, IPIV_32,
75 | * mat_T, LDT_32, INFO_32 )
76 | c
77 | if(INFO_32 .ne. 0) then
78 | write(*,*)
79 | write(*,*) 'jacobian_p2_2d: TRANSF_MAT: ATTENTION, INFO_32 = ',
80 | * INFO_32
81 | do i=1,nnodes
82 | write(*,*) "i, x, y, x, = ", i, (xel(j,i),j=1,2)
83 | enddo
84 | write(*,*) "jacobian_p2_2d: Aborting..."
85 | stop
86 | endif
87 |
88 | c The value determinant can be obtained from the factorization P*L*U
89 | det_jacobian = 1
90 | do i=1,2
91 | if( (IPIV_32(i)-i) .eq. 0) then
92 | det_jacobian = det_jacobian*mat_B(i,i)
93 | else
94 | det_jacobian = -det_jacobian*mat_B(i,i)
95 | endif
96 | enddo
97 |
98 | if(abs(det_jacobian) .lt. 1.0d-10) then
99 | write(*,*)
100 | write(*,*) " ???"
101 | write(*,*) "jacobian_p2_2d: det = 0 : det = ", det_jacobian
102 | do i=1,nnodes
103 | write(*,*) "i, x, y, x, = ", i, (xel(j,i),j=1,2)
104 | enddo
105 | write(*,*) "jacobian_p2_2d: Aborting..."
106 | stop
107 | endif
108 |
109 | c
110 | return
111 | end
112 |
--------------------------------------------------------------------------------
/backend/fortran/lattice_vec.f:
--------------------------------------------------------------------------------
1 | c
2 | c***********************************************************************
3 | c
4 | subroutine lattice_vec (npt, x, lat_vecs, debug)
5 | c
6 | c***********************************************************************
7 | c
8 | implicit none
9 | integer*8 npt
10 | double precision x(2,npt)
11 | double precision lat_vecs(2,2)
12 |
13 | double precision x_min, y_min
14 | double precision x_max, y_max
15 |
16 | double precision x_min_ymin
17 | double precision x_max_ymin
18 | double precision x_min_ymax
19 | double precision x_max_ymax
20 | double precision x_r, y_r
21 | double precision lat_vec_1(2), lat_vec_2(2)
22 | double precision tol
23 | integer*8 i, n1, n2, debug
24 | c
25 | x_min = x(1,1)
26 | x_max = x(1,1)
27 | do i=1,npt
28 | x_r = x(1,i)
29 | if(x_r .lt. x_min) x_min = x_r
30 | if(x_r .gt. x_max) x_max = x_r
31 | enddo
32 | y_min = x(2,1)
33 | y_max = x(2,1)
34 | do i=1,npt
35 | y_r = x(2,i)
36 | if(y_r .lt. y_min) y_min = y_r
37 | if(y_r .gt. y_max) y_max = y_r
38 | enddo
39 | c
40 | if (debug .eq. 1) then
41 | write(*,*) "lattice_vec: x_min, x_max = ", x_min, x_max
42 | write(*,*) "lattice_vec: y_min, y_max = ", y_min, y_max
43 | endif
44 | c
45 | tol = 1.0d-6
46 | n1 = 0
47 | do i=1,npt
48 | if (abs(x(2,i)-y_min) .lt. tol) then
49 | if (n1 .eq. 0) then
50 | x_min_ymin = x(1,i)
51 | x_max_ymin = x(1,i)
52 | endif
53 | n1 = n1 + 1
54 | x_r = x(1,i)
55 | if(x_r .lt. x_min_ymin) x_min_ymin = x_r
56 | if(x_r .gt. x_max_ymin) x_max_ymin = x_r
57 | endif
58 | enddo
59 | c
60 | n2 = 0
61 | do i=1,npt
62 | if (abs(x(2,i)-y_max) .lt. tol) then
63 | if (n2 .eq. 0) then
64 | x_min_ymax = x(1,i)
65 | x_max_ymax = x(1,i)
66 | endif
67 | n2 = n2 + 1
68 | x_r = x(1,i)
69 | if(x_r .lt. x_min_ymax) x_min_ymax = x_r
70 | if(x_r .gt. x_max_ymax) x_max_ymax = x_r
71 | endif
72 | enddo
73 | c
74 | lat_vec_1(1) = x_max_ymin - x_min_ymin
75 | lat_vec_1(2) = 0.0d0
76 | c
77 | lat_vec_2(1) = x_min_ymax - x_min_ymin
78 | lat_vec_2(2) = y_max - y_min
79 | c
80 | do i=1,2
81 | lat_vecs(i,1) = lat_vec_1(i)
82 | lat_vecs(i,2) = lat_vec_2(i)
83 | enddo
84 | c
85 | if (debug .eq. 1) then
86 | write(*,*) "lattice_vec: v1 = ", (lat_vecs(i,1),i=1,2)
87 | write(*,*) "lattice_vec: v2 = ", (lat_vecs(i,2),i=1,2)
88 | endif
89 | c
90 | return
91 | end
92 |
--------------------------------------------------------------------------------
/backend/fortran/lib/libamd.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libamd.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libcamd.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libcamd.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libccolamd.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libccolamd.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libcholmod.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libcholmod.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libcolamd.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libcolamd.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libmetis.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libmetis.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libsuitesparseconfig.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libsuitesparseconfig.a
--------------------------------------------------------------------------------
/backend/fortran/lib/libumfpack.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/libumfpack.a
--------------------------------------------------------------------------------
/backend/fortran/lib/umf4_f77zwrapper64.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/lib/umf4_f77zwrapper64.o
--------------------------------------------------------------------------------
/backend/fortran/list_edge.f:
--------------------------------------------------------------------------------
1 | c
2 | subroutine list_edge (nel, npt, nnodes,
3 | * n_edge, type_nod, table_nod,
4 | * table_edge, table_edge_face, visite)
5 | c
6 | implicit none
7 | integer*8 nel, npt, nnodes
8 | integer*8 n_edge
9 | integer*8 type_nod(npt), visite(npt)
10 | integer*8 table_nod(nnodes,nel), table_edge_face(14,nel)
11 | integer*8 table_edge(4,npt)
12 | integer*8 i, j, k, j1, j2, n_face, debug
13 | integer*8 list_end(2,3)
14 |
15 | c Endpoints of the 6 edges (mid-point) of the reference tetrahedron
16 | c
17 | i = 1
18 | list_end(1,i) = 1
19 | list_end(2,i) = 2
20 | i = 2
21 | list_end(1,i) = 2
22 | list_end(2,i) = 3
23 | i = 3
24 | list_end(1,i) = 1
25 | list_end(2,i) = 3
26 |
27 | n_face = nel
28 | debug = 0
29 |
30 | do i=1,npt
31 | visite(i) = 0
32 | enddo
33 | n_edge = 0
34 | do i=1,nel
35 | do j=4,nnodes
36 | if (type_nod(table_nod(j,i)) .ne. 0) then
37 | j1 = list_end(1,j-3)
38 | j2 = list_end(2,j-3)
39 | if (type_nod(table_nod(j1,i)) .eq. 0 .or.
40 | * type_nod(table_nod(j2,i)) .eq. 0) then
41 | write(*,*) "list_edge: table_nod = ",
42 | * type_nod(table_nod(j1,i)), type_nod(table_nod(j2,i)),
43 | * type_nod(table_nod(j,i))
44 | write(*,*) "type_nod(j1) = ", table_nod(j1,i)
45 | write(*,*) "type_nod(j2) = ", table_nod(j2,i)
46 | write(*,*) "type_nod(j) = ", table_nod(j,i)
47 | write(*,*) "list_edge: Aborting..."
48 | stop
49 | endif
50 | endif
51 | enddo
52 | do j=4,nnodes ! scan the element edge
53 | j1 = table_nod(j,i)
54 | k = visite(j1)
55 | if (k .eq. 0) then
56 | n_edge = n_edge + 1
57 | visite(j1) = n_edge
58 | j2 = list_end(1,j-3)
59 | table_edge(1,n_edge) = table_nod(j2,i)
60 | j2 = list_end(2,j-3)
61 | table_edge(2,n_edge) = table_nod(j2,i)
62 | table_edge(3,n_edge) = j1
63 | c Table of connectivity for the face (with respect to the triangle element)
64 | table_edge_face(j-2,i) = n_edge + n_face
65 | table_edge(4,n_edge) = n_edge + n_face
66 | else
67 | table_edge_face(j-2,i) = k + n_face
68 | table_edge(4,k) = k + n_face
69 | endif
70 | enddo
71 | enddo
72 | if (debug .eq. 1) then
73 | write(*,*) "list_edge: npt, n_edge, nel = ", npt,n_edge,nel
74 | endif
75 | c
76 | return
77 | end
78 |
--------------------------------------------------------------------------------
/backend/fortran/list_face.f:
--------------------------------------------------------------------------------
1 | c
2 | subroutine list_face (nel, table_edge_face)
3 | c
4 | c
5 | implicit none
6 | integer*8 nel
7 | integer*8 table_edge_face(14,nel)
8 | integer*8 i
9 | c
10 | c Table of connectivity for the face (for 2D FEM, face = triangle element)
11 | c
12 | do i=1,nel
13 | table_edge_face(1,i) = i ! each element is a face
14 | enddo
15 | c
16 | return
17 | end
18 |
--------------------------------------------------------------------------------
/backend/fortran/matrix_kxy_1d.f:
--------------------------------------------------------------------------------
1 | C************************************************************************
2 | C
3 | subroutine matrix_kxy_1d (xmin, xmax, matKxy)
4 | c
5 | c matKxy(i,j) = Integrate[lsP2[[i]] P3'[[j]], {x, xmin, xmax}]
6 | c
7 | C************************************************************************
8 | C
9 | C
10 | implicit none
11 |
12 | double precision xmin, xmax, matKxy(3,4)
13 |
14 | C Local parameters:
15 |
16 | double precision fact1
17 | integer*8 dim1, dim2, i, j
18 |
19 | matKxy(1,1) = -83
20 | matKxy(1,2) = -7
21 | matKxy(1,3) = 99
22 | matKxy(1,4) = -9
23 | matKxy(2,1) = 7
24 | matKxy(2,2) = 83
25 | matKxy(2,3) = 9
26 | matKxy(2,4) = -99
27 | matKxy(3,1) = -44
28 | matKxy(3,2) = 44
29 | matKxy(3,3) = -108
30 | matKxy(3,4) = 108
31 |
32 | fact1 = 120
33 | dim1 = 3
34 | dim2 = 4
35 | do j=1,dim2
36 | do i=1,dim1
37 | matKxy(i,j) = matKxy(i,j) / fact1
38 | enddo
39 | enddo
40 | C
41 | end subroutine matrix_kxy_1d
42 |
--------------------------------------------------------------------------------
/backend/fortran/matrix_kyx_1d.f:
--------------------------------------------------------------------------------
1 | C************************************************************************
2 | C
3 | subroutine matrix_kyx_1d (xmin, xmax, matKyx)
4 | c
5 | c matKyx(i,j) = Integrate[P3'[[i]] * P2[[j]], {x, xmin, xmax}]
6 | c
7 | C************************************************************************
8 | C
9 | C
10 | implicit none
11 |
12 | double precision xmin, xmax, matKyx(4,3)
13 |
14 | C Local parameters:
15 |
16 | double precision fact1
17 | integer*8 dim1, dim2, i, j
18 |
19 |
20 | matKyx(1,1) = -83
21 | matKyx(1,2) = 7
22 | matKyx(1,3) = -44
23 | matKyx(2,1) = -7
24 | matKyx(2,2) = 83
25 | matKyx(2,3) = 44
26 | matKyx(3,1) = 99
27 | matKyx(3,2) = 9
28 | matKyx(3,3) = -108
29 | matKyx(4,1) = -9
30 | matKyx(4,2) = -99
31 | matKyx(4,3) = 108
32 |
33 | fact1 = 120
34 | dim1 = 4
35 | dim2 = 3
36 | do j=1,dim2
37 | do i=1,dim1
38 | matKyx(i,j) = matKyx(i,j) / fact1
39 | enddo
40 | enddo
41 | C
42 |
43 | end subroutine matrix_kyx_1d
44 |
--------------------------------------------------------------------------------
/backend/fortran/matrix_kyy_1d.f:
--------------------------------------------------------------------------------
1 | C************************************************************************
2 | C
3 | subroutine matrix_kyy_1d (xmin, xmax, matKyy)
4 | c
5 | c matKyy(i,j) - Integrate[P3'[[i]] * P3'[[j]], {x, xmin, xmax}]
6 | c
7 | C************************************************************************
8 | C
9 | C
10 | implicit none
11 |
12 | double precision xmin, xmax, matKyy(4,4)
13 |
14 | C Local parameters:
15 |
16 | double precision fact1
17 | integer*8 dim1, dim2, i, j
18 |
19 |
20 | matKyy(1,1) = 148
21 | matKyy(1,2) = -13
22 | matKyy(1,3) = -189
23 | matKyy(1,4) = 54
24 | matKyy(2,1) = -13
25 | matKyy(2,2) = 148
26 | matKyy(2,3) = 54
27 | matKyy(2,4) = -189
28 | matKyy(3,1) = -189
29 | matKyy(3,2) = 54
30 | matKyy(3,3) = 432
31 | matKyy(3,4) = -297
32 | matKyy(4,1) = 54
33 | matKyy(4,2) = -189
34 | matKyy(4,3) = -297
35 | matKyy(4,4) = 432
36 |
37 | fact1 = 40 * (xmax-xmin)
38 | dim1 = 4
39 | dim2 = 4
40 | do j=1,dim2
41 | do i=1,dim1
42 | matKyy(i,j) = matKyy(i,j) / fact1
43 | enddo
44 | enddo
45 | C
46 |
47 | end subroutine matrix_kyy_1d
48 |
--------------------------------------------------------------------------------
/backend/fortran/matrix_mxx_1d.f:
--------------------------------------------------------------------------------
1 | C************************************************************************
2 | C
3 | subroutine matrix_mxx_1d (xmin, xmax, matMxx)
4 | c
5 | c matMxx(i,j) = Integrate[P2[[i]] * P2[[j]], {x, xmin, xmax}]
6 | c
7 | C************************************************************************
8 | C
9 | C
10 | implicit none
11 |
12 | double precision xmin, xmax, matMxx(3,3)
13 |
14 | C Local parameters:
15 |
16 | double precision fact1
17 | integer*8 dim1, dim2, i, j
18 |
19 |
20 | matMxx(1,1) = 4*(xmax - xmin)
21 | matMxx(1,2) = -xmax + xmin
22 | matMxx(1,3) = 2*(xmax - xmin)
23 | matMxx(2,1) = -xmax + xmin
24 | matMxx(2,2) = 4*(xmax - xmin)
25 | matMxx(2,3) = 2*(xmax - xmin)
26 | matMxx(3,1) = 2*(xmax - xmin)
27 | matMxx(3,2) = 2*(xmax - xmin)
28 | matMxx(3,3) = 16*(xmax - xmin)
29 |
30 |
31 | fact1 = 30
32 | dim1 = 3
33 | dim2 = 3
34 | do j=1,dim2
35 | do i=1,dim1
36 | matMxx(i,j) = matMxx(i,j) / fact1
37 | enddo
38 | enddo
39 | C
40 | end subroutine matrix_mxx_1d
41 |
--------------------------------------------------------------------------------
/backend/fortran/matrix_myy_1d.f:
--------------------------------------------------------------------------------
1 | C************************************************************************
2 | C
3 | subroutine matrix_myy_1d (xmin, xmax, matMyy)
4 | c
5 | c matMyy(j,j) = Integrate[P3[[i]]*P3[[j]], {x, xmin, xmax}]
6 | c
7 | C************************************************************************
8 | C
9 | C
10 | implicit none
11 |
12 | double precision xmin, xmax, matMyy(4,4)
13 |
14 | C Local parameters:
15 |
16 | double precision fact1
17 | integer*8 dim1, dim2, i, j
18 |
19 |
20 | matMyy(1,1) = 128*(xmax - xmin)
21 | matMyy(1,2) = 19*(xmax - xmin)
22 | matMyy(1,3) = 99*(xmax - xmin)
23 | matMyy(1,4) = -36*(xmax - xmin)
24 | matMyy(2,1) = 19*(xmax - xmin)
25 | matMyy(2,2) = 128*(xmax - xmin)
26 | matMyy(2,3) = -36*(xmax - xmin)
27 | matMyy(2,4) = 99*(xmax - xmin)
28 | matMyy(3,1) = 99*(xmax - xmin)
29 | matMyy(3,2) = -36*(xmax - xmin)
30 | matMyy(3,3) = 648*(xmax - xmin)
31 | matMyy(3,4) = -81*(xmax - xmin)
32 | matMyy(4,1) = -36*(xmax - xmin)
33 | matMyy(4,2) = 99*(xmax - xmin)
34 | matMyy(4,3) = -81*(xmax - xmin)
35 | matMyy(4,4) = 648*(xmax - xmin)
36 |
37 |
38 |
39 | fact1 = 1680
40 | dim1 = 4
41 | dim2 = 4
42 | do j=1,dim2
43 | do i=1,dim1
44 | matMyy(i,j) = matMyy(i,j) / fact1
45 | enddo
46 | enddo
47 | C
48 |
49 | end subroutine matrix_myy_1d
50 |
--------------------------------------------------------------------------------
/backend/fortran/mesh_1d_p2.f.bak:
--------------------------------------------------------------------------------
1 |
2 | subroutine mesh_1d_p2(core_radius, nel, mesh_file)
3 |
4 | implicit none
5 |
6 | integer*8 i, nel, npt, i_el, allocate_status
7 | C parameter (nel = 500)
8 | C parameter (npt = 2 * nel + 1)
9 | double precision, allocatable :: ls_x(:)
10 | integer*8, allocatable :: type_nod(:), type_el(:), table_nod(:,:)
11 | double precision x, x_1, x_2
12 | double precision x_min, x_max, delta_x, core_radius
13 | character mesh_file*500
14 |
15 | Cf2py intent(in) nel, mesh_file, core_radius
16 |
17 | npt = 2 * nel + 1
18 |
19 | allocate_status = 0
20 | allocate(ls_x(npt), STAT=allocate_status)
21 | if (allocate_status /= 0) then
22 | write(*,*) "The allocation is unsuccessful"
23 | write(*,*) "allocate_status = ", allocate_status
24 | write(*,*) "Not enough memory for ls_x"
25 | write(*,*) "ls_x = ", ls_x
26 | write(*,*) "Aborting..."
27 | stop
28 | endif
29 | allocate(type_nod(npt), STAT=allocate_status)
30 | if (allocate_status /= 0) then
31 | write(*,*) "The allocation is unsuccessful"
32 | write(*,*) "allocate_status = ", allocate_status
33 | write(*,*) "Not enough memory for type_nod"
34 | write(*,*) "type_nod = ", type_nod
35 | write(*,*) "Aborting..."
36 | stop
37 | endif
38 | allocate(type_el(nel), STAT=allocate_status)
39 | if (allocate_status /= 0) then
40 | write(*,*) "The allocation is unsuccessful"
41 | write(*,*) "allocate_status = ", allocate_status
42 | write(*,*) "Not enough memory for type_el"
43 | write(*,*) "type_el = ", type_el
44 | write(*,*) "Aborting..."
45 | stop
46 | endif
47 | allocate(table_nod(3,nel), STAT=allocate_status)
48 | if (allocate_status /= 0) then
49 | write(*,*) "The allocation is unsuccessful"
50 | write(*,*) "allocate_status = ", allocate_status
51 | write(*,*) "Not enough memory for table_nod"
52 | write(*,*) "table_nod = ", table_nod
53 | write(*,*) "Aborting..."
54 | stop
55 | endif
56 |
57 | x_min = -0.5d0
58 | x_max = 0.5d0
59 | delta_x = (x_max - x_min) / dble(nel)
60 | C core_radius = (x_max - x_min)/10.0d0
61 |
62 | c Coordinate and type of the nodes
63 | do i_el=1,nel
64 | x = x_min + (i_el-1) * delta_x
65 | ls_x(2*i_el-1) = x
66 | ls_x(2*i_el) = x + delta_x / 2.0d0
67 | type_nod(2*i_el-1) = 0
68 | type_nod(2*i_el) = 0
69 | enddo
70 | c End-points
71 | i_el = nel
72 | x = x_min + i_el * delta_x
73 | ls_x(2*i_el+1) = x
74 | type_nod(2*i_el+1) = 1
75 | i = 1
76 | type_nod(i) = 1
77 | c
78 | c Connectivity table
79 | do i_el=1,nel
80 | table_nod(1,i_el) = 2*i_el-1
81 | table_nod(2,i_el) = 2*i_el+1
82 | table_nod(3,i_el) = 2*i_el ! Mid-node
83 | c End-points of the elements
84 | x_1 = ls_x(2*i_el-1)
85 | x_2 = ls_x(2*i_el+1)
86 | if (abs(x_1) <= core_radius .and.
87 | * abs(x_2) <= core_radius) then
88 | type_el(i_el) = 2
89 | else
90 | type_el(i_el) = 1
91 | endif
92 | enddo
93 |
94 |
95 | open(3,file = mesh_file, status='unknown')
96 | write(3,*) npt, nel
97 | do i=1,npt
98 | write(3,*) i, ls_x(i), type_nod(i)
99 | enddo
100 | do i_el=1,nel
101 | write(3,*) i_el, (table_nod(i,i_el),i=1,3), type_el(i_el)
102 | enddo
103 | close(3)
104 |
105 | deallocate(ls_x, type_nod, type_el, table_nod)
106 |
107 | end
108 |
109 |
--------------------------------------------------------------------------------
/backend/fortran/msh/1D_1_msh_template-horizontal.geo.bak:
--------------------------------------------------------------------------------
1 | d = 1; // unit cell period
2 | d_in_nm = 0; // grating period
3 | w1 = 0;
4 | h_width1 = (w1/(2*d_in_nm))*d;
5 | lc = 0; // 0.501 0.201 0.0701;
6 | lc2 = lc/1; // on grating surfaces
7 |
8 | hy = d; // Thickness: Squre profile => hy=d
9 | hx = 0.;
10 |
11 |
12 | Point(1) = {0, 0, 0, lc};
13 | Point(2) = {-hx, -hy, 0, lc};
14 | Point(3) = {-hx+d, -hy, 0, lc};
15 | Point(4) = {d, 0, 0,lc};
16 |
17 | // Edges of grating
18 | Point(6) = {0, -hy/2-h_width1, 0, lc2};
19 | Point(7) = {0, -hy/2+h_width1, 0, lc2};
20 | Point(8) = {d, -hy/2+h_width1, 0, lc2};
21 | Point(9) = {d, -hy/2-h_width1, 0, lc2};
22 |
23 | //Centre of grating
24 | Point(10) = {0, -hy/2, 0, lc};
25 | Point(11) = {d, -hy/2, 0, lc};
26 |
27 | Line(1) = {1, 4};
28 | Line(2) = {4, 8};
29 | Line(3) = {8, 11};
30 | Line(4) = {11, 9};
31 | Line(5) = {9, 3};
32 | Line(6) = {3, 2};
33 | Line(7) = {2, 6};
34 | Line(8) = {6, 10};
35 | Line(9) = {10, 7};
36 | Line(10) = {7, 1};
37 | Line(11) = {7, 8};
38 | Line(12) = {10, 11};
39 | Line(13) = {6, 9};
40 |
41 |
42 | Line Loop(14) = {10, 1, 2, -11};
43 | Plane Surface(15) = {14};
44 | Line Loop(16) = {11, 3, -12, 9};
45 | Plane Surface(17) = {16};
46 | Line Loop(18) = {8, 12, 4, -13};
47 | Plane Surface(19) = {18};
48 | Line Loop(20) = {7, 13, 5, 6};
49 | Plane Surface(21) = {20};
50 |
51 |
52 | Physical Line(22) = {1};
53 | Physical Line(23) = {2, 3, 4, 5};
54 | Physical Line(24) = {6};
55 | Physical Line(25) = {7, 8, 9, 10};
56 |
57 |
58 | Physical Surface(1) = {15, 21};
59 | Physical Surface(2) = {17, 19};
60 |
--------------------------------------------------------------------------------
/backend/fortran/msh/1D_1_msh_template-vertical.geo.bak:
--------------------------------------------------------------------------------
1 | d = 1; // unit cell period
2 | d_in_nm = 0; // grating period
3 | w1 = 0;
4 | h_width1 = (w1/(2*d_in_nm))*d;
5 | lc = 0; // 0.501 0.201 0.0701;
6 | lc2 = lc/1; // on grating surfaces
7 |
8 | hy = d; // Thickness: Squre profile => hy=d
9 | hx = 0.;
10 |
11 |
12 | Point(1) = {0, 0, 0, lc};
13 | Point(2) = {-hx, -hy, 0, lc};
14 | Point(3) = {-hx+d, -hy, 0, lc};
15 | Point(4) = {d, 0, 0,lc};
16 |
17 | // Edges of grating
18 | Point(6) = {hy/2-h_width1, 0, 0, lc2};
19 | Point(7) = {hy/2+h_width1, 0, 0, lc2};
20 | Point(8) = {hy/2+h_width1, -hy, 0, lc2};
21 | Point(9) = {hy/2-h_width1, -hy, 0, lc2};
22 |
23 | //Centre of grating
24 | Point(10) = {hy/2, 0, 0, lc};
25 | Point(11) = {hy/2, -d, 0, lc};
26 |
27 | Line(1) = {1, 6};
28 | Line(2) = {6, 10};
29 | Line(3) = {10, 7};
30 | Line(4) = {7, 4};
31 | Line(5) = {4, 3};
32 | Line(6) = {3, 8};
33 | Line(7) = {8, 11};
34 | Line(8) = {11, 9};
35 | Line(9) = {9, 2};
36 | Line(10) = {2, 1};
37 | Line(11) = {6, 9};
38 | Line(12) = {10, 11};
39 | Line(13) = {7, 8};
40 |
41 | Line Loop(14) = {1, 11, 9, 10};
42 | Plane Surface(15) = {14};
43 | Line Loop(16) = {13, -6, -5, -4};
44 | Plane Surface(17) = {16};
45 | Line Loop(18) = {11, -8, -12, -2};
46 | Plane Surface(19) = {18};
47 | Line Loop(20) = {12, -7, -13, -3};
48 | Plane Surface(21) = {20};
49 |
50 |
51 | Physical Line(22) = {10};
52 | Physical Line(23) = {1, 2, 3, 4};
53 | Physical Line(24) = {5};
54 | Physical Line(25) = {6, 7, 8, 9};
55 |
56 |
57 | Physical Surface(1) = {15, 17};
58 | Physical Surface(2) = {19, 21};
59 |
--------------------------------------------------------------------------------
/backend/fortran/msh/1D_1_msh_template.geo.bak:
--------------------------------------------------------------------------------
1 | d = 1; // unit cell period
2 | d_in_nm = 0; // grating period
3 | w1 = 0;
4 | h_width1 = (w1/(2*d_in_nm))*d;
5 | lc = 0; // 0.501 0.201 0.0701;
6 | lc2 = lc/1; // on grating surfaces
7 |
8 | hy = d; // Thickness: Squre profile => hy=d
9 | hx = 0.;
10 |
11 |
12 | Point(1) = {0, 0, 0, lc};
13 | Point(2) = {-hx, -hy, 0, lc};
14 | Point(3) = {-hx+d, -hy, 0, lc};
15 | Point(4) = {d, 0, 0,lc};
16 |
17 | // Edges of grating
18 | Point(6) = {hy/2-h_width1, 0, 0, lc2};
19 | Point(7) = {hy/2+h_width1, 0, 0, lc2};
20 | Point(8) = {hy/2+h_width1, -hy, 0, lc2};
21 | Point(9) = {hy/2-h_width1, -hy, 0, lc2};
22 |
23 | //Centre of grating
24 | Point(10) = {hy/2, 0, 0, lc};
25 | Point(11) = {hy/2, -d, 0, lc};
26 |
27 | Line(1) = {1, 6};
28 | Line(2) = {6, 10};
29 | Line(3) = {10, 7};
30 | Line(4) = {7, 4};
31 | Line(5) = {4, 3};
32 | Line(6) = {3, 8};
33 | Line(7) = {8, 11};
34 | Line(8) = {11, 9};
35 | Line(9) = {9, 2};
36 | Line(10) = {2, 1};
37 | Line(11) = {6, 9};
38 | Line(12) = {10, 11};
39 | Line(13) = {7, 8};
40 |
41 | Line Loop(14) = {1, 11, 9, 10};
42 | Plane Surface(15) = {14};
43 | Line Loop(16) = {13, -6, -5, -4};
44 | Plane Surface(17) = {16};
45 | Line Loop(18) = {11, -8, -12, -2};
46 | Plane Surface(19) = {18};
47 | Line Loop(20) = {12, -7, -13, -3};
48 | Plane Surface(21) = {20};
49 |
50 |
51 | Physical Line(22) = {10};
52 | Physical Line(23) = {1, 2, 3, 4};
53 | Physical Line(24) = {5};
54 | Physical Line(25) = {6, 7, 8, 9};
55 |
56 |
57 | Physical Surface(1) = {15, 17};
58 | Physical Surface(2) = {19, 21};
59 |
--------------------------------------------------------------------------------
/backend/fortran/msh/1D_2_msh_template-horizontal.geo.bak:
--------------------------------------------------------------------------------
1 | d = 1; // grating period
2 | d_in_nm = 0;
3 | w1 = 0;
4 | w2 = 0;
5 | h_width1 = (w1/(2*d_in_nm))*d;
6 | h_width2 = (w2/(2*d_in_nm))*d;
7 | lc = 0; // 0.501 0.201 0.0701;
8 | lc2 = lc/1; // on grating_1 surfaces
9 | lc3 = lc/1; // on grating_2 surfaces
10 |
11 | hy = d; // Thickness: Squre profile => hy=d
12 | hx = 0.;
13 |
14 | posx1 = hy/4;// distance from bottom to bottom grating center
15 | posx2 = hy/4;// distance from top to top grating center
16 | posx3 = hy/2;// middle point betwen top & bottom grating centers
17 |
18 |
19 | Point(1) = {0, 0, 0, lc};
20 | Point(2) = {-hx, -hy, 0, lc};
21 | Point(3) = {-hx+d, -hy, 0, lc};
22 | Point(4) = {d, 0, 0,lc};
23 |
24 | Point(5) = {-hx, -hy+posx3, 0,lc};
25 | Point(6) = {d, -hy+posx3, 0,lc};
26 |
27 | // Edges of grating
28 | Point(7) = {0, -hy+posx1-h_width1, 0, lc2};
29 | Point(8) = {0, -hy+posx1+h_width1, 0, lc2};
30 | Point(9) = {d, -hy+posx1+h_width1, 0, lc2};
31 | Point(10) = {d, -hy+posx1-h_width1, 0, lc2};
32 |
33 | Point(11) = {0, 0-posx2-h_width2, 0, lc3};
34 | Point(12) = {0, 0-posx2+h_width2, 0, lc3};
35 | Point(13) = {d, 0-posx2+h_width2, 0, lc3};
36 | Point(14) = {d, 0-posx2-h_width2, 0, lc3};
37 |
38 |
39 |
40 | Line(1) = {1, 4};
41 | Line(2) = {4, 13};
42 | Line(3) = {13, 14};
43 | Line(4) = {14, 6};
44 | Line(5) = {6, 9};
45 | Line(6) = {9, 10};
46 | Line(7) = {10, 3};
47 | Line(8) = {3, 2};
48 | Line(9) = {2, 7};
49 | Line(10) = {8, 7};
50 | Line(11) = {8, 5};
51 | Line(12) = {5, 11};
52 | Line(13) = {11, 12};
53 | Line(14) = {12, 1};
54 | Line(15) = {12, 13};
55 | Line(16) = {11, 14};
56 | Line(17) = {5, 6};
57 | Line(18) = {8, 9};
58 | Line(19) = {7, 10};
59 |
60 |
61 | Line Loop(20) = {1, 2, -15, 14};
62 | Plane Surface(21) = {20};
63 | Line Loop(22) = {15, 3, -16, 13};
64 | Plane Surface(23) = {22};
65 | Line Loop(24) = {16, 4, -17, 12};
66 | Plane Surface(25) = {24};
67 | Line Loop(26) = {11, 17, 5, -18};
68 | Plane Surface(27) = {26};
69 | Line Loop(28) = {10, 19, -6, -18};
70 | Plane Surface(29) = {28};
71 | Line Loop(30) = {19, 7, 8, 9};
72 | Plane Surface(31) = {30};
73 |
74 |
75 | Physical Line(32) = {1};
76 | Physical Line(33) = {2, 3, 4, 5, 6, 7};
77 | Physical Line(34) = {8};
78 | Physical Line(35) = {9, 10, 11, 12, 13, 14};
79 |
80 |
81 | Physical Surface(1) = {21, 25, 27, 31};
82 | Physical Surface(2) = {23};
83 | Physical Surface(3) = {29};
84 |
--------------------------------------------------------------------------------
/backend/fortran/msh/1D_2_msh_template.geo.bak:
--------------------------------------------------------------------------------
1 | d = 1; // grating period
2 | d_in_nm = 0;
3 | w1 = 0;
4 | w2 = 0;
5 | h_width1 = (w1/(2*d_in_nm))*d;
6 | h_width2 = (w2/(2*d_in_nm))*d;
7 | lc = 0; // 0.501 0.201 0.0701;
8 | lc2 = lc/1; // on grating_1 surfaces
9 | lc3 = lc/1; // on grating_1 center
10 | lc4 = lc/1; // on grating_2 center
11 |
12 | hy = d; // Thickness: Squre profile => hy=d
13 | hx = 0.;
14 |
15 | posx1 = hy/4;// distance from bottom to bottom grating center
16 | posx2 = hy/4;// distance from top to top grating center
17 | posx3 = hy/2;// middle point betwen top & bottom grating centers
18 |
19 |
20 | Point(1) = {0, 0, 0, lc};
21 | Point(2) = {-hx, -hy, 0, lc};
22 | Point(3) = {-hx+d, -hy, 0, lc};
23 | Point(4) = {d, 0, 0,lc};
24 |
25 | Point(5) = {hx+posx3, hx, 0,lc};
26 | Point(6) = {hx+posx3, -d, 0,lc};
27 |
28 | // Edges of grating
29 | Point(7) = {posx3+posx1-h_width1, 0, 0, lc2};
30 | Point(8) = {posx3+posx1+h_width1, 0, 0, lc2};
31 | Point(9) = {posx3+posx1+h_width1, -d, 0, lc2};
32 | Point(10) = {posx3+posx1-h_width1, -d, 0, lc2};
33 | // Center
34 | Point(15) = {posx3+posx1, 0, 0, lc3};
35 | Point(16) = {posx3+posx1, -d, 0, lc3};
36 |
37 | Point(11) = {posx2-h_width2, 0, 0, lc2};
38 | Point(12) = {posx2+h_width2, 0, 0, lc2};
39 | Point(13) = {posx2+h_width2, -d, 0, lc2};
40 | Point(14) = {posx2-h_width2, -d, 0, lc2};
41 | // Center
42 | Point(17) = {posx2, 0, 0, lc4};
43 | Point(18) = {posx2, -d, 0, lc4};
44 |
45 |
46 |
47 | Line(1) = {1, 11};
48 | Line(2) = {11, 17};
49 | Line(3) = {17, 12};
50 | Line(4) = {12, 5};
51 | Line(5) = {5, 7};
52 | Line(6) = {7, 15};
53 | Line(7) = {15, 8};
54 | Line(8) = {8, 4};
55 | Line(9) = {4, 3};
56 | Line(10) = {3, 9};
57 | Line(11) = {9, 16};
58 | Line(12) = {16, 10};
59 | Line(13) = {10, 6};
60 | Line(14) = {6, 13};
61 | Line(15) = {13, 18};
62 | Line(16) = {18, 14};
63 | Line(17) = {14, 2};
64 | Line(18) = {2, 1};
65 | Line(19) = {11, 14};
66 | Line(20) = {18, 17};
67 | Line(21) = {12, 13};
68 | Line(22) = {5, 6};
69 | Line(23) = {7, 10};
70 | Line(24) = {16, 15};
71 | Line(25) = {8, 9};
72 |
73 |
74 | Line Loop(26) = {1, 19, 17, 18};
75 | Plane Surface(27) = {26};
76 | Line Loop(28) = {20, -2, 19, -16};
77 | Plane Surface(29) = {28};
78 | Line Loop(30) = {15, 20, 3, 21};
79 | Plane Surface(31) = {30};
80 | Line Loop(32) = {4, 22, 14, -21};
81 | Plane Surface(33) = {32};
82 | Line Loop(34) = {13, -22, 5, 23};
83 | Plane Surface(35) = {34};
84 | Line Loop(36) = {6, -24, 12, -23};
85 | Plane Surface(37) = {36};
86 | Line Loop(38) = {11, 24, 7, 25};
87 | Plane Surface(39) = {38};
88 | Line Loop(40) = {8, 9, 10, -25};
89 | Plane Surface(41) = {40};
90 |
91 |
92 | Physical Line(42) = {1, 2, 3, 4, 5, 6, 7, 8};
93 | Physical Line(43) = {9};
94 | Physical Line(44) = {10, 11, 12, 13, 14, 15, 16, 17};
95 | Physical Line(45) = {18};
96 |
97 |
98 | Physical Surface(1) = {27, 33, 35, 41};
99 | Physical Surface(2) = {29, 31};
100 | Physical Surface(3) = {37, 39};
101 |
--------------------------------------------------------------------------------
/backend/fortran/msh/2_msh_template.geo:
--------------------------------------------------------------------------------
1 |
2 | // Force Gmsh to use legacy msh file format v2
3 | Mesh.MshFileVersion = 2.2;
4 |
5 |
6 | d = 1; // grating period
7 | ff = 0;
8 | d_in_nm = 0;
9 | dy_in_nm = 0;
10 | dy = dy_in_nm/d_in_nm;
11 | a1 = 0;
12 | a2 = 0;
13 | radius1 = (a1/(2*d_in_nm))*d;
14 | radius2 = (a2/(2*d_in_nm))*d;
15 | //radius2 = ((ff*(d)^2)/3.14159265 - (radius1^2))^0.5;
16 | lc = 0; // 0.501 0.201 0.0701;
17 | lc2 = lc/1; // on cylinder surfaces
18 | lc3 = lc/1; // cylinder1 centres
19 | lc4 = lc/1; // cylinder2 centres
20 | posx = 0;//
21 | posy = 0;//
22 |
23 | hy = dy; // Thickness: Squre profile => hy=d
24 | hx = 0.;
25 |
26 | // 2*2 supercell outline
27 |
28 | Point(1) = {0, 0, 0, lc4};
29 | Point(2) = {-hx, -hy, 0, lc4};
30 | Point(3) = {-hx+d, -hy, 0, lc4};
31 | Point(4) = {d, 0, 0,lc4};
32 | Point(5) = {-hx+d/2+posx, -hy/2+posy, 0,lc3};
33 | Point(10) = {-hx+d/2+posx, 0, 0, lc};
34 | Point(11) = {0,-hy/2+posy, 0, lc};
35 | Point(12) = {-hx+d/2+posx, -hy, 0, lc};
36 | Point(13) = {d, -hy/2+posy, 0, lc};
37 |
38 | Point(14) = {-hx+radius2, 0, 0, lc2};
39 | Point(15) = {d-radius2, 0, 0, lc2};
40 | Point(16) = {0,-radius2, 0, lc2};
41 | Point(18) = {-hx+d/2+posx, -hy/2+radius1+posy, 0, lc2};
42 | Point(20) = {d,-radius2, 0, lc2};
43 | Point(21) = {-hx+d/2-radius1+posx, -hy/2+posy, 0,lc2};
44 | Point(22) = {-hx+d/2+radius1+posx, -hy/2+posy, 0,lc2};
45 | Point(23) = {-hx, -hy+radius2, 0, lc2};
46 | Point(25) = {-hx+d/2+posx, -hy/2-radius1+posy, 0, lc2};
47 | Point(27) = {d,-hy+radius2, 0, lc2};
48 | Point(28) = {-hx+radius2, -hy, 0, lc2};
49 | Point(29) = {d-radius2, -hy, 0, lc2};
50 |
51 | Line(1) = {1, 14};
52 | Line(2) = {14, 10};
53 | Line(3) = {10, 15};
54 | Line(4) = {15, 4};
55 | Line(5) = {4, 20};
56 | Line(6) = {20, 13};
57 | Line(7) = {13, 27};
58 | Line(8) = {27, 3};
59 | Line(9) = {3, 29};
60 | Line(10) = {29, 12};
61 | Line(11) = {12, 28};
62 | Line(12) = {28, 2};
63 | Line(13) = {2, 23};
64 | Line(14) = {23, 11};
65 | Line(15) = {11, 16};
66 | Line(16) = {16, 1};
67 | Line(18) = {18, 10};
68 | Line(19) = {18, 5};
69 | Line(20) = {5, 25};
70 | Line(21) = {25, 12};
71 | Line(22) = {11, 21};
72 | Line(23) = {21, 5};
73 | Line(24) = {5, 22};
74 | Line(25) = {22, 13};
75 |
76 | Ellipsis(26) = {14, 1, 16, 16};
77 | Ellipsis(27) = {15, 4, 20, 20};
78 | Ellipsis(28) = {27, 3, 29, 29};
79 | Ellipsis(29) = {28, 2, 23, 23};
80 | Ellipsis(30) = {21, 5, 18, 18};
81 | Ellipsis(31) = {18, 5, 22, 22};
82 | Ellipsis(32) = {22, 5, 25, 25};
83 | Ellipsis(33) = {25, 5, 21, 21};
84 |
85 | Line Loop(77) = {1, 26, 16};
86 | Plane Surface(78) = {77};
87 | Line Loop(79) = {4, 5, -27};
88 | Plane Surface(80) = {79};
89 | Line Loop(81) = {28, -9, -8};
90 | Plane Surface(82) = {81};
91 | Line Loop(83) = {29, -13, -12};
92 | Plane Surface(84) = {83};
93 | Line Loop(85) = {30, 19, -23};
94 | Plane Surface(86) = {85};
95 | Line Loop(87) = {19, 24, -31};
96 | Plane Surface(88) = {87};
97 | Line Loop(89) = {24, 32, -20};
98 | Plane Surface(90) = {89};
99 | Line Loop(91) = {20, 33, 23};
100 | Plane Surface(92) = {91};
101 | Line Loop(93) = {2, -18, -30, -22, 15, -26};
102 | Plane Surface(94) = {93};
103 | Line Loop(95) = {3, 27, 6, -25, -31, 18};
104 | Plane Surface(96) = {95};
105 | Line Loop(97) = {25, 7, 28, 10, -21, -32};
106 | Plane Surface(98) = {97};
107 | Line Loop(99) = {21, 11, 29, 14, 22, -33};
108 | Plane Surface(100) = {99};
109 |
110 | Physical Line(101) = {1, 2, 3, 4};
111 | Physical Line(102) = {5, 6, 7, 8};
112 | Physical Line(103) = {9, 10, 11, 12};
113 | Physical Line(104) = {13, 14, 15, 16};
114 |
115 | Physical Surface(1) = {94, 96, 98, 100};
116 | Physical Surface(2) = {86, 88, 90, 92};
117 | Physical Surface(3) = {78, 80, 82, 84};
118 |
--------------------------------------------------------------------------------
/backend/fortran/msh/4testing-600_120.geo:
--------------------------------------------------------------------------------
1 |
2 | // Force Gmsh to use legacy msh file format v2
3 | Mesh.MshFileVersion = 2.2;
4 |
5 |
6 | d = 1; // grating period
7 | ff = 0.031416;
8 | d_in_nm = 600.000000;
9 | a1 = 120.000000;
10 | radius1 = (a1/(2*d_in_nm))*d;
11 | ellipticity = 0.000000;
12 | square = 0;
13 | lc = 0.100000; // 0.501 0.201 0.0701;
14 | lc2 = lc/2.000000; // on cylinder surfaces
15 | lc3 = lc/1.000000; // cylinder1 centres
16 |
17 | hy = d; // Thickness: Squre profile => hy=d
18 | hx = 0.;
19 |
20 |
21 | Point(1) = {0, 0, 0, lc};
22 | Point(2) = {-hx, -hy, 0, lc};
23 | Point(3) = {-hx+d, -hy, 0, lc};
24 | Point(4) = {d, 0, 0,lc};
25 |
26 | // Vertices of the triangles
27 |
28 | Point(5) = {-hx+d/2, -hy/2, 0,lc3};
29 |
30 | Point(6) = {-hx+d/2, -hy/2+(radius1-ellipticity*radius1), 0, lc2};
31 | Point(7) = {-hx+d/2-radius1, -hy/2, 0, lc2};
32 | Point(8) = {-hx+d/2, -hy/2-(radius1-ellipticity*radius1), 0, lc2};
33 | Point(9) = {-hx+d/2+radius1, -hy/2, 0, lc2};
34 |
35 | Point(10) = {-hx+d/2, 0, 0, lc};
36 | Point(11) = {0,-hy/2, 0, lc};
37 | Point(12) = {-hx+d/2, -hy, 0, lc};
38 | Point(13) = {d, -hy/2, 0, lc};
39 | Line(1) = {1,10};
40 | Line(2) = {10,4};
41 | Line(3) = {2,12};
42 | Line(4) = {12,3};
43 | Line(5) = {1,11};
44 | Line(6) = {11,2};
45 | Line(7) = {4,13};
46 | Line(8) = {13,3};
47 | Line(9) = {11,7};
48 | Line(10) = {7,5};
49 | Line(11) = {5,9};
50 | Line(12) = {9,13};
51 | Line(13) = {10,6};
52 | Line(14) = {6,5};
53 | Line(15) = {5,8};
54 | Line(16) = {8,12};
55 |
56 | //If(ellipticity == 0)
57 | //Circle(17) = {9,5,6};
58 | //Circle(18) = {6,5,7};
59 | //Circle(19) = {7,5,8};
60 | //Circle(20) = {8,5,9};
61 | //EndIf
62 | If(square == 0)
63 | Ellipsis(17) = {9,5,6,6};
64 | Ellipsis(18) = {6,5,7,7};
65 | Ellipsis(19) = {7,5,8,8};
66 | Ellipsis(20) = {8,5,9,9};
67 |
68 | Line Loop(21) = {7,-12,17,-13,2};
69 | Plane Surface(22) = {21};
70 | Line Loop(23) = {1,13,18,-9,-5};
71 | Plane Surface(24) = {23};
72 | Line Loop(25) = {6,3,-16,-19,-9};
73 | Plane Surface(26) = {25};
74 | Line Loop(27) = {4,-8,-12,-20,16};
75 | Plane Surface(28) = {27};
76 | Line Loop(29) = {17,14,11};
77 | Plane Surface(30) = {29};
78 | Line Loop(31) = {18,10,-14};
79 | Plane Surface(32) = {31};
80 | Line Loop(33) = {19,-15,-10};
81 | Plane Surface(34) = {33};
82 | Line Loop(35) = {20,-11,15};
83 | Plane Surface(36) = {35};
84 |
85 | Physical Line(1) = {1,2};
86 | Physical Line(2) = {3,4};
87 | Physical Line(3) = {5,6};
88 | Physical Line(4) = {7,8};
89 |
90 | Physical Surface(1) = {24,26,28,22};
91 | Physical Surface(2) = {30,32,34,36};
92 |
93 |
94 | EndIf
95 | If(square == 1)
96 | // square
97 | Point(150) = {-hx+d/2+radius1, -hy/2+radius1, 0,lc3};
98 | Point(151) = {-hx+d/2-radius1, -hy/2+radius1, 0,lc3};
99 | Point(152) = {-hx+d/2+radius1, -hy/2-radius1, 0,lc3};
100 | Point(153) = {-hx+d/2-radius1, -hy/2-radius1, 0,lc3};
101 |
102 |
103 | Line(17) = {151, 6};
104 | Line(18) = {6, 150};
105 | Line(19) = {150, 9};
106 | Line(20) = {9, 152};
107 | Line(21) = {152, 8};
108 | Line(22) = {8, 153};
109 | Line(23) = {153, 7};
110 | Line(24) = {7, 151};
111 |
112 | Line Loop(25) = {5, 9, 24, 17, -13, -1};
113 | Plane Surface(26) = {25};
114 | Line Loop(27) = {6, 3, -16, 22, 23, -9};
115 | Plane Surface(28) = {27};
116 | Line Loop(29) = {16, 4, -8, -12, 20, 21};
117 | Plane Surface(30) = {29};
118 | Line Loop(31) = {7, -12, -19, -18, -13, 2};
119 | Plane Surface(32) = {31};
120 | Line Loop(33) = {24, 17, 14, -10};
121 | Plane Surface(34) = {33};
122 | Line Loop(35) = {14, 11, -19, -18};
123 | Plane Surface(36) = {35};
124 | Line Loop(37) = {11, 20, 21, -15};
125 | Plane Surface(38) = {37};
126 | Line Loop(39) = {22, 23, 10, 15};
127 | Plane Surface(40) = {39};
128 |
129 | Physical Line(1) = {1,2};
130 | Physical Line(2) = {3,4};
131 | Physical Line(3) = {5,6};
132 | Physical Line(4) = {7,8};
133 |
134 | Physical Surface(1) = {26, 32, 30, 28};
135 | Physical Surface(2) = {34, 36, 38, 40};
136 |
137 | EndIf
--------------------------------------------------------------------------------
/backend/fortran/msh/4testing-940_266_sq.geo:
--------------------------------------------------------------------------------
1 |
2 | // Force Gmsh to use legacy msh file format v2
3 | Mesh.MshFileVersion = 2.2;
4 |
5 |
6 | d = 1; // grating period
7 | ff = 0.000000;
8 | d_in_nm = 940.000000;
9 | a1 = 266.000000;
10 | radius1 = (a1/(2*d_in_nm))*d;
11 | ellipticity = 0.000000;
12 | square = 1;
13 | lc = 0.070000; // 0.501 0.201 0.0701;
14 | lc2 = lc/6.000000; // on cylinder surfaces
15 | lc3 = lc/3.000000; // cylinder1 centres
16 |
17 | hy = d; // Thickness: Squre profile => hy=d
18 | hx = 0.;
19 |
20 |
21 | Point(1) = {0, 0, 0, lc};
22 | Point(2) = {-hx, -hy, 0, lc};
23 | Point(3) = {-hx+d, -hy, 0, lc};
24 | Point(4) = {d, 0, 0,lc};
25 |
26 | // Vertices of the triangles
27 |
28 | Point(5) = {-hx+d/2, -hy/2, 0,lc3};
29 |
30 | Point(6) = {-hx+d/2, -hy/2+(radius1-ellipticity*radius1), 0, lc2};
31 | Point(7) = {-hx+d/2-radius1, -hy/2, 0, lc2};
32 | Point(8) = {-hx+d/2, -hy/2-(radius1-ellipticity*radius1), 0, lc2};
33 | Point(9) = {-hx+d/2+radius1, -hy/2, 0, lc2};
34 |
35 | Point(10) = {-hx+d/2, 0, 0, lc};
36 | Point(11) = {0,-hy/2, 0, lc};
37 | Point(12) = {-hx+d/2, -hy, 0, lc};
38 | Point(13) = {d, -hy/2, 0, lc};
39 | Line(1) = {1,10};
40 | Line(2) = {10,4};
41 | Line(3) = {2,12};
42 | Line(4) = {12,3};
43 | Line(5) = {1,11};
44 | Line(6) = {11,2};
45 | Line(7) = {4,13};
46 | Line(8) = {13,3};
47 | Line(9) = {11,7};
48 | Line(10) = {7,5};
49 | Line(11) = {5,9};
50 | Line(12) = {9,13};
51 | Line(13) = {10,6};
52 | Line(14) = {6,5};
53 | Line(15) = {5,8};
54 | Line(16) = {8,12};
55 |
56 | //If(ellipticity == 0)
57 | //Circle(17) = {9,5,6};
58 | //Circle(18) = {6,5,7};
59 | //Circle(19) = {7,5,8};
60 | //Circle(20) = {8,5,9};
61 | //EndIf
62 | If(square == 0)
63 | Ellipsis(17) = {9,5,6,6};
64 | Ellipsis(18) = {6,5,7,7};
65 | Ellipsis(19) = {7,5,8,8};
66 | Ellipsis(20) = {8,5,9,9};
67 |
68 | Line Loop(21) = {7,-12,17,-13,2};
69 | Plane Surface(22) = {21};
70 | Line Loop(23) = {1,13,18,-9,-5};
71 | Plane Surface(24) = {23};
72 | Line Loop(25) = {6,3,-16,-19,-9};
73 | Plane Surface(26) = {25};
74 | Line Loop(27) = {4,-8,-12,-20,16};
75 | Plane Surface(28) = {27};
76 | Line Loop(29) = {17,14,11};
77 | Plane Surface(30) = {29};
78 | Line Loop(31) = {18,10,-14};
79 | Plane Surface(32) = {31};
80 | Line Loop(33) = {19,-15,-10};
81 | Plane Surface(34) = {33};
82 | Line Loop(35) = {20,-11,15};
83 | Plane Surface(36) = {35};
84 |
85 | Physical Line(1) = {1,2};
86 | Physical Line(2) = {3,4};
87 | Physical Line(3) = {5,6};
88 | Physical Line(4) = {7,8};
89 |
90 | Physical Surface(1) = {24,26,28,22};
91 | Physical Surface(2) = {30,32,34,36};
92 |
93 |
94 | EndIf
95 | If(square == 1)
96 | // square
97 | Point(150) = {-hx+d/2+radius1, -hy/2+radius1, 0,lc3};
98 | Point(151) = {-hx+d/2-radius1, -hy/2+radius1, 0,lc3};
99 | Point(152) = {-hx+d/2+radius1, -hy/2-radius1, 0,lc3};
100 | Point(153) = {-hx+d/2-radius1, -hy/2-radius1, 0,lc3};
101 |
102 |
103 | Line(17) = {151, 6};
104 | Line(18) = {6, 150};
105 | Line(19) = {150, 9};
106 | Line(20) = {9, 152};
107 | Line(21) = {152, 8};
108 | Line(22) = {8, 153};
109 | Line(23) = {153, 7};
110 | Line(24) = {7, 151};
111 |
112 | Line Loop(25) = {5, 9, 24, 17, -13, -1};
113 | Plane Surface(26) = {25};
114 | Line Loop(27) = {6, 3, -16, 22, 23, -9};
115 | Plane Surface(28) = {27};
116 | Line Loop(29) = {16, 4, -8, -12, 20, 21};
117 | Plane Surface(30) = {29};
118 | Line Loop(31) = {7, -12, -19, -18, -13, 2};
119 | Plane Surface(32) = {31};
120 | Line Loop(33) = {24, 17, 14, -10};
121 | Plane Surface(34) = {33};
122 | Line Loop(35) = {14, 11, -19, -18};
123 | Plane Surface(36) = {35};
124 | Line Loop(37) = {11, 20, 21, -15};
125 | Plane Surface(38) = {37};
126 | Line Loop(39) = {22, 23, 10, 15};
127 | Plane Surface(40) = {39};
128 |
129 | Physical Line(1) = {1,2};
130 | Physical Line(2) = {3,4};
131 | Physical Line(3) = {5,6};
132 | Physical Line(4) = {7,8};
133 |
134 | Physical Surface(1) = {26, 32, 30, 28};
135 | Physical Surface(2) = {34, 36, 38, 40};
136 |
137 | EndIf
--------------------------------------------------------------------------------
/backend/fortran/msh/L_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for L shape.
2 |
3 | // Force Gmsh to use legacy msh file format v2
4 | Mesh.MshFileVersion = 2.2;
5 |
6 | d = 1; // grating period
7 | d_in_nm = 0;
8 | dy_in_nm = 0;
9 | dy = dy_in_nm/d_in_nm;
10 |
11 | // input parameters in nm
12 | L_nm = 0;
13 | W_nm = 0;
14 | r = 0;
15 |
16 | // normalized input parameters
17 | L = L_nm/d_in_nm;
18 | W = W_nm/d_in_nm;
19 |
20 | // mesh finesse parameters
21 | lc = 0; // 0.501 0.201 0.0701;
22 | lc2 = lc/1; // mesh at circular arcs
23 |
24 | // unitary cell
25 | Point(1) = {-0.5*d,-0.5*dy, 0, lc};
26 | Point(2) = {0.5*d,-0.5*dy, 0, lc};
27 | Point(3) = {0.5*d,0.5*dy, 0, lc};
28 | Point(4) = {-0.5*d,0.5*dy, 0, lc};
29 |
30 | // L points
31 | Point(5) = {0.5*W*r-0.5*L,0-0.5*L, 0, lc2};
32 | Point(6) = {L-0.5*W-0.5*L,0-0.5*L, 0, lc};
33 | Point(7) = {L-0.5*W-0.5*L,0.5*W-0.5*L, 0, lc};
34 | Point(8) = {L-0.5*W-0.5*L+0.5*Sqrt(2)*W/2,0.5*W-0.5*L - 0.5*Sqrt(2)*W/2, 0, lc2}; // lower right corner
35 | Point(9) = {L-0.5*L,0.5*W-0.5*L, 0, lc2};
36 | Point(10) = {L-0.5*W-0.5*L+0.5*Sqrt(2)*W/2,0.5*W-0.5*L + 0.5*Sqrt(2)*W/2, 0, lc2};
37 | Point(11) = {L-0.5*W-0.5*L,W-0.5*L, 0, lc};
38 | Point(12) = {W+0.5*W*r-0.5*L,W-0.5*L, 0, lc2};
39 | Point(13) = {W+0.5*W*r-0.5*L,W+0.5*W*r-0.5*L, 0, lc};
40 | Point(14) = {W-0.5*L,W+0.5*W*r-0.5*L, 0, lc2};
41 | Point(15) = {W-0.5*L,L-0.5*W-0.5*L, 0, lc};
42 | Point(16) = {0.5*W-0.5*L,L-0.5*W-0.5*L, 0, lc};
43 | Point(17) = {0.5*W-0.5*L+0.5*Sqrt(2)*W/2,L-0.5*W-0.5*L+0.5*Sqrt(2)*W/2, 0, lc2}; // upper left corner
44 | Point(18) = {0.5*W-0.5*L,L-0.5*L, 0, lc2};
45 | Point(19) = {0.5*W-0.5*L-0.5*Sqrt(2)*W/2,L-0.5*W-0.5*L+0.5*Sqrt(2)*W/2, 0, lc2};
46 | Point(20) = {0.0-0.5*L,L-0.5*W-0.5*L, 0, lc};
47 | Point(21) = {0.0-0.5*L,0.5*W*r-0.5*L, 0, lc2};
48 | Point(22) = {0.5*W*r-0.5*L,0.5*W*r-0.5*L, 0, lc};
49 |
50 | // L lines
51 | Line(1) = {1,2};
52 | Line(2) = {2,3};
53 | Line(3) = {3,4};
54 | Line(4) = {4,1};
55 | Line(5) = {5,6};
56 | Circle(6) = {6,7,8};
57 | Circle(7) = {8,7,9};
58 | Circle(8) = {9,7,10};
59 | Circle(9) = {10,7,11};
60 | Line(10) = {11,12};
61 | Circle(11) = {12,13,14};
62 | Line(12) = {14,15};
63 | Circle(13) = {15,16,17};
64 | Circle(14) = {17,16,18};
65 | Circle(15) = {18,16,19};
66 | Circle(16) = {19,16,20};
67 | Line(17) = {20,21};
68 | Circle(18) = {21,22,5};
69 |
70 | // Line loops defining the surfaces
71 | Line Loop(1) = {5,6,7,8,9,10,11,12,13,14,15,16,17,18};
72 | Line Loop(2) = {1,2,3,4};
73 |
74 | // Surfaces
75 | Plane Surface(1) = {1};
76 | Plane Surface(2) = {2,1};
77 |
78 | // Physical Surfaces where materials get assigned
79 | Physical Line(1) = {1};
80 | Physical Line(2) = {2};
81 | Physical Line(3) = {3};
82 | Physical Line(4) = {4};
83 |
84 | Physical Surface(1) = {2}; //internal
85 | Physical Surface(2) = {1};
86 |
--------------------------------------------------------------------------------
/backend/fortran/msh/SRR_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for a split ring resonator,
2 | // with its open side at the top.
3 |
4 | // Force Gmsh to use legacy msh file format v2
5 | Mesh.MshFileVersion = 2.2;
6 |
7 | d = 1; // grating period
8 |
9 | d_in_nm = 0;
10 | dy_in_nm = 0;
11 | dy = dy_in_nm/d_in_nm;
12 | lvert_nm = 0;
13 | lhori_nm = 0;
14 | width_nm = 0;
15 |
16 | lvert = lvert_nm/d_in_nm*d;
17 | lhori = lhori_nm/d_in_nm*d;
18 | w = width_nm/d_in_nm*d;
19 |
20 | lc = 0;
21 | lc2 = lc/1; // on SRR edgesq
22 | lc3 = lc/1; //in centre of SRR
23 |
24 | hy = dy; // Thickness: Squre profile => hy=d
25 | hx = 0.;
26 |
27 | Point(1) = {0, 0, 0, lc};
28 | Point(2) = {-hx, -hy, 0, lc};
29 | Point(3) = {-hx+d, -hy, 0, lc};
30 | Point(4) = {d, 0, 0, lc};
31 |
32 | // Vertices of the triangles
33 |
34 | Point(5) = {-lhori/2+d/2,-lvert/2-d/2,0,lc2};
35 | Point(6) = {-lhori/2+d/2,lvert/2-d/2,0,lc2};
36 | Point(7) = {-lhori/2+d/2+w,lvert/2-d/2,0,lc2};
37 | Point(8) = {-lhori/2+w+d/2,-lvert/2+w-d/2,0,lc2};
38 | Point(9) = {lhori/2-w+d/2,-lvert/2+w-d/2,0,lc2};
39 | Point(10) = {lhori/2-w+d/2,lvert/2-d/2,0,lc2};
40 | Point(11) = {lhori/2+d/2,lvert/2-d/2,0,lc2};
41 | Point(12) = {lhori/2+d/2,-lvert/2-d/2,0,lc2};
42 | Point(13) = {-lhori/2+w+d/2,-lvert/2-d/2,0,lc2};
43 | Point(14) = {lhori/2-w+d/2,-lvert/2-d/2,0,lc2};
44 | Point(15) = {-lhori/2+d/2+w,-hy/2,0,lc2};
45 | Point(16) = {lhori/2+d/2-w,-hy/2,0,lc2};
46 | Point(17) = {d/2,lvert/2-d/2,0,lc2};
47 | Point(18) = {d/2,-lvert/2-d/2+w,0,lc2};
48 | Point(19) = {d/2,-hy/2,0,lc};
49 |
50 |
51 | Line(1) = {1, 4};
52 | Line(2) = {4, 3};
53 | Line(3) = {3, 2};
54 | Line(4) = {2, 1};
55 | Line(5) = {6, 7};
56 | Line(6) = {7, 15};
57 | Line(7) = {15, 8};
58 | Line(9) = {9, 16};
59 | Line(10) = {16, 10};
60 | Line(11) = {10, 11};
61 | Line(12) = {11, 12};
62 | Line(13) = {12, 14};
63 | Line(14) = {14, 13};
64 | Line(15) = {13, 5};
65 | Line(16) = {5, 6};
66 | Line(17) = {7, 17};
67 | Line(18) = {17, 10};
68 | Line(19) = {15, 19};
69 | Line(20) = {19, 16};
70 | Line(21) = {18, 19};
71 | Line(22) = {19, 17};
72 | Line(23) = {8, 13};
73 | Line(24) = {9, 14};
74 | Line(25) = {12, 3};
75 | Line(26) = {6, 1};
76 | Line(27) = {2, 5};
77 | Line(28) = {8, 18};
78 | Line(29) = {18, 9};
79 | Line(30) = {4, 11};
80 | Line Loop(31) = {26, 1, 30, -11, -18, -17, -5};
81 | Plane Surface(32) = {31};
82 | Line Loop(33) = {30, 12, 25, -2};
83 | Plane Surface(34) = {33};
84 | Line Loop(35) = {25, 3, 27, -15, -14, -13};
85 | Plane Surface(36) = {35};
86 | Line Loop(37) = {27, 16, 26, -4};
87 | Plane Surface(38) = {37};
88 | Line Loop(39) = {16, 5, 6, 7, 23, 15};
89 | Plane Surface(40) = {39};
90 | Line Loop(41) = {23, -14, -24, -29, -28};
91 | Plane Surface(42) = {41};
92 | Line Loop(43) = {24, -13, -12, -11, -10, -9};
93 | Plane Surface(44) = {43};
94 | Line Loop(45) = {29, 9, -20, -21};
95 | Plane Surface(46) = {45};
96 | Line Loop(47) = {21, -19, 7, 28};
97 | Plane Surface(48) = {47};
98 | Line Loop(49) = {6, 19, 22, -17};
99 | Plane Surface(50) = {49};
100 | Line Loop(51) = {22, 18, -10, -20};
101 | Plane Surface(52) = {51};
102 |
103 | Physical Line(53) = {4};
104 | Physical Line(54) = {1};
105 | Physical Line(56) = {3};
106 | Physical Line(57) = {2};
107 |
108 | Physical Surface(1) = {38, 32, 50, 52, 48, 46, 34, 36};
109 | Physical Surface(2) = {40, 42, 44};
110 |
--------------------------------------------------------------------------------
/backend/fortran/msh/dimer1_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for a single inclusion.
2 | // By default it will be circular, can also be made to be
3 | // elliptical or square.
4 |
5 | // Force Gmsh to use legacy msh file format v2
6 | Mesh.MshFileVersion = 2.2;
7 |
8 | d = 1; // grating period
9 | ff = 0;
10 | d_in_nm = 0; // input geo params
11 | dy_in_nm = 0;
12 | dy = dy_in_nm/d_in_nm;
13 | a1 = 0;
14 | a2 = 0;
15 | gap = 0;
16 | ellipticity = 0;
17 | lc = 0; // input mesh params
18 | lc2 = lc/1; // on cylinder surfaces and center
19 | lc3 = lc/1; // on gap
20 | center1 = d_in_nm/2 - a1/2 - gap/2; // derived params
21 | center2 = d_in_nm/2 + a2/2 + gap/2;
22 | r1 = (a1/(2*d_in_nm))*d;
23 | r2 = (a2/(2*d_in_nm))*d;
24 | c1 = (center1/d_in_nm)*d;
25 | c2 = (center2/d_in_nm)*d;
26 | ell = ellipticity;
27 |
28 | hy = dy; // Thickness: Square profile => hy=d
29 | hx = 0.;
30 |
31 |
32 | // unit cell
33 | Point(1) = {0, 0, 0, lc};
34 | Point(2) = {-hx, -hy, 0, lc};
35 | Point(3) = {-hx+d, -hy, 0, lc};
36 | Point(4) = {d, 0, 0,lc};
37 |
38 | // first circle
39 | Point(5) = {-hx+c1, -hy/2, 0,lc2};
40 | Point(6) = {-hx+c1, -hy/2+(r1-ell*r1), 0, lc2};
41 | Point(7) = {-hx+c1-r1, -hy/2, 0, lc2};
42 | Point(8) = {-hx+c1, -hy/2-(r1-ell*r1), 0, lc2};
43 | Point(9) = {-hx+c1+r1, -hy/2, 0, lc3};
44 |
45 | // second circle
46 | Point(10) = {-hx+c2, -hy/2, 0,lc2};
47 | Point(11) = {-hx+c2, -hy/2+(r2-ell*r2), 0, lc2};
48 | Point(12) = {-hx+c2-r2, -hy/2, 0, lc3};
49 | Point(13) = {-hx+c2, -hy/2-(r2-ell*r2), 0, lc2};
50 | Point(14) = {-hx+c2+r2, -hy/2, 0, lc2};
51 |
52 | // middle axis points
53 | Point(15) = {-hx, -hy/2, 0, lc};
54 | Point(16) = {-hx+d, -hy/2, 0, lc};
55 |
56 | // now connecting the dots :)
57 | Line(1) = {1,4}; // unit cell perimeter
58 | Line(2) = {2,3};
59 | Line(3) = {1,15};
60 | Line(4) = {15,2};
61 | Line(5) = {4,16};
62 | Line(6) = {16,3};
63 | Line(7) = {15,7}; // horizontal middle axis
64 | Line(8) = {7,5};
65 | Line(9) = {5,9};
66 | Line(10) = {9,12};
67 | Line(11) = {12,10};
68 | Line(12) = {10,14};
69 | Line(13) = {14,16};
70 | Ellipsis(14) = {9,5,6,6}; // left circle
71 | Ellipsis(15) = {6,5,7,7};
72 | Ellipsis(16) = {7,5,8,8};
73 | Ellipsis(17) = {8,5,9,9};
74 | Ellipsis(18) = {14,10,11,11}; // right circle
75 | Ellipsis(19) = {11,10,12,12};
76 | Ellipsis(20) = {12,10,13,13};
77 | Ellipsis(21) = {13,10,14,14};
78 |
79 | // now the line loops to define the surfaces
80 | // starting from the top right corner
81 | Line Loop(22) = {5,-13,18,19,-10,14,15,-7,-3,1};
82 | Plane Surface(23) = {22};
83 | Line Loop(24) = {6,-2,-4,7,16,17,10,20,21,13};
84 | Plane Surface(25) = {24};
85 | Line Loop(26) = {-12,-11,-19,-18};
86 | Plane Surface(27) = {26};
87 | Line Loop(28) = {-9,-8,-15,-14};
88 | Plane Surface(29) = {28};
89 | Line Loop(30) = {-17,-16,8,9};
90 | Plane Surface(31) = {30};
91 | Line Loop(32) = {-21,-20,11,12};
92 | Plane Surface(33) = {32};
93 |
94 | // physical lines: what are they?
95 | Physical Line(1) = {1};
96 | Physical Line(2) = {2};
97 | Physical Line(3) = {3,4};
98 | Physical Line(4) = {5,6};
99 |
100 | // the real stuff
101 | Physical Surface(1) = {23,25};
102 | Physical Surface(2) = {27,29,31,33};
103 |
--------------------------------------------------------------------------------
/backend/fortran/msh/egg_inclusion_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file egg plus active material inclusion
2 | // Force Gmsh to use legacy msh file format v2
3 | Mesh.MshFileVersion = 2.2;
4 |
5 | d = 1; // grating period
6 | ff = 0;
7 | d_in_nm = 0;
8 | dy_in_nm = 0;
9 | dy = dy_in_nm/d_in_nm;
10 | r1 = 0;
11 | r2 = 0;
12 | r3 = 0;
13 | angle = 0;
14 | shiftx = 0;
15 | shifty = 0;
16 | ///////////////////////////////////
17 | // active material inclusion params
18 | ///////////////////////////////////
19 | r_inc = 0;
20 | shift_inc_x = 0;
21 | shift_inc_y = 0;
22 | ///////////////////////////////////
23 | ///////////////////////////////////
24 | ///////////////////////////////////
25 | rr1 = (r1/(d_in_nm))*d;
26 | rr2 = (r2/(d_in_nm))*d;
27 | rr3 = (r3/(d_in_nm))*d;
28 | rr_inc = (r_inc/(d_in_nm))*d;
29 | inc_sshiftx = (shift_inc_x/(d_in_nm))*d;
30 | inc_sshifty = (shift_inc_y/(d_in_nm))*d;
31 | inc_delta = 0.0000001; // this is a numerical trick to distinguish point(5) from point(105) when there is no shift
32 | sshiftx=(shiftx/(d_in_nm))*d;
33 | sshifty=(shifty/(d_in_nm))*d;
34 | lc = 0; // 0.501 0.201 0.0701;
35 | lc2 = lc/1; // on cylinder surfaces
36 | lc3 = lc/1; // cylinder1 centres
37 | ///////////////////////////////////
38 | // active material inclusion params
39 | ///////////////////////////////////
40 | lc4 = lc/1; // active material inclusion
41 | ///////////////////////////////////
42 | ///////////////////////////////////
43 | ///////////////////////////////////
44 |
45 | hy = dy; // Thickness: Square profile => hy=d
46 | hx = 0.;
47 |
48 | // Simplified unit cell
49 | Point(1) = {0, 0, 0, lc};
50 | Point(2) = {-hx, -hy, 0, lc};
51 | Point(3) = {-hx+d, -hy, 0, lc};
52 | Point(4) = {d, 0, 0,lc};
53 |
54 | // circular inclusion of active material, I include sshiftx and sshifty so it moves together with the egg
55 | Point(105) = {inc_sshiftx + sshiftx - hx+d/2 + inc_delta,inc_sshifty + -hy/2 + sshifty, 0,lc4};
56 | Point(106) = {inc_sshiftx + sshiftx - hx+d/2,inc_sshifty + -hy/2 - rr_inc + sshifty, 0, lc4};
57 | Point(107) = {inc_sshiftx + sshiftx - hx+d/2 - rr_inc,inc_sshifty + -hy/2 + sshifty, 0, lc4};
58 | Point(108) = {inc_sshiftx + sshiftx - hx+d/2,inc_sshifty + -hy/2 + rr_inc + sshifty, 0, lc4};
59 | Point(109) = {inc_sshiftx + sshiftx - hx+d/2 + rr_inc,inc_sshifty + -hy/2 + sshifty, 0, lc4};
60 |
61 | // Vertices of the egg
62 | Point(5) = {sshiftx - hx+d/2, -hy/2 + sshifty, 0,lc3};
63 | Point(6) = {sshiftx - hx+d/2, -hy/2 - rr3 + sshifty, 0, lc2};
64 | Point(7) = {sshiftx - hx+d/2 - rr1, -hy/2 + sshifty, 0, lc2};
65 | Point(8) = {sshiftx - hx+d/2, -hy/2 + rr2 + sshifty, 0, lc2};
66 | Point(9) = {sshiftx - hx+d/2 + rr1, -hy/2 + sshifty, 0, lc2};
67 |
68 | Rotate{{0, 0, 1}, {sshiftx - hx+d/2, -hy/2 + sshifty, 0}, angle} {Point{6,7,8,9,105,106,107,108,109};}
69 |
70 | Line(1) = {1,2};
71 | Line(2) = {2,3};
72 | Line(3) = {3,4};
73 | Line(4) = {4,1};
74 |
75 | Ellipsis(5) = {9,5,6,6};
76 | Ellipsis(6) = {6,5,7,7};
77 | Ellipsis(7) = {7,5,8,8};
78 | Ellipsis(8) = {8,5,9,9};
79 |
80 | // active materials inclusion arcs
81 | Ellipsis(105) = {109,105,106,106};
82 | Ellipsis(106) = {106,105,107,107};
83 | Ellipsis(107) = {107,105,108,108};
84 | Ellipsis(108) = {108,105,109,109};
85 |
86 |
87 | Line Loop(9) = {1,2,3,4};
88 | Line Loop(10) = {5,6,7,8};
89 | Line Loop(100) = {105,106,107,108};
90 | Plane Surface(11) = {9,10};
91 | Plane Surface(12) = {10,100};
92 | Plane Surface(101) = {100};
93 |
94 | // Add points to surface for mesh control
95 | Point{5} In Surface{12};
96 |
97 | Physical Line(1) = {1};
98 | Physical Line(2) = {2};
99 | Physical Line(3) = {3};
100 | Physical Line(4) = {4};
101 |
102 | Physical Surface(1) = {11};
103 | Physical Surface(2) = {12};
104 | Physical Surface(3) = {101};
--------------------------------------------------------------------------------
/backend/fortran/msh/elle_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for ELLE shape.
2 | // See Zanotto et al Nanophotonics 8, 2291 (2019)
3 |
4 | // Force Gmsh to use legacy msh file format v2
5 | Mesh.MshFileVersion = 2.2;
6 |
7 | d = 1; // grating period
8 | d_in_nm = 0;
9 | dy_in_nm = 0;
10 | dy = dy_in_nm/d_in_nm;
11 |
12 | // input parameters in units of period d
13 | L1 = 0;
14 | L2 = 0;
15 | L3 = 0;
16 | L4 = 0;
17 |
18 |
19 | // mesh finesse parameters
20 | lc = 0.100000; // 0.501 0.201 0.0701;
21 | lc2 = lc/2.000000; // mesh at ELLE boundary
22 |
23 | // unitary cell
24 | Point(1) = {-0.5*d,-0.5*dy, 0, lc};
25 | Point(2) = {0.5*d,-0.5*dy, 0, lc};
26 | Point(3) = {0.5*d,0.5*dy, 0, lc};
27 | Point(4) = {-0.5*d,0.5*dy, 0, lc};
28 |
29 | // L points
30 | Point(5) = {-0.5*L1, -0.5*L2, 0, lc2}; // lower left corner
31 | Point(6) = { 0.5*L1, -0.5*L2, 0, lc2}; // lower right corner
32 | Point(7) = { 0.5*L1, -0.5*L2+L4, 0, lc2};
33 | Point(8) = {-0.5*L1+L3, -0.5*L2+L4, 0, lc2};
34 | Point(9) = {-0.5*L1+L3, 0.5*L2, 0, lc2};
35 | Point(10) = {-0.5*L1, 0.5*L2, 0, lc2}; // upper left corner
36 |
37 |
38 | // L lines
39 | Line(1) = {1,2};
40 | Line(2) = {2,3};
41 | Line(3) = {3,4};
42 | Line(4) = {4,1};
43 |
44 | Line(5) = {5,6};
45 | Line(6) = {6,7};
46 | Line(7) = {7,8};
47 | Line(8) = {8,9};
48 | Line(9) = {9,10};
49 | Line(10) = {10,5};
50 |
51 |
52 | // Line loops defining the surfaces
53 | Line Loop(1) = {5,6,7,8,9,10};
54 | Line Loop(2) = {1,2,3,4};
55 |
56 | // Surfaces
57 | Plane Surface(1) = {1};
58 | Plane Surface(2) = {2,1};
59 |
60 | // Physical Surfaces where materials get assigned
61 | Physical Line(1) = {1};
62 | Physical Line(2) = {2};
63 | Physical Line(3) = {3};
64 | Physical Line(4) = {4};
65 |
66 | Physical Surface(1) = {2}; //internal
67 | Physical Surface(2) = {1};
68 | //+
69 | Show "*";
70 | //+
71 | Show "*";
72 |
--------------------------------------------------------------------------------
/backend/fortran/msh/ellipse_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for a single inclusion.
2 | // By default it will be circular, can also be made to be
3 | // elliptical or square.
4 |
5 | // Force Gmsh to use legacy msh file format v2
6 | Mesh.MshFileVersion = 2.2;
7 |
8 | d = 1; // grating period
9 | ff = 0;
10 | d_in_nm = 0;
11 | dy_in_nm = 0;
12 | dy = dy_in_nm/d_in_nm;
13 | a1 = 0;
14 | radius1 = (a1/(2*d_in_nm))*d;
15 | ellipticity = 0;
16 | angle = 0;
17 | lc = 0; // 0.501 0.201 0.0701;
18 | lc2 = lc/1; // on cylinder surfaces
19 | lc3 = lc/1; // cylinder1 centres
20 | lc4 = lc/1; // centres of top and bottom
21 |
22 | hy = dy; // Thickness: Square profile => hy=d
23 | hx = 0.;
24 |
25 | // Ellipse aligne with main axes
26 | // so I force the simmetry of the unit cell
27 | If(angle == 0)
28 |
29 | Point(1) = {0, 0, 0, lc};
30 | Point(2) = {-hx, -hy, 0, lc};
31 | Point(3) = {-hx+d, -hy, 0, lc};
32 | Point(4) = {d, 0, 0,lc};
33 |
34 | // Vertices of the triangles
35 |
36 | Point(5) = {-hx+d/2, -hy/2, 0,lc3};
37 |
38 | Point(6) = {-hx+d/2, -hy/2+(radius1-ellipticity*radius1), 0, lc2};
39 | Point(7) = {-hx+d/2-radius1, -hy/2, 0, lc2};
40 | Point(8) = {-hx+d/2, -hy/2-(radius1-ellipticity*radius1), 0, lc2};
41 | Point(9) = {-hx+d/2+radius1, -hy/2, 0, lc2};
42 |
43 | Point(10) = {-hx+d/2, 0, 0, lc4};
44 | Point(11) = {0,-hy/2, 0, lc};
45 | Point(12) = {-hx+d/2, -hy, 0, lc4};
46 | Point(13) = {d, -hy/2, 0, lc};
47 | Line(1) = {1,10};
48 | Line(2) = {10,4};
49 | Line(3) = {2,12};
50 | Line(4) = {12,3};
51 | Line(5) = {1,11};
52 | Line(6) = {11,2};
53 | Line(7) = {4,13};
54 | Line(8) = {13,3};
55 | Line(9) = {11,7};
56 | Line(10) = {7,5};
57 | Line(11) = {5,9};
58 | Line(12) = {9,13};
59 | Line(13) = {10,6};
60 | Line(14) = {6,5};
61 | Line(15) = {5,8};
62 | Line(16) = {8,12};
63 |
64 | Ellipsis(17) = {9,5,6,6};
65 | Ellipsis(18) = {6,5,7,7};
66 | Ellipsis(19) = {7,5,8,8};
67 | Ellipsis(20) = {8,5,9,9};
68 |
69 | Line Loop(21) = {7,-12,17,-13,2};
70 | Plane Surface(22) = {21};
71 | Line Loop(23) = {1,13,18,-9,-5};
72 | Plane Surface(24) = {23};
73 | Line Loop(25) = {6,3,-16,-19,-9};
74 | Plane Surface(26) = {25};
75 | Line Loop(27) = {4,-8,-12,-20,16};
76 | Plane Surface(28) = {27};
77 | Line Loop(29) = {17,14,11};
78 | Plane Surface(30) = {29};
79 | Line Loop(31) = {18,10,-14};
80 | Plane Surface(32) = {31};
81 | Line Loop(33) = {19,-15,-10};
82 | Plane Surface(34) = {33};
83 | Line Loop(35) = {20,-11,15};
84 | Plane Surface(36) = {35};
85 |
86 | Physical Line(1) = {1,2};
87 | Physical Line(2) = {3,4};
88 | Physical Line(3) = {5,6};
89 | Physical Line(4) = {7,8};
90 |
91 | Physical Surface(1) = {24,26,28,22};
92 | Physical Surface(2) = {30,32,34,36};
93 |
94 | // Symmetry is brocken, so no symmetry forcing
95 | Else
96 |
97 | Point(1) = {0, 0, 0, lc};
98 | Point(2) = {-hx, -hy, 0, lc};
99 | Point(3) = {-hx+d, -hy, 0, lc};
100 | Point(4) = {d, 0, 0,lc};
101 |
102 | // Vertices of the triangles
103 |
104 | Point(5) = {-hx+d/2, -hy/2, 0,lc3};
105 |
106 | Point(6) = {-hx+d/2, -hy/2+(radius1-ellipticity*radius1), 0, lc2};
107 | Point(7) = {-hx+d/2-radius1, -hy/2, 0, lc2};
108 | Point(8) = {-hx+d/2, -hy/2-(radius1-ellipticity*radius1), 0, lc2};
109 | Point(9) = {-hx+d/2+radius1, -hy/2, 0, lc2};
110 |
111 | Rotate{{0, 0, 1}, {0.5 * d, -0.5 * dy, 0}, angle} {Point{6,7,8,9};}
112 |
113 | Line(1) = {1,2};
114 | Line(2) = {2,3};
115 | Line(3) = {3,4};
116 | Line(4) = {4,1};
117 |
118 | Ellipsis(5) = {9,5,6,6};
119 | Ellipsis(6) = {6,5,7,7};
120 | Ellipsis(7) = {7,5,8,8};
121 | Ellipsis(8) = {8,5,9,9};
122 |
123 | Line Loop(9) = {1,2,3,4};
124 | Line Loop(10) = {5,6,7,8};
125 | Plane Surface(11) = {9,10};
126 | Plane Surface(12) = {10};
127 |
128 | // Add points to surface for mesh control
129 | Point{5} In Surface{12};
130 |
131 | Physical Line(1) = {1};
132 | Physical Line(2) = {2};
133 | Physical Line(3) = {3};
134 | Physical Line(4) = {4};
135 |
136 | Physical Surface(1) = {11};
137 | Physical Surface(2) = {12};
138 |
139 | EndIf
140 |
--------------------------------------------------------------------------------
/backend/fortran/msh/rect1_msh_template.geo:
--------------------------------------------------------------------------------
1 | // Template mesh geometry file for a single inclusion.
2 | // By default it will be circular, can also be made to be
3 | // elliptical or square.
4 |
5 | // Force Gmsh to use legacy msh file format v2
6 | Mesh.MshFileVersion = 2.2;
7 |
8 | d = 1; // grating period
9 | ff = 0;
10 |
11 | // input geo params
12 | d_in_nm = 0;
13 | dy_in_nm = 0;
14 | dy = dy_in_nm/d_in_nm;
15 | a1 = 0; // horizontal rectangle side
16 | a2 = 0; // vertical rectangle side
17 | smooth = 0;
18 |
19 | // input mesh params
20 | lc = 0; // 0.501 0.201 0.0701;
21 | lc2 = lc/1; // on edges
22 | lc3 = lc/1; // on edges
23 |
24 | hy = dy; // Thickness: Square profile => hy=d
25 | hx = 0.;
26 |
27 | // derived params
28 | r1 = (a1/(2*d_in_nm))*d;
29 | r2 = (a2/(2*d_in_nm))*d;
30 | s2 = r2*smooth;
31 | r1r=r1-s2;
32 | r2r=r2-s2;
33 |
34 | // unit cell
35 | Point(1) = {0, 0, 0, lc}; // first side
36 | Point(2) = {0, -0.5*dy, 0, lc};
37 | Point(3) = {0, -dy, 0, lc};
38 | Point(4) = {0.5*d, -dy, 0,lc};
39 | Point(5) = {d, -dy, 0,lc};
40 | Point(6) = {d, -0.5*dy, 0,lc};
41 | Point(7) = {d, 0, 0,lc};
42 | Point(8) = {0.5*d, 0, 0,lc};
43 | Point(9) = {0.5*d, -0.5*dy, 0,lc2};
44 |
45 | // rectangle
46 | Point(10) = {0.5*d+r1, -0.5*dy, 0,lc2}; // upper right
47 | Point(11) = {0.5*d+r1, -0.5*dy+r2r, 0,lc3};
48 | Point(12) = {0.5*d+r1r, -0.5*dy+r2r, 0,lc2};
49 | Point(13) = {0.5*d+r1r, -0.5*dy+r2, 0,lc3};
50 | Point(14) = {0.5*d, -0.5*dy+r2, 0,lc2};
51 | Point(15) = {0.5*d-r1r, -0.5*dy+r2, 0,lc3}; // upper left
52 | Point(16) = {0.5*d-r1r, -0.5*dy+r2r, 0,lc2};
53 | Point(17) = {0.5*d-r1, -0.5*dy+r2r, 0,lc3};
54 | Point(18) = {0.5*d-r1, -0.5*dy, 0,lc2};
55 | Point(19) = {0.5*d-r1, -0.5*dy-r2r, 0,lc3}; //lower left
56 | Point(20) = {0.5*d-r1r, -0.5*dy-r2r, 0,lc2};
57 | Point(21) = {0.5*d-r1r, -0.5*dy-r2, 0,lc3};
58 | Point(22) = {0.5*d, -0.5*dy-r2, 0,lc2};
59 | Point(23) = {0.5*d+r1r, -0.5*dy-r2, 0,lc3}; //lower rigth
60 | Point(24) = {0.5*d+r1r, -0.5*dy-r2r, 0,lc2};
61 | Point(25) = {0.5*d+r1, -0.5*dy-r2r, 0,lc3};
62 |
63 |
64 | // LINES: unit cell plus crossings
65 | Line(1) = {1,2}; // perimeter
66 | Line(2) = {2,3};
67 | Line(3) = {3,4};
68 | Line(4) = {4,5};
69 | Line(5) = {5,6};
70 | Line(6) = {6,7};
71 | Line(7) = {7,8};
72 | Line(8) = {8,1};
73 | Line(9) = {2,18}; // horizontal diameter
74 | Line(10) = {18,9};
75 | Line(11) = {9,10};
76 | Line(12) = {10,6};
77 | Line(13) = {8,14}; // vertical diameter
78 | Line(14) = {14,9};
79 | Line(15) = {9,22};
80 | Line(16) = {22,4};
81 |
82 | // LINES: rectangle
83 | Line(21) = {10,11};
84 | Ellipse(22) = {11,12,13,13};
85 | Line(23) = {13,14};
86 | Line(24) = {14,15};
87 | Ellipse(25) = {15,16,17,17};
88 | Line(26) = {17,18};
89 | Line(27) = {18,19};
90 | Ellipse(28) = {19,20,21,21};
91 | Line(29) = {21,22};
92 | Line(30) = {22,23};
93 | Ellipse(31) = {23,24,25,25};
94 | Line(32) = {25,10};
95 |
96 | // LINELOOPS: external
97 | Line Loop(41) = {6,7,13,-23,-22,-21,12};
98 | Plane Surface(41) = {41};
99 | Line Loop(42) = {-13,8,1,9,-26,-25,-24};
100 | Plane Surface(42) = {42};
101 | Line Loop(43) = {-16,-29,-28,-27,-9,2,3};
102 | Plane Surface(43) = {43};
103 | Line Loop(44) = {5,-12,-32,-31,-30,16,4};
104 | Plane Surface(44) = {44};
105 |
106 | // LINELOOPS: internal
107 | Line Loop(45) = {32,-11,15,30,31};
108 | Plane Surface(45) = {45};
109 | Line Loop(46) = {21,22,23,14,11};
110 | Plane Surface(46) = {46};
111 | Line Loop(47) = {-14,24,25,26,10};
112 | Plane Surface(47) = {47};
113 | Line Loop(48) = {-15,-10,27,28,29};
114 | Plane Surface(48) = {48};
115 |
116 | //PHYSICAL ENTITIES
117 | Physical Line(1) = {1,2}; // external
118 | Physical Line(2) = {3,4};
119 | Physical Line(3) = {5,6};
120 | Physical Line(4) = {7,8};
121 |
122 | Physical Surface(1) = {41,42,43,44}; //internal
123 | Physical Surface(2) = {45,46,47,48};
124 |
--------------------------------------------------------------------------------
/backend/fortran/normalisation.f:
--------------------------------------------------------------------------------
1 | c
2 | subroutine normalisation (nval, nel, nnodes,
3 | * soln_k1, soln_k2, mat_overlap)
4 | c
5 | implicit none
6 | integer*8 nval, nel, nnodes
7 | complex*16 soln_k1(3,nnodes+7,nval,nel)
8 | complex*16 soln_k2(3,nnodes+7,nval,nel)
9 | complex*16 mat_overlap(nval,nval)
10 | c Local variables
11 | integer*8 i, j
12 | integer*8 iel, ival
13 | complex*16 z_tmp1, z_tmp2
14 | c
15 | do iel=1,nel
16 | do ival=1,nval
17 | z_tmp1 = sqrt(mat_overlap(ival,ival))
18 | if (abs(z_tmp1) .gt. 1.0d-8) then
19 | c z_tmp2 = 1.0d0/z_tmp1
20 | z_tmp2 = 1.0d0/z_tmp1**2
21 | do i=1,nnodes+7
22 | do j=1,3
23 | soln_k1(j,i,ival,iel) =
24 | * soln_k1(j,i,ival,iel) ! * z_tmp2
25 | soln_k2(j,i,ival,iel) =
26 | * soln_k2(j,i,ival,iel) * z_tmp2
27 | enddo
28 | enddo
29 | endif
30 | enddo
31 | enddo
32 | c
33 | return
34 | end
35 |
36 |
--------------------------------------------------------------------------------
/backend/fortran/normalisation_1d.f:
--------------------------------------------------------------------------------
1 | c
2 | subroutine normalisation_1d (nval, nel,
3 | * sol_1, sol_2, mat_overlap)
4 | c
5 | implicit none
6 | integer*8 nval, nel
7 | complex*16 sol_1(3+4+4,nval,nel)
8 | complex*16 sol_2(3+4+4,nval,nel)
9 | complex*16, dimension(nval,nval) :: mat_overlap
10 | c Local variables
11 | integer*8 i, iel, ival
12 | integer*8 nddl_0
13 | parameter (nddl_0 = 11)
14 | complex*16 z_tmp1, z_tmp2
15 | c
16 | do iel=1,nel
17 | do ival=1,nval
18 | z_tmp1 = sqrt(mat_overlap(ival,ival))
19 | if (abs(z_tmp1) .gt. 1.0d-8) then
20 | z_tmp2 = 1.0d0/z_tmp1
21 | C z_tmp2 = 1.0d0/z_tmp1**2
22 | do i=1,nddl_0
23 | sol_1(i,ival,iel) =
24 | * sol_1(i,ival,iel) * z_tmp2
25 | sol_2(i,ival,iel) =
26 | * sol_2(i,ival,iel) * z_tmp2
27 | enddo
28 | endif
29 | enddo
30 | enddo
31 | c
32 | return
33 | end
34 |
35 |
--------------------------------------------------------------------------------
/backend/fortran/phi1_2d_mat.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c phi1_2d_mat evaluates a linear basis function (P3) and its derivative.
5 | c
6 | c P3 basis function over the unit Triangle
7 | c
8 | c
9 | subroutine phi1_2d_mat (x, phi, mat_grad)
10 | c
11 | implicit none
12 | double precision x(2), phi(3), mat_grad(2,3)
13 | double precision x0, y0
14 | integer*8 inode
15 | cccccccccccccccccccccccccccccccccccccccccccccccccccc
16 | c
17 | x0 = x(1)
18 | y0 = x(2)
19 | inode = 1
20 | phi(inode) = 1 - x0 - y0
21 | mat_grad(1,inode) = -1
22 | mat_grad(2,inode) = -1
23 | inode = 2
24 | phi(inode) = x0
25 | mat_grad(1,inode) = 1
26 | mat_grad(2,inode) = 0
27 | inode = 3
28 | phi(inode) = y0
29 | mat_grad(1,inode) = 0
30 | mat_grad(2,inode) = 1
31 | c
32 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
33 | c
34 | return
35 | end
36 |
--------------------------------------------------------------------------------
/backend/fortran/phi2_2d_mat.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c phi2_2d_mat evaluates a linear basis function (P3) and its derivative.
5 | c
6 | c P3 basis function over the unit Triangle
7 | c
8 | c
9 | subroutine phi2_2d_mat (x, phi, mat_grad)
10 | c
11 | implicit none
12 | double precision x(2), phi(6), mat_grad(2,6)
13 | double precision x0, y0
14 | integer*8 inode
15 | cccccccccccccccccccccccccccccccccccccccccccccccccccc
16 | c
17 | x0 = x(1)
18 | y0 = x(2)
19 | inode = 1
20 | phi(inode) = (-1 + x0 + y0)*(-1 + 2*x0 + 2*y0)
21 | mat_grad(1,inode) = -3 + 4*x0 + 4*y0
22 | mat_grad(2,inode) = -3 + 4*x0 + 4*y0
23 | inode = 2
24 | phi(inode) = x0*(-1 + 2*x0)
25 | mat_grad(1,inode) = -1 + 4*x0
26 | mat_grad(2,inode) = 0
27 | inode = 3
28 | phi(inode) = y0*(-1 + 2*y0)
29 | mat_grad(1,inode) = 0
30 | mat_grad(2,inode) = -1 + 4*y0
31 | inode = 4
32 | phi(inode) = -4*x0*(-1 + x0 + y0)
33 | mat_grad(1,inode) = -4*(-1 + 2*x0 + y0)
34 | mat_grad(2,inode) = -4*x0
35 | inode = 5
36 | phi(inode) = 4*x0*y0
37 | mat_grad(1,inode) = 4*y0
38 | mat_grad(2,inode) = 4*x0
39 | inode = 6
40 | phi(inode) = -4*y0*(-1 + x0 + y0)
41 | mat_grad(1,inode) = -4*y0
42 | mat_grad(2,inode) = -4*(-1 + x0 + 2*y0)
43 | c
44 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
45 | c
46 | return
47 | end
48 |
--------------------------------------------------------------------------------
/backend/fortran/phi2_2d_mat_J.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c phi2_2d_mat evaluates a linear basis function (P3) and its derivative.
5 | c
6 | c P3 basis function over the unit Triangle
7 | c
8 | c
9 | subroutine phi2_2d_mat_J (x, phi)
10 | c
11 | implicit none
12 | double precision x(2), phi(6)
13 | double precision x0, y0
14 | integer*8 inode
15 | cccccccccccccccccccccccccccccccccccccccccccccccccccc
16 | c
17 | x0 = x(1)
18 | y0 = x(2)
19 | inode = 1
20 | phi(inode) = (-1 + x0 + y0)*(-1 + 2*x0 + 2*y0)
21 | inode = 2
22 | phi(inode) = x0*(-1 + 2*x0)
23 | inode = 3
24 | phi(inode) = y0*(-1 + 2*y0)
25 | inode = 4
26 | phi(inode) = -4*x0*(-1 + x0 + y0)
27 | inode = 5
28 | phi(inode) = 4*x0*y0
29 | inode = 6
30 | phi(inode) = -4*y0*(-1 + x0 + y0)
31 | c
32 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
33 | c
34 | return
35 | end
36 |
--------------------------------------------------------------------------------
/backend/fortran/phi3_2d_mat.f:
--------------------------------------------------------------------------------
1 | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
2 | c
3 | c
4 | c phi3_2d_mat evaluates a linear basis function (P3) and its derivative.
5 | c
6 | c P3 basis function over the unit Triangle
7 | c
8 | c
9 | subroutine phi3_2d_mat(x, phi, mat_grad)
10 | c
11 | implicit none
12 | double precision x(2), phi(10), mat_grad(2,10)
13 | double precision x0, y0
14 | integer*8 inode
15 | cccccccccccccccccccccccccccccccccccccccccccccccccccc
16 | c
17 | x0 = x(1)
18 | y0 = x(2)
19 | inode = 1
20 | phi(inode) = -((-1 + x0 + y0)*(-2 + 3*x0 + 3*y0)
21 | * *(-1 + 3*x0 + 3*y0))/2.
22 | mat_grad(1,inode) = (-11 - 27*x0**2 + x0*(36 - 54*y0)
23 | * + 36*y0 - 27*y0**2)/2.
24 | mat_grad(2,inode) = (-11 - 27*x0**2 + x0*(36 - 54*y0)
25 | * + 36*y0 - 27*y0**2)/2.
26 | inode = 2
27 | phi(inode) = (x0*(-2 + 3*x0)*(-1 + 3*x0))/2.
28 | mat_grad(1,inode) = 1 - 9*x0 + (27*x0**2)/2.
29 | mat_grad(2,inode) = 0
30 | inode = 3
31 | phi(inode) = (y0*(-2 + 3*y0)*(-1 + 3*y0))/2.
32 | mat_grad(1,inode) = 0
33 | mat_grad(2,inode) = 1 - 9*y0 + (27*y0**2)/2.
34 | inode = 4
35 | phi(inode) = (9*x0*(-1 + x0 + y0)*(-2 + 3*x0 + 3*y0))/2.
36 | mat_grad(1,inode) = (9*(2 + 9*x0**2 - 5*y0 + 3*y0**2
37 | * + 2*x0*(-5 + 6*y0)))/2.
38 | mat_grad(2,inode) = (9*x0*(-5 + 6*x0 + 6*y0))/2.
39 | inode = 5
40 | phi(inode) = (-9*x0*(-1 + 3*x0)*(-1 + x0 + y0))/2.
41 | mat_grad(1,inode) =(-9*(1 + 9*x0**2 - y0 + x0*(-8 + 6*y0)))/2.
42 | mat_grad(2,inode) = (-9*x0*(-1 + 3*x0))/2.
43 | inode = 6
44 | phi(inode) = (9*x0*(-1 + 3*x0)*y0)/2.
45 | mat_grad(1,inode) = (9*(-1 + 6*x0)*y0)/2.
46 | mat_grad(2,inode) = (9*x0*(-1 + 3*x0))/2.
47 | inode = 7
48 | phi(inode) = (9*x0*y0*(-1 + 3*y0))/2.
49 | mat_grad(1,inode) = (9*y0*(-1 + 3*y0))/2.
50 | mat_grad(2,inode) = (9*x0*(-1 + 6*y0))/2.
51 | inode = 8
52 | phi(inode) = (-9*y0*(-1 + x0 + y0)*(-1 + 3*y0))/2.
53 | mat_grad(1,inode) = (-9*y0*(-1 + 3*y0))/2.
54 | mat_grad(2,inode)=(-9*(1 - 8*y0 + 9*y0**2 +x0*(-1 + 6*y0)))/2.
55 | inode = 9
56 | phi(inode) = (9*y0*(-1 + x0 + y0)*(-2 + 3*x0 + 3*y0))/2.
57 | mat_grad(1,inode) = (9*y0*(-5 + 6*x0 + 6*y0))/2.
58 | mat_grad(2,inode) = (9*(2 + 3*x0**2 - 10*y0 + 9*y0**2
59 | * + x0*(-5 + 12*y0)))/2.
60 | inode = 10
61 | phi(inode) = -27*x0*y0*(-1 + x0 + y0)
62 | mat_grad(1,inode) = -27*y0*(-1 + 2*x0 + y0)
63 | mat_grad(2,inode) = -27*x0*(-1 + x0 + 2*y0)
64 | c
65 | ccccccccccccccccccccccccccccccccccccccccccccccccccccc
66 | c
67 | return
68 | end
69 |
--------------------------------------------------------------------------------
/backend/fortran/pw_ordering.f:
--------------------------------------------------------------------------------
1 | C
2 | subroutine pw_ordering (neq_PW, lat_vecs,
3 | * bloch_vec, index_pw_inv,
4 | * debug, ordre_ls, k_0)
5 | C
6 | implicit none
7 | C input output parameters
8 | integer*8 neq_PW, ordre_ls, debug
9 | double precision bloch_vec(2), k_0
10 | double precision lat_vecs(2,2)
11 | integer*8 index_pw_inv(neq_PW)
12 |
13 | C local parameters - purely internal
14 | C
15 | integer alloc_stat
16 | integer*8, dimension(:), allocatable :: index_pw
17 | complex*16, dimension(:), allocatable :: beta_z_pw
18 | integer*8 ui
19 | integer*8 px, py, s, s2
20 | double precision vec_kx, vec_ky, d, dy
21 | double precision bloch1, bloch2, pi, alpha, beta
22 | complex*16 z_tmp
23 | C
24 | CCCCCCCCCCC Start Program CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
25 | C
26 | ui = 6
27 | C
28 | alloc_stat = 0
29 | allocate(index_pw(neq_PW), STAT=alloc_stat)
30 | if (alloc_stat /= 0) then
31 | write(*,*) "pw_ordering: Mem. allocation is unseccesfull"
32 | write(*,*) "alloc_stat (index_pw) = ", alloc_stat
33 | write(*,*) "Aborting..."
34 | stop
35 | endif
36 | allocate(beta_z_pw(neq_PW), STAT=alloc_stat)
37 | if (alloc_stat /= 0) then
38 | write(*,*) "pw_ordering: Mem. allocation is unseccesfull"
39 | write(*,*) "alloc_stat (beta_z_pw) = ", alloc_stat
40 | write(*,*) "Aborting..."
41 | stop
42 | endif
43 | C
44 | d = lat_vecs(1,1)
45 | dy = lat_vecs(2,2)
46 | pi = 3.141592653589793d0
47 | bloch1 = bloch_vec(1)
48 | bloch2 = bloch_vec(2)
49 | vec_kx = 2.0d0*pi/d
50 | vec_ky = 2.0d0*pi/dy
51 | C
52 | CCCCCCCCCCCCCCCCCCCCCCCCCCCC
53 | C Ordering
54 | s = 1
55 | do px = -ordre_ls, ordre_ls
56 | do py = -ordre_ls, ordre_ls
57 | if ((px/d)**2 + (py/dy)**2
58 | * .le. (ordre_ls/MAX(d, dy))**2) then
59 | alpha = bloch1 + vec_kx*px ! Bloch vector along x
60 | beta = bloch2 + vec_ky*py ! Bloch vector along y
61 | z_tmp = k_0**2 - alpha**2 - beta**2
62 | beta_z_pw(s) = sqrt(z_tmp)
63 | s = s + 1
64 | endif
65 | enddo
66 | enddo
67 | C
68 | call z_indexx (neq_PW, beta_z_pw, index_pw)
69 | if (debug .eq. 1) then
70 | write(ui,*) "pw_ordering.f:"
71 | write(ui,*) "index_pw = ", (index_pw(s),s=1,neq_PW)
72 | endif
73 | C
74 | C Inverse of index_pw
75 | do s=1,neq_PW
76 | s2 = index_pw(s)
77 | index_pw_inv(s2) = s
78 | enddo
79 | C
80 | if (debug .eq. 1) then
81 | write(ui,*) "pw_ordering.f: PW k_z = "
82 | do s=1,neq_PW
83 | s2 = index_pw(s)
84 | write(ui,*) beta_z_pw(s2)
85 | enddo
86 | endif
87 | C
88 | deallocate(index_pw)
89 | deallocate(beta_z_pw)
90 | C
91 | return
92 | end
93 |
--------------------------------------------------------------------------------
/backend/fortran/pw_ordering_1d.f:
--------------------------------------------------------------------------------
1 | C
2 | subroutine pw_ordering_1d (neq_PW, period_x,
3 | * bloch_vec_x, bloch_vec_y, index_pw_inv,
4 | * debug, ordre_ls, k_0)
5 | C
6 | implicit none
7 | C input output parameters
8 | integer*8 neq_PW, ordre_ls, debug
9 | double precision k_0, bloch_vec_x, bloch_vec_y
10 | double precision period_x
11 | integer*8 index_pw_inv(neq_PW)
12 | C local parameters - purely internal
13 | C
14 | integer alloc_stat
15 | integer*8, dimension(:), allocatable :: index_pw
16 | complex*16, dimension(:), allocatable :: beta_z_pw
17 | integer*8 ui
18 | integer*8 px, s, s2
19 | double precision vec_kx
20 | double precision bloch1, pi, alpha
21 | complex*16 z_tmp
22 | C
23 | CCCCCCCCCCC Start Program CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
24 | C
25 | ui = 6
26 | C
27 | alloc_stat = 0
28 | allocate(index_pw(neq_PW), STAT=alloc_stat)
29 | if (alloc_stat /= 0) then
30 | write(*,*) "pw_ordering_1d: Mem. allocation is unseccesfull"
31 | write(*,*) "alloc_stat (index_pw) = ", alloc_stat
32 | write(*,*) "Aborting..."
33 | stop
34 | endif
35 | allocate(beta_z_pw(neq_PW), STAT=alloc_stat)
36 | if (alloc_stat /= 0) then
37 | write(*,*) "pw_ordering_1d: Mem. allocation is unseccesfull"
38 | write(*,*) "alloc_stat (beta_z_pw) = ", alloc_stat
39 | write(*,*) "Aborting..."
40 | stop
41 | endif
42 | C
43 | c d = period_x
44 | pi = 3.141592653589793d0
45 | bloch1 = bloch_vec_x
46 | vec_kx = 2.0d0*pi/period_x
47 | C
48 | CCCCCCCCCCCCCCCCCCCCCCCCCCCC
49 | C Ordering
50 | s = 1
51 | do px = -ordre_ls, ordre_ls
52 | alpha = bloch1 + vec_kx*px
53 | z_tmp = k_0**2 - alpha**2 - bloch_vec_y**2
54 | beta_z_pw(s) = sqrt(z_tmp)
55 | s = s + 1
56 | enddo
57 | C
58 | call z_indexx (neq_PW, beta_z_pw, index_pw)
59 | if (debug .eq. 1) then
60 | write(ui,*) "index_pw = ", (index_pw(s),s=1,neq_PW)
61 | endif
62 | C
63 | C Inverse of index_pw
64 | do s=1,neq_PW
65 | s2 = index_pw(s)
66 | index_pw_inv(s2) = s
67 | enddo
68 | C
69 | if (debug .eq. 1) then
70 | do s=1,neq_PW
71 | s2 = index_pw(s)
72 | write(ui,*) beta_z_pw(s2)
73 | enddo
74 | endif
75 | C
76 | deallocate(index_pw)
77 | deallocate(beta_z_pw)
78 | C
79 | return
80 | end
81 |
--------------------------------------------------------------------------------
/backend/fortran/sort_csr.f:
--------------------------------------------------------------------------------
1 |
2 | c
3 | c***********************************************************************
4 | c
5 | subroutine sort_csr (neq, nonz, max_row_len, col_ind,
6 | * row_ptr, arr, indx, istack)
7 | c
8 | implicit none
9 | integer*8 neq, nonz, max_row_len
10 | integer*8 row_ptr(neq+1), col_ind(nonz)
11 | integer*8 arr(max_row_len), indx(max_row_len)
12 | integer*8 istack(max_row_len)
13 | c
14 | integer*8 row_start, row_end, row_len
15 | integer*8 i, j, k
16 | c
17 | do i=1,neq
18 | row_start = row_ptr(i)
19 | row_end = row_ptr(i+1) - 1
20 | row_len = row_end - row_start + 1
21 | cc print*, "sort_csr: i = ", i
22 | do j=row_start,row_end
23 | cc print*, " ", col_ind(j)
24 | k = j - row_start + 1
25 | arr(k) = col_ind(j)
26 | enddo
27 | call sort_int (row_len, arr, indx, istack)
28 | do j=row_start,row_end
29 | k = j - row_start + 1
30 | cc print*, " ", col_ind(j), arr(k), arr(indx(k))
31 | enddo
32 | do j=row_start,row_end
33 | k = j - row_start + 1
34 | col_ind(j) = arr(indx(k))
35 | enddo
36 | enddo
37 |
38 | c
39 | c do i=1,neq
40 | c row_start = row_ptr(i)
41 | c row_end = row_ptr(i+1) - 1
42 | c row_len = row_end - row_start + 1
43 | c print*, "sort_csr: i = ", i
44 | c do j=row_start,row_end
45 | c print*, " #### ", col_ind(j)
46 | c enddo
47 | c enddo
48 | c
49 | c stop
50 | c
51 | return
52 | end
53 |
54 |
--------------------------------------------------------------------------------
/backend/fortran/sort_int.f:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/backend/fortran/sort_int.f
--------------------------------------------------------------------------------
/backend/fortran/sort_n.f:
--------------------------------------------------------------------------------
1 |
2 | c This a modification of the program indexx.f
3 |
4 | c Sort an array in increasing order
5 |
6 | SUBROUTINE sort_n(n,arr,indx)
7 |
8 | INTEGER*8 n,indx(n),M,NSTACK
9 | INTEGER*8 arr(n)
10 | PARAMETER (M=7,NSTACK=50)
11 | INTEGER*8 i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK)
12 | double precision a
13 |
14 | do 11 j=1,n
15 | indx(j)=j
16 | 11 continue
17 | jstack=0
18 | l=1
19 | ir=n
20 | 1 if(ir-l.lt.M)then
21 | do 13 j=l+1,ir
22 | indxt=indx(j)
23 | a=arr(indxt)
24 | do 12 i=j-1,l,-1
25 | if(arr(indx(i)).le.a)goto 2
26 | indx(i+1)=indx(i)
27 | 12 continue
28 | i=l-1
29 | 2 indx(i+1)=indxt
30 | 13 continue
31 | if(jstack.eq.0)return
32 | ir=istack(jstack)
33 | l=istack(jstack-1)
34 | jstack=jstack-2
35 | else
36 | k=(l+ir)/2
37 | itemp=indx(k)
38 | indx(k)=indx(l+1)
39 | indx(l+1)=itemp
40 | if(arr(indx(l)).gt.arr(indx(ir)))then
41 | itemp=indx(l)
42 | indx(l)=indx(ir)
43 | indx(ir)=itemp
44 | endif
45 | if(arr(indx(l+1)).gt.arr(indx(ir)))then
46 | itemp=indx(l+1)
47 | indx(l+1)=indx(ir)
48 | indx(ir)=itemp
49 | endif
50 | if(arr(indx(l)).gt.arr(indx(l+1)))then
51 | itemp=indx(l)
52 | indx(l)=indx(l+1)
53 | indx(l+1)=itemp
54 | endif
55 | i=l+1
56 | j=ir
57 | indxt=indx(l+1)
58 | a=arr(indxt)
59 | 3 continue
60 | i=i+1
61 | if(arr(indx(i)).lt.a)goto 3
62 | 4 continue
63 | j=j-1
64 | if(arr(indx(j)).gt.a)goto 4
65 | if(j.lt.i)goto 5
66 | itemp=indx(i)
67 | indx(i)=indx(j)
68 | indx(j)=itemp
69 | goto 3
70 | 5 indx(l+1)=indx(j)
71 | indx(j)=indxt
72 | jstack=jstack+2
73 | if(jstack.gt.NSTACK) then
74 | write(*,*) 'NSTACK too small in sort_n'
75 | stop
76 | endif
77 | if(ir-i+1.ge.j-l)then
78 | istack(jstack)=ir
79 | istack(jstack-1)=i
80 | ir=j-1
81 | else
82 | istack(jstack)=j-1
83 | istack(jstack-1)=l
84 | l=i
85 | endif
86 | endif
87 | goto 1
88 | END
89 |
--------------------------------------------------------------------------------
/backend/fortran/stat.h:
--------------------------------------------------------------------------------
1 | c %--------------------------------%
2 | c | See stat.doc for documentation |
3 | c %--------------------------------%
4 | c
5 | c\SCCS Information: @(#)
6 | c FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2
7 | c
8 | real t0, t1, t2, t3, t4, t5
9 | save t0, t1, t2, t3, t4, t5
10 | c
11 | integer nopx, nbx, nrorth, nitref, nrstrt
12 | real tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
13 | & tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
14 | & tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
15 | & tmvopx, tmvbx, tgetv0, titref, trvec
16 | common /timing/
17 | & nopx, nbx, nrorth, nitref, nrstrt,
18 | & tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
19 | & tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
20 | & tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
21 | & tmvopx, tmvbx, tgetv0, titref, trvec
22 |
--------------------------------------------------------------------------------
/backend/fortran/type_node_edge_face.f:
--------------------------------------------------------------------------------
1 | c
2 | c***********************************************************************
3 | c
4 | subroutine type_node_edge_face (nel, npt, nnodes, n_ddl,
5 | * type_nod, table_nod, table_N_E_F,
6 | * visite, type_N_E_F, x, x_E_F)
7 | c
8 | c***********************************************************************
9 | c
10 | implicit none
11 | integer*8 nel, npt, nnodes, n_ddl
12 | integer*8 type_nod(npt)
13 | integer*8 table_nod(nnodes,nel), table_N_E_F(14,nel)
14 | integer*8 visite(n_ddl), type_N_E_F(2,n_ddl)
15 | double precision x(2,npt), x_E_F(2,n_ddl)
16 | c Local variables
17 |
18 | integer*8 i, j, j1
19 | integer*8 type_n(10)
20 | c integer*8 list_point_F(6,4)
21 | integer*8 nddl_0
22 | parameter (nddl_0 = 14)
23 | double precision xel(2,6)
24 | c
25 | c***********************************************************************
26 | c
27 | c
28 | if ( nnodes .ne. 6 ) then
29 | write(*,*) "type_node_edge_face: problem nnodes = ", nnodes
30 | write(*,*) "type_node_edge_face: nnodes should be equal to 6 !"
31 | write(*,*) "type_node_edge_face: Aborting..."
32 | stop
33 | endif
34 | c
35 | if ( nnodes .ne. 6 ) then
36 | write(*,*) "type_node_edge_face: problem nnodes = ", nnodes
37 | write(*,*) "type_node_edge_face: nnodes should be equal to 6 !"
38 | write(*,*) "type_node_edge_face: Aborting..."
39 | stop
40 | endif
41 | c
42 | cccccccccccccccccccccccc
43 | c
44 | c Initialisation
45 | do j=1,n_ddl
46 | type_N_E_F(1,j) = 0
47 | type_N_E_F(2,j) = 0
48 | enddo
49 | do i=1,n_ddl
50 | visite(i) = 0
51 | enddo
52 | c
53 | do i=1,nel
54 | do j=1,nnodes
55 | j1 = table_nod(j,i)
56 | type_n(j) = type_nod(j1)
57 | xel(1,j) = x(1,j1)
58 | xel(2,j) = x(2,j1)
59 | enddo
60 | j=1 ! an element is a face
61 | j1 = table_N_E_F(j,i)
62 | x_E_F(1,j1) = (xel(1,1) + xel(1,2) + xel(1,3))/3.0d0 ! centre of the elements
63 | x_E_F(2,j1) = (xel(2,1) + xel(2,2) + xel(2,3))/3.0d0
64 | type_N_E_F(1,j1) = 0 ! Topologically, a face is an interior domain
65 | type_N_E_F(2,j1) = 2 ! Face => dimension two
66 | do j=1,3 ! scan the 3 element edges
67 | j1 = table_N_E_F(j+1,i)
68 | x_E_F(1,j1) = xel(1,j+3)
69 | x_E_F(2,j1) = xel(2,j+3)
70 | if (visite(j1) .eq. 0) then
71 | visite(j1) = 1
72 | type_N_E_F(1,j1) = type_n(j+3)
73 | type_N_E_F(2,j1) = 1 ! Edge => dimension one
74 | endif
75 | enddo
76 | enddo
77 | c
78 | return
79 | end
80 |
--------------------------------------------------------------------------------
/backend/fortran/vector_p2_exp_1d.f:
--------------------------------------------------------------------------------
1 |
2 | C************************************************************************
3 | C
4 | subroutine vector_p2_exp_1d(xmin, xmax, alpha, vecP2Exp)
5 | c
6 | c vecP2Exp(i) = Integrate[lsP2[[i]] Exp[I alpha x], {x, xmin, xmax}]
7 | c
8 | c The exact formula for int_x1^x2 (P_i*exp(I alpha x)) is used when
9 | c alpha is not too small.
10 | c
11 | c The exact formula is numerically unstable for small values of alpha;
12 | c and an asymptotic approximation based on the Taylor formula of
13 | c order 2 is used.
14 | c
15 | C************************************************************************
16 | C
17 | implicit none
18 |
19 | double precision xmin, xmax, alpha
20 | complex*16 vecP2Exp(3)
21 |
22 | C Local parameters:
23 |
24 | double precision fact1, alpha_h
25 | integer*8 dim1, i
26 | complex*16 ii, z_1, z_2, z_3
27 | c
28 | c ii = sqrt(-1)
29 | ii = dcmplx(0.0d0, 1.0d0)
30 |
31 | alpha_h = alpha * (xmax - xmin)
32 | z_1 = Exp(ii*alpha*xmin)
33 | z_2 = Exp(ii*alpha*xmax)
34 | if(abs(alpha_h) > 1.0d-3) then
35 | vecP2Exp(1) = ii*(-4 + alpha_h**2 - 3*alpha_h*ii)*z_1
36 | * + (alpha_h + 4*ii)*z_2
37 | vecP2Exp(2) = (alpha_h - 4*ii)*z_1
38 | * - ii*(-4 + alpha_h**2 + 3*alpha_h*ii)*z_2
39 | vecP2Exp(3) = -4*( 2*ii*(-z_1 + z_2)
40 | * + alpha_h*(z_1 + z_2) )
41 | fact1 = alpha**3*(xmax - xmin)**2
42 | dim1 = 3
43 | do i=1,dim1
44 | vecP2Exp(i) = vecP2Exp(i) / fact1
45 | enddo
46 | else
47 | c Asymptotic approximation
48 | z_3 = Exp(ii*alpha*(xmax+xmin)/2.0d0)
49 | vecP2Exp(1) = (20 + alpha_h**2)*z_1
50 | vecP2Exp(2) = (20 + alpha_h**2)*z_2
51 | vecP2Exp(3) = -2*(-40 + alpha_h**2)*z_3
52 | fact1 = 120/(xmax - xmin)
53 | dim1 = 3
54 | do i=1,dim1
55 | vecP2Exp(i) = vecP2Exp(i) / fact1
56 | enddo
57 | endif
58 | C
59 | end subroutine vector_p2_exp_1d
60 |
61 |
--------------------------------------------------------------------------------
/backend/fortran/vector_p3_exp_1d.f:
--------------------------------------------------------------------------------
1 |
2 | C************************************************************************
3 | C
4 | subroutine vector_p3_exp_1d(xmin, xmax, alpha, vecP3Exp)
5 | c
6 | c vecP3Exp(i) = Integrate[lsP3[[i]] Exp[I alpha x], {x, xmin, xmax}]
7 | c
8 | c The exact formula for int_x1^x2 (P_i*exp(I alpha x)) is used when
9 | c alpha is not too small.
10 | c
11 | c The exact formula is numerically unstable for small values of alpha;
12 | c and an asymptotic approximation based on the Taylor formula of
13 | c order 2 is used.
14 | c
15 | C************************************************************************
16 | C
17 | implicit none
18 |
19 | double precision xmin, xmax, alpha
20 | complex*16 vecP3Exp(4)
21 |
22 | C Local parameters:
23 |
24 | double precision fact1, alpha_h
25 | integer*8 dim1, i
26 | complex*16 ii, z_1, z_2, z_3, z_4
27 | c
28 | c ii = sqrt(-1)
29 | ii = dcmplx(0.0d0, 1.0d0)
30 |
31 | alpha_h = alpha * (xmax - xmin)
32 | z_1 = Exp(ii*alpha*xmin)
33 | z_2 = Exp(ii*alpha*xmax)
34 |
35 | if(abs(alpha_h) > 1.0d-3) then
36 | vecP3Exp(1) = (-54 + 11*alpha_h**2 - 36*alpha_h*ii
37 | * + 2*alpha_h**3*ii)*z_1
38 | * - 2*(-27 + alpha_h**2 + 9*alpha_h*ii)*z_2
39 | vecP3Exp(2) = -2*(-27 + alpha_h**2 - 9*alpha_h*ii)*z_1
40 | * + (-54 + 11*alpha_h**2 + 36*alpha_h*ii
41 | * - 2*alpha_h**3*ii)*z_2
42 | vecP3Exp(3) = 9*(-2*(-9 + alpha_h**2 - 5*alpha_h*ii)*z_1
43 | * + (-18 + alpha_h**2 + 8*alpha_h*ii)*z_2)
44 | vecP3Exp(4) = -9*((18 - alpha_h**2 + 8*alpha_h*ii)*z_1
45 | * + 2*(-9 + alpha_h**2 + 5*alpha_h*ii)*z_2)
46 | fact1 = 2*alpha**4*(xmax - xmin)**3
47 | dim1 = 4
48 | do i=1,dim1
49 | vecP3Exp(i) = vecP3Exp(i) / fact1
50 | enddo
51 | else
52 | c Asymptotic approximation
53 | z_3 = Exp(ii * alpha * (xmax + 2 * xmin) / 3.0d0)
54 | z_4 = Exp(ii * alpha * (2 * xmax + xmin) / 3.0d0)
55 | vecP3Exp(1) = (30 - alpha_h**2 + 4*alpha_h*ii) * z_1
56 | vecP3Exp(2) = (30 - alpha_h**2 - 4*alpha_h*ii) * z_2
57 | vecP3Exp(3) = (90 + alpha_h**2 - 12*alpha_h*ii) * z_3
58 | vecP3Exp(4) = (90 + alpha_h**2 + 12*alpha_h*ii) * z_4
59 | fact1 = 240.0d0/(xmax-xmin)
60 | dim1 = 4
61 | do i=1,dim1
62 | vecP3Exp(i) = vecP3Exp(i) / fact1
63 | enddo
64 | endif
65 | C
66 | end subroutine vector_p3_exp_1d
67 |
68 |
--------------------------------------------------------------------------------
/backend/fortran/write_param.f.bak:
--------------------------------------------------------------------------------
1 | c
2 | c E_H_field = 1 => Electric field formulation (E-Field)
3 | c E_H_field = 2 => Magnetic field formulation (H-Field)
4 | c
5 | c i_cond = 0 => Dirichlet boundary condition
6 | c i_cond = 1 => Neumann boundary condition
7 | c i_cond = 2 => Periodic boundary condition
8 | c
9 | subroutine write_param (E_H_field, lambda, npt, nel, i_cond,
10 | * nval, nvect, itermax, tol, shift, lx, ly,
11 | * mesh_file, mesh_format, n_conv, nb_typ_el, eps_eff,
12 | * bloch_vec, dir_name)
13 | c
14 | c----------------------------------------------------------
15 | c---- write data (lecture des donnees)
16 | c----------------------------------------------------------
17 | c
18 | implicit none
19 | integer*8 E_H_field, npt, nel, i_cond
20 | integer*8 nval, nvect, itermax
21 | integer*8 n_conv, nb_typ_el
22 | double precision lambda, tol, lx, ly
23 | double precision bloch_vec(2)
24 | complex*16 shift
25 | complex*16 eps_eff(nb_typ_el)
26 | integer*8 mesh_format, namelen
27 | character mesh_file*500
28 | character dir_name*500
29 | integer*8 namelength
30 | character*500 tchar1, tchar2, tchar3
31 | c Local variables
32 | integer*8 i
33 | double precision pi
34 | c
35 | pi = 3.141592653589793d0
36 | c
37 | namelength = len_trim(dir_name)
38 | tchar1 = dir_name(1:namelength)//"/param_out.txt"
39 | C
40 | open(3,file=tchar1)
41 | write(3,*) E_H_field, " ! E_H_field"
42 | write(3,*) lambda, " ! lambda"
43 | write(3,*) i_cond, " ! i_cond"
44 | write(3,*) lx, " ! lx"
45 | write(3,*) ly, " ! ly"
46 | write(3,*) nval, " ! nval"
47 | write(3,*) nvect, " ! nvect"
48 | write(3,*) itermax, " ! itermax"
49 | write(3,*) tol, " ! tol"
50 | write(3,12) shift, " ! shift"
51 | write(3,'(a100)') mesh_file
52 | write(3,*) mesh_format, " ! mesh_format"
53 | write(3,*) npt, nel, " ! npt, nel"
54 | write(3,*) n_conv, " ! n_conv"
55 | close(3)
56 | c
57 | tchar2 = dir_name(1:namelength)//"/refrac_index_out.txt"
58 | open (unit=65,file=tchar2)
59 | write(65,*) nb_typ_el
60 | do i=1,nb_typ_el
61 | write(65,12) sqrt(eps_eff(i))
62 | enddo
63 | close(65)
64 | c
65 | tchar3 = dir_name(1:namelength)//"/bloch_vec_out.txt"
66 | open(3,file=tchar3)
67 | write(3,*) bloch_vec(1)/pi, " ! Kx/pi"
68 | write(3,*) bloch_vec(2)/pi, " ! Ky/pi"
69 | close(3)
70 | c
71 | 12 format(6(g25.17) )
72 | c
73 | return
74 | end
75 |
76 |
--------------------------------------------------------------------------------
/backend/fortran/write_sol.f:
--------------------------------------------------------------------------------
1 | c
2 |
3 | subroutine write_sol (nval, nel, nnodes, E_H_field,
4 | * lambda, beta, sol, mesh_file, dir_name)
5 | c
6 | implicit none
7 | integer*8 nval, nel, nnodes, E_H_field
8 | double precision lambda
9 | complex*16 sol(3,nnodes+7,nval,nel)
10 | complex*16 beta(nval)
11 | character mesh_file*500
12 | c Local variables
13 | integer*8 i, iel, ival
14 | integer*8 namelen, namelength, namelen2
15 |
16 | character*11 ivalue, jvalue
17 | character dir_name*500
18 | character*500 tchar1, tchar2
19 | c
20 | namelen = len_trim(mesh_file)
21 | namelength = len_trim(dir_name)
22 |
23 | do ival=1,nval
24 | jvalue = ivalue(ival)
25 | namelen2 = len_trim(jvalue)
26 | tchar1 = dir_name(1:namelength)//"/r_mode_"
27 | * //jvalue(1:namelen2)//".txt"
28 | tchar2 = dir_name(1:namelength)//"/i_mode_"
29 | * //jvalue(1:namelen2)//".txt"
30 | open(63, file=tchar1,
31 | * form="formatted")
32 | open(64, file=tchar2,
33 | * form="formatted")
34 | write(63,*) mesh_file(1:namelen)
35 | write(64,*) mesh_file(1:namelen)
36 | write(63,"((g25.17),2(I7))") lambda, ival, E_H_field
37 | write(64,"((g25.17),2(I7))") lambda, ival, E_H_field
38 | write(63,"(2(g25.17))") beta(ival)
39 | write(64,"(2(g25.17))") beta(ival)
40 | do iel=1,nel
41 | write(63,12) iel, (dble(sol(1,i,ival,iel)),i=1,nnodes+7) ! x-component
42 | write(63,12) iel, (dble(sol(2,i,ival,iel)),i=1,nnodes+7) ! 3-component
43 | write(63,12) iel, (dble(sol(3,i,ival,iel)),i=1,nnodes+7) ! z-component
44 | c
45 | write(64,12) iel, (imag(sol(1,i,ival,iel)),i=1,nnodes+7) ! x-component
46 | write(64,12) iel, (imag(sol(2,i,ival,iel)),i=1,nnodes+7) ! 3-component
47 | write(64,12) iel, (imag(sol(3,i,ival,iel)),i=1,nnodes+7) ! z-component
48 | enddo
49 | close(63)
50 | close(64)
51 | enddo
52 | 12 format(I7,13(g25.17) )
53 | c
54 | return
55 | end
56 |
--------------------------------------------------------------------------------
/backend/fortran/write_sol_P2_1d.f:
--------------------------------------------------------------------------------
1 | c
2 | cccccccccccccccccccccccccccccccccccccccccccccccccc
3 | c
4 |
5 | c sol_P2(1,1..3,nval, nel) contains the values of Ex component at P2 interpolation nodes (3 nodes)
6 | c sol_P2(2,1..3,nval, nel) contains the values of Ey component at P2 interpolation nodes
7 | c sol_P2(3,1..3,nval, nel) contains the values of Ez component at P2 interpolation nodes
8 | c
9 | cccccccccccccccccccccccccccccccccccccccccccccccccc
10 | c
11 | subroutine write_sol_P2_1d (nval, nel, E_H_field,
12 | * lambda, beta, sol_P2, mesh_file, dir_name)
13 | c
14 | cccccccccccccccccccccccccccccccccccccccccccccccccc
15 | c
16 | implicit none
17 | integer*8 nval, nel, E_H_field
18 | double precision lambda
19 | complex*16 sol_P2(3,3,nval,nel), beta(nval)
20 | character mesh_file*500
21 |
22 | c Local variables
23 |
24 | c integer*8 j, inod, iel, ival, debug
25 | c double precision P3_mid_mode_value(4)
26 | c complex*16 z_tmp1, z_tmp2
27 |
28 | c integer*8 nddl_0, nddl_t, dim
29 | c parameter (nnodes_0 = 6)
30 |
31 | integer*8 i, iel, ival, nnodes_P2
32 | integer*8 namelen, namelength, namelen2
33 |
34 | character*11 ivalue, jvalue
35 | character dir_name*500
36 | character*500 tchar1, tchar2
37 | c
38 | c
39 | cccccccccccccccccccccccccccccccccccccccccccccccccc
40 | c
41 | nnodes_P2 = 3
42 | namelen = len_trim(mesh_file)
43 | namelength = len_trim(dir_name)
44 | c
45 | cccccccccccccccccccccccccccccccccccccccccccccccccc
46 | c
47 | c
48 | open (unit=63, file="Matrices/beta.txt",
49 | * status="unknown")
50 | do ival=1,nval
51 | write(63,12) ival, beta(ival)
52 | enddo
53 | close(63)
54 |
55 | do ival=1,nval
56 | jvalue = ivalue(ival)
57 | namelen2 = len_trim(jvalue)
58 | tchar1 = dir_name(1:namelength)//"/Sol_P2/r_mode_P2_"
59 | * //jvalue(1:namelen2)//".txt"
60 | tchar2 = dir_name(1:namelength)//"/Sol_P2/i_mode_P2_"
61 | * //jvalue(1:namelen2)//".txt"
62 | open(63, file=tchar1,
63 | * form="formatted")
64 | open(64, file=tchar2,
65 | * form="formatted")
66 | write(63,*) mesh_file(1:namelen)
67 | write(64,*) mesh_file(1:namelen)
68 | write(63,"((g25.17),2(I7))") lambda, ival, E_H_field
69 | write(64,"((g25.17),2(I7))") lambda, ival, E_H_field
70 | write(63,"(2(g25.17))") beta(ival)
71 | write(64,"(2(g25.17))") beta(ival)
72 | do iel=1,nel
73 | write(63,12) iel, (dble(sol_P2(1,i,ival,iel)),i=1,nnodes_P2) ! x-component
74 | write(63,12) iel, (dble(sol_P2(2,i,ival,iel)),i=1,nnodes_P2) ! y-component
75 | write(63,12) iel, (dble(sol_P2(3,i,ival,iel)),i=1,nnodes_P2) ! z-component
76 | c
77 | write(64,12) iel, (imag(sol_P2(1,i,ival,iel)),i=1,nnodes_P2) ! x-component
78 | write(64,12) iel, (imag(sol_P2(2,i,ival,iel)),i=1,nnodes_P2) ! y-component
79 | write(64,12) iel, (imag(sol_P2(3,i,ival,iel)),i=1,nnodes_P2) ! z-component
80 | enddo
81 | close(63)
82 | close(64)
83 | enddo
84 | c
85 | 12 format(I7,13(g25.17) )
86 | c
87 | return
88 | end
89 |
--------------------------------------------------------------------------------
/backend/fortran/z_indexx.f:
--------------------------------------------------------------------------------
1 | SUBROUTINE z_indexx(n,arr,indx)
2 |
3 | INTEGER*8 n,indx(n),M,NSTACK
4 | complex*16 arr(n)
5 | PARAMETER (M=7,NSTACK=50)
6 | INTEGER*8 i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK)
7 | double precision a
8 | integer :: allocate_status=0
9 | double precision, dimension(:), allocatable :: arr_0
10 | c
11 | C
12 | allocate(arr_0(n), STAT=allocate_status)
13 | if (allocate_status /= 0) then
14 | write(*,*) "The allocation is unsuccessful"
15 | write(*,*) "allocate_status = ", allocate_status
16 | write(*,*) "z_indexx: Not enough memory for arr_0"
17 | write(*,*) "nval = ", n
18 | write(*,*) "Aborting..."
19 | stop
20 | endif
21 | C
22 | do 11 j=1,n
23 | indx(j) = j
24 | 11 continue
25 | c
26 | do j=1,n
27 | arr_0(j) = -1*dble(arr(j)**2)
28 | enddo
29 |
30 | c
31 | jstack=0
32 | l=1
33 | ir=n
34 | 1 if(ir-l.lt.M)then
35 | do 13 j=l+1,ir
36 | indxt=indx(j)
37 | a = arr_0(indxt)
38 | do 12 i=j-1,l,-1
39 | if( arr_0(indx(i)) .le. a)goto 2
40 | indx(i+1)=indx(i)
41 | 12 continue
42 | i=l-1
43 | 2 indx(i+1)=indxt
44 | 13 continue
45 | if(jstack.eq.0)return
46 | ir=istack(jstack)
47 | l=istack(jstack-1)
48 | jstack=jstack-2
49 | else
50 | k=(l+ir)/2
51 | itemp=indx(k)
52 | indx(k)=indx(l+1)
53 | indx(l+1)=itemp
54 | if( arr_0(indx(l)) .gt. arr_0(indx(ir))) then
55 | itemp=indx(l)
56 | indx(l)=indx(ir)
57 | indx(ir)=itemp
58 | endif
59 | if( arr_0(indx(l+1)) .gt. arr_0(indx(ir))) then
60 | itemp=indx(l+1)
61 | indx(l+1)=indx(ir)
62 | indx(ir)=itemp
63 | endif
64 | if( arr_0(indx(l)) .gt. arr_0(indx(l+1))) then
65 | itemp=indx(l)
66 | indx(l)=indx(l+1)
67 | indx(l+1)=itemp
68 | endif
69 | i=l+1
70 | j=ir
71 | indxt=indx(l+1)
72 | a = arr_0(indxt)
73 | 3 continue
74 | i=i+1
75 | if( arr_0(indx(i)) .lt. a)goto 3
76 | 4 continue
77 | j=j-1
78 | if( arr_0(indx(j)) .gt. a)goto 4
79 | if(j.lt.i)goto 5
80 | itemp=indx(i)
81 | indx(i)=indx(j)
82 | indx(j)=itemp
83 | goto 3
84 | 5 indx(l+1)=indx(j)
85 | indx(j)=indxt
86 | jstack=jstack+2
87 | C if(jstack.gt.NSTACK)pause 'NSTACK too small in indexx'
88 | if(jstack.gt.NSTACK) then
89 | write(*,*) 'NSTACK too small in indexx'
90 | write(*,*) "z_indexx: Aborting..."
91 | stop
92 | endif
93 | if(ir-i+1.ge.j-l)then
94 | istack(jstack)=ir
95 | istack(jstack-1)=i
96 | ir=j-1
97 | else
98 | istack(jstack)=j-1
99 | istack(jstack-1)=l
100 | l=i
101 | endif
102 | endif
103 | goto 1
104 | C
105 | deallocate(arr_0)
106 | END
107 |
--------------------------------------------------------------------------------
/backend/fortran/z_mxv_csc_64.f:
--------------------------------------------------------------------------------
1 | c
2 | c***********************************************************************
3 | c
4 | c Compute the product of a matrix in CSC format by a vector
5 | c
6 | c***********************************************************************
7 | c
8 |
9 | subroutine z_mxv_csc (neq, vect1, vect2,
10 | * nonz, row_ind, col_ptr, mat)
11 | c
12 | c***********************************************************************
13 | c
14 | implicit none
15 | integer*8 neq, nonz
16 | integer*8 row_ind(nonz), col_ptr(neq+1)
17 | complex*16 mat(nonz)
18 | complex*16 vect1(neq), vect2(neq)
19 | c
20 | c Local variables
21 | integer*8 i, j, k, col_start, col_end, i_base
22 | c
23 | do i=1,neq
24 | vect2(i) = 0.d0
25 | enddo
26 | c
27 | c valpr.f has changed the CSC indexing to 0-based indexing
28 | c so we must add 1 to the CSD row_pointer row_ind
29 | i_base = 1
30 | c
31 | do i=1,neq ! Column index
32 | col_start = col_ptr(i) + i_base
33 | col_end = col_ptr(i+1) - 1 + i_base
34 | do j=col_start,col_end
35 | k = row_ind(j) + i_base ! Row number
36 | c ! mat(j) = value of the matrix entry (k,i)
37 | vect2(k) = vect2(k) + mat(j)*vect1(i)
38 | enddo
39 | enddo
40 | c
41 | return
42 | end
43 |
--------------------------------------------------------------------------------
/backend/paths.py:
--------------------------------------------------------------------------------
1 | """
2 | paths.py contais all the relevant paths for the operation of the
3 | code. When path are assigned their default values, EMUstack code
4 | can only be executed from 'EMUstack/subfolder'. An appropriate
5 | modification of the path values with absolute paths allows for
6 | code execution from an arbitrary folder.
7 |
8 |
9 |
10 | Copyright (C) 2015 Bjorn Sturmberg, Kokou Dossou, Felix Lawrence
11 |
12 | EMUstack is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU General Public License as published by
14 | the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | This program is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU General Public License for more details.
21 |
22 | You should have received a copy of the GNU General Public License
23 | along with this program. If not, see .
24 | """
25 |
26 | # where the python and fortran backend code is placed
27 | backend_path = '../backend'
28 |
29 | # folder containing relevant data as the optical constants
30 | data_path = '../backend/data/'
31 |
32 | # where template.geo files for mesh creation are store
33 | template_path = '../backend/fortran/msh/'
34 |
35 | # where existing .msh and .mail files are stored and
36 | # new .msh and .mail files are created
37 | msh_path = '../backend/fortran/msh/'
38 |
--------------------------------------------------------------------------------
/dependencies.txt:
--------------------------------------------------------------------------------
1 | python-numpy
2 | python-scipy
3 | python-matplotlib
4 | python-nose
5 | gfortran
6 | make
7 | gmsh
8 | libatlas-dev
9 | libblas-dev
10 | liblapack-dev
11 | libsuitesparse-dev
12 |
--------------------------------------------------------------------------------
/docs/build/latex/EMUstack.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/docs/build/latex/EMUstack.pdf
--------------------------------------------------------------------------------
/docs/requirements.txt:
--------------------------------------------------------------------------------
1 | MarkupSafe==0.15
2 | Sphinx==1.2.2
3 | sphinxcontrib-napoleon==0.2.8
4 |
--------------------------------------------------------------------------------
/docs/source/fem_1d.rst:
--------------------------------------------------------------------------------
1 | 1D FEM Mode Solver
2 | ====================
3 |
4 | 1D Mesh
5 | --------
6 |
7 | 1D FEM mesh are created by the python subroutine objects.make_mesh() and passed directly into the fortran routine 'py_calc_modes.f'.
8 | The only parameter that influences this process is **'lc_bkg'**, where **1 / lc_bkg** is the number of FEM elements that the unit cell is divided into.
9 |
10 | For a single inclusion the mesh is simply::
11 |
12 | | period |
13 |
14 | |--------------------| 1 |--------------------|
15 |
16 | where the inclusion has 'diameter1' as is made of material 'inclusion_a'.
17 |
18 | For a grating with 2 inclusions in the unit cell the spacing between the surfaces of the inclusions is set with the **'small_space'** parameter.::
19 |
20 | | period |
21 | | small_space |
22 | |2|----------------| 1 |--------------| 2 |
23 |
24 | Inclusion1 will always be centered and of material 'inclusion_a', while all higher order inclusions are made of material 'inclusion_b'.
25 |
26 | For unit cells that contain 3 or more inclusions there are 2 implemented spacing options.
27 | By **default 'edge_spacing = False'** and the centers of all inclusions are equally spaced, with inclusion1 centered in the middle of the unit cell. ::
28 |
29 | | | equally | seperated | |
30 | |--| 2 |------| 1 |---------| 3 |-----|
31 |
32 | The alternative is to space the inclusions with equal distances between their surfaces. This is selected with the keyword argument **'edge_spacing = True'**::
33 |
34 | | | |equally | |seperat-| | ed |
35 | |--| 2 |--------| 1 |--------| 3 |------|
36 |
37 | EMUstack can at present create mesh with up to 6 inclusions.
38 | It is straightforward to extended this.
39 |
--------------------------------------------------------------------------------
/docs/source/fem_2d.rst:
--------------------------------------------------------------------------------
1 | 2D FEM Mode Solver
2 | ====================
3 |
4 | 2D Mesh
5 | --------
6 |
7 | 2D FEM mesh are created using the open source program `gmsh `_.
8 | In general they are created automatically by EMUstack using the templates files for each inclusion shape. These are stored in backend/fortran/msh. For an up to date list of templates see the 'inc_shape' entry in the NanoStruct docstring.
9 |
10 | An advantage of using the FEM to calculate the modes of layers is that there is absolutely no constraints on the content of the unit cell. If you wish to create a different structure this can be done using gmsh, which is also used to view the mesh files (select files with the extension .msh).
11 |
12 | Note that the area of the unit cell must always be unity! This has been assumed throughout the theoretical derivations.
13 |
14 | A guide to making your own mesh from scratch is presented `here `_. While the geometry in this example is different from those typically examined with EMUstack, the process is the same.
15 |
16 | Note that the Physical Surface numbers set in the .geo file must map onto the following array in EMUstack ::
17 |
18 | self.n_effs = np.array([st.background.n(wl), st.inclusion_a.n(wl),
19 | st.inclusion_b.n(wl), st.inclusion_c.n(wl),
20 | st.inclusion_d.n(wl), st.inclusion_e.n(wl)])
21 |
22 | So, for example, Physical Surface(1) is st.background and Physical Surface(2) is inclusion_a.
23 |
24 |
25 | FEM Errors
26 | -----------
27 |
28 | There are 2 errors that can be easily triggered within the Fortran FEM routines. These both cause them to simulation to abort and the terminal to be unresponsive (until you kill python or the screen session as described in :ref:`screen_sesh`).
29 |
30 | The first of these is ::
31 |
32 | Error with _naupd, info_32 = -3
33 | Check the documentation in _naupd.
34 | Aborting...
35 |
36 | Long story short, this indicates that the FEM mesh is too coarse for solutions for higher order Bloch modes (Eigenvaules) to converge. To see this run the simulation with FEM_debug = 1 (in mode_calcs.py) and it will print the number of converged Eigenvalues nconv != nval.
37 | This error is easily fixed by increasing the mesh resolution. Decrease 'lc_bkg' and/or increase 'lc2' etc.
38 |
39 |
40 | The second error is ::
41 |
42 | Error with _naupd, info_32 = -8
43 | Check the documentation in _naupd.
44 | Aborting...
45 |
46 | This is the opposite problem, when the mesh is so fine that the simulation is overloading the memory of the machine. More accurately the memory depends on the number of Eigenvalues being calculated as well as the number of FEM mesh points.
47 | The best solution to this is to increase 'lc_bkg' and/or decrease 'lc2' etc.
--------------------------------------------------------------------------------
/docs/source/index.rst:
--------------------------------------------------------------------------------
1 | .. EMUstack documentation master file, created by
2 | sphinx-quickstart on Sat Jun 14 14:17:22 2014.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | Welcome to EMUstack's documentation!
7 | ====================================
8 |
9 |
10 | ==================
11 | Introduction
12 | ==================
13 |
14 | .. toctree::
15 | :maxdepth: 4
16 |
17 | intro
18 |
19 |
20 | ==================
21 | Installation
22 | ==================
23 |
24 | .. toctree::
25 | :maxdepth: 4
26 |
27 | install
28 |
29 | ==================
30 | Guide
31 | ==================
32 |
33 | .. toctree::
34 | :maxdepth: 4
35 |
36 | tutorial
37 |
38 |
39 | ==================
40 | Python Backend
41 | ==================
42 |
43 | .. toctree::
44 | :maxdepth: 4
45 |
46 | objects
47 | materials
48 | mode_calcs
49 | stack
50 | plotting
51 |
52 | ==================
53 | Fortran Backends
54 | ==================
55 |
56 | The intention of EMUstack is that the Fortran FEM routines are essentially black boxes. They are called from mode_calcs.py and return the modes (Eigenvalues) of a structured layer, as well as some matrices of overlap integrals that are then used to compute the scattering matrices.
57 |
58 | There are however a few important things to know about the workings of these routines.
59 |
60 | .. toctree::
61 | :maxdepth: 4
62 |
63 | fem_1d
64 | fem_2d
65 |
66 |
67 |
68 |
69 | ==================
70 | Indices and tables
71 | ==================
72 |
73 | * :ref:`genindex`
74 | * :ref:`modindex`
75 | * :ref:`search`
76 |
77 |
--------------------------------------------------------------------------------
/docs/source/intro.rst:
--------------------------------------------------------------------------------
1 | .. role:: raw-math(raw)
2 | :format: latex html
3 |
4 | Introduction
5 | ================
6 |
7 | EMUstack is an open-source simulation package for calculating light propagation through multi-layered stacks of dispersive, lossy, nanostructured, optical media. It implements a generalised scattering matrix method, which extends the physical intuition of thin film optics to complex structures.
8 |
9 | At the heart of the scattering matrix approach is the requirement that each layer is uniform in one direction, here labelled *z*. In this nomenclature the incident field is unconstrained in :raw-math:`$ k_{\parallel} = k_{x,y} $` but must have :raw-math:`$ k_{\perp} = k_z \ne 0 $`.
10 |
11 | In-plane each layer can be homogeneous, periodic in x or y, or double periodic (periodic in x and y). The modes of periodic (structured layers) are calculated using the Finite Element Method in respectively 1 or 2 dimensions, while the modes of homogeneous media are calculated analytically. This approach maximises the speed and accuracy of the calculations.
12 | These layers can be stacked in arbitrary order.
13 |
14 | An advantage of EMUstack over other scattering matrix methods (for example `CAMFR `_) is that the fields in each layer are considered in their natural basis with transmission scattering matrices converting fields between them. The fields in homogeneous layers are expressed in terms of plane waves, while the natural basis in the periodically structured layers are Bloch modes. Expressing fields in their natural basis gives the terms of the scattering matrices intuitive meaning, providing access to greater physical insights. It is also advantages for the speed and accuracy of the numerical method.
15 |
16 | EMUstack has been designed to handle lossy media with dispersive refractive indices, with the complex refractive index at each frequency being taken directly from tabulated results of experimental measurements. This is an advantage of frequency domain methods over time domain methods such as the Finite Difference Time Domain (FDTD) where refractive indices are included by analytic approximations such as the Drude model. It is also possible to include media with lossless and/or non-dispersive refractive indices and EMUstack comes with a built in Drude model.
17 |
18 | Taking full advantage of the boundary-element nature of the scattering matrix method it is possible to vary the thickness of a layer by a single, numerically inexpensive, matrix multiplication. Furthermore, EMUstack recognises when interfaces are repeated so that their scattering matrices need not be recalculated but rather just retrieved from memory, which takes practically no computation time.
19 |
20 | EMUstack is a completely open source package, utilising free, open source compilers, meshing programs and libraries.
21 | All user interaction with EMUstack is done using the dynamic and easy to script language of python.
22 | The low-level numerical routines are written in Fortran for optimal performance making use of the LAPACK, ARPACK, and UMFPACK libraries. The Fortran routines are compiled as python subroutines using f2py.
23 | EMUstack currently comes with template FEM mesh for 1D and 2D gratings, Nanowire/Nanohole arrays, elliptical inclusions and split ring resonators. The mesh of other structures may be easily created using the open source program `gmsh `_.
24 |
--------------------------------------------------------------------------------
/docs/source/materials.rst:
--------------------------------------------------------------------------------
1 | materials module
2 | ================
3 |
4 | .. automodule:: materials
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/docs/source/mode_calcs.rst:
--------------------------------------------------------------------------------
1 | mode_calcs module
2 | =================
3 |
4 | .. automodule:: mode_calcs
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/docs/source/objects.rst:
--------------------------------------------------------------------------------
1 | objects module
2 | ==============
3 |
4 | .. automodule:: objects
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/docs/source/plotting.rst:
--------------------------------------------------------------------------------
1 | plotting module
2 | ===============
3 |
4 | .. automodule:: plotting
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/docs/source/screen_sesh.rst:
--------------------------------------------------------------------------------
1 | .. _screen_sesh:
2 |
3 | Screen Sessions
4 | ------------------------------------------------
5 | ::
6 |
7 | screen
8 |
9 | is an extremely useful little linux command. In the context of long-ish calculations it has two important applications; ensuring your calculation is unaffected if your connection to a remote machine breaks, and terminating calculations that have hung without closing the terminal.
10 | For more information see the manual::
11 |
12 | $ man screen
13 |
14 | or see online discussions `here `_, `and here `_.
15 |
16 |
17 | The screen session or also called screen instance looks just like your regular terminal/putty, but you can disconnect from it (close putty, turn off your computer etc.) and later reconnect to the screen session and everything inside of this will have kept running. You can also reconnect to the session from a different computer via ssh.
18 |
19 | Basic Usage
20 | ,,,,,,,,,,,,,,,,,,,,,
21 |
22 | To install screen::
23 |
24 | $ sudo apt-get install screen
25 |
26 | To open a new screen session::
27 |
28 | $ screen
29 |
30 | We can start a new calculation here::
31 |
32 | $ cd EMUstack/examples/
33 | $ python simo_040-2D_array.py
34 |
35 | We can then detach from the session (leaving everything in the screen running) by typing::
36 |
37 | Ctrl +a
38 | Ctrl +d
39 |
40 | We can now monitor the processes in that session::
41 |
42 | $ top
43 |
44 | Where we note the numerous running python processes that EMUstack has started. Watching the number of processes is useful for checking if a long simulation is near completion (which is indicated by the number of processes dropping to less than the specified num_cores).
45 |
46 | We could now start another screen and run some more calculations in this terminal (or do anything else).
47 | If we want to access the first session we 'reattach' by typing::
48 |
49 | Ctrl +a +r
50 |
51 | Or entering the following into the terminal::
52 |
53 | $ screen -r
54 |
55 | If there are multiple sessions use::
56 |
57 | $ screen -ls
58 |
59 | to get a listing of the sessions and their ID numbers. To reattach to a particular screen, with ID 1221::
60 |
61 | $ screen -r 1221
62 |
63 | To terminate a screen from within type::
64 |
65 | Ctrl+d
66 |
67 | Or, taking the session ID from the previous example::
68 |
69 | screen -X -S 1221 kill
70 |
71 |
72 |
73 | Terminating EMU stacks
74 | ,,,,,,,,,,,,,,,,,,,,,,,
75 |
76 |
77 | If (for some estranged reason) a simulation hangs, we can kill all python instances upon the machine::
78 |
79 | $ pkill python
80 |
81 | If a calculation hangs from within a screen session one must first detach from that session then kill python. A more targeted way to kill processes is using their PID::
82 |
83 | $ kill PID
84 |
85 | Or if this does not suffice be a little more forceful::
86 |
87 | $ kill -9 PID
88 |
89 | The PID is found from one of two ways::
90 |
91 | $ top
92 | $ ps -fe | grep username
93 |
94 |
95 |
--------------------------------------------------------------------------------
/docs/source/stack.rst:
--------------------------------------------------------------------------------
1 | stack module
2 | ============
3 |
4 | .. automodule:: stack
5 | :members:
6 | :undoc-members:
7 | :show-inheritance:
8 |
--------------------------------------------------------------------------------
/overrides.json:
--------------------------------------------------------------------------------
1 | {
2 | "@jupyterlab/apputils-extension:themes": {
3 | "theme": "JupyterLab Dark"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/reload_simo/simo_reload.py:
--------------------------------------------------------------------------------
1 | """
2 | Reload simulation results for further manipulation.
3 |
4 | Sample script illustrating how to reload simulation objects from .npz files.
5 | Once you have access to the objects you can do everything you forgot to at runtime,
6 | eg. plot different spectra, plot using routines you didn't have at runtime,
7 | view/print/export particular quantities.
8 | """
9 |
10 | import numpy as np
11 | import sys
12 | sys.path.append("../backend/")
13 |
14 | import objects
15 | import materials
16 | import plotting
17 | from stack import *
18 |
19 | directory = 'single_grating'
20 | npz_file = 'Simo_results'
21 | data = np.load('../'+directory+'/'+npz_file+'.npz')
22 | stacks_list = data['stacks_list']
23 |
24 | #### stacks_list is now just like in the original simo.py ####
25 |
26 | # plotting.t_r_a_plots(stacks_list)
27 |
28 | plotting.evanescent_merit(stacks_list, lay_interest=0, save_mean_ev=True)
29 | plotting.evanescent_merit(stacks_list, lay_interest=1, save_mean_ev=True)
30 |
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function makeEMUs() {
4 | ## compile Fortran routines
5 | cd backend/fortran/
6 | make
7 | ## run tests
8 | cd ../../tests/
9 | nosetests
10 |
11 | ##
12 | echo ''
13 | echo '#####################################################################'
14 | echo ' EMUstack and its dependencies have been installed '
15 | echo ' Last tests may give errors if not using Ubuntu 12.04, gmsh 2.5 '
16 | echo ' ... as long as the tests run, things are okay. '
17 | echo ''
18 | echo 'EMUstack is brought to you by Bjorn Sturmberg, Kokou Dossou,'
19 | echo 'Felix Lawrence and Lindsay Botton, with support from CUDOS and ARENA'
20 | echo '#####################################################################'
21 | echo ''
22 |
23 | }
24 |
25 | makeEMUs
26 |
27 |
--------------------------------------------------------------------------------
/tests/ref/case_0.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_0.npz
--------------------------------------------------------------------------------
/tests/ref/case_0/Absorptance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.94353377280 600.00000000000
2 | 700.00000000000 0.70869114139 600.00000000000
3 | 1000.00000000000 0.46486111643 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Efficiency_stack0001.txt:
--------------------------------------------------------------------------------
1 | 0.152764
2 | 200
3 | 50
4 |
5 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Absorb_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.80425221759 600.00000000000
2 | 700.00000000000 0.05684121619 600.00000000000
3 | 1000.00000000000 0.00467313726 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Absorb_1_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.05383748127 600.00000000000
2 | 700.00000000000 0.18387871295 600.00000000000
3 | 1000.00000000000 0.10543900389 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Absorb_2_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.07860536863 600.00000000000
2 | 700.00000000000 0.04401773546 600.00000000000
3 | 1000.00000000000 0.00387423566 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Absorb_3_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.00652521385 600.00000000000
2 | 700.00000000000 0.41522371726 600.00000000000
3 | 1000.00000000000 0.34422582262 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Absorb_4_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.00031349146 600.00000000000
2 | 700.00000000000 0.00872975954 600.00000000000
3 | 1000.00000000000 0.00664891700 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Trans_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.13930838822 600.00000000000
2 | 700.00000000000 0.65199611624 600.00000000000
3 | 1000.00000000000 0.46027295771 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Trans_1_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.09058337793 600.00000000000
2 | 700.00000000000 0.66040173376 600.00000000000
3 | 1000.00000000000 0.76317224224 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Trans_2_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.04928302173 600.00000000000
2 | 700.00000000000 0.65046348785 600.00000000000
3 | 1000.00000000000 0.76250344993 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Trans_3_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.00398175809 600.00000000000
2 | 700.00000000000 0.01896094978 600.00000000000
3 | 1000.00000000000 0.01897759633 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Lay_Trans_4_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.00390836305 600.00000000000
2 | 700.00000000000 0.00034470914 600.00000000000
3 | 1000.00000000000 0.00024213190 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Reflectance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.05643939418 600.00000000000
2 | 700.00000000000 0.29116266757 600.00000000000
3 | 1000.00000000000 0.53505390503 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_0/Transmittance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 400.00000000000 0.00002683302 600.00000000000
2 | 700.00000000000 0.00014619103 600.00000000000
3 | 1000.00000000000 0.00008497854 600.00000000000
4 |
--------------------------------------------------------------------------------
/tests/ref/case_1.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_1.npz
--------------------------------------------------------------------------------
/tests/ref/case_1/Absorptance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.09242231135 2330.00000000000
2 | 1000.00000000000 0.00038188860 2330.00000000000
3 |
--------------------------------------------------------------------------------
/tests/ref/case_1/Efficiency_stack0001.txt:
--------------------------------------------------------------------------------
1 | 0.017261
2 | 600
3 | 120
4 |
5 |
--------------------------------------------------------------------------------
/tests/ref/case_1/Lay_Absorb_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.09242231135 2330.00000000000
2 | 1000.00000000000 0.00038188860 2330.00000000000
3 |
--------------------------------------------------------------------------------
/tests/ref/case_1/Lay_Trans_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.86827952047 2330.00000000000
2 | 1000.00000000000 0.96728672886 2330.00000000000
3 |
--------------------------------------------------------------------------------
/tests/ref/case_1/Reflectance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.03929816818 2330.00000000000
2 | 1000.00000000000 0.03233138254 2330.00000000000
3 |
--------------------------------------------------------------------------------
/tests/ref/case_1/Transmittance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.86827952047 2330.00000000000
2 | 1000.00000000000 0.96728672886 2330.00000000000
3 |
--------------------------------------------------------------------------------
/tests/ref/case_2.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_2.npz
--------------------------------------------------------------------------------
/tests/ref/case_2/Absorptance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.09363860562 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_2/Lay_Absorb_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.09363860562 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_2/Lay_Trans_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.88236377030 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_2/Reflectance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.02399762409 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_2/Transmittance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 500.00000000000 0.88236377030 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_3.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_3.npz
--------------------------------------------------------------------------------
/tests/ref/case_3/Absorptance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 700.00000000000 0.71252767398 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_3/Efficiency_stack0001.txt:
--------------------------------------------------------------------------------
1 | 0.152764
2 | 200
3 | 50
4 |
5 |
--------------------------------------------------------------------------------
/tests/ref/case_3/Lay_Absorb_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 700.00000000000 0.71252767398 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_3/Lay_Trans_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 700.00000000000 0.28665913941 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_3/Reflectance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 700.00000000000 0.00081318662 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_3/Transmittance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 700.00000000000 0.28665913941 2330.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_4.npz
--------------------------------------------------------------------------------
/tests/ref/case_4/Absorptance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.00000000000 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Lay_Absorb_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.00000000000 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Lay_Absorb_1_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.00000000000 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Lay_Trans_0_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.39330879007 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Lay_Trans_1_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 1.00000000000 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Reflectance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.60669120993 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_4/Transmittance_stack0001.txt:
--------------------------------------------------------------------------------
1 | 800.00000000000 0.39330879007 1050.00000000000
2 |
--------------------------------------------------------------------------------
/tests/ref/case_5.npz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjornsturmberg/EMUstack/815637ed4a49f18df50498b00244718cb5141a3a/tests/ref/case_5.npz
--------------------------------------------------------------------------------
/tests/testing.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from numpy.testing import assert_allclose as assert_ac
3 |
4 | from objects import Simmo
5 | from os import system as ossys
6 |
7 | def save_reference_data(casefile_name, stack_list):
8 | ref_stack_list = []
9 | for stack in stack_list:
10 | rstack = {'layers' : []}
11 | for lay in stack.layers:
12 | rlay = {}
13 | rlay['R12'] = lay.R12
14 | rlay['T12'] = lay.T12
15 | rlay['R21'] = lay.R21
16 | rlay['T21'] = lay.T21
17 | rlay['k_z'] = lay.k_z
18 | if isinstance(rlay, Simmo):
19 | rlay['sol1'] = lay.sol1
20 | rstack['layers'].append(rlay)
21 | rstack['R_net'] = stack.R_net
22 | rstack['T_net'] = stack.T_net
23 | ref_stack_list.append(rstack)
24 | np.savez_compressed("ref/%s.npz" % casefile_name,
25 | stack_list = ref_stack_list)
26 |
27 | cp_cmd = 'cp *.txt ref/%s/' % casefile_name
28 | ossys(cp_cmd)
29 |
30 | assert False, "Reference results saved successfully, \
31 | but tests will now pass trivially so let's not run them now."
32 |
--------------------------------------------------------------------------------