jacobi_C-Style
userset.cpp
Go to the documentation of this file.
1 #include "userset.h"
2 #include <cmath>
3 
4 void SetU(int const nx, int const ny, double u[])
5 {
6  int dx = nx + 1;
7  for (int j = 0; j <= ny; ++j)
8  {
9  int k = j * dx;
10  for (int i = 0; i <= nx; ++i, ++k)
11  {
12  u[k] = 0.0;
13  }
14  }
15 }
16 
17 void SetF(int const nx, int const ny, double f[])
18 {
19  int dx = nx + 1;
20  for (int j = 0; j <= ny; ++j)
21  {
22  int k = j * dx;
23  for (int i = 0; i <= nx; ++i, ++k)
24  {
25  f[k] = 1.0;
26  }
27  }
28 }
29 
30 
31 double FunctF(double const x , double const y)
32 {
33 // return std::sin(3.14159*1*x)*std::sin(3.14159*1*y);
34 // return 16.0*1024. ;
35 // return (double)1.0 ;
36  return x * x * std::sin(2.5 * 3.14159 * y);
37 }
38 
39 double FunctU(const double /* x */, double const /* y */)
40 {
41  return 1.0 ;
42 }
FunctU
double FunctU(const double, double const)
Definition: userset.cpp:39
userset.h
SetF
void SetF(int const nx, int const ny, double f[])
Definition: userset.cpp:17
FunctF
double FunctF(double const x, double const y)
Definition: userset.cpp:31
SetU
void SetU(int const nx, int const ny, double u[])
Definition: userset.cpp:4