Commit 8145e769 authored by Michael Kuron's avatar Michael Kuron 🔬 Committed by Christian Godenschwager

[API] Remove boost::filesystem

API change for vtk::VTKOutput::getFilenames
parent 71eff542
......@@ -436,6 +436,46 @@ endif()
############################################################################################################################
##
## Find optional C++ libraries
##
############################################################################################################################
try_compile( WALBERLA_USE_STD_FILESYSTEM "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestStdFilesystem.cpp"
COMPILE_DEFINITIONS -DWALBERLA_USE_STD_FILESYSTEM -std=c++14 )
if( WALBERLA_USE_STD_FILESYSTEM )
message( STATUS "Found std::filesystem")
else()
try_compile( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestStdFilesystem.cpp"
COMPILE_DEFINITIONS -DWALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM -std=c++14 )
if( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
message( STATUS "Found std::experimental::filesystem")
endif()
if( NOT WALBERLA_CXX_COMPILER_IS_MSVC AND NOT WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
unset( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM CACHE )
try_compile( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestStdFilesystem.cpp"
COMPILE_DEFINITIONS -DWALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM -std=c++14
LINK_LIBRARIES stdc++fs )
if( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
message( STATUS "Found std::experimental::filesystem in libstdc++fs")
list ( APPEND SERVICE_LIBS -lstdc++fs )
endif()
endif()
if( NOT WALBERLA_CXX_COMPILER_IS_MSVC AND NOT WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
unset( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM CACHE )
try_compile( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestStdFilesystem.cpp"
COMPILE_DEFINITIONS -DWALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM -std=c++14
LINK_LIBRARIES c++experimental )
if( WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
message( STATUS "Found std::experimental::filesystem in libc++experimental")
list ( APPEND SERVICE_LIBS -lc++experimental )
endif()
endif()
endif()
############################################################################################################################
##
## Visual Studio Setup
......@@ -574,7 +614,9 @@ endif()
#############################################################################################################################
set ( waLBerla_REQUIRED_MIN_BOOST_VERSION "1.48")
list ( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS filesystem system )
if ( NOT WALBERLA_USE_STD_FILESYSTEM AND NOT WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM )
list ( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS filesystem system )
endif()
if ( WALBERLA_BUILD_WITH_PYTHON AND WALBERLA_CXX_COMPILER_IS_MSVC )
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS python3 )
......
......@@ -944,9 +944,9 @@ int main( int argc, char **argv )
WALBERLA_LOG_INFO_ON_ROOT("Basefolder for simulation results: " << basefolder);
// create base directory if it does not yet exist
boost::filesystem::path tpath( basefolder );
if( !boost::filesystem::exists( tpath ) )
boost::filesystem::create_directory( tpath );
filesystem::path tpath( basefolder );
if( !filesystem::exists( tpath ) )
filesystem::create_directory( tpath );
// setup of the LBM communication for synchronizing the pdf field between neighboring blocks
std::function< void () > commFunction;
......@@ -1255,9 +1255,9 @@ int main( int argc, char **argv )
pdfFieldVTK->addBeforeFunction(VTKInfoLogger( &timeloop, blocks, bodyStorageID, basefolder, uInfty ));
// create folder for log_vtk files to not pollute the basefolder
boost::filesystem::path tpath2( basefolder+"/log_vtk" );
if( !boost::filesystem::exists( tpath2 ) )
boost::filesystem::create_directory( tpath2 );
filesystem::path tpath2( basefolder+"/log_vtk" );
if( !filesystem::exists( tpath2 ) )
filesystem::create_directory( tpath2 );
field::FlagFieldCellFilter< FlagField_T > fluidFilter( flagFieldID );
......
......@@ -740,9 +740,9 @@ int main( int argc, char **argv ) {
if( !funcTest )
{
// create base directory if it does not yet exist
boost::filesystem::path tpath( vtkBaseFolder );
if( !boost::filesystem::exists( tpath ) )
boost::filesystem::create_directory( tpath );
filesystem::path tpath( vtkBaseFolder );
if( !filesystem::exists( tpath ) )
filesystem::create_directory( tpath );
}
......
......@@ -21,17 +21,16 @@
#include "geometry/mesh/TriangleMesh.h"
#include "geometry/mesh/TriangleMeshIO.h"
#include "core/Regex.h"
#include "core/Filesystem.h"
#include <fstream>
#include <iomanip>
#include <iostream>
#define BOOST_FILESYSTEM_NO_DEPRECATED
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
namespace fs = boost::filesystem;
namespace filesystem = walberla::filesystem;
bool verbose;
bool quiet;
......@@ -90,29 +89,29 @@ int main(int argc, char** argv)
if( quiet && verbose )
PRINT_ERR( "PovrayFileCompressor can't be quiet (-q) and verbose (-v) at the same time\n" )
fs::path inPath(argv[argc-2]);
if( !fs::exists(inPath) || !fs::is_directory(inPath) )
filesystem::path inPath(argv[argc-2]);
if( !filesystem::exists(inPath) || !filesystem::is_directory(inPath) )
PRINT_ERR( "Path " << inPath << " does not exist or is not a directory!\n" );
fs::path outPath(argv[argc-1]);
if( !fs::exists(outPath) )
fs::create_directories(outPath);
filesystem::path outPath(argv[argc-1]);
if( !filesystem::exists(outPath) )
filesystem::create_directories(outPath);
PRINT_DEF( "Input Path: " << inPath << "\nOutput Path: " << outPath << "\n" )
std::vector< std::vector<fs::path> > infiles;
std::vector< std::vector<filesystem::path> > infiles;
PRINT_DEF( "Collecting files to compress ..." )
for(auto pit = fs::directory_iterator(inPath); pit != fs::directory_iterator(); ++pit)
for(auto pit = filesystem::directory_iterator(inPath); pit != filesystem::directory_iterator(); ++pit)
{
if( !fs::is_directory( pit->status() ) )
if( !filesystem::is_directory( pit->status() ) )
continue;
PRINT_VER( "\nCollecting files to compress in: " << pit->path())
std::vector<fs::path> pfiles;
for(auto tit = fs::directory_iterator(pit->path()); tit != fs::directory_iterator(); ++tit)
std::vector<filesystem::path> pfiles;
for(auto tit = filesystem::directory_iterator(pit->path()); tit != filesystem::directory_iterator(); ++tit)
{
static const walberla::regex extensionExpression("\\.dat");
if( walberla::regex_match( tit->path().extension().string(), extensionExpression ) )
......@@ -140,14 +139,14 @@ int main(int argc, char** argv)
{
PRINT_VER( "Compress timestep " << t << "\n" )
PRINT_VER( "Merge Splitted Meshes: \n" )
PRINT_VER( "Merge Mesh: " << fs::absolute(infiles[0][t]).string().c_str() << "\n" )
std::ifstream is( fs::absolute(infiles[0][t]).string().c_str() );
PRINT_VER( "Merge Mesh: " << filesystem::absolute(infiles[0][t]).string().c_str() << "\n" )
std::ifstream is( filesystem::absolute(infiles[0][t]).string().c_str() );
walberla::geometry::readMeshPov(is, mesh, true);
is.close();
for( size_t p = 1u; p < processes; ++p ){
PRINT_VER( "Merge Mesh: " << fs::absolute(infiles[p][t]).string().c_str() << "\n" )
std::ifstream tis( fs::absolute(infiles[p][t]).string().c_str() );
PRINT_VER( "Merge Mesh: " << filesystem::absolute(infiles[p][t]).string().c_str() << "\n" )
std::ifstream tis( filesystem::absolute(infiles[p][t]).string().c_str() );
walberla::geometry::readMeshPov(tis, mesh, false);
tis.close();
}
......@@ -172,7 +171,7 @@ int main(int argc, char** argv)
}
}
fs::path oPath = fs::absolute(outPath) / infiles[0][t].filename();
filesystem::path oPath = filesystem::absolute(outPath) / infiles[0][t].filename();
PRINT_VER( "Write New Mesh File: " << (oPath.string().c_str()) << "\n" )
std::ofstream os( oPath.string().c_str() );
walberla::geometry::writeMeshPov( os, mesh, 0u, n );
......
#include <iostream>
#if defined(WALBERLA_USE_STD_FILESYSTEM)
#include <filesystem>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM)
#include <experimental/filesystem>
#endif
int main() {
#if defined(WALBERLA_USE_STD_FILESYSTEM)
std::filesystem::path p("/tmp/test.txt");
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM)
std::experimental::filesystem::path p("/tmp/test.txt");
#endif
std::cout << p << std::endl;
return 0;
}
//======================================================================================================================
//
// 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
// 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
// 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/>.
//
//! \file Filesystem.h
//! \ingroup core
//! \author Michael Kuron <mkuron@icp.uni-stuttgart.de>
//
//======================================================================================================================
#pragma once
#if defined(WALBERLA_USE_STD_FILESYSTEM)
#include <filesystem>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM)
#include <experimental/filesystem>
#else
#include <boost/filesystem.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#endif
namespace walberla {
namespace filesystem {
#if defined(WALBERLA_USE_STD_FILESYSTEM)
using namespace std::filesystem;
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM)
using namespace std::experimental::filesystem;
#else
using namespace boost::filesystem;
#endif
}
}
......@@ -262,7 +262,7 @@ void Config::parseFromFile( const char* filename, Block& block, unsigned int lev
}
else {
removeTrailingWhiteSpaces( value );
std::string file( (boost::filesystem::path( getDirectory( filename ) ) / value).string() );
std::string file( (filesystem::path( getDirectory( filename ) ) / value).string() );
parseFromFile( file.c_str(), block, level+1 );
}
}
......@@ -395,7 +395,7 @@ void Config::extractBlock( const char* filename, std::stringstream& input, Block
}
else {
removeTrailingWhiteSpaces( value );
std::string file( (boost::filesystem::path( getDirectory( filename ) ) / value).string() );
std::string file( (filesystem::path( getDirectory( filename ) ) / value).string() );
parseFromFile( file.c_str(), block, level+1 );
}
}
......
......@@ -37,11 +37,7 @@
// boost includes
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/path.hpp>
#ifndef BOOST_FILESYSTEM_VERSION
#define BOOST_FILESYSTEM_VERSION 1
#endif
#include "core/Filesystem.h"
......@@ -687,13 +683,8 @@ inline void Config::convertToLowerCase( std::string& s )
*/
inline std::string Config::getDirectory( const std::string& path )
{
boost::filesystem::path p( path );
# if BOOST_FILESYSTEM_VERSION>2
return p.branch_path().string();
# else
# warning BOOST FILESYSTEM VERSION IS RATHER OLD! PLEASE USE BOOST VERSION 1.46 OR HIGHER
filesystem::path p( path );
return p.parent_path().string();
# endif
}
//**********************************************************************************************************************
......@@ -707,12 +698,8 @@ inline std::string Config::getDirectory( const std::string& path )
*/
inline std::string Config::getFilename( const std::string& path )
{
boost::filesystem::path p( path );
# if BOOST_FILESYSTEM_VERSION>2
return p.leaf().string();
# else
return p.filename();
# endif
filesystem::path p( path );
return p.filename().string();
}
//**********************************************************************************************************************
......
......@@ -21,8 +21,7 @@
#include "Logging.h"
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include "core/Filesystem.h"
#include <ctime>
......@@ -105,9 +104,9 @@ void Logging::includeLoggingToFile( const std::string & file, bool append )
std::ostringstream filename;
if( file.empty() )
{
boost::filesystem::path logDir( "logging" );
if( !boost::filesystem::exists( logDir ) )
boost::filesystem::create_directory( logDir );
filesystem::path logDir( "logging" );
if( !filesystem::exists( logDir ) )
filesystem::create_directory( logDir );
if( numberOfProcesses_ == 1 )
filename << "logging/logfile.txt";
......@@ -120,7 +119,7 @@ void Logging::includeLoggingToFile( const std::string & file, bool append )
filename << file;
else
{
boost::filesystem::path filePath( file );
filesystem::path filePath( file );
const std::string stem = filePath.stem().string();
const std::string extension = filePath.extension().string();
const std::string modifiedFilename = stem + std::string("_") + rank.str() + extension;
......
......@@ -27,7 +27,7 @@
#include "core/mpi/RecvBuffer.h"
#include "core/mpi/SendBuffer.h"
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
#include <boost/lexical_cast.hpp>
......@@ -56,7 +56,7 @@ FileGatherScheme::~FileGatherScheme()
void FileGatherScheme::deleteTemporaryFiles()
{
using namespace boost::filesystem;
using namespace filesystem;
using std::string;
for(int rank=0; rank < MPIManager::instance()->numProcesses(); ++rank)
......@@ -108,7 +108,7 @@ void FileGatherScheme::writeToFile()
void FileGatherScheme::collectFromFiles()
{
using namespace boost::filesystem;
using namespace filesystem;
using namespace std;
if ( fileStream_.is_open() )
......
......@@ -28,7 +28,7 @@
#include <fstream>
#include <string>
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
#ifdef _MSC_VER
# pragma warning(push)
......@@ -57,10 +57,10 @@ namespace mesh {
template< typename MeshType >
void readAndBroadcast( const std::string & filename, MeshType & mesh )
{
if( !boost::filesystem::exists( filename ) )
if( !filesystem::exists( filename ) )
WALBERLA_ABORT( "The mesh file \"" << filename << "\" does not exist!" );
std::string extension = boost::filesystem::extension( filename );
std::string extension = filesystem::path( filename ).extension().string();
std::string str;
......
......@@ -29,7 +29,7 @@
#include "vtk/Base64Writer.h"
#include "vtk/UtilityFunctions.h"
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
#include <iostream>
#include <vector>
......@@ -194,15 +194,15 @@ VTKMeshWriter<MeshType>::VTKMeshWriter( const shared_ptr<const MeshType> & mesh,
{
std::ostringstream folder;
folder << baseFolder_ << '/' << identifier_;
if( boost::filesystem::exists( folder.str() ) )
boost::filesystem::remove_all( folder.str() );
if( filesystem::exists( folder.str() ) )
filesystem::remove_all( folder.str() );
std::ostringstream pvdFile;
pvdFile << baseFolder_ << '/' << identifier_ << ".pvd";
if( boost::filesystem::exists( pvdFile.str() ) )
boost::filesystem::remove( pvdFile.str() );
if( filesystem::exists( pvdFile.str() ) )
filesystem::remove( pvdFile.str() );
boost::filesystem::create_directories( folder.str() );
filesystem::create_directories( folder.str() );
}
WALBERLA_MPI_BARRIER();
}
......
......@@ -31,7 +31,7 @@
#include "helper/ExceptionHandling.h"
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
namespace walberla {
namespace python_coupling {
......@@ -53,15 +53,15 @@ namespace python_coupling {
code << "] \n";
boost::filesystem::path path ( fileOrModuleName );
path = boost::filesystem::absolute( path );
filesystem::path path ( fileOrModuleName );
path = filesystem::absolute( path );
if ( path.extension() == ".py" )
{
moduleName = path.stem().string();
if ( ! path.parent_path().empty() ) {
std::string p = boost::filesystem::canonical(path.parent_path()).string();
std::string p = filesystem::canonical(path.parent_path()).string();
code << "sys.path.append( r'" << p << "')" << "\n";
}
}
......
......@@ -138,20 +138,20 @@ void VTKOutput::init( const std::string & identifier )
WALBERLA_ROOT_SECTION()
{
boost::filesystem::path path( baseFolder_ + "/" + identifier_ );
if( boost::filesystem::exists( path ) && executionCounter_ == 0 )
boost::filesystem::remove_all( path );
filesystem::path path( baseFolder_ + "/" + identifier_ );
if( filesystem::exists( path ) && executionCounter_ == 0 )
filesystem::remove_all( path );
boost::filesystem::path pvd( baseFolder_ + "/" + identifier_ + ".pvd" );
if( boost::filesystem::exists( pvd ) && executionCounter_ == 0 )
filesystem::path pvd( baseFolder_ + "/" + identifier_ + ".pvd" );
if( filesystem::exists( pvd ) && executionCounter_ == 0 )
std::remove( pvd.string().c_str() );
boost::filesystem::path basePath( baseFolder_ );
if( !boost::filesystem::exists( basePath ) )
boost::filesystem::create_directories( basePath );
filesystem::path basePath( baseFolder_ );
if( !filesystem::exists( basePath ) )
filesystem::create_directories( basePath );
if ( !boost::filesystem::exists( path ) )
boost::filesystem::create_directories( path );
if ( !filesystem::exists( path ) )
filesystem::create_directories( path );
}
WALBERLA_MPI_WORLD_BARRIER();
......@@ -181,9 +181,9 @@ void VTKOutput::forceWrite( uint_t number, const bool immediatelyWriteCollectors
{
if( !useMPIIO_ )
{
boost::filesystem::path tpath( path.str() );
if( !boost::filesystem::exists( tpath ) )
boost::filesystem::create_directory( tpath );
filesystem::path tpath( path.str() );
if( !filesystem::exists( tpath ) )
filesystem::create_directory( tpath );
}
}
WALBERLA_MPI_WORLD_BARRIER();
......@@ -1730,7 +1730,7 @@ void VTKOutput::writePVTI( const uint_t collector ) const
ofs << " </PCellData>\n";
std::vector< boost::filesystem::path > files;
std::vector< filesystem::path > files;
getFilenames( files, collector );
for( auto file = files.begin(); file != files.end(); ++file )
......@@ -1780,7 +1780,7 @@ void VTKOutput::writePVTI_sampled( const uint_t collector ) const
ofs << " </PCellData>\n";
std::vector< boost::filesystem::path > files;
std::vector< filesystem::path > files;
getFilenames( files, collector );
for( auto file = files.begin(); file != files.end(); ++file )
......@@ -1928,7 +1928,7 @@ void VTKOutput::writePVTU( const uint_t collector ) const
ofs << " </PCellData>\n";
std::vector< boost::filesystem::path > files;
std::vector< filesystem::path > files;
getFilenames( files, collector );
for( auto file = files.begin(); file != files.end(); ++file )
......@@ -1980,17 +1980,17 @@ bool VTKOutput::writeCombinedVTU( std::string localPart, const uint_t collector
void VTKOutput::getFilenames( std::vector< boost::filesystem::path >& files, const uint_t collector ) const
void VTKOutput::getFilenames( std::vector< filesystem::path >& files, const uint_t collector ) const
{
std::ostringstream path;
path << baseFolder_ << "/" << identifier_ << "/" << executionFolder_ << "_" << collector;
boost::filesystem::path directory( path.str() );
filesystem::path directory( path.str() );
WALBERLA_ASSERT( boost::filesystem::exists( directory ) );
WALBERLA_ASSERT( filesystem::exists( directory ) );
for( boost::filesystem::directory_iterator file( directory ); file != boost::filesystem::directory_iterator(); ++file )
for( filesystem::directory_iterator file( directory ); file != filesystem::directory_iterator(); ++file )
{
WALBERLA_ASSERT( boost::filesystem::is_regular_file( file->path() ) && !boost::filesystem::is_directory( file->path() ) );
WALBERLA_ASSERT( filesystem::is_regular_file( file->path() ) && !filesystem::is_directory( file->path() ) );
files.push_back( file->path() );
}
}
......
......@@ -33,8 +33,7 @@
#include "domain_decomposition/StructuredBlockStorage.h"
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include "core/Filesystem.h"
#include <functional>
#include <boost/tuple/tuple.hpp>
......@@ -271,7 +270,7 @@ private:
bool writeCombinedVTI_sampled( std::string localPart, const uint_t collector ) const;
bool writeCombinedVTU(std::string localPart, const uint_t collector) const;
void getFilenames( std::vector< boost::filesystem::path >& blocks, const uint_t collector ) const;
void getFilenames( std::vector< filesystem::path >& blocks, const uint_t collector ) const;
void writePPointData( std::ofstream& ofs ) const;
void writePCellData( std::ofstream& ofs ) const;
......
......@@ -42,6 +42,9 @@
#cmakedefine WALBERLA_CXX_COMPILER_IS_MSVC
#cmakedefine WALBERLA_CXX_COMPILER_IS_CLANG
#cmakedefine WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM
#cmakedefine WALBERLA_USE_STD_FILESYSTEM
// SIMD
#cmakedefine WALBERLA_SIMD_FORCE_SCALAR
......
......@@ -27,7 +27,7 @@
#include "core/mpi/MPIManager.h"
#include "core/mpi/MPITextFile.h"
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
#include <vector>
#include <sstream>
......@@ -61,8 +61,8 @@ void testSameSizeFile( const std::string & filename, const size_t chunkSize )
WALBERLA_MPI_BARRIER();
WALBERLA_ROOT_SECTION()
{
if( boost::filesystem::exists( filename ) )
boost::filesystem::remove( filename );
if( filesystem::exists( filename ) )
filesystem::remove( filename );
}
WALBERLA_MPI_BARRIER();
}
......@@ -98,8 +98,8 @@ void testDifferentSizeFile( const std::string & filename, const size_t minChunkS
WALBERLA_MPI_BARRIER();
WALBERLA_ROOT_SECTION()
{
if( boost::filesystem::exists( filename ) )
boost::filesystem::remove( filename );
if( filesystem::exists( filename ) )
filesystem::remove( filename );
}
WALBERLA_MPI_BARRIER();
}
......
......@@ -52,7 +52,7 @@
#include "core/logging/Logging.h"
#include "core/mpi/MPIManager.h"
#include <boost/filesystem.hpp>
#include "core/Filesystem.h"
#include <boost/foreach.hpp>
#include <random>
......@@ -209,14 +209,12 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z
using namespace walberla;
using geometry::VoxelFileReader;
namespace fs = boost::filesystem;
WALBERLA_LOG_INFO( "Running Test with size " << xSize << "x" << ySize << "x" << zSize << " T = " << typeid(T).name() );
fs::path path(filename);
filesystem::path path(filename);
if( fs::exists( path ) )
fs::remove( path );
if( filesystem::exists( path ) )
filesystem::remove( path );
CellInterval aabb(0, 0, 0, cell_idx_c(xSize - 1), cell_idx_c(ySize - 1), cell_idx_c(zSize - 1));
uint_t numCells = aabb.numCells();
......@@ -249,8 +247,8 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z
data.clear();
WALBERLA_CHECK( fs::exists( path ) );
WALBERLA_CHECK( fs::is_regular_file( path ) );
WALBERLA_CHECK( filesystem::exists( path ) );
WALBERLA_CHECK( filesystem::is_regular_file( path ) );
geometryFile.open(filename);
WALBERLA_CHECK( geometryFile.isOpen() );
......@@ -396,8 +394,8 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z
geometryFile.close();
WALBERLA_CHECK( !geometryFile.isOpen() );
if( fs::exists( path ) )
fs::remove( path );
if( filesystem::exists( path ) )
filesystem::remove( path );
geometryFile.create(filename, xSize, ySize, zSize);
......@@ -465,8 +463,8 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z
}
WALBERLA_CHECK( runtimeErrorThrown );
geometryFile.close();
if( fs::exists( fs::path(filename + "0") ) )
fs::remove( fs::path(filename + "0") );
if( filesystem::exists( filesystem::path(filename + "0") ) )
filesystem::remove( filesystem::path(filename + "0") );
if(xSize > 0)
{
......@@ -487,12 +485,12 @@ void runTests(const std::string & filename, size_t xSize, size_t ySize, size_t z
}
WALBERLA_CHECK( runtimeErrorThrown );
geometryFile.close();
if( fs::exists( fs::path(filename + "1") ) )
fs::remove( fs::path(filename + "1") );
if( filesystem::exists( filesystem::path(filename + "1") ) )
filesystem::remove( filesystem::path(filename + "1") );
}
if( fs::exists( path ) )
fs::remove( path );
if( filesystem::exists( path ) )
filesystem::remove( path );
}
......
......@@ -703,9 +703,9 @@ int main( int argc, char **argv )
if( fileIO )
{
// create base directory if it does not yet exist
boost::filesystem::path tpath( baseFolder );
if( !boost::filesystem::exists( tpath ) )
boost::filesystem::create_directory( tpath );
filesystem::path tpath( baseFolder );
if( !filesystem::exists( tpath ) )
filesystem::create_directory( tpath );
}
///////////////////////////////
......
......@@ -595,9 +595,9 @@ int main( int argc, char **argv )
if( fileIO )
{
// create base directory if it does not yet exist
boost::filesystem::path tpath( baseFolder );
if( !boost::filesystem::exists( tpath ) )
boost::filesystem::create_directory( tpath );
filesystem::path tpath( baseFolder );
if( !filesystem::exists( tpath ) )
filesystem::create_directory( tpath );
}
///////////////////////////////
...