From 1e6afbde61beee2426684b33f0200a144014d444 Mon Sep 17 00:00:00 2001 From: podlesny <podlesny@zedat.fu-berlin.de> Date: Sun, 14 Mar 2021 17:13:07 +0100 Subject: [PATCH] set dirichlet data for dirichlet body correctly --- src/foam/foam.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/foam/foam.cc b/src/foam/foam.cc index d1048185..21dc1cec 100644 --- a/src/foam/foam.cc +++ b/src/foam/foam.cc @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) { auto const parset = getParameters(argc, argv); auto outPath = std::filesystem::current_path(); - outPath += "/output/" + parset.get<std::string>("outPath"); + outPath += "/output/" + parset.get<std::string>("general.outPath"); if (!std::filesystem::is_directory(outPath)) std::filesystem::create_directories(outPath); @@ -250,22 +250,26 @@ int main(int argc, char *argv[]) { // Assuming dPhi(v = 0) = 0, we thus only have to solve Au = ell0 BitVector totalDirichletNodes; contactNetwork.totalNodes("dirichlet", totalDirichletNodes); + + using BoundaryNodes = typename ContactNetwork::BoundaryNodes; + BoundaryNodes dirichletNodes; + contactNetwork.boundaryNodes("dirichlet", dirichletNodes); + size_t dof = 0; for (size_t i=0; i<bodyCount; i++) { const auto& body = *contactNetwork.body(i); if (body.data()->getYoungModulus() == 0.0) { - for (; dof<body.nVertices(); dof++) { + for (size_t j=0; j<body.nVertices(); j++) { totalDirichletNodes[dof] = true; + dof++; } } else { dof += body.nVertices(); } } - using BoundaryNodes = typename ContactNetwork::BoundaryNodes; - BoundaryNodes dirichletNodes; - contactNetwork.boundaryNodes("dirichlet", dirichletNodes); + std::vector<const Dune::BitSetVector<1>*> frictionNodes; contactNetwork.frictionNodes(frictionNodes); @@ -501,10 +505,17 @@ int main(int argc, char *argv[]) { print(programState.a, "current a:"); print(programState.alpha, "current alpha:");*/ + //using Vector = typename ProgramState::Vector; + /*Vector mortarV; + contactNetwork.nBodyAssembler().nodalToTransformed(programState.v, mortarV); + printRegularityTruncation(globalFriction, mortarV);*/ + contactNetwork.setDeformation(programState.u); ioHandler->write(programState, contactNetwork, globalFriction, iterationCount, false); + + if (programState.timeStep==timeSteps) { std::cout << "limit of timeSteps reached!" << std::endl; break; // TODO remove after debugging -- GitLab