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