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