Loading...
Searching...
No Matches
q3::BerkeleyGWCommonHeader Class Reference

#include <header.hpp>

Public Member Functions

 BerkeleyGWCommonHeader (const MeanFieldRecord &&, std::string, bool)=delete
 See the writers' own deleted rvalue constructors: this holds a reference.
 
 BerkeleyGWCommonHeader (const MeanFieldRecord &&, std::string, const std::array< int32_t, 3 > &)=delete
 
 BerkeleyGWCommonHeader (const MeanFieldRecord &record, std::string stitle, bool include_kpoint_fields)
 
 BerkeleyGWCommonHeader (const MeanFieldRecord &record, std::string stitle, const std::array< int32_t, 3 > &projector_dimensions)
 
void write (std::ofstream &output_file) const
 Write records 1 through 8 to output_file.
 

Static Public Member Functions

static std::pair< std::array< int32_t, 3 >, std::array< double, 3 > > complete_kpoint_grid (const std::vector< Vector3D > &kpoint_coordinates)
 
static std::pair< std::array< int32_t, 3 >, std::array< double, 3 > > kpoint_grid_from_list (const std::vector< Vector3D > &kpoint_coordinates, const std::vector< Real > &kpoint_weights, const std::vector< SymmetryOperation > &symmetry_operations)
 

Detailed Description

Definition at line 97 of file header.hpp.

Constructor & Destructor Documentation

◆ BerkeleyGWCommonHeader() [1/4]

q3::BerkeleyGWCommonHeader::BerkeleyGWCommonHeader ( const MeanFieldRecord &  record,
std::string  stitle,
bool  include_kpoint_fields 
)
inline
Parameters
stitle32-byte title, e.g. "WFN-Complex" or "RHO-Complex" (space-padded/truncated to 32 bytes; pw2bgw.x's write_wfng and write_rhog always pad with spaces, never a NUL terminator).
include_kpoint_fieldstrue for WFN (record 2 carries nk/nbands/ngkmax/ecutwfc and record 3 carries kgrid/kshift), false for RHO (the BerkeleyGW specification's wavefunction-only fields; write_rhog records 2-3).

Definition at line 112 of file header.hpp.

◆ BerkeleyGWCommonHeader() [2/4]

q3::BerkeleyGWCommonHeader::BerkeleyGWCommonHeader ( const MeanFieldRecord &  record,
std::string  stitle,
const std::array< int32_t, 3 > &  projector_dimensions 
)
inline

The VKB header: the WFN header with record 2's nbands replaced by projector_dimensions = {nsp, nkb, nhm} – the number of species, of projector channels over all atoms, and the most channels any one atom has.

Definition at line 125 of file header.hpp.

◆ BerkeleyGWCommonHeader() [3/4]

q3::BerkeleyGWCommonHeader::BerkeleyGWCommonHeader ( const MeanFieldRecord &&  ,
std::string  ,
bool   
)
delete

See the writers' own deleted rvalue constructors: this holds a reference.

◆ BerkeleyGWCommonHeader() [4/4]

q3::BerkeleyGWCommonHeader::BerkeleyGWCommonHeader ( const MeanFieldRecord &&  ,
std::string  ,
const std::array< int32_t, 3 > &   
)
delete

Member Function Documentation

◆ complete_kpoint_grid()

static std::pair< std::array< int32_t, 3 >, std::array< double, 3 > > q3::BerkeleyGWCommonHeader::complete_kpoint_grid ( const std::vector< Vector3D > &  kpoint_coordinates)
inlinestatic

The smallest grid holding every point of kpoint_coordinates, if the points fill it exactly (every grid point present); 0 0 0 / 0 0 0 otherwise. Per axis, the smallest n at which every n * k sits the same distance from an integer, that common offset being the shift (in units of the grid step, wrapped to (-0.5, 0.5]); an axis no grid of up to maximum_grid_dimension divisions fits – a band-structure path, say – leaves the whole result unset.

Definition at line 208 of file header.hpp.

References q3::math::tolerances::kpoint_grid_offset_tolerance.

Referenced by kpoint_grid_from_list().

◆ kpoint_grid_from_list()

static std::pair< std::array< int32_t, 3 >, std::array< double, 3 > > q3::BerkeleyGWCommonHeader::kpoint_grid_from_list ( const std::vector< Vector3D > &  kpoint_coordinates,
const std::vector< Real > &  kpoint_weights,
const std::vector< SymmetryOperation > &  symmetry_operations 
)
inlinestatic

kgrid and kshift for an explicit k-point list (crystal coordinates) – the numbers pw2bgw.x takes as its wfng_nk and wfng_dk inputs for the same points.

Only a grid the list pins down is returned:

  1. the list unfolded by the crystal's rotations and time reversal, when that star fills a grid exactly – a symmetry-reduced wedge, or a full grid, of a grid the rotations preserve;
  2. otherwise the list as given, when it is a full grid – every point once, all with the same weight – e.g. the WFNq list, the full 4x4x2 grid displaced by q0 = (0.001, 0, 0), which gives 4 4 2 with shift (0.004, 0, 0);
  3. otherwise 0 0 0 / 0 0 0, what the record carried before. A reduced list also fits coarser grids than its own, sometimes exactly: the two-point wedge of the shifted 2x2x2 FCC grid is a complete 2x1x1 grid. Its weights are orbit sizes, though, not equal, which is what keeps it out of case 2. Case 3 is then such a wedge of a grid the rotations do not preserve – a shifted FCC grid – which no rule recovers from the points alone.

Weights are compared exactly: a full list is written with one weight repeated, and the same scaling of equal numbers stays equal.

Definition at line 164 of file header.hpp.

References complete_kpoint_grid().

◆ write()

void q3::BerkeleyGWCommonHeader::write ( std::ofstream &  output_file) const
inline

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