From 1e1e5777ff94589718809fdb04daedc8c88ea938 Mon Sep 17 00:00:00 2001
From: Klaus <klaus.boehnlein@tu-dresden.de>
Date: Tue, 10 Oct 2023 15:54:08 +0200
Subject: [PATCH] Add more Timers

---
 dune/microstructure/CorrectorComputer.hh           | 5 +++--
 dune/microstructure/EffectiveQuantitiesComputer.hh | 5 ++---
 src/Cell-Problem.cc                                | 5 +++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dune/microstructure/CorrectorComputer.hh b/dune/microstructure/CorrectorComputer.hh
index 20c824c7..c775f51e 100644
--- a/dune/microstructure/CorrectorComputer.hh
+++ b/dune/microstructure/CorrectorComputer.hh
@@ -941,7 +941,6 @@ public:
   // --- Solving the Corrector-problem:
   auto solve()
   {
-      std::cout << "start corrector solver..." << std::endl;
       bool set_oneBasisFunction_Zero = parameterSet_.get<bool>("set_oneBasisFunction_Zero", false);
       bool substract_integralMean = false;
       if(parameterSet_.get<bool>("set_IntegralZero", false))
@@ -977,6 +976,7 @@ public:
       x_2_ = load_alpha2_;
       x_3_ = load_alpha3_;
 
+      std::cout << "start corrector solver..." << std::endl;
       Dune::Timer SolverTimer;
       if (Solvertype==1)  // CG - SOLVER
       {
@@ -1334,6 +1334,7 @@ public:
   // --- Check Orthogonality relation Paper (75)
   auto check_Orthogonality()
   {
+    Dune::Timer orthogonalityTimer;
     std::cout << "Check Orthogonality..." << std::endl;
 
     auto localView = basis_.localView();
@@ -1436,11 +1437,11 @@ public:
         std::cout << "WARNING: check_Orthogonality failed! apparently  orthogonality (75) not satisfied on discrete level" << std::endl;
 
     }
+    std::cout << "Time required for orthogonality check: " << orthogonalityTimer.elapsed() << std::endl;
     return 0;
   }
 
 
-
   // --- Check whether stiffness matrix is symmetric
   void checkSymmetry()
   {
diff --git a/dune/microstructure/EffectiveQuantitiesComputer.hh b/dune/microstructure/EffectiveQuantitiesComputer.hh
index c6e358d4..4deae7b2 100644
--- a/dune/microstructure/EffectiveQuantitiesComputer.hh
+++ b/dune/microstructure/EffectiveQuantitiesComputer.hh
@@ -58,8 +58,6 @@ public:
     { 
 
         // prestrain_ = material_.getPrestrainFunction();
-        
-
     } 
 
 
@@ -76,8 +74,8 @@ public:
   // --- Compute Effective Quantities
     void computeEffectiveQuantities()
     {
-
         std::cout << "starting effective quantities computation..." << std::endl;
+        Dune::Timer effectiveQuantitiesTimer;
 
         // Get everything.. better TODO: with Inheritance?
         // auto test = correctorComputer_.getLoad_alpha1();
@@ -232,6 +230,7 @@ public:
 
         //   TEST
         //   std::cout << std::setprecision(std::numeric_limits<float_50>::digits10) << higherPrecEnergy << std::endl;
+        std::cout << "Time required to solve for effective quantities: " << effectiveQuantitiesTimer.elapsed() << std::endl;
         return ;
     }
 
diff --git a/src/Cell-Problem.cc b/src/Cell-Problem.cc
index f2897022..170c46a7 100644
--- a/src/Cell-Problem.cc
+++ b/src/Cell-Problem.cc
@@ -280,9 +280,7 @@ int main(int argc, char *argv[])
 
     //--- write material indicator function to VTK
     if (parameterSet.get<bool>("write_materialFunctions", false))
-    {
         material.writeVTKMaterialFunctions(level);
-    }
 
     //--- TEST:: Compute Qeff without using the orthogonality (75)... 
     // only really makes a difference whenever the orthogonality is not satisfied!
@@ -295,6 +293,9 @@ int main(int argc, char *argv[])
     printmatrix(std::cout, Qeff, "Matrix Qeff", "--");
     printvector(std::cout, Beff, "Beff", "--");
 
+
+
+
     //--- write effective quantities to matlab folder (for symbolic minimization)
     if(parameterSet.get<bool>("write_toMATLAB", false))
         effectiveQuantitiesComputer.writeToMatlab(outputPath);
-- 
GitLab