33#ifndef TRANSIENTBCSETTER_H_
34#define TRANSIENTBCSETTER_H_
49namespace grid_generator
51 class BoundaryCondition;
70 fileName(std::
move(fileName))
78 bool markNANs(
const std::vector<uint>& readIndices)
const;
116 void printFileInfo();
121 std::string fileName;
122 real minX, maxX, minY, maxY, minZ, maxZ;
123 real deltaX, deltaY, deltaZ;
125 std::vector<Quantity> quantities;
143 static std::string fixPath(std::string
path)
145 if(
path.back() ==
'/')
167 std::string makeFileName(
int level,
int id,
int part)
169 return prefix +
"_lev_" + StringUtil::toString<int>(level)
170 +
"_ID_" + StringUtil::toString<int>(
id)
171 +
"_File_" + StringUtil::toString<int>(part)
177 static const inline std::string
suffix =
"vti";
178 std::vector<std::vector<std::vector<VTKFile>>>
files;
212 : fileCollection(fileCollection), readLevel(readLevel),
219 void initializeIndexVectors();
222 std::vector<std::vector<std::vector<uint>>> readIndices, writeIndices;
223 std::vector<std::vector<size_t>> nFile;
226 real startTime { vf::basics::constant::c0o1 };
227 std::future<void> read = std::async([]() {});
virtual size_t getNumberOfQuantities()=0
virtual TransientBCFileType getFileType()=0
FileCollection(std::string path, std::string prefix)
virtual ~FileCollection()=default
std::vector< std::vector< std::vector< VTKFile > > > files
static const std::string suffix
size_t getNumberOfQuantities() override
TransientBCFileType getFileType() override
VTKFileCollection(const std::string &path, const std::string &prefix)
int findNeighborPMM(real posX, real posY, real posZ) const
int getLinearIndex(int idxX, int idxY, int idxZ) const
bool inYBounds(real posY) const
size_t getNumberOfQuantities()
real getX(int linearIdx) const
real getZ(int linearIdx) const
int getClosestIdxZ(real posZ) const
int getIdxX(int linearIdx) const
bool inXBounds(real posX) const
int getIdx0M0(real posY) const
int getNumberOfPointsInXZPlane() const
bool inZBounds(real posZ) const
int findNeighborMMP(real posX, real posY, real posZ) const
int findNeighborPMP(real posX, real posY, real posZ) const
int getClosestIdxY(real posY) const
int getIdx00M(real posZ) const
int findNeighborPPP(real posX, real posY, real posZ) const
int getClosestIdxX(real posX) const
bool inBoundingBox(real posX, real posY, real posZ) const
int getNumberOfPoints() const
int findNeighborMPM(real posX, real posY, real posZ) const
VTKFile(std::string fileName)
int findNeighborMPP(real posX, real posY, real posZ) const
int getIdxZ(int linearIdx) const
int getIdxM00(real posX) const
int getNumberOfPointsInYZPlane() const
bool markNANs(const std::vector< uint > &readIndices) const
void getData(real *data, uint numberOfNodes, const std::vector< uint > &readIndices, const std::vector< uint > &writeIndices, uint offsetRead, uint offsetWrite)
real getY(int linearIdx) const
int getIdxY(int linearIdx) const
int getNumberOfPointsInXYPlane() const
int findNeighborPPM(real posX, real posY, real posZ) const
int findNeighborMMM(real posX, real posY, real posZ) const
VTKReader(const SPtr< VTKFileCollection > &fileCollection, uint readLevel, bool cycleFiles)
void fillArrays(std::vector< real > &coordsY, std::vector< real > &coordsZ) override
void getNextData(real *data, uint numberOfNodes, real time) override
std::shared_ptr< T > SPtr
SPtr< TransientBCInputFileReader > createReaderForCollection(SPtr< FileCollection > fileCollection, uint readLevel, bool cycleFiles)
SPtr< FileCollection > createFileCollection(const std::string &path, const std::string &prefix, TransientBCFileType type)
std::vector< double > values