Ejemplo n.º 1
0
int main() 
{

  int i;

  history_file = fopen("hist.data", "w");

  init();			/* do initialisation */
  loadx();			/* load particles onto grid */
  particle_bc();		/* particle boundary conditions */
                     
  loadv();			/* define velocity distribution */

  density();			/* compute initial density from particles */
  add_neutral();                   /* background ion density */
  laser();                      /* initialise laser field */
  field();			/* compute initial electric field */

  diagnostics();		/* output initial conditions */

 
  for (itime=1; itime<=ntrun; itime++) 
    {

      push();			/* Push particles */
      particle_bc();		/* particle boundary conditions */

      density();		/* compute density */

      laser();                  /* update laser field */
      field();		        /* compute electric field (Poisson) */

      diagnostics();		/* output snapshots and time-histories */

    }


  close(history_file);          /*   close time-hist files */


}
Ejemplo n.º 2
0
int command_do(int argc, char * argv[])
{
	printf("command do <%s> \n", argv[0]);

	if (strcmp(argv[0], "help") == 0)
		help(argc, argv);
		
	if (strcmp(argv[0], "md") == 0)
		md(argc, argv);

	if (strcmp(argv[0], "mw") == 0)
		mw(argc, argv);
	
	if (strcmp(argv[0], "loadb") == 0)
		loadb(argc, argv);

	if (strcmp(argv[0], "go") == 0)
		go(argc, argv);
		
	if (strcmp(argv[0], "loadx") == 0)
		loadx(argc, argv);

	return 0;
}