IGMPlot 3.16
Optimized IGMplot version able to use wfn/wfx/xyz files
Loading...
Searching...
No Matches
WFreader.h File Reference

Procedure/Function to manage wave function files (WFN V1.0 and WFX V2.0) More...

#include <fstream>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <general.h>
#include <ADF_KFReader.h>
Include dependency graph for WFreader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  centerData
 structure to save center data More...
 
struct  moleculeOrbital
 structure to save molecule orbital data More...
 

Macros

#define _WFNREADER_H_
 For managing C header inclusion for WFreader.h.
 

Typedefs

typedef struct centerData centerData
 structure to save center data
 
typedef struct moleculeOrbital moleculeOrbital
 structure to save molecule orbital data
 

Functions

void wf_load_file (const std::string &fileName, const bool verbose=false)
 Tool function which read the corresponding file.
 
void wfn_load_file (std::ifstream &inputFile, const bool verbose=false)
 Tool function which load the corresponding wfn file.
 
void wfn_read_GAUSSIAN_line (const std::string &line, const bool verbose=false)
 Tool function which read the line starting by GAUSSIAN to extract the number of orbitals, of primitives and nuclei.
 
void wfn_read_center_data (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the center data according to the number of nuclei.
 
void wfn_read_primitive_centers (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the primitive centers (multiple lines according to the number of primitives)
 
void wfn_read_primitive_types (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the primitive types (multiple lines according to the number of primitives)
 
void wfn_read_exponents (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the exponents (multiple lines according to the number of primitives)
 
void wfn_read_molecule_orbitals (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the molecule orbital (multiple lines according to the number of primitives)
 
void wfn_read_total_energy_and_virial (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the total energy and associated virial.
 
void wfn_fromFortranRealToCppReal (std::string &line)
 Tool function which allows to transform a line with fortran real (with D) to C real (with E) in order to read them.
 
void wfn_printTotalEnergyAndVirial ()
 Tool procedure to print the total energy and virial (only use with WFN reading for the moment.
 
void wfx_load_file (std::ifstream &inputFile, const bool verbose=false)
 Tool function which load the corresponding wfx file.
 
void wfx_init ()
 Tool procedure to initialize some stuff for wfx reading.
 
void wfx_read_data (std::ifstream &inputFile, const bool verbose=false)
 Tool function which read the data of the corresponding wfx file (this method must be called after wfx_load)
 
void wf_cleaning (const bool verbose=false)
 Tool function which frees all the allocated memory.
 
bool wf_file_already_loaded ()
 Tool function which allows to know if a file has already loaded.
 
unsigned int wf_number_of_orbitals ()
 Tool function which allows to know the number of orbitals (if a file is loaded)
 
unsigned int wf_number_of_primitives ()
 Tool function which allows to know the number of primitives (if a file is loaded)
 
unsigned int wf_number_of_nuclei ()
 Tool function which allows to know the number of nuclei (if a file is loaded)
 
unsigned int * wf_user2ADF_atomOrder ()
 Tool function which return the array storing the atom re-ordering (from user to ADF index)
 
unsigned int * wf_ADF2user_atomOrder ()
 Tool function which return the array storing the atom re-ordering (from ADF to user index)
 
centerDatawf_center_data ()
 Tool function which allows to gain access to all the center data (if a file is loaded)
 
unsigned int * wf_primitive_centers ()
 Tool function which allows to gain access to all the primitive centers (if a file is loaded)
 
unsigned int * wf_primitive_types ()
 Tool function which allows to gain access to all the primitive types (if a file is loaded)
 
double * wf_primitive_exponents ()
 Tool function which allows to gain access to all the exponents (if a file is loaded)
 
int wf_netCharge ()
 Tool function which returns the net charge of the whole system (if a file is loaded)
 
std::vector< moleculeOrbitalwf_molecular_orbitals ()
 Tool function which allows to gain access to all molecular orbitals (if a file is loaded)
 
bool wf_molecular_orbitals_sort ()
 Tool function which sort the MOs by ascending order of energy.
 
void wf_allocateMemory ()
 Tool procedure to allocate the memory for the array linked to the number of nuclei, centers and primitives.
 
void wf_printGlobalBounds ()
 Tool procedure to print 3 importants values : the number of nuclei, of primitives and molecular orbitals.
 
void wf_printMO ()
 Tool procedure to print molecular orbitals information.
 
void wf_printPrimitiveExponents ()
 Tool procedure to print the primitive exponents.
 
void wf_printPrimitiveTypes ()
 Tool procedure to print the primitive types.
 
void wf_printPrimitiveCenters ()
 Tool procedure to print the primitive centers.
 
void wf_printCenterData ()
 Tool procedure to print the center data.
 
template<typename T>
void loadInputFileData (std::ifstream &inputFile, T *data, unsigned int nbData)
 Template Tool procedure to load the data from an inputFile.
 
template<typename T>
void wf_printInformation (const T *data, const unsigned int nbData, const unsigned int nbDataLine, const unsigned int borderShift=1, const bool scientific=true, const unsigned int precision=12)
 Template Tool procedure to print data.
 
bool isDouble (std::string text)
 Function checking if a string is a number.
 
double toDouble (std::string text)
 Function converting a string to a double.
 

Detailed Description

Procedure/Function to manage wave function files (WFN V1.0 and WFX V2.0)

Function Documentation

◆ isDouble()

bool isDouble ( std::string text)

Function checking if a string is a number.

Returns
true is the textis a number
Here is the caller graph for this function:

◆ loadInputFileData()

template<typename T>
void loadInputFileData ( std::ifstream & inputFile,
T * data,
unsigned int nbData )

Template Tool procedure to load the data from an inputFile.

Warning
The reading assumes that the inputFile is ready to read nbData T values... No verification
Parameters
inputFileThe stream in order to read the data
dataThe array of T to load
nbDataThe number of values of type T to read
Here is the caller graph for this function:

◆ toDouble()

double toDouble ( std::string text)

Function converting a string to a double.

Returns
a double number or 0.0 if the conversion failed
Here is the caller graph for this function:

◆ wf_ADF2user_atomOrder()

unsigned int * wf_ADF2user_atomOrder ( )

Tool function which return the array storing the atom re-ordering (from ADF to user index)

Returns
ADF2user_atomOrder array
Here is the caller graph for this function:

◆ wf_center_data()

centerData * wf_center_data ( )

Tool function which allows to gain access to all the center data (if a file is loaded)

Returns
The center data
Here is the caller graph for this function:

◆ wf_file_already_loaded()

bool wf_file_already_loaded ( )

Tool function which allows to know if a file has already loaded.

Returns
If a file is already loaded or not
Here is the caller graph for this function:

◆ wf_load_file()

void wf_load_file ( const std::string & fileName,
const bool verbose )

Tool function which read the corresponding file.

Parameters
fileNameThe name of the file to read
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wf_molecular_orbitals()

std::vector< moleculeOrbital > wf_molecular_orbitals ( )

Tool function which allows to gain access to all molecular orbitals (if a file is loaded)

Returns
The molecular orbitals
Here is the caller graph for this function:

◆ wf_molecular_orbitals_sort()

bool wf_molecular_orbitals_sort ( )

Tool function which sort the MOs by ascending order of energy.

  • **
    Returns
    true if MO order has changed

◆ wf_netCharge()

int wf_netCharge ( )

Tool function which returns the net charge of the whole system (if a file is loaded)

  • **
    Returns
    The Net Charge

◆ wf_number_of_nuclei()

unsigned int wf_number_of_nuclei ( )

Tool function which allows to know the number of nuclei (if a file is loaded)

Returns
The number of nuclei
Here is the caller graph for this function:

◆ wf_number_of_orbitals()

unsigned int wf_number_of_orbitals ( )

Tool function which allows to know the number of orbitals (if a file is loaded)

Returns
The number of orbitals

◆ wf_number_of_primitives()

unsigned int wf_number_of_primitives ( )

Tool function which allows to know the number of primitives (if a file is loaded)

Returns
The number of primitives
Here is the caller graph for this function:

◆ wf_primitive_centers()

unsigned int * wf_primitive_centers ( )

Tool function which allows to gain access to all the primitive centers (if a file is loaded)

Returns
The primitive centers
Here is the caller graph for this function:

◆ wf_primitive_exponents()

double * wf_primitive_exponents ( )

Tool function which allows to gain access to all the exponents (if a file is loaded)

Returns
The exponents
Here is the caller graph for this function:

◆ wf_primitive_types()

unsigned int * wf_primitive_types ( )

Tool function which allows to gain access to all the primitive types (if a file is loaded)

Returns
The primitive types
Here is the caller graph for this function:

◆ wf_printInformation()

template<typename T>
void wf_printInformation ( const T * data,
const unsigned int nbData,
const unsigned int nbDataLine,
const unsigned int borderShift = 1,
const bool scientific = true,
const unsigned int precision = 12 )

Template Tool procedure to print data.

Parameters
dataThe array of T to print
nbDataThe number of values in data
nbDataLineThe number of data by line
borderShiftThe number of shift ("\t") to put at the beginning of a line
scientificActivate the scientific notation ?
precisionThe precision is scientific notation is required (not used if scientific is not true)
Here is the caller graph for this function:

◆ wf_user2ADF_atomOrder()

unsigned int * wf_user2ADF_atomOrder ( )

Tool function which return the array storing the atom re-ordering (from user to ADF index)

Returns
user2ADF_atomOrder array
Here is the caller graph for this function:

◆ wfn_fromFortranRealToCppReal()

void wfn_fromFortranRealToCppReal ( std::string & line)

Tool function which allows to transform a line with fortran real (with D) to C real (with E) in order to read them.

Parameters
lineThe string containing the information to transform
Here is the caller graph for this function:

◆ wfn_load_file()

void wfn_load_file ( std::ifstream & inputFile,
const bool verbose )

Tool function which load the corresponding wfn file.

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_center_data()

void wfn_read_center_data ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the center data according to the number of nuclei.

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_exponents()

void wfn_read_exponents ( std::ifstream & inputFile,
const bool verbose = false )

Tool function which read the exponents (multiple lines according to the number of primitives)

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed

◆ wfn_read_GAUSSIAN_line()

void wfn_read_GAUSSIAN_line ( const std::string & line,
const bool verbose )

Tool function which read the line starting by GAUSSIAN to extract the number of orbitals, of primitives and nuclei.

Parameters
lineThe line to considered
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_molecule_orbitals()

void wfn_read_molecule_orbitals ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the molecule orbital (multiple lines according to the number of primitives)

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_primitive_centers()

void wfn_read_primitive_centers ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the primitive centers (multiple lines according to the number of primitives)

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_primitive_types()

void wfn_read_primitive_types ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the primitive types (multiple lines according to the number of primitives)

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfn_read_total_energy_and_virial()

void wfn_read_total_energy_and_virial ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the total energy and associated virial.

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wfx_load_file()

void wfx_load_file ( std::ifstream & inputFile,
const bool verbose )

Tool function which load the corresponding wfx file.

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the caller graph for this function:

◆ wfx_read_data()

void wfx_read_data ( std::ifstream & inputFile,
const bool verbose )

Tool function which read the data of the corresponding wfx file (this method must be called after wfx_load)

Parameters
inputFileThe stream in order to read the data
verboseIf some debug information have to be printed
Here is the call graph for this function:
Here is the caller graph for this function: