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
No related branches found
No related tags found
No related merge requests found
......@@ -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)\"
......
......@@ -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);
......
......@@ -3,10 +3,10 @@ timesteps = 600
verbose = false
printCoefficient = true
printEvolution = false
printFrictionalBoundary = false
printProgress = false
writeEvolution = false
writeVTK = true
[grid]
......
......@@ -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"
#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,
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment