| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * @file interface_vtk.cpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:58:39 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::InterfaceVTK
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifdef HAVE_CONFIG_H
|
|---|
| 11 | #include <config.h>
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 | #ifdef HAVE_VTK
|
|---|
| 15 |
|
|---|
| 16 | #include "interface_vtk.hpp"
|
|---|
| 17 |
|
|---|
| 18 | void MGInterfaceVTK::ImportRightHandSide(MGMultigrid& multigrid)
|
|---|
| 19 | {
|
|---|
| 20 | MGGrid& grid = multigrid(multigrid.GlobalMaxLevel());
|
|---|
| 21 |
|
|---|
| 22 | ptr<vtkStructuredPointsReader> source = ptr<vtkStructuredPointsReader>::New();
|
|---|
| 23 |
|
|---|
| 24 | source->SetFileName(filename.c_str());
|
|---|
| 25 | source->Update();
|
|---|
| 26 |
|
|---|
| 27 | for (int i=0; i<grid.Local().SizeTotal().X(); ++i)
|
|---|
| 28 | for (int j=0; j<grid.Local().SizeTotal().Y(); ++j)
|
|---|
| 29 | for (int k=0; k<grid.Local().SizeTotal().Z(); ++k)
|
|---|
| 30 | grid(i,j,k) = source->GetOutput()->GetScalarComponentAsDouble(i,j,k,0);
|
|---|
| 31 | }
|
|---|
| 32 |
|
|---|
| 33 | void MGInterfaceVTK::ExportSolution(MGGrid& grid)
|
|---|
| 34 | {
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.