ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Functions
unitcell Namespace Reference

Functions

void bcast_atoms_tau (Atom *atoms, const int ntype)
 broadcast the tau array of the atoms
 
void bcast_atoms_pseudo (Atom *atoms, const int ntype)
 broadcast the pseduo of the atoms
 
void bcast_Lattice (Lattice &lat)
 broadcast the lattice
 
void bcast_magnetism (Magnetism &magnet, const int ntype)
 broadcast the magnetism
 
void bcast_unitcell (UnitCell &ucell)
 broadcast the unitcell
 
void check_atomic_stru (UnitCell &ucell, const double &factor)
 
void print_tau (Atom *atoms, const std::string &Coordinate, const int ntype, const double lat0, std::ofstream &ofs)
 
void print_stru_file (const UnitCell &ucell, const Atom *atoms, const ModuleBase::Matrix3 &latvec, const std::string &fn, const int &nspin=1, const bool &direct=false, const bool &vel=false, const bool &magmom=false, const bool &orb=false, const bool &dpks_desc=false, const int &iproc=0)
 UnitCell class is too heavy, this function would be moved elsewhere. Print STRU file respect to given setting.
 
bool read_atom_species (std::ifstream &ifa, std::ofstream &ofs_running, UnitCell &ucell)
 
bool read_lattice_constant (std::ifstream &ifa, std::ofstream &ofs_running, Lattice &lat)
 
bool validate_coordinate_system (const std::string &Coordinate, std::ofstream &ofs_warning)
 Validate coordinate system type.
 
void allocate_atom_properties (Atom &atom, int na, double mass)
 Allocate and initialize atom property vectors.
 
void set_atom_movement_flags (Atom &atom, int ia, const ModuleBase::Vector3< int > &mv)
 Set atom movement constraints based on fixed_atoms parameter.
 
void autoset_magnetization (UnitCell &ucell, int nspin, std::ofstream &ofs_running)
 Set default magnetization if not explicitly specified.
 
