MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / setLargeCellSubset

Function setLargeCellSubset

src/dynamicMesh/fvMeshSubset/fvMeshSubset.C:794–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792
793
794void 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);

Callers

nothing calls this directly

Calls 15

doCoupledPatchesFunction · 0.85
markPointsFunction · 0.85
emptyPolyPatchClass · 0.85
subsetZonesFunction · 0.85
isInternalFaceMethod · 0.80
reverseFaceMethod · 0.80
timeMethod · 0.80
setRefinementMethod · 0.80
abortFunction · 0.50
forAllFunction · 0.50
cellClass · 0.50
fvMeshClass · 0.50

Tested by

no test coverage detected