| 792 | |
| 793 | |
| 794 | void Foam::fvMeshSubset::setLargeCellSubset |
| 795 | ( |
| 796 | const labelList& region, |
| 797 | const label currentRegion, |
| 798 | const label patchID, |
| 799 | const bool syncPar |
| 800 | ) |
| 801 | { |
| 802 | const cellList& oldCells = baseMesh().cells(); |
| 803 | const faceList& oldFaces = baseMesh().faces(); |
| 804 | const pointField& oldPoints = baseMesh().points(); |
| 805 | const labelList& oldOwner = baseMesh().faceOwner(); |
| 806 | const labelList& oldNeighbour = baseMesh().faceNeighbour(); |
| 807 | const polyBoundaryMesh& oldPatches = baseMesh().boundaryMesh(); |
| 808 | const label oldNInternalFaces = baseMesh().nInternalFaces(); |
| 809 | |
| 810 | // Initial checks |
| 811 | |
| 812 | if (region.size() != oldCells.size()) |
| 813 | { |
| 814 | FatalErrorInFunction |
| 815 | << "Size of region " << region.size() |
| 816 | << " is not equal to number of cells in mesh " << oldCells.size() |
| 817 | << abort(FatalError); |
| 818 | } |
| 819 | |
| 820 | |
| 821 | label wantedPatchID = patchID; |
| 822 | |
| 823 | if (wantedPatchID == -1) |
| 824 | { |
| 825 | // No explicit patch specified. Put in oldInternalFaces patch. |
| 826 | // Check if patch with this name already exists. |
| 827 | wantedPatchID = oldPatches.findPatchID("oldInternalFaces"); |
| 828 | } |
| 829 | else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.size()) |
| 830 | { |
| 831 | FatalErrorInFunction |
| 832 | << "Non-existing patch index " << wantedPatchID << endl |
| 833 | << "Should be between 0 and " << oldPatches.size()-1 |
| 834 | << abort(FatalError); |
| 835 | } |
| 836 | |
| 837 | // Clear demand driven data |
| 838 | faceFlipMapPtr_.clear(); |
| 839 | |
| 840 | // Get the cells for the current region. |
| 841 | cellMap_.setSize(oldCells.size()); |
| 842 | label nCellsInSet = 0; |
| 843 | |
| 844 | forAll(region, oldCelli) |
| 845 | { |
| 846 | if (region[oldCelli] == currentRegion) |
| 847 | { |
| 848 | cellMap_[nCellsInSet++] = oldCelli; |
| 849 | } |
| 850 | } |
| 851 | cellMap_.setSize(nCellsInSet); |
nothing calls this directly
no test coverage detected