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

Function combine

src/meshTools/sets/faceSources/pointToFace/pointToFace.C:70–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
69
70void Foam::pointToFace::combine(topoSet& set, const bool add) const
71{
72 // Load the set
73 pointSet loadedSet(mesh_, setName_);
74
75 if (option_ == ANY)
76 {
77 // Add faces with any point in loadedSet
78 forAllConstIter(pointSet, loadedSet, iter)
79 {
80 const label pointi = iter.key();
81 const labelList& pFaces = mesh_.pointFaces()[pointi];
82
83 forAll(pFaces, pFacei)
84 {
85 addOrDelete(set, pFaces[pFacei], add);
86 }
87 }
88 }
89 else if (option_ == ALL)
90 {
91 // Add all faces whose points are all in set.
92
93 // Count number of points using face.
94 Map<label> numPoints(loadedSet.size());
95
96 forAllConstIter(pointSet, loadedSet, iter)
97 {
98 const label pointi = iter.key();
99 const labelList& pFaces = mesh_.pointFaces()[pointi];
100
101 forAll(pFaces, pFacei)
102 {
103 const label facei = pFaces[pFacei];
104
105 Map<label>::iterator fndFace = numPoints.find(facei);
106
107 if (fndFace == numPoints.end())
108 {
109 numPoints.insert(facei, 1);
110 }
111 else
112 {
113 fndFace()++;
114 }
115 }
116 }
117
118
119 // Include faces that are referenced as many times as there are points
120 // in face -> all points of face
121 forAllConstIter(Map<label>, numPoints, iter)
122 {
123 const label facei = iter.key();
124
125 if (iter() == mesh_.faces()[facei].size())
126 {
127 addOrDelete(set, facei, add);

Callers 2

pointToFace.CFile · 0.70
ifFunction · 0.70

Calls 10

addOrDeleteFunction · 0.85
nextLabelMethod · 0.80
forAllConstIterFunction · 0.50
forAllFunction · 0.50
keyMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
facesMethod · 0.45
foundMethod · 0.45

Tested by

no test coverage detected