@@ -13,15 +13,22 @@ namespace profess
1313
1414class System
1515{
16- public:
1716
17+ public:
18+ // public constructors (named constructor idiom)
19+ static
20+ System create (
21+ std::array<std::array<double ,3 >,3 > box_vectors,
22+ double energy_cutoff,
23+ std::array<std::string,2 > units={" b" ," h" });
24+ static
25+ System create_from_grid_shape (
26+ std::array<std::array<double ,3 >,3 > box_vectors,
27+ std::array<size_t ,3 > grid_shape,
28+ std::string unit={" b" });
29+ private:
1830 System (std::array<size_t ,3 > grid_shape);
19-
20- static std::array<size_t ,3 > get_shape (
21- std::array<std::array<double ,3 >,3 > box_vectors,
22- double energy_cutoff,
23- std::array<std::string,2 > units={" b" ," h" });
24-
31+ public:
2532 // rule of five
2633 // copy construction/assignment disabled b/c class has unique ptrs
2734 ~System () = default ;
@@ -47,7 +54,8 @@ class System
4754 System& add_coulomb_ions (
4855 double z,
4956 std::vector<std::array<double ,3 >> coords,
50- std::string unit={" b" });
57+ std::string unit={" b" },
58+ double cutoff=-1.0 );
5159 System& add_harmonic_ions ();
5260
5361 std::vector<std::array<double ,3 >> ions_xyz_coords (std::string unit);
@@ -57,29 +65,31 @@ class System
5765 System& add_ion_electron_functional ();
5866 System& add_luo_karasiev_trickey_functional (double a=1.3 ,
5967 double tiny_den=1e-12 );
60- System& add_libxc_functional (std::vector<int >);
61- System& add_kinetic_class_a_functional (
68+ System& add_libxc_functional (std::vector<int > xc_func_ids );
69+ System& add_generic_nonlocal_a_functional (
6270 double a,
6371 double b,
6472 std::function<double (double )> f,
6573 std::function<double(double )> fp,
66- double den0);
74+ double den0=-1 );
6775 System& add_perdew_burke_ernzerhof_functional ();
6876 System& add_perdew_zunger_functional ();
69- System& add_perrot_functional (double den0);
70- System& add_smargiassi_madden_functional (double den0);
77+ System& add_perrot_functional (double den0=- 1.0 );
78+ System& add_smargiassi_madden_functional (double den0=- 1.0 );
7179 System& add_thomas_fermi_functional ();
7280 System& add_wang_govind_carter_functional (
73- double den0,
81+ double den0=- 1.0 ,
7482 double alpha=(5.0 +std::sqrt(5.0 ))/6.0,
7583 double beta=(5.0 -std::sqrt(5.0 ))/6.0,
7684 double gamma=2.7);
77- System& add_wang_govind_carter_1999_i_functional (double den0);
78- System& add_wang_teter_functional (double den0);
85+ System& add_wang_govind_carter_1999_i_functional (double den0=- 1.0 );
86+ System& add_wang_teter_functional (double den0=- 1.0 );
7987 System& add_weizsaecker_functional ();
8088
8189 System& remove_functional (std::string name);
8290
91+ System& add_ion_ion_interaction ();
92+
8393 // basic information about the system
8494 double energy (std::string unit={" h" });
8595 std::tuple<double , Double3D> energy_potential (bool compute_ion_ion=true );
@@ -89,9 +99,10 @@ class System
8999 double pressure (std::string unit={" h/b3" });
90100 double enthalpy (std::string unit={" h" });
91101 double energy_cutoff (std::string unit={" h" });
102+ double total_ion_charge ();
92103
93104 // basic manipulations
94- System& distribute_electrons_uniformly ( const double electrons);
105+ System& add_electrons ( double electrons=- 1.0 );
95106 System& move_ions (
96107 std::vector<std::array<double ,3 >> xyz_coords,
97108 std::string length_unit={" b" });
@@ -110,6 +121,10 @@ class System
110121 double energy_tol=1e-5 ,
111122 size_t window_size=3 ,
112123 size_t max_iter=100 );
124+
125+ private:
126+
127+ bool _ion_ion_interaction = false ;
113128};
114129
115130}
0 commit comments