/*------------------------------- 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 __pointFieldToVTK_hpp__ #define __pointFieldToVTK_hpp__ #include #include "vtkFile.hpp" #include "pointFields.hpp" #include "IOobject.hpp" namespace pFlow::PFtoVTK { template bool addInt64PointField( iOstream& os, word fieldName, int32 numActivePoints, int64* field, IncludeMaskType includeMask ); template bool addRealPointField( iOstream& os, word fieldName, int32 numActivePoints, real* field, IncludeMaskType includeMask ); template bool addRealx3PointField( iOstream& os, word fieldName, int32 numActivePoints, realx3* field, IncludeMaskType includeMask ); bool regexCheck(word TYPENAME, word fieldType) { std::regex match("pointField\\<([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(pointField::TYPENAME(), objectType); } bool convertIntTypesPointField( iOstream& os, const IOfileHeader& header, const pointStructure& pStruct ) { word objectType = header.objectType(); if( !(checkFieldType(objectType) || checkFieldType(objectType) || checkFieldType(objectType) || checkFieldType(objectType) || checkFieldType(objectType) || checkFieldType