ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ReadLatticeValidationTest Class Reference
Inheritance diagram for ReadLatticeValidationTest:
Collaboration diagram for ReadLatticeValidationTest:

Protected Member Functions

void SetUp () override
void TearDown () override
std::string write_stru_file (const std::string &name, const std::string &content)
std::ifstream open_stru_file (const std::string &path)

Protected Attributes

Lattice lat
std::ofstream ofs_running
std::string log_path
std::vector< std::string > stru_paths

Detailed Description

  • Tested Functions:
    • HexagonalMissingParamsRejected / TrigonalMissingParamsRejected
      • read_lattice_constant(): non-cubic named lattices require LATTICE_PARAMETERS; without it the shape variables stayed zero and produced a zero-volume or NaN cell (issue #8354)
    • CommentMentionDoesNotSatisfyParamsRequirement
      • a "# LATTICE_PARAMETERS" comment token is not a parameter section; SCAN_LINE_BEGIN matches any token in a line, so the section lookup must require the keyword to begin a line
    • CommentMentionDoesNotShadowRealParams
      • with a real LATTICE_PARAMETERS section present, the value must come from that section, not from the token after a comment mention
    • TrigonalMalformedParamRejected
      • a failed cos(alpha) extraction must not silently become the simple-cubic (alpha = 90 degree) special case
    • TrigonalImpossibleAngleRejected
      • cos(alpha) = 1.1 parses fine but yields NaN lattice vectors, which the finiteness check must reject
    • SmPartiallyMalformedParamsRejected / BacmPartiallyMalformedParamsRejected / TriclinicPartiallyMalformedParamsRejected
      • a partially malformed multi-value LATTICE_PARAMETERS line (e.g. "2 3 bad") leaves a finite nonzero-volume cell, so the determinant check alone is not enough for these branches
    • ValidHexagonalWithParams / ValidSmWithParams
      • a hexagonal lattice with c/a given still reads normally
    • SoRangeOverflowRejected / StRangeOverflowRejected
      • an out-of-range value such as 1e999 sets failbit but stores DBL_MAX, leaving a finite nonzero-volume cell that the determinant check alone would accept; every LATTICE_PARAMETERS extraction is therefore validated directly
    • CubicScNeedsNoParams
      • cubic lattice names do not need LATTICE_PARAMETERS
    • DegenerateLatticeVectorsRejected
      • explicit LATTICE_VECTORS forming a zero-volume cell are rejected
    • SpeciesMissingMassRejected
      • read_atom_species(): an ATOMIC_SPECIES line without a mass left mass = 0 silently (issue #8356); it must now quit with a message
    • PartialLatticeVectorsRejected
      • read_lattice_constant(): fewer than 9 LATTICE_VECTORS components left the unread tail at the Matrix3 default (identity), surviving even the determinant check; it must now quit with a message
    • ValidSpeciesAndVectors
      • a well-formed species line and a full 3x3 LATTICE_VECTORS block still read normally
    • LatticeVectorsWithInlineCommentsAccepted
      • vector rows annotated with trailing comments ("0.5 0.5 0.0 # a3"), common in real STRU files, must still be accepted

Member Function Documentation

◆ open_stru_file()

std::ifstream ReadLatticeValidationTest::open_stru_file ( const std::string & path)
inlineprotected

◆ SetUp()

void ReadLatticeValidationTest::SetUp ( )
inlineoverrideprotected

◆ TearDown()

void ReadLatticeValidationTest::TearDown ( )
inlineoverrideprotected

◆ write_stru_file()

std::string ReadLatticeValidationTest::write_stru_file ( const std::string & name,
const std::string & content )
inlineprotected

Member Data Documentation

◆ lat

Lattice ReadLatticeValidationTest::lat
protected

◆ log_path

std::string ReadLatticeValidationTest::log_path
protected

◆ ofs_running

std::ofstream ReadLatticeValidationTest::ofs_running
protected

◆ stru_paths

std::vector<std::string> ReadLatticeValidationTest::stru_paths
protected

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