Skip to content
Snippets Groups Projects
Commit a66f5698 authored by Gregor Weiss's avatar Gregor Weiss
Browse files

ENH: offsets for surface fields (exemplary)

parent cfedfb11
No related merge requests found
......@@ -71,6 +71,25 @@ void Foam::sliceMesh::readMesh()
adiosReadPrimitives( "mesh", "neighbours", newGlobalNeighbours_.data(), faceStart, faceCount );
adiosReadToContainer( "mesh", "neighbours", globalNeighbours_, faceStart, faceCount );
// Offsets for surfaceFields ( owning faces )
// Offsets of all faces
Foam::Offsets faceOffsets_;
faceOffsets_.set( globalNeighbours_.size() );
// Offsets of all internal faces
auto internal = []( label index ) { return index >= 0; };
internalSurfaceFieldOffsets_.set( std::count_if( std::begin( globalNeighbours_ ),
std::end( globalNeighbours_ ),
internal ) );
// Offsets of all physical boundary faces
for ( Foam::label patchi = 0; patchi < numBoundaries_; ++patchi ) {
auto slicePatchId = Foam::encodeSlicePatchId( patchi );
auto boundary = [ slicePatchId ]( Foam::label index ) { return index == slicePatchId; };
Foam::Offsets tmpOffsets( std::count_if( std::begin( globalNeighbours_ ),
std::end( globalNeighbours_ ),
boundary ) );
boundarySurfacePatchOffsets_.push_back( tmpOffsets );
}
// Reading faceStarts and faces
std::vector<Foam::label> faceStarts;
adiosReadToContainer( "mesh", "faceStarts", faceStarts, faceStart, faceCount + 1 );
......
......@@ -89,6 +89,9 @@ class sliceMesh
faceList globalFaces_{};
pointField allPoints_{};
Offsets cellOffsets_{};
Offsets faceOffsets_{};
Offsets internalSurfaceFieldOffsets_{};
std::vector<Offsets> boundarySurfacePatchOffsets_{};
Offsets pointOffsets_{};
Slice cellSlice_{};
Slice pointSlice_{};
......
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