• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

fermisurfer Git


Commit MetaInfo

Revisionab1824b79c065deee51ca90ce0ddf83c9dbe4c5d (tree)
Time2021-02-22 15:57:38
AuthorMitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

Backup

Change Summary

Incremental Difference

--- a/doc/index.html
+++ b/doc/index.html
@@ -1,4 +1,4 @@
1-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
22 <html lang="ja">
33 <head>
44 <meta name="Content-Language" content="ja">
--- a/examples/frmsf.in
+++ b/examples/frmsf.in
@@ -1,4 +1,5 @@
1-# background black
1+backgroundcolor 1 1 0
2+linecolor 0 0 1
23 band 0 0 1
34 #brillouinzone primitive
45 colorbar 1
--- a/javascript/fermisurfer.html
+++ b/javascript/fermisurfer.html
@@ -2,6 +2,7 @@
22 <html>
33 <head>
44 <title>FermiSurfer on Web</title>
5+ <link rel="shortcut icon" href="../figs/fermisurfer.ico" type="image/vnd.microsoft.icon">
56 <script src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js"
67 integrity="sha512-zhHQR0/H5SEBL3Wn6yYSaTTZej12z0hVZKOv3TwCUXT1z5qeqGcXJLLrbERYRScEDDpYIJhPC1fk31gqR783iQ=="
78 crossorigin="anonymous" defer>
--- a/javascript/fermisurfer.js
+++ b/javascript/fermisurfer.js
@@ -21,10 +21,177 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222 THE SOFTWARE.
2323 */
24-let gl; //test
25-let programInfo;
26-let rotatex = 0.0, rotatey = 0.0;
24+/**@file
25+ @brief Main routine
26+*/
27+/**@mainpage FermiSurfer Main Page
28+
29+Fermisurfer displays Fermi surfaces
30+with a color-plot of the arbitraly matrix element
31+
32+@section Notation
33+
34+- @f$\varepsilon_{n k}@f$ : Energy
35+- @f$\Delta_{n k}@f$ : Any @f$(n, k)@f$-dependent value for the color-plot.
36+- @f$N_b@f$ : Number of bands
37+
38+@section sec_routine Important routines
39+- Main routine: main()
40+- Right click menu : FS_CreateMenu(), FS_ModifyMenu(let status)
41+
42+@section sec_file Important files
43+- Main routine : fermisurfer.cpp
44+- Global valiable : variable.hpp
45+
46+@section sec_flow Flow
47+
48+- main() :
49+ - read_file() : Read .frmsf file
50+ - compute_patch_segment() : Compute patch and segment
51+ - fermi_patch() : Compute patches constructing Fermi surface
52+ - display() : Display figures with OpenGL
53+
54+*/
55+/*
56+ Input variables
57+*/
58+let ng0 = [0, 0, 0]; //!< @f$k@f$-point grid in the input file
59+let shiftk = [0, 0, 0]; //!< Wherether @f$k@f$-grid is shifted or not
60+let nb = 0; //!< The number of Bands
61+let avec = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< Direct lattice vector
62+let bvec = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< Reciprocal lattice vector
63+let eig0 = []; //!< Eigenvalues @f$\varepsilon_{n k}@f$[::nb][::ng0[0]][::ng0[1]][::ng0[2]]
64+let mat0 = []; //!< Matrix element [::nb][::ng0[0]][::ng0[1]][::ng0[2]][3]
65+/*
66+ Interpolation
67+*/
68+let ng = [0, 0, 0]; //!< @b Interpolated @f$k@f$-grids
69+let eig = []; //!< Eigenvalues @f$\varepsilon_{n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]]
70+let mat = []; //!< Matrix element @f$\delta_{n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]][3]
71+let vf = []; //!< Matrix element @f$\{\bf v}_{{\rm f} n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]][3]
72+let interpol = 1; //!< Ratio of interpolation
73+/*
74+ Switch for some modes
75+*/
76+let color_scale = 1; //!< Switch for full color scale mode
77+let fbz = 1; //!< Switch for 1st Brillouin zone mode
78+let nodeline = 0; //!< Switch for node lines
79+let lcolorbar = 1; //!< Switch for colorbar
80+let lstereo = 1; //!< Switch for the stereogram
81+let lmouse = 1; //!< Switch for the mouse function
82+let lsection = 0; //!< Switch for the 2D Fermi lines
83+let lequator = 0; //!< Switch for equator
84+let BZ_number = [1, 1, 1];
85+/*
86+ Variables for Brillouin zone boundaries
87+*/
88+let nbzl = 1; //!< The number of Lines of 1st Brillouin zone
89+let bzl = []; //!< Lines of 1st BZ [nbzl(max:26*26=676)][2][3]
90+let bragg = []; //!< Bragg plane vectors
91+let brnrm = []; //!< Norms of Bragg plane vectors
92+let brnrm_min = 0.0; //!< Minimum scale of the reciplocal space
93+let nbragg = 0; //!< Number of Bragg plane og 1st BZ
94+/*
95+ Variables for patchs
96+*/
97+let ntri = []; //!< The number of triangle patch [::nb]
98+let draw_band = []; //!< Switch for drawn bands [::nb]
99+let nmlp = []; //!< Normal vector of patchs [::nb][::ntri][3][3]
100+let kvp = []; //!< @f$k@f$-vectors of points [::nb][::ntri][3][3]
101+let arw = [];
102+let nmlp_rot = []; //!< Normal vector of patchs [::nb][::ntri*3*3]
103+let kvp_rot = []; //!< @f$k@f$-vectors of points [::nb][::ntri*3*3]
104+let arw_rot = [];
105+let matp = []; //!< Matrix elements of points [::nb][::ntri][3][3]
106+let clr = []; //!< Colors of points [::nb][::ntri*3*4]
107+let itet = 0; //!< Counter for tetrahedron
108+let side = 1.0; //!< Which side is lighted
109+let patch_max = 0.0; //!< Max value across patch
110+let patch_min = 0.0; //!< Max value across patch
111+/*
112+ Variables for nodeline
113+*/
114+let nnl = []; //!< The number of nodeline
115+let kvnl = []; //!< @f$k@f$-vector of nodeline [::nb][::nnl][2][3]
116+let kvnl_rot = []; //!< @f$k@f$-vector of nodeline [::nb][::nnl*2*3]
117+/*
118+ 2D Fermi line
119+*/
120+let secvec = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector to define section
121+let secvec_fr = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector to define section
122+let secscale = 0.0; //!< 0.0 (across @f$\Gamma@f$) or 1.0
123+let axis2d = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< @f$k@f$-vector to define section
124+let n2d = []; //!< Number of line segment
125+let kv2d = []; //!< @f$k@f$-vector for 2D plot [::nb][::n2d*2*3]
126+let clr2d = []; //!< Matrix element for 2D plot [::nb][::n2d*2*4]
127+let nbzl2d = 0; //!< The number of Lines of 1st Brillouin zone
128+let bzl2d = []; //!< Lines of 1st BZ [::nbzl2d (max:26)][3]
129+let bzl2d_proj = []; //!< Lines of 1st BZ [::nbzl2d (max:26)][3], projected into 2D plane
130+/*
131+ Equator
132+*/
133+let eqvec = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector for equator
134+let eqvec_fr = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector for equator
135+let nequator = []; //!< The number of equator
136+let kveq = []; //!< @f$k@f$-vector of equator [::nb][::nequator][2][3]
137+let kveq_rot = []; //!< @f$k@f$-vector of equator [::nb][::nequator*2*3]
138+/*
139+ Variables for mouse & cursorkey
140+*/
141+let sx = 0.0; //!< Scale of mouse movement
142+let sy = 0.0; //!< Scale of mouse movement
143+let cx = 0.0; //!< Starting point of drug
144+let cy = 0.0; //!< Starting point of drug
145+let scl = 1.0; //!< Initial scale
146+let trans = [0.0, 0.0, 0.0]; //!< Translation
147+let rot = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]; //!< Rotation matrix
148+let thetax = 0.0; //!< Rotation angle
149+let thetay = 0.0; //!< Rotation angle
150+let thetaz = 0.0; //!< Rotation angle
151+let linewidth = 3.0; //!< BZ/nodal-line/Fermiline width
152+/*
153+ Colors
154+*/
155+let black = [0.0, 0.0, 0.0, 1.0]; //!< Black color code
156+let gray = [0.5, 0.5, 0.5, 1.0]; //!< Gray color code
157+let wgray = [0.9, 0.9, 0.9, 1.0]; //!< Gray color code
158+let bgray = [0.1, 0.1, 0.1, 1.0]; //!< Gray color code
159+let white = [1.0, 1.0, 1.0, 1.0]; //!< White color code
160+let cyan = [0.0, 1.0, 1.0, 1.0]; //!< Cyan color code
161+let magenta = [1.0, 0.0, 1.0, 1.0]; //!< Magenta color code
162+let yellow = [1.0, 1.0, 0.0, 1.0]; //!< Yellow color code
163+let red = [1.0, 0.0, 0.0, 1.0]; //!< Red color code
164+let green = [0.0, 1.0, 0.0, 1.0]; //!< Green color code
165+let blue = [0.0, 0.0, 1.0, 1.0]; //!< Blue color code
166+let BackGroundColor = [0.0, 0.0, 0.0, 1.0];//!< BackGround color code
167+let LineColor = [1.0, 1.0, 1.0, 1.0];//!< Line color code
168+let BarColor = [[0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0],
169+[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 1.0], [1.0, 0.0, 0.0, 1.0]];
170+/*
171+ Others
172+*/
173+let corner = [[0.0, 0.0, 0.0, 0.0],
174+[0.0, 0.0, 0.0, 0.0],
175+[0.0, 0.0, 0.0, 0.0],
176+[0.0, 0.0, 0.0, 0.0],
177+[0.0, 0.0, 0.0, 0.0],
178+[0.0, 0.0, 0.0, 0.0]]; //!< Corners of tetrahedron
179+let EF = 0.0; //!< Fermi energy
180+/*
181+Batch mode
182+*/
183+let refresh_interpol = 0;
184+let refresh_patch = 1;
185+let refresh_color = 1;
186+let refresh_nodeline = 1;
187+let refresh_equator = 1;
188+let refresh_section = 1;
189+let skip_minmax = 0;
190+let windowx = 1100;
191+let windowy = 850;
27192
193+let gl;
194+let programInfo;
28195 //
29196 // Start here
30197 //
@@ -110,8 +277,12 @@ function main() {
110277 drawScene();
111278
112279 var el = document.getElementById("glcanvas");
113- el.addEventListener("touchstart", handleStart, false);
114- el.addEventListener("touchmove", handleMove, false);
280+ el.addEventListener("touchstart", touch_start, false);
281+ el.addEventListener("touchmove", touch_move, false);
282+ el.addEventListener("mousedown", mouse_down, false);
283+ el.addEventListener("mousemove", mouse_move, false);
284+ el.addEventListener("mouseup", mouse_up, false);
285+ el.addEventListener("wheel", zoom, false);
115286 }
116287 //
117288 // Draw the scene.
@@ -161,11 +332,11 @@ function drawScene() {
161332 [-0.0, 0.0, -6.0]); // amount to translate
162333 mat4.rotate(modelViewMatrix, // destination matrix
163334 modelViewMatrix, // matrix to rotate
164- rotatey, // amount to rotate in radians
335+ 0.0, // amount to rotate in radians
165336 [0, 0, 1]); // axis to rotate around (Z)
166337 mat4.rotate(modelViewMatrix, // destination matrix
167338 modelViewMatrix, // matrix to rotate
168- rotatex * .7,// amount to rotate in radians
339+ 0.0,// amount to rotate in radians
169340 [0, 1, 0]); // axis to rotate around (X)
170341 let normalMatrix = mat4.create();
171342 mat4.invert(normalMatrix, modelViewMatrix);
@@ -429,7 +600,7 @@ let touch0y = 0.0;
429600 let touch1x = 0.0;
430601 let touch1y = 0.0;
431602
432-function handleStart(evt) {
603+function touch_start(evt) {
433604 evt.preventDefault();
434605 var touches = evt.changedTouches;
435606
@@ -445,7 +616,7 @@ function handleStart(evt) {
445616 }
446617 }
447618
448-function handleMove(evt) {
619+function touch_move(evt) {
449620 evt.preventDefault();
450621 var touches = evt.changedTouches;
451622 let dx = 0.0, dy = 0.0, dold = 0.0, dnew = 0.;
@@ -474,45 +645,39 @@ function handleMove(evt) {
474645 }
475646
476647 let isDrawing = false;
477-let x = 0;
478-let y = 0;
479-
480-const myPics = document.getElementById('glcanvas');
481648
482-myPics.addEventListener('mousedown', e => {
483- x = e.offsetX;
484- y = e.offsetY;
649+function mouse_down(evt){
650+ touch0x = evt.offsetX;
651+ touch0y = evt.offsetY;
485652 isDrawing = true;
486-});
653+};
487654
488-myPics.addEventListener('mousemove', e => {
655+function mouse_move(evt){
489656 if (isDrawing === true) {
490- let dx = e.offsetX - x;
491- let dy = e.offsetY - y;
657+ let dx = evt.offsetX - touch0x;
658+ let dy = evt.offsetY - touch0y;
492659 dx *= 0.001;
493660 dy *= 0.001;
494661 mouserotation(dx, dy)
495662 drawScene();
496- x = e.offsetX;
497- y = e.offsetY;
663+ touch0x = evt.offsetX;
664+ touch0y = evt.offsetY;
498665 }
499-});
666+};
500667
501-window.addEventListener('mouseup', e => {
668+function mouse_up(evt){
502669 if (isDrawing === true) {
503- let dx = e.offsetX - x;
504- let dy = e.offsetY - y;
670+ let dx = evt.offsetX - touch0x;
671+ let dy = evt.offsetY - touch0y;
505672 dx *= 0.001;
506673 dy *= 0.001;
507674 mouserotation(dx, dy)
508675 drawScene();
509- x = 0;
510- y = 0;
676+ touch0x = 0;
677+ touch0y = 0;
511678 isDrawing = false;
512679 }
513-});
514-
515-myPics.addEventListener('wheel', zoom);
680+};
516681
517682 function zoom(evt) {
518683 scl -= evt.deltaY*0.001;
@@ -2040,222 +2205,6 @@ function fermi_patch()
20402205 }/*for (ib = 0; ib < nb; ++ib)*/
20412206 terminal(" ... Done\n");
20422207 } /* fermi_patch */
2043-/**@file
2044- @brief Main routine
2045-*/
2046-/**@mainpage FermiSurfer Main Page
2047-
2048-Fermisurfer displays Fermi surfaces
2049-with a color-plot of the arbitraly matrix element
2050-
2051-@section Notation
2052-
2053-- @f$\varepsilon_{n k}@f$ : Energy
2054-- @f$\Delta_{n k}@f$ : Any @f$(n, k)@f$-dependent value for the color-plot.
2055-- @f$N_b@f$ : Number of bands
2056-
2057-@section sec_routine Important routines
2058-- Main routine: main()
2059-- Right click menu : FS_CreateMenu(), FS_ModifyMenu(let status)
2060-
2061-@section sec_file Important files
2062-- Main routine : fermisurfer.cpp
2063-- Global valiable : variable.hpp
2064-
2065-@section sec_flow Flow
2066-
2067-- main() :
2068- - read_file() : Read .frmsf file
2069- - compute_patch_segment() : Compute patch and segment
2070- - fermi_patch() : Compute patches constructing Fermi surface
2071- - display() : Display figures with OpenGL
2072-
2073-*/
2074-/*
2075- Input variables
2076-*/
2077-let ng0 = [0, 0, 0]; //!< @f$k@f$-point grid in the input file
2078-let shiftk = [0, 0, 0]; //!< Wherether @f$k@f$-grid is shifted or not
2079-let nb = 0; //!< The number of Bands
2080-let avec = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< Direct lattice vector
2081-let bvec = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< Reciprocal lattice vector
2082-let eig0 = []; //!< Eigenvalues @f$\varepsilon_{n k}@f$[::nb][::ng0[0]][::ng0[1]][::ng0[2]]
2083-let mat0 = []; //!< Matrix element [::nb][::ng0[0]][::ng0[1]][::ng0[2]][3]
2084-/*
2085- Interpolation
2086-*/
2087-let ng = [0, 0, 0]; //!< @b Interpolated @f$k@f$-grids
2088-let eig = []; //!< Eigenvalues @f$\varepsilon_{n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]]
2089-let mat =[]; //!< Matrix element @f$\delta_{n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]][3]
2090-let vf =[]; //!< Matrix element @f$\{\bf v}_{{\rm f} n k}@f$ [::nb][::ng[0]][::ng[1]][::ng[2]][3]
2091-let interpol = 1; //!< Ratio of interpolation
2092-/*
2093- Switch for some modes
2094-*/
2095-let color_scale = 1; //!< Switch for full color scale mode
2096-let fbz = 1; //!< Switch for 1st Brillouin zone mode
2097-let nodeline = 0; //!< Switch for node lines
2098-let lcolorbar = 1; //!< Switch for colorbar
2099-let lstereo = 1; //!< Switch for the stereogram
2100-let lmouse = 1; //!< Switch for the mouse function
2101-let lsection = 0; //!< Switch for the 2D Fermi lines
2102-let lequator = 0; //!< Switch for equator
2103-let BZ_number = [1, 1, 1];
2104-/*
2105- Variables for Brillouin zone boundaries
2106-*/
2107-let nbzl = 1; //!< The number of Lines of 1st Brillouin zone
2108-let bzl = []; //!< Lines of 1st BZ [nbzl(max:26*26=676)][2][3]
2109-let bragg = []; //!< Bragg plane vectors
2110-let brnrm = []; //!< Norms of Bragg plane vectors
2111-let brnrm_min = 0.0; //!< Minimum scale of the reciplocal space
2112-let nbragg = 0; //!< Number of Bragg plane og 1st BZ
2113-/*
2114- Variables for patchs
2115-*/
2116-let ntri = []; //!< The number of triangle patch [::nb]
2117-let draw_band = []; //!< Switch for drawn bands [::nb]
2118-let nmlp = []; //!< Normal vector of patchs [::nb][::ntri][3][3]
2119-let kvp = []; //!< @f$k@f$-vectors of points [::nb][::ntri][3][3]
2120-let arw = [];
2121-let nmlp_rot = []; //!< Normal vector of patchs [::nb][::ntri*3*3]
2122-let kvp_rot = []; //!< @f$k@f$-vectors of points [::nb][::ntri*3*3]
2123-let arw_rot = [];
2124-let matp = []; //!< Matrix elements of points [::nb][::ntri][3][3]
2125-let clr = []; //!< Colors of points [::nb][::ntri*3*4]
2126-let itet = 0; //!< Counter for tetrahedron
2127-let side = 1.0; //!< Which side is lighted
2128-let patch_max = 0.0; //!< Max value across patch
2129-let patch_min = 0.0; //!< Max value across patch
2130-/*
2131- Variables for nodeline
2132-*/
2133-let nnl = []; //!< The number of nodeline
2134-let kvnl = []; //!< @f$k@f$-vector of nodeline [::nb][::nnl][2][3]
2135-let kvnl_rot = []; //!< @f$k@f$-vector of nodeline [::nb][::nnl*2*3]
2136-/*
2137- 2D Fermi line
2138-*/
2139-let secvec = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector to define section
2140-let secvec_fr = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector to define section
2141-let secscale = 0.0; //!< 0.0 (across @f$\Gamma@f$) or 1.0
2142-let axis2d = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]; //!< @f$k@f$-vector to define section
2143-let n2d = []; //!< Number of line segment
2144-let kv2d = []; //!< @f$k@f$-vector for 2D plot [::nb][::n2d*2*3]
2145-let clr2d = []; //!< Matrix element for 2D plot [::nb][::n2d*2*4]
2146-let nbzl2d = 0; //!< The number of Lines of 1st Brillouin zone
2147-let bzl2d = []; //!< Lines of 1st BZ [::nbzl2d (max:26)][3]
2148-let bzl2d_proj = []; //!< Lines of 1st BZ [::nbzl2d (max:26)][3], projected into 2D plane
2149-/*
2150- Equator
2151-*/
2152-let eqvec = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector for equator
2153-let eqvec_fr = [0.0, 0.0, 0.0]; //!< @f$k@f$-vector for equator
2154-let nequator = []; //!< The number of equator
2155-let kveq = []; //!< @f$k@f$-vector of equator [::nb][::nequator][2][3]
2156-let kveq_rot = []; //!< @f$k@f$-vector of equator [::nb][::nequator*2*3]
2157-/*
2158- Variables for mouse & cursorkey
2159-*/
2160-let sx = 0.0; //!< Scale of mouse movement
2161-let sy = 0.0; //!< Scale of mouse movement
2162-let cx = 0.0; //!< Starting point of drug
2163-let cy = 0.0; //!< Starting point of drug
2164-let scl = 1.0; //!< Initial scale
2165-let trans = [0.0, 0.0, 0.0]; //!< Translation
2166-let rot = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]; //!< Rotation matrix
2167-let thetax = 0.0; //!< Rotation angle
2168-let thetay = 0.0; //!< Rotation angle
2169-let thetaz = 0.0; //!< Rotation angle
2170-let linewidth = 3.0; //!< BZ/nodal-line/Fermiline width
2171-/*
2172- Colors
2173-*/
2174-let black = [0.0, 0.0, 0.0, 1.0]; //!< Black color code
2175-let gray = [0.5, 0.5, 0.5, 1.0]; //!< Gray color code
2176-let wgray = [0.9, 0.9, 0.9, 1.0]; //!< Gray color code
2177-let bgray = [0.1, 0.1, 0.1, 1.0]; //!< Gray color code
2178-let white = [1.0, 1.0, 1.0, 1.0]; //!< White color code
2179-let cyan = [0.0, 1.0, 1.0, 1.0]; //!< Cyan color code
2180-let magenta = [1.0, 0.0, 1.0, 1.0]; //!< Magenta color code
2181-let yellow = [1.0, 1.0, 0.0, 1.0]; //!< Yellow color code
2182-let red = [1.0, 0.0, 0.0, 1.0]; //!< Red color code
2183-let green = [0.0, 1.0, 0.0, 1.0]; //!< Green color code
2184-let blue = [0.0, 0.0, 1.0, 1.0]; //!< Blue color code
2185-let BackGroundColor = [0.0, 0.0, 0.0, 1.0];//!< BackGround color code
2186-let LineColor = [1.0, 1.0, 1.0, 1.0];//!< Line color code
2187-let BarColor = [[0.0, 0.0, 1.0, 1.0], [0.0, 1.0, 1.0, 1.0],
2188-[0.0, 1.0, 0.0, 1.0], [1.0, 1.0, 0.0, 1.0], [1.0, 0.0, 0.0, 1.0]];
2189-/*
2190- Others
2191-*/
2192-let corner = [[0.0, 0.0, 0.0, 0.0],
2193- [0.0, 0.0, 0.0, 0.0],
2194- [0.0, 0.0, 0.0, 0.0],
2195- [0.0, 0.0, 0.0, 0.0],
2196- [0.0, 0.0, 0.0, 0.0],
2197- [0.0, 0.0, 0.0, 0.0]]; //!< Corners of tetrahedron
2198-let EF = 0.0; //!< Fermi energy
2199-/*
2200-Batch mode
2201-*/
2202-let batch_name;
2203-let frmsf_file_name;
2204-let lbatch = 0;
2205-
2206-let refresh_interpol = 0;
2207-let refresh_patch = 1;
2208-let refresh_color = 1;
2209-let refresh_nodeline = 1;
2210-let refresh_equator = 1;
2211-let refresh_section = 1;
2212-let skip_minmax = 0;
2213-let windowx = 1100;
2214-let windowy = 850;
2215-/**
2216- @brief Main routine of FermiSurfer
2217-
2218-*/
2219-function OnInit()
2220-{
2221- let ierr;
2222-
2223-
2224- terminal("\n");
2225- /**/
2226- terminal(" Initialize variables ...\n");
2227- terminal("\n");
2228- /*
2229- Input from BXSF or FRMSF file
2230- */
2231- color_scale = read_file();
2232- if (color_scale == 0)color_scale = 4;
2233- /**/
2234- interpol_energy();
2235- init_corner();
2236- bragg_vector();
2237- /*
2238- Brillouin zone
2239- */
2240- bz_lines();
2241- calc_2dbz();
2242- /**/
2243- max_and_min_bz();
2244- /**/
2245- compute_patch_segment();
2246- /*
2247- Description
2248- */
2249- terminal("\n");
2250- terminal(" ## How to handle ###################\n");
2251- terminal("\n");
2252- terminal(" mouse drag : Rotate objects\n");
2253- terminal(" mousewheel : Resize objects\n");
2254- terminal(" cursorkey or w,a,s,d : Move objects\n");
2255- terminal("\n");
2256- /**/
2257- return true;
2258-} /* main */
22592208 /**
22602209 @brief Free variables for patch before new patch is computed
22612210