better error messages

This commit is contained in:
andy
2009-04-14 14:05:47 +01:00
parent 37aec66281
commit e1cb1a379d

View File

@ -42,11 +42,13 @@ Foam::phaseProperties::phaseProperties(Istream& is)
dictionaryEntry phaseInfo(dictionary::null, is); dictionaryEntry phaseInfo(dictionary::null, is);
if (!phaseInfo.isDict()) if (phaseInfo.size() == 0)
{ {
FatalErrorIn("Foam::phaseProperties::phaseProperties(Istream& is)") FatalErrorIn
<< "Phase properties should be given in dictionary entries" (
<< nl << exit(FatalError); "Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)"
) << "No phases identified. Please define each phase property as "
<< "a dictionary entry" << nl << exit(FatalError);
} }
label nComponents = phaseInfo.size(); label nComponents = phaseInfo.size();
@ -85,16 +87,17 @@ Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)
dictionaryEntry phaseInfo(dictionary::null, is); dictionaryEntry phaseInfo(dictionary::null, is);
if (!phaseInfo.isDict()) if (phaseInfo.size() == 0)
{ {
FatalErrorIn FatalErrorIn
( (
"Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)" "Foam::Istream& Foam::operator>>(Istream& is, phaseProperties& pp)"
) << "Phase properties should be given in dictionary entries" ) << "No phases identified. Please define each phase property as "
<< nl << exit(FatalError); << "a dictionary entry" << nl << exit(FatalError);
} }
label nComponents = phaseInfo.size(); label nComponents = phaseInfo.size();
pp.names_.setSize(nComponents); pp.names_.setSize(nComponents);
pp.Y_.setSize(nComponents); pp.Y_.setSize(nComponents);