Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions source/module_basis/module_pw/pw_basis_big.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,36 @@ class PW_Basis_Big: public PW_Basis
this->nx = nx_in;
this->ny = ny_in;
this->nz = nz_in;
// autoset bx/by/bz if not set in INPUT
if (!this->bz)
{
this->autoset_big_cell_size(this->bz, nz, this->poolnproc);
}
if (!this->bx)
{
// if cz == cx, autoset bx==bz for keeping same symmetry
if (nx == nz)
{
this->bx = this->bz;
}
else
{
this->autoset_big_cell_size(this->bx, nx);
}
}
if (!this->by)
{
// if cz == cy, autoset by==bz for keeping same symmetry
if (ny == nz)
{
this->by = this->bz;
}
else
{
this->autoset_big_cell_size(this->by, ny);
}
}
this->bxyz = this->bx * this->by * this->bz;
if(this->nx%this->bx != 0) this->nx += (this->bx - this->nx % this->bx);
if(this->ny%this->by != 0) this->ny += (this->by - this->ny % this->by);
if(this->nz%this->bz != 0) this->nz += (this->bz - this->nz % this->bz);
Expand Down