From c7456a00aac3608264fe46bc3849702a77c79e7c Mon Sep 17 00:00:00 2001 From: haochong zhang Date: Wed, 20 Nov 2024 11:30:06 +0000 Subject: [PATCH 1/3] Refactor atom_input and unify the fake atom data structure of grid and atom_input. --- .../module_cell/module_neighbor/sltk_atom.h | 11 ++ .../module_neighbor/sltk_atom_input.cpp | 108 +++--------------- .../module_neighbor/sltk_atom_input.h | 13 +-- .../module_cell/module_neighbor/sltk_grid.cpp | 48 +------- .../module_neighbor/sltk_grid_driver.cpp | 51 +-------- .../module_neighbor/sltk_grid_driver.h | 10 -- 6 files changed, 40 insertions(+), 201 deletions(-) diff --git a/source/module_cell/module_neighbor/sltk_atom.h b/source/module_cell/module_neighbor/sltk_atom.h index 187238e0d7..1f5cf61ebc 100644 --- a/source/module_cell/module_neighbor/sltk_atom.h +++ b/source/module_cell/module_neighbor/sltk_atom.h @@ -20,6 +20,9 @@ class FAtom int type; int natom; + int cell_x; + int cell_y; + int cell_z; public: //========================================================== // Default Constructor and deconstructor @@ -59,6 +62,10 @@ class FAtom const double& z() const { return d_z; } const int& getType() const { return type;} const int& getNatom() const { return natom;} + const int& getCellX() const { return cell_x; } + const int& getCellY() const { return cell_y; } + const int& getCellZ() const { return cell_z; } + //========================================================== // MEMBER FUNCTION : @@ -69,6 +76,10 @@ class FAtom void setZ(const double& r) { d_z = r; } void setType(const int ntype) {type = ntype;} void setNatom(const int atom) {natom = atom;} + void setCellX(const int nx) {cell_x = nx;} + void setCellY(const int ny) {cell_y = ny;} + void setCellZ(const int nz) {cell_z = nz;} + }; #endif diff --git a/source/module_cell/module_neighbor/sltk_atom_input.cpp b/source/module_cell/module_neighbor/sltk_atom_input.cpp index 2f1f127766..73cca8c443 100644 --- a/source/module_cell/module_neighbor/sltk_atom_input.cpp +++ b/source/module_cell/module_neighbor/sltk_atom_input.cpp @@ -188,14 +188,6 @@ Atom_input::Atom_input Atom_input::~Atom_input() { - if (expand_flag) - { - delete [] store_x; - delete [] store_y; - delete [] store_z; - delete [] store_type; - delete [] store_natom; - } } //============================================ @@ -409,27 +401,6 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype) GlobalV::ofs_running << " Good luck! " << std::endl; } - double *x_old = new double[d_amount]; - double *y_old = new double[d_amount]; - double *z_old = new double[d_amount]; - - int *type_old = new int[d_amount]; - int *natom_old = new int[d_amount]; - - int ia = 0; - for (int i = 0;i < ntype;i++) - { - for (int j = 0;j < ucell.atoms[i].na;j++) - { - x_old[ia] = ucell.atoms[i].tau[j].x; - y_old[ia] = ucell.atoms[i].tau[j].y; - z_old[ia] = ucell.atoms[i].tau[j].z; - type_old[ia] = i; - natom_old[ia] = j; - ia++; - } - } - // how many copys we need now. const int gcopy = (glayerX + glayerX_minus) * @@ -443,23 +414,7 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype) if(test_atom_input)ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running,"Atom_number_now",d_amount_expand); // store new atom positions. - this->store_x = new double[d_amount_expand]; - this->store_y = new double[d_amount_expand]; - this->store_z = new double[d_amount_expand]; - - ModuleBase::Memory::record("SLTK::Epd_Atom",sizeof(double) * d_amount_expand*3); - - // store which grid the atom is in. - store_cell_x = new int[d_amount_expand]; - store_cell_y = new int[d_amount_expand]; - store_cell_z = new int[d_amount_expand]; - - this->store_type = new int[d_amount_expand]; - this->store_natom = new int[d_amount_expand]; - ModuleBase::Memory::record("SLTK::Epd_atom_info",sizeof(int) * d_amount_expand*5); - - int ia_all = 0; for (int ix = -glayerX_minus; ix < glayerX; ix++) { @@ -467,48 +422,29 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype) { for (int iz = -glayerZ_minus; iz < glayerZ; iz++) { - for (int ia = 0; ia < d_amount; ia++) + for (int i = 0;i < ntype;i++) { - store_x[ia_all] = x_old[ia] + vec1[0] * ix + vec2[0] * iy + vec3[0] * iz; - store_y[ia_all] = y_old[ia] + vec1[1] * ix + vec2[1] * iy + vec3[1] * iz; - store_z[ia_all] = z_old[ia] + vec1[2] * ix + vec2[2] * iy + vec3[2] * iz; - store_type[ia_all] = type_old[ia]; - store_natom[ia_all] = natom_old[ia]; - - // notice '0' is not the origin unitcell. - store_cell_x[ia_all] = ix + glayerX_minus; - store_cell_y[ia_all] = iy + glayerY_minus; - store_cell_z[ia_all] = iz + glayerZ_minus; - - if (test_atom_input > 1) + for (int j = 0;j < ucell.atoms[i].na;j++) { - if (d_amount_expand < 1000) - { - GlobalV::ofs_running << "\n" << std::setw(6) << ia_all - << std::setw(10) << x_old[ia] - << std::setw(10) << y_old[ia] - << std::setw(10) << z_old[ia] - << std::setw(10) << store_x[ia_all] - << std::setw(10) << store_y[ia_all] - << std::setw(10) << store_z[ia_all] - << std::setw(6) << store_cell_x[ia_all] - << std::setw(6) << store_cell_y[ia_all] - << std::setw(6) << store_cell_z[ia_all]; - } + FAtom fake_atom; + fake_atom.setX(ucell.atoms[i].tau[j].x + vec1[0] * ix + vec2[0] * iy + vec3[0] * iz); + fake_atom.setY(ucell.atoms[i].tau[j].y + vec1[1] * ix + vec2[1] * iy + vec3[1] * iz); + fake_atom.setZ(ucell.atoms[i].tau[j].z + vec1[2] * ix + vec2[2] * iy + vec3[2] * iz); + fake_atom.setType(i); + fake_atom.setNatom(j); + fake_atom.setCellX(ix); + fake_atom.setCellY(iy); + fake_atom.setCellZ(iz); + + this->fake_atoms.push_back(fake_atom); } - - ia_all++; } } } } - // mohan fix bug 2012-04-02 by valgrind. - delete[] store_cell_x; - delete[] store_cell_y; - delete[] store_cell_z; - assert(ia_all == d_amount_expand); + assert(this->fake_atoms.size() == d_amount_expand); // becareful! now the cell is not the origin cell, // it's unitcell in expand case! so don't add @@ -554,12 +490,6 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype) << " Ymax=" << y_max_expand << " Zmax=" << z_max_expand << std::endl; } - - delete[] x_old; - delete[] y_old; - delete[] z_old; - delete[] type_old; - delete[] natom_old; return; } @@ -614,11 +544,7 @@ void Atom_input::set_FAtom(const UnitCell &ucell, FAtom &a)const //---------------------------------------------------------- if (expand_flag) { - a.setX(store_x[d_current]); - a.setY(store_y[d_current]); - a.setZ(store_z[d_current]); - a.setType(store_type[d_current]); - a.setNatom(store_natom[d_current]); + a = fake_atoms[d_current]; ++ d_current; } @@ -630,9 +556,7 @@ void Atom_input::set_FAtom(const UnitCell &ucell, FAtom &a)const //---------------------------------------------------------- else { - Load_atom(ucell - - ); + Load_atom(ucell); a.setX(x); a.setY(y); a.setZ(z); diff --git a/source/module_cell/module_neighbor/sltk_atom_input.h b/source/module_cell/module_neighbor/sltk_atom_input.h index 6a864633c0..06b61f4fcb 100644 --- a/source/module_cell/module_neighbor/sltk_atom_input.h +++ b/source/module_cell/module_neighbor/sltk_atom_input.h @@ -118,6 +118,8 @@ class Atom_input int getGrid_layerZ_minus(void) const { return glayerZ_minus;} + FAtom getFakeAtom(const int index) const { return fake_atoms[index];} + private: int test_atom_input; //caoyu reconst 2021-05-24 int d_amount;//number of atoms. @@ -154,14 +156,9 @@ class Atom_input // NAME : Expand_Grid //========================================================== void Expand_Grid(const UnitCell& ucell, const int ntype); - double* store_x; - double* store_y; - double* store_z; - int* store_cell_x; - int* store_cell_y; - int* store_cell_z; - int* store_type; - int* store_natom; + + std::vector fake_atoms; + double x_min_expand; double y_min_expand; double z_min_expand; diff --git a/source/module_cell/module_neighbor/sltk_grid.cpp b/source/module_cell/module_neighbor/sltk_grid.cpp index ab93e08996..5284c9f95f 100644 --- a/source/module_cell/module_neighbor/sltk_grid.cpp +++ b/source/module_cell/module_neighbor/sltk_grid.cpp @@ -401,49 +401,9 @@ void Grid::In_Which_Cell(const UnitCell &ucell, int &a, int &b, int &c, const FA // A bug remain! // d_minX, d_minY, d_minZ must be the cell origin //---------------------------------------------------------- - double directx, directy, directz; - ModuleBase::Mathzone::Cartesian_to_Direct( - atom.x(), atom.y(), atom.z(), - vec1[0], vec1[1], vec1[2], - vec2[0], vec2[1], vec2[2], - vec3[0], vec3[1], vec3[2], - directx, directy, directz); - - // cell_x_length - // mohan add the 'save_add' 2011-03-12 - // for example, if a is 2.999999999999999999, the int command - // will make a = 2 (in fact we want 3) - // if a is 3.00000000000000001, it's save. - //static double save_add = 1.0e-15; // from -8 to -15, mohan add 2012-03-22 - //a = static_cast( (directx - this->d_minX) + save_add ); - //b = static_cast( (directy - this->d_minY) + save_add ); - //c = static_cast( (directz - this->d_minZ) + save_add ); - int now_type = atom.getType(); - int now_number = atom.getNatom(); - double now_x_d = ucell.atoms[now_type].taud[now_number].x; - double now_y_d = ucell.atoms[now_type].taud[now_number].y; - double now_z_d = ucell.atoms[now_type].taud[now_number].z; - a = static_cast(directx - now_x_d - this->d_minX + 0.5 ); - b = static_cast(directy - now_y_d - this->d_minY + 0.5 ); - c = static_cast(directz - now_z_d - this->d_minZ + 0.5 ); - - //ofs_running << std::setw(8) << atom.x() << std::setw(8) << atom.y() << std::setw(8) << atom.z() - //<< std::setw(12) << directx << std::setw(12) << directy << std::setw(12) << directz - //<< std::setw(6) << a << std::setw(6) << b << std::setw(6) << c << std::endl; - - /* - if(a==0 && b==4 && c==0) - { - std::cout << std::setprecision(25) << std::endl; - std::cout << " save_add=" << save_add << std::endl; - std::cout << atom.x() << " " << atom.y() << " " << atom.z() << std::endl; - std::cout << " directy=" << directy << " d_minX=" << d_minY << " b=" << b << std::endl; - std::cout << " (int)directy=" << (int)directy << " (int)d_minY=" << (int)d_minY << " static_cast( (directx - this->d_minX) )=" << static_cast( (directy - this->d_minY) ) << std::endl; - std::cout << std::endl; - int ok; - cin >> ok; - } - */ + a = atom.getCellX() - this->d_minX; + b = atom.getCellY() - this->d_minY; + c = atom.getCellZ() - this->d_minZ; } else { @@ -500,7 +460,7 @@ void Grid::Build_Hash_Table(const UnitCell &ucell, AtomLink* const pointCache) Hash_one_hit = 0; // mohan add 2010-06-25 for (; current < end; ++ current) { - AtomLink* const hashTarget = this->getHashCode(ucell, current->fatom); + AtomLink* const hashTarget = this->getHashCode(ucell, current->fatom); //================================================ // Find a new position diff --git a/source/module_cell/module_neighbor/sltk_grid_driver.cpp b/source/module_cell/module_neighbor/sltk_grid_driver.cpp index e7b6e65238..82ec4e48e6 100644 --- a/source/module_cell/module_neighbor/sltk_grid_driver.cpp +++ b/source/module_cell/module_neighbor/sltk_grid_driver.cpp @@ -75,6 +75,9 @@ int Grid_Driver::Locate_offset( temp.fatom.setX(cartesian_pos.x); temp.fatom.setY(cartesian_pos.y); temp.fatom.setZ(cartesian_pos.z); + temp.fatom.setCellX(0); + temp.fatom.setCellY(0); + temp.fatom.setCellZ(0); temp.fatom.setType(ntype); temp.fatom.setNatom(nnumber); @@ -82,7 +85,7 @@ int Grid_Driver::Locate_offset( // EXPLAIN : Find the Hash number of this atom position //---------------------------------------------------------- AtomLink* Search = this->getHashCode(ucell, temp.fatom); - + //---------------------------------------------------------- // EXPLAIN : If we don't get the index for one Hash try, // we need to search in array. @@ -196,28 +199,6 @@ void Grid_Driver::Find_adjacent_atom(const int offset, std::shared_ptr &adjacent_site)const -{ - const double dx = a1.fatom.x() - adjacent_site.x; - const double dy = a1.fatom.y() - adjacent_site.y; - const double dz = a1.fatom.z() - adjacent_site.z; - return sqrt(dx*dx + dy*dy + dz*dz); -} - ModuleBase::Vector3 Grid_Driver::Calculate_adjacent_site ( @@ -241,30 +222,6 @@ ModuleBase::Vector3 Grid_Driver::Calculate_adjacent_site return adjacent_site; } -AdjacentAtomInfo Grid_Driver::get_adjs(const UnitCell& ucell_in, const size_t &iat) -{ - const int it = ucell_in.iat2it[iat]; - const int ia = ucell_in.iat2ia[iat]; - const ModuleBase::Vector3 &tau = ucell_in.atoms[it].tau[ia]; - - AdjacentAtomInfo adjs; - this->Find_atom(ucell_in, tau, it, ia, &adjs); - return adjs; -} - -std::vector Grid_Driver::get_adjs(const UnitCell& ucell_in) -{ - std::vector adjs(ucell_in.nat); -#ifdef _OPENMP -#pragma omp parallel for -#endif - for(size_t iat = 0; iat < ucell_in.nat; iat++) - { - adjs[iat] = Grid_Driver::get_adjs(ucell_in, iat); - } - return adjs; -} - // filter_adjs delete not adjacent atoms in adjs void filter_adjs(const std::vector& is_adj, AdjacentAtomInfo& adjs) { diff --git a/source/module_cell/module_neighbor/sltk_grid_driver.h b/source/module_cell/module_neighbor/sltk_grid_driver.h index e501cb8940..61216665bb 100644 --- a/source/module_cell/module_neighbor/sltk_grid_driver.h +++ b/source/module_cell/module_neighbor/sltk_grid_driver.h @@ -77,13 +77,6 @@ class Grid_Driver : public Grid const ModuleBase::Vector3& getAdjacentTau(const int i) const { return adj_info.adjacent_tau[i]; } const ModuleBase::Vector3& getBox(const int i) const {return adj_info.box[i];} - //========================================================== - // get_adjs will not store results in Grid_Driver::adj_info, - // but return the AdjacentAtomInfo object instead - //========================================================== - AdjacentAtomInfo get_adjs(const UnitCell& ucell_in, const size_t &iat); - std::vector get_adjs(const UnitCell& ucell_in); - private: mutable AdjacentAtomInfo adj_info; @@ -107,9 +100,6 @@ class Grid_Driver : public Grid std::shared_ptr as, AdjacentAtomInfo &adjs)const; - double Distance(const AtomLink& a1, const ModuleBase::Vector3 &adjacent_site)const; - double Distance(const AtomLink& a1, const AtomLink& a2)const; - //========================================================== // MEMBER FUNCTIONS : // NAME : Calculate_adjacent_site From 76629aac588d0fb5fd41fc425b2f3a54ee0ec844 Mon Sep 17 00:00:00 2001 From: haochong zhang Date: Wed, 20 Nov 2024 12:34:42 +0000 Subject: [PATCH 2/3] add constructors for atom_input --- .../module_cell/module_neighbor/sltk_atom.h | 30 +++++---- .../module_neighbor/sltk_atom_input.cpp | 62 +++++-------------- .../module_neighbor/sltk_atom_input.h | 5 +- .../module_cell/module_neighbor/sltk_grid.h | 7 +-- .../module_neighbor/sltk_grid_driver.cpp | 13 +--- .../module_neighbor/test/sltk_atom_test.cpp | 21 ++++--- 6 files changed, 47 insertions(+), 91 deletions(-) diff --git a/source/module_cell/module_neighbor/sltk_atom.h b/source/module_cell/module_neighbor/sltk_atom.h index 1f5cf61ebc..1971a94e7b 100644 --- a/source/module_cell/module_neighbor/sltk_atom.h +++ b/source/module_cell/module_neighbor/sltk_atom.h @@ -29,6 +29,19 @@ class FAtom //========================================================== FAtom(); + FAtom(const double& x_in, const double& y_in, const double& z_in, + const int& type_in, const int& natom_in, + const int& cell_x_in, const int& cell_y_in, const int& cell_z_in) + { + d_x = x_in; + d_y = y_in; + d_z = z_in; + type = type_in; + natom = natom_in; + cell_x = cell_x_in; + cell_y = cell_y_in; + cell_z = cell_z_in; + } ~FAtom(); //2015-05-07 void delete_vector(void); @@ -64,22 +77,7 @@ class FAtom const int& getNatom() const { return natom;} const int& getCellX() const { return cell_x; } const int& getCellY() const { return cell_y; } - const int& getCellZ() const { return cell_z; } - - -//========================================================== -// MEMBER FUNCTION : -// EXPLAIN : set value -//========================================================== - void setX(const double& r) { d_x = r; } - void setY(const double& r) { d_y = r; } - void setZ(const double& r) { d_z = r; } - void setType(const int ntype) {type = ntype;} - void setNatom(const int atom) {natom = atom;} - void setCellX(const int nx) {cell_x = nx;} - void setCellY(const int ny) {cell_y = ny;} - void setCellZ(const int nz) {cell_z = nz;} - + const int& getCellZ() const { return cell_z; } }; #endif diff --git a/source/module_cell/module_neighbor/sltk_atom_input.cpp b/source/module_cell/module_neighbor/sltk_atom_input.cpp index 73cca8c443..7991bb142c 100644 --- a/source/module_cell/module_neighbor/sltk_atom_input.cpp +++ b/source/module_cell/module_neighbor/sltk_atom_input.cpp @@ -426,17 +426,11 @@ void Atom_input::Expand_Grid(const UnitCell &ucell, const int ntype) { for (int j = 0;j < ucell.atoms[i].na;j++) { - FAtom fake_atom; - fake_atom.setX(ucell.atoms[i].tau[j].x + vec1[0] * ix + vec2[0] * iy + vec3[0] * iz); - fake_atom.setY(ucell.atoms[i].tau[j].y + vec1[1] * ix + vec2[1] * iy + vec3[1] * iz); - fake_atom.setZ(ucell.atoms[i].tau[j].z + vec1[2] * ix + vec2[2] * iy + vec3[2] * iz); - fake_atom.setType(i); - fake_atom.setNatom(j); - fake_atom.setCellX(ix); - fake_atom.setCellY(iy); - fake_atom.setCellZ(iz); - - this->fake_atoms.push_back(fake_atom); + double x = ucell.atoms[i].tau[j].x + vec1[0] * ix + vec2[0] * iy + vec3[0] * iz; + double y = ucell.atoms[i].tau[j].y + vec1[1] * ix + vec2[1] * iy + vec3[1] * iz; + double z = ucell.atoms[i].tau[j].z + vec1[2] * ix + vec2[2] * iy + vec3[2] * iz; + + this->fake_atoms.push_back(FAtom(x, y, z, i, j, ix, iy, iz)); } } } @@ -556,42 +550,20 @@ void Atom_input::set_FAtom(const UnitCell &ucell, FAtom &a)const //---------------------------------------------------------- else { - Load_atom(ucell); - a.setX(x); - a.setY(y); - a.setZ(z); - a.setType(type); - a.setNatom(natom); -// GlobalV::ofs_running<<"\n x = "<= ucell.atoms[type].na) - { - type ++; - natom = 0; + if (natom >= ucell.atoms[type].na) + { + type ++; + natom = 0; + } + FAtom temp(ucell.atoms[type].tau[natom].x, + ucell.atoms[type].tau[natom].y, + ucell.atoms[type].tau[natom].z, + type, natom, + 0, 0, 0); + a = temp; } - x = ucell.atoms[type].tau[natom].x; - - y = ucell.atoms[type].tau[natom].y; - z = ucell.atoms[type].tau[natom].z; - -// std::cout<<" x = "< Date: Wed, 20 Nov 2024 13:16:28 +0000 Subject: [PATCH 3/3] [pre-commit.ci lite] apply automatic fixes --- .../module_cell/module_neighbor/sltk_atom.h | 4 +- .../module_neighbor/sltk_atom_input.h | 79 ++++++++++--------- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/source/module_cell/module_neighbor/sltk_atom.h b/source/module_cell/module_neighbor/sltk_atom.h index 1971a94e7b..1c9ed519cb 100644 --- a/source/module_cell/module_neighbor/sltk_atom.h +++ b/source/module_cell/module_neighbor/sltk_atom.h @@ -44,7 +44,7 @@ class FAtom } ~FAtom(); //2015-05-07 - void delete_vector(void); + void delete_vector(); // static int count1; // static int count2; @@ -63,7 +63,7 @@ class FAtom std::shared_ptr getAdjacentSet() const { return this->as; } - void allocate_AdjacentSet(void) + void allocate_AdjacentSet() { this->as = std::make_shared(); } //========================================================== diff --git a/source/module_cell/module_neighbor/sltk_atom_input.h b/source/module_cell/module_neighbor/sltk_atom_input.h index 496df65a23..f747e00f34 100644 --- a/source/module_cell/module_neighbor/sltk_atom_input.h +++ b/source/module_cell/module_neighbor/sltk_atom_input.h @@ -16,7 +16,7 @@ class Atom_input const UnitCell &ucell, const int amount = 0, //number of atoms const int ntype = 0, //number of atom_types - const bool boundary = 1, // 1 : periodic ocndition + const bool boundary = true, // 1 : periodic ocndition const double radius_in = 0, // searching radius const int &test_atom_in = 0 //caoyu reconst 2021-05-24 ); @@ -31,92 +31,99 @@ class Atom_input double vec3[3]; public: - bool getExpandFlag(void)const {return expand_flag;} + bool getExpandFlag()const {return expand_flag;} int getAmount() const { - if (!expand_flag) return d_amount; - else return d_amount_expand; + if (!expand_flag) { return d_amount; + } else { return d_amount_expand; +} } int getBoundary()const { return periodic_boundary;} - double getLatNow(void) const { return lat_now;} + double getLatNow() const { return lat_now;} double getRadius() const {return radius;} //========================================================== // //========================================================== - double getCellXLength(void) const + double getCellXLength() const { - if (!expand_flag) return radius; - else return 1; + if (!expand_flag) { return radius; + } else { return 1; +} } - double getCellYLength(void) const + double getCellYLength() const { - if (!expand_flag) return radius; - else return 1; + if (!expand_flag) { return radius; + } else { return 1; +} } - double getCellZLength(void) const + double getCellZLength() const { - if (!expand_flag) return radius; - else return 1; + if (!expand_flag) { return radius; + } else { return 1; +} } //========================================================== // //========================================================== - double Clength0(void) const { return (glayerX + glayerX_minus) * clength0;} - double Clength1(void) const { return (glayerY + glayerY_minus) * clength1;} - double Clength2(void) const { return (glayerZ + glayerZ_minus) * clength2;} + double Clength0() const { return (glayerX + glayerX_minus) * clength0;} + double Clength1() const { return (glayerY + glayerY_minus) * clength1;} + double Clength2() const { return (glayerZ + glayerZ_minus) * clength2;} //========================================================== // //========================================================== - double minX(void) const + double minX() const { - if (!expand_flag) return x_min; - else return (double)(-glayerX_minus); + if (!expand_flag) { return x_min; + } else { return (double)(-glayerX_minus); +} } - double minY(void) const + double minY() const { - if (!expand_flag) return y_min; - else return (double)(-glayerY_minus); + if (!expand_flag) { return y_min; + } else { return (double)(-glayerY_minus); +} } - double minZ(void) const + double minZ() const { - if (!expand_flag) return z_min; - else return (double)(-glayerZ_minus); + if (!expand_flag) { return z_min; + } else { return (double)(-glayerZ_minus); +} } //========================================================== // //========================================================== - int getCellX(void) const { return cell_nx; } + int getCellX() const { return cell_nx; } - int getCellY(void) const { return cell_ny; } + int getCellY() const { return cell_ny; } - int getCellZ(void) const { return cell_nz; } + int getCellZ() const { return cell_nz; } //========================================================== // //========================================================== - int getGrid_layerX(void) const { return glayerX;} + int getGrid_layerX() const { return glayerX;} - int getGrid_layerX_minus(void) const { return glayerX_minus;} + int getGrid_layerX_minus() const { return glayerX_minus;} - int getGrid_layerY(void) const { return glayerY;} + int getGrid_layerY() const { return glayerY;} - int getGrid_layerY_minus(void) const { return glayerY_minus;} + int getGrid_layerY_minus() const { return glayerY_minus;} - int getGrid_layerZ(void) const { return glayerZ;} + int getGrid_layerZ() const { return glayerZ;} - int getGrid_layerZ_minus(void) const { return glayerZ_minus;} + int getGrid_layerZ_minus() const { return glayerZ_minus;} FAtom getFakeAtom(const int index) const { return fake_atoms[index];} @@ -169,7 +176,7 @@ class Atom_input // MEMBRE FUNCTION : // NAME : Expand_Grid //========================================================== - void calculate_cells(void); + void calculate_cells(); int cell_nx; int cell_ny; int cell_nz;