56#include "aflowlib/aflowlib_libraries_scrubber.h"
57#include "aflowlib/aflowlib_web_outreach.h"
58#include "extern/SQLITE/sqlite3.h"
59#include "flow/aflow_ivasp.h"
60#include "flow/aflow_pflow.h"
61#include "interfaces/aflow_pthreads.h"
62#include "modules/POCC/aflow_pocc.h"
63#include "structure/aflow_xatom.h"
64#include "structure/aflow_xstructure.h"
65#include "test/aflow_test.cpp"
66#include "test/aflow_unit_test.h"
75using std::stringstream;
78int main(
int _argc,
char **_argv) {
81 const bool LDEBUG =
false;
84 cerr <<
"AFLOW-MAIN [1]" << endl;
88 cerr <<
"AFLOW-MAIN [2]" << endl;
90 std::vector<string> cmds;
93 curl_global_init(CURL_GLOBAL_SSL);
101 if (LDEBUG ||
XHOST.DEBUG) {
102 cerr <<
"AFLOW-MAIN [3]" << endl;
130 if (KBIN::VASP_PseudoPotential_CleanName_TEST()) {
137 const bool LDEBUG =
true;
157 cerr << submat << endl;
162 cerr <<
__AFLOW_FUNC__ <<
" replacing with submat at 1,1" << endl;
205 for (
uint i = 0; i < 200; i++) {
207 cout <<
"mv \"unknown.pdf\" stefano_" << y << m <<
".pdf" << endl;
210 cout <<
"mv \"unknown(" << i <<
").pdf\" stefano_" << y <<
"0" << m <<
".pdf" << endl;
212 cout <<
"mv \"unknown(" << i <<
").pdf\" stefano_" << y << m <<
".pdf" << endl;
227 vector<string> tests;
229 unittest::UnitTest ut(std::cout);
230 return (ut.runTestSuites(tests) ? 0 : 1);
237 for (
size_t iext = 0; iext <
XHOST.vext.size(); iext++) {
238 cout <<
"\"" <<
XHOST.vext[iext] <<
"\"" <<
" " <<
"\"" <<
XHOST.vcat[iext] <<
"\"" << endl;
242 cout <<
"dimm=" << dim << endl;
246 for (
int i = 1; i <= dim; i++) {
247 for (
int j = 1; j <= dim; j++) {
251 cout <<
"m=" << endl << m << endl;
253 cout <<
"mi=" << endl << mi << endl;
254 cout <<
"mi*m=" << endl <<
det(mi * m) << endl;
261 const string test =
"2.730747137 -2.730747137-12.397646334";
262 vector<string> _tokens;
264 for (
size_t i = 0; i < _tokens.size(); i++) {
265 cerr << _tokens[i] << endl;
272 char *err_msg =
nullptr;
273 int rc = sqlite3_open(
"test.db", &db);
274 if (rc != SQLITE_OK) {
275 fprintf(stderr,
"Cannot open database: %s\n", sqlite3_errmsg(db));
280 "DROP TABLE IF EXISTS Cars;"
281 "CREATE TABLE Cars(Id INT, Name TEXT, Price INT);"
282 "INSERT INTO Cars VALUES(1, 'Audi', 52642);"
283 "INSERT INTO Cars VALUES(2, 'Mercedes', 57127);"
284 "INSERT INTO Cars VALUES(3, 'Skoda', 9000);"
285 "INSERT INTO Cars VALUES(4, 'Volvo', 29000);"
286 "INSERT INTO Cars VALUES(5, 'Bentley', 350000);"
287 "INSERT INTO Cars VALUES(6, 'Citroen', 21000);"
288 "INSERT INTO Cars VALUES(7, 'Hummer', 41400);"
289 "INSERT INTO Cars VALUES(8, 'Volkswagen', 21600);";
290 rc = sqlite3_exec(db, sql,
nullptr,
nullptr, &err_msg);
291 if (rc != SQLITE_OK) {
292 fprintf(stderr,
"SQL error: %s\n", err_msg);
293 sqlite3_free(err_msg);
325 cerr << sqlite3_libversion() << endl;
328 cout << x.
re <<
"," << x.
im <<
" - " << x.
real() <<
"," << x.
imag() <<
" - " << x << endl;
331 cout << x.
re <<
"," << x.
im <<
" - " << x.
real() <<
"," << x.
imag() <<
" - " << x << endl;
334 stringstream for_corey;
335 for_corey <<
"scatter/use mapped color={draw=black,fill=mapped color,solid}";
336 const string corey = for_corey.str();
337 cout << corey << endl;
339 aus <<
"************************ 00000 MESSAGE KPOINTS KSHIFT=[" << 1 <<
" " << 2 <<
" " << 3 <<
"]" <<
" ************************ " << endl;
340 cout << aus.str() << endl;
347 cout << b64String << endl;
411 XHOST.PSEUDOPOTENTIAL_GENERATOR =
true;
413 for (
size_t ifile = 0; ifile < vfile.size(); ifile++) {
414 cerr <<
"PROCESSING = " << vfile[ifile] << endl;
415 const xPOTCAR xPOT(vfile[ifile]);
421 XHOST.PSEUDOPOTENTIAL_GENERATOR =
false;
423 for (
size_t ifile = 0; ifile < vfile.size(); ifile++) {
424 cerr <<
"PROCESSING = " << vfile[ifile] << endl;
425 const xOUTCAR xOUT(vfile[ifile]);
453 vector<xstructure> vstr;
454 aflowlib::_aflowlib_entry data;
455 vector<aflowlib::_aflowlib_entry> vdata;
458 data.url2aflowlib(
"materials.duke.edu:AFLOWDATA/ICSD_WEB/" +
BRAVAIS_LATTICES[i] +
"/?format=text", cout,
false);
459 vdata.push_back(data);
460 cout <<
"AFLOWLIB " <<
BRAVAIS_LATTICES[i] <<
"=" << data.vaflowlib_entries.size() << endl;
461 for (
size_t j = 0; j < data.vaflowlib_entries.size(); j++) {
462 aflowlib::_aflowlib_entry dataj;
463 dataj.url2aflowlib(
"materials.duke.edu:AFLOWDATA/ICSD_WEB/" +
BRAVAIS_LATTICES[i] +
"/" + data.vaflowlib_entries[j], cout,
true);
465 if (!dataj.aurl.empty()) {
466 const xstructure str(dataj.aurl,
"CONTCAR.relax.vasp",
IOAFLOW_AUTO);
478 cerr <<
"vstr.size()=" << vstr.size() <<
" "
479 <<
"str.atoms.size()=" << str.atoms.size() <<
" "
498 if (!Arun &&
XHOST.vflag_control.flag(
"MACHINE")) {
508 if (!Arun &&
XHOST.vflag_control.flag(
"SWITCH_AFLOW")) {
513 if (!Arun &&
XHOST.vflag_control.flag(
"AFLOWIN_SYM")) {
518 if (!Arun && (
XHOST.vflag_aflow.flag(
"CLEAN") ||
XHOST.vflag_aflow.flag(
"XCLEAN") ||
XHOST.AFLOW_RUNDIRflag ||
XHOST.AFLOW_MULTIflag ||
XHOST.AFLOW_RUNXflag)) {
536 if (!Arun &&
XHOST.vflag_control.flag(
"MULTI=SH")) {
538 AFLOW_PTHREADS::MULTI_sh(argv);
541 if (!Arun &&
XHOST.vflag_control.flag(
"MONITOR")) {
546 if (!Arun &&
XHOST.vflag_control.flag(
"MONITOR_VASP")) {
551 if (!Arun &&
XHOST.vflag_control.flag(
"GETTEMP")) {
560 stringstream banner_message;
561 if (
XHOST.vflag_control.flag(
"AFLOW_HELP")) {
563 }
else if (
XHOST.vflag_control.flag(
"AFLOW_EXCEPTIONS")) {
565 }
else if (
XHOST.vflag_control.flag(
"README_AFLOW_LICENSE_GPL3")) {
567 banner_message <<
" " << endl;
569 banner_message <<
" " << endl;
570 banner_message <<
"*************************************************************************** " << endl;
571 }
else if (
XHOST.vflag_control.flag(
"README_AFLOW")) {
573 }
else if (
XHOST.vflag_control.flag(
"README_AFLOW_VERSIONS_HISTORY")) {
575 }
else if (
XHOST.vflag_control.flag(
"README_AFLOW_PFLOW")) {
577 }
else if (
XHOST.vflag_control.flag(
"README_FROZSL")) {
579 }
else if (
XHOST.vflag_control.flag(
"README_APL")) {
581 }
else if (
XHOST.vflag_control.flag(
"README_QHA")) {
583 }
else if (
XHOST.vflag_control.flag(
"README_AAPL")) {
585 }
else if (
XHOST.vflag_control.flag(
"README_AGL")) {
587 }
else if (
XHOST.vflag_control.flag(
"README_AEL")) {
589 }
else if (
XHOST.vflag_control.flag(
"README_ANRL")) {
591 }
else if (
XHOST.vflag_control.flag(
"README_COMPARE")) {
593 }
else if (
XHOST.vflag_control.flag(
"README_GFA")) {
595 }
else if (
XHOST.vflag_control.flag(
"README_SYMMETRY")) {
597 }
else if (
XHOST.vflag_control.flag(
"README_CCE")) {
599 }
else if (
XHOST.vflag_control.flag(
"README_CHULL")) {
601 }
else if (
XHOST.vflag_control.flag(
"README_PARTIAL_OCCUPATION")) {
603 }
else if (
XHOST.vflag_control.flag(
"README_SCRIPTING")) {
605 }
else if (
XHOST.vflag_control.flag(
"README_EXCEPTIONS")) {
607 }
else if (
XHOST.vflag_control.flag(
"README_XAFLOW")) {
609 }
else if (
XHOST.vflag_control.flag(
"README_AFLOWRC")) {
613 if (!banner_message.str().empty()) {
614 std::cout << (
XHOST.vflag_control.flag(
"WWW") ?
aurostd::text2html(banner_message.str()) : banner_message.str()) << std::endl;
620 if (ProcessPhpLatexCv()) {
628 if (!Arun && VVERSION) {
634 if (!Arun &&
XHOST.TEST) {
636 cerr <<
"test" << endl;
663 curl_global_cleanup();
664 return (Arun ? return_code : 1);
689 stringstream strstream;
691 strstream <<
"***************************************************************************" << endl;
692 strstream <<
"* *" << endl;
693 strstream <<
"* AFLOW - Duke University 2003-2024 *" << endl;
694 strstream <<
"* *" << endl;
695 strstream <<
"***************************************************************************" << endl;
696 strstream <<
"Copyright 2003-2023 - AFLOW.ORG consortium" << endl;
698 strstream <<
"This file is part of AFLOW software." << endl;
700 strstream <<
"AFLOW is free software: you can redistribute it and/or modify" << endl;
701 strstream <<
"it under the terms of the GNU General Public License as published by" << endl;
702 strstream <<
"the Free Software Foundation, either version 3 of the License, or" << endl;
703 strstream <<
"(at your option) any later version." << endl;
705 strstream <<
"This program is distributed in the hope that it will be useful," << endl;
706 strstream <<
"but WITHOUT ANY WARRANTY; without even the implied warranty of" << endl;
707 strstream <<
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" << endl;
708 strstream <<
"GNU General Public License for more details." << endl;
710 strstream <<
"You should have received a copy of the GNU General Public License" << endl;
711 strstream <<
"along with this program. If not, see <http://www.gnu.org/licenses/>." << endl;
713 strstream <<
"***************************************************************************" << endl;
715 return strstream.str();
726 stringstream strstream;
727 const string tab =
" ";
729 for (
size_t i = 0; i < x.size(); i++) {
733 strstream <<
"******* BEGIN INFORMATION MODE *********************************************************************" << endl;
734 strstream << tab << x <<
" -h|--help|--readme_aflow CHECK" << endl;
735 strstream << tab << x <<
" --version|-v CHECK" << endl;
736 strstream << tab << x <<
" --machine CHECK" << endl;
737 strstream <<
"******* END INFORMATION MODE ***********************************************************************" << endl;
739 strstream <<
"******* BEGIN RUNNING MODE *************************************************************************" << endl;
740 strstream << tab << x <<
" --run|--run=multi|--run=N COMMANDS for running" << endl;
741 strstream << tab << x <<
" --clean|-c COMMAND for cleaning " << endl;
743 strstream <<
" MODIFIERS" << endl;
744 strstream << tab <<
" --DIRECTORY[=| ]dir|--D[=| ]dir|--d[=| ]dir" << endl;
745 strstream << tab <<
" --FILE[=| ]file|--F[=| ]file|--f[=| ]file " << endl;
746 strstream << tab <<
" --quiet|-quiet|-q " << endl;
747 strstream << tab <<
" --loop " << endl;
748 strstream << tab <<
" --sort|-sort" << endl;
749 strstream << tab <<
" --reverse|-rsort" << endl;
750 strstream << tab <<
" --random|-rnd" << endl;
751 strstream << tab <<
" --force|-force" << endl;
752 strstream << tab <<
" --mem=XX|--maxmem=XX" << endl;
753 strstream << tab <<
" --readme= xaflow|aflow|aconvasp|aflowrc|scripting|apl|agl|ael|anrl|compare|gfa|symmetry|chull|errors|exceptions|frozsl CHECK !!!!" << endl;
754 strstream << tab <<
" --np=NUMBER|--npmax" << endl;
755 strstream << tab <<
" --generate_aflowin_from_vasp" << endl;
756 strstream << tab <<
" --generate_vasp_from_aflowin|--generate" << endl;
757 strstream << tab <<
" --use_aflow.in=XXX" << endl;
758 strstream << tab <<
" --use_LOCK=XXX" << endl;
759 strstream << tab <<
" --use_tmpfs=XXXX " << endl;
761 strstream <<
" MODIFIERS MPI/SERIAL PARAMETERS" << endl;
762 strstream << tab <<
" --mpi|-nompi|--serial " << endl;
764 strstream <<
" HOST ORIENTED OPTION" << endl;
765 strstream << tab <<
" --machine=beta|beta_openmpi|qrats|qflow|x|conrad|eos|materials|habana|aflowlib|ranger|kraken" << endl;
766 strstream << tab <<
" marylou|parsons|jellium|ohad|host1" << endl;
767 strstream << tab <<
" raptor --np=N|diamond --np=N" << endl;
768 strstream << tab <<
" --machine_name=XXXX " << endl;
769 strstream <<
"******* END RUNNING MODE ***************************************************************************" << endl;
772 return strstream.str();
782 stringstream strstream;
783 const string tab =
" ";
785 strstream <<
"******* BEGIN SCRIPTING MODE ***********************************************************************" << endl;
786 strstream <<
" AFLOW SCRIPTING COMMANDS" << endl;
787 strstream << tab << x <<
" --justafter=string" << endl;
788 strstream << tab << x <<
" --justbefore=string" << endl;
789 strstream << tab << x <<
" --justbetween=string_from[,string_to]" << endl;
790 strstream << tab << x <<
" --qsub=N,file" << endl;
791 strstream << tab << x <<
" --qdel=aaa,nnn:mmm,aaa,bbb,ccc" << endl;
792 strstream << tab << x <<
" --bsub=N,file" << endl;
793 strstream << tab << x <<
" --bkill=aaa,nnn:mmm,aaa,bbb,ccc" << endl;
794 strstream << tab << x <<
" --sbatch=N,file" << endl;
795 strstream << tab << x <<
" --scancel=aaa,nnn:mmm,aaa,bbb,ccc" << endl;
796 strstream << tab << x <<
" --kill=aaa,nnn:mmm,aaa,bbb,ccc" << endl;
797 strstream << tab << x <<
" --multi=sh [--np=NUMBER|npmax|nothing] [--F[ILE]] file" << endl;
798 strstream << tab << x <<
" --getTEMP [--runstat|--runbar|--refresh=X|--warning_beep=T|--warning_halt=T|--mem=XX]" << endl;
799 strstream << tab << x <<
" --monitor [--mem=XX]" << endl;
800 strstream <<
"******* END SCRIPTING MODE *************************************************************************" << endl;
802 return strstream.str();
812 stringstream strstream;
813 const string tab =
" ";
815 for (
size_t i = 0; i < x.size(); i++) {
818 strstream <<
"******* BEGIN HELP MODE ****************************************************************************" << endl;
819 strstream <<
" AFLOW HELP AVAILABLE HELPS" << endl;
820 strstream << tab << x <<
" --license" << endl;
821 strstream << tab << xspaces <<
" " << tab <<
"License information." << endl;
822 strstream << tab << x <<
" --help" << endl;
823 strstream << tab << xspaces <<
" " << tab <<
"This help." << endl;
824 strstream << tab << x <<
" --readme" << endl;
825 strstream << tab << xspaces <<
" " << tab <<
"The list of all the commands available." << endl;
826 strstream << tab << x <<
" --readme=xaflow" << endl;
827 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the installation of aflow." << endl;
828 strstream << tab << x <<
" --readme=aflow|--readme=run|--readme_aflow" << endl;
829 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"running machinery\"." << endl;
830 strstream << tab << x <<
" --readme=aflowrc" << endl;
831 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the installation of aflow." << endl;
832 strstream << tab << x <<
" --readme=pflow|--readme=processor|--readme=aconvasp|--readme_aconvasp" << endl;
833 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"processing machinery\"." << endl;
834 strstream << tab << x <<
" --readme=scripting|--readme_scripting" << endl;
835 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"scripting\" operations." << endl;
836 strstream << tab << x <<
" --readme=apl|--readme_apl" << endl;
837 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-harmonic-phonon-library\"." << endl;
838 strstream << tab << x <<
" --readme=qha|--readme_qha|--readme=qha3p|--readme_qha3p|--readme=scqha|--readme_scqha" << endl;
839 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-quasi-harmonic-library\"." << endl;
840 strstream << tab << x <<
" --readme=aapl|--readme_aapl" << endl;
841 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-anharmonic-phonon-library (AFLOW-AAPL)\"." << endl;
842 strstream << tab << x <<
" --readme=agl|--readme_agl" << endl;
843 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-gibbs-library (AFLOW-AGL)\"." << endl;
844 strstream << tab << x <<
" --readme=ael|--readme_ael" << endl;
845 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-elastic-library (AFLOW-AEL)\"." << endl;
846 strstream << tab << x <<
" --readme=prototypes|--readme_prototypes|--readme=anrl|--readme_anrl" << endl;
847 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow library of prototypes\"." << endl;
848 strstream << tab << x <<
" --readme=xtalfinder|--readme_xtalfinder|--readme=compare|--readme_compare" << endl;
849 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"aflow-crystal-finder (AFLOW-XtalFinder) code\"." << endl;
850 strstream << tab << x <<
" --readme=gfa|--readme_gfa" << endl;
851 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"glass-forming-ability code\"." << endl;
852 strstream << tab << x <<
" --readme=symmetry|--readme_symmetry" << endl;
853 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"symmetry library (AFLOW-SYM)\"." << endl;
854 strstream << tab << x <<
" --readme=chull|--readme_chull" << endl;
855 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"convex hull library (AFLOW-hull)\"." << endl;
856 strstream << tab << x <<
" --readme=errors|--readme=exceptions|--readme_errors|--readme_exceptions" << endl;
857 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for exception handling in AFLOW." << endl;
858 strstream << tab << x <<
" --readme=partial_occupation|--readme=pocc|--readme_pocc" << endl;
859 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"partial occupation library\"." << endl;
860 strstream << tab << x <<
" --readme=frozsl|--readme_frozsl" << endl;
861 strstream << tab << xspaces <<
" " << tab <<
"Returns the HELP information for the \"frozsl\" add ons." << endl;
862 strstream <<
"******* END HELP MODE ******************************************************************************" << endl;
864 return strstream.str();
874 if (type ==
"VERSION" || type ==
"AFLOW_VERSION") {
876 oss <<
"AFLOW VERSION " << string(AFLOW_VERSION) <<
" Automatic-FLOW [(C) " <<
XHOST.Copyright_Years <<
" aflow.org consortium]" << endl;
877 oss <<
"New versions are available here: <http://" <<
XHOST.AFLOW_MATERIALS_SERVER <<
"/AFLOW/>" << endl;
879 oss <<
"AFLOW is free software: you can redistribute it and/or modify it under the terms of the" << endl;
880 oss <<
"GNU General Public License as published by the Free Software Foundation, either version 3" << endl;
881 oss <<
"of the License, or (at your option) any later version." << endl;
883 oss <<
"This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;" << endl;
884 oss <<
"without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl;
885 oss <<
"See the GNU General Public License for more details." << endl;
887 oss <<
"You should have received a copy of the GNU General Public License along with this program." << endl;
888 oss <<
"If not, see <http://www.gnu.org/licenses/>." << endl;
890 oss <<
"AFLOW V" << string(AFLOW_VERSION) <<
" [" <<
XHOST.hostname <<
"] [" <<
XHOST.machine_type <<
"] [" <<
XHOST.CPU_Cores <<
"] [" <<
XHOST.Find_Parameters <<
"]" << endl;
894 if (type ==
"INTRODUCTION") {
896 oss <<
"MMMMM AFLOW VERSION " << string(AFLOW_VERSION) <<
" Automatic-FLOW for materials discovery - [" << TODAY <<
"] -" <<
aflow_get_time_string() << endl;
898 oss <<
"MMMMM AFLOW.org consortium - High-Throughput ab-initio Computing Project - (C) " <<
XHOST.Copyright_Years <<
" " << endl;
900 oss <<
"MMMMM AFLOW is free software: you can redistribute it and/or modify it under the terms of the" << endl;
901 oss <<
"MMMMM GNU General Public License as published by the Free Software Foundation, either version 3" << endl;
902 oss <<
"MMMMM of the License, or (at your option) any later version." << endl;
903 oss <<
"MMMMM " << endl;
904 oss <<
"MMMMM This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;" << endl;
905 oss <<
"MMMMM without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl;
906 oss <<
"MMMMM See the GNU General Public License for more details." << endl;
907 oss <<
"MMMMM " << endl;
908 oss <<
"MMMMM You should have received a copy of the GNU General Public License along with this program." << endl;
909 oss <<
"MMMMM If not, see <http://www.gnu.org/licenses/>." << endl;
910 oss <<
"MMMMM " << endl;
913 if (type ==
"BANNER_NORMAL") {
914 oss <<
"****************************************************************************************************" << endl;
915 oss <<
"MMMMM AFLOW V" << string(AFLOW_VERSION) <<
" Automatic-FLOW [" << TODAY <<
"] - " << endl;
916 oss <<
"****************************************************************************************************" << endl;
919 if (type ==
"BANNER_BIG") {
920 oss <<
"****************************************************************************************************" << endl;
921 oss <<
"* *" << endl;
922 oss <<
"* aflow - Automatic-FLOW for materials discovery *" << endl;
923 oss <<
"* aflow.org consortium - High-Throughput ab-initio Computing Project *" << endl;
929 oss <<
"* *" << endl;
930 oss <<
"****************************************************************************************************" << endl;
931 oss <<
"* *" << endl;
932 oss <<
"* AFLOW is free software: you can redistribute it and/or modify it under the terms of the *" << endl;
933 oss <<
"* GNU General Public License as published by the Free Software Foundation, either version 3 *" << endl;
934 oss <<
"* of the License, or (at your option) any later version. *" << endl;
935 oss <<
"* *" << endl;
936 oss <<
"* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; *" << endl;
937 oss <<
"* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *" << endl;
938 oss <<
"* See the GNU General Public License for more details. *" << endl;
939 oss <<
"* *" << endl;
940 oss <<
"* You should have received a copy of the GNU General Public License along with this program. *" << endl;
941 oss <<
"* If not, see <http://www.gnu.org/licenses/>. *" << endl;
942 oss <<
"* *" << endl;
943 oss <<
"****************************************************************************************************" << endl;
944 oss <<
"* *" << endl;
945 oss <<
"* Use of AFLOW software and repositories welcomes references to the following publications: *" << endl;
946 oss <<
"* *" << endl;
947 oss <<
"* Eckert et al. npj Comput. Mater. 11, 40 (2025) 10.1038/s41524-025-01529-1 (Soliquidy) *" << endl;
948 oss <<
"* Eckert et al. Comp. Mat. Sci. 240, 112988 (2024) 10.1016/j.commatsci.2024.112988 (proto4) *" << endl;
949 oss <<
"* Divilov et al. Acta Mater. 266, 119667 (2024) 10.1016/j.actamat.2024.119667 (spinodal) *" << endl;
950 oss <<
"* Divilov et al. Nature 625, 66-73 (2024) 10.1038/s41586-023-06786-y (DEED) *" << endl;
951 oss <<
"* Friedrich et al. J. Chem. Phys. 160, 042501 (2024) 10.1063/5.0184917 (CCE2) *" << endl;
952 oss <<
"* Esters et al. Comp. Mat. Sci. 216, 111808 (2023) 10.1016/j.commatsci.2022.111808 (AFLOW.org) *" << endl;
953 oss <<
"* Oses et al. Comp. Mat. Sci. 217, 111889 (2023) 10.1016/j.commatsci.2022.111889 (aflow++) *" << endl;
954 oss <<
"* Friedrich et al. npj Comput. Mater. 5, 59 (2019) 10.1038/s41524-019-0192-1 (CCE) *" << endl;
955 oss <<
"* Hicks et al. Comp. Mat. Sci. 161, S1 (2019) 10.1016/j.commatsci.2018.10.043 (ANRL proto2) *" << endl;
956 oss <<
"* Oses et al. J. Chem. Inf. Model. (2018) 10.1021/acs.jcim.8b00393 (AFLOW-CHULL) *" << endl;
957 oss <<
"* Gossett et al. Comp. Mat. Sci. 152, 134 (2018) 10.1016/j.commatsci.2018.03.075 (AFLOW-ML) *" << endl;
958 oss <<
"* Hicks et al. Acta Cryst. A74, 184-203 (2018) 10.1107/S2053273318003066 (AFLOW-SYM) *" << endl;
959 oss <<
"* MBNardelli et al Comp. Mat. Sci. 143, 462 (2018) 10.1016/j.commatsci.2017.11.034 (PAOFLOW) *" << endl;
960 oss <<
"* Rose et al. Comp. Mat. Sci. 137, 362 (2017) 10.1016/j.commatsci.2017.04.036 (AFLUX lang) *" << endl;
961 oss <<
"* Supka et al. Comp. Mat. Sci. 136, 76 (2017) 10.1016/j.commatsci.2017.03.055 (AFLOWpi) *" << endl;
962 oss <<
"* Plata et al. npj Comput. Mater. 3, 45 (2017) 10.1038/s41524-017-0046-7 (AAPL kappa) *" << endl;
963 oss <<
"* Toher et al. Phys. Rev.Mater.1, 015401 (2017) 10.1103/PhysRevMaterials.1.015401 (AEL elast) *" << endl;
964 oss <<
"* Mehl et al. Comp. Mat. Sci. 136, S1 (2017) 10.1016/j.commatsci.2017.01.017 (ANRL proto1) *" << endl;
965 oss <<
"* Calderon et al. Comp. Mat. Sci. 108A, 233 (2015) 10.1016/j.commatsci.2015.07.019 (standard) *" << endl;
966 oss <<
"* Toher et al. Phys. Rev. B 90, 174107 (2014) 10.1103/PhysRevB.90.174107 (AGL Gibbs) *" << endl;
967 oss <<
"* Taylor et al. Comp. Mat. Sci. 93, 178 (2014) 10.1016/j.commatsci.2014.05.014 (REST-API) *" << endl;
968 oss <<
"* Curtarolo et al. Comp. Mat. Sci. 58, 227 (2012) 10.1016/j.commatsci.2012.02.002 (AFLOW.org) *" << endl;
969 oss <<
"* Curtarolo et al. Comp. Mat. Sci. 58, 218 (2012) 10.1016/j.commatsci.2012.02.005 (AFLOW C++) *" << endl;
970 oss <<
"* *" << endl;
971 oss <<
"****************************************************************************************************" << endl;
972 oss <<
"* *" << endl;
974 oss <<
"* 2000-2019 Stefano Curtarolo (aflow); 2002-2004 Dane Morgan (convasp); 2007-2011 Wahyu Setyawan *" << endl;
975 oss <<
"* (--rsm --edos --kband --icsd*); 2008-2011 Roman Chepulskyy (--edos --kband surfaces); *" << endl;
976 oss <<
"* 2008 Gus Hart (lattice reductions - prototypes); 2009-2011, Ohad Levy (prototypes); *" << endl;
977 oss <<
"* 2009-2010, Michal Jahnatek (APL); 2010-2013 Shidong Wang (cluster expansion); 2010-2013 *" << endl;
978 oss <<
"* Richard Taylor (surfaces, apennsy); 2010-2013 Junkai Xue (prototyper); 2010-2013 Kesong Yang *" << endl;
979 oss <<
"* (findsym, frozsl, plotband/dos); 2013-2019 Cormac Toher (AGL Debye-Gruneisen, AEL elastic); *" << endl;
980 oss <<
"* 2013-2019 Frisco Rose (API, Aflux); 2013-2018 Pinku Nath (Quasi-harmonic approximation); *" << endl;
981 oss <<
"* 2013-2017 Jose J. Plata (AAPL, thermal cond.); 2014-2019 David Hicks (symmetry, structure *" << endl;
982 oss <<
"* comparison, prototypes); 2014-2019 Corey Oses (Egap, bader, chull, APL, pocc); 2018-2019 Marco *" << endl;
983 oss <<
"* Esters (AAPL, thermal cond.); 2016-2019 Denise Ford (GFA); 2018-2019 Rico Friedrich (CCE); *" << endl;
984 oss <<
"* 2021-2023 Simon Divilov (QCA, fitting); 2021-2023 Hagen Eckert (GFA, entry loader, JSON); *" << endl;
985 oss <<
"* *" << endl;
986 oss <<
"****************************************************************************************************" << endl;
992 oss <<
"****************************************************************************************************" << endl;
995 if (type ==
"BANNER_TINY") {
997 oss <<
"AFLOW VERSION " << AFLOW_VERSION <<
": [aflow.org consortium - 2003-2023] ";
1000 if (type ==
"EXCEPTIONS") {
1001 oss <<
"List of AFLOW exceptions with error codes. See README_AFLOW_EXCEPTIONS.TXT for more information" << endl;
1003 oss <<
"----------------------------------------------------------------------------------------------------" << endl;
1004 oss <<
"Error Code Error Type Error Name of Constant " << endl;
1005 oss <<
"----------------------------------------------------------------------------------------------------" << endl;
1006 oss <<
" 1 N/A Generic error _GENERIC_ERROR_ " << endl;
1007 oss <<
" 2 Illegal error code _ILLEGAL_CODE_ " << endl;
1008 oss <<
" 10 Input Error generic _INPUT_ERROR_ " << endl;
1009 oss <<
" 11 unknown flag _INPUT_UNKNOWN_ " << endl;
1010 oss <<
" 12 missing flag _INPUT_MISSING_ " << endl;
1011 oss <<
" 13 input ambiguous _INPUT_AMBIGUOUS_ " << endl;
1012 oss <<
" 14 illegal parameter _INPUT_ILLEGAL_ " << endl;
1013 oss <<
" 15 number of parameters _INPUT_NUMBER_ " << endl;
1014 oss <<
" 20 File Error generic _FILE_ERROR_ " << endl;
1015 oss <<
" 21 file not found _FILE_NOT_FOUND_ " << endl;
1016 oss <<
" 22 wrong format _FILE_WRONG_FORMAT_ " << endl;
1017 oss <<
" 23 file corrupt _FILE_CORRUPT_ " << endl;
1018 oss <<
" 30 Value Error generic _VALUE_ERROR_ " << endl;
1019 oss <<
" 31 illegal value _VALUE_ILLEGAL_ " << endl;
1020 oss <<
" 32 out of range _VALUE_RANGE_ " << endl;
1021 oss <<
" 40 Index Error generic _INDEX_ERROR_ " << endl;
1022 oss <<
" 41 illegal value _INDEX_ILLEGAL_ " << endl;
1023 oss <<
" 42 out of bounds _INDEX_BOUNDS_ " << endl;
1024 oss <<
" 43 mismatch _INDEX_MISMATCH_ " << endl;
1025 oss <<
" 50 Runtime Error generic _RUNTIME_ERROR_ " << endl;
1026 oss <<
" 51 not initialized _RUNTIME_INIT_ " << endl;
1027 oss <<
" 52 SQL error _RUNTIME_SQL_ " << endl;
1028 oss <<
" 53 busy _RUNTIME_BUSY_ " << endl;
1029 oss <<
" 54 external command not found _RUNTIME_EXTERNAL_MISS_ " << endl;
1030 oss <<
" 55 external command failed _RUNTIME_EXTERNAL_FAIL_ " << endl;
1031 oss <<
" 60 Allocation Error generic _ALLOC_ERROR_ " << endl;
1032 oss <<
" 61 could not allocate memory _ALLOC_ALLOCATE_ " << endl;
1033 oss <<
" 62 insufficient memory _ALLOC_INSUFFICIENT_ " << endl;
1034 oss <<
"----------------------------------------------------------------------------------------------------" << endl;
1037 cerr <<
XPID <<
"aflow::Banner type=" << type <<
" not found..." << endl;
1038 oss <<
"aflow::Banner type=" << type <<
" not found..." << endl;
1058#ifndef _AFLOW_AURO_CPP_
int main(int _argc, char **_argv)
int AFLOW_main(vector< string > &argv)
static const std::vector< std::string > BRAVAIS_LATTICES
uint xPOTCAR_Initialize()
double det(const xvector< double > &v1, const xvector< double > &v2, const xvector< double > &v3)
void AFLOW_monitor_VASP()
uint AFLOW_monitor(const vector< string > &argv)
uint AFLOW_getTEMP(const vector< string > &argv)
string aflow_get_time_string()
std::string buildMessageString()
std::string whereFileName()
std::string whereFunction()
void setmat(const xmatrix< utype > &mat, int irow=1, int icol=1)
void setcol(const xvector< utype > &col, int icol=1)
void getxmatInPlace(xmatrix< utype > &mat_out, int lrow, int urow, int lcol, int ucol, int lrows_out=1, int lcols_out=1) const
Convert xmatrix into a submatrix given a set of indices.
void setrow(const xvector< utype > &row, int irow=1)
bool args2addattachedscheme(std::vector< std::string > &argv, const std::string scheme, const std::string &_s_search, std::string string_default)
std::string getattachedscheme(const std::string &scheme) const
bool GetPropertiesUrlFile(const std::string &url, const std::string &file, bool=true)
std::vector< std::string > vcontent
bool GetPropertiesUrlFile(const std::string &url, const std::string &file, bool=true)
std::vector< std::string > vcontent
std::vector< std::string > vcontent
bool GetPropertiesUrlFile(const std::string &url, const std::string &file, bool=true)
int KBIN_Main(std::vector< std::string > argv)
string Intro_sflow(string x)
string Intro_aflow(string x)
string Banner(string type)
string License_Preamble_aflow()
string Intro_HELP(string x)
std::string get_content(const std::string &filename, const std::string &collection)
get the content of an embedded file
void StringSubstInPlace(string &work_string, const string &old_string, const string &new_string)
substitute parts of a strings in place
string text2html(const string &str) __xprototype
string PaddedCENTER(utype, int, string=" ")
uint string2tokens(const string &str, vector< string > &tokens, const string &delimiters=" ", bool consecutive=false) __xprototype
string PaddedPOST(utype, int, string=" ")
bool args2flag(const vector< string > &argv, const string &s0)
string utype2string(const utype &from, int precision=AUROSTD_DEFAULT_PRECISION, char FORMAT=DEFAULT_STREAM) __xprototype
vector< string > get_arguments_from_input(int _argc, char **_argv)
string args2attachedutype(const vector< string > &argv, const string &s0, const string &s_def)
bool args2attachedflag(const vector< string > &argv, const string &s0)
bool bin2base64(const std::string &b_file, std::string &b64String)
string args2attachedstring(const vector< string > &argv, const string &s0, string s_def)
vector< string > args2vectorstring(const vector< string > &argv, const string &s0, const string &s_def)
bool substring2bool(const string &strstream, const string &strsub1, bool RemoveWS=false, bool RemoveComments=true)
int InitMachine(bool INIT_VERBOSE, vector< string > &argv, vector< string > &cmds, std::ostream &oss)
void logger(const string &filename, const string &function_name, stringstream &message, const char &type, ostream &oss, bool silent, const string &message_metadata)
int main(vector< string > &argv, vector< string > &cmds)
string Intro_pflow(string x)