Skip to content
Snippets Groups Projects
Commit e65ddd4b authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added body filter to PeVTKMeshWriter

parent 9994fb9e
No related merge requests found
...@@ -124,6 +124,9 @@ public: ...@@ -124,6 +124,9 @@ public:
void addVertexPropertyRank() { meshWriter_.addDataSource( make_shared<RankVertexDataSource<MeshType>>() ); } void addVertexPropertyRank() { meshWriter_.addDataSource( make_shared<RankVertexDataSource<MeshType>>() ); }
void addFacePropertyRank() { meshWriter_.addDataSource( make_shared<RankFaceDataSource<MeshType>>() ); } void addFacePropertyRank() { meshWriter_.addDataSource( make_shared<RankFaceDataSource<MeshType>>() ); }
void setBodyFilter( const std::function<bool(const walberla::pe::RigidBody&)>& filter) { bodyFilter_ = filter; }
const std::function<bool(const walberla::pe::RigidBody&)>& getBodyFilter() const { return bodyFilter_; }
protected: protected:
template< typename T > template< typename T >
...@@ -183,6 +186,7 @@ protected: ...@@ -183,6 +186,7 @@ protected:
const walberla::pe::BodyStorage & bodyStorage = (*storage)[0]; const walberla::pe::BodyStorage & bodyStorage = (*storage)[0];
for(auto bodyIt = bodyStorage.begin(); bodyIt != bodyStorage.end(); ++bodyIt) for(auto bodyIt = bodyStorage.begin(); bodyIt != bodyStorage.end(); ++bodyIt)
{ {
if (!bodyFilter_(**bodyIt)) continue;
newVertices.clear(); newVertices.clear();
newFaces.clear(); newFaces.clear();
tesselation_( **bodyIt, *mesh_, newVertices, newFaces ); tesselation_( **bodyIt, *mesh_, newVertices, newFaces );
...@@ -204,6 +208,7 @@ protected: ...@@ -204,6 +208,7 @@ protected:
DistributedVTKMeshWriter<MeshType> meshWriter_; DistributedVTKMeshWriter<MeshType> meshWriter_;
BodyPointerFPropManager faceBodyPointer_; BodyPointerFPropManager faceBodyPointer_;
BodyPointerVPropManager vertexBodyPointer_; BodyPointerVPropManager vertexBodyPointer_;
std::function<bool(const walberla::pe::RigidBody&)> bodyFilter_ = [](const walberla::pe::RigidBody&){ return true; };
}; };
} // namespace pe } // namespace pe
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment