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