当前位置: 首页>>代码示例>>C++>>正文


C++ CMol::Edit_Dihedral方法代码示例

本文整理汇总了C++中CMol::Edit_Dihedral方法的典型用法代码示例。如果您正苦于以下问题:C++ CMol::Edit_Dihedral方法的具体用法?C++ CMol::Edit_Dihedral怎么用?C++ CMol::Edit_Dihedral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMol的用法示例。


在下文中一共展示了CMol::Edit_Dihedral方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveOptPdb

void SaveOptPdb(char szName[])
{
    int i;
    for(i=0; i<n_Phi; i++)	{
        Mol.QueryDihedral(IdxDihSelect[i]);
        Mol.Edit_Dihedral(IdxDihSelect[i], Phi_To_Set_Scan[i]);
    }
    Mol.SavePdb(szName);
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:9,代码来源:____QM_1D_scan.cpp

示例2: MM_Fixed_1D_Scan

void MM_Fixed_1D_Scan(void)
{
    int i, Phi, Count;

    RestoreCoordinates();
    for(i=0; i<n_Phi; i++)	{
        Mol.QueryDihedral(IdxDihSelect[i]);
        Mol.Edit_Dihedral(IdxDihSelect[i], Phi_To_Set[i]);
    }
    
    Count = 0;
    for(Phi=-180; Phi<=180; Phi+=BIN_SIZE)	{	// 1D scan for this rotamer
        Phi_To_Set[Active_Phi] = Phi*1.0;
        Mol.QueryDihedral(IdxDihSelect[Active_Phi]);
        Mol.Edit_Dihedral(IdxDihSelect[Active_Phi], Phi_To_Set[Active_Phi]);
        E_Phi[Count] = Mol.Cal_E(0);
        Count++;
    }

    return;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:21,代码来源:____QM_1D_scan.cpp

示例3: Output_Gaussian_File

void Output_Gaussian_File(void)
{
    FILE *fOut, *fIn;
    int i, nAtom, IdxScan;
    char szNameGjf[256], szCmd[256], szName_Output[256];

    Determine_QM_Scan_Part();

    nAtom = Mol.nAtom;
    for(IdxScan=0; IdxScan<n_QM_Part; IdxScan++)	{
        Mol.QueryDihedral(IdxDihSelect[Active_Phi]);
        Mol.Edit_Dihedral(IdxDihSelect[Active_Phi], Phi_QM_Start[IdxScan]);

        sprintf(szNameGjf, "qm-scan-%d-%d.gjf", Active_Phi+1, IdxScan+1);
        fOut = fopen(szNameGjf, "w");
        fprintf(fOut, "%s", szQM_Level_1D_Scan_Cmd);
        for(i=0; i<nAtom; i++)	{
//			fprintf(fOut, "%c  %9.5lf %9.5lf %9.5lf\n", Mol.AtomName[i][0], Mol.x[i], Mol.y[i], Mol.z[i]);
            fprintf(fOut, "%s  %9.5lf %9.5lf %9.5lf\n", szElemName[i], Mol.x[i], Mol.y[i], Mol.z[i]);
        }
        fprintf(fOut, "\n");
        
        for(i=0; i<n_Phi; i++)	{
            if(i == Active_Phi)	{
                fprintf(fOut, "%s", szQM_Scan[IdxScan]);
            }
            else	{
                fprintf(fOut, "%d %d %d %d F\n", DihList[i][0]+1, DihList[i][1]+1, DihList[i][2]+1, DihList[i][3]+1);
            }
        }
        fprintf(fOut, "\n");
        fclose(fOut);

        sprintf(szName_Output, "qm-1d-phi-%d-p%d.out", Active_Phi+1, IdxScan+1);
        sprintf(szCmd, "%s < %s > %s", szExe_G09, szNameGjf, szName_Output);


        fIn = fopen(szName_Output, "r");
        if(fIn == NULL)	{
            system(szCmd);
        }
        else	{
            fclose(fIn);
        }

        Extract_Coord_E(szName_Output, Active_Phi, IdxScan);
    }
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:48,代码来源:____QM_1D_scan.cpp

示例4: main

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;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:90,代码来源:____QM_1D_scan.cpp

示例5: main

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;
}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:97,代码来源:qm-1d-scan-para.cpp


注:本文中的CMol::Edit_Dihedral方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。