Timothy  0.9
Tissue Modelling Framework
 All Data Structures Files Functions Variables Typedefs Macros
chemf.c
Go to the documentation of this file.
1 /* **************************************************************************
2  * This file is part of Timothy
3  *
4  * Copyright (c) 2014/15 Maciej Cytowski
5  * Copyright (c) 2014/15 ICM, University of Warsaw, Poland
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  * *************************************************************************/
22 
23 #include <float.h>
24 #include "_hypre_utilities.h"
25 #include "HYPRE_sstruct_ls.h"
26 #include "HYPRE_parcsr_ls.h"
27 #include "HYPRE_krylov.h"
28 
29 #include "global.h"
30 #include "fields.h"
31 
36 HYPRE_SStructGrid chemGrid[NCHEM];
37 HYPRE_SStructGraph chemGraph[NCHEM];
38 HYPRE_SStructStencil chemStencil[NCHEM];
39 
40 HYPRE_SStructMatrix chemA[NCHEM];
41 HYPRE_SStructVector chemb[NCHEM];
42 HYPRE_SStructVector chemx[NCHEM];
43 
44 HYPRE_ParCSRMatrix chemParA[NCHEM];
45 HYPRE_ParVector chemParb[NCHEM];
46 HYPRE_ParVector chemParx[NCHEM];
47 
48 HYPRE_Solver chemSolver[NCHEM];
49 HYPRE_Solver chemPrecond[NCHEM];
50 
52 
53 long long chemLower[3], chemUpper[3];
54 long long bcLower[3];
55 long long bcUpper[3];
56 
57 double dt[NCHEM];
58 double chemLambda = 0.25;
59 
60 char chfname[256];
61 
63 
64 double chemZ[NCHEM];
65 
66 HYPRE_SStructVariable chemVartypes[1] = { HYPRE_SSTRUCT_VARIABLE_NODE };
67 
69 
70 double *chemPC; /* production-consumption function */
71 
75 void chemSetBoundary(int coord, int boundary)
76 {
77  if (coord == 0 && boundary == -1) {
78  bcLower[0] = chemLower[0];
79  bcUpper[0] = chemLower[0];
80  bcLower[1] = chemLower[1];
81  bcUpper[1] = chemUpper[1];
82  bcLower[2] = chemLower[2];
83  bcUpper[2] = chemUpper[2];
84  }
85  if (coord == 0 && boundary == 1) {
86  bcLower[0] = chemUpper[0];
87  bcUpper[0] = chemUpper[0];
88  bcLower[1] = chemLower[1];
89  bcUpper[1] = chemUpper[1];
90  bcLower[2] = chemLower[2];
91  bcUpper[2] = chemUpper[2];
92  }
93  if (coord == 1 && boundary == -1) {
94  bcLower[0] = chemLower[0];
95  bcUpper[0] = chemUpper[0];
96  bcLower[1] = chemLower[1];
97  bcUpper[1] = chemLower[1];
98  bcLower[2] = chemLower[2];
99  bcUpper[2] = chemUpper[2];
100  }
101  if (coord == 1 && boundary == 1) {
102  bcLower[0] = chemLower[0];
103  bcUpper[0] = chemUpper[0];
104  bcLower[1] = chemUpper[1];
105  bcUpper[1] = chemUpper[1];
106  bcLower[2] = chemLower[2];
107  bcUpper[2] = chemUpper[2];
108  }
109  if (coord == 2 && boundary == -1) {
110  bcLower[0] = chemLower[0];
111  bcUpper[0] = chemUpper[0];
112  bcLower[1] = chemLower[1];
113  bcUpper[1] = chemUpper[1];
114  bcLower[2] = chemLower[2];
115  bcUpper[2] = chemLower[2];
116  }
117  if (coord == 2 && boundary == 1) {
118  bcLower[0] = chemLower[0];
119  bcUpper[0] = chemUpper[0];
120  bcLower[1] = chemLower[1];
121  bcUpper[1] = chemUpper[1];
122  bcLower[2] = chemUpper[2];
123  bcUpper[2] = chemUpper[2];
124  }
125 }
126 
130 void chemEnvInitSystem(int nch)
131 {
132  int i, j, k, c;
133  int entry;
134  long long offsets[7][3] =
135  { {0, 0, 0}, {-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0,
136  -1}, {0,
137  0,
138  1}
139  };
140  double gridResolutionInUnits; /* grid resolution in centimeters */
141 
142  dt[nch] = fieldDt[nch + NGLOB];
143  numberOfIters = 1;
144  chemIter[nch] = 0;
145 
146  sprintf(chfname, "%s/chemSolver.log", logdir);
147  /* stdout will go to the file */
149 
150  /* 1. INIT GRID */
151 
152  /* create an empty 3D grid object */
153  HYPRE_SStructGridCreate(MPI_CART_COMM, 3, 1, &chemGrid[nch]);
154 
155  /* set this process box */
159 
163 
164  /* add a new box to the grid */
165  HYPRE_SStructGridSetExtents(chemGrid[nch], 0, chemLower, chemUpper);
166 
167  HYPRE_SStructGridSetVariables(chemGrid[nch], 0, 1, chemVartypes);
168  HYPRE_SStructGridAssemble(chemGrid[nch]);
169 
170  /* 2. INIT STENCIL */
171  HYPRE_SStructStencilCreate(3, 7, &chemStencil[nch]);
172  for (entry = 0; entry < 7; entry++)
173  HYPRE_SStructStencilSetEntry(chemStencil[nch], entry, offsets[entry],
174  0);
175 
176  /* 3. SET UP THE GRAPH */
177  chemObjectType = HYPRE_PARCSR;
178  HYPRE_SStructGraphCreate(MPI_CART_COMM, chemGrid[nch], &chemGraph[nch]);
179  HYPRE_SStructGraphSetObjectType(chemGraph[nch], chemObjectType);
180  HYPRE_SStructGraphSetStencil(chemGraph[nch], 0, 0, chemStencil[nch]);
181  HYPRE_SStructGraphAssemble(chemGraph[nch]);
182 
183  /* 4. SET UP MATRIX */
184  long long nentries = 7;
185  long long nvalues;
186  double *values;
187  long long stencil_indices[7];
188 
189  nvalues = nentries * gridSize.x * gridSize.y * gridSize.z;
190  /* create an empty matrix object */
191  HYPRE_SStructMatrixCreate(MPI_CART_COMM, chemGraph[nch], &chemA[nch]);
192  HYPRE_SStructMatrixSetObjectType(chemA[nch], chemObjectType);
193  /* indicate that the matrix coefficients are ready to be set */
194  HYPRE_SStructMatrixInitialize(chemA[nch]);
195 
196  values = calloc(nvalues, sizeof(double));
197 
198  for (j = 0; j < nentries; j++)
199  stencil_indices[j] = j;
200 
201  gridResolutionInUnits = (gridResolution / csize) * csizeInUnits * 0.0001;
202 
203  chemZ[nch] =
204  fieldDiffCoef[nch +
205  NGLOB] * dt[nch] / (gridResolutionInUnits *
206  gridResolutionInUnits);
207 
208  /* set the standard stencil at each grid point,
209  * we will fix the boundaries later */
210  for (i = 0; i < nvalues; i += nentries) {
211  values[i] = 1 + 6.0 * chemZ[nch] + fieldLambda[nch + NGLOB] * dt[nch];
212  for (j = 1; j < nentries; j++)
213  values[i + j] = -chemZ[nch];
214  }
215 
216  HYPRE_SStructMatrixSetBoxValues(chemA[nch], 0, chemLower, chemUpper, 0,
217  nentries, stencil_indices, values);
218 
219  for (k = 0; k < gridSize.z; k++)
220  for (j = 0; j < gridSize.y; j++)
221  for (i = 0; i < gridSize.x; i++) {
222  chemField[nch][gridSize.y * gridSize.z * i + gridSize.z * j + k] =
223  fieldICMean[nch + NGLOB];
224  }
225  fieldMax[nch + NGLOB] = fieldICMean[nch + NGLOB];
226  fieldMin[nch + NGLOB] = fieldICMean[nch + NGLOB];
227 
228  for (c = 0; c < maxCellsPerProc; c++) {
229  cellFields[nch + NGLOB][c] = fieldICMean[nch + NGLOB];
230  }
231 
232  free(values);
233  /* stdout brought back */
234  revertStdOut();
235 }
236 
241 void chemEnvCellPC(int nch)
242 {
243  int ch, i, j, k;
244  long long nvalues = gridSize.x * gridSize.y * gridSize.z;
245 
246  if (step == 0)
247  return;
248 
249  int idx = 0;
250  for (k = 0; k < gridSize.z; k++)
251  for (j = 0; j < gridSize.y; j++)
252  for (i = 0; i < gridSize.x; i++, idx++) {
253  chemPC[idx] = (-fieldConsumption[nch + NGLOB] + fieldProduction[nch + NGLOB]) * densityField[gridSize.z * gridSize.y * i + gridSize.z * j + k] * dt[nch]; //*(cellVolume/boxVolume);//*(1.0/cellVolume);//*dt[nch];//*dt[nch];
254  }
255 }
256 
260 void chemEnvInitBC(int nch)
261 {
262  int i, j, k;
263  int m;
264  int nentries = 1;
265  long long stencil_indices[1];
266  long long nvalues = gridSize.x * gridSize.y * gridSize.z;
267  double *values, *bvalues;
268  /* stdout redirected to file */
270 
271  chemPC = (double *) calloc(nvalues, sizeof(double));
272  values = calloc(nvalues, sizeof(double));
273  bvalues = calloc(nvalues, sizeof(double));
274 
275  chemEnvCellPC(nch);
276 
277  /* 5. SETUP STRUCT VECTORS FOR B AND X */
278 
279  /* create an empty vector object */
280  HYPRE_SStructVectorCreate(MPI_CART_COMM, chemGrid[nch], &chemb[nch]);
281  HYPRE_SStructVectorCreate(MPI_CART_COMM, chemGrid[nch], &chemx[nch]);
282 
283  /* as with the matrix, set the appropriate object type for the vectors */
284  HYPRE_SStructVectorSetObjectType(chemb[nch], chemObjectType);
285  HYPRE_SStructVectorSetObjectType(chemx[nch], chemObjectType);
286 
287  /* indicate that the vector coefficients are ready to be set */
288  HYPRE_SStructVectorInitialize(chemb[nch]);
289  HYPRE_SStructVectorInitialize(chemx[nch]);
290 
291  /* set the values */
292  m = 0;
293  for (k = chemLower[2]; k <= chemUpper[2]; k++)
294  for (j = chemLower[1]; j <= chemUpper[1]; j++)
295  for (i = chemLower[0]; i <= chemUpper[0]; i++) {
296  values[m] = fieldICMean[nch + NGLOB];
297  m++;
298  }
299 
300  HYPRE_SStructVectorSetBoxValues(chemb[nch], 0, chemLower, chemUpper, 0,
301  values);
302 
303  m = 0;
304  for (k = chemLower[2]; k <= chemUpper[2]; k++)
305  for (j = chemLower[1]; j <= chemUpper[1]; j++)
306  for (i = chemLower[0]; i <= chemUpper[0]; i++) {
307  values[m] = fieldICMean[nch + NGLOB];
308  m++;
309  }
310 
311  HYPRE_SStructVectorSetBoxValues(chemx[nch], 0, chemLower, chemUpper, 0,
312  values);
313 
314  /* incorporate boundary conditions; Dirichlet on 6 faces */
315 
316  for (i = 0; i < nvalues; i++)
317  values[i] = chemZ[nch];
318  for (i = 0; i < nvalues; i++)
319  bvalues[i] = chemZ[nch] * fieldBC[nch + NGLOB];
320 
321  if (MPIcoords[MPIrank][0] == 0) {
322  nvalues = nentries * gridSize.y * gridSize.z;
323  chemSetBoundary(0, -1);
324  stencil_indices[0] = 1;
325  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
326  nentries, stencil_indices, values);
327  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
328  bvalues);
329  }
330  if (MPIcoords[MPIrank][0] == MPIdim[0] - 1) {
331  nvalues = nentries * gridSize.y * gridSize.z;
332  chemSetBoundary(0, 1);
333  stencil_indices[0] = 2;
334  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
335  nentries, stencil_indices, values);
336  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
337  bvalues);
338  }
339  if (MPIcoords[MPIrank][1] == 0) {
340  nvalues = nentries * gridSize.x * gridSize.z;
341  chemSetBoundary(1, -1);
342  stencil_indices[0] = 3;
343  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
344  nentries, stencil_indices, values);
345  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
346  bvalues);
347  }
348  if (MPIcoords[MPIrank][1] == MPIdim[1] - 1) {
349  nvalues = nentries * gridSize.x * gridSize.z;
350  chemSetBoundary(1, 1);
351  stencil_indices[0] = 4;
352  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
353  nentries, stencil_indices, values);
354  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
355  bvalues);
356  }
357  if (MPIcoords[MPIrank][2] == 0) {
358  nvalues = nentries * gridSize.x * gridSize.y;
359  chemSetBoundary(2, -1);
360  stencil_indices[0] = 5;
361  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
362  nentries, stencil_indices, values);
363  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
364  bvalues);
365  }
366  if (MPIcoords[MPIrank][2] == MPIdim[2] - 1) {
367  nvalues = nentries * gridSize.x * gridSize.y;
368  chemSetBoundary(2, 1);
369  stencil_indices[0] = 6;
370  HYPRE_SStructMatrixAddToBoxValues(chemA[nch], 0, bcLower, bcUpper, 0,
371  nentries, stencil_indices, values);
372  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper, 0,
373  bvalues);
374  }
375 
376  /* add production consumption function to the right side */
377  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, chemLower, chemUpper, 0,
378  chemPC);
379 
380  free(chemPC);
381  free(values);
382  free(bvalues);
383  /* stdout brought back */
384  revertStdOut();
385 }
386 
390 void chemEnvInitSolver(int nch)
391 {
392  /* stdout redirected to file */
394 
395  HYPRE_SStructMatrixAssemble(chemA[nch]);
396  /* This is a collective call finalizing the vector assembly.
397  The vector is now ``ready to be used'' */
398  HYPRE_SStructVectorAssemble(chemb[nch]);
399  HYPRE_SStructVectorAssemble(chemx[nch]);
400 
401  HYPRE_SStructMatrixGetObject(chemA[nch], (void **) &chemParA[nch]);
402  HYPRE_SStructVectorGetObject(chemb[nch], (void **) &chemParb[nch]);
403  HYPRE_SStructVectorGetObject(chemx[nch], (void **) &chemParx[nch]);
404 
405  HYPRE_ParCSRPCGCreate(MPI_CART_COMM, &chemSolver[nch]);
406  HYPRE_ParCSRPCGSetTol(chemSolver[nch], 1.0e-12);
407  HYPRE_ParCSRPCGSetPrintLevel(chemSolver[nch], 2);
408  HYPRE_ParCSRPCGSetMaxIter(chemSolver[nch], 50);
409 
410  HYPRE_BoomerAMGCreate(&chemPrecond[nch]);
411  HYPRE_BoomerAMGSetMaxIter(chemPrecond[nch], 1);
412  HYPRE_BoomerAMGSetTol(chemPrecond[nch], 0.0);
413  HYPRE_BoomerAMGSetPrintLevel(chemPrecond[nch], 2);
414  HYPRE_BoomerAMGSetCoarsenType(chemPrecond[nch], 6);
415  HYPRE_BoomerAMGSetRelaxType(chemPrecond[nch], 6);
416  HYPRE_BoomerAMGSetNumSweeps(chemPrecond[nch], 1);
417 
418  HYPRE_ParCSRPCGSetPrecond(chemSolver[nch], HYPRE_BoomerAMGSolve,
419  HYPRE_BoomerAMGSetup, chemPrecond[nch]);
420  HYPRE_ParCSRPCGSetup(chemSolver[nch], chemParA[nch], chemParb[nch],
421  chemParx[nch]);
422 
423  /* stdout brought back */
424  revertStdOut();
425 }
426 
431 void chemEnvSolve(int nch)
432 {
433  int i, j, k;
434  int idx;
435  double *values;
436  int stepIter = 0;
437  long long nvalues = gridSize.x * gridSize.y * gridSize.z;
438 #ifdef DEBUG
439  if (MPIrank == 0 && !(step % statOutStep) && gfIter == 0) {
440  printf(" Solving field: %s...", fieldName[nch + NGLOB]);
441  fflush(stdout);
442  }
443 #endif
444  /* redirecting stdout to log file */
446 
447  values = (double *) calloc(nvalues, sizeof(double));
448  chemPC = (double *) calloc(nvalues, sizeof(double));
449  chemEnvCellPC(nch);
450 
451  fieldMin[nch + NGLOB] = DBL_MAX;
452  fieldMax[nch + NGLOB] = DBL_MIN;
453 
454  while (stepIter < numberOfIters) {
455  if (chemIter[nch] > 0) {
456  /* update right hand side */
457  HYPRE_SStructVectorGetBoxValues(chemx[nch], 0, chemLower, chemUpper,
458  0, values);
459  HYPRE_SStructVectorSetBoxValues(chemb[nch], 0, chemLower, chemUpper,
460  0, values);
461  for (i = 0; i < nvalues; i++)
462  values[i] = chemZ[nch] * fieldBC[nch + NGLOB];
463  if (MPIcoords[MPIrank][0] == 0) {
464  chemSetBoundary(0, -1);
465  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
466  0, values);
467  }
468  if (MPIcoords[MPIrank][0] == MPIdim[0] - 1) {
469  chemSetBoundary(0, 1);
470  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
471  0, values);
472  }
473  if (MPIcoords[MPIrank][1] == 0) {
474  chemSetBoundary(1, -1);
475  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
476  0, values);
477  }
478  if (MPIcoords[MPIrank][1] == MPIdim[1] - 1) {
479  chemSetBoundary(1, 1);
480  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
481  0, values);
482  }
483  if (MPIcoords[MPIrank][2] == 0) {
484  chemSetBoundary(2, -1);
485  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
486  0, values);
487  }
488  if (MPIcoords[MPIrank][2] == MPIdim[2] - 1) {
489  chemSetBoundary(2, 1);
490  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, bcLower, bcUpper,
491  0, values);
492  }
493  HYPRE_SStructVectorAddToBoxValues(chemb[nch], 0, chemLower,
494  chemUpper, 0, chemPC);
495  HYPRE_SStructVectorAssemble(chemb[nch]);
496  HYPRE_SStructVectorAssemble(chemx[nch]);
497  }
498 
499  HYPRE_ParCSRPCGSolve(chemSolver[nch], chemParA[nch], chemParb[nch],
500  chemParx[nch]);
501 
502  /* copy solution to field buffer */
503  HYPRE_SStructVectorGather(chemx[nch]);
504  HYPRE_SStructVectorGetBoxValues(chemx[nch], 0, chemLower, chemUpper, 0,
505  values);
506  idx = 0;
507  for (k = 0; k < gridSize.z; k++)
508  for (j = 0; j < gridSize.y; j++)
509  for (i = 0; i < gridSize.x; i++, idx++) {
510  chemField[nch][gridSize.y * gridSize.z * i + gridSize.z * j +
511  k] = values[idx];
512  if (values[idx] > fieldMax[nch + NGLOB])
513  fieldMax[nch + NGLOB] = values[idx];
514  if (values[idx] < fieldMin[nch + NGLOB])
515  fieldMin[nch + NGLOB] = values[idx];
516  }
517  chemIter[nch]++;
518  stepIter++;
519  }
520 
521  free(values);
522  free(chemPC);
523  /* stdout brought back */
524  revertStdOut();
525 #ifdef DEBUG
526  if (MPIrank == 0 && !(step % statOutStep) && gfIter == gfIterPerStep - 1) {
527  printf("done\n");
528  fflush(stdout);
529  }
530 #endif
531 }
int statOutStep
Definition: global.h:214
int64_t x
Definition: global.h:229
long long bcUpper[3]
Definition: chemf.c:55
int MPIdim[3]
Definition: global.h:136
double csizeInUnits
Definition: global.h:198
void chemEnvCellPC(int nch)
Definition: chemf.c:241
HYPRE_ParCSRMatrix chemParA[NCHEM]
Definition: chemf.c:44
int MPIrank
Definition: global.h:134
void chemEnvInitSystem(int nch)
Definition: chemf.c:130
double chemZ[NCHEM]
Definition: chemf.c:64
struct int64Vector3d * gridEndIdx
Definition: fields.h:42
double fieldMin[NFIELDS]
Definition: fields.h:72
int gfIter
Definition: global.h:252
double * chemField[NCHEM]
Definition: fields.h:77
double fieldDiffCoef[NFIELDS]
Definition: fields.h:55
int chemIter[NCHEM]
Definition: chemf.c:62
HYPRE_ParVector chemParb[NCHEM]
Definition: chemf.c:45
int64_t z
Definition: global.h:231
double fieldDt[NFIELDS]
Definition: fields.h:60
char fieldName[NFIELDS][128]
Definition: fields.h:51
contains the most important global variables, arrays and defines
long long bcLower[3]
Definition: chemf.c:54
double fieldMax[NFIELDS]
Definition: fields.h:73
float m
Definition: global.h:188
long long chemLower[3]
Definition: chemf.c:53
long long chemUpper[3]
Definition: chemf.c:53
void switchStdOut(const char *newStream)
Definition: io.c:1790
void chemEnvSolve(int nch)
Definition: chemf.c:431
HYPRE_SStructVariable chemVartypes[1]
Definition: chemf.c:66
int step
Definition: global.h:173
struct int64Vector3d gridSize
Definition: fields.h:41
double dt[NCHEM]
Definition: chemf.c:57
char logdir[128]
Definition: global.h:167
double fieldBC[NFIELDS]
Definition: fields.h:57
int maxCellsPerProc
Definition: global.h:132
double csize
Definition: global.h:197
HYPRE_SStructGraph chemGraph[NCHEM]
Definition: chemf.c:37
HYPRE_ParVector chemParx[NCHEM]
Definition: chemf.c:46
struct int64Vector3d * gridStartIdx
Definition: fields.h:42
double gridResolution
Definition: fields.h:45
void revertStdOut()
Definition: io.c:1803
double fieldICMean[NFIELDS]
Definition: fields.h:58
int gfIterPerStep
Definition: global.h:253
void chemEnvInitSolver(int nch)
Definition: chemf.c:390
int numberOfIters
Definition: chemf.c:68
double fieldConsumption[NFIELDS]
Definition: fields.h:64
double chemLambda
Definition: chemf.c:58
char chfname[256]
Definition: chemf.c:60
#define NCHEM
Definition: fields.h:29
HYPRE_SStructStencil chemStencil[NCHEM]
Definition: chemf.c:38
double * chemPC
Definition: chemf.c:70
int64_t y
Definition: global.h:230
void chemEnvInitBC(int nch)
Definition: chemf.c:260
void chemSetBoundary(int coord, int boundary)
Definition: chemf.c:75
contains variables and arrays for global fields
HYPRE_SStructVector chemb[NCHEM]
Definition: chemf.c:41
double fieldProduction[NFIELDS]
Definition: fields.h:65
int ** MPIcoords
Definition: global.h:144
double ** cellFields
Definition: global.h:83
double * densityField
Definition: fields.h:75
HYPRE_SStructGrid chemGrid[NCHEM]
Definition: chemf.c:36
HYPRE_Solver chemPrecond[NCHEM]
Definition: chemf.c:49
double fieldLambda[NFIELDS]
Definition: fields.h:56
HYPRE_SStructMatrix chemA[NCHEM]
Definition: chemf.c:40
HYPRE_SStructVector chemx[NCHEM]
Definition: chemf.c:42
MPI_Comm MPI_CART_COMM
Definition: global.h:143
int chemObjectType
Definition: chemf.c:51
HYPRE_Solver chemSolver[NCHEM]
Definition: chemf.c:48
#define NGLOB
Definition: fields.h:28