Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -114,8 +114,8 @@ G4BooleanSolid::~G4BooleanSolid()
G4BooleanSolid::G4BooleanSolid(const G4BooleanSolid& rhs)
: G4VSolid (rhs), fPtrSolidA(rhs.fPtrSolidA), fPtrSolidB(rhs.fPtrSolidB),
fStatistics(rhs.fStatistics), fCubVolEpsilon(rhs.fCubVolEpsilon),
fAreaAccuracy(rhs.fAreaAccuracy), fCubicVolume(rhs.fCubicVolume),
fCubicVolume(rhs.fCubicVolume), fStatistics(rhs.fStatistics),
fCubVolEpsilon(rhs.fCubVolEpsilon), fAreaAccuracy(rhs.fAreaAccuracy),
fSurfaceArea(rhs.fSurfaceArea), fRebuildPolyhedron(false),
fpPolyhedron(nullptr), createdDisplacedSolid(rhs.createdDisplacedSolid)
{
@@ -409,3 +409,17 @@ G4BooleanSolid::StackPolyhedron(HepPolyhedronProcessor& processor,
return top;
}
//////////////////////////////////////////////////////////////////////////
//
// Estimate Cubic Volume (capacity) and store it for reuse.
G4double G4BooleanSolid::GetCubicVolume()
{
if(fCubicVolume < 0.)
{
fCubicVolume = EstimateCubicVolume(fStatistics,fCubVolEpsilon);
}
return fCubicVolume;
}
@@ -41,6 +41,8 @@
#include "G4Polyhedron.hh"
#include "HepPolyhedronProcessor.h"
#include "G4IntersectionSolid.hh"
#include <sstream>
///////////////////////////////////////////////////////////////////
@@ -571,3 +573,35 @@ G4SubtractionSolid::CreatePolyhedron () const
if (processor.execute(*result)) { return result; }
else { return nullptr; }
}
////////////////////////////////////////////////////
//
// GetCubicVolume
//
G4double G4SubtractionSolid::GetCubicVolume()
{
if( fCubicVolume != -1.0 ) {
return fCubicVolume;
}
G4double cubVolumeA = fPtrSolidA->GetCubicVolume();
G4ThreeVector bminA, bmaxA, bminB, bmaxB;
fPtrSolidA->BoundingLimits(bminA, bmaxA);
fPtrSolidB->BoundingLimits(bminB, bmaxB);
G4double intersection = 0.;
G4bool canIntersect =
bminA.x() < bmaxB.x() && bminA.y() < bmaxB.y() && bminA.z() < bmaxB.z() &&
bminB.x() < bmaxA.x() && bminB.y() < bmaxA.y() && bminB.z() < bmaxA.z();
if ( canIntersect )
{
G4IntersectionSolid intersectVol( "Temporary-Intersection-for-Union",
fPtrSolidA, fPtrSolidB );
intersection = intersectVol.GetCubicVolume();
}
fCubicVolume = cubVolumeA - intersection;
return fCubicVolume;
}
@@ -43,6 +43,8 @@
#include "G4Polyhedron.hh"
#include "HepPolyhedronProcessor.h"
#include "G4IntersectionSolid.hh"
///////////////////////////////////////////////////////////////////
//
// Transfer all data members to G4BooleanSolid which is responsible
@@ -526,3 +528,36 @@ G4UnionSolid::CreatePolyhedron () const
if (processor.execute(*result)) { return result; }
else { return nullptr; }
}
////////////////////////////////////////////////////
//
// GetCubicVolume
G4double G4UnionSolid::GetCubicVolume()
{
if( fCubicVolume != -1.0 ) {
return fCubicVolume;
}
G4double cubVolumeA = fPtrSolidA->GetCubicVolume();
G4double cubVolumeB = fPtrSolidB->GetCubicVolume();
G4ThreeVector bminA, bmaxA, bminB, bmaxB;
fPtrSolidA->BoundingLimits(bminA, bmaxA);
fPtrSolidB->BoundingLimits(bminB, bmaxB);
G4double intersection = 0.;
G4bool canIntersect =
bminA.x() < bmaxB.x() && bminA.y() < bmaxB.y() && bminA.z() < bmaxB.z() &&
bminB.x() < bmaxA.x() && bminB.y() < bmaxA.y() && bminB.z() < bmaxA.z();
if ( canIntersect )
{
G4IntersectionSolid intersectVol( "Temporary-Intersection-for-Union",
fPtrSolidA, fPtrSolidB );
intersection = intersectVol.GetCubicVolume();
}
fCubicVolume = cubVolumeA + cubVolumeB - intersection;
return fCubicVolume;
}