forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Added json array support. Implement init json (#3612)
- Loading branch information
Showing
14 changed files
with
309 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ dist | |
toolchain.tar.gz | ||
time.json | ||
*.pyc | ||
__pycache__ | ||
__pycache__ | ||
abacus.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
list(APPEND objects_json | ||
abacusjson.cpp | ||
general_info.cpp | ||
|
||
init_info.cpp | ||
) | ||
|
||
add_library( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#include "module_io/input.h" | ||
|
||
//Add json objects to gener_info | ||
namespace Json | ||
{ | ||
#ifdef __RAPIDJSON | ||
void gen_general_info(); | ||
void gen_general_info(Input *input); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include "init_info.h" | ||
#include "module_io/input.h" | ||
#include "../para_json.h" | ||
#include "abacusjson.h" | ||
|
||
|
||
//Add json objects to init | ||
namespace Json | ||
{ | ||
|
||
#ifdef __RAPIDJSON | ||
|
||
|
||
// void gen_init(ModuleSymmetry::Symmetry *symm,Atom *atoms){ | ||
// std::string pgname = symm->pgname; | ||
// std::string spgname = symm->spgname; | ||
// AbacusJson::add_json({"init", "pgname"}, pgname,false); | ||
// AbacusJson::add_json({"init", "spgname"}, spgname,false); | ||
|
||
|
||
// int numAtoms = atoms->na; | ||
// AbacusJson::add_json({"init", "natom"}, numAtoms,false); | ||
// AbacusJson::add_json({"init", "nband"}, INPUT.nbands,false); | ||
|
||
|
||
// } | ||
|
||
void gen_init(UnitCell *ucell){ | ||
std::string pgname = ucell->symm.pgname; | ||
std::string spgname = ucell->symm.spgname; | ||
AbacusJson::add_json({"init", "point_group"}, pgname,false); | ||
AbacusJson::add_json({"init", "point_group_in_space"}, spgname,false); | ||
|
||
|
||
int numAtoms = ucell->atoms->na; | ||
AbacusJson::add_json({"init", "natom"}, numAtoms,false); | ||
AbacusJson::add_json({"init", "nband"}, GlobalV::NBANDS,false); | ||
|
||
int ntype = ucell->ntype; | ||
AbacusJson::add_json({"init", "nelectron"}, ntype,false); | ||
|
||
for (int it = 0; it < ntype; it++) | ||
{ | ||
std::string label = ucell->atoms[it].label; | ||
int number = ucell->atoms[it].ncpp.zv; | ||
AbacusJson::add_json({"init", "nelectron_each_type",label}, number,false); | ||
} | ||
|
||
} | ||
|
||
|
||
void add_nkstot(int nkstot,int nkstot_ibz){ | ||
Json::AbacusJson::add_json({"init", "nkstot"}, nkstot,false); | ||
Json::AbacusJson::add_json({"init", "nkstot_ibz"}, nkstot_ibz,false); | ||
} | ||
|
||
#endif | ||
} // namespace Json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "module_cell/module_symmetry/symmetry.h" | ||
#include "module_cell/atom_spec.h" | ||
#include "module_cell/unitcell.h" | ||
|
||
|
||
//Add json objects to init | ||
namespace Json | ||
{ | ||
#ifdef __RAPIDJSON | ||
// void gen_init(ModuleSymmetry::Symmetry *symm,Atom *atoms); | ||
void gen_init(UnitCell *ucell); | ||
|
||
void add_nkstot(int nkstot,int nkstot_ibz); | ||
|
||
|
||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.