| 1 | /**
|
|---|
| 2 | * @file interface.hpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:56:05 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::Interface
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifndef INTERFACE_HPP_
|
|---|
| 11 | #define INTERFACE_HPP_
|
|---|
| 12 |
|
|---|
| 13 | #include <vector>
|
|---|
| 14 |
|
|---|
| 15 | #include "base/object.hpp"
|
|---|
| 16 | #include "grid/grid_properties.hpp"
|
|---|
| 17 |
|
|---|
| 18 | namespace VMG
|
|---|
| 19 | {
|
|---|
| 20 |
|
|---|
| 21 | class Grid;
|
|---|
| 22 | class Multigrid;
|
|---|
| 23 |
|
|---|
| 24 | class Interface : public Object
|
|---|
| 25 | {
|
|---|
| 26 | public:
|
|---|
| 27 | Interface(const Boundary& boundary, const int& levelMin, const int& levelMax,
|
|---|
| 28 | const Vector& box_offset, const vmg_float box_size,
|
|---|
| 29 | int coarseningSteps=0, vmg_float alpha=1.6) :
|
|---|
| 30 | bc(boundary),
|
|---|
| 31 | levelMin(levelMin),
|
|---|
| 32 | levelMax(levelMax)
|
|---|
| 33 | {
|
|---|
| 34 | InitInterface(box_offset, box_size, coarseningSteps, alpha);
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | virtual ~Interface() {}
|
|---|
| 38 |
|
|---|
| 39 | virtual void ImportRightHandSide(Multigrid& grid) = 0;
|
|---|
| 40 | virtual void ExportSolution(Grid& grid) = 0;
|
|---|
| 41 |
|
|---|
| 42 | const std::vector<GlobalIndices>& Global() const {return global;}
|
|---|
| 43 | const std::vector<SpatialExtent>& Extent() const {return extent;}
|
|---|
| 44 |
|
|---|
| 45 | const GlobalIndices& Global(const int& level) const
|
|---|
| 46 | {
|
|---|
| 47 | return global[levelMax - level];
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | const SpatialExtent& Extent(const int& level) const
|
|---|
| 51 | {
|
|---|
| 52 | return extent[levelMax - level];
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | const Boundary& BoundaryConditions() const {return bc;}
|
|---|
| 56 |
|
|---|
| 57 | const int& MinLevel() const {return levelMin;}
|
|---|
| 58 | const int& MaxLevel() const {return levelMax;}
|
|---|
| 59 |
|
|---|
| 60 | private:
|
|---|
| 61 | void InitInterface(const Vector& box_offset, const vmg_float& box_end,
|
|---|
| 62 | const int& coarseningSteps, const vmg_float& alpha);
|
|---|
| 63 |
|
|---|
| 64 | std::vector<GlobalIndices> global;
|
|---|
| 65 | std::vector<SpatialExtent> extent;
|
|---|
| 66 |
|
|---|
| 67 | Boundary bc;
|
|---|
| 68 |
|
|---|
| 69 | int levelMin, levelMax;
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | }
|
|---|
| 73 |
|
|---|
| 74 | #endif /* INTERFACE_HPP_ */
|
|---|