/// <summary> /// Saves the internal state of <see cref="m_OldTracker"/>. /// </summary> public void BackupTracker() { using (new FuncTrace()) { if (m_LsTrkPrivData != null) { throw new NotSupportedException("Can only be called once."); } m_LsTrkPrivData = new LevelSetTrackerPrivateData(); int NoOfLS = m_OldTracker.NoOfLevelSets; if (m_OldTracker != null) { m_LsTrkPrivData.HistoryLength = m_OldTracker.HistoryLength; m_LsTrkPrivData.PopultatedHistoryLength = m_OldTracker.PopulatedHistoryLength; m_LsTrkPrivData.Versions = new int[m_LsTrkPrivData.PopultatedHistoryLength + 1]; m_LsTrkPrivData.Times = new double[m_LsTrkPrivData.PopultatedHistoryLength + 1]; for (int iH = 1; iH > -m_LsTrkPrivData.PopultatedHistoryLength; iH--) { var TimeLevel = m_OldTracker.BackupTimeLevel(iH); for (int iLs = 0; iLs < NoOfLS; iLs++) { this.BackupField(TimeLevel.LevelSets[iLs], GetLSbackupName(iH, iLs)); } this.BackupVector(TimeLevel.Regions, GetLSregioncodeName(iH)); m_LsTrkPrivData.Versions[1 - iH] = TimeLevel.Version; m_LsTrkPrivData.Times[1 - iH] = TimeLevel.time; } } } }
/// <summary> /// Saves the internal state of <see cref="m_OldTracker"/>. /// </summary> public void BackupTracker() { using (new FuncTrace()) { if (m_LsTrkPrivData != null) { throw new NotSupportedException("Can only be called once."); } m_LsTrkPrivData = new LevelSetTrackerPrivateData(); int NoOfLS = m_OldTracker.NoOfLevelSets; if (m_OldTracker != null) { m_LsTrkPrivData.HistoryLength = m_OldTracker.HistoryLength; m_LsTrkPrivData.PopultatedHistoryLength = m_OldTracker.PopulatedHistoryLength; m_LsTrkPrivData.Versions = new int[m_LsTrkPrivData.PopultatedHistoryLength + 1]; for (int iH = 1; iH > -m_LsTrkPrivData.PopultatedHistoryLength; iH--) { var TimeLevel = m_OldTracker.BackupTimeLevel(iH); for (int iLs = 0; iLs < NoOfLS; iLs++) { this.BackupField(TimeLevel.Item1[iLs], GetLSbackupName(iH, iLs)); //TimeLevel.Item1[iLs].GetExtremalValues(out double min, out double max); //Console.WriteLine("before backup: phi[{2}] min value = {0} / phi max value = {1}", min, max, iH); } this.BackupVector(TimeLevel.Item2, GetLSregioncodeName(iH)); m_LsTrkPrivData.Versions[1 - iH] = TimeLevel.Item3; } } } }