Changeset 921 for trunk/source/geometry/navigation/src/G4VoxelNavigation.cc
- Timestamp:
- Feb 16, 2009, 10:14:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/navigation/src/G4VoxelNavigation.cc
r850 r921 25 25 // 26 26 // 27 // $Id: G4VoxelNavigation.cc,v 1. 7 2007/05/11 13:43:59gcosmo 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 $ 29 29 // 30 30 // … … 254 254 G4String solidResponse = "-kInside-"; 255 255 if (insideIntPt == kOutside) 256 solidResponse = "-kOutside-";256 { solidResponse = "-kOutside-"; } 257 257 else if (insideIntPt == kSurface) 258 solidResponse = "-kSurface-";258 { solidResponse = "-kSurface-"; } 259 259 if( fVerbose == 1 ) 260 260 { … … 265 265 << " For point p: " << intersectionPoint 266 266 << ", 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); 267 281 } 268 282 if( insideIntPt != kSurface ) … … 277 291 << " for this point !" << G4endl; 278 292 G4cout << " Point = " << intersectionPoint << G4endl; 293 G4cout << " Safety values: " << G4endl; 279 294 if ( insideIntPt != kInside ) 280 G4cout << " DistanceToIn(p) = "281 << sampleSolid->DistanceToIn(intersectionPoint)295 { 296 G4cout << " DistanceToIn(p) = " << safetyIn 282 297 << G4endl; 283 if ( insideIntPt != kOutside ) 284 G4cout << " DistanceToOut(p) = " 285 << sampleSolid->DistanceToOut(intersectionPoint) 298 } 299 if ( insideIntPt != kOutside ) 300 { 301 G4cout << " DistanceToOut(p) = " << safetyOut 286 302 << G4endl; 303 } 287 304 G4Exception("G4VoxelNavigation::ComputeStep()", 288 305 "InaccurateDistanceToIn", JustWarning, 289 " Navigator gets conflicting response from Solid.");306 "Conflicting response from Solid."); 290 307 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 } 291 340 } 292 341 }
Note: See TracChangeset
for help on using the changeset viewer.