source: src/base/discretization.hpp@ dfed1c

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

Major vmg update.

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

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file discretization.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Tue Apr 5 20:32:09 2011
5 *
6 * @brief Base class for controlling the discretization of
7 * the continuous system of equations. The discretized
8 * operator must be specified as a stencil.
9 *
10 */
11
12#ifndef DISCRETIZATION_HPP_
13#define DISCRETIZATION_HPP_
14
15#include <algorithm>
16#include <string>
17
18#include "base/object.hpp"
19#include "base/stencil.hpp"
20#include "grid/grid.hpp"
21#include "grid/multigrid.hpp"
22#include "mg.hpp"
23
24namespace VMG
25{
26
27class Discretization : public Object
28{
29public:
30 Discretization() : stencil(1.0) {}
31 Discretization(const Stencil& stencil_) : stencil(stencil_) {}
32
33 Discretization(std::string id) :
34 Object(id),
35 stencil(1.0)
36 {}
37
38 Discretization(std::string id, const Stencil& stencil_) :
39 Object(id),
40 stencil(stencil_)
41 {}
42
43 const Stencil& GetStencil() const {return stencil;} ///< Returns the stencil of the discretized operator.
44
45 virtual vmg_float OperatorPrefactor(const Grid& grid) const = 0; ///< Returns the prefactor of the operator.
46
47 /**
48 * This function gets called whenever boundary points at inner boundaries are needed.
49 * Inner boundaries occur when using adaptive grid refinement.
50 *
51 * @param sol_fine Solution vector / fine level
52 * @param rhs_fine Right handside vector / fine level
53 * @param sol_coarse Solution vector / coarse level
54 */
55 void SetInnerBoundary(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const
56 {
57 if (sol_fine.Global().BoundaryType() == LocallyRefined)
58 SetInnerBoundaryCompute(sol_fine, rhs_fine, sol_coarse);
59 }
60
61private:
62 virtual void SetInnerBoundaryCompute(Grid& sol_fine, Grid& rhs_fine, Grid& sol_coarse) const = 0;
63
64protected:
65 VMG::Stencil stencil;
66};
67
68}
69
70#endif /* DISCRETIZATION_HPP_ */
Note: See TracBrowser for help on using the repository browser.