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

Unit tests for dhs_sparse_writer.cpp (ModuleIO::save_dH_sparse). More...

Include dependency graph for test_dhs_sparse_writer.cpp:

Functions

 TEST (DhsSparseWriter, TextCountsOnlyValuesAboveThreshold)
 TEST (DhsSparseWriter, BinaryCountsOnlyValuesAboveThreshold)
 TEST (DhsSparseWriter, SocWritesAllDirections)
 TEST (DhsSparseWriter, OverlapDerivativeWritesSingleSpinChannel)
 TEST (DhsSparseWriter, AppendModeReusesFixedFilename)
int main (int argc, char **argv)

Detailed Description

Unit tests for dhs_sparse_writer.cpp (ModuleIO::save_dH_sparse).

save_dH_sparse writes the derivative sparse matrices (dHx/dHy/dHz) for either H or S into separate CSR files. The tests verify that:

  • text mode respects the sparse threshold
  • binary mode preserves the native field order
  • SOC spin mode (nspin == 4) writes the complex variant for all three directions.

dhs_sparse_writer.cpp only reads GlobalV::DRANK; no PARAM state is involved, so the fixture sets DRANK directly.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

◆ TEST() [1/5]

TEST ( DhsSparseWriter ,
AppendModeReusesFixedFilename  )
Here is the call graph for this function:

◆ TEST() [2/5]

TEST ( DhsSparseWriter ,
BinaryCountsOnlyValuesAboveThreshold  )
Here is the call graph for this function:

◆ TEST() [3/5]

TEST ( DhsSparseWriter ,
OverlapDerivativeWritesSingleSpinChannel  )
Here is the call graph for this function:

◆ TEST() [4/5]

TEST ( DhsSparseWriter ,
SocWritesAllDirections  )
Here is the call graph for this function:

◆ TEST() [5/5]

TEST ( DhsSparseWriter ,
TextCountsOnlyValuesAboveThreshold  )
Here is the call graph for this function: