occ
Loading...
Searching...
No Matches
occ::io Namespace Reference

file input and output module including reading wavefunction files More...

Namespaces

namespace  basis
namespace  crystalgrower
namespace  kmcpp
namespace  conversion
namespace  impl

Classes

struct  ColumnConfiguration
struct  RowConfiguration
class  Table
struct  AdaptiveBounds
class  AdaptiveGridBounds
struct  AtomData
struct  AdpData
struct  CellData
struct  SymmetryData
class  CifParser
class  CifWriter
 Writer class for crystallographic information files (CIF). More...
class  Cube
class  DftbGenFormat
class  EngradReader
class  GMFWriter
class  JsonCache
 Somewhere to keep expensive intermediate results (monomer energies, wavefunctions, solvation surfaces) as JSON documents, so a repeat calculation can skip them. More...
class  FileJsonCache
 Documents on disk, one file per key. Persists between runs. More...
class  MemoryJsonCache
 Documents held for the lifetime of the object; nothing touches the disk. More...
struct  CrystalBlock
 One structure from a file that may hold several, such as a multi-block CIF. More...
struct  ElectronInput
struct  GeometryInput
struct  OutputInput
struct  DriverInput
struct  COSXSettings
struct  MethodInput
struct  BasisSetInput
struct  SolventInput
struct  RuntimeInput
struct  OptimizationInput
struct  DispersionCorrectionInput
struct  CrystalInput
struct  PairInput
struct  IsosurfaceInput
struct  OccInput
struct  PointChargeFileReader
struct  GridFileHeader
struct  GridSymmetryInfo
class  PeriodicGrid
class  ShelxFile
 Unified reader/writer for SHELX .res/.ins crystallographic files. More...
struct  SiteMultipoles
struct  MoleculeSite
struct  MoleculeType
struct  BuckinghamPair
struct  Potentials
struct  Settings
struct  Basis
 Everything needed to define the energy model, independent of crystal packing. More...
struct  IndependentMolecule
struct  CrystalData
struct  ReferenceEnergies
struct  StructureInput
 Complete input for crystal energy calculations. More...
struct  XyzFileReader
class  FchkReader
class  FchkWriter
struct  GaussianInputFile
class  MoldenReader
 Reader for Molden format wavefunction files. More...
class  OrcaJSONReader
struct  QCSchemaBond
struct  QCSchemaTopology
struct  QCSchemaModel
struct  QCSchemaInput
class  QCSchemaReader
struct  JsonWavefunctionReader
struct  JsonWavefunctionWriter
struct  ElectronShell
struct  ECPShell
struct  ReferenceData
struct  ElementBasis
struct  JsonBasis
struct  JsonBasisReader
class  Element
 Utility class representing and holding data for a chemical element. More...

Typedefs

using Position = std::array<double, 3>
using PointChargeList = std::vector<occ::core::PointCharge>
using ElementMap

Enumerations

enum class  RIPolicy { Auto , None , JK , COSX }
enum class  GridFormat { GeneralGrid , PeriodicGrid }
enum class  GridDataType { Raw , Indexed }
enum class  JsonFormat {
  JSON , UBJSON , CBOR , BSON ,
  MSGPACK
}
enum  SpinorbitalKind
 Spin treatment for molecular orbitals / SCF. More...

Functions

template<typename PropertyFunctor>
auto make_adaptive_bounds (PropertyFunctor &func, const typename AdaptiveGridBounds< PropertyFunctor >::Parameters &params={})
occ::crystal::Crystal load_crystal (const std::string &filename)
std::vector< CrystalBlock > load_crystal_blocks (const std::string &filename)
 Every crystal in the file: one per data block of a CIF, otherwise the single structure load_crystal() reads.
occ::core::Molecule load_molecule (const std::string &filename)
template<typename T>
OccInput build (const std::string &filename)
template<typename T>
OccInput build (std::istream &file)
OccInput read_occ_input_file (const std::string path)
PointChargeFileReader::PointChargeList point_charges_from_file (const std::string &)
PointChargeFileReader::PointChargeList point_charges_from_string (const std::string &)
void to_json (nlohmann::json &j, const SiteMultipoles &m)
void from_json (const nlohmann::json &j, SiteMultipoles &m)
void to_json (nlohmann::json &j, const MoleculeSite &s)
void from_json (const nlohmann::json &j, MoleculeSite &s)
void to_json (nlohmann::json &j, const MoleculeType &mt)
void from_json (const nlohmann::json &j, MoleculeType &mt)
void to_json (nlohmann::json &j, const IndependentMolecule &im)
void from_json (const nlohmann::json &j, IndependentMolecule &im)
void to_json (nlohmann::json &j, const BuckinghamPair &bp)
void from_json (const nlohmann::json &j, BuckinghamPair &bp)
void to_json (nlohmann::json &j, const Potentials &p)
void from_json (const nlohmann::json &j, Potentials &p)
void to_json (nlohmann::json &j, const Settings &s)
void from_json (const nlohmann::json &j, Settings &s)
void to_json (nlohmann::json &j, const ReferenceEnergies &r)
void from_json (const nlohmann::json &j, ReferenceEnergies &r)
void to_json (nlohmann::json &j, const Basis &b)
void from_json (const nlohmann::json &j, Basis &b)
void to_json (nlohmann::json &j, const CrystalData &c)
void from_json (const nlohmann::json &j, CrystalData &c)
void to_json (nlohmann::json &j, const StructureInput &si)
void from_json (const nlohmann::json &j, StructureInput &si)
StructureInput read_structure_json (const std::string &path)
void write_structure_json (const std::string &path, const StructureInput &input)
void write_force_field_json (const std::string &path, const Basis &basis, const std::string &title="")
 Write only the force-field section (molecule definitions, multipoles, pair potentials, and model settings) to a standalone JSON file.
bool is_structure_format (const std::string &json_path)
 Detect whether a JSON file uses the structure format.
occ::core::Molecule molecule_from_xyz_file (const std::string &)
occ::core::Molecule molecule_from_xyz_string (const std::string &)
std::string to_xyz_string (const occ::core::Molecule &molecule)
std::string to_xyz_string (const occ::core::Molecule &molecule, const std::string &comment)
nlohmann::json isosurface_to_json (const isosurface::Isosurface &surf)
void write_isosurface_json (const std::string &filename, const isosurface::Isosurface &surf)
std::string isosurface_to_json_string (const isosurface::Isosurface &surf)
void write_obj_file (const std::string &filename, const isosurface::Isosurface &isosurface)
void write_ply_file (const std::string &filename, const Eigen::Matrix3Xf &vertices, const Eigen::Matrix3Xi &faces)
void write_ply_mesh (const std::string &filename, const isosurface::Isosurface &isosurface, bool binary=true)
void write_molden (const occ::qm::Wavefunction &wfn, std::ostream &os)
 Write a wavefunction in Molden format.
void write_molden (const occ::qm::Wavefunction &wfn, const std::string &filename)
JsonFormat json_format (const std::string &str)
bool valid_json_format_string (const std::string &str)

Detailed Description

file input and output module including reading wavefunction files

Typedef Documentation

◆ ElementMap

◆ PointChargeList

◆ Position

typedef std::array< double, 3 > occ::io::Position = std::array<double, 3>

Enumeration Type Documentation

◆ GridDataType

enum class occ::io::GridDataType
strong
Enumerator
Raw 
Indexed 

◆ GridFormat

enum class occ::io::GridFormat
strong
Enumerator
GeneralGrid 
PeriodicGrid 

◆ JsonFormat

enum class occ::io::JsonFormat
strong
Enumerator
JSON 
UBJSON 
CBOR 
BSON 
MSGPACK 

◆ RIPolicy

enum class occ::io::RIPolicy
strong
Enumerator
Auto 
None 
JK 
COSX 

◆ SpinorbitalKind

Spin treatment for molecular orbitals / SCF.

Unscoped enum: the enumerators are intentionally usable unqualified within the enclosing namespace. The canonical definition lives here (occ_core) so that low-level consumers (e.g. input/config structs) can reference it without depending on occ_qm; occ::qm re-exports the type and enumerators for backwards compatibility (see occ/qm/spinorbital.h).

Function Documentation

◆ build() [1/2]

template<typename T>
OccInput occ::io::build ( const std::string & filename)

◆ build() [2/2]

template<typename T>
OccInput occ::io::build ( std::istream & file)

◆ from_json() [1/11]

void occ::io::from_json ( const nlohmann::json & j,
Basis & b )

◆ from_json() [2/11]

void occ::io::from_json ( const nlohmann::json & j,
BuckinghamPair & bp )

◆ from_json() [3/11]

void occ::io::from_json ( const nlohmann::json & j,
CrystalData & c )

◆ from_json() [4/11]

void occ::io::from_json ( const nlohmann::json & j,
IndependentMolecule & im )

◆ from_json() [5/11]

void occ::io::from_json ( const nlohmann::json & j,
MoleculeSite & s )

◆ from_json() [6/11]

void occ::io::from_json ( const nlohmann::json & j,
MoleculeType & mt )

◆ from_json() [7/11]

void occ::io::from_json ( const nlohmann::json & j,
Potentials & p )

◆ from_json() [8/11]

void occ::io::from_json ( const nlohmann::json & j,
ReferenceEnergies & r )

◆ from_json() [9/11]

void occ::io::from_json ( const nlohmann::json & j,
Settings & s )

◆ from_json() [10/11]

void occ::io::from_json ( const nlohmann::json & j,
SiteMultipoles & m )

◆ from_json() [11/11]

void occ::io::from_json ( const nlohmann::json & j,
StructureInput & si )

◆ is_structure_format()

bool occ::io::is_structure_format ( const std::string & json_path)

Detect whether a JSON file uses the structure format.

◆ isosurface_to_json()

nlohmann::json occ::io::isosurface_to_json ( const isosurface::Isosurface & surf)

◆ isosurface_to_json_string()

