00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "G4BrentLocator.hh"
00035 #include "G4ios.hh"
00036 #include <iomanip>
00037
00038 G4BrentLocator::G4BrentLocator(G4Navigator *theNavigator)
00039 : G4VIntersectionLocator(theNavigator)
00040 {
00041
00042
00043
00044
00045 G4ThreeVector zeroV(0.0,0.0,0.0);
00046 for (G4int idepth=0; idepth<max_depth+1; idepth++ )
00047 {
00048 ptrInterMedFT[ idepth ] = new G4FieldTrack( zeroV, zeroV, 0., 0., 0., 0.);
00049 }
00050
00051
00052
00053
00054
00055 maxNumberOfStepsForIntersection=0;
00056
00057
00058
00059 maxNumberOfCallsToReIntegration=0;
00060 maxNumberOfCallsToReIntegration_depth=0;
00061 }
00062
00063 G4BrentLocator::~G4BrentLocator()
00064 {
00065 for ( G4int idepth=0; idepth<max_depth+1; idepth++)
00066 {
00067 delete ptrInterMedFT[idepth];
00068 }
00069 #ifdef G4DEBUG_FIELD
00070 if(fVerboseLevel>0)
00071 {
00072 G4cout << "G4BrentLocator::Location with Max Number of Steps="
00073 << maxNumberOfStepsForIntersection<<G4endl;
00074 G4cout << "G4BrentLocator::ReIntegrateEndPoint was called "
00075 << maxNumberOfCallsToReIntegration
00076 << " times and for depth algorithm "
00077 << maxNumberOfCallsToReIntegration_depth << " times." << G4endl;
00078 }
00079 #endif
00080 }
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 G4bool G4BrentLocator::EstimateIntersectionPoint(
00116 const G4FieldTrack& CurveStartPointVelocity,
00117 const G4FieldTrack& CurveEndPointVelocity,
00118 const G4ThreeVector& TrialPoint,
00119 G4FieldTrack& IntersectedOrRecalculatedFT,
00120 G4bool& recalculatedEndPoint,
00121 G4double& fPreviousSafety,
00122 G4ThreeVector& fPreviousSftOrigin)
00123
00124 {
00125
00126
00127 G4bool found_approximate_intersection = false;
00128 G4bool there_is_no_intersection = false;
00129
00130 G4FieldTrack CurrentA_PointVelocity = CurveStartPointVelocity;
00131 G4FieldTrack CurrentB_PointVelocity = CurveEndPointVelocity;
00132 G4ThreeVector CurrentE_Point = TrialPoint;
00133 G4bool validNormalAtE = false;
00134 G4ThreeVector NormalAtEntry;
00135
00136 G4FieldTrack ApproxIntersecPointV(CurveEndPointVelocity);
00137 G4double NewSafety = 0.0;
00138 G4bool last_AF_intersection = false;
00139
00140
00141
00142 G4bool first_section = true;
00143 recalculatedEndPoint = false;
00144
00145 G4bool restoredFullEndpoint = false;
00146
00147 G4int oldprc;
00148 G4int substep_no = 0;
00149
00150
00151
00152 const G4int max_substeps= 10000;
00153 const G4int warn_substeps= 1000;
00154
00155
00156
00157 static G4int max_no_seen= -1;
00158
00159
00160
00161 G4int restartB = 0;
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 const G4int param_substeps=50;
00174
00175 const G4double fraction_done=0.3;
00176
00177 G4bool Second_half = false;
00178
00179 NormalAtEntry = GetSurfaceNormal(CurrentE_Point, validNormalAtE);
00180
00181
00182
00183
00184
00185
00186
00187 G4int depth=0;
00188
00189 #ifdef G4DEBUG_FIELD
00190 static G4double tolerance= 1.0e-8;
00191 G4ThreeVector StartPosition= CurveStartPointVelocity.GetPosition();
00192 if( (TrialPoint - StartPosition).mag() < tolerance * mm )
00193 {
00194 G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
00195 "GeomNav1002", JustWarning,
00196 "Intersection point F is exactly at start point A." );
00197 }
00198 #endif
00199
00200
00201
00202
00203
00204 *ptrInterMedFT[0] = CurveEndPointVelocity;
00205 for (G4int idepth=1; idepth<max_depth+1; idepth++ )
00206 {
00207 *ptrInterMedFT[idepth]=CurveStartPointVelocity;
00208 }
00209
00210
00211 G4bool fin_section_depth[max_depth];
00212 for (G4int idepth=0; idepth<max_depth; idepth++ )
00213 {
00214 fin_section_depth[idepth]=true;
00215 }
00216
00217
00218
00219 G4FieldTrack SubStart_PointVelocity = CurveStartPointVelocity;
00220
00221 do
00222 {
00223 G4int substep_no_p = 0;
00224 G4bool sub_final_section = false;
00225
00226 SubStart_PointVelocity = CurrentA_PointVelocity;
00227 do
00228 {
00229 G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
00230 G4ThreeVector Point_B = CurrentB_PointVelocity.GetPosition();
00231
00232
00233
00234
00235 if(substep_no_p==0)
00236 {
00237 ApproxIntersecPointV = GetChordFinderFor()
00238 ->ApproxCurvePointV( CurrentA_PointVelocity,
00239 CurrentB_PointVelocity,
00240 CurrentE_Point,
00241 GetEpsilonStepFor());
00242
00243 }
00244 #ifdef G4DEBUG_FIELD
00245 if( ApproxIntersecPointV.GetCurveLength() >
00246 CurrentB_PointVelocity.GetCurveLength() * (1.0 + tolerance) )
00247 {
00248 G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
00249 "GeomNav0003", FatalException,
00250 "Intermediate F point is past end B point" );
00251 }
00252 #endif
00253
00254 G4ThreeVector CurrentF_Point= ApproxIntersecPointV.GetPosition();
00255
00256
00257
00258
00259 G4ThreeVector ChordEF_Vector = CurrentF_Point - CurrentE_Point;
00260 G4ThreeVector NewMomentumDir= ApproxIntersecPointV.GetMomentumDir();
00261 G4double MomDir_dot_Norm= NewMomentumDir.dot( NormalAtEntry ) ;
00262
00263 #ifdef G4DEBUG_FIELD
00264 G4ThreeVector ChordAB = Point_B - Point_A;
00265
00266 G4VIntersectionLocator::ReportTrialStep( substep_no, ChordAB,
00267 ChordEF_Vector, NewMomentumDir, NormalAtEntry, validNormalAtE );
00268 #endif
00269
00270 G4bool adequate_angle;
00271 adequate_angle = ( MomDir_dot_Norm >= 0.0 )
00272 || (! validNormalAtE );
00273 G4double EF_dist2 = ChordEF_Vector.mag2();
00274 if ( ( EF_dist2 <= sqr(fiDeltaIntersection) && ( adequate_angle ) )
00275 || ( EF_dist2 <= kCarTolerance*kCarTolerance ) )
00276 {
00277 found_approximate_intersection = true;
00278
00279
00280
00281 IntersectedOrRecalculatedFT = ApproxIntersecPointV;
00282 IntersectedOrRecalculatedFT.SetPosition( CurrentE_Point );
00283
00284 if ( GetAdjustementOfFoundIntersection() )
00285 {
00286
00287
00288 G4ThreeVector IP;
00289 G4ThreeVector MomentumDir=ApproxIntersecPointV.GetMomentumDirection();
00290 G4bool goodCorrection = AdjustmentOfFoundIntersection( Point_A,
00291 CurrentE_Point, CurrentF_Point, MomentumDir,
00292 last_AF_intersection, IP, NewSafety,
00293 fPreviousSafety, fPreviousSftOrigin );
00294 if ( goodCorrection )
00295 {
00296 IntersectedOrRecalculatedFT = ApproxIntersecPointV;
00297 IntersectedOrRecalculatedFT.SetPosition(IP);
00298 }
00299 }
00300
00301
00302
00303
00304
00305
00306
00307 }
00308 else
00309 {
00310
00311
00312
00313
00314
00315 GetNavigatorFor()->LocateGlobalPointWithinVolume( Point_A );
00316
00317 G4ThreeVector PointG;
00318 G4double stepLengthAF;
00319 G4bool usedNavigatorAF = false;
00320 G4bool Intersects_AF = IntersectChord( Point_A, CurrentF_Point,
00321 NewSafety,fPreviousSafety,
00322 fPreviousSftOrigin,
00323 stepLengthAF,
00324 PointG,
00325 &usedNavigatorAF);
00326 last_AF_intersection = Intersects_AF;
00327 if( Intersects_AF )
00328 {
00329
00330
00331
00332
00333
00334
00335 G4FieldTrack EndPoint = ApproxIntersecPointV;
00336 ApproxIntersecPointV = GetChordFinderFor()->ApproxCurvePointS(
00337 CurrentA_PointVelocity, CurrentB_PointVelocity,
00338 EndPoint,CurrentE_Point, CurrentF_Point,PointG,
00339 true, GetEpsilonStepFor() );
00340 CurrentB_PointVelocity = EndPoint;
00341 CurrentE_Point = PointG;
00342
00343
00344
00345
00346
00347 G4bool validNormalLast;
00348 NormalAtEntry = GetSurfaceNormal( PointG, validNormalLast );
00349 validNormalAtE = validNormalLast;
00350
00351
00352
00353
00354 fin_section_depth[depth] = false;
00355 #ifdef G4VERBOSE
00356 if( fVerboseLevel > 3 )
00357 {
00358 G4cout << "G4PiF::LI> Investigating intermediate point"
00359 << " at s=" << ApproxIntersecPointV.GetCurveLength()
00360 << " on way to full s="
00361 << CurveEndPointVelocity.GetCurveLength() << G4endl;
00362 }
00363 #endif
00364 }
00365 else
00366 {
00367
00368
00369
00370
00371 GetNavigatorFor()->LocateGlobalPointWithinVolume( CurrentF_Point );
00372
00373 G4double stepLengthFB;
00374 G4ThreeVector PointH;
00375 G4bool usedNavigatorFB = false;
00376
00377
00378
00379
00380 G4bool Intersects_FB = IntersectChord( CurrentF_Point, Point_B,
00381 NewSafety,fPreviousSafety,
00382 fPreviousSftOrigin,
00383 stepLengthFB,
00384 PointH,
00385 &usedNavigatorFB);
00386 if( Intersects_FB )
00387 {
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400 G4FieldTrack InterMed=ApproxIntersecPointV;
00401 ApproxIntersecPointV = GetChordFinderFor()->ApproxCurvePointS(
00402 CurrentA_PointVelocity,CurrentB_PointVelocity,
00403 InterMed,CurrentE_Point,CurrentF_Point,PointH,
00404 false,GetEpsilonStepFor());
00405 CurrentA_PointVelocity = InterMed;
00406 CurrentE_Point = PointH;
00407
00408
00409
00410 G4bool validNormalLast;
00411 NormalAtEntry = GetSurfaceNormal( PointH, validNormalLast );
00412 validNormalAtE= validNormalLast;
00413 }
00414 else
00415 {
00416
00417
00418 if( fin_section_depth[depth] )
00419 {
00420
00421
00422
00423
00424
00425
00426
00427
00428 if( ((Second_half)&&(depth==0)) || (first_section) )
00429 {
00430 there_is_no_intersection = true;
00431 }
00432 else
00433 {
00434
00435
00436
00437 substep_no_p = param_substeps+2;
00438
00439
00440
00441
00442 Second_half = true;
00443 sub_final_section = true;
00444 }
00445 }
00446 else
00447 {
00448 if(depth==0)
00449 {
00450
00451
00452 CurrentA_PointVelocity = CurrentB_PointVelocity;
00453 CurrentB_PointVelocity = CurveEndPointVelocity;
00454 SubStart_PointVelocity = CurrentA_PointVelocity;
00455 ApproxIntersecPointV = GetChordFinderFor()
00456 ->ApproxCurvePointV( CurrentA_PointVelocity,
00457 CurrentB_PointVelocity,
00458 CurrentE_Point,
00459 GetEpsilonStepFor());
00460
00461 restoredFullEndpoint = true;
00462 restartB++;
00463 }
00464 else
00465 {
00466
00467
00468 CurrentA_PointVelocity = CurrentB_PointVelocity;
00469 CurrentB_PointVelocity = *ptrInterMedFT[depth];
00470 SubStart_PointVelocity = CurrentA_PointVelocity;
00471 ApproxIntersecPointV = GetChordFinderFor()
00472 ->ApproxCurvePointV( CurrentA_PointVelocity,
00473 CurrentB_PointVelocity,
00474 CurrentE_Point,
00475 GetEpsilonStepFor());
00476 restoredFullEndpoint = true;
00477 restartB++;
00478 }
00479 }
00480 }
00481 }
00482
00483
00484
00485
00486 G4double linDistSq, curveDist;
00487 linDistSq = ( CurrentB_PointVelocity.GetPosition()
00488 - CurrentA_PointVelocity.GetPosition() ).mag2();
00489 curveDist = CurrentB_PointVelocity.GetCurveLength()
00490 - CurrentA_PointVelocity.GetCurveLength();
00491
00492
00493
00494 if( curveDist*curveDist*(1+2* GetEpsilonStepFor()) < linDistSq )
00495 {
00496
00497
00498 G4FieldTrack newEndPointFT=
00499 ReEstimateEndpoint( CurrentA_PointVelocity,
00500 CurrentB_PointVelocity,
00501 linDistSq,
00502 curveDist );
00503 G4FieldTrack oldPointVelB = CurrentB_PointVelocity;
00504 CurrentB_PointVelocity = newEndPointFT;
00505
00506 if ( (fin_section_depth[depth])
00507 &&( first_section || ((Second_half)&&(depth==0)) ) )
00508 {
00509 recalculatedEndPoint = true;
00510 IntersectedOrRecalculatedFT = newEndPointFT;
00511
00512 }
00513 }
00514 if( curveDist < 0.0 )
00515 {
00516 fVerboseLevel = 5;
00517 printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
00518 -1.0, NewSafety, substep_no );
00519 std::ostringstream message;
00520 message << "Error in advancing propagation." << G4endl
00521 << " Error in advancing propagation." << G4endl
00522 << " Point A (start) is " << CurrentA_PointVelocity
00523 << G4endl
00524 << " Point B (end) is " << CurrentB_PointVelocity
00525 << G4endl
00526 << " Curve distance is " << curveDist << G4endl
00527 << G4endl
00528 << "The final curve point is not further along"
00529 << " than the original!" << G4endl;
00530
00531 if( recalculatedEndPoint )
00532 {
00533 message << "Recalculation of EndPoint was called with fEpsStep= "
00534 << GetEpsilonStepFor() << G4endl;
00535 }
00536 oldprc = G4cerr.precision(20);
00537 message << " Point A (Curve start) is " << CurveStartPointVelocity
00538 << G4endl
00539 << " Point B (Curve end) is " << CurveEndPointVelocity
00540 << G4endl
00541 << " Point A (Current start) is " << CurrentA_PointVelocity
00542 << G4endl
00543 << " Point B (Current end) is " << CurrentB_PointVelocity
00544 << G4endl
00545 << " Point S (Sub start) is " << SubStart_PointVelocity
00546 << G4endl
00547 << " Point E (Trial Point) is " << CurrentE_Point
00548 << G4endl
00549 << " Old Point F(Intersection) is " << CurrentF_Point
00550 << G4endl
00551 << " New Point F(Intersection) is " << ApproxIntersecPointV
00552 << G4endl
00553 << " LocateIntersection parameters are : Substep no= "
00554 << substep_no << G4endl
00555 << " Substep depth no= "<< substep_no_p << " Depth= "
00556 << depth << G4endl
00557 << " Restarted no= "<< restartB << " Epsilon= "
00558 << GetEpsilonStepFor() <<" DeltaInters= "
00559 << GetDeltaIntersectionFor();
00560 G4cerr.precision( oldprc );
00561
00562 G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
00563 "GeomNav0003", FatalException, message);
00564 }
00565
00566 if(restoredFullEndpoint)
00567 {
00568 fin_section_depth[depth] = restoredFullEndpoint;
00569 restoredFullEndpoint = false;
00570 }
00571 }
00572
00573
00574 #ifdef G4DEBUG_LOCATE_INTERSECTION
00575 static G4int trigger_substepno_print= warn_substeps - 20 ;
00576
00577 if( substep_no >= trigger_substepno_print )
00578 {
00579 G4cout << "Difficulty in converging in "
00580 << "G4BrentLocator::EstimateIntersectionPoint()"
00581 << G4endl
00582 << " Substep no = " << substep_no << G4endl;
00583 if( substep_no == trigger_substepno_print )
00584 {
00585 printStatus( CurveStartPointVelocity, CurveEndPointVelocity,
00586 -1.0, NewSafety, 0);
00587 }
00588 G4cout << " State of point A: ";
00589 printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
00590 -1.0, NewSafety, substep_no-1, 0);
00591 G4cout << " State of point B: ";
00592 printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
00593 -1.0, NewSafety, substep_no);
00594 }
00595 #endif
00596 substep_no++;
00597 substep_no_p++;
00598
00599 } while ( ( ! found_approximate_intersection )
00600 && ( ! there_is_no_intersection )
00601 && ( substep_no_p <= param_substeps) );
00602
00603 first_section = false;
00604
00605 if( (!found_approximate_intersection) && (!there_is_no_intersection) )
00606 {
00607 G4double did_len = std::abs( CurrentA_PointVelocity.GetCurveLength()
00608 - SubStart_PointVelocity.GetCurveLength());
00609 G4double all_len = std::abs( CurrentB_PointVelocity.GetCurveLength()
00610 - SubStart_PointVelocity.GetCurveLength());
00611
00612 G4double stepLengthAB;
00613 G4ThreeVector PointGe;
00614
00615
00616
00617
00618 if ( ( did_len < fraction_done*all_len )
00619 && (depth<max_depth) && (!sub_final_section) )
00620 {
00621 Second_half=false;
00622 depth++;
00623
00624 G4double Sub_len = (all_len-did_len)/(2.);
00625 G4FieldTrack start = CurrentA_PointVelocity;
00626 G4MagInt_Driver* integrDriver =
00627 GetChordFinderFor()->GetIntegrationDriver();
00628 integrDriver->AccurateAdvance(start, Sub_len, GetEpsilonStepFor());
00629 *ptrInterMedFT[depth] = start;
00630 CurrentB_PointVelocity = *ptrInterMedFT[depth];
00631
00632
00633
00634 SubStart_PointVelocity = CurrentA_PointVelocity;
00635
00636
00637
00638 G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
00639 G4ThreeVector SubE_point = CurrentB_PointVelocity.GetPosition();
00640
00641 GetNavigatorFor()->LocateGlobalPointWithinVolume(Point_A);
00642 G4bool Intersects_AB = IntersectChord(Point_A, SubE_point,
00643 NewSafety, fPreviousSafety,
00644 fPreviousSftOrigin,stepLengthAB,
00645 PointGe);
00646 if( Intersects_AB )
00647 {
00648 last_AF_intersection = Intersects_AB;
00649 CurrentE_Point = PointGe;
00650 fin_section_depth[depth]=true;
00651
00652
00653
00654 G4bool validNormalAB;
00655 NormalAtEntry = GetSurfaceNormal( PointGe, validNormalAB );
00656 validNormalAtE= validNormalAB;
00657 }
00658 else
00659 {
00660
00661
00662
00663 Second_half = true;
00664 }
00665 }
00666
00667 if( (Second_half)&&(depth!=0) )
00668 {
00669
00670
00671
00672 Second_half = true;
00673
00674
00675
00676 SubStart_PointVelocity = *ptrInterMedFT[depth];
00677 CurrentA_PointVelocity = *ptrInterMedFT[depth];
00678 CurrentB_PointVelocity = *ptrInterMedFT[depth-1];
00679
00680
00681
00682 G4double linDistSq, curveDist;
00683 linDistSq = ( CurrentB_PointVelocity.GetPosition()
00684 - CurrentA_PointVelocity.GetPosition() ).mag2();
00685 curveDist = CurrentB_PointVelocity.GetCurveLength()
00686 - CurrentA_PointVelocity.GetCurveLength();
00687 if( curveDist*curveDist*(1+2*GetEpsilonStepFor() ) < linDistSq )
00688 {
00689
00690
00691 G4FieldTrack newEndPointFT=
00692 ReEstimateEndpoint( CurrentA_PointVelocity,
00693 CurrentB_PointVelocity,
00694 linDistSq,
00695 curveDist );
00696 G4FieldTrack oldPointVelB = CurrentB_PointVelocity;
00697 CurrentB_PointVelocity = newEndPointFT;
00698 if (depth==1)
00699 {
00700 recalculatedEndPoint = true;
00701 IntersectedOrRecalculatedFT = newEndPointFT;
00702
00703 }
00704 }
00705
00706
00707 G4ThreeVector Point_A = CurrentA_PointVelocity.GetPosition();
00708 G4ThreeVector SubE_point = CurrentB_PointVelocity.GetPosition();
00709 GetNavigatorFor()->LocateGlobalPointWithinVolume(Point_A);
00710 G4bool Intersects_AB = IntersectChord(Point_A, SubE_point, NewSafety,
00711 fPreviousSafety,
00712 fPreviousSftOrigin,stepLengthAB, PointGe);
00713 if( Intersects_AB )
00714 {
00715 last_AF_intersection = Intersects_AB;
00716 CurrentE_Point = PointGe;
00717
00718 G4bool validNormalAB;
00719 NormalAtEntry = GetSurfaceNormal( PointGe, validNormalAB );
00720 validNormalAtE = validNormalAB;
00721 }
00722
00723 depth--;
00724 fin_section_depth[depth]=true;
00725 }
00726 }
00727
00728 } while ( ( ! found_approximate_intersection )
00729 && ( ! there_is_no_intersection )
00730 && ( substep_no <= max_substeps) );
00731
00732 if( substep_no > max_no_seen )
00733 {
00734 max_no_seen = substep_no;
00735 #ifdef G4DEBUG_LOCATE_INTERSECTION
00736 if( max_no_seen > warn_substeps )
00737 {
00738 trigger_substepno_print = max_no_seen-20;
00739 }
00740 #endif
00741 }
00742
00743 if( ( substep_no >= max_substeps)
00744 && !there_is_no_intersection
00745 && !found_approximate_intersection )
00746 {
00747 G4cout << "ERROR - G4BrentLocator::EstimateIntersectionPoint()" << G4endl
00748 << " Start and end-point of requested Step:" << G4endl;
00749 printStatus( CurveStartPointVelocity, CurveEndPointVelocity,
00750 -1.0, NewSafety, 0);
00751 G4cout << " Start and end-point of current Sub-Step:" << G4endl;
00752 printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
00753 -1.0, NewSafety, substep_no-1);
00754 printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
00755 -1.0, NewSafety, substep_no);
00756 std::ostringstream message;
00757 message << "Too many substeps!" << G4endl
00758 << " Convergence is requiring too many substeps: "
00759 << substep_no << G4endl
00760 << " Abandoning effort to intersect. " << G4endl
00761 << " Found intersection = "
00762 << found_approximate_intersection << G4endl
00763 << " Intersection exists = "
00764 << !there_is_no_intersection << G4endl;
00765 oldprc = G4cout.precision( 10 );
00766 G4double done_len = CurrentA_PointVelocity.GetCurveLength();
00767 G4double full_len = CurveEndPointVelocity.GetCurveLength();
00768 message << " Undertaken only length: " << done_len
00769 << " out of " << full_len << " required." << G4endl
00770 << " Remaining length = " << full_len - done_len;
00771 G4cout.precision( oldprc );
00772
00773 G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
00774 "GeomNav0003", FatalException, message);
00775 }
00776 else if( substep_no >= warn_substeps )
00777 {
00778 oldprc= G4cout.precision( 10 );
00779 std::ostringstream message;
00780 message << "Many substeps while trying to locate intersection."
00781 << G4endl
00782 << " Undertaken length: "
00783 << CurrentB_PointVelocity.GetCurveLength()
00784 << " - Needed: " << substep_no << " substeps." << G4endl
00785 << " Warning level = " << warn_substeps
00786 << " and maximum substeps = " << max_substeps;
00787 G4Exception("G4BrentLocator::EstimateIntersectionPoint()",
00788 "GeomNav1002", JustWarning, message);
00789 G4cout.precision( oldprc );
00790 }
00791 return !there_is_no_intersection;
00792 }