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

Function writeEdges

src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C:223–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223void Foam::faceCoupleInfo::writeEdges
224(
225 const labelList& cutToMasterEdges,
226 const labelList& cutToSlaveEdges
227) const
228{
229 const indirectPrimitivePatch& m = masterPatch();
230 const indirectPrimitivePatch& s = slavePatch();
231 const primitiveFacePatch& c = cutFaces();
232
233 // Edge connectivity
234 {
235 OFstream str("cutToMasterEdges.obj");
236 Pout<< "Writing cutToMasterEdges to " << str.name() << endl;
237
238 label vertI = 0;
239
240 forAll(cutToMasterEdges, cutEdgeI)
241 {
242 if (cutToMasterEdges[cutEdgeI] != -1)
243 {
244 const edge& masterEdge =
245 m.edges()[cutToMasterEdges[cutEdgeI]];
246 const edge& cutEdge = c.edges()[cutEdgeI];
247
248 meshTools::writeOBJ(str, m.localPoints()[masterEdge[0]]);
249 vertI++;
250 meshTools::writeOBJ(str, m.localPoints()[masterEdge[1]]);
251 vertI++;
252 meshTools::writeOBJ(str, c.localPoints()[cutEdge[0]]);
253 vertI++;
254 meshTools::writeOBJ(str, c.localPoints()[cutEdge[1]]);
255 vertI++;
256 str << "l " << vertI-3 << ' ' << vertI-2 << nl;
257 str << "l " << vertI-3 << ' ' << vertI-1 << nl;
258 str << "l " << vertI-3 << ' ' << vertI << nl;
259 str << "l " << vertI-2 << ' ' << vertI-1 << nl;
260 str << "l " << vertI-2 << ' ' << vertI << nl;
261 str << "l " << vertI-1 << ' ' << vertI << nl;
262 }
263 }
264 }
265 {
266 OFstream str("cutToSlaveEdges.obj");
267 Pout<< "Writing cutToSlaveEdges to " << str.name() << endl;
268
269 label vertI = 0;
270
271 labelList slaveToCut(invert(s.nEdges(), cutToSlaveEdges));
272
273 forAll(slaveToCut, edgeI)
274 {
275 if (slaveToCut[edgeI] != -1)
276 {
277 const edge& slaveEdge = s.edges()[edgeI];
278 const edge& cutEdge = c.edges()[slaveToCut[edgeI]];
279
280 meshTools::writeOBJ(str, s.localPoints()[slaveEdge[0]]);

Callers 1

subDivisionMatchFunction · 0.70

Calls 5

localPointsMethod · 0.80
writeOBJFunction · 0.70
forAllFunction · 0.50
nameMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected