Exemplo n.º 1
0
int main(int argc, char *argv[])
{
	if(argc == 2)	{
		To_Exclude_Methyl_Torsion = 0;
	}
	else	{
		To_Exclude_Methyl_Torsion = 1;
	}

	memset(IsRigidDih, 0, sizeof(int)*MAX_DIHEDRAL_LIST);

	fFile_Run_Log = fopen("identify-soft.log", "w");

	ForceField.ReadForceField(szForceFiled);
	Mol.ReadPSF(szXpsfFile, 0);
	Mol.AssignForceFieldParameters(&ForceField);
	Mol.ReadCRD(szCrdFile);
	Setup_Bond_List();

//	Gen_Soft_Dihedral_List_MD_High_T();
//	printf("\n\n");

	Gen_Soft_Dihedral_List_Excluding_Ring();
	printf("\n\n");

	To_Refine_Soft_Dihedral_List();

/*	
	fData = fopen("dihedral.txt", "w");
	for(Step=0; Step<MAX_STEP/GAP; Step++)	{
		fprintf(fData, "%8d ", Step);
		for(Idx=0; Idx<nDihedral; Idx++)	{
			if(IsRigidDih[Idx] == 0)	{
				fprintf(fData, " %7.2lf", dih_List[Step][Idx]);
			}
		}
		fprintf(fData, "\n");
	}
	fclose(fData);
*/
	fclose(fFile_Run_Log);


	return 0;
}
Exemplo n.º 2
0
int main(int argc, char **argv)
{
	int i;
	FILE *fOut;
	char szName[256];


	fFile_Run_Log = fopen("qm-1d-scan.log", "w");

//	MPI_Init(&argc, &argv);
//	MPI_Comm_rank(MPI_COMM_WORLD, &ProgID);
//	MPI_Comm_size(MPI_COMM_WORLD, &nProc);

	Get_EXE_Path("G09_EXE_PATH", szExe_G09);

	n_Bins = 360/BIN_SIZE+1;


	ForceField.ReadForceField(szForceFiled);
	Mol.ReadPSF(szXpsfFile, 0);
	Get_Netcharge_From_Xpsf();
	Setup_QM_Level();
	ReadElementList();

	Mol.AssignForceFieldParameters(&ForceField);
	Mol.ReadCRD(szCrdFile);
	BackupCoordinates();

	Read_Soft_DihedralList();

	for(Active_Phi=0; Active_Phi<n_Phi; Active_Phi++)	{
		RestoreCoordinates();
		for(i=0; i<n_Phi; i++)	{
			Phi_To_Set[i] = Mol.QueryDihedral(IdxDihSelect[i]);
			Mol.Edit_Dihedral(IdxDihSelect[i], Phi_To_Set[i]);
		}

		MM_Fixed_1D_Scan();
		E_Barrier_Lowest = Get_Barrier(E_Phi, n_Bins, E_Min, Phi_Save);
		E_Min_Save = E_Min;
		E_Min_Org = E_Min + E_RANGE;
		memcpy(E_Scan, E_Phi, sizeof(double)*n_Bins);
		memcpy(Phi_To_Set_Scan, Phi_To_Set, sizeof(double)*n_Phi);
		Phi_To_Set_Scan[Active_Phi] = Phi_Save;

		sprintf(szName, "ini-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Bins; i++)	{
			fprintf(fOut, "%5d %8.5E\n", -180+i*BIN_SIZE, E_Scan[i]-E_Min);
		}
		fclose(fOut);

		sprintf(szName, "ini-%d.pdb", Active_Phi+1);
		SaveOptPdb(szName);

		n_State_List[Active_Phi] = 1;
		Enumerate_Dihedrals(0);
		n_State_List[Active_Phi] = n_State_List_Save[Active_Phi];

		sprintf(szName, "end-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Bins; i++)	{
			fprintf(fOut, "%5d %8.5E\n", -180+i*BIN_SIZE, E_Scan[i]-E_Min_Save);
		}
		fclose(fOut);

		sprintf(szName, "end-%d.pdb", Active_Phi+1);
		SaveOptPdb(szName);

		sprintf(szName, "phi-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Phi; i++)	{
			fprintf(fOut, "%lf\n", Phi_To_Set_Scan[i]);
		}
		fclose(fOut);

	
		Output_Gaussian_File();
	}


	Reorganize_QM_1D_Scan_Data();

	fclose(fFile_Run_Log);

//	MPI_Barrier(MPI_COMM_WORLD);
//	MPI_Finalize();

	return 0;
}
Exemplo n.º 3
0
int main(int argc, char **argv)
{
	int i;
	FILE *fOut;
	char szName[256], *szEnv;

//	SetEnvironmentVariable(szGAUSS_SCRDIR, "c:\\1");

	fFile_Run_Log = fopen("qm-1d-scan.log", "w");
	
	szEnv = getenv(szGAUSS_SCRDIR);
	if (szEnv == NULL) {
		Quit_With_Error_Msg("Environment variable $GAUSS_SCRDIR is NOT set.\nQuit\n");
	}
	strcpy(szGAUSS_SCRDIR_Base, szEnv);
	


	Get_EXE_Path("G09_EXE_PATH", szExe_G09);

	n_Bins = 360/BIN_SIZE+1;


	ForceField.ReadForceField(szForceFiled);
	Mol.ReadPSF(szXpsfFile, 0);
	Get_Netcharge_From_Xpsf();
	Setup_QM_Level();
	ReadElementList();

	Mol.AssignForceFieldParameters(&ForceField);
	Mol.ReadCRD(szCrdFile);
	BackupCoordinates();

	Read_Soft_DihedralList();

	nJob = nJobDone = 0;

	for(Active_Phi=0; Active_Phi<n_Phi; Active_Phi++)	{
		RestoreCoordinates();
		for(i=0; i<n_Phi; i++)	{
			Phi_To_Set[i] = Mol.QueryDihedral(IdxDihSelect[i]);
			Mol.Edit_Dihedral(IdxDihSelect[i], Phi_To_Set[i]);
		}

		MM_Fixed_1D_Scan();
		E_Barrier_Lowest = Get_Barrier(E_Phi, n_Bins, E_Min, Phi_Save);
		E_Min_Save = E_Min;
		E_Min_Org = E_Min + E_RANGE;
		memcpy(E_Scan, E_Phi, sizeof(double)*n_Bins);
		memcpy(Phi_To_Set_Scan, Phi_To_Set, sizeof(double)*n_Phi);
		Phi_To_Set_Scan[Active_Phi] = Phi_Save;

		sprintf(szName, "ini-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Bins; i++)	{
			fprintf(fOut, "%5d %8.5E\n", -180+i*BIN_SIZE, E_Scan[i]-E_Min);
		}
		fclose(fOut);

		sprintf(szName, "ini-%d.pdb", Active_Phi+1);
		SaveOptPdb(szName);

		n_State_List[Active_Phi] = 1;
		Enumerate_Dihedrals(0);
		n_State_List[Active_Phi] = n_State_List_Save[Active_Phi];

		sprintf(szName, "end-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Bins; i++)	{
			fprintf(fOut, "%5d %8.5E\n", -180+i*BIN_SIZE, E_Scan[i]-E_Min_Save);
		}
		fclose(fOut);

		sprintf(szName, "end-%d.pdb", Active_Phi+1);
		SaveOptPdb(szName);

		sprintf(szName, "phi-%d.dat", Active_Phi+1);
		fOut = fopen(szName, "w");
		for(i=0; i<n_Phi; i++)	{
			fprintf(fOut, "%lf\n", Phi_To_Set_Scan[i]);
		}
		fclose(fOut);

	
		Output_Gaussian_File();
	}

	if(nJob > 0)	{
		RunAllJobs();
		Exatract_All_Info_QM_1D_Scan();
		Reorganize_QM_1D_Scan_Data();
	}

	fclose(fFile_Run_Log);

	return 0;
}