| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * @file stencil.cpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:24:43 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::Stencil.
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | #ifdef HAVE_CONFIG_H
|
|---|
| 12 | #include <config.h>
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #include "base/stencil.hpp"
|
|---|
| 16 | #include "grid/grid.hpp"
|
|---|
| 17 |
|
|---|
| 18 | using namespace VMG;
|
|---|
| 19 |
|
|---|
| 20 | vmg_float Stencil::Apply(const Grid& grid, const Index& index) const
|
|---|
| 21 | {
|
|---|
| 22 | vmg_float result = diag * grid.GetVal(index);
|
|---|
| 23 |
|
|---|
| 24 | for (Stencil::iterator iter=disp.begin(); iter!=disp.end(); ++iter)
|
|---|
| 25 | result += iter->val * grid.GetVal(index + iter);
|
|---|
| 26 |
|
|---|
| 27 | return result;
|
|---|
| 28 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.