|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
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>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) |
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.
| int main | ( | int | argc, |
| char ** | argv ) |
| TEST | ( | WriteHsk | , |
| Mode2OverwritesSameIstep | ) |
| TEST | ( | WriteHsk | , |
| SkipsOverlapForSpinDownChannel | ) |
| TEST | ( | WriteHsk | , |
| TextBodyKeepsRowMajorOrderForColumnMajorSolver | ) |
| TEST | ( | WriteHsk | , |
| WritesComplexKMatrix | ) |
| TEST | ( | WriteHsk | , |
| WritesDenseTextAndAppendsRecords | ) |
| TEST | ( | WriteHsk | , |
| WritesHkAndSkForEveryKPoint | ) |