| Rev | Line | |
|---|
| [48b662] | 1 | /*
|
|---|
| 2 | * interface_sinus.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: 31.03.2011
|
|---|
| 5 | * Author: Julian Iseringhausen
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifdef HAVE_CONFIG_H
|
|---|
| 9 | #include <config.h>
|
|---|
| 10 | #endif
|
|---|
| 11 |
|
|---|
| 12 | #ifndef _USE_MATH_DEFINES
|
|---|
| 13 | #define _USE_MATH_DEFINES
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include <cmath>
|
|---|
| 17 |
|
|---|
| 18 | #include "grid/grid.hpp"
|
|---|
| 19 | #include "grid/multigrid.hpp"
|
|---|
| 20 |
|
|---|
| 21 | #include "interface_sinus.hpp"
|
|---|
| 22 |
|
|---|
| 23 | using namespace VMG;
|
|---|
| 24 | using VMGInterfaces::InterfaceSinus;
|
|---|
| 25 |
|
|---|
| 26 | void InterfaceSinus::ImportRightHandSide(Multigrid& grid)
|
|---|
| 27 | {
|
|---|
| 28 | Index i;
|
|---|
| 29 | Vector pos;
|
|---|
| 30 |
|
|---|
| 31 | Grid& grid_l = grid(grid.GlobalMaxLevel());
|
|---|
| 32 |
|
|---|
| 33 | const double& sp = grid_l.MeshWidth();
|
|---|
| 34 | const double factor = 2.0 * M_PI * grid_l.Extent().Size().Max();
|
|---|
| 35 |
|
|---|
| 36 | grid_l.ClearBoundary();
|
|---|
| 37 |
|
|---|
| 38 | for (i.X()=0; i.X()<grid_l.Local().SizeTotal().X(); ++i.X())
|
|---|
| 39 | for (i.Y()=0; i.Y()<grid_l.Local().SizeTotal().Y(); ++i.Y())
|
|---|
| 40 | for (i.Z()=0; i.Z()<grid_l.Local().SizeTotal().Z(); ++i.Z()) {
|
|---|
| 41 |
|
|---|
| 42 | pos = grid_l.Extent().Begin() + sp * static_cast<Vector>(grid_l.Global().Begin() + i);
|
|---|
| 43 |
|
|---|
| 44 | grid_l(i) = 3.0 * factor * factor * sin(factor * pos.X()) * sin(factor * pos.Y()) * sin(factor * pos.Z());
|
|---|
| 45 |
|
|---|
| 46 | }
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | void InterfaceSinus::ExportSolution(Grid& grid)
|
|---|
| 50 | {
|
|---|
| 51 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.