newSolid.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "solid.H"
00028
00029
00030
00031 Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
00032 {
00033 if (debug)
00034 {
00035 Info<< "solid::New(Istream&): "
00036 << "constructing solid"
00037 << endl;
00038 }
00039
00040 word solidType(is);
00041
00042 word coeffs(is);
00043
00044 if (coeffs == "defaultCoeffs")
00045 {
00046 ConstructorTable::iterator cstrIter =
00047 ConstructorTablePtr_->find(solidType);
00048
00049 if (cstrIter == ConstructorTablePtr_->end())
00050 {
00051 FatalErrorIn("solid::New(Istream&)")
00052 << "Unknown solid type " << solidType << nl << nl
00053 << "Valid solid types are:" << endl
00054 << ConstructorTablePtr_->toc()
00055 << exit(FatalError);
00056 }
00057
00058 return autoPtr<solid>(cstrIter()());
00059 }
00060 else if (coeffs == "coeffs")
00061 {
00062 IstreamConstructorTable::iterator cstrIter =
00063 IstreamConstructorTablePtr_->find(solidType);
00064
00065 if (cstrIter == IstreamConstructorTablePtr_->end())
00066 {
00067 FatalErrorIn("solid::New(Istream&)")
00068 << "Unknown solid type " << solidType << nl << nl
00069 << "Valid solid types are:" << endl
00070 << IstreamConstructorTablePtr_->toc()
00071 << exit(FatalError);
00072 }
00073
00074 return autoPtr<solid>(cstrIter()(is));
00075 }
00076 else
00077 {
00078 FatalErrorIn("solid::New(Istream&)")
00079 << "solid type " << solidType
00080 << ", option " << coeffs << " given"
00081 << ", should be coeffs or defaultCoeffs"
00082 << exit(FatalError);
00083
00084 return autoPtr<solid>(NULL);
00085 }
00086 }
00087
00088
00089
Copyright © 2000-2009 OpenCFD Ltd