curvedEdge.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
00030
00031
00032 #include "error.H"
00033
00034 #include "curvedEdge.H"
00035
00036
00037
00038 namespace Foam
00039 {
00040
00041
00042
00043 defineTypeNameAndDebug(curvedEdge, 0);
00044 defineRunTimeSelectionTable(curvedEdge, Istream);
00045
00046
00047
00048
00049
00050 curvedEdge::curvedEdge
00051 (
00052 const pointField& points,
00053 const label start,
00054 const label end
00055 )
00056 :
00057 points_(points),
00058 start_(start),
00059 end_(end)
00060 {}
00061
00062
00063
00064 curvedEdge::curvedEdge(const pointField& points, Istream& is)
00065 :
00066 points_(points),
00067 start_(readLabel(is)),
00068 end_(readLabel(is))
00069 {}
00070
00071
00072
00073 curvedEdge::curvedEdge(const curvedEdge& c)
00074 :
00075 points_(c.points_),
00076 start_(c.start_),
00077 end_(c.end_)
00078 {}
00079
00080
00081
00082 autoPtr<curvedEdge> curvedEdge::clone() const
00083 {
00084 notImplemented("curvedEdge::clone() const");
00085 return autoPtr<curvedEdge>(NULL);
00086 }
00087
00088
00089
00090 autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
00091 {
00092 if (debug)
00093 {
00094 Info<< "curvedEdge::New(const pointField&, Istream&) : "
00095 << "constructing curvedEdge"
00096 << endl;
00097 }
00098
00099 word curvedEdgeType(is);
00100
00101 IstreamConstructorTable::iterator cstrIter =
00102 IstreamConstructorTablePtr_
00103 ->find(curvedEdgeType);
00104
00105 if (cstrIter == IstreamConstructorTablePtr_->end())
00106 {
00107 FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
00108 << "Unknown curvedEdge type " << curvedEdgeType << endl << endl
00109 << "Valid curvedEdge types are" << endl
00110 << IstreamConstructorTablePtr_->toc()
00111 << abort(FatalError);
00112 }
00113
00114 return autoPtr<curvedEdge>(cstrIter()(points, is));
00115 }
00116
00117
00118
00119
00120
00121
00122 pointField knotlist
00123 (
00124 const pointField& points,
00125 const label start,
00126 const label end,
00127 const pointField& otherknots
00128 )
00129 {
00130 label listsize(otherknots.size() + 2);
00131 pointField tmp(listsize);
00132
00133 tmp[0] = points[start];
00134
00135 for (register label i=1; i<listsize-1; i++)
00136 {
00137 tmp[i] = otherknots[i-1];
00138 }
00139
00140 tmp[listsize-1] = points[end];
00141
00142 return tmp;
00143 }
00144
00145
00146
00147
00148 void curvedEdge::operator=(const curvedEdge&)
00149 {
00150 notImplemented("void curvedEdge::operator=(const curvedEdge&)");
00151 }
00152
00153
00154 Ostream& operator<<(Ostream& os, const curvedEdge& p)
00155 {
00156 os << p.start_ << tab << p.end_ << endl;
00157
00158 return os;
00159 }
00160
00161
00162
00163
00164 }
00165
00166
Copyright © 2000-2009 OpenCFD Ltd