bool finalize_atom_positions (UnitCell &ucell, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 Perform final validation and output.
 
ModuleBase::Vector3< double > calculate_lattice_center (const ModuleBase::Matrix3 &latvec, const std::string &center_mode)
 Calculate lattice center for different centering modes.
 
void transform_atom_coordinates (Atom &atom, int ia, const std::string &Coordinate, const ModuleBase::Vector3< double > &v, const ModuleBase::Matrix3 &latvec, double lat0, ModuleBase::Vector3< double > &latcenter)
 Convert between different coordinate systems.
 
void process_magnetization (Atom &atom, int it, int ia, int nspin, bool input_vec_mag, bool input_angle_mag, std::ofstream &ofs_running)
 Convert between magnetization representations and output.
 
bool parse_atom_properties (std::ifstream &ifpos, Atom &atom, int ia, ModuleBase::Vector3< int > &mv, bool &input_vec_mag, bool &input_angle_mag, bool &set_element_mag_zero)
 Parse optional atom properties (mag, angle1, angle2, lambda, sc, m, v)
 
bool read_atom_type_header (int it, UnitCell &ucell, std::ifstream &ifpos, std::ofstream &ofs_running, std::ofstream &ofs_warning, bool &set_element_mag_zero)
 Read atom type metadata (label, magnetization, orbital info, atom count)
 
bool check_tau (const Atom *atoms, const int &ntype, const double &lat0)
 
void check_dtau (Atom *atoms, const int &ntype, const double &lat0, ModuleBase::Matrix3 &latvec)
 
bool read_atom_positions (UnitCell &ucell, std::ifstream &ifpos, std::ofstream &ofs_running, std::ofstream &ofs_warning)
 
void remake_cell (Lattice &lat)
 
void setup_cell_after_vc (UnitCell &ucell, std::ofstream &log)
 
void update_pos_tau (const Lattice &lat, const double *pos, const int ntype, const int nat, Atom *atoms)
 update the position and tau of the atoms
 
void update_pos_taud (const Lattice &lat, const double *posd_in, const int ntype, const int nat, Atom *atoms)
 update the position and tau of the atoms
 
void update_pos_taud (const Lattice &lat, const ModuleBase::Vector3< double > *posd_in, const int ntype, const int nat, Atom *atoms)
 update the velocity of the atoms
 
void update_vel (const ModuleBase::Vector3< double > *vel_in, const int ntype, const int nat, Atom *atoms)
 update the velocity of the atoms
 
void periodic_boundary_adjustment (Atom *atoms, const ModuleBase::Matrix3 &latvec, const int ntype)
 check the boundary of the cell, for each atom,the taud in three directions should be in the range of [-1,1)
 
void reset_remake_cell_mock ()
 
bool was_remake_cell_called ()
 

Detailed Description

Function Documentation

◆ allocate_atom_properties()

void unitcell::allocate_atom_properties ( Atom atom,
int  na,
double  mass 
)

Allocate and initialize atom property vectors.

Parameters
atomThe atom object to allocate properties for
naNumber of atoms
massAtomic mass
Here is the caller graph for this function:

◆ autoset_magnetization()

void unitcell::autoset_magnetization ( UnitCell ucell,
int  nspin,
std::ofstream &  ofs_running 
)

Set default magnetization if not explicitly specified.

Parameters
ucellUnit cell object
nspinNumber of spin components
ofs_runningOutput stream for running information
Here is the call graph for this function:

◆ bcast_atoms_pseudo()

void unitcell::bcast_atoms_pseudo ( Atom atoms,
const int  ntype 
)

broadcast the pseduo of the atoms

Parameters
atomsthe atoms to be broadcasted [in/out]
ntypethe number of types of the atoms [in]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_atoms_tau()

void unitcell::bcast_atoms_tau ( Atom atoms,
const int  ntype 
)

broadcast the tau array of the atoms

Parameters
atomsthe atoms to be broadcasted [in/out]
ntypethe number of types of the atoms [in]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_Lattice()

void unitcell::bcast_Lattice ( Lattice lat)

broadcast the lattice

Parameters
latthe lattice to be broadcasted [in/out]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_magnetism()

void unitcell::bcast_magnetism ( Magnetism magnet,
const int  ntype 
)

broadcast the magnetism

Parameters
magnetthe magnetism to be broadcasted [in/out]
nytpethe number of types of the atoms [in]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_unitcell()

void unitcell::bcast_unitcell ( UnitCell ucell)

broadcast the unitcell

Parameters
ucellthe unitcell to be broadcasted [in/out]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_lattice_center()

ModuleBase::Vector3< double > unitcell::calculate_lattice_center ( const ModuleBase::Matrix3 latvec,
const std::string &  center_mode 
)

Calculate lattice center for different centering modes.

Parameters
latvecLattice vectors
center_modeCentering mode: "xy", "xz", "yz", or "xyz"
Returns
Lattice center coordinates
Here is the caller graph for this function:

◆ check_atomic_stru()

void unitcell::check_atomic_stru ( UnitCell ucell,
const double &  factor 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_dtau()

void unitcell::check_dtau ( Atom atoms,
const int &  ntype,
const double &  lat0,
ModuleBase::Matrix3 latvec 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_tau()

bool unitcell::check_tau ( const Atom atoms,
const int &  ntype,
const double &  lat0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize_atom_positions()

bool unitcell::finalize_atom_positions ( UnitCell ucell,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning 
)

Perform final validation and output.

Parameters
ucellUnit cell object
ofs_runningOutput stream for running information
ofs_warningOutput stream for warnings
Returns
true if validation passes, false otherwise
Here is the call graph for this function:

◆ parse_atom_properties()

bool unitcell::parse_atom_properties ( std::ifstream &  ifpos,
Atom atom,
int  ia,
ModuleBase::Vector3< int > &  mv,
bool &  input_vec_mag,
bool &  input_angle_mag,
bool &  set_element_mag_zero 
)

Parse optional atom properties (mag, angle1, angle2, lambda, sc, m, v)

Parameters
ifposInput file stream
atomThe atom object
iaAtom index
mvMovement vector (output parameter)
input_vec_magWhether vector magnetization was input (output parameter)
input_angle_magWhether angle magnetization was input (output parameter)
set_element_mag_zeroWhether to reset element magnetization (output parameter)
Returns
true if parsing succeeds, false otherwise
Here is the caller graph for this function:

◆ periodic_boundary_adjustment()

void unitcell::periodic_boundary_adjustment ( Atom atoms,
const ModuleBase::Matrix3 latvec,
const int  ntype 
)

check the boundary of the cell, for each atom,the taud in three directions should be in the range of [-1,1)

Parameters
atomsthe atoms to be adjusted [in]
latvecthe lattice of the atoms [in]
ntypethe number of types of the atoms [in]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_stru_file()

void unitcell::print_stru_file ( const UnitCell ucell,
const Atom atoms,
const ModuleBase::Matrix3 latvec,
const std::string &  fn,
const int &  nspin = 1,
const bool &  direct = false,
const bool &  vel = false,
const bool &  magmom = false,
const bool &  orb = false,
const bool &  dpks_desc = false,
const int &  iproc = 0 
)

UnitCell class is too heavy, this function would be moved elsewhere. Print STRU file respect to given setting.

Parameters
ucellreference of unitcell
atomsAtom list
latveclattice const parmater vector
fnSTRU file name
nspinPARAM.inp.nspin feed in
directtrue for direct coords, false for cartesian coords
voltrue for printing velocities
magmomtrue for printing Mulliken population analysis produced magmom
orbtrue for printing NUMERICAL_ORBITAL section
dpks_desctrue for printing NUMERICAL_DESCRIPTOR section
iprocGlobalV::MY_RANK feed in
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_tau()

void unitcell::print_tau ( Atom atoms,
const std::string &  Coordinate,
const int  ntype,
const double  lat0,
std::ofstream &  ofs 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_magnetization()

void unitcell::process_magnetization ( Atom atom,
int  it,
int  ia,
int  nspin,
bool  input_vec_mag,
bool  input_angle_mag,
std::ofstream &  ofs_running 
)

Convert between magnetization representations and output.

Parameters
atomThe atom object
itAtom type index
iaAtom index
nspinNumber of spin components
input_vec_magWhether vector magnetization was input
input_angle_magWhether angle magnetization was input
ofs_runningOutput stream for running information
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_atom_positions()

bool unitcell::read_atom_positions ( UnitCell ucell,
std::ifstream &  ifpos,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning 
)
Here is the caller graph for this function:

◆ read_atom_species()

bool unitcell::read_atom_species ( std::ifstream &  ifa,
std::ofstream &  ofs_running,
UnitCell ucell 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_atom_type_header()

bool unitcell::read_atom_type_header ( int  it,
UnitCell ucell,
std::ifstream &  ifpos,
std::ofstream &  ofs_running,
std::ofstream &  ofs_warning,
bool &  set_element_mag_zero 
)

Read atom type metadata (label, magnetization, orbital info, atom count)

Parameters
itAtom type index
ucellUnit cell object
ifposInput file stream
ofs_runningOutput stream for running information
ofs_warningOutput stream for warnings
set_element_mag_zeroWhether to reset element magnetization (output parameter)
Returns
true if reading succeeds, false otherwise

liuyu update 2023-05-11 In order to employ the DP model as esolver, all atom types must be specified in the STRU in the order consistent with that of the DP model, even if the number of ucell.atoms is zero!

Here is the call graph for this function:

◆ read_lattice_constant()

bool unitcell::read_lattice_constant ( std::ifstream &  ifa,
std::ofstream &  ofs_running,
Lattice lat 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remake_cell()

void unitcell::remake_cell ( Lattice lat)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_remake_cell_mock()

void unitcell::reset_remake_cell_mock ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_atom_movement_flags()

void unitcell::set_atom_movement_flags ( Atom atom,
int  ia,
const ModuleBase::Vector3< int > &  mv 
)

Set atom movement constraints based on fixed_atoms parameter.

Parameters
atomThe atom object
iaAtom index
mvMovement vector (1=movable, 0=fixed)

◆ setup_cell_after_vc()

void unitcell::setup_cell_after_vc ( UnitCell ucell,
std::ofstream &  log 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform_atom_coordinates()

void unitcell::transform_atom_coordinates ( Atom atom,
int  ia,
const std::string &  Coordinate,
const ModuleBase::Vector3< double > &  v,
const ModuleBase::Matrix3 latvec,
double  lat0,
ModuleBase::Vector3< double > &  latcenter 
)

Convert between different coordinate systems.

Parameters
atomThe atom object
iaAtom index
CoordinateCoordinate system type
vInput position vector
latvecLattice vectors
lat0Lattice constant
latcenterLattice center (output parameter)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pos_tau()

void unitcell::update_pos_tau ( const Lattice lat,
const double *  pos,
const int  ntype,
const int  nat,
Atom atoms 
)

update the position and tau of the atoms

Parameters
latthe lattice of the atoms [in]
posthe position of the atoms [in]
ntypethe number of types of the atoms [in]
natthe number of atoms [in]
atomsthe atoms to be updated [out]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pos_taud() [1/2]

void unitcell::update_pos_taud ( const Lattice lat,
const double *  posd_in,
const int  ntype,
const int  nat,
Atom atoms 
)

update the position and tau of the atoms

Parameters
latthe lattice of the atoms [in]
pos_inthe position of the atoms in direct coordinate system [in]
ntypethe number of types of the atoms [in]
natthe number of atoms [in]
atomsthe atoms to be updated [out]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pos_taud() [2/2]

void unitcell::update_pos_taud ( const Lattice lat,
const ModuleBase::Vector3< double > *  posd_in,
const int  ntype,
const int  nat,
Atom atoms 
)

update the velocity of the atoms

Parameters
latthe lattice of the atoms [in]
pos_inthe position of the atoms in direct coordinate system in ModuleBase::Vector3 version [in]
ntypethe number of types of the atoms [in]
natthe number of atoms [in]
atomsthe atoms to be updated [out]
Here is the call graph for this function:

◆ update_vel()

void unitcell::update_vel ( const ModuleBase::Vector3< double > *  vel_in,
const int  ntype,
const int  nat,
Atom atoms 
)

update the velocity of the atoms

Parameters
vel_inthe velocity of the atoms [in]
ntypethe number of types of the atoms [in]
natthe number of atoms [in]
atomsthe atoms to be updated [out]
Here is the caller graph for this function:

◆ validate_coordinate_system()

bool unitcell::validate_coordinate_system ( const std::string &  Coordinate,
std::ofstream &  ofs_warning 
)

Validate coordinate system type.

Parameters
CoordinateThe coordinate system string to validate
ofs_warningOutput stream for warnings
Returns
true if valid, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ was_remake_cell_called()

bool unitcell::was_remake_cell_called ( )
Here is the caller graph for this function: