Commit 0a1b7cf2 authored by akbib's avatar akbib Committed by akbib
Browse files

Use BoundaryFunctionalAssembler and NeumannBoundaryAssembler to make compile again.

[[Imported from SVN: r13123]]
parent 7d4d52da
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
#include <dune/fufem/boundarypatch.hh> #include <dune/fufem/boundarypatch.hh>
#include <dune/fufem/readbitfield.hh> #include <dune/fufem/readbitfield.hh>
#include <dune/fufem/computestress.hh> #include <dune/fufem/computestress.hh>
#include <dune/fufem/neumannassembler.hh>
#include <dune/fufem/functionspacebases/p1nodalbasis.hh> #include <dune/fufem/functionspacebases/p1nodalbasis.hh>
#include <dune/fufem/assemblers/operatorassembler.hh> #include <dune/fufem/assemblers/operatorassembler.hh>
#include <dune/fufem/assemblers/boundaryfunctionalassembler.hh>
#include <dune/fufem/assemblers/localassemblers/neumannboundaryassembler.hh>
#include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh> #include <dune/fufem/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include <dune/fufem/assemblers/localassemblers/viscosityassembler.hh> #include <dune/fufem/assemblers/localassemblers/viscosityassembler.hh>
#include <dune/fufem/functiontools/gridfunctionadaptor.hh> #include <dune/fufem/functiontools/gridfunctionadaptor.hh>
...@@ -142,17 +143,16 @@ int main (int argc, char *argv[]) try ...@@ -142,17 +143,16 @@ int main (int argc, char *argv[]) try
dirichletBoundaryAll[0].setup(grid, 0, dirichletNodesAll[0]); dirichletBoundaryAll[0].setup(grid, 0, dirichletNodesAll[0]);
*/ */
std::vector<BitSetVector<dim> > neumannNodes(maxLevel+1); LevelBoundaryPatch coarseNeumannBoundary;
std::vector<LevelBoundaryPatch> neumannBoundary(maxLevel+1); VectorType coarseNeumannValues;
std::vector<VectorType> neumannValues(maxLevel+1);
//Read neumann boundary values //Read neumann boundary values
if (neumannBV) { if (neumannBV) {
neumannBoundary[0].setup(grid.levelView(0)); coarseNeumannBoundary.setup(grid.levelView(0));
readBoundaryPatch<GridType>(neumannBoundary[0], path + neumannFile); readBoundaryPatch<GridType>(coarseNeumannBoundary, path + neumannFile);
neumannValues[0].resize(grid.size(0,dim)); coarseNeumannValues.resize(grid.size(0,dim));
AmiraMeshReader<GridType>::readFunction(neumannValues[0], path + neumannValuesFile); AmiraMeshReader<GridType>::readFunction(coarseNeumannValues, path + neumannValuesFile);
} }
...@@ -191,23 +191,20 @@ int main (int argc, char *argv[]) try ...@@ -191,23 +191,20 @@ int main (int argc, char *argv[]) try
sampleOnBitField(grid, dirichletValues, dirichletNodes); sampleOnBitField(grid, dirichletValues, dirichletNodes);
//Determine Neumann dofs //Determine Neumann dofs
if(neumannBV){
BoundaryPatchProlongator<GridType>::prolong(neumannBoundary); BitSetVector<dim> neumannNodes(grid.size(dim));
VectorType neumannValues(neumannNodes.size());
BoundaryPatch<GridType::LeafGridView> neumannBoundary(grid.leafGridView());
if(neumannBV) {
BoundaryPatchProlongator<GridType>::prolong(coarseNeumannBoundary,neumannBoundary);
for (int i=0; i<=grid.maxLevel(); i++) { for (size_t j=0; j<neumannNodes.size(); j++)
neumannNodes[i].resize(grid.size(i,dim)); for (int k=0; k<dim; k++)
for (int j=0; j<grid.size(i,dim); j++) neumannNodes[j][k] = neumannBoundary.containsVertex(j);
for (int k=0; k<dim; k++)
neumannNodes[i][j][k] = neumannBoundary[i].containsVertex(j);
}
sampleOnBitField(grid, neumannValues, neumannNodes); sampleOnBitField(grid, coarseNeumannValues, neumannValues, neumannNodes);
} }
//PatchProlongator<GridType>::prolong(dirichletBoundaryAll);
//right-hand-side rhs = bodyforces + neumanboundary //right-hand-side rhs = bodyforces + neumanboundary
VectorType rhs(grid.size(dim)); VectorType rhs(grid.size(dim));
...@@ -224,10 +221,7 @@ int main (int argc, char *argv[]) try ...@@ -224,10 +221,7 @@ int main (int argc, char *argv[]) try
} }
// Assemble neumann boundary values
if (neumannBV)
assembleAndAddNeumannTerm(neumannBoundary[grid.maxLevel()],neumannValues[grid.maxLevel()],rhs);
OperatorType elasticPart,viscousPart; OperatorType elasticPart,viscousPart;
typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis; typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis;
P1Basis p1Basis(grid.leafView()); P1Basis p1Basis(grid.leafView());
...@@ -237,8 +231,14 @@ int main (int argc, char *argv[]) try ...@@ -237,8 +231,14 @@ int main (int argc, char *argv[]) try
ViscosityAssembler<GridType, P1Basis::LocalFiniteElement, P1Basis::LocalFiniteElement> visLocalAssembler(nu_shear, nu_bulk); ViscosityAssembler<GridType, P1Basis::LocalFiniteElement, P1Basis::LocalFiniteElement> visLocalAssembler(nu_shear, nu_bulk);
globalAssembler.assemble(visLocalAssembler, viscousPart); globalAssembler.assemble(visLocalAssembler, viscousPart);
if (neumannBV) {
BasisGridFunction<P1Basis,VectorType> neumannFunction(p1Basis, neumannValues);
NeumannBoundaryAssembler<GridType, Dune::FieldVector<double,dim> > neumannBoundaryAssembler(neumannFunction);
BoundaryFunctionalAssembler<P1Basis> boundaryFunctionalAssembler(p1Basis, neumannBoundary);
boundaryFunctionalAssembler.assemble(neumannBoundaryAssembler, rhs, true);
}
/* /*
//test vectors with time ,total surfacestress and total strain data //test vectors with time ,total surfacestress and total strain data
BlockVector<FieldVector<double,1> > time(num_timesteps),surfacestress(num_timesteps), strain(num_timesteps); BlockVector<FieldVector<double,1> > time(num_timesteps),surfacestress(num_timesteps), strain(num_timesteps);
......
Supports Markdown
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