From 0d24ea74d7a094d400383f5a24c94e4de43462c9 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 30 Sep 2014 18:14:04 +0000 Subject: [PATCH] Allow to start from a configuration given as a vtk file [[Imported from SVN: r9904]] --- cosserat-continuum.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc index a7ebf1bb..51e422d8 100644 --- a/cosserat-continuum.cc +++ b/cosserat-continuum.cc @@ -36,6 +36,7 @@ #include <dune/gfe/localgeodesicfeadolcstiffness.hh> #include <dune/gfe/cosseratenergystiffness.hh> #include <dune/gfe/cosseratvtkwriter.hh> +#include <dune/gfe/cosseratvtkreader.hh> #include <dune/gfe/geodesicfeassembler.hh> #include <dune/gfe/riemanniantrsolver.hh> @@ -208,6 +209,10 @@ int main (int argc, char *argv[]) try SolutionType x(feBasis.size()); + if (parameterSet.hasKey("startFromFile")) + { + GFE::CosseratVTKReader::read(x, parameterSet.get<std::string>("initialIterateFilename")); + } else { lambda = std::string("lambda x: (") + parameterSet.get<std::string>("initialDeformation") + std::string(")"); PythonFunction<FieldVector<double,dim>, FieldVector<double,3> > pythonInitialDeformation(Python::evaluate(lambda)); @@ -216,6 +221,7 @@ int main (int argc, char *argv[]) try for (size_t i=0; i<x.size(); i++) x[i].r = v[i]; + } //////////////////////////////////////////////////////// // Main homotopy loop -- GitLab