• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revision2d94de8dc68bd8510e066e97a5f32df2167d17f1 (tree)
Zeit2019-06-26 17:10:06
Autormitsuaki1987 <kawamitsuaki@gmai...>
Commitermitsuaki1987

Log Message

BXSF2FRMSF is merged to FermiSurfer

Ändern Zusammenfassung

Diff

--- a/doc/fermisurfer.doxygen
+++ b/doc/fermisurfer.doxygen
@@ -1,4 +1,4 @@
1-# Doxyfile 1.8.9.1
1+# Doxyfile 1.8.13
22
33 # This file describes the settings to be used by the documentation system
44 # doxygen (www.doxygen.org) for a project.
@@ -38,7 +38,7 @@ PROJECT_NAME = fermisurfer
3838 # could be handy for archiving the generated documentation or if some version
3939 # control system is used.
4040
41-PROJECT_NUMBER = 1.10.1
41+PROJECT_NUMBER = 2.0.0
4242
4343 # Using the PROJECT_BRIEF tag one can provide an optional one line description
4444 # for a project that appears at the top of each page and should give viewer a
@@ -252,7 +252,7 @@ TCL_SUBST =
252252 # members will be omitted, etc.
253253 # The default value is: NO.
254254
255-OPTIMIZE_OUTPUT_FOR_C = YES
255+OPTIMIZE_OUTPUT_FOR_C = NO
256256
257257 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
258258 # Python sources only. Doxygen will then generate output that is more tailored
@@ -303,6 +303,15 @@ EXTENSION_MAPPING =
303303
304304 MARKDOWN_SUPPORT = YES
305305
306+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
307+# to that level are automatically included in the table of contents, even if
308+# they do not have an id attribute.
309+# Note: This feature currently applies only to Markdown headings.
310+# Minimum value: 0, maximum value: 99, default value: 0.
311+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
312+
313+TOC_INCLUDE_HEADINGS = 0
314+
306315 # When enabled doxygen tries to link words that correspond to documented
307316 # classes, or namespaces to their corresponding documentation. Such a link can
308317 # be prevented in individual cases by putting a % sign in front of the word or
@@ -353,6 +362,13 @@ IDL_PROPERTY_SUPPORT = YES
353362
354363 DISTRIBUTE_GROUP_DOC = NO
355364
365+# If one adds a struct or class to a group and this option is enabled, then also
366+# any nested class or struct is added to the same group. By default this option
367+# is disabled and one has to add nested compounds explicitly via \ingroup.
368+# The default value is: NO.
369+
370+GROUP_NESTED_COMPOUNDS = NO
371+
356372 # Set the SUBGROUPING tag to YES to allow class member groups of the same type
357373 # (for instance a group of public functions) to be put as a subgroup of that
358374 # type (e.g. under the Public Functions section). Set it to NO to prevent
@@ -515,7 +531,7 @@ CASE_SENSE_NAMES = NO
515531 # scope will be hidden.
516532 # The default value is: NO.
517533
518-HIDE_SCOPE_NAMES = YES
534+HIDE_SCOPE_NAMES = NO
519535
520536 # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
521537 # append additional text to a page's title, such as Class Reference. If set to
@@ -742,6 +758,12 @@ WARN_IF_DOC_ERROR = YES
742758
743759 WARN_NO_PARAMDOC = NO
744760
761+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
762+# a warning is encountered.
763+# The default value is: NO.
764+
765+WARN_AS_ERROR = NO
766+
745767 # The WARN_FORMAT tag determines the format of the warning messages that doxygen
746768 # can produce. The string should contain the $file, $line, and $text tags, which
747769 # will be replaced by the file and line number from which the warning originated
@@ -765,11 +787,10 @@ WARN_LOGFILE =
765787 # The INPUT tag is used to specify the files and/or directories that contain
766788 # documented source files. You may enter file names like myfile.cpp or
767789 # directories like /usr/src/myproject. Separate the files or directories with
768-# spaces.
790+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
769791 # Note: If this tag is empty the current directory is searched.
770792
771-INPUT = ../src \
772- ../src/variable.h
793+INPUT = ../src
773794
774795 # This tag can be used to specify the character encoding of the source files
775796 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -782,14 +803,20 @@ INPUT_ENCODING = UTF-8
782803
783804 # If the value of the INPUT tag contains directories, you can use the
784805 # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
785-# *.h) to filter out the source-files in the directories. If left blank the
786-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
787-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
788-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
789-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
790-# *.qsf, *.as and *.js.
806+# *.h) to filter out the source-files in the directories.
807+#
808+# Note that for custom extensions or not directly supported extensions you also
809+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
810+# read by doxygen.
811+#
812+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
813+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
814+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
815+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
816+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
791817
792-FILE_PATTERNS = *.c
818+FILE_PATTERNS = *.cpp \
819+ *.hpp
793820
794821 # The RECURSIVE tag can be used to specify whether or not subdirectories should
795822 # be searched for input files as well.
@@ -873,6 +900,10 @@ IMAGE_PATH =
873900 # Note that the filter must not add or remove lines; it is applied before the
874901 # code is scanned, but not when the output code is generated. If lines are added
875902 # or removed, the anchors will not be placed correctly.
903+#
904+# Note that for custom extensions or not directly supported extensions you also
905+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
906+# properly processed by doxygen.
876907
877908 INPUT_FILTER =
878909
@@ -882,6 +913,10 @@ INPUT_FILTER =
882913 # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
883914 # filters are used. If the FILTER_PATTERNS tag is empty or if none of the
884915 # patterns match the file name, INPUT_FILTER is applied.
916+#
917+# Note that for custom extensions or not directly supported extensions you also
918+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
919+# properly processed by doxygen.
885920
886921 FILTER_PATTERNS =
887922
@@ -999,7 +1034,7 @@ VERBATIM_HEADERS = YES
9991034 # rich C++ code for which doxygen's built-in parser lacks the necessary type
10001035 # information.
10011036 # Note: The availability of this option depends on whether or not doxygen was
1002-# compiled with the --with-libclang option.
1037+# generated with the -Duse-libclang=ON option for CMake.
10031038 # The default value is: NO.
10041039
10051040 CLANG_ASSISTED_PARSING = NO
@@ -1159,8 +1194,9 @@ HTML_COLORSTYLE_GAMMA = 80
11591194
11601195 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
11611196 # page will contain the date and time when the page was generated. Setting this
1162-# to NO can help when comparing the output of multiple runs.
1163-# The default value is: YES.
1197+# to YES can help to show when doxygen was last run and thus if the
1198+# documentation is up to date.
1199+# The default value is: NO.
11641200 # This tag requires that the tag GENERATE_HTML is set to YES.
11651201
11661202 HTML_TIMESTAMP = YES
@@ -1634,9 +1670,12 @@ COMPACT_LATEX = NO
16341670 PAPER_TYPE = a4
16351671
16361672 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
1637-# that should be included in the LaTeX output. To get the times font for
1638-# instance you can specify
1639-# EXTRA_PACKAGES=times
1673+# that should be included in the LaTeX output. The package can be specified just
1674+# by its name or with the correct syntax as to be used with the LaTeX
1675+# \usepackage command. To get the times font for instance you can specify :
1676+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
1677+# To use the option intlimits with the amsmath package you can specify:
1678+# EXTRA_PACKAGES=[intlimits]{amsmath}
16401679 # If left blank no extra packages will be included.
16411680 # This tag requires that the tag GENERATE_LATEX is set to YES.
16421681
@@ -1739,6 +1778,14 @@ LATEX_SOURCE_CODE = NO
17391778
17401779 LATEX_BIB_STYLE = plain
17411780
1781+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
1782+# page will contain the date and time when the page was generated. Setting this
1783+# to NO can help when comparing the output of multiple runs.
1784+# The default value is: NO.
1785+# This tag requires that the tag GENERATE_LATEX is set to YES.
1786+
1787+LATEX_TIMESTAMP = NO
1788+
17421789 #---------------------------------------------------------------------------
17431790 # Configuration options related to the RTF output
17441791 #---------------------------------------------------------------------------
@@ -2123,7 +2170,7 @@ HIDE_UNDOC_RELATIONS = YES
21232170 # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
21242171 # Bell Labs. The other options in this section have no effect if this option is
21252172 # set to NO
2126-# The default value is: NO.
2173+# The default value is: YES.
21272174
21282175 HAVE_DOT = YES
21292176
@@ -2237,7 +2284,8 @@ INCLUDED_BY_GRAPH = YES
22372284 #
22382285 # Note that enabling this option will significantly increase the time of a run.
22392286 # So in most cases it will be better to enable call graphs for selected
2240-# functions only using the \callgraph command.
2287+# functions only using the \callgraph command. Disabling a call graph can be
2288+# accomplished by means of the command \hidecallgraph.
22412289 # The default value is: NO.
22422290 # This tag requires that the tag HAVE_DOT is set to YES.
22432291
@@ -2248,7 +2296,8 @@ CALL_GRAPH = YES
22482296 #
22492297 # Note that enabling this option will significantly increase the time of a run.
22502298 # So in most cases it will be better to enable caller graphs for selected
2251-# functions only using the \callergraph command.
2299+# functions only using the \callergraph command. Disabling a caller graph can be
2300+# accomplished by means of the command \hidecallergraph.
22522301 # The default value is: NO.
22532302 # This tag requires that the tag HAVE_DOT is set to YES.
22542303
@@ -2271,11 +2320,17 @@ GRAPHICAL_HIERARCHY = YES
22712320 DIRECTORY_GRAPH = YES
22722321
22732322 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
2274-# generated by dot.
2323+# generated by dot. For an explanation of the image formats see the section
2324+# output formats in the documentation of the dot tool (Graphviz (see:
2325+# http://www.graphviz.org/)).
22752326 # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
22762327 # to make the SVG files visible in IE 9+ (other browsers do not have this
22772328 # requirement).
2278-# Possible values are: png, jpg, gif and svg.
2329+# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
2330+# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
2331+# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
2332+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
2333+# png:gdiplus:gdiplus.
22792334 # The default value is: png.
22802335 # This tag requires that the tag HAVE_DOT is set to YES.
22812336
@@ -2326,6 +2381,11 @@ DIAFILE_DIRS =
23262381
23272382 PLANTUML_JAR_PATH =
23282383
2384+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
2385+# configuration file for plantuml.
2386+
2387+PLANTUML_CFG_FILE =
2388+
23292389 # When using plantuml, the specified paths are searched for files specified by
23302390 # the !include statement in a plantuml block.
23312391
--- a/src/bxsf2frmsf.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
1-/*
2- The MIT License (MIT)
3-
4- Copyright (c) 2014 Mitsuaki KAWAMURA
5-
6- Permission is hereby granted, free of charge, to any person obtaining a copy
7- of this software and associated documentation files (the "Software"), to deal
8- in the Software without restriction, including without limitation the rights
9- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10- copies of the Software, and to permit persons to whom the Software is
11- furnished to do so, subject to the following conditions:
12-
13- The above copyright notice and this permission notice shall be included in
14- all copies or substantial portions of the Software.
15-
16- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22- THE SOFTWARE.
23-*/
24-/**@file
25-@brief Convert BXSF format to FRMSF format and compute Fermi velocity
26-*/
27-#include <stdio.h>
28-#include <stdlib.h>
29-#include <string.h>
30-#include <math.h>
31-
32-int Nb;//!< Number of bands
33-int Ng[3];//!< @f$k@f$-grid along each direction
34-
35-double Bvec[3][3];//!< Reciprocal lattice vector
36-
37-double ****Eig;//!< Eigenvalue @f$\varepsilon_{n k}@f$ [::Nb][::Ng[0]][::Ng[1]][::Ng[2]]
38-double *****vf;//!< Fermi velocity @f${\bf v}_{{\rm F} n k}@f$ [::Nb][::Ng[0]][::Ng[1]][::Ng[2]][7]
39-/*
40-@brief Read BXSF file
41-*/
42-static void read_dat(
43- char *fname//!<[in] Input file name
44-) {
45- FILE *fp;
46- char ctmp[256], ctmpEF1[16], ctmpEF2[16];
47- int ierr, ii, ib, ik0, ik1, ik2;
48- char *cerr;
49- double EF;
50-
51- if ((fp = fopen(fname, "r")) == NULL) {
52- printf("file open error!!\n");
53- printf(" Press any key to exit.\n");
54- ierr = getchar();
55- exit(EXIT_FAILURE);
56- }
57- printf("\n##### Reading BXSF file %s #####\n\n", fname);
58-
59- cerr = fgets(ctmp, 256, fp);
60- while (strstr(ctmp, "Fermi Energy:") == NULL) {
61- cerr = fgets(ctmp, 256, fp);
62- }
63- ierr = sscanf(ctmp, "%s %s %lf", ctmpEF1, ctmpEF2, &EF);
64- printf(" Fermi energy : %le\n", EF);
65-
66- cerr = fgets(ctmp, 256, fp);
67- while (strstr(ctmp, "BEGIN_BLOCK_BANDGRID_3D") == NULL) {
68- cerr = fgets(ctmp, 256, fp);
69- }
70- cerr = fgets(ctmp, 256, fp);
71- cerr = fgets(ctmp, 256, fp);
72-
73- cerr = fgets(ctmp, 256, fp);
74- ierr = sscanf(ctmp, "%d", &Nb);
75- printf(" Number of bands : %d \n", Nb);
76- cerr = fgets(ctmp, 256, fp);
77- ierr = sscanf(ctmp, "%d%d%d", &Ng[0], &Ng[1], &Ng[2]);
78- for (ii = 0; ii < 3; ii++) Ng[ii] -= 1;
79- printf(" k point grid : %d %d %d \n", Ng[0], Ng[1], Ng[2]);
80-
81- cerr = fgets(ctmp, 256, fp);
82- for (ii = 0; ii < 3; ++ii) {
83- cerr = fgets(ctmp, 256, fp);
84- ierr = sscanf(ctmp, "%le%le%le", &Bvec[0][ii], &Bvec[1][ii], &Bvec[2][ii]);
85- printf(" Bvec %d : %f %f %f \n", ii + 1, Bvec[0][ii], Bvec[1][ii], Bvec[2][ii]);
86- }
87-
88- Eig = new double***[Nb];
89- for (ib = 0; ib < Nb; ib++) {
90- Eig[ib] = new double**[Ng[0] + 1];
91- for (ik0 = 0; ik0 <= Ng[0]; ik0++) {
92- Eig[ib][ik0] = new double*[Ng[1] + 1];
93- for (ik1 = 0; ik1 <= Ng[1]; ik1++) {
94- Eig[ib][ik0][ik1] = new double[Ng[2] + 1];
95- }/*for (ik1 = 0; ik1 < Ng[1]; ik1++)*/
96- }/*for (ik0 = 0; ik0 < Ng[0]; ik0++)*/
97- }/*for (ib = 0; ib < Nb; ib++)*/
98-
99- for (ib = 0; ib < Nb; ib++) {
100- cerr = fgets(ctmp, 256, fp);
101- printf(" Reading %s", ctmp);
102-
103- for (ik0 = 0; ik0 <= Ng[0]; ik0++) {
104- for (ik1 = 0; ik1 <= Ng[1]; ik1++) {
105- for (ik2 = 0; ik2 <= Ng[2]; ik2++) {
106- ierr = fscanf(fp, "%le", &Eig[ib][ik0][ik1][ik2]);
107- Eig[ib][ik0][ik1][ik2] -= EF;
108- }/*for (ik2 = 0; ik2 < Ng[2]; ik2++)*/
109- }/*for (ik1 = 0; ik1 < Ng[1]; ik1++)*/
110- }/*for (ik0 = 0; ik0 < Ng[0]; ik0++)*/
111-
112- cerr = fgets(ctmp, 256, fp);
113-
114- }/*for (ib = 0; ib < Nb; ib++)*/
115-}
116-/**
117-@brief This routine compute the Fermi verocity from differentiate of e_{n k}.
118-*/
119-static void fvel() {
120- int ik0, ik1, ik2, ib, ii, jj, ikv[3], ikp[3], ikm[3];
121- double de[3];
122- double det, avec[3][3], alength[3];
123-
124- printf("\n##### Compute the Fermi velocity #####\n\n");
125-
126- /*
127- Compute direct lattice vectors
128- */
129- det = -Bvec[0][2] * Bvec[1][1] * Bvec[2][0]
130- + Bvec[0][1] * Bvec[1][2] * Bvec[2][0]
131- + Bvec[0][2] * Bvec[1][0] * Bvec[2][1]
132- - Bvec[0][0] * Bvec[1][2] * Bvec[2][1]
133- - Bvec[0][1] * Bvec[1][0] * Bvec[2][2]
134- + Bvec[0][0] * Bvec[1][1] * Bvec[2][2];
135-
136- avec[0][0] = -Bvec[1][2] * Bvec[2][1] + Bvec[1][1] * Bvec[2][2];
137- avec[0][1] = Bvec[0][2] * Bvec[2][1] - Bvec[0][1] * Bvec[2][2];
138- avec[0][2] = -Bvec[0][2] * Bvec[1][1] + Bvec[0][1] * Bvec[1][2];
139- avec[1][0] = Bvec[1][2] * Bvec[2][0] - Bvec[1][0] * Bvec[2][2];
140- avec[1][1] = -Bvec[0][2] * Bvec[2][0] + Bvec[0][0] * Bvec[2][2];
141- avec[1][2] = Bvec[0][2] * Bvec[1][0] - Bvec[0][0] * Bvec[1][2];
142- avec[2][0] = -Bvec[1][1] * Bvec[2][0] + Bvec[1][0] * Bvec[2][1];
143- avec[2][1] = Bvec[0][1] * Bvec[2][0] - Bvec[0][0] * Bvec[2][1];
144- avec[2][2] = -Bvec[0][1] * Bvec[1][0] + Bvec[0][0] * Bvec[1][1];
145- for (ii = 0; ii < 3; ++ii) {
146- for (jj = 0; jj < 3; ++jj) avec[ii][jj] /= det;
147- printf(" avec %d : %f %f %f \n", ii + 1, avec[ii][0], avec[ii][1], avec[ii][2]);
148- }
149-
150- for (ii = 0; ii < 3; ii++)
151- alength[ii] = sqrt(
152- avec[0][ii] * avec[0][ii] + avec[1][ii] * avec[1][ii] + avec[2][ii] * avec[2][ii]);
153- printf(" alength : %f %f %f \n", alength[0], alength[1], alength[2]);
154- /*
155- malloc fermi velocity
156- */
157- vf = new double****[Nb];
158- for (ib = 0; ib < Nb; ib++) {
159- vf[ib] = new double***[Ng[0]];
160- for (ik0 = 0; ik0 < Ng[0]; ik0++) {
161- vf[ib][ik0] = new double**[Ng[1]];
162- for (ik1 = 0; ik1 < Ng[1]; ik1++) {
163- vf[ib][ik0][ik1] = new double*[Ng[2]];
164- for (ik2 = 0; ik2 < Ng[2]; ik2++) {
165- vf[ib][ik0][ik1][ik2] = new double[7];
166- }
167- }/*for (ik1 = 0; ik1 < Ng[1]; ik1++)*/
168- }/*for (ik0 = 0; ik0 < Ng[0]; ik0++)*/
169- }/*for (ib = 0; ib < Nb; ib++)*/
170-
171- for (ik0 = 0; ik0 < Ng[0]; ik0++) {
172- ikv[0] = ik0;
173- for (ik1 = 0; ik1 < Ng[1]; ik1++) {
174- ikv[1] = ik1;
175- for (ik2 = 0; ik2 < Ng[2]; ik2++) {
176- ikv[2] = ik2;
177-
178- for (ib = 0; ib < Nb; ib++) {
179- for (ii = 0; ii < 3; ii++) {
180-
181- for (jj = 0; jj < 3; jj++) {
182- ikp[jj] = ikv[jj];
183- ikm[jj] = ikv[jj];
184- }
185- if(ikv[ii] == Ng[ii] - 1) ikp[ii] = 0;
186- else ikp[ii] += 1;
187-
188- if (ikv[ii] == 0) ikm[ii] = Ng[ii] - 1;
189- else ikm[ii] -= 1;
190-
191- de[ii] = Eig[ib][ikp[0]][ikp[1]][ikp[2]]
192- - Eig[ib][ikm[0]][ikm[1]][ikm[2]];
193- de[ii] *= 0.5 * (double)Ng[ii];
194- }/*for (ii = 0; ii < 3; ii++)*/
195-
196- for (ii = 0; ii < 3; ii++) {
197- vf[ib][ik0][ik1][ik2][ii] = de[ii] * alength[ii];
198- vf[ib][ik0][ik1][ik2][ii + 3] =
199- avec[0][ii] * de[0] + avec[1][ii] * de[1] + avec[2][ii] * de[2];
200- }/*for (ii = 0; ii < 3; ii++)*/
201- vf[ib][ik0][ik1][ik2][6] = sqrt(
202- vf[ib][ik0][ik1][ik2][3] * vf[ib][ik0][ik1][ik2][3]
203- + vf[ib][ik0][ik1][ik2][4] * vf[ib][ik0][ik1][ik2][4]
204- + vf[ib][ik0][ik1][ik2][5] * vf[ib][ik0][ik1][ik2][5]);
205-
206- }/*for (ib = 0; ib < Nb; ib++)*/
207- }/* for (ik2 = 0; ik2 < Ng[2]; ik2++)*/
208- }/*for (ik1 = 0; ik1 < Ng[1]; ik1++)*/
209- }/* for (ik0 = 0; ik0 < Ng[0]; ik0++)*/
210-}/*void fvel()*/
211-/**
212-@brief Write FRMSF file
213-*/
214-static void write_file(
215- char *fname1, //!< [in] File name without
216- const char *ext, //!< [in] File tail
217- int component //!< [in] Component of the Fermi velocity
218-)
219-{
220- FILE* fo;
221- int ierr, ibnd, ik0, ik1, ik2, ii;
222- char fname2[256];
223- char *p;
224-
225- ii = 0;
226- if (strstr(fname1, ".bxsf") != NULL) {
227- for (p = &fname1[0]; p < strstr(fname1, ".bxsf"); p++) fname2[ii++] = *p;
228- }
229- else if (strstr(fname1, ".BXSF") != NULL) {
230- for (p = &fname1[0]; p < strstr(fname1, ".BXSF"); p++) fname2[ii++] = *p;
231- }
232- else if (strstr(fname1, ".Bxsf") != NULL) {
233- for (p = &fname1[0]; p < strstr(fname1, ".Bxsf"); p++) fname2[ii++] = *p;
234- }
235- else {
236- printf("ERROR! Extension shoud be .bxsf, .BXSF, or .Bxsf !\n");
237- printf(" Press any key to exit.\n");
238- ierr = getchar();
239- exit(-1);
240- }
241- sprintf(&fname2[ii], "%s", ext);
242-
243- printf(" %s\n", fname2);
244-
245- fo = fopen(fname2, "w");
246- ierr = fprintf(fo, "%d %d %d\n", Ng[0], Ng[1], Ng[2]);
247- ierr = fprintf(fo, "%d\n", 1);
248- ierr = fprintf(fo, "%d\n", Nb);
249- ierr = fprintf(fo, "%e %e %e\n", Bvec[0][0], Bvec[1][0], Bvec[2][0]);
250- ierr = fprintf(fo, "%e %e %e\n", Bvec[0][1], Bvec[1][1], Bvec[2][1]);
251- ierr = fprintf(fo, "%e %e %e\n", Bvec[0][2], Bvec[1][2], Bvec[2][2]);
252-
253- for (ibnd = 0; ibnd < Nb; ++ibnd) {
254- for (ik0 = 0; ik0 < Ng[0]; ++ik0) {
255- for (ik1 = 0; ik1 < Ng[1]; ++ik1) {
256- for (ik2 = 0; ik2 < Ng[2]; ++ik2) {
257- ierr = fprintf(fo, "%e\n", Eig[ibnd][ik0][ik1][ik2]);
258- }
259- }
260- }
261- }
262- if (component != 7) {
263- for (ibnd = 0; ibnd < Nb; ++ibnd) {
264- for (ik0 = 0; ik0 < Ng[0]; ++ik0) {
265- for (ik1 = 0; ik1 < Ng[1]; ++ik1) {
266- for (ik2 = 0; ik2 < Ng[2]; ++ik2) {
267- ierr = fprintf(fo, "%e\n", vf[ibnd][ik0][ik1][ik2][component]);
268- }
269- }
270- }
271- }
272- }
273- fclose(fo);
274-
275-}/*void write_file()*/
276-/*
277- @brief Main routine of BXSF2FRMSF
278-*/
279-int main(
280- int argc, //!< [in]
281- char *argv[] //!< [in] Input file name
282-)
283-{
284- int ierr;
285-
286- if (argc < 2) {
287- printf("\n\nInput file is not specified !\n");
288- printf(" Press any key to exit.\n");
289- ierr = getchar();
290- exit(-1);
291- }
292-
293- read_dat(argv[1]);
294-
295- fvel();
296-
297- if (argc > 2 && strncmp(argv[2], "-v", 2) == 0) {
298- printf("\n##### Output files #####\n\n");
299-
300- write_file(argv[1], "_vfa1.frmsf\0", 0);
301- write_file(argv[1], "_vfa2.frmsf\0", 1);
302- write_file(argv[1], "_vfa3.frmsf\0", 2);
303- write_file(argv[1], "_vfx.frmsf\0", 3);
304- write_file(argv[1], "_vfy.frmsf\0", 4);
305- write_file(argv[1], "_vfz.frmsf\0", 5);
306- write_file(argv[1], "_vf.frmsf\0", 6);
307-
308- printf("\n##### DONE #####\n");
309- printf(" Press any key to exit.\n");
310- ierr = getchar();
311- }
312- else {
313- write_file(argv[1], ".frmsf\0", 7);
314- }
315-}
Show on old repository browser