| Line | |
|---|
| 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 | #include <cmath>
|
|---|
| 13 | #include <iostream>
|
|---|
| 14 |
|
|---|
| 15 | #include "grid/grid.hpp"
|
|---|
| 16 | #include "grid/multigrid.hpp"
|
|---|
| 17 |
|
|---|
| 18 | #include "interface_sinus.hpp"
|
|---|
| 19 |
|
|---|
| 20 | using namespace VMG;
|
|---|
| 21 | using VMGInterfaces::InterfaceSinus;
|
|---|
| 22 |
|
|---|
| 23 | void InterfaceSinus::ImportRightHandSide(Multigrid& multigrid)
|
|---|
| 24 | {
|
|---|
| 25 | Index i;
|
|---|
| 26 | Vector pos;
|
|---|
| 27 |
|
|---|
| 28 | Grid& grid = multigrid(multigrid.MaxLevel());
|
|---|
| 29 | grid.ClearBoundary();
|
|---|
| 30 |
|
|---|
| 31 | const Index begin_local = grid.Global().LocalBegin() - grid.Local().HaloSize1();
|
|---|
| 32 |
|
|---|
| 33 | for (i.X()=grid.Local().Begin().X(); i.X()<grid.Local().End().X(); ++i.X())
|
|---|
| 34 | for (i.Y()=grid.Local().Begin().Y(); i.Y()<grid.Local().End().Y(); ++i.Y())
|
|---|
| 35 | for (i.Z()=grid.Local().Begin().Z(); i.Z()<grid.Local().End().Z(); ++i.Z()) {
|
|---|
| 36 | pos = grid.Extent().MeshWidth() * static_cast<Vector>(begin_local + i);
|
|---|
| 37 | grid(i) = 3.0 * sine_factor * sine_factor * std::sin(sine_factor * pos.X()) * std::sin(sine_factor * pos.Y()) * std::sin(sine_factor * pos.Z());
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | void InterfaceSinus::ExportSolution(Grid& grid)
|
|---|
| 42 | {
|
|---|
| 43 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.