ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
test_hsk_writer.cpp File Reference

Unit tests for ModuleIO::write_hsk. More...

#include "source_io/module_hs/hsk_writer.h"
#include "source_base/matrix_block.h"
#include "source_base/module_out/filename.h"
#include "source_base/module_parallel/para_mpi_func.h"
#include "source_base/module_parallel/para_world.h"
#include "source_base/parallel_comm.h"
#include "source_base/parallel_common.h"
#include "source_basis/module_ao/parallel_orbitals.h"
#include "source_cell/klist.h"
#include "source_hamilt/hamilt.h"
#include "gtest/gtest.h"
#include <complex>
#include <cstdio>
#include <fstream>
#include <string>
#include <vector>
#include <mpi.h>
Include dependency graph for test_hsk_writer.cpp:

Functions

 TEST (WriteHsk, WritesHkAndSkForEveryKPoint)
 TEST (WriteHsk, SkipsOverlapForSpinDownChannel)
 TEST (WriteHsk, WritesComplexKMatrix)
 TEST (WriteHsk, Mode2OverwritesSameIstep)
 TEST (WriteHsk, WritesDenseTextAndAppendsRecords)
 TEST (WriteHsk, TextBodyKeepsRowMajorOrderForColumnMajorSolver)
int main (int argc, char **argv)

Detailed Description

Unit tests for ModuleIO::write_hsk.

write_hsk loops over the k points owned by this rank, calls Hamilt::updateHk followed by Hamilt::matrix, and writes one H(k) file per k point and one S(k) file per spin-up k point (the spin-down overlap is skipped because both spin channels share the same S).

A lightweight FakeHamilt supplies controllable local H/S blocks; the tests verify the call order (updateHk once per k point), the k-index mapping (ik -> ik2iktot global index appears in the filename), the spin-skip rule, and that the binary payload matches the distributed input after MPI reduction.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )
Here is the call graph for this function:

◆ TEST() [1/6]

TEST ( WriteHsk ,
Mode2OverwritesSameIstep  )
Here is the call graph for this function:

◆ TEST() [2/6]

TEST ( WriteHsk ,
SkipsOverlapForSpinDownChannel  )
Here is the call graph for this function:

◆ TEST() [3/6]

TEST ( WriteHsk ,
TextBodyKeepsRowMajorOrderForColumnMajorSolver  )
Here is the call graph for this function:

◆ TEST() [4/6]

TEST ( WriteHsk ,
WritesComplexKMatrix  )
Here is the call graph for this function:

◆ TEST() [5/6]

TEST ( WriteHsk ,
WritesDenseTextAndAppendsRecords  )
Here is the call graph for this function:

◆ TEST() [6/6]

TEST ( WriteHsk ,
WritesHkAndSkForEveryKPoint  )
Here is the call graph for this function: