Problem 1880 - Provide method to check existence of unit
Summary: Provide method to check existence of unit
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: global/management (show other problems)
Version: 10.2
Hardware: All All
: P5 minor
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2016-08-16 21:42 CEST by David Hall
Modified: 2016-08-18 18:15 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description David Hall 2016-08-16 21:42:18 CEST
In Geant4.10.2.p02, the failure of G4UnitDefinition::GetValueOf(G4String unit) was raised from a warning to a fatal error (#1843). We were using this method to check that a unit is defined, but this is no longer possible.

Please could we have a new G4UnitDefinition::IsDefined(G4String unit) method?

Thanks,
David
Comment 1 Gabriele Cosmo 2016-08-18 09:42:07 CEST
Thanks for reporting the use-case. A new static method "G4bool IsUnitDefined(const G4String&)" has been added in the development version and will be available in the next release.
Comment 2 David Hall 2016-08-18 18:15:19 CEST
Thanks a lot, Gabriele!