Skip to content
Snippets Groups Projects
Commit e9a5d400 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Use CoarseGridFunctionWrapper to interpolate coarse to fine data

parent 38f346b4
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#include <dune/istl/io.hh>
#include <dune/fufem/functiontools/gridfunctionadaptor.hh>
#include <dune/fufem/functions/coarsegridfunctionwrapper.hh>
#include <dune/fufem/functionspacebases/p1nodalbasis.hh>
#include <dune/fufem/functionspacebases/p2nodalbasis.hh>
#include <dune/fufem/assemblers/operatorassembler.hh>
......@@ -111,6 +112,8 @@ int main (int argc, char *argv[]) try
AmiraMeshReader<GridType>::readFunction(coarseNeumannValues, path + neumannFile);
P1NodalBasis<GridType::LevelGridView> coarseBasis(grid->levelGridView(0));
auto coarseDir = Functions::makeFunction(coarseBasis,coarseDirichletValues);
auto coarseNeumann = Functions::makeFunction(coarseBasis,coarseNeumannValues);
for (int i=0; i<minLevel; i++)
grid->globalRefine(1);
......@@ -142,9 +145,12 @@ int main (int argc, char *argv[]) try
dirichletNodes[i][j]=true;
VectorType dirichletValues, neumannValues;
Functions::interpolate(p1NodalBasis, dirichletValues, Functions::makeFunction(coarseBasis,coarseDirichletValues));
Functions::interpolate(p1NodalBasis, neumannValues, Functions::makeFunction(coarseBasis,coarseNeumannValues));
CoarseGridFunctionWrapper<BasisGridFunction<P1NodalBasis<GridType::LevelGridView>, VectorType> > wrappedDir(coarseDir);
Functions::interpolate(p1NodalBasis, dirichletValues, wrappedDir);
CoarseGridFunctionWrapper<BasisGridFunction<P1NodalBasis<GridType::LevelGridView>, VectorType> > wrappedNeu(coarseNeumann);
Functions::interpolate(p1NodalBasis, neumannValues, wrappedNeu);
VectorType rhs(grid->size(dim));
rhs = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment