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

Do not print the state evolution; write it

parent b37233fb
Branches
No related tags found
No related merge requests found
...@@ -28,8 +28,8 @@ one_body_sample_SOURCES = \ ...@@ -28,8 +28,8 @@ one_body_sample_SOURCES = \
compute_state_ruina.cc \ compute_state_ruina.cc \
mysolver.cc \ mysolver.cc \
one-body-sample.cc \ one-body-sample.cc \
print.cc \ vtk.cc \
vtk.cc write.cc
one_body_sample_CPPFLAGS = \ one_body_sample_CPPFLAGS = \
$(AM_CPPFLAGS) -Dsrcdir=\"$(srcdir)\" $(AM_CPPFLAGS) -Dsrcdir=\"$(srcdir)\"
......
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
#include "compute_state.hh" #include "compute_state.hh"
#include "compute_state_ruina.hh" #include "compute_state_ruina.hh"
#include "mysolver.hh" #include "mysolver.hh"
#include "print.hh"
#include "vtk.hh" #include "vtk.hh"
#include "write.hh"
int const dim = 2; int const dim = 2;
...@@ -298,8 +298,8 @@ int main(int argc, char *argv[]) { ...@@ -298,8 +298,8 @@ int main(int argc, char *argv[]) {
break; break;
} }
if (parset.get<bool>("printEvolution")) if (parset.get<bool>("writeEvolution"))
print_evolution<SingletonVectorType, VectorType>( write_evolution<SingletonVectorType, VectorType>(
frictionalNodes, *s4_new, u4, functions.get("neumannCondition"), frictionalNodes, *s4_new, u4, functions.get("neumannCondition"),
run, h * run, octave_writer); run, h * run, octave_writer);
......
...@@ -3,10 +3,10 @@ timesteps = 600 ...@@ -3,10 +3,10 @@ timesteps = 600
verbose = false verbose = false
printCoefficient = true printCoefficient = true
printEvolution = false
printFrictionalBoundary = false printFrictionalBoundary = false
printProgress = false printProgress = false
writeEvolution = false
writeVTK = true writeVTK = true
[grid] [grid]
......
...@@ -2,12 +2,10 @@ ...@@ -2,12 +2,10 @@
#include "config.h" #include "config.h"
#endif #endif
#include <boost/format.hpp> #include "write.hh"
#include "print.hh"
template <class SingletonVectorType, class VectorType> template <class SingletonVectorType, class VectorType>
void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, void write_evolution(Dune::BitSetVector<1> const &frictionalNodes,
SingletonVectorType const &state, SingletonVectorType const &state,
VectorType const &displacement, VectorType const &displacement,
Dune::VirtualFunction<double, double> const &function, Dune::VirtualFunction<double, double> const &function,
...@@ -19,12 +17,10 @@ void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, ...@@ -19,12 +17,10 @@ void print_evolution(Dune::BitSetVector<1> const &frictionalNodes,
double out; double out;
function.evaluate(time, 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 << " " octave_writer << state[i][0] << " " << displacement[i][0] * 1e6 << " "
<< out << std::endl; << out << std::endl;
break; break;
} }
} }
#include "print_tmpl.cc" #include "write_tmpl.cc"
#ifndef PRINT_HH #ifndef WRITE_HH
#define PRINT_HH #define WRITE_HH
#include <dune/common/function.hh> #include <dune/common/function.hh>
#include <dune/common/bitsetvector.hh> #include <dune/common/bitsetvector.hh>
template <class SingletonVectorType, class VectorType> template <class SingletonVectorType, class VectorType>
void print_evolution(Dune::BitSetVector<1> const &frictionalNodes, void write_evolution(Dune::BitSetVector<1> const &frictionalNodes,
SingletonVectorType const &state, SingletonVectorType const &state,
VectorType const &displacement, VectorType const &displacement,
Dune::VirtualFunction<double, double> const &function, Dune::VirtualFunction<double, double> const &function,
......
...@@ -7,7 +7,7 @@ typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; ...@@ -7,7 +7,7 @@ typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType;
typedef Dune::FieldVector<double, 2> SmallVector2; typedef Dune::FieldVector<double, 2> SmallVector2;
typedef Dune::BlockVector<SmallVector2> VectorType2; typedef Dune::BlockVector<SmallVector2> VectorType2;
template void print_evolution<SingletonVectorType, VectorType2>( template void write_evolution<SingletonVectorType, VectorType2>(
Dune::BitSetVector<1> const &frictionalNodes, Dune::BitSetVector<1> const &frictionalNodes,
SingletonVectorType const &state, VectorType2 const &displacement, SingletonVectorType const &state, VectorType2 const &displacement,
Dune::VirtualFunction<double, double> const &function, int run, double time, Dune::VirtualFunction<double, double> const &function, int run, double time,
...@@ -18,7 +18,7 @@ template void print_evolution<SingletonVectorType, VectorType2>( ...@@ -18,7 +18,7 @@ template void print_evolution<SingletonVectorType, VectorType2>(
typedef Dune::FieldVector<double, 3> SmallVector3; typedef Dune::FieldVector<double, 3> SmallVector3;
typedef Dune::BlockVector<SmallVector3> VectorType3; typedef Dune::BlockVector<SmallVector3> VectorType3;
template void print_evolution<SingletonVectorType, VectorType3>( template void write_evolution<SingletonVectorType, VectorType3>(
Dune::BitSetVector<1> const &frictionalNodes, Dune::BitSetVector<1> const &frictionalNodes,
SingletonVectorType const &state, VectorType3 const &displacement, SingletonVectorType const &state, VectorType3 const &displacement,
Dune::VirtualFunction<double, double> const &function, int run, double time, Dune::VirtualFunction<double, double> const &function, int run, double time,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment