int main(int argc, char* argv[]){ #ifdef DEBUG FILE* fileOut = fopen("./debug.txt","w"); fprintf(fileOut," *** Debug File Created *** \n"); #endif parseCommandArguments(argc, argv); glutInit(&argc, argv); //Simple buffer init(); // glGetFloatv (GL_MODELVIEW_MATRIX, m); //Call to the drawing function glutDisplayFunc(draw); #ifdef ANIMATION_SHOW glutTimerFunc(DELAY,update,0); #else glutMouseFunc(mouse); glutMotionFunc(motion); #endif glutMainLoop(); #ifdef DEBUG fclose(fileOut); #endif return 0; }
main(int argc,char *argv[]) { try{ parseCommandArguments( argc, // in argv, //in ¶ms, //in/out paramFile, //out additionalParams, //out Error, // aux prefix //out ); printf("prefix = [%s]\n",prefix); printf("Parameters = [%s]\n", paramFile); printf("AdditionalParameters = [%s]\n",additionalParams); ParametersAdaptor3DRISM pa(¶ms); char Error[256]; MGFactoryCollection3DRISM3 *factories= new MGFactoryCollection3DRISM3(); factories->init(&pa); GridIndependent3DRISM3 *gridIndependent = (GridIndependent3DRISM3 *) factories->m_gridIndependent; Grid3DRISM grid0(1,1,1,1,1,1); generateGrid3DRISM(gridIndependent->getSoluteCoordinates(), //CMoleculeCoordinates *coors, pa.getBuffer(), // Real buffer, pa.getSpacing(), //Real dr, &grid0, //Grid3DRISM *result, //out 2 //Integer align ); int Nsites = gridIndependent->getSolventCharges()->getNumSites(); GridDependent3DRISM3 *gridDependent = (GridDependent3DRISM3*)gridIndependent->createGridDependent(&grid0); Solution3DRISMR *pot = gridDependent->getBetaUshort(); saveGrid3DRISM( &grid0, //Grid3DRISM *grid, prefix, //const char *fileNamePrefix, ".grd" //const char *fileNameSuffix) ); for(int i=0;i<Nsites;i++) { sprintf(fname,"%spot%d.3d",prefix,i); writeDoubleArrayToFile(fname,//const char *fname, pot->getGamma()[i],//potentReal *x, pot->getSizeOfOneGamma() // Integer N ); } NULL_DELETE(pot); NULL_DELETE( factories); return 0; }catch(Exception *e) { printf("Exception: %s\n",e->toString()); NULL_DELETE(e); } return 1; }
main(int argc,char *argv[]) { try{ parseCommandArguments( argc, // in argv, //in ¶ms, //in/out paramFile, //out additionalParams, //out Error, // aux prefix //out ); printf("prefix = [%s]\n",prefix); printf("Parameters = [%s]\n", paramFile); printf("AdditionalParameters = [%s]\n",additionalParams); ParametersAdaptor3DRISM pa(¶ms); char Error[256]; MGFactoryCollection3DRISM3 *factories= new MGFactoryCollection3DRISM3(); factories->init(&pa); GridIndependent3DRISM3 *gridIndependent = (GridIndependent3DRISM3 *) factories->m_gridIndependent; Grid3DRISM grid0(1,1,1,1,1,1); char prefix0[256]; strcpy(prefix0,prefix); prefix0[strlen(prefix)-1]=0; readGrid(prefix0,&grid0); Nx = grid0.getNx(); Ny = grid0.getNy(); Nz = grid0.getNz(); dx = grid0.getDRx(); dy = grid0.getDRy(); dz = grid0.getDRz(); printf("SIZES =%d x %d x %d \n",Nx,Ny,Nz); printf("SPACING = %lf ,%lf, %lf \n",dx,dy,dz); // Grid3DRISM grid0(Nx,Ny,Nz,dx,dy,dz); Solution3DRISMR *gamma = (Solution3DRISMR *)factories->createSolution(&grid0); Solution3DRISMR *c = (Solution3DRISMR *)factories->createSolution(&grid0); Solution3DRISMR *clong= (Solution3DRISMR *)factories->createSolution(&grid0); Solution3DRISMR *ctotal = (Solution3DRISMR *)factories->createSolution(&grid0); readFunctionFromFile( prefix, //const char *prefix, "gamma",//const char *functionName, gamma //Solution3DRISMR *gamma //out ); readFunctionFromFile( prefix, //const char *prefix, "c", //const char *functionName, c //Solution3DRISMR *gamma //out ); readFunctionFromFile( prefix, //const char *prefix, "clong",//const char *functionName, clong //Solution3DRISMR *gamma //out ); c->copy(ctotal); // ctotal = c addSolution3DRISMR(ctotal,clong); //ctotal +=clong double value_KH= calculateKHFreeEnergy( gamma, //Solution3DRISMR *gamma, c, //Solution3DRISMR *c, clong, //Solution3DRISMR *minusBetaUlong, gridIndependent->getKBT(), //Real kBT, gridIndependent->getSiteDensities()->getDensity(),//Real *densities, gridIndependent->getSiteMultiplicities()->getSiteMultiplicities() //Integer *multiplicities ); double value_GF= calculateGFFreeEnergy( gamma, //Solution3DRISMR *gamma, c, //Solution3DRISMR *c, clong, //Solution3DRISMR *minusBetaUlong, gridIndependent->getKBT(), //Real kBT, gridIndependent->getSiteDensities()->getDensity(),//Real *densities, gridIndependent->getSiteMultiplicities()->getSiteMultiplicities() //Integer *multiplicities ); double value_HNC = calculateHNCFreeEnergy( gamma, //Solution3DRISMR *gamma, c, //Solution3DRISMR *c, clong, //Solution3DRISMR *minusBetaUlong, gridIndependent->getKBT(), //Real kBT, gridIndependent->getSiteDensities()->getDensity(),//Real *densities, gridIndependent->getSiteMultiplicities()->getSiteMultiplicities() //Integer *multiplicities ); double excludedVolume = calculateExcludedVolume( gridIndependent->getSolventRDFs(), //TabFunction **solventRDFs, gamma, //Solution3DRISMR *gamma, ctotal, //Solution3DRISMR *c, gridIndependent->getSiteDensities()->getDensity(),//Real *densities, gridIndependent->getSiteMultiplicities()->getSiteMultiplicities()// Integer *multiplicities ); double value_MyHNC = calculateMyHNCFreeEnergy( gamma, //Solution3DRISMR *gamma, c, //Solution3DRISMR *c, clong, //Solution3DRISMR *minusBetaUlong, gridIndependent->getKBT(), //Real kBT, gridIndependent->getSiteDensities()->getDensity(),//Real *densities, gridIndependent->getSiteMultiplicities()->getSiteMultiplicities() //Integer *multiplicities ); double B2A = Units::distanceUnits()->unit2unit("Bohr","Angstr"); double B2A3 = B2A*B2A*B2A; printf("HNC: %lf [kcal/mol]\n",value_HNC*Units::energyUnits()->unit2unit("Hartree","kcal/mol")); printf("KH: %lf [kcal/mol]\n",value_KH*Units::energyUnits()->unit2unit("Hartree","kcal/mol")); printf("GF: %lf [kcal/mol]\n",value_GF*Units::energyUnits()->unit2unit("Hartree","kcal/mol")); printf("VUA: %lf [Angstr^3]\n", excludedVolume * B2A3 ); // printf("SVP: %lf [kcal/mol]\n",value_MyHNC*Units::energyUnits()->unit2unit("Hartree","kcal/mol")); NULL_DELETE( gamma ); NULL_DELETE( c ); NULL_DELETE( clong ); NULL_DELETE( ctotal ); NULL_DELETE( factories); return 0; }catch(Exception *e) { printf("Exception: %s\n",e->toString()); NULL_DELETE(e); } return 1; }