@@ -279,10 +279,11 @@ protected function traverseComponents1 "author: Frenkel TUD 2012-05"
279279 output Integer strongComponentIndexOut= strongComponentIndexIn;
280280protected
281281 constant Boolean debug = false ;
282+ Boolean debugFlag = Flags . isSet(Flags . TEARING_DUMP ) or Flags . isSet(Flags . TEARING_DUMPVERBOSE );
282283algorithm
283284 strongComponentIndexOut := match(inComp)
284285 case (BackendDAE . EQUATIONSYSTEM (jac= BackendDAE . FULL_JACOBIAN ())) equation
285- if Flags . isSet( Flags . TEARING_DUMP ) or Flags . isSet( Flags . TEARING_DUMPVERBOSE ) then
286+ if debugFlag then
286287 print("Handle strong component with index: " + intString(strongComponentIndexOut+ 1 ) + " \n To disable tearing of this component use '--noTearingForComponent=" + intString(strongComponentIndexOut+ 1 ) + "'. \n " );
287288 end if ;
288289 then (strongComponentIndexOut + 1 );
@@ -304,17 +305,19 @@ algorithm
304305 true = getLinearfromJacType(jacType);
305306 maxSize = Flags . getConfigInt(Flags . MAX_SIZE_LINEAR_TEARING );
306307 if intGt(listLength(vindx),maxSize) then
307- Error . addMessage(Error . MAX_TEARING_SIZE , {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear" ,intString(maxSize)});
308+ if debugFlag then
309+ Error . addMessage(Error . MAX_TEARING_SIZE , {intString(strongComponentIndexOut), intString(listLength(vindx)),"linear" ,intString(maxSize)});
310+ end if ;
308311 fail();
309312 end if ;
310313 if listMember(strongComponentIndexOut,Flags . getConfigIntList(Flags . NO_TEARING_FOR_COMPONENT )) then
311- if Flags . isSet( Flags . TEARING_DUMP ) or Flags . isSet( Flags . TEARING_DUMPVERBOSE ) then
314+ if debugFlag then
312315 print(" \n Tearing deactivated by user. \n " );
313316 end if ;
314317 Error . addMessage(Error . NO_TEARING_FOR_COMPONENT , {intString(strongComponentIndexOut)});
315318 fail();
316319 end if ;
317- if Flags . isSet( Flags . TEARING_DUMP ) or Flags . isSet( Flags . TEARING_DUMPVERBOSE ) then
320+ if debugFlag then
318321 print(" \n Tearing of LINEAR component \n Use Flag '-d=tearingdumpV' for more details \n\n " );
319322 end if ;
320323 // TODO: Remove when cpp runtime ready for doLinearTearing
@@ -331,17 +334,19 @@ algorithm
331334 false = getLinearfromJacType(jacType);
332335 maxSize = Flags . getConfigInt(Flags . MAX_SIZE_NONLINEAR_TEARING );
333336 if intGt(listLength(vindx),maxSize) then
334- Error . addMessage(Error . MAX_TEARING_SIZE , {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear" ,intString(maxSize)});
337+ if debugFlag then
338+ Error . addMessage(Error . MAX_TEARING_SIZE , {intString(strongComponentIndexOut), intString(listLength(vindx)),"nonlinear" ,intString(maxSize)});
339+ end if ;
335340 fail();
336341 end if ;
337342 if listMember(strongComponentIndexOut,Flags . getConfigIntList(Flags . NO_TEARING_FOR_COMPONENT )) then
338- if Flags . isSet( Flags . TEARING_DUMP ) or Flags . isSet( Flags . TEARING_DUMPVERBOSE ) then
343+ if debugFlag then
339344 print(" \n Tearing deactivated by user. \n " );
340345 end if ;
341346 Error . addMessage(Error . NO_TEARING_FOR_COMPONENT , {intString(strongComponentIndexOut)});
342347 fail();
343348 end if ;
344- if Flags . isSet( Flags . TEARING_DUMP ) or Flags . isSet( Flags . TEARING_DUMPVERBOSE ) then
349+ if debugFlag then
345350 print(" \n Tearing of NONLINEAR component \n Use Flag '-d=tearingdumpV' for more details \n\n " );
346351 end if ;
347352 if Flags . isSet(Flags . TEARING_DUMPVERBOSE ) then
0 commit comments