コード例 #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;
}
コード例 #2
0
ファイル: 1d-org.cpp プロジェクト: mj-harvey/gaamp-local
int main(int argc, char **argv)
{
	int i;
	char ErrorMsg[256];

	fFile_Run_Log = fopen(szName_Run_Log, "w");
	if(fFile_Run_Log==NULL)	{
		sprintf(ErrorMsg, "Fail to create the log file.\n\n");
		Quit_With_Error_Msg(ErrorMsg);
	}

	ForceField.ReadForceField("org-mol.prm");
//	ForceField.ReadForceField("mol.prm");
	
	Mol_ESP.ReadPSF("org-mol.xpsf", 0);
//	Mol_ESP.ReadPSF("mol.xpsf", 0);
	Read_Rtf_File();
	
	strcpy(Mol_ESP.MolName, Mol_ESP.ResName[0]);
	Mol_ESP.AssignForceFieldParameters(&ForceField);

	Read_Soft_DihedralList();

	Mol_ESP.Is_Phi_Psi_Constrained = 0;
	Mol_ESP.E_CMap_On = 0;

//	i = 3;
	for(i=0; i<n_Phi; i++)	{
		Cal_E_MM_QM_Diff(i);
		Fit_Torsion_Parameters(i);
	}

	fflush(fFile_Run_Log);
	

	fclose(fFile_Run_Log);
	return 0;
}
コード例 #3
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;
}
コード例 #4
0
ファイル: 1d_rotamer_fitting.cpp プロジェクト: salotz/htmd
int main(int argc, char **argv)
{
	char ErrorMsg[256];

  timebomb();

	fFile_Run_Log = fopen(szName_Run_Log, "w");
	if(fFile_Run_Log==NULL)	{
		sprintf(ErrorMsg, "Fail to create the log file.\n\n");
		Quit_With_Error_Msg(ErrorMsg);
	}

	strcpy(szName_Conf_File, argv[1]);
	ReadConfFile(szName_Conf_File);

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

	ForceField.ReadForceField(szName_Force_Field);
	
	Mol_ESP.ReadPSF(szName_XPSF, 0);
	Read_Rtf_File();
	
	strcpy(Mol_ESP.MolName, Mol_ESP.ResName[0]);
	Mol_ESP.AssignForceFieldParameters(&ForceField);

	Read_Soft_DihedralList();

	Mol_ESP.Is_Phi_Psi_Constrained = 0;
	Mol_ESP.E_CMap_On = 0;

	Read_QM_Rotamer_Data();

  if( nRotamer == 0 ) {
    printf("No rotamers found. The should be at least one in all-rotamer.dat. Something has gone wrong in the previous step\n" );
		exit(0);
  }

	Read_Tor_Para_1D_Fitting();
	Assign_Torsion_Parameters();

	Read_1D_Scan_QM_Data();

//	Cal_E_MM_Scaned();
//	Cal_E_MM_Rotamer();

	fFitting = fopen("fitting.dat", "w");
	Fitting_Torsion_Parameters();
	fclose(fFitting);

//	FILE *fOut;
//	fOut = fopen("rotamer-E.dat", "w");
//	for(i=0; i<nRotamer; i++)	{
//		fprintf(fOut, "%d %lf %lf %lf\n", i+1, E_Rotamer_QM[i], E_Rotamer_MM[i], rmsd_Rotamer[i]);
//	}
//	fclose(fOut);

//	Cal_E_MM_QM_Diff(7);
	
//	for(i=0; i<n_Phi; i++)	{
//		Cal_E_MM_QM_Diff(i);
//	}

//	Fit_Torsion_Parameters(7);

//	fPara = fopen("torsion-para.dat", "w");
//	for(i=0; i<n_Phi; i++)	{
//		Fit_Torsion_Parameters(i);
//	}
//	fclose(fPara);


//	Geoometry_Optimization_With_Constraint(&Mol_ESP);

	fflush(fFile_Run_Log);
	

	fclose(fFile_Run_Log);

//	MPI_Finalize();
	
	return 0;
}
コード例 #5
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;
}