22 const char chDetail[] )
40 if( strcmp( chMode ,
"pres" )==0 )
47 " PROBLEM ConvFail %li, pressure not converged; itr %li, zone %.2f Te:%.3e Hden:%.4e curr Pres:%.4e Error:%.4e%% Pra/gas:%.3e\n",
59 strcmp(
dense.chDenseLaw,
"DYNA") == 0 )
62 "\n PROBLEM continued, pressure not converged; we are stuck at the sonic point.\n\n");
69 else if( strcmp( chMode,
"eden" ) == 0 )
77 " PROBLEM ConvFail %li, eden not converged itr %li zone %li fnzone %.2f correct=%.3e "
89 if( !
conv.lgConvTemp )
91 fprintf(
ioQQQ,
" Temperature failure also." );
95 if( !
conv.lgConvIoniz() )
97 fprintf(
ioQQQ,
" Ionization failure also." );
100 fprintf(
ioQQQ,
" \n");
103 else if( strcmp( chMode,
"ioni" ) == 0 )
109 fprintf(
ioQQQ,
" PROBLEM ConvFail %li, %s ionization not converged"
110 " iteration %li zone %li fnzone %.2f reason %s BadConvIoniz0:%g [1]=%g\n",
117 conv.convIonizOldVal(),
118 conv.convIonizNewVal());
122 else if( strcmp( chMode,
"pops" ) == 0 )
126 conv.lgConvPops =
false;
129 fprintf(
ioQQQ,
" PROBLEM ConvFail %li, %s population not converged"
130 " iteration %li zone %li fnzone %.2f %s %g %g\n",
137 conv.convIonizOldVal(),
138 conv.convIonizNewVal());
142 else if( strcmp( chMode,
"grai" ) == 0 )
148 fprintf(
ioQQQ,
" PROBLEM ConvFail %ld, a grain failure occurred"
149 " iteration %li zone %li fnzone %.2f %s %g %g\n",
155 conv.convIonizOldVal(),
156 conv.convIonizNewVal());
161 else if( strcmp( chMode,
"temp" ) == 0 )
168 " PROBLEM ConvFail %ld, Temp not converged itr %li zone %li fnzone %.2f Te=%.4e"
169 " Htot=%.3e Ctot=%.3e rel err=%.3e rel tol:%.3e\n",
178 conv.HeatCoolRelErrorAllowed );
181 if( !
conv.lgConvIoniz() )
183 fprintf(
ioQQQ,
" Solution not converged due to %10.10s\n",
184 conv.chConvIoniz() );
190 fprintf(
ioQQQ,
" ConvFail called with insane mode %s detail %s\n",
198 ++
conv.nTotalFailures;
211 if(
conv.nTotalFailures <
conv.LimFail )
216 fprintf(
ioQQQ,
" Stop due to excessive convergence failures - there have been %ld so far. \n",
218 fprintf(
ioQQQ,
" This limit can be reset with the FAILURES command.\n" );
224 fprintf(
ioQQQ,
"\n This problem may be solved by adding cosmic rays.\n");
225 fprintf(
ioQQQ,
"\n The gas was cold and neutral.\n");
226 fprintf(
ioQQQ,
"\n The chemistry is not designed to work without a source of ionization.\n");
227 fprintf(
ioQQQ,
" >>> Add galactic background cosmic rays with the COSMIC RAYS BACKBOUND command and try again.\n\n" );
231 if(
conv.nPreFail==
conv.nTotalFailures )
233 fprintf(
ioQQQ,
" These were all pressure failures - we may be near an unstable point in the cooling curve. \n");
234 fprintf(
ioQQQ,
" The PUNCH PRESSURE HISTORY command will show the n-T-P curve, and may be interesting.\n\n");
246 hcmap.lgMapBeingDone =
true;
255 fprintf(
ioQQQ,
" ConvFail sets lgAbort since nTotalFailures=%ld is >= LimFail=%ld\n",
258 fprintf(
ioQQQ,
" This limit can be reset with the FAILURES command.\n");
#define DEBUG_ENTRY(funcname)
void ConvFail(const char chMode[], const char chDetail[])
void map_do(FILE *io, const char *chType)