tk::MeshReader class

Polymorphic mesh reader class for connecting to various mesh readers

This class uses runtime polymorphism without client-side inheritance: inheritance is confined to the internals of the this class, invisible to client-code. The class exclusively deals with ownership enabling client-side value semantics. Credit goes to Sean Parent at Adobe.

Constructors, destructors, conversion operators

MeshReader(const std::string& filename) explicit
MeshReader(const MeshReader& x)
Copy constructor.
MeshReader(MeshReader&&) noexcept defaulted
Move constructor.

Public functions

auto npoin() -> std::size_t
Public interface to return the total number of nodes in mesh file.
void readMeshPart(std::vector<std::size_t>& ginpoel, std::vector<std::size_t>& inpoel, std::vector<std::size_t>& triinp, std::unordered_map<std::size_t, std::size_t>& lid, tk::UnsMesh::Coords& coord, std::unordered_map<std::size_t, std::set<std::size_t>>& elemBlockId, int numpes = 1, int mype = 0)
auto triinpoel(std::map<int, std::vector<std::size_t>>& bface, const std::map<int, std::vector<std::size_t>>& faceid, const std::vector<std::size_t>& ginpoel, const std::vector<std::size_t>& triinp) -> std::vector<std::size_t>
...
void readSidesetFaces(std::map<int, std::vector<std::size_t>>& bface, std::map<int, std::vector<std::size_t>>& faces)
Public interface to side sets from mesh file.
void readFaces(std::vector<std::size_t>& conn)
Public interface to read face connectivity of boundary faces from file.
auto readSidesetNodes() -> std::map<int, std::vector<std::size_t>>
Public interfaces to read node list of all side sets from mesh file.
auto operator=(const MeshReader& x) -> MeshReader&
Copy assignment.
auto operator=(MeshReader&&) noexcept -> MeshReader& defaulted
Move assignment.

Function documentation

tk::MeshReader::MeshReader(const std::string& filename) explicit

Parameters
filename in Input mesh filename

Constructor Dispatch constructor call to various low level mesh readers by creating child class and assigning to base to be used in polymorphic fashion.

void tk::MeshReader::readMeshPart(std::vector<std::size_t>& ginpoel, std::vector<std::size_t>& inpoel, std::vector<std::size_t>& triinp, std::unordered_map<std::size_t, std::size_t>& lid, tk::UnsMesh::Coords& coord, std::unordered_map<std::size_t, std::set<std::size_t>>& elemBlockId, int numpes = 1, int mype = 0)

Public interface to read part of the mesh (graph and coords) from file

Total number of PEs defaults to 1 for a single-CPU read, this PE defaults to 0 for a single-CPU read.