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

Clean up data writers; now enabled unconditionally

parent 831d3fb2
Branches
No related tags found
No related merge requests found
......@@ -266,7 +266,9 @@ int main(int argc, char *argv[]) {
mySolver(parset.sub("solver.tnnmg"), refinements, solver_tolerance, *grid,
ignoreNodes);
std::fstream octave_writer("data", std::fstream::out);
std::fstream state_writer("state", std::fstream::out);
std::fstream displacement_writer("displacement", std::fstream::out);
std::fstream velocity_writer("velocity", std::fstream::out);
std::fstream coefficient_writer("coefficient", std::fstream::out);
std::fstream velocity_stepping_writer("velocity_stepping",
std::fstream::out);
......@@ -280,10 +282,6 @@ int main(int argc, char *argv[]) {
auto const timesteps = parset.get<size_t>("timeSteps");
double const tau = 1.0 / timesteps;
octave_writer << "# name: A" << std::endl << "# type: matrix" << std::endl
<< "# rows: " << timesteps << std::endl << "# columns: 3"
<< std::endl;
velocity_stepping_writer << "# name: B" << std::endl << "# type: matrix"
<< std::endl << "# rows: " << timesteps
<< std::endl << "# columns: 2" << std::endl;
......@@ -405,16 +403,6 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("printProgress"))
std::cerr << std::endl;
// Record the state, (scaled) displacement, and Neumann
// condition at a fixed node
if (parset.get<bool>("writeEvolution")) {
double out;
neumannFunction.evaluate(time, out);
octave_writer << alpha[first_frictional_node][0] << " "
<< u[first_frictional_node][0] * 1e6 << " " << out
<< std::endl;
}
// Comparison with the analytic solution of a velocity stepping test
// with the Ruina state evolution law.
// Jumps at 120 and 360 timesteps; v1 = .6 * v2;
......@@ -440,24 +428,31 @@ int main(int argc, char *argv[]) {
}
velocity_stepping_writer << euler << " " << direct << std::endl;
}
// Record the coefficient of friction at a fixed node
if (parset.get<bool>("printCoefficient")) {
double const V = ud[first_frictional_node].two_norm();
double const state = alpha[first_frictional_node];
coefficient_writer << (mu + a * std::log(V * eta) +
b * (state - std::log(eta * L))) << std::endl;
}
}
alpha_old = alpha;
if (parset.get<bool>("printFrictionalVelocity")) {
{ // Write all kinds of data
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
state_writer << alpha[i][0] << " ";
state_writer << std::endl;
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
displacement_writer << u[i][0] << " ";
displacement_writer << std::endl;
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
velocity_writer << ud[i][0] << " ";
velocity_writer << std::endl;
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
std::cout << ud[i][0] << " ";
std::cout << std::endl;
coefficient_writer << mu + a *std::log(ud[i].two_norm() * eta) +
b * (alpha[i] - std::log(eta * L)) << " ";
coefficient_writer << std::endl;
}
// Compute von Mises stress and write everything to a file
......@@ -478,7 +473,9 @@ int main(int argc, char *argv[]) {
std::cerr << std::endl << "Making " << timesteps << " time steps took "
<< timer.elapsed() << "s" << std::endl;
octave_writer.close();
state_writer.close();
displacement_writer.close();
velocity_writer.close();
coefficient_writer.close();
velocity_stepping_writer.close();
......
......@@ -2,11 +2,8 @@
timeSteps = 1000
verbose = false
printCoefficient = false
printFrictionalVelocity = false
printProgress = false
writeEvolution = false
writeVTK = false
printVelocitySteppingComparison = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment