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

Implementation of the methods declared in WFNreader.h. More...

#include "WFreader.h"
Include dependency graph for WFreader.cpp:

Macros

#define _WFNREADER_CPP_
 For managing C header inclusion for WFreader.cpp.
 

Functions

void wf_allocateMemory ()
 Tool procedure to allocate the memory for the array linked to the number of nuclei, centers and primitives.
 
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.
 
void wfn_read_center_data (std::ifstream &inputFile, const bool verbose)
 Tool function which read the center data according to the number of nuclei.
 
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)
 
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)
 
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)
 
void wfn_read_total_energy_and_virial (std::ifstream &inputFile, const bool verbose)
 Tool function which read the total energy and associated virial.
 
void wfn_load_file (std::ifstream &inputFile, const bool verbose)
 Tool function which load the corresponding wfn file.
 
void wf_load_file (const std::string &fileName, const bool verbose)
 Tool function which read the corresponding file.
 
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 wf_cleaning (const bool verbose)
 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_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)
 
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)
 
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 wfx_load_file (std::ifstream &inputFile, const bool verbose)
 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)
 Tool function which read the data of the corresponding wfx file (this method must be called after wfx_load)
 
void wf_printMO ()
 Tool procedure to print molecular orbitals information.
 
void wf_printPrimitiveCenters ()
 Tool procedure to print the primitive centers.
 
void wf_printPrimitiveTypes ()
 Tool procedure to print the primitive types.
 
void wf_printPrimitiveExponents ()
 Tool procedure to print the primitive exponents.
 
void wf_printCenterData ()
 Tool procedure to print the center data.
 
void wf_printGlobalBounds ()
 Tool procedure to print 3 importants values : the number of nuclei, of primitives and molecular orbitals.
 
void wfn_printTotalEnergyAndVirial ()
 Tool procedure to print the total energy and virial (only use with WFN reading for the moment.
 
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.
 

Variables

bool fileLoaded =false
 a flag to know if a file is already loaded
 
unsigned int nbOrbitals =0
 Number of molecule orbitals.
 
unsigned int nbPrimitives =0
 Number ot primitives.
 
unsigned int nbNuclei =0
 Number of nuclei.
 
unsigned int * user2ADF_atomOrder =NULL
 Array that defines the re-ordering of atoms between the user's list and ADF atom numbering.
 
unsigned int * ADF2user_atomOrder =NULL
 Arrays that define the re-ordering of atoms between the ADF's list and user atom numbering.
 
centerDatacenters =NULL
 Variable for saving center data.
 
unsigned int * primitiveCenters =NULL
 Variable for saving the primitive data.
 
unsigned int * primitiveTypes =NULL
 Variable for saving the primitive types.
 
unsigned int * primitiveKRs =NULL
 Variable for saving the primitive kr (TO DOC)
 
double * primitiveExponents =NULL
 Variable for saving the exponents.
 
int netCharge =NOCHARGE
 Variable for saving the net charge in WFN(WFX)
 
std::vector< moleculeOrbitalmoleculeOrbitals
 Vector of molecules.
 
std::vector< std::string > wfxSectionNames
 WFX section names.
 
std::vector< int > inputFileSectionPositions
 To save where begin the data of each section.
 
double totalEnergy =0.0
 Total energy (only used in WFN reading)
 
double virial = 0.0
 Virial value (only used in WFN reading)
 

Detailed Description

Implementation of the methods declared in WFNreader.h.

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:

◆ 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 = false )

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_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 = false )

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 = false )

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_GAUSSIAN_line()

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.

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 = false )

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 = false )

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 = false )

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 = false )

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 = false )

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 = false )

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: