From 19d1ad343de9dc9fa5bc2db9a1a2eeec7163e36a Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Fri, 29 Mar 2024 13:45:29 -0700 Subject: [PATCH 1/2] changes to cellsWallLevel0 to narrow down the contact list for particle-wall --- .../ContactSearch/ContactSearch.hpp | 10 ++-- .../contactSearch/contactSearch.cpp | 8 +-- .../contactSearch/contactSearch.hpp | 10 ++-- .../methods/cellBased/NBS/NBS.cpp | 6 +- .../methods/cellBased/NBS/NBS.hpp | 8 ++- .../methods/cellBased/NBS/NBSLevel0.cpp | 1 - .../methods/cellBased/NBS/cellsWallLevel0.cpp | 60 ++++++++++++------- .../methods/cellBased/NBS/cellsWallLevel0.hpp | 26 ++++++-- .../sphereInteraction/sphereInteraction.cpp | 2 +- 9 files changed, 83 insertions(+), 48 deletions(-) diff --git a/src/Interaction/contactSearch/ContactSearch/ContactSearch.hpp b/src/Interaction/contactSearch/ContactSearch/ContactSearch.hpp index 84fe8c95..c7afcbf0 100644 --- a/src/Interaction/contactSearch/ContactSearch/ContactSearch.hpp +++ b/src/Interaction/contactSearch/ContactSearch/ContactSearch.hpp @@ -56,12 +56,12 @@ public: ContactSearch( const dictionary& csDict, - const box& domain, + const box& extDomain, const particles& prtcl, const geometry& geom, Timers& timers) : - contactSearch(csDict, domain, prtcl, geom, timers) + contactSearch(csDict, extDomain, prtcl, geom, timers) { auto method = dict().getVal("method"); @@ -79,12 +79,13 @@ public: uint32 wnTri = this->Geometry().size(); const auto& wPoints = this->Geometry().points().deviceViewAll(); const auto& wVertices = this->Geometry().vertices().deviceViewAll(); + const auto& wNormals = this->Geometry().normals().deviceViewAll(); ppwContactSearch_ = makeUnique ( nbDict, - this->domainBox(), + this->extendedDomainBox(), minD, maxD, position, @@ -93,7 +94,8 @@ public: wnPoints, wnTri, wPoints, - wVertices + wVertices, + wNormals ); REPORT(2)<<"Contact search algorithm for particle-particle is "<< Green_Text(ppwContactSearch_().typeName())< pFlow::contactSearch::create( const dictionary &dict, - const box &domain, + const box &extDomain, const particles &prtcl, const geometry &geom, Timers &timers) @@ -60,7 +60,7 @@ pFlow::uniquePtr pFlow::contactSearch::create( if( dictionaryvCtorSelector_.search(model)) { - auto objPtr = dictionaryvCtorSelector_[model] (dict, domain, prtcl, geom, timers); + auto objPtr = dictionaryvCtorSelector_[model] (dict, extDomain, prtcl, geom, timers); REPORT(2)<<"Model "<< Green_Text(model)<<" is created."<< END_REPORT; return objPtr; } diff --git a/src/Interaction/contactSearch/contactSearch/contactSearch.hpp b/src/Interaction/contactSearch/contactSearch/contactSearch.hpp index 347ae028..eaf9c100 100644 --- a/src/Interaction/contactSearch/contactSearch/contactSearch.hpp +++ b/src/Interaction/contactSearch/contactSearch/contactSearch.hpp @@ -42,7 +42,7 @@ class contactSearch { private: - const box& domainBox_; + const box& extendedDomainBox_; const particles& particles_; @@ -60,7 +60,7 @@ public: contactSearch( const dictionary& dict, - const box& domain, + const box& extDomain, const particles& prtcl, const geometry& geom, Timers& timers); @@ -88,9 +88,9 @@ public: return dict_; } - const auto& domainBox()const + const auto& extendedDomainBox()const { - return domainBox_; + return extendedDomainBox_; } const auto& Particles()const @@ -133,7 +133,7 @@ public: static uniquePtr create( const dictionary& dict, - const box& domain, + const box& extDomain, const particles& prtcl, const geometry& geom, Timers& timers); diff --git a/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.cpp b/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.cpp index 9c8b3a29..733313b4 100644 --- a/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.cpp +++ b/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.cpp @@ -32,7 +32,8 @@ pFlow::NBS::NBS uint32 nWallPoints, uint32 nWallElements, const ViewType1D& wallPoints, - const ViewType1D& wallVertices + const ViewType1D& wallVertices, + const ViewType1D& wallNormals ) : particleWallContactSearchs( @@ -61,7 +62,8 @@ pFlow::NBS::NBS nWallPoints, nWallElements, wallPoints, - wallVertices + wallVertices, + wallNormals ) { } diff --git a/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.hpp b/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.hpp index f0f83436..11d2e108 100644 --- a/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.hpp +++ b/src/Interaction/contactSearch/methods/cellBased/NBS/NBS.hpp @@ -80,7 +80,10 @@ protected: if(!cellsWallLevel0_.broadSearch( pwPairs, NBSLevel0_.getSearchCells(), - NBSLevel0_.getCellIterator())) + NBSLevel0_.getCellIterator(), + pointPos, + diameter, + sizeRatio_)) { fatalErrorInFunction<< "Error in broadSearch for NBS (particle-wall)"<& wallPoints, - const ViewType1D& wallVertices); + const ViewType1D& wallVertices, + const ViewType1D& wallNormals ); INLINE_FUNCTION_HD diff --git a/src/Interaction/contactSearch/methods/cellBased/NBS/NBSLevel0.cpp b/src/Interaction/contactSearch/methods/cellBased/NBS/NBSLevel0.cpp index 96e47917..8e43c35f 100644 --- a/src/Interaction/contactSearch/methods/cellBased/NBS/NBSLevel0.cpp +++ b/src/Interaction/contactSearch/methods/cellBased/NBS/NBSLevel0.cpp @@ -60,7 +60,6 @@ bool pFlow::NBSLevel0::findPairs } - Kokkos::fence(); } return true; diff --git a/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp b/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp index 5d85a118..00932281 100644 --- a/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp +++ b/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.cpp @@ -26,18 +26,18 @@ pFlow::cellsWallLevel0::cellsWallLevel0 real cellExtent, uint32 numPoints, uint32 numElements, - const ViewType1D &points, - const ViewType1D &vertices + const ViewType1D &points, + const ViewType1D &vertices, + const ViewType1D& normals ) : cellExtent_( max(cellExtent, 0.5 ) ), numElements_(numElements), numPoints_(numPoints), vertices_(vertices), - points_(points) + points_(points), + normals_(normals) { - allocateArrays(); } @@ -45,8 +45,9 @@ bool pFlow::cellsWallLevel0::resetElements ( uint32 numElements, uint32 numPoints, - ViewType1D &points, - ViewType1D &vertices + const ViewType1D& points, + const ViewType1D& vertices, + const ViewType1D& normals ) { @@ -54,6 +55,7 @@ bool pFlow::cellsWallLevel0::resetElements numPoints_ = numPoints; points_ = points; vertices_ = vertices; + normals_ = normals; allocateArrays(); @@ -64,7 +66,10 @@ bool pFlow::cellsWallLevel0::broadSearch ( csPairContainerType &pairs, const cells& searchBox, - const mapperNBS::CellIterator &particleMap + const mapperNBS::CellIterator &particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio ) { @@ -72,7 +77,7 @@ bool pFlow::cellsWallLevel0::broadSearch this->build(searchBox); - this->particleWallFindPairs(pairs, particleMap); + this->particleWallFindPairs(pairs, particleMap, pPoints, pDiams, sizeRatio); return true; } @@ -104,7 +109,10 @@ bool pFlow::cellsWallLevel0::build(const cells & searchBox) bool pFlow::cellsWallLevel0::particleWallFindPairs ( csPairContainerType &pairs, - const mapperNBS::CellIterator &particleMap + const mapperNBS::CellIterator &particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio ) { @@ -113,7 +121,7 @@ bool pFlow::cellsWallLevel0::particleWallFindPairs while (getFull) { - getFull = findPairsElementRangeCount(pairs, particleMap); + getFull = findPairsElementRangeCount(pairs, particleMap, pPoints, pDiams, sizeRatio); if(getFull) { @@ -137,14 +145,14 @@ bool pFlow::cellsWallLevel0::particleWallFindPairs pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount ( csPairContainerType &pairs, - const mapperNBS::CellIterator &particleMap + const mapperNBS::CellIterator &particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio ) { uint32 getFull =0; - - //const auto pwPairs = pairs; - const auto elementBox = elementBox_; - + Kokkos::parallel_reduce( "pFlow::cellsWallLevel0::findPairsElementRangeCount", @@ -155,13 +163,16 @@ pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount const uint32 iTri = teamMember.league_rank(); - const auto triBox = elementBox[iTri]; - + const auto triBox = elementBox_[iTri]; + const auto triPlane = infinitePlane( + normals_[iTri], + points_[vertices_[iTri].x()]); + uint32 getFull2 = 0; auto bExtent = boxExtent(triBox); uint32 numCellBox = bExtent.x()*bExtent.y()*bExtent.z(); - + Kokkos::parallel_reduce( Kokkos::TeamThreadRange( teamMember, numCellBox ), [&] ( const uint32 linIndex, uint32 &innerUpdate ) @@ -175,10 +186,13 @@ pFlow::int32 pFlow::cellsWallLevel0::findPairsElementRangeCount while( n != particleMap.NoPos) { // id is wall id the pair is (particle id, wall id) - if( pairs.insert( - static_cast(n), - static_cast(iTri) ) == -1 ) - innerUpdate++; + if( abs(triPlane.pointFromPlane(pPoints[n]))< pDiams[n]*sizeRatio*cellExtent_) + { + if( pairs.insert( + static_cast(n), + static_cast(iTri) ) == -1 ) + innerUpdate++; + } n = particleMap.next(n); } diff --git a/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.hpp b/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.hpp index 2ffb4414..da7d77d1 100644 --- a/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.hpp +++ b/src/Interaction/contactSearch/methods/cellBased/NBS/cellsWallLevel0.hpp @@ -60,6 +60,9 @@ private: // - ref to points in the trisurface (borrowed) ViewType1D points_; + // - ref to normal vectors of triangles (borrowed) + ViewType1D normals_; + // cell range of element/triangle bounding box ViewType1D elementBox_; @@ -88,7 +91,8 @@ public: uint32 numPoints, uint32 numElements, const ViewType1D& points, - const ViewType1D& vertices); + const ViewType1D& vertices, + const ViewType1D& normals); @@ -97,8 +101,9 @@ public: bool resetElements( uint32 numElements, uint32 numPoints, - ViewType1D& points, - ViewType1D& vertices); + const ViewType1D& points, + const ViewType1D& vertices, + const ViewType1D& normals); INLINE_FUNCTION_HD @@ -116,18 +121,27 @@ public: bool broadSearch( csPairContainerType& pairs, const cells& searchBox, - const mapperNBS::CellIterator& particleMap); + const mapperNBS::CellIterator& particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio); bool build(const cells& searchBox); bool particleWallFindPairs( csPairContainerType& pairs, - const mapperNBS::CellIterator& particleMap); + const mapperNBS::CellIterator& particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio); int32 findPairsElementRangeCount( csPairContainerType& pairs, - const mapperNBS::CellIterator& particleMap); + const mapperNBS::CellIterator& particleMap, + const deviceViewType1D& pPoints, + const deviceViewType1D& pDiams, + real sizeRatio); diff --git a/src/Interaction/sphereInteraction/sphereInteraction.cpp b/src/Interaction/sphereInteraction/sphereInteraction.cpp index 1cb1472e..983d3757 100644 --- a/src/Interaction/sphereInteraction/sphereInteraction.cpp +++ b/src/Interaction/sphereInteraction/sphereInteraction.cpp @@ -134,7 +134,7 @@ pFlow::sphereInteraction::sphereInteraction { contactSearch_ = contactSearch::create( subDict("contactSearch"), - prtcl.thisDomain().domainBox(), + prtcl.extendedDomain().domainBox(), prtcl, geom, timers()); From f288f812fdfe33a4e38a1c85a750085551fc1a43 Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Fri, 29 Mar 2024 13:50:02 -0700 Subject: [PATCH 2/2] pFlowToVTK is added - this utility is not complete yet. - geometry should be ajusted to be converted separately --- src/phasicFlow/fileSystem/fileSystem.cpp | 9 ++ src/phasicFlow/fileSystem/fileSystem.hpp | 8 +- .../repository/Time/timeControl.cpp | 11 ++- .../repository/Time/timeControl.hpp | 10 +- .../systemControl/systemControl.hpp | 6 -- .../pointStructure/pointStructure.hpp | 6 ++ utilities/CMakeLists.txt | 2 +- utilities/Utilities/CMakeLists.txt | 4 +- utilities/pFlowToVTK/CMakeLists.txt | 2 +- utilities/pFlowToVTK/pFlowToVTK.cpp | 50 +++++----- utilities/pFlowToVTK/pointFieldToVTK.hpp | 94 +++++++++---------- 11 files changed, 102 insertions(+), 100 deletions(-) diff --git a/src/phasicFlow/fileSystem/fileSystem.cpp b/src/phasicFlow/fileSystem/fileSystem.cpp index c1abf154..3423ac0b 100644 --- a/src/phasicFlow/fileSystem/fileSystem.cpp +++ b/src/phasicFlow/fileSystem/fileSystem.cpp @@ -281,6 +281,15 @@ pFlow::fileSystem pFlow::operator / } +pFlow::fileSystem pFlow::operator / +( + const fileSystem& fs1, + const word& dir2 +) +{ + return fs1/fileSystem(dir2, ""); +} + pFlow::fileSystem pFlow::operator + ( const fileSystem& fs1, diff --git a/src/phasicFlow/fileSystem/fileSystem.hpp b/src/phasicFlow/fileSystem/fileSystem.hpp index 9eb70122..9f0d63d7 100644 --- a/src/phasicFlow/fileSystem/fileSystem.hpp +++ b/src/phasicFlow/fileSystem/fileSystem.hpp @@ -50,7 +50,13 @@ fileSystem operator / ( const fileSystem& fs1, const fileSystem& fs2 - ); +); + +fileSystem operator / +( + const fileSystem& fs1, + const word& dir2 +); fileSystem operator + ( diff --git a/src/phasicFlow/repository/Time/timeControl.cpp b/src/phasicFlow/repository/Time/timeControl.cpp index 701130e8..206da94e 100644 --- a/src/phasicFlow/repository/Time/timeControl.cpp +++ b/src/phasicFlow/repository/Time/timeControl.cpp @@ -117,6 +117,15 @@ pFlow::timeControl::timeControl( checkForOutputToFile(); } +pFlow::real pFlow::timeControl::setTime(real t) +{ + real tmp = currentTime_; + currentTime_ = t; + lastSaved_ = t; + checkForOutputToFile(); + return tmp; +} + pFlow::word pFlow::timeControl::timeName()const { if(managedExternaly_) @@ -167,8 +176,6 @@ void pFlow::timeControl::checkForOutputToFile() } outputToFile_ = save; - - } bool pFlow::timeControl::timersReportTime()const diff --git a/src/phasicFlow/repository/Time/timeControl.hpp b/src/phasicFlow/repository/Time/timeControl.hpp index 9503d8ea..64129ab0 100644 --- a/src/phasicFlow/repository/Time/timeControl.hpp +++ b/src/phasicFlow/repository/Time/timeControl.hpp @@ -108,14 +108,8 @@ public: return dt_; } - real setTime(real t) - { - real tmp = currentTime_; - currentTime_ = t; - lastSaved_ = t; - checkForOutputToFile(); - return tmp; - } + real setTime(real t); + void setStopAt(real sT) { diff --git a/src/phasicFlow/repository/systemControl/systemControl.hpp b/src/phasicFlow/repository/systemControl/systemControl.hpp index 28d5542b..94d3b939 100644 --- a/src/phasicFlow/repository/systemControl/systemControl.hpp +++ b/src/phasicFlow/repository/systemControl/systemControl.hpp @@ -31,7 +31,6 @@ Licence: #include "types.hpp" #include "Time.hpp" #include "fileDictionary.hpp" -#include "box.hpp" #include "Timers.hpp" #include "dynamicLinkLibs.hpp" #include "Set.hpp" @@ -176,11 +175,6 @@ public: return settingsDict_().getVal("g"); } - /*inline box domain() - { - return box(domainDict().subDict("globalBox")); - }*/ - bool operator ++(int); void setSaveTimeFolder( diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructure.hpp b/src/phasicFlow/structuredData/pointStructure/pointStructure.hpp index 51e76aea..27679178 100644 --- a/src/phasicFlow/structuredData/pointStructure/pointStructure.hpp +++ b/src/phasicFlow/structuredData/pointStructure/pointStructure.hpp @@ -147,6 +147,12 @@ public: { return simulationDomain_().thisDomain(); } + + inline + const auto& extendedDomain()const + { + return boundaries_.extendedDomain(); + } // - IO methods diff --git a/utilities/CMakeLists.txt b/utilities/CMakeLists.txt index db9fee8b..37a70ad1 100644 --- a/utilities/CMakeLists.txt +++ b/utilities/CMakeLists.txt @@ -5,7 +5,7 @@ add_subdirectory(particlesPhasicFlow) add_subdirectory(geometryPhasicFlow) -#add_subdirectory(pFlowToVTK) +add_subdirectory(pFlowToVTK) add_subdirectory(Utilities) diff --git a/utilities/Utilities/CMakeLists.txt b/utilities/Utilities/CMakeLists.txt index 47124ab0..729958ed 100644 --- a/utilities/Utilities/CMakeLists.txt +++ b/utilities/Utilities/CMakeLists.txt @@ -1,8 +1,8 @@ set(SourceFiles readFromTimeFolder.cpp -readControlDict.cpp -#vtkFile/vtkFile.cpp +#readControlDict.cpp +vtkFile/vtkFile.cpp geometryPhasicFlow/Wall/Wall.cpp geometryPhasicFlow/planeWall/planeWall.cpp #geometryPhasicFlow/stlWall/stlWall.cpp diff --git a/utilities/pFlowToVTK/CMakeLists.txt b/utilities/pFlowToVTK/CMakeLists.txt index db943590..353daa6b 100644 --- a/utilities/pFlowToVTK/CMakeLists.txt +++ b/utilities/pFlowToVTK/CMakeLists.txt @@ -1,7 +1,7 @@ set(source_files pFlowToVTK.cpp -geometric.cpp +#geometric.cpp ) set(link_lib phasicFlow Kokkos::kokkos Utilities) diff --git a/utilities/pFlowToVTK/pFlowToVTK.cpp b/utilities/pFlowToVTK/pFlowToVTK.cpp index f4a68e83..9046fb63 100755 --- a/utilities/pFlowToVTK/pFlowToVTK.cpp +++ b/utilities/pFlowToVTK/pFlowToVTK.cpp @@ -18,29 +18,19 @@ Licence: -----------------------------------------------------------------------------*/ - +#include "vocabs.hpp" #include "systemControl.hpp" -#include "pointFieldToVTK.hpp" -#include "triSurfaceFieldToVTK.hpp" #include "timeFolder.hpp" #include "commandLine.hpp" #include "ranges.hpp" -#include "readControlDict.hpp" +#include "Vectors.hpp" +#include "phasicFlowKokkos.hpp" +#include "pointFieldToVTK.hpp" +//#include "triSurfaceFieldToVTK.hpp" +//#include "readControlDict.hpp" -using pFlow::word; -using pFlow::wordVector; -using pFlow::geometryFolder__; -using pFlow::timeFolder; -using pFlow::fileSystem; -using pFlow::wordList; -using pFlow::IOfileHeader; -using pFlow::objectFile; -using pFlow::output; -using pFlow::endl; -using pFlow::multiTriSurface; -using pFlow::commandLine; -using pFlow::realCombinedRange; +using namespace pFlow; int main(int argc, char** argv ) { @@ -68,6 +58,12 @@ int main(int argc, char** argv ) outFolder, "path to output folder of VTK", "path"); + + bool separateSurfaces = false; + cmds.addOption( + "-s,--separate-surfaces", + separateSurfaces, + "surfaces in the geometry are converted separatedly"); wordVector fields; bool allFields = true; @@ -92,7 +88,7 @@ int main(int argc, char** argv ) timeFolder folders(Control); - fileSystem destFolder = fileSystem(outFolder)/geometryFolder__; + fileSystem destFolder = fileSystem(outFolder)/word(geometryFolder__); fileSystem destFolderField = fileSystem(outFolder); wordList geomfiles{"triSurface"}; @@ -117,11 +113,11 @@ int main(int argc, char** argv ) do { - + Control.time().setTime(folders.time()); if( !validRange.isMember( folders.time() ) )continue; - output<< "time: " << cyanText( folders.time() )<<" s" < #include "vtkFile.hpp" +#include "systemControl.hpp" +#include "pointStructure.hpp" #include "pointFields.hpp" -#include "IOobject.hpp" + namespace pFlow::PFtoVTK { -template +/*template bool addIntPointField( iOstream& os, word fieldName, @@ -53,7 +55,7 @@ bool addRealx3PointField( word fieldName, int32 numActivePoints, realx3* field, - IncludeMaskType includeMask ); + IncludeMaskType includeMask );*/ bool regexCheck(word TYPENAME, word fieldType) { @@ -69,14 +71,10 @@ bool regexCheck(word TYPENAME, word fieldType) 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); - + return regexCheck(pointField::TYPENAME(), objectType); } -template +/*template bool convertIntPointField ( iOstream& os, @@ -113,10 +111,10 @@ bool convertIntPointField pStruct.numActive(), data, pStruct.activePointsMaskH() ); -} +}*/ -bool convertRealTypePointField( +/*bool convertRealTypePointField( iOstream& os, const IOfileHeader& header, const pointStructure& pStruct) @@ -144,9 +142,9 @@ bool convertRealTypePointField( pStruct.numActive(), data, pStruct.activePointsMaskH() ); -} +}*/ -bool convertRealx3TypePointField( +/*bool convertRealx3TypePointField( iOstream& os, const IOfileHeader& header, const pointStructure& pStruct) @@ -174,50 +172,45 @@ bool convertRealx3TypePointField( pStruct.numActive(), data, pStruct.activePointsMaskH() ); -} +}*/ -template bool addUndstrcuturedGridField( iOstream& os, - int32 numActivePoints, realx3* position, - IncludeMaskType includeMask) + uint32 numPoints) { - auto [iFirst, iLast] = includeMask.activeRange(); - os<< "DATASET UNSTRUCTURED_GRID\n"; - os<< "POINTS "<< numActivePoints << " float\n"; + os<< "POINTS "<< numPoints << " float\n"; - if(numActivePoints==0) return true; + if(numPoints==0) return true; - for(int32 i=iFirst; i +/*template bool addIntPointField( iOstream& os, word fieldName, @@ -238,9 +231,9 @@ bool addIntPointField( } return true; -} +}*/ -template +/*template bool addRealPointField( iOstream& os, word fieldName, @@ -260,9 +253,9 @@ bool addRealPointField( os<< field[i] <<'\n'; } return true; -} +}*/ -template +/*template bool addRealx3PointField( iOstream& os, word fieldName, @@ -283,16 +276,16 @@ bool addRealx3PointField( } return true; -} +}*/ bool convertTimeFolderPointFields( - fileSystem timeFolder, - real time, + systemControl& control, fileSystem destPath, word bName) { + fileSystem timeFolder = control.time().path(); // check if pointStructure exist in this folder IOfileHeader pStructHeader( objectFile( @@ -304,36 +297,35 @@ bool convertTimeFolderPointFields( if( !pStructHeader.headerOk(true) ) { - output<(pStructHeader); - auto& pStruct = pStructObjPtr().getObject(); + + auto pStruct = pointStructure(control); // get a list of files in this timeFolder; - auto posVec = std::as_const(pStruct).pointPosition().hostVectorAll(); + auto posVec = pStruct.pointPositionHost(); auto* pos = posVec.data(); - REPORT(1)<<"Writing pointStructure to vtk file with "<< yellowText(pStruct.numActive()) - <<" active particles"<