source: test/interfaces/interface_sinus.cpp@ 48b662

Last change on this file since 48b662 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@847 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#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
23using namespace VMG;
24using VMGInterfaces::InterfaceSinus;
25
26void 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
49void InterfaceSinus::ExportSolution(Grid& grid)
50{
51}
Note: See TracBrowser for help on using the repository browser.