@@ -606,7 +606,7 @@ void nlsKinsolJacSumDense(DlsMat mat)
606606 }
607607
608608 if (sum == 0.0 ){
609- warningStreamPrint (LOG_NLS , 0 , "sum of col %d of jacobian is zero!" , i );
609+ warningStreamPrint (LOG_NLS_V , 0 , "sum of col %d of jacobian is zero!" , i );
610610 }else {
611611 infoStreamPrint (LOG_NLS_JAC , 0 , "col %d jac sum = %g" , i , sum );
612612 }
@@ -627,7 +627,7 @@ void nlsKinsolJacSumSparse(SlsMat mat)
627627 }
628628
629629 if (sum == 0.0 ){
630- warningStreamPrint (LOG_NLS , 0 , "sum of col %d of jacobian is zero!" , i );
630+ warningStreamPrint (LOG_NLS_V , 0 , "sum of col %d of jacobian is zero!" , i );
631631 }else {
632632 infoStreamPrint (LOG_NLS_JAC , 0 , "col %d jac sum = %g" , i , sum );
633633 }
@@ -644,13 +644,13 @@ void nlsKinsolErrorPrint(int errorCode, const char *module, const char *function
644644 int sysNumber = kinsolData -> userData .sysNumber ;
645645 long eqSystemNumber = data -> simulationInfo -> nonlinearSystemData [sysNumber ].equationIndex ;
646646
647- if (ACTIVE_STREAM (LOG_NLS ))
647+ if (ACTIVE_STREAM (LOG_NLS_V ))
648648 {
649- warningStreamPrint (LOG_NLS , 1 , "kinsol failed for %d" , modelInfoGetEquation (& data -> modelData -> modelDataXml ,eqSystemNumber ).id );
650- warningStreamPrint (LOG_NLS , 0 , "[module] %s | [function] %s | [error_code] %d" , module , function , errorCode );
651- warningStreamPrint (LOG_NLS , 0 , "%s" , msg );
649+ warningStreamPrint (LOG_NLS_V , 1 , "kinsol failed for %d" , modelInfoGetEquation (& data -> modelData -> modelDataXml ,eqSystemNumber ).id );
650+ warningStreamPrint (LOG_NLS_V , 0 , "[module] %s | [function] %s | [error_code] %d" , module , function , errorCode );
651+ warningStreamPrint (LOG_NLS_V , 0 , "%s" , msg );
652652
653- messageClose (LOG_NLS );
653+ messageClose (LOG_NLS_V );
654654 }
655655}
656656
@@ -839,32 +839,32 @@ int nlsKinsolErrorHandler(int errorCode, DATA *data, NONLINEAR_SYSTEM_DATA *nlsD
839839 case KIN_MEM_NULL :
840840 case KIN_ILL_INPUT :
841841 case KIN_NO_MALLOC :
842- errorStreamPrint (LOG_NLS , 0 , "kinsol has a serious memory issue ERROR %d\n" , errorCode );
842+ errorStreamPrint (LOG_NLS_V , 0 , "kinsol has a serious memory issue ERROR %d\n" , errorCode );
843843 return errorCode ;
844844 break ;
845845 /* just retry with new initial guess */
846846 case KIN_MXNEWT_5X_EXCEEDED :
847- warningStreamPrint (LOG_NLS , 0 , "Newton step exceed the maximum step size several times. Try again after increasing maximum step size.\n" );
847+ warningStreamPrint (LOG_NLS_V , 0 , "Newton step exceed the maximum step size several times. Try again after increasing maximum step size.\n" );
848848 kinsolData -> maxstepfactor *= 1e5 ;
849849 nlsKinsolSetMaxNewtonStep (kinsolData , kinsolData -> maxstepfactor );
850850 return 1 ;
851851 break ;
852852 /* just retry without line search */
853853 case KIN_LINESEARCH_NONCONV :
854- warningStreamPrint (LOG_NLS , 0 , "kinsols line search did not convergence. Try without.\n" );
854+ warningStreamPrint (LOG_NLS_V , 0 , "kinsols line search did not convergence. Try without.\n" );
855855 kinsolData -> kinsolStrategy = KIN_NONE ;
856856 kinsolData -> retries -- ;
857857 return 1 ;
858858 /* maybe happened because of an out-dated factorization, so just retry */
859859 case KIN_LSOLVE_FAIL :
860- warningStreamPrint (LOG_NLS , 0 , "kinsols matrix need new factorization. Try again.\n" );
860+ warningStreamPrint (LOG_NLS_V , 0 , "kinsols matrix need new factorization. Try again.\n" );
861861 if (nlsData -> isPatternAvailable ){
862862 KINKLUReInit (kinsolData -> kinsolMemory , kinsolData -> size , kinsolData -> nnz , 2 );
863863 }
864864 return 1 ;
865865 case KIN_MAXITER_REACHED :
866866 case KIN_REPTD_SYSFUNC_ERR :
867- warningStreamPrint (LOG_NLS , 0 , "kinsols runs into issues retry with different configuration.\n" );
867+ warningStreamPrint (LOG_NLS_V , 0 , "kinsols runs into issues retry with different configuration.\n" );
868868 retValue = 1 ;
869869 break ;
870870 case KIN_LSETUP_FAIL :
@@ -883,7 +883,7 @@ int nlsKinsolErrorHandler(int errorCode, DATA *data, NONLINEAR_SYSTEM_DATA *nlsD
883883 break ;
884884 case KIN_LINESEARCH_BCFAIL :
885885 KINGetNumBetaCondFails (kinsolData -> kinsolMemory , & outL );
886- warningStreamPrint (LOG_NLS , 0 , "kinsols runs into issues with beta-condition fails: %ld\n" , outL );
886+ warningStreamPrint (LOG_NLS_V , 0 , "kinsols runs into issues with beta-condition fails: %ld\n" , outL );
887887 retValue = 1 ;
888888 break ;
889889 default :
@@ -896,14 +896,14 @@ int nlsKinsolErrorHandler(int errorCode, DATA *data, NONLINEAR_SYSTEM_DATA *nlsD
896896 KINGetFuncNorm (kinsolData -> kinsolMemory , & fNorm );
897897 if (fNorm < FTOL_WITH_LESS_ACCURANCY )
898898 {
899- warningStreamPrint (LOG_NLS , 0 , "Move forward with a less accurate solution." );
899+ warningStreamPrint (LOG_NLS_V , 0 , "Move forward with a less accurate solution." );
900900 KINSetFuncNormTol (kinsolData -> kinsolMemory , FTOL_WITH_LESS_ACCURANCY );
901901 KINSetScaledStepTol (kinsolData -> kinsolMemory , FTOL_WITH_LESS_ACCURANCY );
902902 retValue2 = 1 ;
903903 }
904904 else
905905 {
906- warningStreamPrint (LOG_NLS , 0 , "Current status of fx = %f" , fNorm );
906+ warningStreamPrint (LOG_NLS_V , 0 , "Current status of fx = %f" , fNorm );
907907 }
908908
909909 /* reconfigure kinsol for an other try */
@@ -976,8 +976,7 @@ int nlsKinsolSolve(DATA *data, threadData_t *threadData, int sysNumber)
976976 /* reset configuration settings */
977977 nlsKinsolConfigSetup (kinsolData );
978978
979- infoStreamPrint (LOG_NLS , 0 , "------------------------------------------------------" );
980- infoStreamPrintWithEquationIndexes (LOG_NLS , 1 , indexes , "Start solving non-linear system >>%ld<< using Kinsol solver at time %g" , eqSystemNumber , data -> localData [0 ]-> timeValue );
979+ infoStreamPrintWithEquationIndexes (LOG_NLS_V , 1 , indexes , "Start Kinsol solver at time %g" , data -> localData [0 ]-> timeValue );
981980
982981 nlsKinsolResetInitial (data , kinsolData , nlsData , INITIAL_EXTRAPOLATION );
983982
@@ -1031,10 +1030,10 @@ int nlsKinsolSolve(DATA *data, threadData_t *threadData, int sysNumber)
10311030 N_VProd (kinsolData -> fRes , kinsolData -> fScale , kinsolData -> fRes );
10321031 fNormValue = N_VWL2Norm (kinsolData -> fRes , kinsolData -> fRes );
10331032
1034- infoStreamPrint (LOG_NLS , 0 , "scaled Euclidean norm of F(u) = %e" , fNormValue );
1033+ infoStreamPrint (LOG_NLS_V , 0 , "scaled Euclidean norm of F(u) = %e" , fNormValue );
10351034 if (FTOL_WITH_LESS_ACCURANCY < fNormValue )
10361035 {
1037- warningStreamPrint (LOG_NLS , 0 , "False positive solution. FNorm is not small enough." );
1036+ warningStreamPrint (LOG_NLS_V , 0 , "False positive solution. FNorm is not small enough." );
10381037 success = 0 ;
10391038 }
10401039 else /* solved system for reuse linear solver information */
@@ -1043,19 +1042,9 @@ int nlsKinsolSolve(DATA *data, threadData_t *threadData, int sysNumber)
10431042 }
10441043 /* copy solution */
10451044 memcpy (nlsData -> nlsx , xStart , nlsData -> size * (sizeof (double )));
1046- /* dump solution */
1047- if (ACTIVE_STREAM (LOG_NLS ))
1048- {
1049- infoStreamPrintWithEquationIndexes (LOG_NLS , 1 , indexes , "solution for NLS %ld at t=%g" , eqSystemNumber , kinsolData -> userData .data -> localData [0 ]-> timeValue );
1050- for (i = 0 ; i < nlsData -> size ; ++ i )
1051- {
1052- infoStreamPrintWithEquationIndexes (LOG_NLS , 0 , indexes , "[%d] %s = %g" , i + 1 , modelInfoGetEquation (& kinsolData -> userData .data -> modelData -> modelDataXml ,eqSystemNumber ).vars [i ], nlsData -> nlsx [i ]);
1053- }
1054- messageClose (LOG_NLS );
1055- }
10561045 }
10571046
1058- messageClose (LOG_NLS );
1047+ messageClose (LOG_NLS_V );
10591048
10601049 return success ;
10611050}
0 commit comments