Browse Source

Removal of Boost progress bar

master
Trevor Irons 5 years ago
parent
commit
d06a6948a8
2 changed files with 17 additions and 18 deletions
  1. 3
    3
      include/KernelV0.h
  2. 14
    15
      src/KernelV0.cpp

+ 3
- 3
include/KernelV0.h View File

25
 #include "PolygonalWireAntenna.h"
25
 #include "PolygonalWireAntenna.h"
26
 #include "EMEarth1D.h"
26
 #include "EMEarth1D.h"
27
 
27
 
28
+#include "ProgressBar.h"
29
+
28
 #ifdef LEMMAUSEVTK
30
 #ifdef LEMMAUSEVTK
29
 //#include "vtkHyperOctree.h"
31
 //#include "vtkHyperOctree.h"
30
 //#include "vtkHyperOctreeCursor.h"
32
 //#include "vtkHyperOctreeCursor.h"
391
         std::map< int, Real >                     LeafDictErr;   // error value
393
         std::map< int, Real >                     LeafDictErr;   // error value
392
         #endif
394
         #endif
393
 
395
 
394
-        #ifdef HAVE_BOOST_PROGRESS
395
-        boost::progress_display* disp;
396
+        ProgressBar* disp;
396
         int percent_done;
397
         int percent_done;
397
-        #endif
398
 
398
 
399
         // Physical constants and conversion factors
399
         // Physical constants and conversion factors
400
         static constexpr Real GAMMA = 2.67518e8;                  // MKS units
400
         static constexpr Real GAMMA = 2.67518e8;                  // MKS units

+ 14
- 15
src/KernelV0.cpp View File

241
         //for (ilay=0; ilay<Interfaces.size()-1; ++ilay) {
241
         //for (ilay=0; ilay<Interfaces.size()-1; ++ilay) {
242
         std::cout.precision(3);
242
         std::cout.precision(3);
243
         for (ilay=0; ilay<Interfaces.size()-1; ++ilay) {
243
         for (ilay=0; ilay<Interfaces.size()-1; ++ilay) {
244
-            std::cout << "\n\nLayer " << ilay << "\tfrom " << Interfaces(ilay) <<" to "
245
-                      << Interfaces(ilay+1); // << std::endl;
244
+            //std::cout << "\n\nLayer " << ilay << "\tfrom " << Interfaces(ilay) <<" to "
245
+            //          << Interfaces(ilay+1) << std::endl;
246
             Size(2) = Interfaces(ilay+1) - Interfaces(ilay);
246
             Size(2) = Interfaces(ilay+1) - Interfaces(ilay);
247
             Origin(2) = Interfaces(ilay);
247
             Origin(2) = Interfaces(ilay);
248
 
248
 
249
-            #ifdef HAVE_BOOST_PROGRESS
249
+            //#ifdef HAVE_BOOST_PROGRESS
250
             percent_done = 0;
250
             percent_done = 0;
251
-            disp = new boost::progress_display( 100 );
251
+            disp = new ProgressBar( 100 );
252
+            disp->printNewMessage( "Integrating layer " + std::to_string(ilay) + " from " + std::to_string(Interfaces(ilay)) +
253
+                    " to " + std::to_string( Interfaces(ilay+1)) );
252
             IntegrateOnOctreeGrid( vtkOutput );
254
             IntegrateOnOctreeGrid( vtkOutput );
255
+            //disp->updateLastPrintedMessage("Number of leaves: " + std::to_string(nleaves));
256
+            disp->printNewMessage("Number of leaves: " + std::to_string(nleaves));
253
             delete disp;
257
             delete disp;
254
-            #else
255
-            IntegrateOnOctreeGrid( vtkOutput );
256
-            #endif
258
+            //#else
259
+            //IntegrateOnOctreeGrid( vtkOutput );
260
+            //#endif
257
             //std::cout << "Kernel row " << Kern.row(ilay);
261
             //std::cout << "Kernel row " << Kern.row(ilay);
258
         }
262
         }
259
         std::cout << "\nFinished KERNEL\n";
263
         std::cout << "\nFinished KERNEL\n";
555
     void KernelV0::EvaluateKids( const Vector3r& size, const int& level, const Vector3r& cpos,
559
     void KernelV0::EvaluateKids( const Vector3r& size, const int& level, const Vector3r& cpos,
556
         const VectorXcr& parentVal ) {
560
         const VectorXcr& parentVal ) {
557
 
561
 
558
-        #ifdef HAVE_BOOST_PROGRESS
559
         int pdone =  (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2]));
562
         int pdone =  (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2]));
560
         if (pdone > percent_done ) {
563
         if (pdone > percent_done ) {
561
             percent_done = pdone;
564
             percent_done = pdone;
562
             ++(*disp);
565
             ++(*disp);
563
         }
566
         }
564
-        #else
565
-        std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
566
-        #endif
567
+        //disp->updateLastPrintedMessage("Number of leaves: " + std::to_string(nleaves));
568
+        //std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
567
         //std::cout.flush();
569
         //std::cout.flush();
568
 
570
 
569
         // Next level step, interested in one level below
571
         // Next level step, interested in one level below
644
     void KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
646
     void KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
645
         const VectorXcr& parentVal, vtkHyperTreeGrid* oct, vtkHyperTreeCursor* curse) {
647
         const VectorXcr& parentVal, vtkHyperTreeGrid* oct, vtkHyperTreeCursor* curse) {
646
 
648
 
647
-        #ifdef HAVE_BOOST_PROGRESS
648
         int pdone =  (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2]));
649
         int pdone =  (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2]));
649
         if (pdone > percent_done ) {
650
         if (pdone > percent_done ) {
650
             percent_done = pdone;
651
             percent_done = pdone;
651
             ++(*disp);
652
             ++(*disp);
652
         }
653
         }
653
-        #else
654
-        std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
655
-        #endif
654
+        //disp->updateLastPrintedMessage("Number of leaves: " + std::to_string(nleaves));
656
 
655
 
657
         // Next level step, interested in one level below
656
         // Next level step, interested in one level below
658
         // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
657
         // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)

Loading…
Cancel
Save