surfZone.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
00028
00029 #include "surfZone.H"
00030 #include "dictionary.H"
00031 #include "word.H"
00032
00033
00034
00035 defineTypeNameAndDebug(Foam::surfZone, 0);
00036
00037
00038
00039
00040 Foam::surfZone::surfZone()
00041 :
00042 surfZoneIdentifier(),
00043 size_(0),
00044 start_(0)
00045 {}
00046
00047
00048 Foam::surfZone::surfZone
00049 (
00050 const word& name,
00051 const label size,
00052 const label start,
00053 const label index,
00054 const word& geometricType
00055 )
00056 :
00057 surfZoneIdentifier(name, index, geometricType),
00058 size_(size),
00059 start_(start)
00060 {}
00061
00062
00063 Foam::surfZone::surfZone(Istream& is, const label index)
00064 :
00065 surfZoneIdentifier(),
00066 size_(0),
00067 start_(0)
00068 {
00069 word name(is);
00070 dictionary dict(is);
00071
00072 operator=(surfZone(name, dict, index));
00073 }
00074
00075
00076 Foam::surfZone::surfZone
00077 (
00078 const word& name,
00079 const dictionary& dict,
00080 const label index
00081 )
00082 :
00083 surfZoneIdentifier(name, dict, index),
00084 size_(readLabel(dict.lookup("nFaces"))),
00085 start_(readLabel(dict.lookup("startFace")))
00086 {}
00087
00088
00089 Foam::surfZone::surfZone(const surfZone& zone)
00090 :
00091 surfZoneIdentifier(zone, zone.index()),
00092 size_(zone.size()),
00093 start_(zone.start())
00094 {}
00095
00096
00097 Foam::surfZone::surfZone(const surfZone& zone, const label index)
00098 :
00099 surfZoneIdentifier(zone, index),
00100 size_(zone.size()),
00101 start_(zone.start())
00102 {}
00103
00104
00105
00106
00107 void Foam::surfZone::write(Ostream& os) const
00108 {
00109 writeDict(os);
00110 }
00111
00112
00113 void Foam::surfZone::writeDict(Ostream& os) const
00114 {
00115 os << indent << name() << nl
00116 << indent << token::BEGIN_BLOCK << incrIndent << nl;
00117
00118 surfZoneIdentifier::write(os);
00119 os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
00120 os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
00121
00122 os << decrIndent << indent << token::END_BLOCK << endl;
00123 }
00124
00125
00126
00127
00128 bool Foam::surfZone::operator!=(const surfZone& rhs) const
00129 {
00130 return !(*this == rhs);
00131 }
00132
00133
00134 bool Foam::surfZone::operator==(const surfZone& rhs) const
00135 {
00136 return
00137 (
00138 size() == rhs.size()
00139 && start() == rhs.start()
00140 && geometricType() == rhs.geometricType()
00141 );
00142 }
00143
00144
00145
00146
00147 Foam::Istream& Foam::operator>>(Istream& is, surfZone& zone)
00148 {
00149 zone = surfZone(is, 0);
00150
00151 is.check("Istream& operator>>(Istream&, surfZone&)");
00152 return is;
00153 }
00154
00155
00156 Foam::Ostream& Foam::operator<<(Ostream& os, const surfZone& zone)
00157 {
00158 zone.write(os);
00159 os.check("Ostream& operator<<(Ostream&, const surfZone&");
00160 return os;
00161 }
00162
00163
00164
Copyright © 2000-2009 OpenCFD Ltd