36 sprintf (name,
"%s%s%d.dat",
OUTPUTDIR, fileprefix, filenumber);
37 input = fopen (name,
"r");
39 fprintf (stderr,
"WARNING ! Can't read %s. Restarting with t=0 settings.\n", name);
46 for (c = 0; c <
IMIN; c++) {
47 fread (field,
sizeof(
real), ns, input);
49 fread (field,
sizeof(
real), nr*ns, input);
64 for (i = 0; i <= nr; i++) {
65 for (j = 0; j < ns; j++) {
72 void Initialization (gas_density, gas_v_rad, gas_v_theta, gas_energy, gas_label)
73 PolarGrid *gas_density, *gas_v_rad, *gas_v_theta, *gas_energy, *gas_label;
79 InitEuler (gas_density, gas_v_rad, gas_v_theta, gas_energy);
82 nr = gas_density->Nrad;
83 ns = gas_density->Nsec;
84 rho = gas_density->Field;
85 energy = gas_energy->Field;
88 mastererr (
"Initializing from files...\n");
90 mastererr (
"Reading initial files to refill boundary zones for the damping condition (if used)...\n");
98 for (i=0; i<nr; i++) {
99 for (j=0; j<ns; j++) {
101 energy[l] = energy[l]*rho[l]/(
ADIABIND-1.0);
114 mastererr (
"Reading restart files...\n");
121 for (i=0; i<nr; i++) {
122 for (j=0; j<ns; j++) {
124 energy[l] = energy[l]*rho[l]/(
ADIABIND-1.0);
134 fprintf (stderr,
"done\n");
152 char ignore[512], *err;
153 int foo=0, nr, ns, i, j, l, chck;
158 input = fopen (path,
"r");
160 fprintf (stderr,
"\nError! Can't find the initialization file %s \n", path);
163 field = array->Field;
166 for (i = 0; i <
IMIN; i++) {
167 for (j = 0; j < ns; j++) {
168 err = fgets (ignore,
sizeof(ignore), input);
170 fprintf (stderr,
"\nError! Number of values in the initialization file %s\n", path);
171 fprintf (stderr,
"is smaller than the size of hydrodynamic arrays.\n");
176 for (i = 0; i < nr; i++) {
177 for (j = 0; j < ns; j++) {
179 chck = fscanf (input,
"%lf", &field[l]);
181 fprintf (stderr,
"\nError! Number of values in the initialization file %s\n", path);
182 fprintf (stderr,
"is smaller than the size of hydrodynamic arrays.\n");
188 chck = fscanf (input,
"%lf", &tmp);
190 fprintf (stderr,
"\nError! Number of values in the initialization file %s\n", path);
191 fprintf (stderr,
"is larger than the size of hydrodynamic arrays.\n");
double real
Definition of the type 'real' used throughout the code.
void EquilPebbleDisk(PolarGrid *Rho, PolarGrid *Vrad, PolarGrid *Vtheta)
Sets up a pebble disk in a coagulation-drift equilibrium.
void ComputePressureField()
void RestartPebbleDisk(PolarGrid *Rho, int index)
Reads arrays necessary to restart the pebble disk.
A structure used to store any scalar fied on the computational domain.
void mastererr(const char *template,...)
Contains all the include directives requested by the code.
void ReadfromFile(PolarGrid *array, char *fileprefix, int filenumber)
void ComputeTemperatureField()
void ReadfromAsciiFile(PolarGrid *array, char *path)
Enables to read a polar grid array from an ascii file.
void Initialization(PolarGrid *gas_density, PolarGrid *gas_v_rad, PolarGrid *gas_v_theta, PolarGrid *gas_energy, PolarGrid *gas_label)
void InitLabel(PolarGrid *array)