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