ParMooN
 All Classes Functions Variables Friends Pages
exp.h
1 // ======================================================================
2 // instationary problem
3 // ======================================================================
4 
6 // example file
7 // ========================================================================
8 
9 #define __SIN3__
10 
11 void ExampleFile()
12 {
13  OutPut("Example: exp.h" << endl);
14 }
15 
16 // exact solution
17 void Exact(double x, double y, double *values)
18 {
19  double t;
20 
21  t = TDatabase::TimeDB->CURRENTTIME;
22 
23  values[0] = exp(t)*(sin(2*Pi*x)*sin(2*Pi*y));
24  values[1] = exp(t)*2*Pi*cos(2*Pi*x)*sin(2*Pi*y);
25  values[2] = exp(t)*2*Pi*sin(2*Pi*x)*cos(2*Pi*y);
26  values[3] = 0;
27 }
28 
29 // kind of boundary condition (for FE space needed)
30 void BoundCondition(int BdComp, double t, BoundCond &cond)
31 {
32  cond = DIRICHLET;
33 }
34 
35 // value of boundary condition
36 void BoundValue(int BdComp, double Param, double &value)
37 {
38  value = 0;
39 }
40 
41 // initial conditon
42 void InitialCondition(double x, double y, double *values)
43 {
44  double t;
45 
46  t = TDatabase::TimeDB->CURRENTTIME;
47  values[0] = exp(t)*(sin(2*Pi*x)*sin(2*Pi*y));
48 }
49 
50 
51 void BilinearCoeffs(int n_points, double *X, double *Y,
52  double **parameters, double **coeffs)
53 {
54  double eps=1/TDatabase::ParamDB->PE_NR;
55  double b1=1, b2=-1, c=1;
56  int i;
57  double *coeff;
58  double x, y;
59  double t = TDatabase::TimeDB->CURRENTTIME;
60 
61  for(i=0;i<n_points;i++)
62  {
63  coeff = coeffs[i];
64 
65  x = X[i];
66  y = Y[i];
67 
68  coeff[0] = eps;
69  coeff[1] = b1;
70  coeff[2] = b2;
71  coeff[3] = c;
72 
73  coeff[4] = exp(t)*(sin(2*Pi*x)*sin(2*Pi*y))
74  - eps * exp(t)*4*Pi*Pi*(-sin(2*Pi*x)*sin(2*Pi*y)-sin(2*Pi*x)*sin(2*Pi*y))
75  + b1 * exp(t)*2*Pi*cos(2*Pi*x)*sin(2*Pi*y)
76  + b2 * exp(t)*2*Pi*sin(2*Pi*x)*cos(2*Pi*y)
77  + c * exp(t)*(sin(2*Pi*x)*sin(2*Pi*y));
78  }
79 }
static TTimeDB * TimeDB
Definition: Database.h:1137
static TParamDB * ParamDB
Definition: Database.h:1134