Exemplo n.º 1
0
Arquivo: MC1p.hpp Projeto: hust220/nsp
    MC1p(const Par &par) : TSP(par) {
        LOG << "# Read parameters" << std::endl;
        read_par();

        LOG << "# Set parameters" << std::endl;
        #define JN_MCPSB_PAR_SET(a) par.set(PP_CAT(_mc_, a), PP_STRING3(PP_CAT(mc_, a)));
        JN_MAP(JN_MCPSB_PAR_SET, JN_MC_PARS1, JN_MC_PARS2)

        LOG << "# Print parameters" << std::endl;
        print_parameters();

        LOG << "# Read initial structure" << std::endl;
        chain_read_model(_pred_chain, par.get("pdb"));

        LOG << "# Set indices" << std::endl;
        thread_local static std::map<char, int> m {{'A', 0}, {'U', 1}, {'G', 2}, {'C', 3}};
        m_indices.resize(_seq.size());
        for (int i = 0; i < _seq.size(); i++) {
            m_indices[i] = m[_seq[i]];
        }

        LOG << "# Set 2D trees" << std::endl;
        set_trees();

        LOG << "# Set ranges" << std::endl;
        set_ranges();

        LOG << "# Print ranges" << std::endl;
        print_ranges();

    }
Exemplo n.º 2
0
int main(int argc, char **argv){

int nsnap;
char *fileinp;

/* read parameters from parameter-file (stdin) */
/*read_par(stdin);*/ 


/* read parameters from parameter-file (stdin) */
fileinp=argv[1];
FP=fopen(fileinp,"r");
if(FP==NULL) {
	if (MYID == 0){
		printf("\n==================================================================\n");
		printf(" Cannot open Denise input file %s \n",fileinp);
		printf("\n==================================================================\n\n");
		err(" --- ");
	}
}

/* read input file */
read_par(FP);
	
NXG=NX;
NYG=NY;	
NX = NXG/NPROCX;
NY = NYG/NPROCY;

nsnap=1+iround((TSNAP2-TSNAP1)/TSNAPINC);

FP=stdout;


switch(SNAP){
case 1 : /*particle velocity*/
   merge(nsnap,1);
   merge(nsnap,2);
   break;
case 2 : /*pressure */
   merge(nsnap,6);
   break;
case 4 : /*particle velocity*/
   merge(nsnap,1);
   merge(nsnap,2);
case 3 :
   merge(nsnap,4);
   merge(nsnap,5);
   break;
default :
   warning(" snapmerge: cannot identify content of snapshot !");
   break;

}	
return 0;	

}
Exemplo n.º 3
0
int main(int argc, char **argv){

int nsnap;
char *fileinp;

/* read parameters from parameter-file (stdin) */
/*read_par(stdin);*/ 


/* read parameters from parameter-file (stdin) */
fileinp=argv[1];
FP=fopen(fileinp,"r");
if(FP==NULL) {
	if (MYID == 0){
		printf("\n==================================================================\n");
		printf(" Cannot open Denise input file %s \n",fileinp);
		printf("\n==================================================================\n\n");
		err(" --- ");
	}
}

if (strstr(fileinp,".json")){
	/* read json formatted input file */
	read_par_json(stdout,fileinp);}
else{
	/* read "old" input file *.inp */
	read_par(FP);}
	


NXG=NX;
NYG=NY;	
NX = NXG/NPROCX;
NY = NYG/NPROCY;

nsnap=1+iround((TSNAP2-TSNAP1)/TSNAPINC);

FP=stdout;


switch(SNAP){
case 1 : /*particle velocity*/
   merge(nsnap,1);
   /*merge(nsnap,2);*/
   break;
default :
   warning(" snapmerge: cannot identify content of snapshot !");
   break;

}	
return 0;	

}
Exemplo n.º 4
0
// Read each item in turn.
void corrobj::read(char *parfile)
{

    read_par(parfile);
    kcorr = new kcorr_table(par.kcorr_file);
    read_primary();

    if (par.corrtype == 1 || par.corrtype == 3)
        read_secondary();
    else
        read_random_secondary();

    read_rev();

}