Commit 04094a1a authored by Michael Kuron's avatar Michael Kuron 🔬

Merge branch 'vtk_Int32' into 'master'

Change vtk cell connectivity and cell offsets to int32

See merge request !256
parents b2d24ca2 49c42ce0
Pipeline #22497 passed with stages
in 439 minutes and 19 seconds
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
......@@ -366,11 +366,11 @@ void VTKOutput::writeDomainDecompositionPieces( std::ostream& ofs, const Set<SUI
if( binary_ )
{
Base64Writer base64;
for( uint32_t i = 0; i != uint32_c( points ); ++i )
for( int32_t i = 0; i != int32_c( points ); ++i )
base64 << i;
ofs << " "; base64.toStream( ofs );
}
else for( uint_t i = 0; i != points; i += 8 )
else for( int32_t i = 0; i != int32_c( points ); i += 8 )
ofs << " " << ( i ) << " " << ( i + 1 ) << " " << ( i + 2 ) << " " << ( i + 3 ) << " "
<< ( i + 4 ) << " " << ( i + 5 ) << " " << ( i + 6 ) << " " << ( i + 7 ) << "\n";
......@@ -380,12 +380,12 @@ void VTKOutput::writeDomainDecompositionPieces( std::ostream& ofs, const Set<SUI
if( binary_ )
{
Base64Writer base64;
for( uint_t i = 0; i != points; i += 8 )
base64 << uint32_c( i + uint_c( 8 ) );
for( int32_t i = 0; i != int32_c( points ); i += 8 )
base64 << i + int32_c( 8 );
ofs << " "; base64.toStream( ofs );
}
else for( uint_t i = 0; i != points; i += 8 )
ofs << " " << uint32_c( i + uint_c( 8 ) ) << "\n";
else for( int32_t i = 0; i != int32_c( points ); i += 8 )
ofs << " " << i + int32_c( 8 ) << "\n";
ofs << " </DataArray>\n"
<< " <DataArray type=\"" << vtk::typeToString< uint8_t >() << "\" Name=\"types\" format=\"" << format_ << "\">\n";
......@@ -607,7 +607,7 @@ void VTKOutput::writePointData( const std::string& path )
ofs << "<?xml version=\"1.0\"?>\n"
<< "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"" << endianness_ << "\">\n"
<< " <UnstructuredGrid>\n";
writePointDataPieceHelper( points, outputPoint, numberOfPoints, ofs );
......@@ -1072,10 +1072,10 @@ void VTKOutput::writeBlockPieces( std::ostream & oss, const Set<SUID>& requiredS
writeVTIPiece_sampling( oss, block );
}
else // unstructured data -> vtu
{
{
CellVector cells; // cells to be written to file
computeVTUCells( block, cells );
if( !cells.empty() )
{
if( samplingDx_ <= real_c(0) || samplingDy_ <= real_c(0) || samplingDz_ <= real_c(0) )
......@@ -1137,7 +1137,7 @@ void VTKOutput::writeVTI_sampling( std::ostream& ofs, const IBlock& block ) cons
{
const AABB& blockBB = block.getAABB();
const AABB& domain = blockStorage_->getDomain();
CellInterval cellBB = getSampledCellInterval( blockBB );
ofs << "<?xml version=\"1.0\"?>\n"
......@@ -1644,11 +1644,11 @@ void VTKOutput::writePVD()
std::string file( baseFolder_ + "/" + identifier_ + ".pvd" );
std::fstream ofs( file.c_str() );
if( !ofs ) // failed because file does not yet exist
{
ofs.open( file.c_str(), std::ios::out );
ofs << "<?xml version=\"1.0\"?>\n"
<< "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"" << endianness_ << "\">\n"
<< " <Collection>\n";
......@@ -1695,7 +1695,7 @@ void VTKOutput::writePVD()
ofs << " <DataSet timestep=\"" << *collector << "\" file=\"" << collection.str() << "\"/>\n";
}
allCollectors_.clear();
pvdEnd_ = ofs.tellp();
WALBERLA_ASSERT_GREATER( pvdEnd_, 0 );
ofs << " </Collection>\n"
......@@ -1831,7 +1831,7 @@ bool VTKOutput::writeCombinedVTI( std::string localPart, const uint_t collector
<< cellBB.yMin() << " " << ( cellBB.yMax() + 1 ) << " "
<< cellBB.zMin() << " " << ( cellBB.zMax() + 1 ) << "\""
<< " Origin=\"" << domain.xMin() << " " << domain.yMin() << " " << domain.zMin() << "\""
<< " Spacing=\"" << blockStorage_->dx() << " " << blockStorage_->dy() << " " << blockStorage_->dz()
<< " Spacing=\"" << blockStorage_->dx() << " " << blockStorage_->dy() << " " << blockStorage_->dz()
<< "\">\n\n";
localPart.insert( 0, header.str() );
......
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
......@@ -57,7 +57,7 @@ private:
// types used during vertex-index mapping procedure when writing (P)VTU files
typedef std::tuple< cell_idx_t, cell_idx_t, cell_idx_t > Vertex;
typedef std::tuple< real_t, real_t, real_t > VertexCoord;
typedef uint32_t Index;
typedef int32_t Index;
struct VertexCompare {
bool operator()( const Vertex& lhs, const Vertex& rhs ) const
......@@ -126,7 +126,7 @@ public:
friend inline shared_ptr<VTKOutput> createVTKOutput_BlockData( const StructuredBlockStorage & sbs, const std::string & identifier,
const uint_t writeFrequency, const uint_t ghostLayers, const bool forcePVTU,
const std::string & baseFolder, const std::string & executionFolder,
const bool continuousNumbering, const bool binary, const bool littleEndian,
const bool continuousNumbering, const bool binary, const bool littleEndian,
const bool useMPIIO, const uint_t initialExecutionCount );
/// creates a VTKOutput object that is supposed to output arbitrary point data
......@@ -140,7 +140,7 @@ public:
friend inline shared_ptr<VTKOutput> createVTKOutput_PolylineData( const shared_ptr< PolylineDataSource > pds, const std::string & identifier,
const uint_t writeFrequency,
const std::string & baseFolder, const std::string & executionFolder,
const bool continuousNumbering, const bool binary, const bool littleEndian,
const bool continuousNumbering, const bool binary, const bool littleEndian,
const bool useMPIIO, const uint_t initialExecutionCount );
typedef std::function< void () > BeforeFunction;
......@@ -214,7 +214,7 @@ private:
void writeDomainDecomposition( const std::string& path, const Set<SUID>& requiredStates, const Set<SUID>& incompatibleStates ) const;
void writeDomainDecompositionPieces( std::ostream& ofs, const Set<SUID>& requiredStates, const Set<SUID>& incompatibleStates ) const;
void computeOutputPoints( std::vector<Vector3<real_t> > & points, std::vector<bool> & outputPoint,
void computeOutputPoints( std::vector<Vector3<real_t> > & points, std::vector<bool> & outputPoint,
uint_t & numberOfPoints ) const;
void writePointDataPieceHelper( const std::vector<Vector3<real_t> > & points, const std::vector<bool> & outputPoint,
const uint_t numberOfPoints, std::ostream & ofs ) const;
......@@ -227,7 +227,7 @@ private:
uint_t & numberOfPolylines, uint_t & numberOfPolylinePoints ) const;
void writePolylineDataPieceHelper( const std::vector< std::vector< Vector3< real_t > > > & lines,
const std::vector< std::vector< bool > > & outputPolylinePoint, const std::vector< size_t > & polylineSize,
const std::vector< std::vector< bool > > & outputPolylinePoint, const std::vector< size_t > & polylineSize,
const uint_t numberOfPolylines, const uint_t numberOfPolylinePoints, std::ostream & ofs ) const;
void writePolylineData( const std::string& path );
......
Markdown is supported
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