36 #ifdef G4GEOMETRY_VOXELDEBUG
90 if (pVolume !=
nullptr)
113 if (pVolume !=
nullptr)
166 std::vector<G4SmartVoxelStat> stats;
167 if (verbose) { allTimer.
Start(); }
173 for (
size_t n=0;
n<Store->size(); ++
n)
175 if (verbose) timer.
Start();
189 #ifdef G4GEOMETRY_VOXELDEBUG
190 G4cout <<
"**** G4GeometryManager::BuildOptimisations" <<
G4endl
191 <<
" Examining logical volume name = "
202 message <<
"VoxelHeader allocation error." <<
G4endl
203 <<
"Allocation of new VoxelHeader" <<
G4endl
204 <<
" for volume " << volume->
GetName() <<
" failed.";
205 G4Exception(
"G4GeometryManager::BuildOptimisations()",
"GeomMgt0003",
219 #ifdef G4GEOMETRY_VOXELDEBUG
220 G4cout <<
"**** G4GeometryManager::BuildOptimisations" <<
G4endl
221 <<
" Skipping logical volume name = " << volume->
GetName()
241 if (pVolume ==
nullptr) {
return; }
265 message <<
"VoxelHeader allocation error." <<
G4endl
266 <<
"Allocation of new VoxelHeader" <<
G4endl
267 <<
" for volume " << tVolume->
GetName() <<
" failed.";
268 G4Exception(
"G4GeometryManager::BuildOptimisations()",
"GeomMgt0003",
275 #ifdef G4GEOMETRY_VOXELDEBUG
276 G4cout <<
"**** G4GeometryManager::BuildOptimisations" <<
G4endl
277 <<
" Skipping logical volume name = " << tVolume->
GetName()
300 for (
size_t n=0;
n<Store->size(); ++
n)
315 if (!pVolume) {
return; }
346 G4Exception(
"G4GeometryManager::SetMaximumExtent()",
348 "Extent can be set only BEFORE creating any geometry object!");
361 G4cout <<
"G4GeometryManager::ReportVoxelStats -- Voxel Statistics"
367 G4int i, nStat = stats.size();
370 for( i=0; i<nStat; ++i ) { totalMemory += stats[i].GetMemoryUse(); }
372 G4cout <<
" Total memory consumed for geometry optimisation: "
373 << totalMemory/1024 <<
" kByte" <<
G4endl;
374 G4cout <<
" Total CPU time elapsed for geometry optimisation: "
375 << std::setprecision(2) << totalCpuTime <<
" seconds"
376 << std::setprecision(6) <<
G4endl;
381 std::sort( stats.begin(), stats.end(),
387 G4int nPrint = nStat > 10 ? 10 : nStat;
392 G4cout <<
" Percent Total CPU System CPU Memory Volume\n"
393 <<
" ------- ---------- ---------- -------- ----------"
398 for(i=0; i<nPrint; ++i)
404 if (system < 0) { system = 0.0; }
405 if ((total < 0) || (totalCpuTime <
perMillion))
408 { perc = total*100/totalCpuTime; }
410 G4cout << std::setprecision(2)
412 << std::setw(11) << perc
413 << std::setw(13) << total
414 << std::setw(13) << system
415 << std::setw(13) << (stats[i].GetMemoryUse()+512)/1024
417 << stats[i].GetVolume()->GetName()
418 << std::resetiosflags(std::ios::floatfield|std::ios::adjustfield)
419 << std::setprecision(6)
426 std::sort( stats.begin(), stats.end(),
434 G4cout <<
"\n Voxelisation: top memory users:" <<
G4endl;
435 G4cout <<
" Percent Memory Heads Nodes Pointers Total CPU Volume\n"
436 <<
" ------- -------- ------ ------ -------- ---------- ----------"
441 for(i=0; i<nPrint; ++i)
443 G4long memory = stats[i].GetMemoryUse();
444 G4double totTime = stats[i].GetTotalTime();
445 if (totTime < 0) { totTime = 0.0; }
447 G4cout << std::setprecision(2)
450 << std::setw(11) << memory/1024 <<
"k "
451 << std::setw( 9) << stats[i].GetNumberHeads()
452 << std::setw( 9) << stats[i].GetNumberNodes()
453 << std::setw(11) << stats[i].GetNumberPointers()
454 << std::setw(13) << totTime <<
" "
456 << stats[i].GetVolume()->GetName()
457 << std::resetiosflags(std::ios::floatfield|std::ios::adjustfield)
458 << std::setprecision(6)