source: src/samples/discretization_poisson_fd.hpp@ 48b662

Last change on this file since 48b662 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

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

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[48b662]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
12#ifndef DISCRETIZATION_POISSON_FD_HPP_
13#define DISCRETIZATION_POISSON_FD_HPP_
14
15#include "base/discretization.hpp"
16
17namespace VMG
18{
19
20static inline vmg_float sqr(const vmg_float& val) {return val*val;}
21
22class DiscretizationPoissonFD : public Discretization
23{
24public:
25 DiscretizationPoissonFD()
26 {
27 stencil.SetDiag(6.0);
28 stencil.push_back(Displacement(-1, 0, 0, -1.0));
29 stencil.push_back(Displacement( 1, 0, 0, -1.0));
30 stencil.push_back(Displacement( 0, -1, 0, -1.0));
31 stencil.push_back(Displacement( 0, 1, 0, -1.0));
32 stencil.push_back(Displacement( 0, 0, -1, -1.0));
33 stencil.push_back(Displacement( 0, 0, 1, -1.0));
34 }
35
36 vmg_float OperatorPrefactor(const Grid& grid) const
37 {
38 return 1.0 / (sqr(grid.MeshWidth()));
39 }
40
41private:
42 void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const {}
43};
44
45}
46
47#endif /* DISCRETIZATION_POISSON_FD_HPP_ */
Note: See TracBrowser for help on using the repository browser.