std::string occ::io::isosurface_to_json_string ( const isosurface::Isosurface & surf)

◆ json_format()

JsonFormat occ::io::json_format ( const std::string & str)
inline

◆ load_crystal()

occ::crystal::Crystal occ::io::load_crystal ( const std::string & filename)

◆ load_crystal_blocks()

std::vector< CrystalBlock > occ::io::load_crystal_blocks ( const std::string & filename)

Every crystal in the file: one per data block of a CIF, otherwise the single structure load_crystal() reads.

A block that is not a crystal (no cell or symmetry, say) is returned with its error rather than skipped, so the result lines up with the file's blocks; so is a single-structure file that cannot be read.

Exceptions
std::runtime_errorif a CIF cannot be read or holds no data block.

◆ load_molecule()

occ::core::Molecule occ::io::load_molecule ( const std::string & filename)

◆ make_adaptive_bounds()

template<typename PropertyFunctor>
auto occ::io::make_adaptive_bounds ( PropertyFunctor & func,
const typename AdaptiveGridBounds< PropertyFunctor >::Parameters & params = {} )

◆ molecule_from_xyz_file()

occ::core::Molecule occ::io::molecule_from_xyz_file ( const std::string & )

◆ molecule_from_xyz_string()

occ::core::Molecule occ::io::molecule_from_xyz_string ( const std::string & )

◆ point_charges_from_file()

PointChargeFileReader::PointChargeList occ::io::point_charges_from_file ( const std::string & )

◆ point_charges_from_string()

PointChargeFileReader::PointChargeList occ::io::point_charges_from_string ( const std::string & )

◆ read_occ_input_file()

OccInput occ::io::read_occ_input_file ( const std::string path)

◆ read_structure_json()

StructureInput occ::io::read_structure_json ( const std::string & path)

◆ to_json() [1/11]

void occ::io::to_json ( nlohmann::json & j,
const Basis & b )

◆ to_json() [2/11]

void occ::io::to_json ( nlohmann::json & j,
const BuckinghamPair & bp )

◆ to_json() [3/11]

void occ::io::to_json ( nlohmann::json & j,
const CrystalData & c )

◆ to_json() [4/11]

void occ::io::to_json ( nlohmann::json & j,
const IndependentMolecule & im )

◆ to_json() [5/11]

void occ::io::to_json ( nlohmann::json & j,
const MoleculeSite & s )

◆ to_json() [6/11]

void occ::io::to_json ( nlohmann::json & j,
const MoleculeType & mt )

◆ to_json() [7/11]

void occ::io::to_json ( nlohmann::json & j,
const Potentials & p )

◆ to_json() [8/11]

void occ::io::to_json ( nlohmann::json & j,
const ReferenceEnergies & r )

◆ to_json() [9/11]

void occ::io::to_json ( nlohmann::json & j,
const Settings & s )

◆ to_json() [10/11]

void occ::io::to_json ( nlohmann::json & j,
const SiteMultipoles & m )

◆ to_json() [11/11]

void occ::io::to_json ( nlohmann::json & j,
const StructureInput & si )

◆ to_xyz_string() [1/2]

std::string occ::io::to_xyz_string ( const occ::core::Molecule & molecule)

◆ to_xyz_string() [2/2]

std::string occ::io::to_xyz_string ( const occ::core::Molecule & molecule,
const std::string & comment )

◆ valid_json_format_string()

bool occ::io::valid_json_format_string ( const std::string & str)
inline

◆ write_force_field_json()

void occ::io::write_force_field_json ( const std::string & path,
const Basis & basis,
const std::string & title = "" )

Write only the force-field section (molecule definitions, multipoles, pair potentials, and model settings) to a standalone JSON file.

Despite the serialized key being "basis" for historical reasons, this is distinct from the GTO basis set used elsewhere in OCC.

◆ write_isosurface_json()

void occ::io::write_isosurface_json ( const std::string & filename,
const isosurface::Isosurface & surf )

◆ write_molden() [1/2]

void occ::io::write_molden ( const occ::qm::Wavefunction & wfn,
const std::string & filename )

◆ write_molden() [2/2]

void occ::io::write_molden ( const occ::qm::Wavefunction & wfn,
std::ostream & os )

Write a wavefunction in Molden format.

Coordinates are in bohr. Spherical bases are flagged with [5D] [7F] [9G]; Cartesian functions are written unit-normalized, as the format requires. Unrestricted wavefunctions are written as alpha then beta orbitals in one [MO] section. ECPs cannot be represented in Molden files.

◆ write_obj_file()

void occ::io::write_obj_file ( const std::string & filename,
const isosurface::Isosurface & isosurface )

◆ write_ply_file()

void occ::io::write_ply_file ( const std::string & filename,
const Eigen::Matrix3Xf & vertices,
const Eigen::Matrix3Xi & faces )

◆ write_ply_mesh()

void occ::io::write_ply_mesh ( const std::string & filename,
const isosurface::Isosurface & isosurface,
bool binary = true )

◆ write_structure_json()

void occ::io::write_structure_json ( const std::string & path,
const StructureInput & input )