Commit 80f41a22 authored by akbib's avatar akbib Committed by akbib@FU-BERLIN.DE
Browse files

adapt to changes in boundarypatch

[[Imported from SVN: r10689]]
parent 54451a08
......@@ -15,7 +15,7 @@
#include <dune/fufem/assemblers/operatorassembler.hh>
#include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include <dune/fufem/sampleonbitfield.hh>
#include <dune/fufem/prolongboundarypatch.hh>
#include <dune/fufem/boundarypatchprolongator.hh>
#include <dune/fufem/readbitfield.hh>
#include <dune/fufem/estimators/fractionalmarking.hh>
#include <dune/fufem/estimators/hierarchicalestimator.hh>
......@@ -75,7 +75,10 @@ int main (int argc, char *argv[]) try
// Generate the grid
// /////////////////////////////
typedef UGGrid<dim> GridType;
GridType grid;
typedef BoundaryPatch<GridType::LevelGridView> LevelBoundaryPatch;
typedef BoundaryPatch<GridType::LeafGridView> LeafBoundaryPatch;
GridType grid;
grid.setRefinementType(GridType::COPY);
if (paramBoundaries)
......@@ -86,13 +89,13 @@ int main (int argc, char *argv[]) try
// Read Dirichlet boundary values
std::vector<BitSetVector<dim> > dirichletNodes(maxLevel+1);
std::vector<LevelBoundaryPatch<GridType> > dirichletBoundary(maxLevel+1);
dirichletBoundary[0].setup(grid, 0);
readBoundaryPatch(dirichletBoundary[0], path + dirichletFile);
std::vector<LevelBoundaryPatch> dirichletBoundary(maxLevel+1);
dirichletBoundary[0].setup(grid.levelView(0));
readBoundaryPatch<GridType>(dirichletBoundary[0], path + dirichletFile);
std::vector<VectorType> dirichletValues(maxLevel+1);
dirichletValues[0].resize(grid.size(0, dim));
AmiraMeshReader<int>::readFunction(dirichletValues[0], path + dirichletValuesFile);
AmiraMeshReader<GridType>::readFunction(dirichletValues[0], path + dirichletValuesFile);
for (int i=0; i<minLevel; i++)
grid.globalRefine(1);
......@@ -110,9 +113,9 @@ int main (int argc, char *argv[]) try
while (true) {
// Determine Dirichlet dofs
PatchProlongator<GridType>::prolong(dirichletBoundary);
LeafBoundaryPatch<GridType> leafDirichletBoundary(grid);
PatchProlongator<GridType>::prolong(dirichletBoundary[0], leafDirichletBoundary);
BoundaryPatchProlongator<GridType>::prolong(dirichletBoundary);
LeafBoundaryPatch leafDirichletBoundary(grid.leafView());
BoundaryPatchProlongator<GridType>::prolong(dirichletBoundary[0], leafDirichletBoundary);
for (int i=0; i<=grid.maxLevel(); i++) {
......
......@@ -11,7 +11,7 @@
#include <dune/istl/io.hh>
#include <dune/fufem/prolongboundarypatch.hh>
#include <dune/fufem/boundarypatchprolongator.hh>
#include <dune/fufem/sampleonbitfield.hh>
#include <dune/fufem/readbitfield.hh>
#include <dune/fufem/functionspacebases/p1nodalbasis.hh>
......@@ -65,25 +65,27 @@ int main (int argc, char *argv[]) try
// Generate the grid
// /////////////////////////////
typedef UGGrid<dim> GridType;
typedef BoundaryPatch<GridType::LevelGridView> LevelBoundaryPatch;
GridType grid;
Dune::AmiraMeshReader<GridType>::read(grid, gridFile);
// Read Dirichlet boundary values
std::vector<LevelBoundaryPatch<GridType> > dirichletBoundary(numLevels);
dirichletBoundary[0].setup(grid,0);
readBoundaryPatch(dirichletBoundary[0], dnFile);
std::vector<LevelBoundaryPatch> dirichletBoundary(numLevels);
dirichletBoundary[0].setup(grid.levelView(0));
readBoundaryPatch<GridType>(dirichletBoundary[0], dnFile);
std::vector<VectorType> dirichletValues(numLevels);
dirichletValues[0].resize(grid.size(0, dim));
AmiraMeshReader<int>::readFunction(dirichletValues[0], dvFile);
AmiraMeshReader<GridType>::readFunction(dirichletValues[0], dvFile);
dirichletValues[0] *= scaling;
for (int i=0; i<numLevels-1; i++)
grid.globalRefine(1);
PatchProlongator<GridType>::prolong(dirichletBoundary);
BoundaryPatchProlongator<GridType>::prolong(dirichletBoundary);
std::vector<BitSetVector<dim> > dirichletNodes(numLevels);
for (int i=0; i<numLevels; i++) {
......
......@@ -16,7 +16,8 @@
#include <dune/solvers/solvers/loopsolver.hh>
#include <dune/fufem/sampleonbitfield.hh>
#include <dune/fufem/prolongboundarypatch.hh>
#include <dune/fufem/boundarypatchprolongator.hh>
#include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/readbitfield.hh>
#include <dune/fufem/computestress.hh>
#include <dune/fufem/neumannassembler.hh>
......@@ -102,7 +103,9 @@ int main (int argc, char *argv[]) try
// /////////////////////////////
typedef UGGrid<dim> GridType;
typedef BoundaryPatch<GridType::LevelGridView> LevelBoundaryPatch;
typedef BoundaryPatch<GridType::LeafGridView> LeafBoundaryPatch;
GridType grid;
grid.setRefinementType(GridType::COPY);
......@@ -117,13 +120,13 @@ int main (int argc, char *argv[]) try
// Read Dirichlet boundary values
std::vector<BitSetVector<dim> > dirichletNodes(maxLevel+1);
std::vector<LevelBoundaryPatch<GridType> > dirichletBoundary(maxLevel+1);
dirichletBoundary[0].setup(grid, 0);
readBoundaryPatch(dirichletBoundary[0], path + dirichletFile);
std::vector<LevelBoundaryPatch> dirichletBoundary(maxLevel+1);
dirichletBoundary[0].setup(grid.levelView(0));
readBoundaryPatch<GridType>(dirichletBoundary[0], path + dirichletFile);
std::vector<VectorType> dirichletValues(maxLevel+1);
dirichletValues[0].resize(grid.size(0, dim));
AmiraMeshReader<int>::readFunction(dirichletValues[0], path + dirichletValuesFile);
AmiraMeshReader<GridType>::readFunction(dirichletValues[0], path + dirichletValuesFile);
/*
//Create boundary patch for whole boundary (only needed for computation of surface stress on the whole boundary)
......@@ -136,16 +139,16 @@ int main (int argc, char *argv[]) try
*/
std::vector<BitSetVector<dim> > neumannNodes(maxLevel+1);
std::vector<LevelBoundaryPatch<GridType> > neumannBoundary(maxLevel+1);
std::vector<LevelBoundaryPatch> neumannBoundary(maxLevel+1);
std::vector<VectorType> neumannValues(maxLevel+1);
//Read neumann boundary values
if (neumannBV) {
neumannBoundary[0].setup(grid, 0);
readBoundaryPatch(neumannBoundary[0], path + neumannFile);
neumannBoundary[0].setup(grid.levelView(0));
readBoundaryPatch<GridType>(neumannBoundary[0], path + neumannFile);
neumannValues[0].resize(grid.size(0,dim));
AmiraMeshReader<int>::readFunction(neumannValues[0], path + neumannValuesFile);
AmiraMeshReader<GridType>::readFunction(neumannValues[0], path + neumannValuesFile);
}
......@@ -171,7 +174,7 @@ int main (int argc, char *argv[]) try
// Determine Dirichlet dofs
PatchProlongator<GridType>::prolong(dirichletBoundary);
BoundaryPatchProlongator<GridType>::prolong(dirichletBoundary);
for (int i=0; i<=grid.maxLevel(); i++) {
......@@ -185,7 +188,7 @@ int main (int argc, char *argv[]) try
//Determine Neumann dofs
if(neumannBV){
PatchProlongator<GridType>::prolong(neumannBoundary);
BoundaryPatchProlongator<GridType>::prolong(neumannBoundary);
for (int i=0; i<=grid.maxLevel(); i++) {
neumannNodes[i].resize(grid.size(i,dim));
......
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