41 if ( (*it).second.mesh_ ==
nullptr ) {
42 (*it).second.mesh_ = std::make_shared<Mesh>(
Input::Record() );
43 (*it).second.reader_->read_raw_mesh( (*it).second.mesh_.get() );
44 (*it).second.reader_->check_compatible_mesh( *((*it).second.mesh_) );
47 return (*it).second.mesh_;
55 reader_data.
reader_ = std::make_shared<GmshMeshReader>(file_path);
56 }
else if ( file_path.
extension() ==
".vtu" ) {
57 reader_data.
reader_ = std::make_shared<VtkMeshReader>(file_path);
58 }
else if ( file_path.
extension() ==
".pvd" ) {
59 reader_data.
reader_ = std::make_shared<PvdMeshReader>(file_path);
61 THROW(BaseMeshReader::ExcWrongExtension()
62 << BaseMeshReader::EI_FileExtension(file_path.
extension()) << BaseMeshReader::EI_MeshFile((
string)file_path) );
ReaderCache()
Constructor.
static ReaderCache * instance()
Returns singleton instance.
std::shared_ptr< BaseMeshReader > reader_
static ReaderTable::iterator get_reader_data(const FilePath &file_path)
Returns instance of given FilePath. If reader doesn't exist, creates new ReaderData object...
Dedicated class for storing path to input and output files.
ReaderTable reader_table_
Table of readers.
static std::shared_ptr< Mesh > get_mesh(const FilePath &file_path)
static std::shared_ptr< BaseMeshReader > get_reader(const FilePath &file_path)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.