Skip to content
Snippets Groups Projects
Commit 5c990948 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Write to VTK instead of AmiraMesh

[[Imported from SVN: r9751]]
parent 4a0c8db0
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
#include <dune/grid/utility/structuredgridfactory.hh> #include <dune/grid/utility/structuredgridfactory.hh>
#include <dune/grid/io/file/amirameshreader.hh> #include <dune/grid/io/file/amirameshreader.hh>
#include <dune/grid/io/file/amirameshwriter.hh> #include <dune/grid/io/file/vtk.hh>
#include <dune/fufem/boundarypatch.hh> #include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/functions/vtkbasisgridfunction.hh>
#include <dune/solvers/solvers/iterativesolver.hh> #include <dune/solvers/solvers/iterativesolver.hh>
#include <dune/solvers/norms/energynorm.hh> #include <dune/solvers/norms/energynorm.hh>
...@@ -268,7 +269,8 @@ int main (int argc, char *argv[]) try ...@@ -268,7 +269,8 @@ int main (int argc, char *argv[]) try
// Output result // Output result
// ////////////////////////////// // //////////////////////////////
BlockVector<FieldVector<double,3> > xEmbedded(x.size()); typedef BlockVector<FieldVector<double,3> > EmbeddedVectorType;
EmbeddedVectorType xEmbedded(x.size());
for (size_t i=0; i<x.size(); i++) { for (size_t i=0; i<x.size(); i++) {
#ifdef UNITVECTOR2 #ifdef UNITVECTOR2
xEmbedded[i][0] = x[i].globalCoordinates()[0]; xEmbedded[i][0] = x[i].globalCoordinates()[0];
...@@ -292,10 +294,13 @@ int main (int argc, char *argv[]) try ...@@ -292,10 +294,13 @@ int main (int argc, char *argv[]) try
#endif #endif
} }
LeafAmiraMeshWriter<GridType> amiramesh; VTKWriter<GridType::LeafGridView> vtkWriter(grid.leafGridView());
amiramesh.addGrid(grid.leafGridView()); Dune::shared_ptr<VTKBasisGridFunction<FEBasis,EmbeddedVectorType> > vtkVectorField
amiramesh.addVertexData(xEmbedded, grid.leafGridView()); = Dune::shared_ptr<VTKBasisGridFunction<FEBasis,EmbeddedVectorType> >
amiramesh.write("resultGrid", 1); (new VTKBasisGridFunction<FEBasis,EmbeddedVectorType>(feBasis, xEmbedded, "orientation"));
vtkWriter.addVertexData(vtkVectorField);
vtkWriter.write("resultGrid");
// ////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////
// Recompute and compare against exact solution // Recompute and compare against exact solution
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment