1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
26 \*---------------------------------------------------------------------------*/
29 #include "faGlobalMeshData.H"
32 #include "primitiveMesh.H"
33 #include "demandDrivenData.H"
34 #include "IndirectList.H"
35 #include "areaFields.H"
36 #include "edgeFields.H"
37 #include "faMeshLduAddressing.H"
38 #include "wedgeFaPatch.H"
39 #include "faPatchData.H"
40 #include "SortableList.H"
41 #include "controlSwitches.H"
43 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
47 defineTypeNameAndDebug(faMesh, 0);
50 Foam::word Foam::faMesh::meshSubDir = "faMesh";
52 const Foam::debug::optimisationSwitch
53 Foam::faMesh::quadricsFit_
60 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
62 void Foam::faMesh::setPrimitiveMeshData()
66 Info<< "void faMesh::setPrimitiveMeshData() const : "
67 << "Setting primitive data" << endl;
70 const indirectPrimitivePatch& bp = patch();
73 edges_.setSize(bp.nEdges());
78 label nIntEdges = bp.nInternalEdges();
80 for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
82 edges_[++edgeI] = bp.edges()[curEdge];
85 forAll (boundary(), patchI)
87 const labelList& curP = boundary()[patchI];
91 edges_[++edgeI] = bp.edges()[curP[eI]];
95 nEdges_ = edges_.size();
96 nInternalEdges_ = nIntEdges;
99 // Set edge owner and neighbour
100 edgeOwner_.setSize(nEdges());
101 edgeNeighbour_.setSize(nInternalEdges());
105 const labelListList& bpef = bp.edgeFaces();
107 for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
109 edgeOwner_[++edgeI] = bpef[curEdge][0];
111 edgeNeighbour_[edgeI] = bpef[curEdge][1];
114 forAll (boundary(), patchI)
116 const labelList& curP = boundary()[patchI];
120 edgeOwner_[++edgeI] = bpef[curP[eI]][0];
124 // Set number of faces
127 // Set number of points
128 nPoints_ = bp.nPoints();
132 void Foam::faMesh::clearGeomNotAreas() const
136 Info<< "void faMesh::clearGeomNotAreas() const : "
137 << "Clearing geometry" << endl;
140 deleteDemandDrivenData(SPtr_);
141 deleteDemandDrivenData(patchPtr_);
142 deleteDemandDrivenData(patchStartsPtr_);
143 deleteDemandDrivenData(LePtr_);
144 deleteDemandDrivenData(magLePtr_);
145 deleteDemandDrivenData(centresPtr_);
146 deleteDemandDrivenData(edgeCentresPtr_);
147 deleteDemandDrivenData(faceAreaNormalsPtr_);
148 deleteDemandDrivenData(edgeAreaNormalsPtr_);
149 deleteDemandDrivenData(pointAreaNormalsPtr_);
150 deleteDemandDrivenData(faceCurvaturesPtr_);
151 deleteDemandDrivenData(edgeTransformTensorsPtr_);
155 void Foam::faMesh::clearGeom() const
159 Info<< "void faMesh::clearGeom() const : "
160 << "Clearing geometry" << endl;
164 deleteDemandDrivenData(S0Ptr_);
165 deleteDemandDrivenData(S00Ptr_);
166 deleteDemandDrivenData(correctPatchPointNormalsPtr_);
170 void Foam::faMesh::clearAddressing() const
174 Info<< "void faMesh::clearAddressing() const : "
175 << "Clearing addressing" << endl;
178 deleteDemandDrivenData(lduPtr_);
182 void Foam::faMesh::clearOut() const
186 deleteDemandDrivenData(globalMeshDataPtr_);
190 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
192 Foam::faMesh::faMesh(const polyMesh& pMesh)
194 GeoMesh<polyMesh>(pMesh),
195 MeshObject<polyMesh, faMesh>(pMesh),
196 edgeInterpolation(*this),
202 time().findInstance(meshDir(), "faceLabels"),
214 time().findInstance(meshDir(), "faBoundary"),
224 curTimeIndex_(time().timeIndex()),
228 patchStartsPtr_(NULL),
232 edgeCentresPtr_(NULL),
233 faceAreaNormalsPtr_(NULL),
234 edgeAreaNormalsPtr_(NULL),
235 pointAreaNormalsPtr_(NULL),
236 faceCurvaturesPtr_(NULL),
237 edgeTransformTensorsPtr_(NULL),
238 correctPatchPointNormalsPtr_(NULL),
239 globalMeshDataPtr_(NULL)
243 Info<< "faMesh::faMesh(...) : "
244 << "Creating faMesh from IOobject" << endl;
247 setPrimitiveMeshData();
249 // Create global mesh data
250 if (Pstream::parRun())
255 // Calculate topology for the patches (processor-processor comms etc.)
256 boundary_.updateMesh();
258 // Calculate the geometry for the patches (transformation tensors etc.)
259 boundary_.calcGeometry();
261 if (isFile(pMesh.time().timePath()/"S0"))
263 S0Ptr_ = new DimensionedField<scalar, areaMesh>
280 // Construct from components without boundary.
283 const polyMesh& pMesh,
284 const labelList& faceLabels
287 GeoMesh<polyMesh>(pMesh),
288 MeshObject<polyMesh, faMesh>(pMesh),
289 edgeInterpolation(*this),
295 mesh().facesInstance(),
308 mesh().facesInstance(),
319 curTimeIndex_(time().timeIndex()),
323 patchStartsPtr_(NULL),
327 edgeCentresPtr_(NULL),
328 faceAreaNormalsPtr_(NULL),
329 edgeAreaNormalsPtr_(NULL),
330 pointAreaNormalsPtr_(NULL),
331 faceCurvaturesPtr_(NULL),
332 edgeTransformTensorsPtr_(NULL),
333 correctPatchPointNormalsPtr_(NULL),
334 globalMeshDataPtr_(NULL)
338 Info<< "faMesh::faMesh(...) : "
339 << "Creating faMesh from components" << endl;
344 // Construct from definition field
347 const polyMesh& pMesh,
348 const fileName& defFile
351 GeoMesh<polyMesh>(pMesh),
352 MeshObject<polyMesh, faMesh>(pMesh),
353 edgeInterpolation(*this),
359 mesh().facesInstance(),
372 mesh().facesInstance(),
383 curTimeIndex_(time().timeIndex()),
387 patchStartsPtr_(NULL),
391 edgeCentresPtr_(NULL),
392 faceAreaNormalsPtr_(NULL),
393 edgeAreaNormalsPtr_(NULL),
394 pointAreaNormalsPtr_(NULL),
395 faceCurvaturesPtr_(NULL),
396 edgeTransformTensorsPtr_(NULL),
397 correctPatchPointNormalsPtr_(NULL),
398 globalMeshDataPtr_(NULL)
402 Info<< "faMesh::faMesh(...) : "
403 << "Creating faMesh from definition file" << endl;
406 // Reading faMeshDefinition dictionary
407 IOdictionary faMeshDefinition
412 mesh().time().constant(),
420 wordList polyMeshPatches
422 faMeshDefinition.lookup("polyMeshPatches")
425 dictionary bndDict = faMeshDefinition.subDict("boundary");
427 wordList faPatchNames = bndDict.toc();
429 List<faPatchData> faPatches(faPatchNames.size() + 1);
431 forAll (faPatchNames, patchI)
433 dictionary curPatchDict =
434 bndDict.subDict(faPatchNames[patchI]);
436 faPatches[patchI].name_ = faPatchNames[patchI];
438 faPatches[patchI].type_ =
439 word(curPatchDict.lookup("type"));
441 faPatches[patchI].ownPolyPatchID_ =
442 mesh().boundaryMesh().findPatchID
444 word(curPatchDict.lookup("ownerPolyPatch"))
447 faPatches[patchI].ngbPolyPatchID_ =
448 mesh().boundaryMesh().findPatchID
450 word(curPatchDict.lookup("neighbourPolyPatch"))
455 // Setting faceLabels list size
458 labelList patchIDs(polyMeshPatches.size(), -1);
460 forAll (polyMeshPatches, patchI)
463 mesh().boundaryMesh().findPatchID(polyMeshPatches[patchI]);
465 size += mesh().boundaryMesh()[patchIDs[patchI]].size();
468 faceLabels_ = labelList(size, -1);
471 // Filling of faceLabels list
476 forAll (polyMeshPatches, patchI)
478 label start = mesh().boundaryMesh()[patchIDs[patchI]].start();
479 label size = mesh().boundaryMesh()[patchIDs[patchI]].size();
481 for (label i = 0; i < size; i++)
483 faceLabels_[++faceI] = start + i;
488 // Determination of faPatch ID for each boundary edge.
489 // Result is in the bndEdgeFaPatchIDs list
490 labelList faceCells(faceLabels_.size(), -1);
492 forAll (faceCells, faceI)
494 label faceID = faceLabels_[faceI];
496 faceCells[faceI] = mesh().faceOwner()[faceID];
499 labelList meshEdges =
507 const labelListList& edgeFaces = mesh().edgeFaces();
509 const label nTotalEdges = patch().nEdges();
510 const label nInternalEdges = patch().nInternalEdges();
512 labelList bndEdgeFaPatchIDs(nTotalEdges - nInternalEdges, -1);
514 for (label edgeI = nInternalEdges; edgeI < nTotalEdges; edgeI++)
516 label curMeshEdge = meshEdges[edgeI];
518 labelList curEdgePatchIDs(2, -1);
522 forAll (edgeFaces[curMeshEdge], faceI)
524 label curFace = edgeFaces[curMeshEdge][faceI];
526 label curPatchID = mesh().boundaryMesh().whichPatch(curFace);
528 if (curPatchID != -1)
530 curEdgePatchIDs[++patchI] = curPatchID;
534 for (label pI = 0; pI < faPatches.size() - 1; pI++)
539 curEdgePatchIDs[0] == faPatches[pI].ownPolyPatchID_
540 && curEdgePatchIDs[1] == faPatches[pI].ngbPolyPatchID_
544 curEdgePatchIDs[1] == faPatches[pI].ownPolyPatchID_
545 && curEdgePatchIDs[0] == faPatches[pI].ngbPolyPatchID_
549 bndEdgeFaPatchIDs[edgeI - nInternalEdges] = pI;
556 // Set edgeLabels for each faPatch
557 for (label pI = 0; pI < (faPatches.size() - 1); pI++)
559 SLList<label> tmpList;
561 forAll (bndEdgeFaPatchIDs, eI)
563 if (bndEdgeFaPatchIDs[eI] == pI)
565 tmpList.append(nInternalEdges + eI);
569 faPatches[pI].edgeLabels_ = tmpList;
572 // Check for undefined edges
573 SLList<label> tmpList;
575 forAll (bndEdgeFaPatchIDs, eI)
577 if (bndEdgeFaPatchIDs[eI] == -1)
579 tmpList.append(nInternalEdges + eI);
583 if (tmpList.size() > 0)
585 // Check for processor edges
586 labelList allUndefEdges = tmpList;
587 labelList ngbPolyPatch(allUndefEdges.size(), -1);
588 forAll (ngbPolyPatch, edgeI)
590 label curEdge = allUndefEdges[edgeI];
592 label curPMeshEdge = meshEdges[curEdge];
594 forAll (edgeFaces[curPMeshEdge], faceI)
596 label curFace = edgeFaces[curPMeshEdge][faceI];
598 if (findIndex(faceLabels_, curFace) == -1)
601 pMesh.boundaryMesh().whichPatch(curFace);
603 if (polyPatchID != -1)
605 ngbPolyPatch[edgeI] = polyPatchID;
611 // Count ngb processorPolyPatch-es
612 labelHashSet processorPatchSet;
613 forAll (ngbPolyPatch, edgeI)
615 if (ngbPolyPatch[edgeI] != -1)
619 isA<processorPolyPatch>
621 pMesh.boundaryMesh()[ngbPolyPatch[edgeI]]
625 if (!processorPatchSet.found(ngbPolyPatch[edgeI]))
627 processorPatchSet.insert(ngbPolyPatch[edgeI]);
632 labelList processorPatches(processorPatchSet.toc());
633 faPatches.setSize(faPatches.size() + processorPatches.size());
635 for (label i = 0; i < processorPatches.size(); i++)
637 SLList<label> tmpLst;
639 forAll (ngbPolyPatch, eI)
641 if (ngbPolyPatch[eI] == processorPatches[i])
643 tmpLst.append(allUndefEdges[eI]);
647 faPatches[faPatchNames.size() + i].edgeLabels_ = tmpLst;
649 faPatches[faPatchNames.size() + i].name_ =
650 pMesh.boundaryMesh()[processorPatches[i]].name();
652 faPatches[faPatchNames.size() + i].type_ =
653 processorFaPatch::typeName;
655 faPatches[faPatchNames.size() + i].ngbPolyPatchID_ =
659 // Remaining undefined edges
660 SLList<label> undefEdges;
661 forAll (ngbPolyPatch, eI)
663 if (ngbPolyPatch[eI] == -1)
665 undefEdges.append(allUndefEdges[eI]);
669 !isA<processorPolyPatch>
671 pMesh.boundaryMesh()[ngbPolyPatch[eI]]
675 undefEdges.append(allUndefEdges[eI]);
679 if (undefEdges.size() > 0)
681 label pI = faPatches.size()-1;
683 faPatches[pI].name_ = "undefined";
684 faPatches[pI].type_ = "patch";
685 faPatches[pI].edgeLabels_ = undefEdges;
689 faPatches.setSize(faPatches.size() - 1);
694 faPatches.setSize(faPatches.size() - 1);
698 // Reorder processorFaPatch using
699 // ordering of ngb processorPolyPatch
700 forAll (faPatches, patchI)
702 if (faPatches[patchI].type_ == processorFaPatch::typeName)
704 labelList ngbFaces(faPatches[patchI].edgeLabels_.size(), -1);
706 forAll (ngbFaces, edgeI)
708 label curEdge = faPatches[patchI].edgeLabels_[edgeI];
710 label curPMeshEdge = meshEdges[curEdge];
712 forAll (edgeFaces[curPMeshEdge], faceI)
714 label curFace = edgeFaces[curPMeshEdge][faceI];
717 pMesh.boundaryMesh().whichPatch(curFace);
719 if (curPatchID == faPatches[patchI].ngbPolyPatchID_)
721 ngbFaces[edgeI] = curFace;
726 SortableList<label> sortedNgbFaces(ngbFaces);
727 labelList reorderedEdgeLabels(ngbFaces.size(), -1);
728 for (label i = 0; i < reorderedEdgeLabels.size(); i++)
730 reorderedEdgeLabels[i] =
731 faPatches[patchI].edgeLabels_
733 sortedNgbFaces.indices()[i]
737 faPatches[patchI].edgeLabels_ = reorderedEdgeLabels;
742 // Add good patches to faMesh
743 SLList<faPatch*> faPatchLst;
745 for (label pI = 0; pI < faPatches.size(); pI++)
747 faPatches[pI].dict_.add("type", faPatches[pI].type_);
748 faPatches[pI].dict_.add("edgeLabels", faPatches[pI].edgeLabels_);
749 faPatches[pI].dict_.add
752 faPatches[pI].ngbPolyPatchID_
755 if (faPatches[pI].type_ == processorFaPatch::typeName)
757 if (faPatches[pI].ngbPolyPatchID_ == -1)
761 "void faMesh::faMesh(const polyMesh&, const fileName&)"
763 << "ngbPolyPatch is not defined for processorFaPatch: "
764 << faPatches[pI].name_
765 << abort(FatalError);
768 const processorPolyPatch& procPolyPatch =
769 refCast<const processorPolyPatch>
771 pMesh.boundaryMesh()[faPatches[pI].ngbPolyPatchID_]
774 faPatches[pI].dict_.add("myProcNo", procPolyPatch.myProcNo());
775 faPatches[pI].dict_.add
778 procPolyPatch.neighbProcNo()
794 addFaPatches(List<faPatch*>(faPatchLst));
796 // Create global mesh data
797 if (Pstream::parRun())
802 // Calculate topology for the patches (processor-processor comms etc.)
803 boundary_.updateMesh();
805 // Calculate the geometry for the patches (transformation tensors etc.)
806 boundary_.calcGeometry();
808 if (isFile(mesh().time().timePath()/"S0"))
810 S0Ptr_ = new DimensionedField<scalar, areaMesh>
827 // Construct from polyPatch
830 const polyMesh& pMesh,
831 const label polyPatchID
834 GeoMesh<polyMesh>(pMesh),
835 MeshObject<polyMesh, faMesh>(pMesh),
836 edgeInterpolation(*this),
842 mesh().facesInstance(),
848 labelList(pMesh.boundaryMesh()[polyPatchID].size(), -1)
855 mesh().facesInstance(),
866 curTimeIndex_(time().timeIndex()),
870 patchStartsPtr_(NULL),
874 edgeCentresPtr_(NULL),
875 faceAreaNormalsPtr_(NULL),
876 edgeAreaNormalsPtr_(NULL),
877 pointAreaNormalsPtr_(NULL),
878 faceCurvaturesPtr_(NULL),
879 edgeTransformTensorsPtr_(NULL),
880 correctPatchPointNormalsPtr_(NULL),
881 globalMeshDataPtr_(NULL)
885 Info<< "faMesh::faMesh(...) : "
886 << "Creating faMesh from polyPatch" << endl;
890 forAll (faceLabels_, faceI)
893 mesh().boundaryMesh()[polyPatchID].start() + faceI;
897 const indirectPrimitivePatch& bp = patch();
899 const label nTotalEdges = bp.nEdges();
901 const label nInternalEdges = bp.nInternalEdges();
903 labelList edgeLabels(nTotalEdges - nInternalEdges, -1);
905 forAll (edgeLabels, edgeI)
907 edgeLabels[edgeI] = nInternalEdges + edgeI;
910 dictionary patchDict;
912 patchDict.add("type", "patch");
913 patchDict.add("edgeLabels", edgeLabels);
914 patchDict.add("ngbPolyPatchIndex", -1);
916 List<faPatch*> faPatchLst(1);
919 faPatch::New("default", patchDict, 0, boundary()).ptr();
921 addFaPatches(faPatchLst);
923 setPrimitiveMeshData();
925 // Calculate topology for the patches (processor-processor comms etc.)
926 boundary_.updateMesh();
928 // Calculate the geometry for the patches (transformation tensors etc.)
929 boundary_.calcGeometry();
933 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
935 Foam::faMesh::~faMesh()
940 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
942 Foam::fileName Foam::faMesh::meshDir() const
944 return mesh().dbDir()/meshSubDir;
948 const Foam::Time& Foam::faMesh::time() const
950 return mesh().time();
954 const Foam::fileName& Foam::faMesh::pointsInstance() const
956 return mesh().pointsInstance();
960 const Foam::fileName& Foam::faMesh::facesInstance() const
962 return mesh().facesInstance();
966 const Foam::indirectPrimitivePatch& Foam::faMesh::patch() const
970 patchPtr_ = new indirectPrimitivePatch
985 Foam::indirectPrimitivePatch& Foam::faMesh::patch()
989 patchPtr_ = new indirectPrimitivePatch
1004 const Foam::pointField& Foam::faMesh::points() const
1006 return patch().localPoints();
1010 const Foam::edgeList& Foam::faMesh::edges() const
1016 const Foam::faceList& Foam::faMesh::faces() const
1018 return patch().localFaces();
1022 void Foam::faMesh::addFaPatches(const List<faPatch*>& p)
1026 Info<< "void faMesh::addFaPatches(const List<faPatch*>& p) : "
1027 << "Adding patches to faMesh" << endl;
1030 if (boundary().size() > 0)
1032 FatalErrorIn("void faMesh::addPatches(const List<faPatch*>& p)")
1033 << "boundary already exists"
1034 << abort(FatalError);
1037 boundary_.setSize(p.size());
1041 boundary_.set(patchI, p[patchI]);
1044 setPrimitiveMeshData();
1046 boundary_.checkDefinition();
1050 const Foam::objectRegistry& Foam::faMesh::thisDb() const
1052 return mesh().thisDb();
1056 const Foam::faBoundaryMesh& Foam::faMesh::boundary() const
1062 const Foam::labelList& Foam::faMesh::patchStarts() const
1064 if (!patchStartsPtr_)
1069 return *patchStartsPtr_;
1073 const Foam::edgeVectorField& Foam::faMesh::Le() const
1084 const Foam::edgeScalarField& Foam::faMesh::magLe() const
1095 const Foam::areaVectorField& Foam::faMesh::areaCentres() const
1102 return *centresPtr_;
1106 const Foam::edgeVectorField& Foam::faMesh::edgeCentres() const
1108 if (!edgeCentresPtr_)
1113 return *edgeCentresPtr_;
1117 const Foam::DimensionedField<Foam::scalar, Foam::areaMesh>&
1118 Foam::faMesh::S() const
1129 const Foam::DimensionedField<Foam::scalar, Foam::areaMesh>&
1130 Foam::faMesh::S0() const
1134 FatalErrorIn("faMesh::S0() const")
1135 << "S0 is not available"
1136 << abort(FatalError);
1143 const Foam::DimensionedField<Foam::scalar, Foam::areaMesh>&
1144 Foam::faMesh::S00() const
1148 S00Ptr_ = new DimensionedField<scalar, areaMesh>
1161 S0Ptr_->writeOpt() = IOobject::AUTO_WRITE;
1168 const Foam::areaVectorField& Foam::faMesh::faceAreaNormals() const
1170 if (!faceAreaNormalsPtr_)
1172 calcFaceAreaNormals();
1175 return *faceAreaNormalsPtr_;
1179 const Foam::edgeVectorField& Foam::faMesh::edgeAreaNormals() const
1181 if (!edgeAreaNormalsPtr_)
1183 calcEdgeAreaNormals();
1186 return *edgeAreaNormalsPtr_;
1190 const Foam::vectorField& Foam::faMesh::pointAreaNormals() const
1192 if (!pointAreaNormalsPtr_)
1194 calcPointAreaNormals();
1196 if (quadricsFit_() > 0)
1198 calcPointAreaNormalsByQuadricsFit();
1202 return *pointAreaNormalsPtr_;
1206 const Foam::areaScalarField& Foam::faMesh::faceCurvatures() const
1208 if (!faceCurvaturesPtr_)
1210 calcFaceCurvatures();
1213 return *faceCurvaturesPtr_;
1217 const Foam::FieldField<Foam::Field, Foam::tensor>&
1218 Foam::faMesh::edgeTransformTensors() const
1220 if (!edgeTransformTensorsPtr_)
1222 calcEdgeTransformTensors();
1225 return *edgeTransformTensorsPtr_;
1229 // Return global mesh data
1230 const Foam::faGlobalMeshData& Foam::faMesh::globalData() const
1232 if (!globalMeshDataPtr_)
1234 globalMeshDataPtr_ = new faGlobalMeshData(*this);
1237 return *globalMeshDataPtr_;
1241 const Foam::lduAddressing& Foam::faMesh::lduAddr() const
1245 calcLduAddressing();
1252 bool Foam::faMesh::movePoints() const
1254 // Grab point motion from polyMesh
1255 const vectorField& newPoints = mesh().allPoints();
1257 // Grab old time areas if the time has been incremented
1258 if (curTimeIndex_ < time().timeIndex())
1260 if (S00Ptr_ && S0Ptr_)
1262 Info<< "Copy old-old S" << endl;
1268 Info<< "Copy old S" << endl;
1275 InfoIn("bool faMesh::movePoints() const")
1276 << "Creating old cell volumes." << endl;
1279 S0Ptr_ = new DimensionedField<scalar, areaMesh>
1294 curTimeIndex_ = time().timeIndex();
1297 clearGeomNotAreas();
1299 // To satisfy the motion interface for MeshObject, const cast is needed
1303 patchPtr_->movePoints(newPoints);
1306 // Move boundary points
1307 const_cast<faBoundaryMesh&>(boundary_).movePoints(newPoints);
1309 // Move interpolation
1310 const edgeInterpolation& cei = *this;
1311 const_cast<edgeInterpolation&>(cei).edgeInterpolation::movePoints();
1313 // Fluxes were dummy? HJ, 28/Jul/2011
1319 bool Foam::faMesh::correctPatchPointNormals(const label patchID) const
1321 if ((patchID < 0) || (patchID >= boundary().size()))
1325 "bool correctPatchPointNormals(const label patchID) const"
1326 ) << "patchID is not in the valid range"
1327 << abort(FatalError);
1330 if (correctPatchPointNormalsPtr_)
1332 return (*correctPatchPointNormalsPtr_)[patchID];
1339 //- Set patch point normals corrections
1340 Foam::boolList& Foam::faMesh::correctPatchPointNormals() const
1342 if (!correctPatchPointNormalsPtr_)
1344 correctPatchPointNormalsPtr_ =
1345 new boolList(boundary().size(), false);
1348 return *correctPatchPointNormalsPtr_;
1352 bool Foam::faMesh::write() const
1354 faceLabels_.write();
1361 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
1363 bool Foam::faMesh::operator!=(const faMesh& m) const
1369 bool Foam::faMesh::operator==(const faMesh& m) const
1375 // ************************************************************************* //