| 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 |
|
|---|
| 19 | namespace VMG
|
|---|
| 20 | {
|
|---|
| 21 |
|
|---|
| 22 | class DiscretizationPoissonFV : public Discretization
|
|---|
| 23 | {
|
|---|
| 24 | public:
|
|---|
| 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 |
|
|---|
| 41 | private:
|
|---|
| 42 | void SetInnerBoundaryCompute(Grid& sol_f, Grid& rhs_f, Grid& sol_c) const;
|
|---|
| 43 | };
|
|---|
| 44 |
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | #endif /* DISCRETIZATION_POISSON_FV_HPP_ */
|
|---|