source: test/interfaces/interface_sinus.cpp@ a40eea

Last change on this file since a40eea was ac6d04, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1666 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 1.1 KB
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
20using namespace VMG;
21using VMGInterfaces::InterfaceSinus;
22
23void 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
41void InterfaceSinus::ExportSolution(Grid& grid)
42{
43}
Note: See TracBrowser for help on using the repository browser.