#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "options.h"
Include dependency graph for utilf.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | PI 3.14159265359 |
#define | sq(x) ((x) * (x)) |
#define | cube(x) ((x) * (x) * (x)) |
#define | MAX(x, y) ((x) > (y) ? (x) : (y)) |
#define | MIN(x, y) ((x) < (y) ? (x) : (y)) |
#define | POWER(x, y) exp((y)*log(x)) |
#define | realreadSI doublereadSI |
Typedefs | |
typedef double | real |
typedef real * | real1D |
typedef real ** | real2D |
typedef int * | int1D |
typedef int ** | int2D |
Functions | |
real | findmax (real2D u, int nx, int ny, int *imax, int *jmax) |
real | fmodmax (real2D u, int nx, int ny, int *imax, int *jmax) |
real | fmean (real2D u, real umean, int xs, int nx, int ny) |
real | findmin (real2D u, int nx, int ny, int *imin, int *jmin) |
real | sumfield (real2D u, int nx, int ny) |
real | findninf (real2D u, real2D v, int nx, int ny, int *imax, int *jmax) |
real | dp (real2D p, real2D cc, int nx, int ny) |
real | rdivmax (real2D div, int nx, int ny, int *imax, int *jmax) |
void | copy (real2D out, real2D in, int nx, int ny) |
void | add (real2D a, real2D b, int nx, int ny) |
void | fill0 (real2D u, int nx, int ny) |
|
Definition at line 17 of file utilf.h. Referenced by bc_vector_bound(), and readglob(). |
|
Definition at line 18 of file utilf.h. Referenced by adaptative(). |
|
Definition at line 19 of file utilf.h. Referenced by computeng(). |
|
|
|
|
|
Definition at line 29 of file utilf.h. Referenced by ini_impact(), ini_impact2(), inibubble(), inidroplet(), inidroplets(), inifusion(), inirealwave(), initorus(), iniwave(), and readglob(). |
|
|
|
|
|
|
|
Definition at line 23 of file utilf.h. Referenced by Pspline(), spline(), splint_find(), and tridag(). |
|
|
Definition at line 182 of file utilf.c. References real2D. Referenced by mgsolve(), and mgvcycle().
00183 { 00184 int i, j; 00185 00186 for (i = 1; i <= nx; i++) 00187 for (j = 1; j <= ny; j++) 00188 a[i][j] += b[i][j]; 00189 } |
|
Definition at line 173 of file utilf.c. References real2D. Referenced by mgfas(), mgsolve(), and pressure().
00174 { 00175 int i, j; 00176 for (i = 1; i <= nx; i++) 00177 for (j = 1; j <= ny; j++) 00178 out[i][j] = in[i][j]; 00179 } |
|
Definition at line 133 of file utilf.c. Referenced by timestep().
00134 { 00135 int i, j, nin = 0, nout = 0; 00136 real pin = 0, pout = 0; 00137 00138 for (i = 2; i <= nx - 1; i++) 00139 for (j = 2; j <= ny - 1; j++) 00140 if (cc[i][j] == 1.0) { 00141 pin += p[i][j]; nin++; 00142 } 00143 else 00144 if (cc[i][j] == 0.0) { 00145 pout += p[i][j]; nout++; 00146 } 00147 if (nin > 0 && nout > 0) 00148 return pin / (real) nin - pout / (real) nout; 00149 else 00150 return 0.0; 00151 } |
|
Definition at line 192 of file utilf.c. References real2D. Referenced by interface_fill(), interface_fluxes(), interface_hfrac(), interface_rrdz(), interface_rzdr(), interface_surfaces(), interface_tensionu(), interface_tensionv(), interface_vfrac(), mgsolve(), mgvcycle(), and pressure().
00193 { 00194 int i, j; 00195 for (i = 1; i <= nx; i++) 00196 for (j = 1; j <= ny; j++) 00197 u[i][j] = 0.0; 00198 } |
|
Definition at line 10 of file utilf.c. Referenced by timestep().
00011 { 00012 int i, j; 00013 real res; 00014 real fmax; 00015 00016 fmax = -1.0; 00017 for (i = 2; i <= nx - 1; i++) 00018 for (j = 2; j <= ny - 1; j++) 00019 { 00020 res = u[i][j]; 00021 if (res > fmax) 00022 { 00023 fmax = res; 00024 *imax = i; 00025 *jmax = j; 00026 } 00027 } 00028 00029 return fmax; 00030 } |
|
Definition at line 97 of file utilf.c. Referenced by timestep().
00098 { 00099 int i, j; 00100 real res, fmin; 00101 00102 fmin = 1.0; 00103 for (i = 2; i <= nx - 1; i++) 00104 for (j = 2; j <= ny - 1; j++) 00105 { 00106 res = u[i][j]; 00107 if(res < fmin) 00108 { 00109 fmin = res; 00110 *imin = i; 00111 *jmin = j; 00112 } 00113 } 00114 00115 return fmin; 00116 } |
|
Referenced by adaptative_tau(), and timestep(). |
|
Definition at line 33 of file utilf.c.
00034 { 00035 int i, j; 00036 real mean = 0; 00037 00038 for (i = xs; i <= nx - 1; i++) 00039 for (j = 2; j <= ny - 1; j++) 00040 mean += (u[i][j] - umean) * (u[i][j] - umean); 00041 00042 return sqrt(mean / (nx - xs) / (ny - 2)); 00043 } |
|
Definition at line 46 of file utilf.c. References real, real2D, and UNDEFINED. Referenced by adaptative(), printfree(), and timestep().
00047 { 00048 int i, j; 00049 real res, fmax; 00050 00051 fmax = 0.0; 00052 for (i = 2; i <= nx - 1; i++) 00053 for (j = 2; j <= ny - 1; j++) 00054 if (u[i][j] != UNDEFINED) { 00055 res = u[i][j]; 00056 if(fabs(res) > fmax) { 00057 fmax = fabs(res); 00058 *imax = i; 00059 *jmax = j; 00060 } 00061 } 00062 00063 return fmax; 00064 } |
|
Definition at line 156 of file utilf.c. Referenced by adaptative(), adaptative_tau(), mgsolve(), and timestep().
00157 { 00158 int i, j; 00159 real val, maxdiv = 0.0; 00160 00161 for (i = 2; i < nx; i++) 00162 for (j = 2; j < ny; j++) { 00163 /* 2D-axi: the divergence is div, the volume is (r + 1/2) */ 00164 val = fabs(div[i][j]/((real)j - 1.5)); 00165 if (val > maxdiv) { 00166 maxdiv = val; *imax = i; *jmax = j; 00167 } 00168 } 00169 return maxdiv; 00170 } |
|
Definition at line 119 of file utilf.c. Referenced by timestep().
00120 { 00121 int i, j; 00122 real sum; 00123 00124 sum = 0.0; 00125 for (i = 2; i <= nx - 1; i++) 00126 for (j = 2; j <= ny - 1; j++) 00127 sum += u[i][j]; 00128 00129 return sum; 00130 } |