source: src/samples/discretization_poisson_fv.hpp@ 4571da

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

vmg: Implement fourth-order discretization of the Poisson equation.

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

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[48b662]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"
[ac6d04]17#include "base/helper.hpp"
[48b662]18
19namespace VMG
20{
21
22class DiscretizationPoissonFV : public Discretization
23{
24public:
[4571da]25 DiscretizationPoissonFV(const int& order) :
26 Discretization(order)
[48b662]27 {
28 stencil.SetDiag(6.0);
[dfed1c]29 stencil.push_back(-1, 0, 0, -1.0);
30 stencil.push_back( 1, 0, 0, -1.0);
31 stencil.push_back( 0, -1, 0, -1.0);
32 stencil.push_back( 0, 1, 0, -1.0);
33 stencil.push_back( 0, 0, -1, -1.0);
34 stencil.push_back( 0, 0, 1, -1.0);
[48b662]35 }
36
37 vmg_float OperatorPrefactor(const Grid& grid) const
38 {
[ac6d04]39 return 1.0 / Helper::pow_2(grid.Extent().MeshWidth().Max());
[48b662]40 }
41
42private:
43 void SetInnerBoundaryCompute(Grid& sol_f, Grid& rhs_f, Grid& sol_c) const;
44};
45
46}
47
48#endif /* DISCRETIZATION_POISSON_FV_HPP_ */
Note: See TracBrowser for help on using the repository browser.