Exemplo n.º 1
0
void main(int argc, char *argv[])
{
  int    Ntemp = NTEMP;
  /*  double temp[NTEMP] = {3.0E+3, 5.0E+3, 7.0E+3, 1.0E+4, 2.0E+4,
      3.0E+4, 1.0E+5}; */

  double temp[NTEMP] = {1264.9, 2249.4, 4000.0, 7113.1, 12649.1, 22493.6, 40000.0,
			71131.1, 126491.0, 224936.0, 400000.0, 711312.0, 1264910.0};   
  FILE  *fp_out;
  Atom atom;

  commandline.quiet = FALSE;
  commandline.logfile = stderr;

  if (argc >=3) {
    if ((fp_out = fopen(argv[2], "w")) == NULL) {
      sprintf(messageStr, "Unable to open output file %s", argv[1]);
      Error(ERROR_LEVEL_2, argv[0], messageStr);
    }
  } else if (argc == 2)
    fp_out = stdout;
  else {
    fprintf(stderr, "  Usage: %s atomFile [outFile]\n", argv[0]);
    exit(0);
  }
  rawAtom(&atom, argv[1]);
  E_Rydberg = E_RYDBERG / (1.0 + M_ELECTRON / (atom.weight * AMU));

  quantumNumbers(&atom);	  
  crossSection(&atom, Ntemp, temp, fp_out);
  fclose(fp_out);
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
double HydrogenLike::evaluate(const vec &r)
{
    int dim = r.n_rows;
    double laguerre = 1;
    double rNorm = norm(r,2);

    for(int d=0; d<dim; d++){
        laguerre *= laguerrePolynomial(quantumNumbers(d+1), r(d));
    }

    return laguerre*exp(-rNorm);
}