From de8b6c2030d9e53d6f13ff55f30a01553a5152c3 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Sun, 27 Apr 2014 23:06:39 +0100
Subject: [PATCH] subCycleTime: added access to cycle index

---
 src/OpenFOAM/db/Time/subCycleTime.H | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/OpenFOAM/db/Time/subCycleTime.H b/src/OpenFOAM/db/Time/subCycleTime.H
index 594ee56ea6c..9bec0326f68 100644
--- a/src/OpenFOAM/db/Time/subCycleTime.H
+++ b/src/OpenFOAM/db/Time/subCycleTime.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -75,6 +75,18 @@ public:
         //- End the sub-cycling and reset the time-state
         void endSubCycle();
 
+        //- Return the total number of sub-cycles
+        label nSubCycles() const
+        {
+            return nSubCycles_;
+        }
+
+        //- Return the current sub-cycle index
+        label index() const
+        {
+            return subCycleIndex_;
+        }
+
 
     // Member operators
 
-- 
GitLab