source: src/samples/discretization_poisson_fd.hpp@ d24c2f

Last change on this file since d24c2f was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/**
2 * @file discretization_poisson_fd.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 13:01:40 2011
5 *
6 * @brief Finite difference discretization of the
7 * Poisson equation.
8 *
9 */
10
11#ifndef DISCRETIZATION_POISSON_FD_HPP_
12#define DISCRETIZATION_POISSON_FD_HPP_
13
14#include "base/discretization.hpp"
15
16namespace VMG
17{
18
19static inline vmg_float sqr(const vmg_float& val) {return val*val;}
20
21class DiscretizationPoissonFD : public Discretization
22{
23public:
24 DiscretizationPoissonFD()
25 {
26 stencil.SetDiag(6.0);
27 stencil.push_back(-1, 0, 0, -1.0);
28 stencil.push_back( 1, 0, 0, -1.0);
29 stencil.push_back( 0, -1, 0, -1.0);
30 stencil.push_back( 0, 1, 0, -1.0);
31 stencil.push_back( 0, 0, -1, -1.0);
32 stencil.push_back( 0, 0, 1, -1.0);
33 }
34
35 vmg_float OperatorPrefactor(const Grid& grid) const
36 {
37 return 1.0 / (sqr(grid.MeshWidth()));
38 }
39
40private:
41 void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const {}
42};
43
44}
45
46#endif /* DISCRETIZATION_POISSON_FD_HPP_ */
Note: See TracBrowser for help on using the repository browser.