Commit 001970cb authored by Peter Bastian's avatar Peter Bastian

corrected computation of normal times face volume.

checked shock speed in 2D and 3D for simplices.

[[Imported from SVN: r34]]
parent 7b48e1ed
......@@ -1346,8 +1346,8 @@ The data vector is allocated in line 35. Here we use a
mapper returns the number of entities in the set $E^\prime$. Instead
of the STL vector one can use any other type with an
\lstinline!operator[]!, even built-in arrays (however, built-in arrays
will not work in this example because the constructor of
\lstinline!Dune::LeafP0Function! below requires a container with a
will not work in this example because the VTK output
below requires a container with a
\lstinline!size()! method.
Now the loop in lines 38-53 iterates through all leaf elements. The
......
......@@ -64,9 +64,9 @@ void evolve (const G& grid, const M& mapper, V& c, double t, double& dt)
const Dune::FieldVector<ct,dim-1>&
facelocal = Dune::ReferenceElements<ct,dim-1>::general(gtf).position(0,0);
// get normal vector scaled with integration element
Dune::FieldVector<ct,dimworld>
integrationOuterNormal = is.integrationOuterNormal(facelocal);
// get normal vector scaled with volume
Dune::FieldVector<ct,dimworld> integrationOuterNormal = is.integrationOuterNormal(facelocal);
integrationOuterNormal *= Dune::ReferenceElements<ct,dim-1>::general(gtf).volume();
// center of face in global coordinates
Dune::FieldVector<ct,dimworld>
......
......@@ -7,7 +7,7 @@
#include "dune/grid/common/mcmgmapper.hh" // mapper class
#include "unitcube.hh"
#include "transportproblem.hh"
#include "transportproblem2.hh"
#include "initialize.hh"
#include "evolve.hh"
#include "vtkout.hh"
......@@ -66,8 +66,17 @@ int main (int argc , char ** argv)
#endif
UnitCube<Dune::YaspGrid<2,2>,1> uc;
uc.grid().globalRefine(9);
timeloop(uc.grid(),0.5);
#if HAVE_UG
UnitCube<Dune::UGGrid<3,3>,2> uc2;
#endif
#if HAVE_ALBERTA
#if DUNE_PROBLEM_DIM==2
UnitCube<Dune::AlbertaGrid<2,2>,1> uc3;
#endif
#endif
uc2.grid().globalRefine(4);
timeloop(uc2.grid(),0.5);
#if HAVE_MPI
MPI_Finalize();
......
......@@ -69,9 +69,9 @@ void parevolve (const G& grid, const M& mapper, V& c, double t, double& dt)
const Dune::FieldVector<ct,dim-1>&
facelocal = Dune::ReferenceElements<ct,dim-1>::general(gtf).position(0,0);
// get normal vector scaled with integration element
Dune::FieldVector<ct,dimworld>
integrationOuterNormal = is.integrationOuterNormal(facelocal);
// get normal vector scaled with volume
Dune::FieldVector<ct,dimworld> integrationOuterNormal = is.integrationOuterNormal(facelocal);
integrationOuterNormal *= Dune::ReferenceElements<ct,dim-1>::general(gtf).volume();
// center of face in global coordinates
Dune::FieldVector<ct,dimworld>
......
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