From 9765ed501f21084f7ec4069a08984d7f85fcbb40 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Tue, 8 Nov 2011 16:35:48 +0100 Subject: [PATCH] Two-dimensional problem: * Dirichlet boundary at the top, * Neumann boundary on the left * Frictional boundary at the bottom --- src/one-body-sample.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 8fdb7c81..87916e15 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -43,7 +43,7 @@ #include <dune/tectonic/myconvexproblem.hh> #include <dune/tectonic/myblockproblem.hh> -int const dim = 3; +int const dim = 2; template <class GridView> void setup_boundary(GridView const &gridView, @@ -65,19 +65,19 @@ void setup_boundary(GridView const &gridView, Dune::GeometryType const gt = it->type(); assert(it->geometry().corners() == 1); Dune::FieldVector<double, dim> const coordinates = it->geometry().corner(0); - if (coordinates[0] == end_points[0]) { + if (coordinates[1] == end_points[0]) { ++dirichlet_nodes; size_t const id = myVertexMapper.map(*it); ignoreNodes[id] = true; } else if (coordinates[1] == 0) { - ++neumann_nodes; - size_t const id = myVertexMapper.map(*it); - neumannNodes[id] = true; - } else if (coordinates[0] == 0) { ++frictional_nodes; size_t const id = myVertexMapper.map(*it); frictionalNodes[id] = true; ignoreNodes[id][1] = true; // Zero displacement in direction y + } else if (coordinates[0] == 0) { + ++neumann_nodes; + size_t const id = myVertexMapper.map(*it); + neumannNodes[id] = true; } } std::cout << "Number of Neumann nodes: " << neumann_nodes << std::endl; @@ -135,7 +135,7 @@ int main() { // FIXME: Random values size_t const runs = 1000; - double const E = 1e4; + double const E = 5e3; double const nu = 0.3; int const refinements = 3; size_t const solver_maxIterations = 10000; @@ -207,7 +207,7 @@ int main() { // TODO: Random value std::vector<double> normalStress; normalStress.resize(grid.size(grid.maxLevel(), dim)); - std::fill(normalStress.begin(), normalStress.end(), 0.0); + std::fill(normalStress.begin(), normalStress.end(), 2.0); // TODO: Random value std::vector<double> coefficientOfFriction; -- GitLab