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