/*------------------------------- phasicFlow --------------------------------- O C enter of O O E ngineering and O O M ultiscale modeling of OOOOOOO F luid flow ------------------------------------------------------------------------------ Copyright (C): www.cemf.ir email: hamid.r.norouzi AT gmail.com ------------------------------------------------------------------------------ Licence: This file is part of phasicFlow code. It is a free software for simulating granular and multiphase flows. You can redistribute it and/or modify it under the terms of GNU General Public License v3 or any other later versions. phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -----------------------------------------------------------------------------*/ #ifndef __triSurfaceFieldToVTK_hpp__ #define __triSurfaceFieldToVTK_hpp__ #include #include "vtkFile.hpp" #include "triSurface.hpp" #include "multiTriSurface.hpp" #include "triSurfaceFields.hpp" #include "IOobject.hpp" namespace pFlow::TSFtoVTK { bool regexCheck(word TYPENAME, word fieldType) { std::regex match("triSurfaceField\\<([A-Za-z1-9_]*)\\,([A-Za-z1-9_]*)\\>"); std::smatch search1, search2; if(!std::regex_match(fieldType, search1, match))return false; if(!std::regex_match(TYPENAME, search2, match))return false; if(search1.size()!=3)return false; if(search1.size()!=search2.size())return false; return search1[1] == search2[1]; } template bool checkFieldType(word objectType) { //if( pointField::TYPENAME() == objectType )return true; //if( pointField::TYPENAME() == objectType ) return true; //if( pointField::TYPENAME() == objectType )return true; return regexCheck(triSurfaceField::TYPENAME(), objectType); } template bool triDataToVTK(iOstream& os, const Type& dataEntity) { fatalErrorInFunction<< "not implemented function!"; fatalExit; return false; } template<> bool triDataToVTK(iOstream& os, const triSurface& surface ) { auto nP = surface.numPoints(); auto hPoints = surface.points().hostVector(); os << "DATASET POLYDATA" << endl; os << "POINTS " << nP << " float" << endl; for ( auto i=0; i bool triDataToVTK(iOstream& os, const multiTriSurface& surface ) { auto nP = surface.numPoints(); auto hPoints = surface.points().hostVector(); os << "DATASET UNSTRUCTURED_GRID" << endl; os << "POINTS " << nP << " float" << endl; for ( auto i=0; i(objectType))return false; auto objField = IOobject::make ( header, tSurface, static_cast(0) ); auto& Field = objField().getObject(); realx3* data = Field.hostVectorAll().data(); Report(2)<<"writing "<< greenColor <(triSurfaeHeader); auto& tSurface = triSurfaceObjPtr().getObject(); // get a list of files in this timeFolder; Report(1)<<"Wrting triSurface mesh/Geometry to vtk file."<