在上課時間()方法運行使用變量BOOL subCycling_下面的代碼:什麼意思是分循環?
bool Foam::Time::run() const
810 {
811 bool running = value() < (endTime_ - 0.5*deltaT_);
812
813 if (!subCycling_) //bool subCycling_; //- Is the time currently being sub-cycled?
814 {
815 // only execute when the condition is no longer true
816 // ie, when exiting the control loop
817 if (!running && timeIndex_ != startTimeIndex_)
818 {
819 // Note, end() also calls an indirect start() as required
820 functionObjects_.end();
821 }
822 }
823
824 if (running)
825 {
826 if (!subCycling_)
827 {
828 const_cast<Time&>(*this).readModifiedObjects();
829
830 if (timeIndex_ == startTimeIndex_)
831 {
832 functionObjects_.start();
833 }
834 else
835 {
836 functionObjects_.execute();
837 }
838 }
839
840 // Update the "running" status following the
841 // possible side-effects from functionObjects
842 running = value() < (endTime_ - 0.5*deltaT_);
843 }
844
845 return running;
846 }
847
848
849 bool Foam::Time::loop()
850 {
851 bool running = run();
852
853 if (running)
854 {
855 operator++();
856 }
857
858 return running;
859 }
當我翻譯子循環成德文我還是不明白意思。 那麼,什麼意思是分循環[line 813]?這裏的一個例子會很棒。
問候 streight
看起來它只是一個布爾變量... – Josh
英語也沒有多大意義。如果作者沒有記錄它,那麼你需要閱讀'if'語句中的代碼,並弄清楚它做了什麼,以便知道他的意思。 –
@Soylent:當然,但我需要知道變量背後的含義。 – Streight