| 1 | /**
|
|---|
| 2 | * @file stencils.hpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 13:06:11 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief Some examples for stencils.
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifndef STENCILS_HPP_
|
|---|
| 11 | #define STENCILS_HPP_
|
|---|
| 12 |
|
|---|
| 13 | #include "base/stencil.hpp"
|
|---|
| 14 |
|
|---|
| 15 | namespace VMG
|
|---|
| 16 | {
|
|---|
| 17 |
|
|---|
| 18 | class Injection : public Stencil
|
|---|
| 19 | {
|
|---|
| 20 | public:
|
|---|
| 21 | Injection() :
|
|---|
| 22 | Stencil(1.0)
|
|---|
| 23 | {}
|
|---|
| 24 | };
|
|---|
| 25 |
|
|---|
| 26 | class InterpolationTrilinear : public Stencil
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | InterpolationTrilinear() :
|
|---|
| 30 | Stencil(1.0)
|
|---|
| 31 | {
|
|---|
| 32 | this->push_back( 1, 0, 0, 0.5);
|
|---|
| 33 | this->push_back(-1, 0, 0, 0.5);
|
|---|
| 34 | this->push_back( 0, 1, 0, 0.5);
|
|---|
| 35 | this->push_back( 0, -1, 0, 0.5);
|
|---|
| 36 | this->push_back( 0, 0, 1, 0.5);
|
|---|
| 37 | this->push_back( 0, 0, -1, 0.5);
|
|---|
| 38 |
|
|---|
| 39 | this->push_back( 1, 1, 0, 0.25);
|
|---|
| 40 | this->push_back( 1, -1, 0, 0.25);
|
|---|
| 41 | this->push_back(-1, 1, 0, 0.25);
|
|---|
| 42 | this->push_back(-1, -1, 0, 0.25);
|
|---|
| 43 | this->push_back( 0, 1, 1, 0.25);
|
|---|
| 44 | this->push_back( 0, 1, -1, 0.25);
|
|---|
| 45 | this->push_back( 0, -1, 1, 0.25);
|
|---|
| 46 | this->push_back( 0, -1, -1, 0.25);
|
|---|
| 47 | this->push_back( 1, 0, 1, 0.25);
|
|---|
| 48 | this->push_back( 1, 0, -1, 0.25);
|
|---|
| 49 | this->push_back(-1, 0, 1, 0.25);
|
|---|
| 50 | this->push_back(-1, 0, -1, 0.25);
|
|---|
| 51 |
|
|---|
| 52 | this->push_back( 1, 1, 1, 0.125);
|
|---|
| 53 | this->push_back( 1, 1, -1, 0.125);
|
|---|
| 54 | this->push_back( 1, -1, 1, 0.125);
|
|---|
| 55 | this->push_back(-1, 1, 1, 0.125);
|
|---|
| 56 | this->push_back( 1, -1, -1, 0.125);
|
|---|
| 57 | this->push_back(-1, 1, -1, 0.125);
|
|---|
| 58 | this->push_back(-1, -1, 1, 0.125);
|
|---|
| 59 | this->push_back(-1, -1, -1, 0.125);
|
|---|
| 60 | }
|
|---|
| 61 | };
|
|---|
| 62 |
|
|---|
| 63 | class RestrictionFullWeight : public Stencil
|
|---|
| 64 | {
|
|---|
| 65 | public:
|
|---|
| 66 | RestrictionFullWeight() :
|
|---|
| 67 | Stencil(0.125)
|
|---|
| 68 | {
|
|---|
| 69 | this->push_back( 1, 0, 0, 0.0625);
|
|---|
| 70 | this->push_back(-1, 0, 0, 0.0625);
|
|---|
| 71 | this->push_back( 0, 1, 0, 0.0625);
|
|---|
| 72 | this->push_back( 0, -1, 0, 0.0625);
|
|---|
| 73 | this->push_back( 0, 0, 1, 0.0625);
|
|---|
| 74 | this->push_back( 0, 0, -1, 0.0625);
|
|---|
| 75 |
|
|---|
| 76 | this->push_back( 1, 1, 0, 0.03125);
|
|---|
| 77 | this->push_back( 1, -1, 0, 0.03125);
|
|---|
| 78 | this->push_back(-1, 1, 0, 0.03125);
|
|---|
| 79 | this->push_back(-1, -1, 0, 0.03125);
|
|---|
| 80 | this->push_back( 0, 1, 1, 0.03125);
|
|---|
| 81 | this->push_back( 0, 1, -1, 0.03125);
|
|---|
| 82 | this->push_back( 0, -1, 1, 0.03125);
|
|---|
| 83 | this->push_back( 0, -1, -1, 0.03125);
|
|---|
| 84 | this->push_back( 1, 0, 1, 0.03125);
|
|---|
| 85 | this->push_back( 1, 0, -1, 0.03125);
|
|---|
| 86 | this->push_back(-1, 0, 1, 0.03125);
|
|---|
| 87 | this->push_back(-1, 0, -1, 0.03125);
|
|---|
| 88 |
|
|---|
| 89 | this->push_back( 1, 1, 1, 0.015625);
|
|---|
| 90 | this->push_back( 1, 1, -1, 0.015625);
|
|---|
| 91 | this->push_back( 1, -1, 1, 0.015625);
|
|---|
| 92 | this->push_back(-1, 1, 1, 0.015625);
|
|---|
| 93 | this->push_back( 1, -1, -1, 0.015625);
|
|---|
| 94 | this->push_back(-1, 1, -1, 0.015625);
|
|---|
| 95 | this->push_back(-1, -1, 1, 0.015625);
|
|---|
| 96 | this->push_back(-1, -1, -1, 0.015625);
|
|---|
| 97 | }
|
|---|
| 98 | };
|
|---|
| 99 |
|
|---|
| 100 | namespace Stencils
|
|---|
| 101 | {
|
|---|
| 102 | static const VMG::Stencil Injection = VMG::Injection();
|
|---|
| 103 | static const VMG::Stencil InterpolationTrilinear = VMG::InterpolationTrilinear();
|
|---|
| 104 | static const VMG::Stencil RestrictionFullWeight = VMG::RestrictionFullWeight();
|
|---|
| 105 | }
|
|---|
| 106 |
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | #endif /* STENCILS_HPP_ */
|
|---|