Skip to content
Snippets Groups Projects
Commit 2f30c080 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Solve a bigger problem

parent f89016a9
Branches
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include "boost/format.hpp" #include "boost/format.hpp"
int const dim = 2; int const dim = 3;
template <class GridView> template <class GridView>
void setup_boundary(GridView const &gridView, void setup_boundary(GridView const &gridView,
...@@ -93,7 +93,7 @@ void assemble_neumann(GridView const &gridView, FEBasis const &feBasis, ...@@ -93,7 +93,7 @@ void assemble_neumann(GridView const &gridView, FEBasis const &feBasis,
Dune::BlockVector<LocalVectorType> & Dune::BlockVector<LocalVectorType> &
f) { // constant sample function on neumann boundary f) { // constant sample function on neumann boundary
BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes); BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes);
LocalVectorType SampleVector; LocalVectorType SampleVector(0);
// FIXME: random values // FIXME: random values
SampleVector[0] = 1; SampleVector[0] = 1;
SampleVector[1] = 2; SampleVector[1] = 2;
...@@ -135,11 +135,11 @@ int main() { ...@@ -135,11 +135,11 @@ int main() {
typedef Dune::BlockVector<SmallVector> VectorType; typedef Dune::BlockVector<SmallVector> VectorType;
// FIXME: Random values // FIXME: Random values
size_t const runs = 3; size_t const runs = 1000;
double const E = 1; double const E = 1e4;
double const nu = 0.3; double const nu = 0.3;
int const refinements = 5; int const refinements = 3;
size_t const solver_maxIterations = 100; size_t const solver_maxIterations = 10000;
double const solver_tolerance = 1e-4; double const solver_tolerance = 1e-4;
// {{{ Set up grid // {{{ Set up grid
...@@ -194,6 +194,7 @@ int main() { ...@@ -194,6 +194,7 @@ int main() {
leafView, p1Basis, frictionalNodes, nodalIntegrals); leafView, p1Basis, frictionalNodes, nodalIntegrals);
for (size_t run = 1; run <= runs; ++run) { for (size_t run = 1; run <= runs; ++run) {
std::cout << "Run: " << run << std::endl;
// b = neumann // b = neumann
assemble_neumann<GridType, GridType::LeafGridView, SmallVector, P1Basis>( assemble_neumann<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
leafView, p1Basis, neumannNodes, b); leafView, p1Basis, neumannNodes, b);
...@@ -205,7 +206,7 @@ int main() { ...@@ -205,7 +206,7 @@ int main() {
// TODO: Random value // TODO: Random value
std::vector<double> normalStress; std::vector<double> normalStress;
normalStress.resize(grid.size(grid.maxLevel(), dim)); normalStress.resize(grid.size(grid.maxLevel(), dim));
std::fill(normalStress.begin(), normalStress.end(), 2.0); std::fill(normalStress.begin(), normalStress.end(), 0.0);
// TODO: Random value // TODO: Random value
std::vector<double> coefficientOfFriction; std::vector<double> coefficientOfFriction;
...@@ -225,7 +226,7 @@ int main() { ...@@ -225,7 +226,7 @@ int main() {
LoopSolver<VectorType> solver(&nonlinearGSStep, solver_maxIterations, LoopSolver<VectorType> solver(&nonlinearGSStep, solver_maxIterations,
solver_tolerance, &energyNorm, solver_tolerance, &energyNorm,
Solver::FULL); // Solver::QUIET); Solver::QUIET); // Solver::QUIET);
solver.solve(); solver.solve();
Dune::VTKWriter<GridType::LeafGridView> writer(leafView); Dune::VTKWriter<GridType::LeafGridView> writer(leafView);
...@@ -247,7 +248,7 @@ int main() { ...@@ -247,7 +248,7 @@ int main() {
LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations, LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations,
solver_tolerance, &energyNorm, solver_tolerance, &energyNorm,
Solver::FULL); // Solver::QUIET); Solver::QUIET); // Solver::QUIET);
solver.solve(); solver.solve();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment