XACopy copies the contents of the parameter curr_atom into a new created data structure whose pointer is returned afterwards. Please free the memory allocated by the source atom when you do not need it anymore. This should prevent memory leaks.
Name XACreateOrbitalArray
Parameter(s) (atom_ptr curr_atom, char *orbital_string, double alpha)
Returns create_orbital_array_ptr
Global variables none
Calling
XAMatrix,
XAVector,
XAElim,
XASolve,
XAFactorial
File Gauss.h, gauss.c
This function combines all the steps necessary to create a new pseudo orbital of type symbol. After the calculation a pointer to the create orbital array structure is returned which consists of the following elements:
Name XACalculateCreate
Parameter(s) (atom_ptr curr_atom)
Returns int
Global variables
GCreateSymbol,
Gcrutch,
GCreateOrbital
Calling
XANextMaxOrbital,
XAMinAlpha,
XACreateOrbitalArray
File Xamisc.h, xamisc.c
XACalculateCreate controls the creation of a new pseudo orbital. After preparing all the necessary preconditions XACalculateCreate calls XACreateOrbitalArray which solves the linear equations to get the new n-, alpha and constant values of the pseudo orbital.
The global variables fullfill the following functions
Name XAOrbitalArray
Parameter(s) (atom_ptr curr_atom)
Returns orbital_array_ptr
Global variables none
Calling
XAFirstOrbital,
XANextOrbital,
XAOrbitalSymbol,
XAFirstShell,
XANextShell
File Access.h, access.c
XAOrbitalArray returns general pieces of information of an atom to the calling procedure. The information is written into an orbital_array_ptr structure whose memory has to be allocated before before calling XAOrbitalArray. After that the values can be accessed by using:
Please note
XAOrbitalArray and its convenience functions are closely connected,
therefore whenever XAOrbitalArray is mentioned in the Calling
list one of the above convenience functions is definitely called to.
Name XAAllocateGOrbitalListItems
Parameter(s) (atom_ptr curr_atom)
Returns int
Global variables
GOrbitalListItems,
GNumberOrbitals
Calling XAOrbitalArray
File Xamisc.h, xamisc.c
It is necessary that this procedure is called directly after adding or deleting an orbital of the atom structure. Otherwise XA might address the wrong orbitals for computations or drawings. XAAllocateGOrbitalListItems reserves memory for the global array GOrbitalListItems to store new values and releases the memory allocation for the previous ones. Generally, GOrbitalListItems stores the selected orbitals in the Orbitals listbox of the main menu.
GNumberOrbitals has to be set to the returned int value after the procedure call of XAAllocateGOrbitalListItems. If an error occurs, the value CANCEL will be returned to the calling procedure.
Name XANextMaxOrbital
Parameter(s) (atom_ptr curr_atom, char* orbital_string)
Returns int
Global variables none
Calling XAOrbitalArray
File Xamisc.h, xamisc.c
XANextMaxOrbital returns the next shell number for the given orbital type which is extracted from the orbital_string parameter. This function is usefull in the creation of pseudo orbitals for which the shell number of a new orbital is just increased by one. In case of an error the value INTEGER_RETURN_ERROR is returned.
Name XAMinAlpha
Parameter(s) (atom_ptr curr_atom, char symbol)
Returns float
Global variables none
Calling
XAOrbitalArray,
XAData,
XANextData,
XACurrentAlpha
File Xamisc.h, xamisc.c
XAMinAlpha is looking for the smallest alpha value of the given orbital type symbol. If an error occurs, the FLOAT_RETURN_ERROR will be returned. This function is necessary in the creation of pseudo orbitals whose default alpha is set to the minimum.
Name XAFindMaxN
Parameter(s) (atom_ptr curr_atom)
Returns int
Global variables none
Calling
XAFirstOrbital,
XANextOrbital,
XAFirstShell,
XANextShell,
XAShellNr
File Xamisc.h, xamisc.c
XAFindMaxN examines the whole atom structure, i.e. every orbital, for the smallest n value. If one is found, it is returned to the calling procedure, otherwise the value CANCEL. This procedure is used in the drawing routine to figure out the amount of points which have to be calculated.
Name XADeleteOrbital
Parameter(s) (atom_ptr curr_atom)
Returns int
Global variables
GOrbitalListItems,
Gcrutch,
GDrawList,
GNumberOrbitals,
GCount
Calling
XAShell,
XAData,
XAFirstData,
XANextData,
XASetNextShell,
XAFillOrbitalListbox,
XANextMaxOrbital,
XAAllocateGOrbitalListItems
File Xamisc.h, xamisc.c
Briefly said, XADeleteOrbital removes the selected orbital in the Orbitals listbox. Before calling XADeleteOrbital Gcrutch has to be set to UPDORB if the selected orbital has to be updated, or DELORB otherwise. In the procedure the global pointer to the atom structure curr_atom is changed, as are GOrbitalListItems, GDrawList, GNumberOrbitals and GCount. Due to these changes the drawing area has to be deleted what is done in the procedure too.
In case of an error, the value CANCEL will be returned, otherwise OK.
Name XAUpdateOrbital
Parameter(s) (atom_ptr curr_atom)
Returns int
Global variables
GCreateSymbol,
GOrbitalListItems
Calling none
File Xamisc.h, xamisc.c
XAUpdateOrbital controls the update process of the selected orbital in the Orbitals listbox of the main window.