⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prinitialstate.cc

📁 c++编写的并行拉马克遗传算法的程序。实现分析对接程序
💻 CC
字号:
/* prInitialState.cc */#include <math.h>#ifdef sgi    #include <stdlib.h>    #include <stdio.h>    #include <string.h>    #include "prInitialState.h"#else    extern "C"    {	#include <stdlib.h>	#include <stdio.h>	#include <string.h>        #include "prInitialState.h"    }#endifextern int keepresnum;extern FILE *logFile;extern char *programname;void prInitialState(    float einter,    float eintra,    float torsFreeEnergy,    int natom,    float crd[MAX_ATOMS][SPACE],    char atomstuff[MAX_ATOMS][MAX_CHARS],    int type[MAX_ATOMS],    float emap[MAX_ATOMS],    float elec[MAX_ATOMS],    float charge[MAX_ATOMS]){    char rec8[10];    char rec13[15];    register int i = 0;    pr( logFile, "\n\t\tINITIAL STATE\n\t\t_____________\n\n\n" );    pr( logFile, "INITIAL-STATE:  USER    Transformed Initial Coordinates\n" );    for (i = 0;  i < natom;  i++) {	if (keepresnum > 0) {	    strncpy( rec13, &atomstuff[i][13], (size_t)13);	    pr( logFile, "INITIAL-STATE:  ATOM  %5d  %.13s    %8.3f%8.3f%8.3f%6.2f%6.2f    %6.3f\n", i+1, rec13,   (double)crd[i][X], (double)crd[i][Y], (double)crd[i][Z], (double)1., (double)0., (double)charge[i] );	} else {	    strncpy( rec8, &atomstuff[i][13], (size_t)8);	    pr( logFile, "INITIAL-STATE:  ATOM  %5d  %.8s%5d    %8.3f%8.3f%8.3f%6.2f%6.2f    %6.3f\n", i+1, rec8, 0, (double)crd[i][X], (double)crd[i][Y], (double)crd[i][Z], (double)1., (double)0., (double)charge[i] );	}    } /* i */    pr( logFile, "INITIAL-STATE:  TER\n\n\n" );    pr( logFile, "\t\tINITIAL ENERGY BREAKDOWN\n" );    pr( logFile, "\t\t________________________\n" );    pr( logFile, "\n\nEnergy of starting position of Small Molecule by atom: \n\n" );    print_atomic_energies( natom, atomstuff, type, emap, elec, charge );    printEnergies( einter, eintra, torsFreeEnergy, "Initial " );    flushLog;}/* EOF */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -