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

Function write

src/triSurface/triSurface/triSurface.C:425–488  ·  view source on GitHub ↗

Write to file in given format

Source from the content-addressed store, hash-verified

423
424// Write to file in given format
425void Foam::triSurface::write
426(
427 const fileName& name,
428 const word& ext,
429 const bool sort
430) const
431{
432 if (ext == "ftr")
433 {
434 return write(OFstream(name)());
435 }
436 else if (ext == "stl")
437 {
438 return writeSTLASCII(sort, OFstream(name)());
439 }
440 else if (ext == "stlb")
441 {
442 ofstream outFile(name.c_str(), std::ios::binary);
443
444 writeSTLBINARY(outFile);
445 }
446 else if (ext == "gts")
447 {
448 return writeGTS(sort, OFstream(name)());
449 }
450 else if (ext == "obj")
451 {
452 writeOBJ(sort, OFstream(name)());
453 }
454 else if (ext == "off")
455 {
456 writeOFF(sort, OFstream(name)());
457 }
458 else if (ext == "vtk")
459 {
460 writeVTK(sort, OFstream(name)());
461 }
462 else if (ext == "tri")
463 {
464 writeTRI(sort, OFstream(name)());
465 }
466 else if (ext == "dx")
467 {
468 writeDX(sort, OFstream(name)());
469 }
470 else if (ext == "ac")
471 {
472 writeAC(OFstream(name)());
473 }
474 else if (ext == "smesh")
475 {
476 writeSMESH(sort, OFstream(name)());
477 }
478 else
479 {
480 FatalErrorInFunction
481 << "unknown file extension " << ext
482 << " for file " << name

Callers 4

addZonesAndModifiersFunction · 0.50
addZonesAndModifiersFunction · 0.50
addZonesAndModifiersFunction · 0.50
addZonesAndModifiersFunction · 0.50

Calls 13

OFstreamClass · 0.85
writeSTLASCIIFunction · 0.85
writeSTLBINARYFunction · 0.85
writeGTSFunction · 0.85
writeOFFFunction · 0.85
writeTRIFunction · 0.85
writeDXFunction · 0.85
writeACFunction · 0.85
writeSMESHFunction · 0.85
pointsFunction · 0.85
writeOBJFunction · 0.50
writeVTKFunction · 0.50

Tested by

no test coverage detected