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

#include <G4SchedulerMessenger.hh>

+ Inheritance diagram for G4SchedulerMessenger:

Public Member Functions

 G4SchedulerMessenger (G4Scheduler *runMgr)
 
 ~G4SchedulerMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4long StoL (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 65 of file G4SchedulerMessenger.hh.

Constructor & Destructor Documentation

◆ G4SchedulerMessenger()

G4SchedulerMessenger::G4SchedulerMessenger ( G4Scheduler runMgr)

Definition at line 46 of file G4SchedulerMessenger.cc.

46 :
47 fScheduler(stepMgr)
48{
49 fITDirectory = new G4UIdirectory("/scheduler/");
50 fITDirectory->SetGuidance("Control commands for the time scheduler "
51 "(dna chemistry applications).");
52
53 // Set end time
54 fEndTime = new G4UIcmdWithADoubleAndUnit("/scheduler/endTime", this);
55 fEndTime->SetGuidance("Set time at which the simulation must stop.");
57 fEndTime->SetUnitCategory("Time");
58 fEndTime->SetDefaultUnit("picosecond");
59 fEndTime->SetDefaultValue(1);
60
61 // Set time tolerance
62 fTimeTolerance = new G4UIcmdWithADoubleAndUnit("/scheduler/timeTolerance",
63 this);
64 fTimeTolerance->SetGuidance("This command aims at resolving issues related to"
65 " floating points. If two time events are separated by less than the "
66 "selected tolerance, they are assumed to belong to the same time step.");
68 fTimeTolerance->SetUnitCategory("Time");
69 fTimeTolerance->SetDefaultUnit("picosecond");
70 fTimeTolerance->SetDefaultValue(1);
71
72 // Initialize
73 fInitCmd = new G4UIcmdWithoutParameter("/scheduler/initialize", this);
74 fInitCmd->SetGuidance("Initialize G4Scheduler. This is done "
75 "for standalone application only (no physics).");
77
78 // Set Max Null time Step
79 fMaxNULLTimeSteps = new G4UIcmdWithAnInteger("/scheduler/maxNullTimeSteps",
80 this);
81 fMaxNULLTimeSteps->SetGuidance("Set maximum allowed zero time steps. After this "
82 "threshold, the simulation is stopped.");
83 fMaxNULLTimeSteps->SetParameterName("numberOfNullTimeSteps", true);
84 fMaxNULLTimeSteps->SetDefaultValue(10);
85 fMaxNULLTimeSteps->SetRange("numberOfNullTimeSteps >=0 ");
86
87 fMaxStepNumber = new G4UIcmdWithAnInteger("/scheduler/maxStepNumber", this);
88 fMaxStepNumber->SetGuidance("Set the maximum number of time steps. After this "
89 "threshold, the simulation is stopped.");
90 fMaxStepNumber->SetParameterName("maximumNumberOfSteps", true);
91 fMaxStepNumber->SetDefaultValue(-1);
92
93 // Beam On
94 fProcessCmd = new G4UIcmdWithoutParameter("/scheduler/process", this);
95 fProcessCmd->SetGuidance("Process stacked tracks in G4Scheduler. This is done "
96 "for standalone application only (no physics).");
98
99 // Verbose
100 fVerboseCmd = new G4UIcmdWithAnInteger("/scheduler/verbose", this);
101 fVerboseCmd->SetGuidance("Set the Verbose level of G4Scheduler.");
102 fVerboseCmd->SetGuidance(" 0 : Silent (default)");
103 fVerboseCmd->SetGuidance(" 1 : Display reactions");
104 fVerboseCmd->SetGuidance(" 2 ");
105 fVerboseCmd->SetParameterName("level", true);
106 fVerboseCmd->SetDefaultValue(1);
107 // fVerboseCmd->SetRange("level >=0 && level <=4");
108
109 fWhyDoYouStop = new G4UIcmdWithoutParameter("/scheduler/whyDoYouStop",this);
110 fWhyDoYouStop->SetGuidance("Will print information on why the scheduler is "
111 "stopping the process");
112
113 fUseDefaultTimeSteps = new G4UIcmdWithABool("/scheduler/useDefaultTimeSteps",
114 this);
115 fUseDefaultTimeSteps->SetGuidance("Let the G4 processes decided for the next "
116 "time step interval. This command would be interesting if no reaction has "
117 "been set and if one will want to track down Brownian objects. "
118 "NB: This command gets in conflicts with the declaration of time steps.");
119}
@ G4State_Idle
@ G4State_PreInit
void SetUnitCategory(const char *unitCategory)
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:273

◆ ~G4SchedulerMessenger()

G4SchedulerMessenger::~G4SchedulerMessenger ( )

Definition at line 121 of file G4SchedulerMessenger.cc.

122{
123 delete fTimeTolerance;
124 delete fITDirectory;
125 delete fInitCmd;
126 delete fEndTime;
127 delete fMaxNULLTimeSteps;
128 delete fMaxStepNumber;
129 delete fProcessCmd;
130 delete fVerboseCmd;
131 delete fWhyDoYouStop;
132 delete fUseDefaultTimeSteps;
133}

Member Function Documentation

◆ GetCurrentValue()

G4String G4SchedulerMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 178 of file G4SchedulerMessenger.cc.

179{
180 G4String cv;
181
182 if (command == fVerboseCmd)
183 {
184 cv = fVerboseCmd->ConvertToString(fScheduler->GetVerbose());
185 }
186 else if (command == fEndTime)
187 {
188 cv = fEndTime->ConvertToString(fScheduler->GetEndTime());
189 }
190 else if (command == fTimeTolerance)
191 {
192 cv = fTimeTolerance->ConvertToString(fScheduler->GetTimeTolerance());
193 }
194 else if (command == fInitCmd)
195 {
196 cv = fInitCmd->ConvertToString(fScheduler->IsInitialized());
197 }
198 else if (command == fMaxNULLTimeSteps)
199 {
200 cv = fMaxNULLTimeSteps->ConvertToString(
201 fScheduler->GetMaxZeroTimeAllowed());
202 }
203 else if (command == fMaxStepNumber)
204 {
205 cv = fMaxStepNumber->ConvertToString(fScheduler->GetMaxNbSteps());
206 }
207 else if (command == fUseDefaultTimeSteps)
208 {
209 cv = fUseDefaultTimeSteps->ConvertToString(fScheduler->AreDefaultTimeStepsUsed());
210 }
211
212 return cv;
213}
int GetMaxZeroTimeAllowed() const
Definition: G4Scheduler.hh:382
int GetVerbose() const
Definition: G4Scheduler.hh:371
G4int GetMaxNbSteps() const
Definition: G4Scheduler.hh:325
G4double GetEndTime() const
Definition: G4Scheduler.hh:335
G4bool AreDefaultTimeStepsUsed()
Definition: G4Scheduler.hh:437
bool IsInitialized()
Definition: G4Scheduler.hh:282
double GetTimeTolerance() const
Definition: G4Scheduler.hh:392
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:430

◆ SetNewValue()

void G4SchedulerMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 135 of file G4SchedulerMessenger.cc.

137{
138 if (command == fProcessCmd)
139 {
140 fScheduler->Process();
141 }
142 else if (command == fEndTime)
143 {
144 fScheduler->SetEndTime(fEndTime->GetNewDoubleValue(newValue));
145 }
146 else if (command == fTimeTolerance)
147 {
148 fScheduler->SetTimeTolerance(
149 fTimeTolerance->GetNewDoubleValue(newValue));
150 }
151 else if (command == fVerboseCmd)
152 {
153 fScheduler->SetVerbose(fVerboseCmd->GetNewIntValue(newValue));
154 }
155 else if (command == fInitCmd)
156 {
157 fScheduler->Initialize();
158 }
159 else if (command == fMaxNULLTimeSteps)
160 {
161 fScheduler->SetMaxZeroTimeAllowed(
162 fMaxNULLTimeSteps->GetNewIntValue(newValue));
163 }
164 else if (command == fMaxStepNumber)
165 {
166 fScheduler->SetMaxNbSteps(fMaxStepNumber->GetNewIntValue(newValue));
167 }
168 else if (command == fWhyDoYouStop)
169 {
170 fScheduler->WhyDoYouStop();
171 }
172 else if (command == fUseDefaultTimeSteps)
173 {
174 fScheduler->UseDefaultTimeSteps(fUseDefaultTimeSteps->GetNewBoolValue(newValue));
175 }
176}
void SetTimeTolerance(double)
Definition: G4Scheduler.hh:387
void SetEndTime(const double)
Definition: G4Scheduler.hh:292
void SetMaxZeroTimeAllowed(int)
Definition: G4Scheduler.hh:377
void SetMaxNbSteps(G4int)
Definition: G4Scheduler.hh:320
void Process()
Definition: G4Scheduler.cc:376
void WhyDoYouStop()
Definition: G4Scheduler.hh:427
void SetVerbose(int)
Definition: G4Scheduler.hh:366
void Initialize()
Definition: G4Scheduler.cc:281
void UseDefaultTimeSteps(G4bool)
Definition: G4Scheduler.hh:432
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)

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