Skip to content
Snippets Groups Projects
Commit b5f0bcab authored by akbib's avatar akbib Committed by akbib@FU-BERLIN.DE
Browse files

adapt the solver to the new structure of the OgdenAssembler class

[[Imported from SVN: r10470]]
parent c8f6931f
Branches
No related tags found
No related merge requests found
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
#include <dune/ag-common/prolongboundarypatch.hh> #include <dune/ag-common/prolongboundarypatch.hh>
#include <dune/ag-common/sampleonbitfield.hh> #include <dune/ag-common/sampleonbitfield.hh>
#include <dune/ag-common/readbitfield.hh> #include <dune/ag-common/readbitfield.hh>
#include <dune-solvers/solvers/quadraticipopt.hh> #include <dune/ag-common/functionspacebases/p1nodalbasis.hh>
#include <dune-solvers/solvers/loopsolver.hh>
#include <dune-solvers/norms/energynorm.hh> #include <dune/solvers/solvers/quadraticipopt.hh>
#include <dune-solvers/iterationsteps/mmgstep.hh> #include <dune/solvers/solvers/loopsolver.hh>
#include <dune/solvers/norms/energynorm.hh>
#include <dune/solvers/iterationsteps/mmgstep.hh>
// Choose a solver // Choose a solver
#define IPOPT #define IPOPT
...@@ -27,7 +29,7 @@ ...@@ -27,7 +29,7 @@
//#define IPOPT_BASE //#define IPOPT_BASE
// The grid dimension // The grid dimension
const int dim = 2; const int dim = 3;
using namespace Dune; using namespace Dune;
...@@ -139,6 +141,7 @@ int main (int argc, char *argv[]) try ...@@ -139,6 +141,7 @@ int main (int argc, char *argv[]) try
VectorType rhs(grid.size(grid.maxLevel(), dim)); VectorType rhs(grid.size(grid.maxLevel(), dim));
VectorType x(grid.size(grid.maxLevel(), dim)); VectorType x(grid.size(grid.maxLevel(), dim));
VectorType corr(grid.size(grid.maxLevel(), dim)); VectorType corr(grid.size(grid.maxLevel(), dim));
OperatorType problemMatrix;
// Initial solution // Initial solution
x = 0; x = 0;
...@@ -213,9 +216,11 @@ int main (int argc, char *argv[]) try ...@@ -213,9 +216,11 @@ int main (int argc, char *argv[]) try
#else #else
#warning You have to specify a solver! #warning You have to specify a solver!
#endif #endif
typedef P1NodalBasis<GridType::LeafGridView,double> P1Basis;
typedef OgdenAssembler<P1Basis,P1Basis> Assembler;
typedef OgdenAssembler<GridType> Assembler; P1Basis p1Basis(grid.leafView());
Assembler ogdenAssembler(grid); Assembler ogdenAssembler(p1Basis,p1Basis);
for (int i=0; i<numHomotopySteps; i++) { for (int i=0; i<numHomotopySteps; i++) {
...@@ -237,7 +242,7 @@ int main (int argc, char *argv[]) try ...@@ -237,7 +242,7 @@ int main (int argc, char *argv[]) try
// Assemble the Jacobi matrix at the current solution // Assemble the Jacobi matrix at the current solution
rhs = 0; rhs = 0;
ogdenAssembler.assembleMatrix(x, rhs); ogdenAssembler.assembleProblem(problemMatrix,x, rhs);
corr = 0; corr = 0;
...@@ -247,7 +252,7 @@ int main (int argc, char *argv[]) try ...@@ -247,7 +252,7 @@ int main (int argc, char *argv[]) try
if (dirichletNodes[maxlevel][k][l]) if (dirichletNodes[maxlevel][k][l])
rhs[k][l] = 0; rhs[k][l] = 0;
solver.setProblem(*ogdenAssembler.matrix_, corr, rhs); solver.setProblem(problemMatrix, corr, rhs);
solver.preprocess(); solver.preprocess();
#ifdef MULTIGRID #ifdef MULTIGRID
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment