<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Instationary Navier-Stokes equations with Finite Volume method : Getting the velocity components at the center of the faces</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
I wrote my own Local Operator to achieve a finite volume method on the instasionary Navier-Stokes equations.<BR>
I also coded the associated Local Functions (localBasis, localcoefficients and LocalInterpolation) to have a proper finite element map.<BR>
<BR>
The problem is I DON'T want to get my velocity components on the vertices BUT on the center of the faces of my cells.<BR>
<BR>
To do so, I tried to start form the cgstokes case in which the addVertexData is used.<BR>
<BR>
I looked into the VTKWriter.hh file but couldn't find out how to change the position where to get my data (from vertex to center of face)...<BR>
<BR>
In my LocalInterpolation.hh file, I use the following function :<BR>
<BR>
template<typename F, typename C><BR>
      void interpolate (const F& f, std::vector<C>& out) const {<BR>
        typename LB::Traits::DomainType x;<BR>
        typename LB::Traits::RangeType y;<BR>
<BR>
        out.resize(4);<BR>
        x[0] = 0.5; x[1] = 0.0; f.evaluate(x,y); out[0] = y; // out[] should be 1 or 2<BR>
        x[0] = 0.0; x[1] = 0.5; f.evaluate(x,y); out[1] = y;<BR>
        x[0] = 1.0; x[1] = 1.0; f.evaluate(x,y); out[2] = y;<BR>
        x[0] = 0.5; x[1] = 1.0; f.evaluate(x,y); out[3] = y;<BR>
      }<BR>
<BR>
<BR>
In my Main, I have the following lines :<BR>
<BR>
 //////////////////////////////////////////////////////////<BR>
  // Initial guess<BR>
  Dune::PDELab::FilenameHelper fn(filename); //output file name<BR>
  {<BR>
    // Generate functions suitable for VTK output<BR>
    typedef Dune::PDELab::VectorDiscreteGridFunction<VelocitySubGFS,V> VDGF;<BR>
    VDGF vdgf(velocitySubGfs,x0);<BR>
    typedef Dune::PDELab::DiscreteGridFunction<PressureSubGFS,V> PDGF;<BR>
    PDGF pdgf(pressureSubGfs,x0);<BR>
<BR>
    // Output grid function with SubsamplingVTKWriter<BR>
    Dune::SubsamplingVTKWriter<GV> vtkwriter(gv,2);<BR>
    vtkwriter.addCellData(new Dune::PDELab::VTKGridFunctionAdapter<PDGF>(pdgf,"p")); // get pressure<BR>
    vtkwriter.addVertexData(new Dune::PDELab::VTKGridFunctionAdapter<VDGF>(vdgf,"v")); // get velocity<BR>
    vtkwriter.write(fn.getName(),Dune::VTK::ascii);//appendedraw); // write ouput file<BR>
    std::cout << "VTK output file was written: " << fn.getName() << ".vtu" << std::endl;<BR>
    fn.increment(); // increment output file name<BR>
  }<BR>
<BR>
Thx for your help !<BR>
<BR>
Samuel<BR>
</FONT>
</P>

</BODY>
</HTML>