ParMooN
 All Classes Functions Variables Friends Pages
ConstTSmooth.h
1 // ==========================================================================
2 // instationary problem
3 // ==========================================================================
4 
5 //===========================================================================
6 // example file
7 // =========================================================================
8 // exact solution in unit cube
9 void ExampleFile()
10 {
11  OutPut("Example: ConstTSmooth.h" << endl);
12 }
13 
14 // exact solution
15 void Exact(double x, double y, double z, double *values)
16 {
17  double t, PI =3.14159265;
18  t = TDatabase::TimeDB->CURRENTTIME;
19 
20  values[0] = (exp(-0.1*t))*sin(PI*x)*cos(PI*y)*cos(PI*z);
21  values[1] = PI*(exp(-0.1*t))*cos(PI*x)*cos(PI*y)*cos(PI*z);
22  values[2] = -PI*(exp(-0.1*t))*cos(PI*x)*sin(PI*y)*cos(PI*z);
23  values[3] = -PI*(exp(-0.1*t))*cos(PI*x)*cos(PI*y)*sin(PI*z);
24  values[4] = -3.*PI*PI*(exp(-0.1*t))*sin(PI*x)*cos(PI*y)*cos(PI*z); ;
25 }
26 
27 // initial conditon
28 void InitialCondition(double x, double y, double z, double *values)
29 {
30  double t, PI =3.14159265;
31 
32  t =0.;
33  values[0] = (exp(-0.1*t))*sin(PI*x)*cos(PI*y)*cos(PI*z);
34 }
35 
36 // kind of boundary condition
37 void BoundCondition(double x, double y, double z, BoundCond &cond)
38 {
39  cond = DIRICHLET;
40 }
41 
42 // value of boundary condition
43 void BoundValue(double x, double y, double z, double &value)
44 {
45  double t, PI =3.14159265;
46  t = TDatabase::TimeDB->CURRENTTIME;
47 
48  value = (exp(-0.1*t))*sin(PI*x)*cos(PI*y)*cos(PI*z);
49 }
50 
51 void BilinearCoeffs(int n_points, double *X, double *Y, double *Z,
52  double **parameters, double **coeffs)
53 {
54  double eps;
55  int i;
56  double *coeff, PI =3.14159265;
57  double x, y, z, c, a[3], b[3], s[3], h;
58  double t = TDatabase::TimeDB->CURRENTTIME;
59 
60 
61  if(TDatabase::ParamDB->RE_NR!=0)
62  eps = 1.0/TDatabase::ParamDB->RE_NR;
63  else
64  eps = 0;
65 
66 // cout << "eps eps = " << eps << endl;
67  b[0] = 0;
68  b[1] = 0;
69  b[2] = 0;
70  c = 0;
71 
72  for(i=0;i<n_points;i++)
73  {
74  coeff = coeffs[i];
75 
76  x = X[i];
77  y = Y[i];
78  z = Z[i];
79 
80  // diffusion
81  coeff[0] = eps;
82  // convection in x direction
83  coeff[1] = b[0];
84  // convection in y direction
85  coeff[2] = b[1];
86  // convection in z direction
87  coeff[3] = b[2];
88  // reaction
89  coeff[4] = c;
90  // rhs
91  coeff[5] = (3.*eps*PI*PI - 0.1)*(exp(-0.1*t))*sin(PI*x)*cos(PI*y)*cos(PI*z); // f
92  coeff[6] = 0;
93 
94  }
95 }
96 
static TTimeDB * TimeDB
Definition: Database.h:1137
double RE_NR
Definition: Database.h:313
static TParamDB * ParamDB
Definition: Database.h:1134