66#include < chrono/physics/ChBodyEasy.h>
77#include < chrono/physics/ChSystemNSC.h>
88
9+ #include " chrono_postprocess/ChGnuPlot.h"
10+
911#include < chrono> // std::chrono::high_resolution_clock::now
1012#include < iomanip> // std::setprecision
1113#include < vector> // std::vector<double>
@@ -65,7 +67,7 @@ int main(int argc, char* argv[]) {
6567 int reg_wave_num_max = periods.size ();
6668
6769 for (int reg_wave_num = 1 ; reg_wave_num <= reg_wave_num_max; ++reg_wave_num) {
68- std::cout << " Chrono version : " << CHRONO_VERSION << " \n\n " ;
70+ std::cout << " Wave number : " << reg_wave_num << " of " << reg_wave_num_max << std::endl ;
6971
7072 // Parse CLI arguments and initialize environment
7173 bool profilingOn = true ;
@@ -124,7 +126,7 @@ int main(int argc, char* argv[]) {
124126 // << std::endl;
125127
126128 // set up body from a mesh
127- std::cout << " Attempting to open mesh file: " << body1_meshfname << std::endl;
129+ std::cout << " Attempting to open mesh file: " << body1_meshfname << std::endl;
128130 std::shared_ptr<ChBody> flap_body = chrono_types::make_shared<ChBodyEasyMesh>( //
129131 body1_meshfname,
130132 1000 , // density
@@ -150,7 +152,7 @@ int main(int argc, char* argv[]) {
150152 // notes: mass and inertia added to added mass and system mass correctly.
151153
152154 // set up body from a mesh
153- std::cout << " Attempting to open mesh file: " << body2_meshfname << std::endl;
155+ std::cout << " Attempting to open mesh file: " << body2_meshfname << std::endl;
154156 std::shared_ptr<ChBody> base_body = chrono_types::make_shared<ChBodyEasyMesh>( //
155157 body2_meshfname,
156158 1000 , // density
@@ -271,6 +273,17 @@ int main(int argc, char* argv[]) {
271273 return 1 ; // Return an error code
272274 }
273275 }
276+
277+ if (plotOn) {
278+ postprocess::ChGnuPlot gplot (out_dir + " /owsec_reg_waves_" + std::to_string (reg_wave_num) + " .gpl" );
279+ gplot.SetCanvasSize (1000 , 600 );
280+ gplot.SetGrid ();
281+ gplot.SetLabelX (" time (s)" );
282+ gplot.SetLabelY (" pitch (rad)" );
283+ gplot.SetRangeX (0 , simulationDuration);
284+ gplot.SetTitle (" OSWEC reg waves " + std::to_string (reg_wave_num));
285+ gplot.Plot (time_vector, flap_rot, " " , " with lines lt rgb '#FF5500' lw 2" );
286+ }
274287 }
275288
276289 return 0 ;
0 commit comments