36#ifndef _GENERICMESHREADER_HPP_
37#define _GENERICMESHREADER_HPP_
42#include "AbstractMeshReader.hpp"
45#include "TrianglesMeshReader.hpp"
46#include "MemfemMeshReader.hpp"
47#include "VtkMeshReader.hpp"
67template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
68std::shared_ptr<AbstractMeshReader<ELEMENT_DIM, SPACE_DIM> > GenericMeshReader(
const std::string& rPathBaseName,
69 unsigned orderOfElements=1,
70 unsigned orderOfBoundaryElements=1,
71 bool readContainingElementsForBoundaryElements=
false)
73 std::shared_ptr<AbstractMeshReader<ELEMENT_DIM, SPACE_DIM> > p_reader;
78 orderOfBoundaryElements,
79 readContainingElementsForBoundaryElements));
81 catch (
const Exception& r_triangles_exception)
83 if (orderOfElements!=1 || orderOfBoundaryElements!=1 || readContainingElementsForBoundaryElements)
85 EXCEPTION(
"Quadratic meshes are only supported in Triangles format.");
92 catch (
const Exception& r_memfem_exception)
102 std::string eol(
"\n");
103 std::string combined_message =
"Could not open appropriate mesh files for " + rPathBaseName + eol;
104 combined_message +=
"Triangle format: " + r_triangles_exception.
GetShortMessage() + eol;
105 combined_message +=
"Memfem format: " + r_memfem_exception.
GetShortMessage() + eol;
107 combined_message +=
"Vtk format: " + r_vtk_exception.
GetShortMessage() + eol;
#define EXCEPTION(message)
std::string GetShortMessage() const