55 std::istringstream iss(newValue);
66 description <<
" marker : " << marker <<
G4endl;
67 G4Exception(
"G4MoleculeTableMessenger::SetNewValue",
72 iss >> speciesDefName;
85 iss >> diffusion_coefficient;
91 iss >> VanDerVaalsRadius;
99 if(VanDerVaalsRadius != 0)
101 pConf->SetVanDerVaalsRadius(VanDerVaalsRadius * nm);
103 if(diffusion_coefficient != 0)
105 pConf->SetDiffusionCoefficient(diffusion_coefficient * (m2 / s));
112 if(particleDef !=
nullptr)
116 particleDef, charge);
117 if(molConf ==
nullptr)
120 description <<
"This molecule has not been defined" <<
G4endl;
121 G4Exception(
"G4MoleculeTableMessenger::SetNewValue",
124 molConf->UnFinalize();
125 if(VanDerVaalsRadius != 0)
127 molConf->SetVanDerVaalsRadius(VanDerVaalsRadius * nm);
129 if(diffusion_coefficient != 0)
131 molConf->SetDiffusionCoefficient(diffusion_coefficient * (m2 / s));
134 auto usedName = molConf->GetUserID();
137 molConf->PrintState();
139 description <<
"This molecule has been defined by the name : "
140 << usedName <<
" . Please, use this name." <<
G4endl;
141 G4Exception(
"G4MoleculeTableMessenger::SetNewValue",
146 molConf->SetUserID(speciesName);
153 diffusion_coefficient * (m * m / s),
156 VanDerVaalsRadius * nm);
157 G4bool alreadyCreated(
false);
159 speciesName, speciesDef, alreadyCreated);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static G4MolecularConfiguration * GetOrCreateMolecularConfiguration(const G4MoleculeDefinition *)
static G4MolecularConfiguration * GetMolecularConfiguration(const G4MoleculeDefinition *, const G4String &label)
static G4MolecularConfiguration * CreateMolecularConfiguration(const G4String &userIdentifier, const G4MoleculeDefinition *, bool &wasAlreadyCreated)
std::unique_ptr< G4UIcmdWithoutParameter > fpPrintTable
void SetNewValue(G4UIcommand *command, G4String newValue) override
std::unique_ptr< G4UIcmdWithAString > fpSpecies
G4MoleculeTableMessenger()
~G4MoleculeTableMessenger() override
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()