source: src/samples/discretization_poisson_fv.hpp@ ac6d04

Last change on this file since ac6d04 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: 1.1 KB
Line 
1/**
2 * @file discretization_poisson_fv.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 13:03:47 2011
5 *
6 * @brief Finite volume discretization for the Poisson
7 * equation. Absolutely equivalent to the finite
8 * difference discretization unless you use
9 * hierarchically coarsened grids.
10 *
11 */
12
13#ifndef DISCRETIZATION_POISSON_FV_HPP_
14#define DISCRETIZATION_POISSON_FV_HPP_
15
16#include "base/discretization.hpp"
17#include "base/helper.hpp"
18
19namespace VMG
20{
21
22class DiscretizationPoissonFV : public Discretization
23{
24public:
25 DiscretizationPoissonFV()
26 {
27 stencil.SetDiag(6.0);
28 stencil.push_back(-1, 0, 0, -1.0);
29 stencil.push_back( 1, 0, 0, -1.0);
30 stencil.push_back( 0, -1, 0, -1.0);
31 stencil.push_back( 0, 1, 0, -1.0);
32 stencil.push_back( 0, 0, -1, -1.0);
33 stencil.push_back( 0, 0, 1, -1.0);
34 }
35
36 vmg_float OperatorPrefactor(const Grid& grid) const
37 {
38 return 1.0 / Helper::pow_2(grid.Extent().MeshWidth().Max());
39 }
40
41private:
42 void SetInnerBoundaryCompute(Grid& sol_f, Grid& rhs_f, Grid& sol_c) const;
43};
44
45}
46
47#endif /* DISCRETIZATION_POISSON_FV_HPP_ */
Note: See TracBrowser for help on using the repository browser.