diff --git a/src/Makefile.am b/src/Makefile.am index 7649f800aa2510de0e32509c4a3bace528975758..a428d85730ee000cca3737736d4550f3364d9464 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,8 +28,8 @@ one_body_sample_SOURCES = \ compute_state_ruina.cc \ mysolver.cc \ one-body-sample.cc \ - print.cc \ - vtk.cc + vtk.cc \ + write.cc one_body_sample_CPPFLAGS = \ $(AM_CPPFLAGS) -Dsrcdir=\"$(srcdir)\" diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 04e210dcb457922cdb62820fd688456b290f7b61..a99aeb13f37f6b377d4e348b8e6cb65c07081ecb 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -65,8 +65,8 @@ #include "compute_state.hh" #include "compute_state_ruina.hh" #include "mysolver.hh" -#include "print.hh" #include "vtk.hh" +#include "write.hh" int const dim = 2; @@ -298,8 +298,8 @@ int main(int argc, char *argv[]) { break; } - if (parset.get<bool>("printEvolution")) - print_evolution<SingletonVectorType, VectorType>( + if (parset.get<bool>("writeEvolution")) + write_evolution<SingletonVectorType, VectorType>( frictionalNodes, *s4_new, u4, functions.get("neumannCondition"), run, h * run, octave_writer); diff --git a/src/one-body-sample.parset b/src/one-body-sample.parset index fd2acefc3b24d1969a31b8c8dc50c99dc653deb4..360d23334e439f24eac25403b84e391bfcb5b0a7 100644 --- a/src/one-body-sample.parset +++ b/src/one-body-sample.parset @@ -3,10 +3,10 @@ timesteps = 600 verbose = false printCoefficient = true -printEvolution = false printFrictionalBoundary = false printProgress = false +writeEvolution = false writeVTK = true [grid] diff --git a/src/print.cc b/src/write.cc similarity index 71% rename from src/print.cc rename to src/write.cc index dcafd65b5fec51a8a3d6814866020aa7efc27b5e..593bea262ddd853d95ac1cbe584a68151cef193e 100644 --- a/src/print.cc +++ b/src/write.cc @@ -2,12 +2,10 @@ #include "config.h" #endif -#include <boost/format.hpp> - -#include "print.hh" +#include "write.hh" template <class SingletonVectorType, class VectorType> -void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, +void write_evolution(Dune::BitSetVector<1> const &frictionalNodes, SingletonVectorType const &state, VectorType const &displacement, Dune::VirtualFunction<double, double> const &function, @@ -19,12 +17,10 @@ void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, double out; function.evaluate(time, out); - std::cout << boost::format("s[%03d] = %+3e, %|20t|u[%03d] = %+3e") % run % - state[i] % run % displacement[i][0] << std::endl; octave_writer << state[i][0] << " " << displacement[i][0] * 1e6 << " " << out << std::endl; break; } } -#include "print_tmpl.cc" +#include "write_tmpl.cc" diff --git a/src/print.hh b/src/write.hh similarity index 80% rename from src/print.hh rename to src/write.hh index 79d52066569ca18f239593e10fb958b4a5cf5659..6b0d8f92aaadf092d65822dfee7b2b51f50171c8 100644 --- a/src/print.hh +++ b/src/write.hh @@ -1,11 +1,11 @@ -#ifndef PRINT_HH -#define PRINT_HH +#ifndef WRITE_HH +#define WRITE_HH #include <dune/common/function.hh> #include <dune/common/bitsetvector.hh> template <class SingletonVectorType, class VectorType> -void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, +void write_evolution(Dune::BitSetVector<1> const &frictionalNodes, SingletonVectorType const &state, VectorType const &displacement, Dune::VirtualFunction<double, double> const &function, diff --git a/src/print_tmpl.cc b/src/write_tmpl.cc similarity index 87% rename from src/print_tmpl.cc rename to src/write_tmpl.cc index ae475a813ce56d01705e68e30aeae58b9b749e6a..5727f3453bd9d37231bfcd7eb9d29fc98ed145e0 100644 --- a/src/print_tmpl.cc +++ b/src/write_tmpl.cc @@ -7,7 +7,7 @@ typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; typedef Dune::FieldVector<double, 2> SmallVector2; typedef Dune::BlockVector<SmallVector2> VectorType2; -template void print_evolution<SingletonVectorType, VectorType2>( +template void write_evolution<SingletonVectorType, VectorType2>( Dune::BitSetVector<1> const &frictionalNodes, SingletonVectorType const &state, VectorType2 const &displacement, Dune::VirtualFunction<double, double> const &function, int run, double time, @@ -18,7 +18,7 @@ template void print_evolution<SingletonVectorType, VectorType2>( typedef Dune::FieldVector<double, 3> SmallVector3; typedef Dune::BlockVector<SmallVector3> VectorType3; -template void print_evolution<SingletonVectorType, VectorType3>( +template void write_evolution<SingletonVectorType, VectorType3>( Dune::BitSetVector<1> const &frictionalNodes, SingletonVectorType const &state, VectorType3 const &displacement, Dune::VirtualFunction<double, double> const &function, int run, double time,