ParMooN
 All Classes Functions Variables Friends Pages
SineLaplace_hl.h
1 // ======================================================================
2 // Sine problem
3 // ======================================================================
4 
5 #define __HEATLINE__
6 
7 void ExampleFile()
8 {
9  OutPut("Example: SineLaplace_hl.h" << endl) ;
10 }
11 
12 void GetVelo(double xi, double yi, double*val)
13 {
14  double theta = atan2(yi,xi);
15  double r = sqrt(xi*xi + yi*yi);
16 
17  if(r<1.)
18  {
19  val[0] = (1.-r)*sin(theta);
20  val[1] = -(1.-r)*cos(theta);
21  }
22  else
23  {
24  val[0] = 0.;
25  val[1] = 0.;
26  }
27 
28 }
29 
30 // exact solution
31 void ExactU1(double x, double y, double *values)
32 {
33  double xi = x - 0.5;
34  double yi = y - 0.5;
35  //convective velo
36  GetVelo(xi, yi, values);
37 
38  values[1] = 0.;
39  values[2] = 0.;
40  values[3] = 0.;
41 }
42 
43 // exact solution
44 void ExactU2(double x, double y, double *values)
45 {
46  double xi = x - 0.5;
47  double yi = y - 0.5;
48  //convective velo
49  GetVelo(xi, yi, values);
50 
51  values[0] = values[1] ;
52  values[1] = 0.;
53  values[2] = 0.;
54  values[3] = 0.;
55 }
56 
57 
58 // exact solution
59 void Exact(double x, double y, double *values)
60 {
61  values[0] = 0.;
62  values[1] = 0.;
63  values[2] = 0.;
64  values[3] = 0.;
65 }
66 
67 // kind of boundary condition (for FE space needed)
68 void BoundCondition(int BdComp, double t, BoundCond &cond)
69 {
70  if(BdComp==0 || BdComp==2)
71  { cond = NEUMANN;}
72  else
73  { cond = DIRICHLET;}
74 }
75 
76 // value of boundary condition
77 void BoundValue(int BdComp, double Param, double &value)
78 {
79  static double eps=1/TDatabase::ParamDB->PE_NR;
80 
81  if(BdComp==3)
82  value = 1.;
83  else
84  value = 0;
85 
86 }
87 
88 void BilinearCoeffs(int n_points, double *x, double *y,
89  double **parameters, double **coeffs)
90 {
91  static double eps=1/TDatabase::ParamDB->PE_NR;
92  int i;
93  double *coeff, *param, theta, r, xi, yi;
94 // int xmin,xmax,ymin,ymax,x0,y0;
95 
96  for(i=0;i<n_points;i++)
97  {
98  coeff = coeffs[i];
99  param = parameters[i];
100 
101  xi = x[i] - 0.5;
102  yi = y[i] - 0.5;
103 
104  coeff[0] = eps;
105 
106  //convective velo
107  GetVelo(xi, yi, coeff+1);
108 
109  coeff[3] = 0;
110  coeff[4] = 0;
111 
112 // cout << xi << " , " << yi << " eps " << eps << " : u " << coeff[1] << " v " << coeff[2] << endl;
113  }
114 }
115 
116 // kind of boundary condition (for FE space needed)
117 void HeatFuncBoundCondition(int BdComp, double t, BoundCond &cond)
118 {
119  cond = DIRICHLET;
120 }
121 
122 // value of boundary condition
123 void HeatFuncBoundValue(int BdComp, double Param, double &value)
124 {
125  static double eps=1./TDatabase::ParamDB->PE_NR;
126 
127  if(BdComp==0)
128  value = 0;
129  else if(BdComp==1)
130  value = Param;
131  else if(BdComp==2)
132  value = 1;
133  else
134  value = 1.-Param;
135 }
136 
137 void HeatfuncCoeffs(int n_points, double *x, double *y,
138  double **parameters, double **coeffs)
139 {
140  int i;
141  double *coeff;
142  double r2;
143 
144  for(i=0;i<n_points;i++)
145  {
146  coeff = coeffs[i];
147 
148  coeff[0] = 1.0;
149  coeff[1] = 0;
150  coeff[2] = 0;
151  coeff[3] = 0;
152  coeff[4] = 0;
153  }
154 }
static TParamDB * ParamDB
Definition: Database.h:1134