• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revision221c7159066123312ffdb8b3290850b620b1c180 (tree)
Zeit2020-11-09 16:03:25
AutorMitsuaki Kawamura <kawamitsuaki@gmai...>
CommiterMitsuaki Kawamura

Log Message

Backup

Ändern Zusammenfassung

Diff

--- a/javascript/fermisurfer.js
+++ b/javascript/fermisurfer.js
@@ -26,7 +26,7 @@ function test() {
2626 }
2727 function terminal(msg) {
2828 var p = document.getElementById('log');
29- p.innerHTML += "\n" + msg;
29+ p.innerHTML += msg;
3030 }
3131 /**@file
3232 @brief Mathematical operations used in various step
@@ -253,7 +253,7 @@ function bz_lines()
253253 let vert = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]];
254254 /**/
255255 nbzl = 0;
256-
256+ bzl = [];
257257 /**/
258258 for (ibr = 0; ibr < 26; ++ibr) {
259259 for (jbr = 0; jbr < 26; ++jbr) {
@@ -267,8 +267,12 @@ function bz_lines()
267267 lvert = bragg_vert(bragg, brnrm, ibr, jbr, nbr, vert[1], vert[0]);
268268 if (lvert == 0) continue;
269269 /**/
270- for (i = 0; i < 2; ++i) for (j = 0; j < 3; ++j) bzl[nbzl][i][j] = vert[i][j];
271- nbzl = nbzl + 1;
270+ bzl.push([]);
271+ for (i = 0; i < 2; ++i) {
272+ bzl[nbzl].push([]);
273+ for (j = 0; j < 3; ++j) bzl[nbzl][i].push(vert[i][j]);
274+ }
275+ nbzl += 1;
272276
273277 }/*for (jbr = 0; jbr < 26; ++jbr)*/
274278 }/*for (ibr = 0; ibr < 26; ++ibr)*/
@@ -901,11 +905,13 @@ function draw()
901905 Modify : ::nequator, ::kveq, ::kveq_rot
902906 */
903907 function equator() {
904- let ib = 0, itri = 0, i = 0, j = 0, nequator0 = 0;
908+ let ib = 0, itri = 0, i = 0, j = 0;
905909 let sw = [0,0,0];
906910 let a = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], prod = [0.0, 0.0, 0.0];
907911 let kveq_0 = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]];
908912
913+ kveq = [];
914+ nequator = [];
909915 terminal(" band # of equator\n");
910916 for (ib = 0; ib < nb; ib++) {
911917 kveq.push([]);
@@ -943,7 +949,7 @@ function equator() {
943949 /*
944950 Sum node-lines in all threads
945951 */
946- nequator.push(kveq[ib].size);
952+ nequator.push(kveq[ib].length);
947953 terminal(" " + String(ib + 1) + " " + String(nequator[ib])+ "\n");
948954 }/*for (ib = 0; ib < nb; ib++)*/
949955 }/*function equator()*/
@@ -1034,7 +1040,7 @@ function triangle(
10341040 a[i][j] = (brnrm[ibr] - prod[sw[j]]) / (prod[sw[i]] - prod[sw[j]]);
10351041 }/*for (j = 0; j < 3; ++j)*/
10361042 }/*for (i = 0; i < 3; ++i)*/
1037- i = (0.5 * ((prod[sw[2]] / brnrm[ibr]) + 1.0));
1043+ i = Math.floor(0.5 * ((prod[sw[2]] / brnrm[ibr]) + 1.0));
10381044 bshift = -2.0 *i;
10391045
10401046 if (brnrm[ibr] + thr > prod[sw[2]]) continue;
@@ -1354,7 +1360,7 @@ function tetrahedron(
13541360 */
13551361 function fermi_patch()
13561362 {
1357- let ntri0 = 0, ib = 0, i0 = 0, i1 = 0, j0 = 0, start = [0, 0, 0], last = [0, 0, 0];
1363+ let ib = 0, i0 = 0, i1 = 0, j0 = 0, start = [0, 0, 0], last = [0, 0, 0];
13581364 let i = 0, j = 0, i2 = 0, j1 = 0, j2 = 0, ii0 = 0, ii1 = 0, ii2 = 0;
13591365 let kvec1 = [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0],
13601366 [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]],
@@ -1382,8 +1388,16 @@ function fermi_patch()
13821388 }
13831389 terminal(" Computing patch ...\n");
13841390 terminal(" band # of patchs\n");
1385- /**/
1391+/**/
1392+ kvp = [];
1393+ matp = [];
1394+ nmlp = [];
1395+ ntri = [];
13861396 for (ib = 0; ib < nb; ++ib) {
1397+ kvp.push([]);
1398+ matp.push([]);
1399+ nmlp.push([]);
1400+ ntri.push([]);
13871401 for (j0 = start[0]; j0 < last[0]; ++j0) {
13881402 for (j1 = start[1]; j1 < last[1]; ++j1) {
13891403 for (j2 = start[2]; j2 < last[2]; ++j2) {
@@ -1467,6 +1481,8 @@ function fermi_patch()
14671481 }/*for (j0 = start[0]; j0 < ng[0]; ++j0)*/
14681482 }/*for (j1 = start[1]; j1 < ng[1]; ++j1)*/
14691483 }/*for (j0 = start[0]; j0 < ng[0]; ++j0)*/
1484+ ntri[ib] = kvp[ib].length;
1485+ terminal(" " + String(ib + 1) + " " + String(ntri[ib]) + "\n");
14701486 }/*for (ib = 0; ib < nb; ++ib)*/
14711487 terminal(" ... Done\n");
14721488 } /* fermi_patch */
@@ -1633,7 +1649,6 @@ let batch_name;
16331649 let frmsf_file_name;
16341650 let lbatch = 0;
16351651
1636-wxTextCtrl* terminal;
16371652 let refresh_interpol = 0;
16381653 let refresh_patch = 1;
16391654 let refresh_color = 1;
@@ -1651,37 +1666,20 @@ function OnInit()
16511666 {
16521667 let ierr;
16531668
1654- myf = new MyFrame(NULL, argv[1], wxDefaultPosition, wxSize(windowx, windowy));
16551669
16561670 terminal("\n");
1657- terminal("##### Welocome to FermiSurfer ver. ") <<
1658- wxT(VERSION) << wxT(" #####\n");
1659- terminal("\n");
1660- if (argc < 2) {
1661- printf("\n");
1662- printf(" Input file is not specified !\n");
1663- printf(" Press any key to exit.\n");
1664- ierr = getchar();
1665- exit(-1);
1666- }
1667- /**/
1671+ /**/
16681672 terminal(" Initialize variables ...\n");
16691673 terminal("\n");
16701674 /*
16711675 Input from BXSF or FRMSF file
16721676 */
1673- if (frmsf_file_name.AfterLast(wxUniChar('.')).CmpNoCase(wxT("bxsf")) == 0) {
1674- read_bxsf();
1675- }
1676- else {
1677- color_scale = read_file();
1678- if (color_scale == 0)color_scale = 4;
1679- }
1677+ color_scale = read_file();
1678+ if (color_scale == 0)color_scale = 4;
16801679 /**/
16811680 interpol_energy();
16821681 init_corner();
16831682 bragg_vector();
1684- modify_band();
16851683 /*
16861684 Brillouin zone
16871685 */
@@ -1702,9 +1700,6 @@ function OnInit()
17021700 terminal(" cursorkey or w,a,s,d : Move objects\n");
17031701 terminal("\n");
17041702 /**/
1705- if (lbatch == 1) {
1706- batch_draw();
1707- }
17081703 return true;
17091704 } /* main */
17101705 /**
@@ -1905,8 +1900,10 @@ function paint()
19051900 let mat2 = 0.0;
19061901 let theta = 0.0, abs = 0.0, theta2 = 0.0;
19071902
1903+ clr = [];
19081904 if (color_scale == 1) {
19091905 for (ib = 0; ib < nb; ib++) {
1906+ clr.push([]);
19101907 for (itri = 0; itri < ntri[ib]; ++itri) {
19111908 for (i = 0; i < 3; ++i) {
19121909 /**/
@@ -1914,23 +1911,19 @@ function paint()
19141911 mat2 = mat2 * 4.0;
19151912 /**/
19161913 if (mat2 <= 1.0) {
1917- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
1918- = BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2);
1914+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2));
19191915 }
19201916 else if (mat2 <= 2.0) {
19211917 mat2 = mat2 - 1.0;
1922- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
1923- = BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2);
1918+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2));
19241919 }
19251920 else if (mat2 <= 3.0) {
19261921 mat2 = mat2 - 2.0;
1927- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
1928- = BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2);
1922+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2));
19291923 }
19301924 else {
19311925 mat2 = mat2 - 3.0;
1932- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
1933- = BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2);
1926+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2));
19341927 }
19351928 }/*for (i = 0; i < 3; ++i)*/
19361929 }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
@@ -1939,6 +1932,7 @@ function paint()
19391932 else if (color_scale == 2) {
19401933 for (j = 0; j < 4; ++j) origin[j] = 1.0 - BackGroundColor[j];
19411934 for (ib = 0; ib < nb; ib++) {
1935+ clr.push([]);
19421936 for (itri = 0; itri < ntri[ib]; ++itri) {
19431937 for (i = 0; i < 3; ++i) {
19441938 /**/
@@ -1953,32 +1947,32 @@ function paint()
19531947 if (-3.0 <= theta && theta < -2.0) {
19541948 theta2 = theta + 3.0;
19551949 for (j = 0; j < 4; ++j)
1956- clr[ib][j + 4 * i + 12 * itri] = blue[j] * theta2 + cyan[j] * (1.0 - theta2);
1950+ clr[ib].push(blue[j] * theta2 + cyan[j] * (1.0 - theta2));
19571951 }
19581952 else if (-2.0 <= theta && theta < -1.0) {
19591953 theta2 = theta + 2.0;
19601954 for (j = 0; j < 4; ++j)
1961- clr[ib][j + 4 * i + 12 * itri] = magenta[j] * theta2 + blue[j] * (1.0 - theta2);
1955+ clr[ib].push(magenta[j] * theta2 + blue[j] * (1.0 - theta2));
19621956 }
19631957 else if (-1.0 <= theta && theta < 0.0) {
19641958 theta2 = theta + 1.0;
19651959 for (j = 0; j < 4; ++j)
1966- clr[ib][j + 4 * i + 12 * itri] = red[j] * theta2 + magenta[j] * (1.0 - theta2);
1960+ clr[ib].push(red[j] * theta2 + magenta[j] * (1.0 - theta2));
19671961 }
19681962 else if (0.0 <= theta && theta < 1.0) {
19691963 theta2 = theta;
19701964 for (j = 0; j < 4; ++j)
1971- clr[ib][j + 4 * i + 12 * itri] = yellow[j] * theta2 + red[j] * (1.0 - theta2);
1965+ clr[ib].push(yellow[j] * theta2 + red[j] * (1.0 - theta2));
19721966 }
19731967 else if (1.0 <= theta && theta < 2.0) {
19741968 theta2 = theta - 1.0;
19751969 for (j = 0; j < 4; ++j)
1976- clr[ib][j + 4 * i + 12 * itri] = green[j] * theta2 + yellow[j] * (1.0 - theta2);
1970+ clr[ib].push(green[j] * theta2 + yellow[j] * (1.0 - theta2));
19771971 }
19781972 else {
19791973 theta2 = theta - 2.0;
19801974 for (j = 0; j < 4; ++j)
1981- clr[ib][j + 4 * i + 12 * itri] = cyan[j] * theta2 + green[j] * (1.0 - theta2);
1975+ clr[ib].push(cyan[j] * theta2 + green[j] * (1.0 - theta2));
19821976 }
19831977 clr[ib][j + 4 * i + 12 * itri] = clr[ib][j + 4 * i + 12 * itri] * abs + origin[j] * (1.0 - abs);
19841978 }/*for (i = 0; i < 3; ++i)*/
@@ -1987,6 +1981,7 @@ function paint()
19871981 }/*if (color_scale == 2)*/
19881982 else if (color_scale == 4) {
19891983 for (ib = 0; ib < nb; ib++) {
1984+ clr.push([]);
19901985 for (itri = 0; itri < ntri[ib]; ++itri) {
19911986 for (i = 0; i < 3; ++i) {
19921987 /**/
@@ -1997,23 +1992,19 @@ function paint()
19971992 mat2 = mat2 * 4.0;
19981993 /**/
19991994 if (mat2 <= 1.0) {
2000- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2001- = BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2);
1995+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2));
20021996 }
20031997 else if (mat2 <= 2.0) {
20041998 mat2 = mat2 - 1.0;
2005- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2006- = BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2);
1999+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2));
20072000 }
20082001 else if (mat2 <= 3.0) {
20092002 mat2 = mat2 - 2.0;
2010- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2011- = BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2);
2003+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2));
20122004 }
20132005 else {
20142006 mat2 = mat2 - 3.0;
2015- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2016- = BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2);
2007+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2));
20172008 }
20182009 }/*for (i = 0; i < 3; ++i)*/
20192010 }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
@@ -2021,6 +2012,7 @@ function paint()
20212012 }/*if (color_scale == 4)*/
20222013 else if (color_scale == 3 || color_scale == 5) {
20232014 for (ib = 0; ib < nb; ib++) {
2015+ clr.push([]);
20242016 /**/
20252017 if (nb == 1) mat2 = 0.5;
20262018 else mat2 = 1.0 / (nb - 1) * ib;
@@ -2029,8 +2021,7 @@ function paint()
20292021 if (mat2 <= 1.0) {
20302022 for (itri = 0; itri < ntri[ib]; ++itri) {
20312023 for (i = 0; i < 3; ++i) {
2032- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2033- = BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2);
2024+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[1][j] * mat2 + BarColor[0][j] * (1.0 - mat2));
20342025 }
20352026 }
20362027 }
@@ -2038,8 +2029,7 @@ function paint()
20382029 mat2 = mat2 - 1.0;
20392030 for (itri = 0; itri < ntri[ib]; ++itri) {
20402031 for (i = 0; i < 3; ++i) {
2041- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2042- = BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2);
2032+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[2][j] * mat2 + BarColor[1][j] * (1.0 - mat2));
20432033 }
20442034 }
20452035 }
@@ -2047,8 +2037,7 @@ function paint()
20472037 mat2 = mat2 - 2.0;
20482038 for (itri = 0; itri < ntri[ib]; ++itri) {
20492039 for (i = 0; i < 3; ++i) {
2050- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2051- = BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2);
2040+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[3][j] * mat2 + BarColor[2][j] * (1.0 - mat2));
20522041 }
20532042 }
20542043 }
@@ -2056,14 +2045,14 @@ function paint()
20562045 mat2 = mat2 - 3.0;
20572046 for (itri = 0; itri < ntri[ib]; ++itri) {
20582047 for (i = 0; i < 3; ++i) {
2059- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri]
2060- = BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2);
2048+ for (j = 0; j < 4; ++j) clr[ib].push(BarColor[4][j] * mat2 + BarColor[3][j] * (1.0 - mat2));
20612049 }
20622050 }
20632051 }
20642052 }/*for (ib = 0; ib < nb; ib++*/
20652053 if (color_scale == 3) {
20662054 for (ib = 0; ib < nb; ib++) {
2055+ clr.push([]);
20672056 for (itri = 0; itri < ntri[ib]; ++itri){
20682057 for (i = 0; i < 3; ++i) {
20692058 for (j = 0; j < 3; ++j) {
@@ -2079,18 +2068,20 @@ function paint()
20792068 }/*if (color_scale == 5)*/
20802069 else if (color_scale == 6) {
20812070 for (ib = 0; ib < nb; ib++) {
2071+ clr.push([]);
20822072 for (itri = 0; itri < ntri[ib]; ++itri) {
20832073 for (i = 0; i < 3; ++i) {
20842074 /**/
20852075 mat2 = (matp[ib][itri][i][0] - patch_min) / (patch_max - patch_min);
20862076 /**/
2087- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri] = wgray[j] * mat2 + bgray[j] * (1.0 - mat2);
2077+ for (j = 0; j < 4; ++j) clr[ib].push(wgray[j] * mat2 + bgray[j] * (1.0 - mat2));
20882078 }/*for (i = 0; i < 3; ++i)*/
20892079 }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
20902080 }/*for (ib = 0; ib < nb; ib++)*/
20912081 }/*if (color_scale == 6)*/
20922082 else if (color_scale == 7) {
20932083 for (ib = 0; ib < nb; ib++) {
2084+ clr.push([]);
20942085 for (itri = 0; itri < ntri[ib]; ++itri) {
20952086 for (i = 0; i < 3; ++i) {
20962087 /**/
@@ -2099,7 +2090,7 @@ function paint()
20992090 mat2 = Math.sqrt(mat2);
21002091 mat2 = (mat2 - patch_min) / (patch_max - patch_min);
21012092 /**/
2102- for (j = 0; j < 4; ++j) clr[ib][j + 4 * i + 12 * itri] = wgray[j] * mat2 + bgray[j] * (1.0 - mat2);
2093+ for (j = 0; j < 4; ++j) clr[ib].push(wgray[j] * mat2 + bgray[j] * (1.0 - mat2));
21032094 }/*for (i = 0; i < 3; ++i)*/
21042095 }/*for (itri = 0; itri < ntri[ib]; ++itri)*/
21052096 }/*for (ib = 0; ib < nb; ib++)*/
@@ -2276,7 +2267,9 @@ function bragg_vector()
22762267 let i0, i1, i2, i, ibr;
22772268 /**/
22782269 ibr = 0;
2279- /**/
2270+ //
2271+ bragg = [];
2272+ brnrm = [];
22802273 for (i0 = -1; i0 <= 1; ++i0) {
22812274 for (i1 = -1; i1 <= 1; ++i1) {
22822275 for (i2 = -1; i2 <= 1; ++i2) {
@@ -2287,18 +2280,19 @@ function bragg_vector()
22872280 /*
22882281 Fractional -> Cartecian
22892282 */
2283+ bragg.push([]);
22902284 for (i = 0; i < 3; ++i)
2291- bragg[ibr][i] = (i0 * bvec[0][i]
2285+ bragg[ibr].push((i0 * bvec[0][i]
22922286 + i1 * bvec[1][i]
2293- + i2 * bvec[2][i]) * 0.5;
2287+ + i2 * bvec[2][i]) * 0.5);
22942288 /*
22952289 And its norm
22962290 */
2297- brnrm[ibr] = bragg[ibr][0] * bragg[ibr][0]
2298- + bragg[ibr][1] * bragg[ibr][1]
2299- + bragg[ibr][2] * bragg[ibr][2];
2291+ brnrm.push(bragg[ibr][0] * bragg[ibr][0]
2292+ + bragg[ibr][1] * bragg[ibr][1]
2293+ + bragg[ibr][2] * bragg[ibr][2]);
23002294 /**/
2301- ibr = ibr + 1;
2295+ ibr += 1;
23022296 }/*for (i2 = -1; i2 <= 1; ++i2)*/
23032297 }/*for (i1 = -1; i1 <= 1; ++i1)*/
23042298 }/*for (i0 = -1; i0 <= 1; ++i0)*/
@@ -2896,30 +2890,35 @@ function allocate_griddata(
28962890 secvec_fr[2] = 1.0;
28972891 secscale = 0.0;
28982892
2893+ eig0 = [];
2894+ eig = [];
2895+ mat0 = [];
2896+ mat = [];
2897+ vf = [];
28992898 for (ib = 0; ib < nb; ib++) {
2900- eig0.psuh([]);
2901- eig.psuh([]);
2902- mat0.psuh([]);
2903- mat.psuh([]);
2904- vf.psuh([]);
2899+ eig0.push([]);
2900+ eig.push([]);
2901+ mat0.push([]);
2902+ mat.push([]);
2903+ vf.push([]);
29052904 for (i0 = 0; i0 < ng0[0]; i0++) {
2906- eig0[ib].psuh([]);
2907- eig[ib].psuh([]);
2908- mat0[ib].psuh([]);
2909- mat[ib].psuh([]);
2910- vf[ib].psuh([]);
2905+ eig0[ib].push([]);
2906+ eig[ib].push([]);
2907+ mat0[ib].push([]);
2908+ mat[ib].push([]);
2909+ vf[ib].push([]);
29112910 for (i1 = 0; i1 < ng0[1]; i1++) {
2912- eig0[ib][i0].psuh([]);
2913- eig[ib][i0].psuh([]);
2914- mat0[ib][i0].psuh([]);
2915- mat[ib][i0].psuh([]);
2916- vf[ib][i0].psuh([]);
2911+ eig0[ib][i0].push([]);
2912+ eig[ib][i0].push([]);
2913+ mat0[ib][i0].push([]);
2914+ mat[ib][i0].push([]);
2915+ vf[ib][i0].push([]);
29172916 for (i2 = 0; i2 < ng0[2]; ++i2) {
2918- eig0[ib][i0][i1].psuh(0.0);
2919- eig[ib][i0][i1].psuh(0.0);
2920- mat0[ib][i0][i1].psuh([0.0, 0.0, 0.0]);
2921- mat[ib][i0][i1].psuh([0.0, 0.0, 0.0]);
2922- vf[ib][i0][i1].psuh([0.0, 0.0, 0.0]);
2917+ eig0[ib][i0][i1].push(0.0);
2918+ eig[ib][i0][i1].push(0.0);
2919+ mat0[ib][i0][i1].push([0.0, 0.0, 0.0]);
2920+ mat[ib][i0][i1].push([0.0, 0.0, 0.0]);
2921+ vf[ib][i0][i1].push([0.0, 0.0, 0.0]);
29232922 }
29242923 }
29252924 }
@@ -3028,13 +3027,24 @@ function read_file()
30283027 }/*for (i1 = 0; i1 < ng0[1]; ++i1)*/
30293028 }/*for (i0 = 0; i0 < ng0[0]; ++i0)*/
30303029 }/*for (ib = 0; ib < nb; ++ib)*/
3031- }
3030+ }//for (iaxis = 0; iaxis < 1; iaxis++)
3031+ //
3032+ interpol_energy();
3033+ init_corner();
3034+ bragg_vector();
3035+ //
3036+ //Brillouin zone
3037+ //
3038+ bz_lines();
3039+ calc_2dbz();
3040+ //
3041+ max_and_min_bz();
3042+ //
3043+ compute_patch_segment();
30323044 };
30333045 reader.onerror = function () {
30343046 terminal("File can not be loaded.");
30353047 };
3036-
3037-
30383048 return 1;
30393049 } /* read_file */
30403050 /**
@@ -3186,7 +3196,7 @@ function calc_2dbz() {
31863196 set2daxis(secvec, axis2d);
31873197
31883198 nbzl2d = 0;
3189-
3199+ vec = [];
31903200 for (jbr = 0; jbr < nbragg; ++jbr) {
31913201 /**/
31923202 for (i = 0; i < 3; ++i) vert[1][i] = 0.0;
@@ -3208,8 +3218,9 @@ function calc_2dbz() {
32083218 /*
32093219 Order bz lines
32103220 */
3211- for (i = 0; i < 3; i++) bzl2d[0][i] = vec[0][0][i];
3212- for (i = 0; i < 3; i++) bzl2d[1][i] = vec[0][1][i];
3221+ bzl2d = [[], []];
3222+ for (i = 0; i < 3; i++) bzl2d[0].push(vec[0][0][i]);
3223+ for (i = 0; i < 3; i++) bzl2d[1].push(vec[0][1][i]);
32133224 for (ibzl = 0; ibzl < nbzl2d; ibzl++) {
32143225
32153226 thr = 0.0;
@@ -3248,6 +3259,7 @@ function calc_2dbz() {
32483259 + (bzl2d[jbr][1] - vec[ibzl][0][1]) * (bzl2d[jbr][1] - vec[ibzl][0][1])
32493260 + (bzl2d[jbr][2] - vec[ibzl][0][2]) * (bzl2d[jbr][2] - vec[ibzl][0][2]);
32503261 if (prod < thr) {
3262+ bzl2d.push([]);
32513263 for (i = 0; i < 3; i++) bzl2d[jbr + 1][i] = vec[ibzl][1][i];
32523264 for (j = 0; j < 2; j++) for (i = 0; i < 3; i++) vec[ibzl][j][i] = 0.0;
32533265 }
@@ -3256,7 +3268,8 @@ function calc_2dbz() {
32563268 + (bzl2d[jbr][1] - vec[ibzl][1][1]) * (bzl2d[jbr][1] - vec[ibzl][1][1])
32573269 + (bzl2d[jbr][2] - vec[ibzl][1][2]) * (bzl2d[jbr][2] - vec[ibzl][1][2]);
32583270 if (prod < thr) {
3259- for (i = 0; i < 3; i++) bzl2d[jbr + 1][i] = vec[ibzl][0][i];
3271+ bzl2d.push([]);
3272+ for (i = 0; i < 3; i++) bzl2d[jbr + 1].push(vec[ibzl][0][i]);
32603273 for (j = 0; j < 2; j++) for (i = 0; i < 3; i++) vec[ibzl][j][i] = 0.0;
32613274 }
32623275 }/*for (ibzl = 1; ibzl < *nbzl2d; ibzl++)*/
@@ -3264,8 +3277,10 @@ function calc_2dbz() {
32643277 /*
32653278 Project into 2D plane
32663279 */
3280+ bzl2d_proj = [];
32673281 for (ibzl = 0; ibzl < nbzl2d; ibzl++) {
3268- for (i = 0; i < 3; i++) bzl2d_proj[ibzl][i] = bzl2d[ibzl][i];
3282+ bzl2d_proj.push([]);
3283+ for (i = 0; i < 3; i++) bzl2d_proj[ibzl].push(bzl2d[ibzl][i]);
32693284 proj_2d(axis2d, bzl2d_proj[ibzl]);
32703285 }/*for (ibzl = 0; ibzl < *nbzl2d; ibzl++)*/
32713286 }/*calc_2dbz()*/
@@ -3283,9 +3298,12 @@ function calc_section() {
32833298 if (fbz != 1)return;
32843299
32853300 terminal(" band # of Fermi-line\n");
3301+ kv2d = [];
3302+ clr2d = [];
32863303 for (ib = 0; ib < nb; ib++) {
32873304
32883305 kv2d.push([]);
3306+ clr2d.push([]);
32893307
32903308 for (itri = 0; itri < ntri[ib]; ++itri) {
32913309 /**/
Show on old repository browser