| version 1.1.1.1, 2001/09/20 14:12:01 |
version 1.1.1.1.2.1, 2002/09/13 18:38:34 |
|
|
| |
#include <stdio.h> |
| #include <malloc.h> |
#include <malloc.h> |
| |
#include <errno.h> |
| |
#include <string.h> |
| |
|
| #include "pdp1.h" |
#include "pdp1.h" |
| #include "xgrafix.h" |
#include "xgrafix.h" |
| |
|
|
|
| // Open files and read in "general" parameters {{{ |
// Open files and read in "general" parameters {{{ |
| |
|
| if (!WasInputFileGiven) { |
if (!WasInputFileGiven) { |
| puts("Syntax:"); |
PrintUsage(NULL); |
| puts("\tPDP1 <inputdeck> [dumpfile]"); |
// puts("Syntax:"); |
| |
// puts("\tPDP1 <inputdeck> [dumpfile]"); |
| exit(1); |
exit(1); |
| } |
} |
| InputDeck = fopen(theInputFile, "r"); |
if ((InputDeck = fopen(theInputFile, "r")) == NULL) { |
| |
fprintf(stderr, "Can't open input file '%s': %s \n", |
| |
theInputFile, strerror(errno)); |
| |
} |
| |
|
| // }}} |
// }}} |
| |
|
| // Read lines until we get to numbers {{{ |
// Read lines until we get to numbers {{{ |
| Line 159 void start(void) |
|
| Line 168 void start(void) |
|
| phi = (float *)malloc(ng*sizeof(float)); |
phi = (float *)malloc(ng*sizeof(float)); |
| e = (float *)malloc(ng*sizeof(float)); |
e = (float *)malloc(ng*sizeof(float)); |
| chi = (float *)malloc(ng*sizeof(float)); |
chi = (float *)malloc(ng*sizeof(float)); |
| for (j=0; j<ng; j++) chi[j] = e[j] = phi[j] = 0.0; |
n1_delta = (float *)malloc(ng*sizeof(float)); |
| |
n2_delta = (float *)malloc(ng*sizeof(float)); |
| |
for (j=0; j<ng; j++) |
| |
chi[j] = e[j] = phi[j] = n1_delta[j] = n2_delta[j] = 0.0; |
| // }}} |
// }}} |
| |
|
| //*** Allocate Dianostic arrays ****** {{{ |
//*** Allocate Dianostic arrays ****** {{{ |
| Line 427 void start(void) |
|
| Line 439 void start(void) |
|
| // the number "num", yielding a fraction between 0 and 1. |
// the number "num", yielding a fraction between 0 and 1. |
| // Index[] is also used in padjus.c. |
// Index[] is also used in padjus.c. |
| |
|
| for (i=0; i<1024; i++) Index[i] = 1024*revers(i); |
for (i = 0; i < 1024; i++) |
| |
Index[i] = 1024 * revers(i); |
| |
|
| //******************************************************* |
//******************************************************* |
| // Load in all species' particles, properly distributed. |
// Load in all species' particles, properly distributed. |