ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hs_sparse_io_detail.h File Reference
#include "hs_sparse_io.h"
#include "source_base/module_out/sparse_matrix.h"
#include "source_base/parallel_reduce.h"
#include "source_base/tool_quit.h"
#include "source_cell/ucell_io.h"
#include "source_io/module_output/provenance_header.h"
#include <cmath>
#include <fstream>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
Include dependency graph for hs_sparse_io_detail.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ModuleIO::detail::CsrTextHeader
 Metadata shared by every self-describing CSR text writer. More...

Namespaces

namespace  ModuleIO
 Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in each anonymous namespace) so the header layout, R records and file-append rules cannot diverge between hs_sparse_io.cpp, dhs_sparse_writer.cpp, pos_op_csr.cpp, hsr_writer.cpp and write_dmr.cpp.
namespace  ModuleIO::detail

Functions

template<typename Tdata>
std::vector< long long > ModuleIO::detail::count_nonzeros_by_R (const SparseRMatrix< Tdata > &smat, const std::set< RCoordinate > &all_R_coor, const double threshold, const bool reduce)
 Count non-zero elements per R-block of a sparse R-matrix.
void ModuleIO::detail::check_output_file_open (const std::ofstream &ofs, const std::string &filename, const std::string &context)
 Quit if a sparse-matrix output stream failed to open.
bool ModuleIO::detail::append_ionic_step (const int out_app_flag, const int istep)
 Decide whether the current ionic step appends to an existing file.
std::string ModuleIO::detail::make_sparse_R_filename (const std::string &prefix, const std::string &spin_suffix, const bool numbered, const int istep, const std::string &extension)
 Build the "<prefix><spin suffix>[g<step>]_nao<ext>" name shared by every R-space sparse output.
void ModuleIO::detail::write_csr_text_header (std::ofstream &ofs, const CsrTextHeader &header)
 Write the common self-describing header of a CSR text file.
void ModuleIO::detail::write_csr_binary_header (std::ofstream &ofs, const int step, const int nbasis, const int number_of_R)
 Write the three-integer binary CSR header.
void ModuleIO::detail::write_R_record (std::ofstream &ofs, const int rx, const int ry, const int rz, const long long nnz, const bool binary, const bool leading_space)
 Write the "Rx Ry Rz nnz" record that starts one R block.