source: src/samples/discretization_poisson_fd_collatz.hpp@ a40eea

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

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

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

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/**
2 * @file discretization_poisson_fd_collatz.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 13:02:26 2011
5 *
6 * @brief Collatz finite difference discretization of the
7 * Poisson equation for a higher order discretization
8 * while preserving compactness of the stencil.
9 *
10 */
11
12#ifndef DISCRETIZATION_POISSON_FD_COLLATZ_HPP_
13#define DISCRETIZATION_POISSON_FD_COLLATZ_HPP_
14
15#include "base/discretization.hpp"
16
17namespace VMG
18{
19
20class DiscretizationPoissonFDCollatz : public Discretization
21{
22public:
23 DiscretizationPoissonFDCollatz()
24 {
25 stencil.SetDiag(24.0/6.0);
26
27 stencil.push_back(-1, 0, 0, -2.0/6.0);
28 stencil.push_back( 1, 0, 0, -2.0/6.0);
29 stencil.push_back( 0, -1, 0, -2.0/6.0);
30 stencil.push_back( 0, 1, 0, -2.0/6.0);
31 stencil.push_back( 0, 0, -1, -2.0/6.0);
32 stencil.push_back( 0, 0, 1, -2.0/6.0);
33
34 stencil.push_back(-1, -1, 0, -1.0/6.0);
35 stencil.push_back(-1, 1, 0, -1.0/6.0);
36 stencil.push_back( 1, -1, 0, -1.0/6.0);
37 stencil.push_back( 1, 1, 0, -1.0/6.0);
38 stencil.push_back(-1, 0, -1, -1.0/6.0);
39 stencil.push_back(-1, 0, 1, -1.0/6.0);
40 stencil.push_back( 1, 0, -1, -1.0/6.0);
41 stencil.push_back( 1, 0, 1, -1.0/6.0);
42 stencil.push_back( 0, -1, -1, -1.0/6.0);
43 stencil.push_back( 0, -1, 1, -1.0/6.0);
44 stencil.push_back( 0, 1, -1, -1.0/6.0);
45 stencil.push_back( 0, 1, 1, -1.0/6.0);
46 }
47
48 vmg_float OperatorPrefactor(const Grid& grid) const
49 {
50 return 1.0 / Helper::pow_2(grid.Extent().MeshWidth().Max());
51 }
52
53private:
54 void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const {}
55};
56
57class StencilPoissonCollatzRhs : public Stencil
58{
59public:
60 StencilPoissonCollatzRhs() :
61 Stencil(0.5)
62 {
63 this->push_back(-1, 0, 0, 1.0/12.0);
64 this->push_back( 1, 0, 0, 1.0/12.0);
65 this->push_back( 0, -1, 0, 1.0/12.0);
66 this->push_back( 0, 1, 0, 1.0/12.0);
67 this->push_back( 0, 0, -1, 1.0/12.0);
68 this->push_back( 0, 0, 1, 1.0/12.0);
69 }
70};
71
72}
73
74#endif /* DISCRETIZATION_POISSON_FD_HPP_ */
Note: See TracBrowser for help on using the repository browser.