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

adapted the solver to recent changes in the other moduls and removed all dune-disc functions

[[Imported from SVN: r10478]]
parent f03a550d
......@@ -9,21 +9,25 @@
#include <dune/istl/io.hh>
#include <dune/disc/operators/p1operator.hh>
#include <dune/solvers/iterationsteps/blockgsstep.hh>
#include <dune/solvers/iterationsteps/multigridstep.hh>
#include <dune/solvers/transferoperators/compressedmultigridtransfer.hh>
#include <dune/solvers/norms/energynorm.hh>
#include <dune/solvers/solvers/loopsolver.hh>
#include <dune/ag-common/sampleonbitfield.hh>
#include <dune/ag-common/prolongboundarypatch.hh>
#include <dune/ag-common/readbitfield.hh>
#include <dune-solvers/iterationsteps/blockgsstep.hh>
#include <dune-solvers/iterationsteps/multigridstep.hh>
#include <dune-solvers/transferoperators/compressedmultigridtransfer.hh>
#include <dune-solvers/solvers/loopsolver.hh>
#include <dune/ag-common/computestress.hh>
#include <dune/ag-common/neumannassembler.hh>
#include <dune-solvers/norms/energynorm.hh>
#include <dune/ag-common/estimators/hierarchicestimator.hh>
#include <dune/disc/elasticity/linearelasticityassembler.hh>
#include "dune-elasticity/viscoelasticassembler.hh"
#include <dune/ag-common/functionspacebases/p1nodalbasis.hh>
#include <dune/ag-common/assemblers/operatorassembler.hh>
#include <dune/ag-common/assemblers/localassemblers/stvenantkirchhoffassembler.hh>
#include <dune/ag-common/assemblers/localassemblers/viscosityassembler.hh>
#include <dune/ag-common/functiontools/gridfunctionadaptor.hh>
//#include <fstream>
......@@ -216,17 +220,17 @@ int main (int argc, char *argv[]) try
// Assemble neumann boundary values
if (neumannBV)
assembleAndAddNeumannTerm(neumannBoundary[grid.maxLevel()],neumannValues[grid.maxLevel()],rhs);
// Assemble elastic part of the problem
LeafP1Function<GridType,double,dim> u(grid),f(grid);
LinearElasticityLocalStiffness<GridType::LeafGridView,double> lstiff(E, nu);
LeafP1OperatorAssembler<GridType,double,dim> elasticbilinearForm(grid);
elasticbilinearForm.assemble(lstiff,u,f);
//Assemble viscous part of the problem
LinearViscosityLocalStiffness<GridType::LeafGridView,double> vstiff(nu_shear,nu_bulk);
LeafP1OperatorAssembler<GridType,double,dim> viscousbilinearForm(grid);
viscousbilinearForm.assemble(vstiff,u,f);
OperatorType elasticPart,viscousPart;
typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis;
P1Basis p1Basis(grid.leafView());
OperatorAssembler<P1Basis,P1Basis> globalAssembler(p1Basis,p1Basis);
StVenantKirchhoffAssembler<GridType, P1Basis::LocalFiniteElement, P1Basis::LocalFiniteElement> localAssembler(E, nu);
globalAssembler.assemble(localAssembler, elasticPart);
ViscosityAssembler<GridType, P1Basis::LocalFiniteElement, P1Basis::LocalFiniteElement> visLocalAssembler(nu_shear, nu_bulk);
globalAssembler.assemble(visLocalAssembler, viscousPart);
/*
//test vectors with time ,total surfacestress and total strain data
......@@ -267,9 +271,9 @@ int main (int argc, char *argv[]) try
//Quasistatic equation of the form : N*D'(t)+K*D(t)=rhs(t) N viscous_stiffness K elastic_stiffness D displacement
//Using implicit euler scheme leads to: (N+timestep*K)*D_{k+1}=N*D_{k}+timestep*rhs(t_k+1)
OperatorType lgs = (*viscousbilinearForm);
*elasticbilinearForm *= timestep;
lgs += *elasticbilinearForm;
OperatorType lgs = viscousPart;
elasticPart *= timestep;
lgs += elasticPart;
rhs *= timestep;
for (int j=1;j<=num_timesteps;j++) {
......@@ -287,8 +291,7 @@ int main (int argc, char *argv[]) try
multigridStep.ignoreNodes_ = &dirichletNodes.back();
multigridStep.basesolver_ = &baseSolver;
multigridStep.presmoother_ = &presmoother;
multigridStep.postsmoother_ = &postsmoother;
multigridStep.setSmoother(&presmoother,&postsmoother);
multigridStep.mgTransfer_.resize(grid.maxLevel());
for (int i=0; i<multigridStep.mgTransfer_.size(); i++) {
......@@ -330,7 +333,7 @@ int main (int argc, char *argv[]) try
(*viscousbilinearForm).mv(x,erhs);
viscousPart.mv(x,erhs);
v+=x;
......@@ -340,7 +343,7 @@ int main (int argc, char *argv[]) try
BlockVector<FieldVector<double,1> > stress;
std::string namestress= "resultGridstress";
namestress+=num;
Stress<GridType,dim>::getViscoelasticStress(grid, x, v, stress, E, nu, nu_bulk, nu_shear);
Stress<GridType>::getViscoelasticStress(grid, x, v, stress, E, nu, nu_bulk, nu_shear);
LeafAmiraMeshWriter<GridType>::writeBlockVector(grid, stress, resultpath + namestress);
......
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