ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleIO::UcellIO Class Reference

A class for unit cell I/O operations. More...

#include <ucell_io.h>

Collaboration diagram for ModuleIO::UcellIO:

Static Public Member Functions

static void write_ucell (std::ofstream &ofs, const UnitCell *ucell)
 Writes the unit cell information to a file.
static bool read_ucell (std::ifstream &ifs)
 Skips the UnitCell block that follows the DMK header.

Detailed Description

A class for unit cell I/O operations.

This class provides methods to write and read unit cell information to/from files, particularly for DMK files.

Member Function Documentation

◆ read_ucell()

bool ModuleIO::UcellIO::read_ucell ( std::ifstream & ifs)
static

Skips the UnitCell block that follows the DMK header.

The function consumes the latName, lat0, three lattice vectors, atom labels, per-type atom counts, the "Direct" marker, and every coordinate line in order. On success the stream is positioned at the first line of the trailing matrix body.

Parameters
ifsThe input file stream positioned at the start of the block.
Returns
true when the full block is consumed without parse errors; false when any mandatory line cannot be read, or when the atom count line yields no positive integer (leaving the stream at the coordinates, which would otherwise be misinterpreted as the matrix body by the caller).
Here is the caller graph for this function:

◆ write_ucell()

void ModuleIO::UcellIO::write_ucell ( std::ofstream & ofs,
const UnitCell * ucell )
static

Writes the unit cell information to a file.

Parameters
ofsThe output file stream.
ucellA pointer to the UnitCell object.
Here is the caller graph for this function:

The documentation for this class was generated from the following files: