Commit 0b563a4
committed
fix(com1DFA): handle
- Store original `dtSave` to ensure accurate initial timestep decisions.
- Update `dtSave` only after initial timestep export to avoid unintended modifications.
- Improve readability of conditions by explicitly referencing `dtSaveOriginal`.
Root Cause:
The code uses dtSave for two decisions but modifies it between them:
1. Line 2107: Checks if dtSave contains t=0 → decides to export initial timestep
2. Line 2114: Calls updateSavingTimeStep() which modifies dtSave (changes [0] to [2*tEnd])
3. Line 2142: Checks dtSave again → decides whether to add t=0 to Tsave array
The Problem:
When tSteps = "0":
- Line 2107 check passes → exports t=0
- Line 2114 modifies dtSave from [0] to [2*tEnd]
- Line 2142 check fails → Tsave remains empty
- Result: t=0 was exported but not tracked in Tsave (inconsistency)
Proposed Fix: ✓ CORRECT
The fix saves the original dtSave before modifications and uses it for both decisions. This ensures
consistency between the export and Tsave array decisions.dtSave updates correctly for initial timestep export1 parent 2f1755f commit 0b563a4
1 file changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
2106 | | - | |
2107 | | - | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2108 | 2113 | | |
2109 | 2114 | | |
2110 | 2115 | | |
2111 | 2116 | | |
2112 | 2117 | | |
2113 | 2118 | | |
2114 | | - | |
| 2119 | + | |
| 2120 | + | |
2115 | 2121 | | |
2116 | 2122 | | |
2117 | 2123 | | |
| |||
2139 | 2145 | | |
2140 | 2146 | | |
2141 | 2147 | | |
2142 | | - | |
| 2148 | + | |
2143 | 2149 | | |
2144 | 2150 | | |
2145 | 2151 | | |
| 2152 | + | |
2146 | 2153 | | |
2147 | 2154 | | |
2148 | 2155 | | |
| |||
0 commit comments