# -*- coding: utf-8 -*-## This file is subject to the terms and conditions defined in# file 'LICENSE.txt', which is part of this source code package.#"""Universal file reader"""
[docs]defReadMesh(filename,out=None,timeToRead=-1):importos.pathdirname=os.path.dirname(filename)basename,extention=os.path.splitext(os.path.basename(filename))fromMuscat.IO.IOFactoryimportCreateReaderreader=CreateReader("."+filename.split(".")[-1])reader.SetFileName(filename)ifreader.canHandleTemporal:reader.ReadMetaData()reader.SetTimeToRead(timeToRead)iftimeToRead==-1:print("Reading last available time step")else:print("Reading Time")print(timeToRead)returnreader.Read()