Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4SchedulerMessenger Class Reference

#include <G4SchedulerMessenger.hh>

Inheritance diagram for G4SchedulerMessenger:
Collaboration 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 ()
 
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)
 
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
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 66 of file G4SchedulerMessenger.hh.

Constructor & Destructor Documentation

G4SchedulerMessenger::G4SchedulerMessenger ( G4Scheduler runMgr)

Definition at line 47 of file G4SchedulerMessenger.cc.

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

Here is the call graph for this function:

G4SchedulerMessenger::~G4SchedulerMessenger ( )

Definition at line 122 of file G4SchedulerMessenger.cc.

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

Member Function Documentation

G4String G4SchedulerMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 179 of file G4SchedulerMessenger.cc.

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

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 136 of file G4SchedulerMessenger.cc.

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

Here is the call graph for this function:


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