Ignore:
Timestamp:
Feb 16, 2009, 10:14:30 AM (15 years ago)
Author:
garnier
Message:

en test de gl2ps. Problemes de libraries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/navigation/src/G4VoxelNavigation.cc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4VoxelNavigation.cc,v 1.7 2007/05/11 13:43:59 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4VoxelNavigation.cc,v 1.9 2008/11/14 18:26:35 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030//
     
    254254                G4String solidResponse = "-kInside-";
    255255                if (insideIntPt == kOutside)
    256                   solidResponse = "-kOutside-";
     256                  { solidResponse = "-kOutside-"; }
    257257                else if (insideIntPt == kSurface)
    258                   solidResponse = "-kSurface-";
     258                  { solidResponse = "-kSurface-"; }
    259259                if( fVerbose == 1 )
    260260                {
     
    265265                         << "    For point p: " << intersectionPoint
    266266                         << ", considered as 'intersection' point." << G4endl;
     267                }
     268                G4double safetyIn= -1, safetyOut= -1;  //  Set to invalid values
     269                G4double newDistIn= -1,  newDistOut= -1;
     270                if( insideIntPt != kInside )
     271                {
     272                  safetyIn= sampleSolid->DistanceToIn(intersectionPoint);
     273                  newDistIn= sampleSolid->DistanceToIn(intersectionPoint,
     274                                                       sampleDirection);
     275                }
     276                if( insideIntPt != kOutside )
     277                {
     278                  safetyOut= sampleSolid->DistanceToOut(intersectionPoint);
     279                  newDistOut= sampleSolid->DistanceToOut(intersectionPoint,
     280                                                         sampleDirection);
    267281                }
    268282                if( insideIntPt != kSurface )
     
    277291                         << " for this point !" << G4endl;
    278292                  G4cout << "          Point = " << intersectionPoint << G4endl;
     293                  G4cout << "          Safety values: " << G4endl;
    279294                  if ( insideIntPt != kInside )
    280                     G4cout << "        DistanceToIn(p) = "
    281                            << sampleSolid->DistanceToIn(intersectionPoint)
     295                  {
     296                    G4cout << "          DistanceToIn(p)  = " << safetyIn
    282297                           << G4endl;
    283                   if ( insideIntPt != kOutside )
    284                     G4cout << "        DistanceToOut(p) = "
    285                            << sampleSolid->DistanceToOut(intersectionPoint)
     298                  }
     299                  if ( insideIntPt != kOutside )
     300                  {
     301                    G4cout << "          DistanceToOut(p) = " << safetyOut
    286302                           << G4endl;
     303                  }
    287304                  G4Exception("G4VoxelNavigation::ComputeStep()",
    288305                              "InaccurateDistanceToIn", JustWarning,
    289                               "Navigator gets conflicting response from Solid.");
     306                              "Conflicting response from Solid.");
    290307                  G4cout.precision(oldcoutPrec);
     308                }
     309                else
     310                { 
     311                  // If it is on the surface, *ensure* that either DistanceToIn
     312                  // or DistanceToOut returns a finite value ( >= Tolerance).
     313                  //
     314                  if( std::max( newDistIn, newDistOut ) <= kCarTolerance )
     315                  {
     316                    G4cout << "ERROR - G4VoxelNavigation::ComputeStep()"
     317                       << G4endl
     318                       << "  Identified point for which the solid "
     319                       << sampleSolid->GetName() << G4endl
     320                       << "  has MAJOR problem:  " << G4endl
     321                       << "  --> Both DistanceToIn(p,v) and DistanceToOut(p,v) "
     322                       << "return Zero, an equivalent value or negative value."
     323                       << G4endl;
     324                    G4cout << "    Solid: " << sampleSolid << G4endl;
     325                    G4cout << "    Point p= " << intersectionPoint << G4endl;
     326                    G4cout << "    Direction v= " << sampleDirection << G4endl;
     327                    G4cout << "    DistanceToIn(p,v)     = " << newDistIn
     328                           << G4endl;
     329                    G4cout << "    DistanceToOut(p,v,..) = " << newDistOut
     330                           << G4endl;
     331                    G4cout << "    Safety values: " << G4endl;
     332                    G4cout << "      DistanceToIn(p)  = " << safetyIn
     333                           << G4endl;
     334                    G4cout << "      DistanceToOut(p) = " << safetyOut
     335                           << G4endl;
     336                    G4Exception("G4VoxelNavigation::ComputeStep()",
     337                              "DistanceToInAndOutAreZero", FatalException,
     338                              "Zero from both Solid DistanceIn and Out(p,v).");
     339                  }
    291340                }
    292341              }
Note: See TracChangeset for help on using the changeset viewer.