diff --git a/diffusivityModel/Particle/Particle.C b/diffusivityModel/Particle/Particle.C index c2f21de..aa6120c 100644 --- a/diffusivityModel/Particle/Particle.C +++ b/diffusivityModel/Particle/Particle.C @@ -78,37 +78,52 @@ Foam::Particle::Particle(const dictionary& thermoDict, const dictionary& tranDic Zrot_(tranDict.lookupOrDefault("rotationalRelaxation", 0.0)), thermo_(thermoDict) { - label geometry = 0; - const entry* entryPtr = tranDict.lookupEntryPtr("tranlib", false, true); if (entryPtr) { scalarList tranlib(entryPtr->stream()); - geometry = tranlib[0]; + label geometry = tranlib[0]; + + switch(geometry) + { + case 0: + geometry_ = Geometry::ATOM; + break; + case 1: + geometry_ = Geometry::LINEAR; + break; + case 2: + geometry_ = Geometry::NONLINEAR; + break; + default: + FatalErrorInFunction + << "Illegal molecule geometry type. 0, 1 and 2 are allowed." + << abort(FatalError); + } } else { - geometry = readLabel(tranDict.lookup("geometry")); - } - - switch(geometry) - { - case 0: - geometry_ = Geometry::ATOM; - break; - case 1: - geometry_ = Geometry::LINEAR; - break; - case 2: - geometry_ = Geometry::NONLINEAR; - break; - default: + word gWord(tranDict.lookup("geometry")); + if (gWord == "atom") + { + geometry_ = Geometry::ATOM; + } + else if (gWord == "linear") + { + geometry_ = Geometry::LINEAR; + } + else if (gWord == "nonlinear") + { + geometry_ = Geometry::NONLINEAR; + } + else + { FatalErrorInFunction - << "Illegal molecule geometry type. 0, 1 and 2 are allowed." + << "Illegal molecule geometry type. atom, linear and nonlinear are allowed." << abort(FatalError); + } } - }