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

Function subset

src/meshTools/sets/topoSets/faceZoneSet.C:176–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175
176void faceZoneSet::subset(const topoSet& set)
177{
178 label nConflict = 0;
179
180 DynamicList<label> newAddressing(addressing_.size());
181 DynamicList<bool> newFlipMap(flipMap_.size());
182
183 Map<label> faceToIndex(addressing_.size());
184 forAll(addressing_, i)
185 {
186 faceToIndex.insert(addressing_[i], i);
187 }
188
189 const faceZoneSet& fSet = refCast<const faceZoneSet>(set);
190
191 forAll(fSet.addressing(), i)
192 {
193 label facei = fSet.addressing()[i];
194
195 Map<label>::const_iterator iter = faceToIndex.find(facei);
196
197 if (iter != faceToIndex.end())
198 {
199 label index = iter();
200
201 if (fSet.flipMap()[i] != flipMap_[index])
202 {
203 nConflict++;
204 }
205 newAddressing.append(facei);
206 newFlipMap.append(flipMap_[index]);
207 }
208 }
209
210 if (nConflict > 0)
211 {
212 WarningInFunction
213 << "subset : there are " << nConflict
214 << " faces with different orientation in faceZonesSets "
215 << name() << " and " << set.name() << endl;
216 }
217
218 addressing_.transfer(newAddressing);
219 flipMap_.transfer(newFlipMap);
220 updateSet();
221}
222
223
224void faceZoneSet::addSet(const topoSet& set)

Callers

nothing calls this directly

Calls 9

updateSetFunction · 0.70
forAllFunction · 0.50
nameFunction · 0.50
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
nameMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected