ParMooN
 All Classes Functions Variables Friends Pages
CubicPressure.h
1 // Bechmark for Darcy problem, exact solution is
2 //
3 
4 void ExampleFile()
5 {
6  OutPut("Example: CubicPressure.h" << endl) ;
7 }
8 
9 // ========================================================================
10 // exact solution
11 // ========================================================================
12 void ExactU1(double x, double y, double *values)
13 {
14  values[0] = -x*x*y + y*y*y/3.0;
15  values[1] = -2*x*y;
16  values[2] = -x*x + y*y;
17  values[3] = 0;
18 }
19 
20 void ExactU2(double x, double y, double *values)
21 {
22  values[0] = -x*x*x/3.0 + x*y*y;
23  values[1] = -x*x + y*y;
24  values[2] = 2*x*y;
25  values[3] = 0;
26 }
27 
28 void ExactP(double x, double y, double *values)
29 {
30  values[0] = (x*x*x*y - x*y*y*y)/3.0;
31  values[1] = x*x*y - y*y*y/3.0;
32  values[2] = x*x*x/3.0 - x*y*y;
33  values[3] = 0.0;
34 }
35 
36 // ========================================================================
37 // boundary conditions
38 // ========================================================================
39 void BoundCondition(int bdComp, double t, BoundCond &cond)
40 {
41  cond = (bdComp == 3) ? DIRICHLET : NEUMANN;
42 }
43 
44 // u \cdot n
45 void FluxBoundValue(int bdComp, double t, double &value)
46 {
47 
48  switch(bdComp)
49  {
50  case 0:
51  {
52  value = 0.0; // Neumann
53  //value = t*t*t/3.0; // Dirichlet
54  break;
55  }
56  case 1:
57  {
58  value = (t - t*t*t) / 3.0; // Neumann
59  //value = t*t*t/3.0 - t; // Dirichlet
60  break;
61  }
62  case 2:
63  {
64  double x = 1-t;
65  value = (x*x*x - x) / 3.0; // Neumann
66  //value = x - x*x*x/3.0; // Dirichlet
67  break;
68  }
69  case 3:
70  {
71  double y = 1-t;
72  //value = 0.0; // Neumann
73  value = -y*y*y/3.0; // Dirichlet
74  break;
75  }
76  default:
77  ErrMsg("wrong boundary part number");
78  exit(0);
79  break;
80  }
81 }
82 
83 // ========================================================================
84 // coefficients for Stokes form: A, B1, B2, f1, f2
85 // ========================================================================
86 void LinCoeffs(int n_points, double *X, double *Y,
87  double **parameters, double **coeffs)
88 {
89  const double eps = 1.0 / TDatabase::ParamDB->SIGMA_PERM;
90  for(int i = 0; i < n_points; i++)
91  {
92  coeffs[i][0] = eps;
93  // RHS for exact solution
94  coeffs[i][1] = 0; // f1
95  coeffs[i][2] = 0; // f2
96  coeffs[i][3] = 0; // g
97  }
98 }
99 
100 
static TParamDB * ParamDB
Definition: Database.h:1134