/*
 * display title before running the simulation or program usage
 * 
 * 
 */

#include "peg_pic.h"

void display_title() {
	printf("\nBIT1 - Bounded Electrostatic 1 Dimensional PIC-MCC Code (Berkeley-Innsbruck-Tbilisi)\n");
	printf("Developed in High Energy and Plasma Physics Group, University of Innsbruck\n");
	printf("Author: D.Tskhakaya, Permanent address: ");
	printf("Institute of Physics, Georgian Academy of Sciences, Tbilisi\n");
	printf("Code is based on XPDP1 code from University of California - Berkeley: Plasma Theory and Simulation Group\n");
	printf("Changes (2009-2012): Janez Krek (LECAD; lecad.si), Nikola Jelic (University of Innsbruck)\n");
	printf("\nVersion: %s\n", BIT1_VERSION );
	printf("Compiled with: Si(x) = exp(alpha Phi(x)) + Six use delta Phi");
	
#ifdef REFLECTED_OWN_SPECIES
	printf( ", reflected particles as separate species");
#endif

#ifdef WITH_XGRAFIX
	printf( ", XGrafix");
#endif

#ifdef WITH_OPENMP
	printf( ", openMP");
#endif

#ifdef WITH_MT_RANDOM_GENERATOR	
	printf( ", MT19937 random generator");
#endif
	
#ifdef INTEL_CC
	printf( ", Intel CC");
#endif
	
#ifdef GCC
	printf( ", gcc");
#endif
	
	printf("\n");
}


/*
 * display program usage.
 * IN: tools=0 : display usage for running program (for running simulations)
 *     tools=1 : display usage for tools inside program (show running times, do result approximation, ...)   
 */ 
void usage(int tools, int argc, char *argv[], int toolsHelp) {

	if( tools == 0 ) {
		/* display usage for running simulation */
		printf("\nSyntax:\n");
		printf("\t%s <input file> [dumpfile] [step of given dump file]\n\n", argv[0]);
	} else {
		/* display usage for tools */
		printf("\nUsage for tools inside program.\n");
				
		if( toolsHelp == 0 ) {
			/* display general help for tools*/
			printf("Tools in BIT1 enable user to prepare data from BIT1 for further use or displaying.\n");
			printf("Possible tools are:\n");
			printf("  approx : calculate approximation of results in output files\n");
			printf("  times  : show running times between DAT files (helps monitor speed of calculation)\n");

		} else if( toolsHelp == 1 ) {
			/* show help for approximation */
			printf("\nApproximation of results, stored in files ..-block1.dat.\n");
			printf("Command:\n\t%s tools <output file> <input file> <start step> <end step>\n\n", argv[0]);
			printf("where:\n");
	        printf("  output file    = file name for storing results of approximation, e.g. results01.txt\n");
	        printf("  BIT input file = name of input file, used to run simulation with BIT1\n" );
			printf("  start step     = step number from which to start approximation of results, e.g. 10\n"); 
			printf("  end step       = step number at which to end approximation of results, e.g. 100\n");
	        printf("\n");
	        printf("File names for step results are as follows: <input file>-999999-block1.dat, with 999999 is replaced with\n");
	        printf("step number. Length of step number is 6, with pending 0 (step 123 is 000123).\n");
	        printf("If any file between start and end files is missing, it is skipped and warning is displayed.\n");

		} else if( toolsHelp == 2 ) {
			/* show help for show running times */
		}
	
	}
	
	printf("\n");
	exit(1);
}
