Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SolidsWorkspace Class Reference

G4SolidsWorkspace manages the per-thread state of thoese solids which have a per-thread state and dependent classes (if any). It takes ownership and control of per-thread state of classes to work with multi-threading. More...

#include <G4SolidsWorkspace.hh>

Public Types

using pool_type = G4TWorkspacePool<G4SolidsWorkspace>

Public Member Functions

 G4SolidsWorkspace (G4bool verbose=false)
 ~G4SolidsWorkspace ()=default
void UseWorkspace ()
void ReleaseWorkspace ()
void DestroyWorkspace ()
void InitialiseWorkspace ()
void SetVerbose (G4bool v)
G4bool GetVerbose ()

Static Public Member Functions

static pool_typeGetPool ()

Detailed Description

G4SolidsWorkspace manages the per-thread state of thoese solids which have a per-thread state and dependent classes (if any). It takes ownership and control of per-thread state of classes to work with multi-threading.

Definition at line 60 of file G4SolidsWorkspace.hh.

Member Typedef Documentation

◆ pool_type

Constructor & Destructor Documentation

◆ G4SolidsWorkspace()

G4SolidsWorkspace::G4SolidsWorkspace ( G4bool verbose = false)

Constructor.

Parameters
[in]verboseVerbosity flag.

Definition at line 48 of file G4SolidsWorkspace.cc.

49 : fVerbose(verbose)
50{
51 fpPolyconeSideSIM=
53 fpPolyhedraSideSIM=
55
56 // Copy information from master into PolyCone/Gon Sides in this thread.
58
59 // Capture its address of PolyCone/Gon Sides in this thread
60 fPolyconeSideOffset = fpPolyconeSideSIM->GetOffset();
61 fPolyhedraSideOffset = fpPolyhedraSideSIM->GetOffset();
62}
G4GeomSplitter< G4PlSideData > G4PlSideManager
G4GeomSplitter< G4PhSideData > G4PhSideManager
static const G4PlSideManager & GetSubInstanceManager()
static const G4PhSideManager & GetSubInstanceManager()

◆ ~G4SolidsWorkspace()

G4SolidsWorkspace::~G4SolidsWorkspace ( )
default

Default Destructor.

Member Function Documentation

◆ DestroyWorkspace()

void G4SolidsWorkspace::DestroyWorkspace ( )

Definition at line 119 of file G4SolidsWorkspace.cc.

120{
121 fpPolyconeSideSIM->FreeSlave();
122 fpPolyhedraSideSIM->FreeSlave();
123}

Referenced by G4WorkerThread::UpdateGeometryAndPhysicsVectorFromMaster().

◆ GetPool()

◆ GetVerbose()

G4bool G4SolidsWorkspace::GetVerbose ( )
inline

Definition at line 94 of file G4SolidsWorkspace.hh.

94{ return fVerbose; }

◆ InitialiseWorkspace()

void G4SolidsWorkspace::InitialiseWorkspace ( )

Method to be called at start of each run (especially at the 2nd and further runs).

Definition at line 94 of file G4SolidsWorkspace.cc.

95{
96 if( fVerbose )
97 {
98 G4cout << "G4SolidsWorkspace::InitialiseWorkspace: "
99 << "Copying geometry - Start " << G4endl;
100 }
101
102 // Geometry related, split classes mechanism:
103 // Do *NOT* instantiate sub-instance for this thread, just copy the contents!!
104 //
105 fpPolyconeSideSIM->SlaveInitializeSubInstance();
106 fpPolyhedraSideSIM->SlaveInitializeSubInstance();
107
108 // Additional initialization if needed - beyond copying memory
109 //
110 InitialiseSolids();
111
112 if( fVerbose )
113 {
114 G4cout << "G4SolidsWorkspace::CreateAndUseWorkspace: "
115 << "Copying geometry - Done!" << G4endl;
116 }
117}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by G4SolidsWorkspace(), and G4WorkerThread::UpdateGeometryAndPhysicsVectorFromMaster().

◆ ReleaseWorkspace()

void G4SolidsWorkspace::ReleaseWorkspace ( )

Definition at line 82 of file G4SolidsWorkspace.cc.

84{
85 fpPolyconeSideSIM->UseWorkArea(nullptr);
86 fpPolyhedraSideSIM->UseWorkArea(nullptr);
87}

◆ SetVerbose()

void G4SolidsWorkspace::SetVerbose ( G4bool v)
inline

Accessor/modifier for verbosity.

Definition at line 93 of file G4SolidsWorkspace.hh.

93{ fVerbose=v; }

◆ UseWorkspace()

void G4SolidsWorkspace::UseWorkspace ( )

Methods to achieve/release ownership.

Definition at line 66 of file G4SolidsWorkspace.cc.

67{
68 if( fVerbose )
69 {
70 G4cout << "G4SolidsWorkspace::UseWorkspace: Copying geometry - Start "
71 << G4endl;
72 }
73
74 // Geometry related, split classes mechanism: instantiate sub-instance
75 // for this thread
76 //
77 fpPolyconeSideSIM->UseWorkArea(fPolyconeSideOffset);
78 fpPolyhedraSideSIM->UseWorkArea(fPolyhedraSideOffset);
79}

The documentation for this class was generated from the following files: