Skip to content
Snippets Groups Projects
Commit f6bae5d2 authored by Youett, Jonathan's avatar Youett, Jonathan Committed by akbib@FU-BERLIN.DE
Browse files

make writer scale with rod radius

[[Imported from SVN: r7856]]
parent c5788af4
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
#include <ctime>
#include <dune/common/exceptions.hh>
#include <dune/common/fvector.hh>
#include <dune/istl/bvector.hh>
#include <dune/solvers/common/numproc.hh>
......@@ -124,7 +125,8 @@ void writeRod(const std::vector<RigidBodyMotion<2> >& rod,
/** \brief Write a spatial rod
*/
void writeRod(const std::vector<RigidBodyMotion<3> >& rod,
const std::string& filename)
const std::string& filename,
double radius = 1.0)
{
int nPoints = rod.size();
......@@ -169,20 +171,24 @@ void writeRod(const std::vector<RigidBodyMotion<3> >& rod,
// ///////////////////////////////////////
outfile << std::endl << "@2" << std::endl;
for (size_t i=0; i<rod.size(); i++)
outfile << rod[i].q.director(0) << std::endl;
for (size_t i=0; i<rod.size(); i++) {
Dune::FieldVector<double,3> dir = rod[i].q.director(0);
dir *= radius;
outfile << dir << std::endl;
}
outfile << std::endl << "@3" << std::endl;
for (size_t i=0; i<rod.size(); i++)
outfile << rod[i].q.director(1) << std::endl;
for (size_t i=0; i<rod.size(); i++) {
Dune::FieldVector<double,3> dir = rod[i].q.director(1);
dir *= radius;
outfile << dir << std::endl;
}
std::cout << "Result written successfully to: " << filename << std::endl;
}
/** \brief Write a spatial rod along with a strain or stress field
*/
void writeRodElementData(Dune::BlockVector<Dune::FieldVector<double, 1> >& data,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment