enrichedPatchPointPoints.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 "enrichedPatch.H"
00030 #include "primitiveMesh.H"
00031 #include "DynamicList.H"
00032
00033
00034
00035
00036
00037
00038 void Foam::enrichedPatch::calcPointPoints() const
00039 {
00040
00041 if (pointPointsPtr_)
00042 {
00043 FatalErrorIn("void enrichedPatch::calcPointPoints() const")
00044 << "Point-point addressing already calculated."
00045 << abort(FatalError);
00046 }
00047
00048
00049
00050
00051
00052 List<DynamicList<label, primitiveMesh::edgesPerPoint_> >
00053 pp(meshPoints().size());
00054
00055 const faceList& lf = localFaces();
00056
00057 register bool found = false;
00058
00059 forAll (lf, faceI)
00060 {
00061 const face& curFace = lf[faceI];
00062
00063 forAll (curFace, pointI)
00064 {
00065 DynamicList<label, primitiveMesh::edgesPerPoint_>&
00066 curPp = pp[curFace[pointI]];
00067
00068
00069 label next = curFace.nextLabel(pointI);
00070
00071 found = false;
00072
00073 forAll (curPp, i)
00074 {
00075 if (curPp[i] == next)
00076 {
00077 found = true;
00078 break;
00079 }
00080 }
00081
00082 if (!found)
00083 {
00084 curPp.append(next);
00085 }
00086
00087
00088 label prev = curFace.prevLabel(pointI);
00089 found = false;
00090
00091 forAll (curPp, i)
00092 {
00093 if (curPp[i] == prev)
00094 {
00095 found = true;
00096 break;
00097 }
00098 }
00099
00100 if (!found)
00101 {
00102 curPp.append(prev);
00103 }
00104 }
00105 }
00106
00107
00108 pointPointsPtr_ = new labelListList(pp.size());
00109 labelListList& ppAddr = *pointPointsPtr_;
00110
00111 forAll (pp, pointI)
00112 {
00113 ppAddr[pointI].transfer(pp[pointI]);
00114 }
00115 }
00116
00117
00118
Copyright © 2000-2009 OpenCFD Ltd