39 qssCmdDir->SetGuidance(
"G4QSStepper configuration.");
42 dQMinCmd->SetDefaultUnit(
"mm");
43 dQMinCmd->SetParameterName(
"dQMinCmd",
false);
44 dQMinCmd->SetUnitCategory(
"Length");
47 dQRelCmd->SetGuidance(
"Default is 1e-5");
48 dQRelCmd->SetParameterName(
"dQRelCmd",
false);
51 stepperSelectorCmd->SetGuidance(
"Select stepper.");
52 stepperSelectorCmd->SetParameterName(
"choice",
false);
53 stepperSelectorCmd->SetCandidates(
"TemplatedDoPri OldRK45 G4QSS2");
56 maxSubstepsCmd->SetGuidance(
"Default is 5000");
57 maxSubstepsCmd->SetDefaultValue(5000);
58 maxSubstepsCmd->SetParameterName(
"maxSubstepsCmd",
false);
67 delete stepperSelectorCmd;
68 delete maxSubstepsCmd;
74 return &theSingleMessengerInstance;
104 if ( command == dQMinCmd )
106 good_value= Set_dQMin( dQMinCmd->GetNewDoubleValue(newValue) );
109 if ( command == dQRelCmd )
111 good_value= Set_dQRel( dQRelCmd->GetNewDoubleValue(newValue) );
114 if (command == maxSubstepsCmd)
117 good_value= SetMaxSubsteps ( maxSubstepsCmd->GetNewIntValue(newValue) );
121 <<
" ( old value = " << oldMaxSubstp <<
" )." <<
G4endl;
127 G4cerr <<
" G4QSSMessenger: Command FAILED - parameter was not accepted." <<
G4endl;
130 if(command == stepperSelectorCmd)
138 const std::map<std::string, StepperSelection> stepperMapping =
142 _selectedStepper = stepperMapping.at(newValue);
147 G4cout <<
"G4QSSMessenger: Selecting stepper " << newValue
148 <<
" ( which is method # " << _selectedStepper <<
" ) " <<
G4endl;
151 if( _selectedStepper ==
G4QSS2 )
157 if( _selectedStepper ==
G4QSS3 )
166 G4cerr <<
"G4QSSMessenger::selectStepper : Invalid type of stepper requested"
167 <<
" Cannot find the requested stepper type '" << newValue <<
G4endl;
175 if( 2 <= value && value <= 3 )
179 _selectedStepper =
G4QSS2;
183 _selectedStepper =
G4QSS3;
189 G4cerr <<
"G4QSSMessenger::SetQssOrder : requested invalid *order* of QSS-stepper"
190 <<
" Asked for " << value <<
" . Value must be either 2 or 3." <<
G4endl;
197 return _selectedStepper;
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
StepperSelection selectedStepper()
G4bool SetQssOrder(G4int order)
void SetNewValue(G4UIcommand *command, G4String newValues) override
void selectStepper(const std::string &)
static G4QSSMessenger * instance()
~G4QSSMessenger() override
static G4QSSParameters * Instance()
G4bool Set_dQMin(G4double dQMin)
G4bool SetQssOrder(G4int value, G4bool onlyWarn=false)
G4bool Set_dQRel(G4double dQRel)
G4bool SetMaxSubsteps(G4int maxSubsteps)
G4bool commandsShouldBeInMaster