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

Function changeFaces

src/dynamicMesh/boundaryMesh/boundaryMesh.C:1713–1829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1711
1712
1713void Foam::boundaryMesh::changeFaces
1714(
1715 const labelList& patchIDs,
1716 labelList& oldToNew
1717)
1718{
1719 if (patchIDs.size() != mesh().size())
1720 {
1721 FatalErrorInFunction
1722 << "List of patchIDs not equal to number of faces." << endl
1723 << "PatchIDs size:" << patchIDs.size()
1724 << " nFaces::" << mesh().size()
1725 << abort(FatalError);
1726 }
1727
1728 // Count number of faces for each patch
1729
1730 labelList nFaces(patches_.size(), 0);
1731
1732 forAll(patchIDs, facei)
1733 {
1734 label patchID = patchIDs[facei];
1735
1736 if (patchID < 0 || patchID >= patches_.size())
1737 {
1738 FatalErrorInFunction
1739 << "PatchID " << patchID << " out of range"
1740 << abort(FatalError);
1741 }
1742 nFaces[patchID]++;
1743 }
1744
1745
1746 // Determine position in faces_ for each patch
1747
1748 labelList startFace(patches_.size());
1749
1750 startFace[0] = 0;
1751
1752 for (label patchi = 1; patchi < patches_.size(); patchi++)
1753 {
1754 startFace[patchi] = startFace[patchi-1] + nFaces[patchi-1];
1755 }
1756
1757 // Update patch info
1758 PtrList<boundaryPatch> newPatches(patches_.size());
1759
1760 forAll(patches_, patchi)
1761 {
1762 const boundaryPatch& bp = patches_[patchi];
1763
1764 newPatches.set
1765 (
1766 patchi,
1767 new boundaryPatch
1768 (
1769 bp.name(),
1770 patchi,

Callers

nothing calls this directly

Calls 12

meshFunction · 0.85
boundaryPatchClass · 0.85
clearOutFunction · 0.70
abortFunction · 0.50
forAllFunction · 0.50
sizeMethod · 0.45
setMethod · 0.45
nameMethod · 0.45
startMethod · 0.45
setSizeMethod · 0.45
pointsMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected