diff --git a/src/Geometry/geometry/geometry.hpp b/src/Geometry/geometry/geometry.hpp index d526bde3..acc40dfd 100644 --- a/src/Geometry/geometry/geometry.hpp +++ b/src/Geometry/geometry/geometry.hpp @@ -229,6 +229,7 @@ public: auto area = triSurface_.area().deviceVectorAll(); auto stress = stressWall_.deviceVectorAll(); auto numTri =triSurface_.size(); + Kokkos::parallel_for( "geometry::calculateStress", diff --git a/src/phasicFlow/repository/IOobject/IOfileHeader.cpp b/src/phasicFlow/repository/IOobject/IOfileHeader.cpp index 980835d1..a30daa8e 100644 --- a/src/phasicFlow/repository/IOobject/IOfileHeader.cpp +++ b/src/phasicFlow/repository/IOobject/IOfileHeader.cpp @@ -31,7 +31,15 @@ pFlow::uniquePtr pFlow::IOfileHeader::inStream()const pFlow::uniquePtr pFlow::IOfileHeader::outStream()const { - return makeUnique(path()); + auto osPtr = makeUnique(path()); + + if(osPtr && owner_) + { + auto outPrecision = owner_->outFilePrecision(); + osPtr->precision(outPrecision); + } + + return osPtr; } pFlow::IOfileHeader::IOfileHeader diff --git a/src/phasicFlow/repository/repository/repository.hpp b/src/phasicFlow/repository/repository/repository.hpp index 251a6af4..ae9c059d 100644 --- a/src/phasicFlow/repository/repository/repository.hpp +++ b/src/phasicFlow/repository/repository/repository.hpp @@ -178,6 +178,18 @@ public: // - return number of repositories size_t numRepositories()const; + + virtual + size_t outFilePrecision() const + { + if(owner_) + { + return owner_->outFilePrecision(); + }else + { + return 6; + } + } // - return a ref to the underlaying data in the object template diff --git a/src/phasicFlow/repository/systemControl/systemControl.cpp b/src/phasicFlow/repository/systemControl/systemControl.cpp index 3f673137..e8919f11 100644 --- a/src/phasicFlow/repository/systemControl/systemControl.cpp +++ b/src/phasicFlow/repository/systemControl/systemControl.cpp @@ -135,6 +135,9 @@ pFlow::systemControl::systemControl true ) ), + outFilePrecision_( + settingsDict_.getValOrSet("outFilePrecision", static_cast(6)) + ), Time_ ( this, diff --git a/src/phasicFlow/repository/systemControl/systemControl.hpp b/src/phasicFlow/repository/systemControl/systemControl.hpp index ac894ebb..7b25c436 100644 --- a/src/phasicFlow/repository/systemControl/systemControl.hpp +++ b/src/phasicFlow/repository/systemControl/systemControl.hpp @@ -58,12 +58,15 @@ protected: // - settingsDict fileDictionary dictionary& settingsDict_; + // - precision for writing to file + size_t outFilePrecision_ = 6; + // - time repository Time Time_; // - if time control is managed externaly - bool externalTimeControl_ = false; + bool externalTimeControl_ = false; // - acceleration realx3 g_; @@ -178,6 +181,11 @@ public: Time_.setSaveTimeFolder(saveToFile, timeName); } + size_t outFilePrecision() const override + { + return outFilePrecision_; + } + }; diff --git a/src/phasicFlow/structuredData/trisurfaceStructure/multiTriSurface.cpp b/src/phasicFlow/structuredData/trisurfaceStructure/multiTriSurface.cpp index f06d9ed9..4e3af48b 100644 --- a/src/phasicFlow/structuredData/trisurfaceStructure/multiTriSurface.cpp +++ b/src/phasicFlow/structuredData/trisurfaceStructure/multiTriSurface.cpp @@ -101,6 +101,7 @@ bool pFlow::multiTriSurface::addTriSurface const auto& newPoints = tSurf.points(); const auto& newVertices = tSurf.vertices(); + const auto& newAreas = tSurf.area(); // @@ -112,8 +113,14 @@ bool pFlow::multiTriSurface::addTriSurface auto vOldSize = vertices_.size(); auto vNewSize = vOldSize + newVertices.size(); vertices_.resize(vNewSize); + area_.resize(vNewSize); + auto verVec = vertices_.deviceVectorAll(); + auto areaVec = area_.deviceVectorAll(); + auto newVerVec = newVertices.deviceVectorAll(); + auto newArea = newAreas.deviceVectorAll(); + auto maxIdx = maxIndex(); Kokkos::parallel_for( @@ -121,6 +128,7 @@ bool pFlow::multiTriSurface::addTriSurface newVertices.size(), LAMBDA_HD(int32 i){ verVec[vOldSize+i] = newVerVec[i]+(maxIdx+1); + areaVec[vOldSize+i] = newArea[i]; } ); Kokkos::fence(); diff --git a/src/phasicFlow/structuredData/trisurfaceStructure/stlFile.cpp b/src/phasicFlow/structuredData/trisurfaceStructure/stlFile.cpp index 4e9f8d14..0dc3cde6 100644 --- a/src/phasicFlow/structuredData/trisurfaceStructure/stlFile.cpp +++ b/src/phasicFlow/structuredData/trisurfaceStructure/stlFile.cpp @@ -61,19 +61,46 @@ bool pFlow::stlFile::readSolid if(!checkWordToken(is, tok, "solid")) return false; // check if there is a name associated with solid + name = ""; + + + int32 nWords =0; + bool reachedFacet = false; is >> tok; - if( badInput(is, tok) ) return false; - if(!tok.isWord()) return false; - if(tok.wordToken() != "facet" ) + while (nWords < 20 ) { - name = tok.wordToken(); + if( badInput(is, tok) ) return false; + //if(!tok.isWord()) return false; + nWords++; + if(tok.isWord() && tok.wordToken() != "facet" ) + { + name += tok.wordToken(); + } + else if( tok.isNumber()) + { + auto val = tok.number(); + name += real2Word(val); + } + else if( tok.isPunctuation()) + { + name += tok.pToken(); + } + else if (tok.isWord() && tok.wordToken() == "facet") + { + is.putBack(tok); + reachedFacet = true; + break; + } + else + { + return false; + } + is >> tok; } - else - { - name = ""; - is.putBack(tok); - } + + if(!reachedFacet) return false; + vertecies.clear(); while(true ) {