Skip to content

Commit

Permalink
header correction in energy csv file
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricix committed Sep 26, 2024
1 parent 1042dd2 commit a548445
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ namespace Output{
void updateTerminal(vector<Body*>* bodies, double itime)
{
std::cout <<"Time: "<< std::setw(8) << std::scientific << std::setprecision(4) << itime << " s, ";
std::cout <<"Energy: "<< std::setw(8) << std::scientific << std::setprecision(4) << DynamicRelaxation::computeKineticEnergy(bodies) << " J, ";
std::cout <<"Energy: "<< std::setw(8) << std::scientific << std::setprecision(4) << DynamicRelaxation::computeKineticEnergy(bodies) << " J - ";
std::cout << std::setw(1) << std::fixed << std::setprecision(0) <<"(" << int(100 * itime / ModelSetup::getTime()) << "%) \n";
}

Expand Down Expand Up @@ -607,7 +607,10 @@ namespace Output{
}

// Write time and energy to the file
csv_file << iTime << "," << ienergy << "\n";
if(iTime==0)
csv_file << "time,energy" << "\n";

csv_file << iTime << "," << ienergy << "\n";

// Close the file
csv_file.close();
Expand Down
2 changes: 1 addition & 1 deletion src/Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void Update::setPlaneMomentum(const Boundary::planeBoundary* plane, vector<Node*
nodeI->setMomentum(Vector3d::Zero());
break;

// perpendicular restriction
// sliding restriction
case Boundary::BoundaryType::SLIDING:

// get current boundary nodal momentum
Expand Down

0 comments on commit a548445

Please sign in to comment.