Commit 9f23fc23 authored by Peter Bastian's avatar Peter Bastian

snapshot

[[Imported from SVN: r27]]
parent 6da20ada
......@@ -31,12 +31,9 @@ struct P0Layout
template<class G>
void timeloop (G& grid, double tend, int lmin, int lmax)
{
// get leaf index set type needed for mapper
typedef typename G::template Codim<0>::LeafIndexSet IS;
// make a mapper for codim 0 entities in the leaf grid
Dune::MultipleCodimMultipleGeomTypeMapper<G,IS,P0Layout>
mapper(grid,grid.leafIndexSet());
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P0Layout>
mapper(grid);
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -87,6 +87,16 @@
note = {http://www.iam.uni-bonn.de/grape/main.html},
}
@Misc{VTK,
author = {Visualization Toolkit Web Page},
note = {http://public.kitware.com/VTK/},
}
@Misc{Paraview,
author = {Paraview Web Page},
note = {http://www.paraview.org/HTML/Index.html},
}
@Misc{GPL,
author = {GNU Lesser General Public License},
note = {http://www.gnu.org/licenses/lgpl.html},
......
This diff is collapsed.
......@@ -29,12 +29,9 @@ void elementdata (const G& grid, const F& f)
typedef typename G::ctype ct;
typedef typename G::template Codim<0>::LeafIterator ElementLeafIterator;
// get leaf index set type needed for mapper
typedef typename G::template Codim<0>::LeafIndexSet IS;
// make a mapper for codim 0 entities in the leaf grid
Dune::MultipleCodimMultipleGeomTypeMapper<G,IS,P0Layout>
mapper(grid,grid.leafIndexSet());
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P0Layout>
mapper(grid);
// allocate a vector for the data
std::vector<double> c(mapper.size());
......@@ -57,10 +54,8 @@ void elementdata (const G& grid, const F& f)
c[mapper.map(*it)] = f(global);
}
// initialize a P0 function with the vector, needed for VTK IO
Dune::LeafP0Function<G,double> cc(grid,c);
// generate a VTK file
Dune::LeafP0Function<G,double> cc(grid,c);
Dune::VTKWriter<G> vtkwriter(grid);
vtkwriter.addCellData(cc,"data");
vtkwriter.write("elementdata",Dune::VTKOptions::binaryappended);
......
......@@ -22,7 +22,8 @@ void evolve (const G& grid, const M& mapper, V& c, double t, double& dt)
typedef typename G::template Codim<0>::EntityPointer EntityPointer;
// allocate a temporary vector for the update
V update(c.size(),0.0);
V update(c.size());
for (int i=0; i<c.size(); i++) update[i] = 0;
// initialize dt very large
dt = 1E100;
......
......@@ -30,12 +30,9 @@ struct P0Layout
template<class G>
void timeloop (const G& grid, double tend)
{
// get leaf index set type needed for mapper
typedef typename G::template Codim<0>::LeafIndexSet IS;
// make a mapper for codim 0 entities in the leaf grid
Dune::MultipleCodimMultipleGeomTypeMapper<G,IS,P0Layout>
mapper(grid,grid.leafIndexSet());
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P0Layout>
mapper(grid);
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -24,7 +24,8 @@ void parevolve (const G& grid, const M& mapper, V& c, double t, double& dt)
typedef typename G::template Codim<0>::EntityPointer EntityPointer;
// allocate a temporary vector for the update
V update(c.size(),0.0);
V update(c.size());
for (int i=0; i<c.size(); i++) update[i] = 0;
// initialize dt very large
dt = 1E100;
......
......@@ -31,12 +31,9 @@ struct P0Layout
template<class G>
void partimeloop (const G& grid, double tend)
{
// get leaf index set type needed for mapper
typedef typename G::template Codim<0>::LeafIndexSet IS;
// make a mapper for codim 0 entities in the leaf grid
Dune::MultipleCodimMultipleGeomTypeMapper<G,IS,P0Layout>
mapper(grid,grid.leafIndexSet());
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P0Layout>
mapper(grid);
// allocate a vector for the concentration
std::vector<double> c(mapper.size());
......
......@@ -29,12 +29,9 @@ void vertexdata (const G& grid, const F& f)
typedef typename G::ctype ct;
typedef typename G::template Codim<dim>::LeafIterator VertexLeafIterator;
// get leaf index set type needed for mapper
typedef typename G::template Codim<0>::LeafIndexSet IS;
// make a mapper for codim 0 entities in the leaf grid
Dune::MultipleCodimMultipleGeomTypeMapper<G,IS,P1Layout>
mapper(grid,grid.leafIndexSet());
Dune::LeafMultipleCodimMultipleGeomTypeMapper<G,P1Layout>
mapper(grid);
// allocate a vector for the data
std::vector<double> c(mapper.size());
......@@ -47,10 +44,8 @@ void vertexdata (const G& grid, const F& f)
c[mapper.map(*it)] = f(it->geometry()[0]);
}
// initialize a P0 function with the vector, needed for VTK IO
Dune::LeafP1Function<G,double> cc(grid,c);
// generate a VTK file
Dune::LeafP1Function<G,double> cc(grid,c);
Dune::VTKWriter<G> vtkwriter(grid);
vtkwriter.addVertexData(cc,"data");
vtkwriter.write("vertexdata",Dune::VTKOptions::binaryappended);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment