...
 
Commits (10)
......@@ -2,6 +2,11 @@
## [Unreleased]
## [4.2] - 2019-09-27
- Fix compiling Walberla on certain compilers
- Fix compilation failure in ParserUBB and ExtendedBoundaryHandlingFactory
- add missing std::hash specializations for Cell, Vector2, Vector3
## [4.1] - 2019-04-19
### Added
- Galerkin coarsening for Multigrid
......
......@@ -34,7 +34,7 @@ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${walberla_SOURCE_DIR}/cmake )
include ( waLBerlaFunctions )
set_version( 4 1 )
set_version( 4 2 )
include( CMakeParseArguments )
......@@ -645,7 +645,8 @@ else()
endif()
if ( WALBERLA_BUILD_WITH_PYTHON AND WALBERLA_CXX_COMPILER_IS_MSVC )
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS python36 )
get_filename_component(PYTHON_REQUIRED_LIB ${PYTHON_LIBRARY} NAME_WE)
list( APPEND waLBerla_REQUIRED_BOOST_COMPONENTS ${PYTHON_REQUIRED_LIB} )
endif()
# This variable is necessary, if the CMAKE version used is not aware of a more recent boost version (keep this up to date!)
......@@ -653,7 +654,7 @@ set ( Boost_ADDITIONAL_VERSIONS
"1.45" "1.45.0" "1.46" "1.46.0" "1.46.1" "1.47" "1.47.0" "1.48" "1.48.0" "1.49" "1.49.0"
"1.50" "1.50.0" "1.51" "1.51.0" "1.52" "1.52.0" "1.53" "1.53.0" "1.54" "1.54.0" "1.55" "1.55.0"
"1.56" "1.56.0" "1.57" "1.57.0" "1.58" "1.58.0" "1.59" "1.59.0" "1.60" "1.60.0" "1.61" "1.61.0" "1.62" "1.62.0" "1.63" "1.63.0"
"1.64.0" "1.65.0" "1.65.1" "1.66.0" "1.67.0" "1.68.0" "1.69.0" )
"1.64.0" "1.65.0" "1.65.1" "1.66.0" "1.67.0" "1.68.0" "1.69.0" "1.70.0" )
set ( Boost_USE_STATIC_LIBS OFF CACHE BOOL "Use boost static libraries" )
set ( Boost_USE_MULTITHREADED OFF CACHE BOOL "Use boost multithreaded libraries" )
......@@ -741,11 +742,10 @@ if ( WALBERLA_BUILD_WITH_PYTHON AND NOT WALBERLA_CXX_COMPILER_IS_MSVC)
endif()
if( PYTHON_LIBRARY MATCHES "python3" )
find_library( BOOST_PYTHON_LIBRARY NAMES
boost_python36${_boost_MULTITHREADED}
boost_python35${_boost_MULTITHREADED}
boost_python-py36${_boost_MULTITHREADED} boost_python-py35${_boost_MULTITHREADED}
boost_python37${_boost_MULTITHREADED} boost_python36${_boost_MULTITHREADED} boost_python35${_boost_MULTITHREADED}
boost_python-py37${_boost_MULTITHREADED} boost_python-py36${_boost_MULTITHREADED} boost_python-py35${_boost_MULTITHREADED}
boost_python-py34${_boost_MULTITHREADED} boost_python-py33${_boost_MULTITHREADED}
boost_python-py32${_boost_MULTITHREADED} boost_python3${_boost_MULTITHREADED}
boost_python3${_boost_MULTITHREADED}
boost_python${_boost_MULTITHREADED}
PATHS ${Boost_LIBRARY_DIRS} NO_DEFAULT_PATH )
else()
......@@ -842,14 +842,6 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER )
add_flag ( CMAKE_MODULE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" )
add_flag ( CMAKE_EXE_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" )
add_flag ( CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}" )
# When using Intel MPI, mpi.h has to be included before including the standard library
# therefore we use the -include flag to enforce this.
if ( MPI_C_INCLUDE_PATH MATCHES "intel" )
message (STATUS "Activating IntelMPI include workaround for mpi.h" )
add_flag ( CMAKE_CXX_FLAGS "-include mpi.h" )
add_flag ( CMAKE_C_FLAGS "-include mpi.h" )
endif ( )
endif ( )
endif ( )
......
......@@ -113,12 +113,12 @@ class PintUnitConverter:
elif type(value) is tuple:
try:
result[key] = tuple( [ self.ureg.Quantity(e) for e in value ] )
except (pint.unit.UndefinedUnitError, ValueError, TypeError):
except (pint.UndefinedUnitError, ValueError, TypeError):
result[key] = value
else:
try:
result[key] = self.ureg.Quantity( value )
except (pint.unit.UndefinedUnitError, ValueError, TypeError):
except (pint.UndefinedUnitError, ValueError, TypeError):
result[key] = value
return result
......
......@@ -25,6 +25,7 @@
#if defined(WALBERLA_USE_STD_ANY)
#include <any>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_ANY)
#undef _LIBCPP_WARN_ON_DEPRECATED_EXPERIMENTAL_HEADER
#include <experimental/any>
#else
#include <boost/any.hpp>
......
......@@ -30,9 +30,16 @@
#include <cmath>
#include <limits>
#if (defined( __has_include ) && __has_include(<cxxabi.h>)) || defined( __GLIBCXX__ )
#ifdef __GLIBCXX__
#define HAVE_CXXABI_H
#include <cxxabi.h>
#else
#ifdef __has_include
#if __has_include(<cxxabi.h>)
#define HAVE_CXXABI_H
#include <cxxabi.h>
#endif
#endif
#endif
......
......@@ -25,6 +25,7 @@
#if defined(WALBERLA_USE_STD_FILESYSTEM)
#include <filesystem>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_FILESYSTEM)
#define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM
#include <experimental/filesystem>
#else
#include <boost/filesystem.hpp>
......
......@@ -25,6 +25,7 @@
#if defined(WALBERLA_USE_STD_OPTIONAL)
#include <optional>
#elif defined(WALBERLA_USE_STD_EXPERIMENTAL_OPTIONAL)
#undef _LIBCPP_WARN_ON_DEPRECATED_EXPERIMENTAL_HEADER
#include <experimental/optional>
#else
#include <boost/optional.hpp>
......
......@@ -381,3 +381,15 @@ namespace mpi
} // namespace walberla
namespace std
{
template<>
struct hash< walberla::Cell >
{
std::size_t operator()( walberla::Cell const & cell ) const noexcept
{
return walberla::cell::hash_value( cell );
}
};
} // namespace std
......@@ -1681,3 +1681,15 @@ namespace walberla {
};
} // namespace walberla
namespace std
{
template<typename T>
struct hash< walberla::Vector2<T> >
{
std::size_t operator()( walberla::Vector2<T> const & v ) const noexcept
{
return walberla::Vector2<T>::hash_value( v );
}
};
} // namespace std
......@@ -1961,3 +1961,15 @@ inline bool check_float_equal_eps( const math::Vector3<real_t> & lhs, const math
}
}
}
namespace std
{
template<typename T>
struct hash< walberla::Vector3<T> >
{
std::size_t operator()( walberla::Vector3<T> const & v ) const noexcept
{
return walberla::Vector3<T>::hash_value( v );
}
};
} // namespace std
......@@ -63,7 +63,7 @@ public:
{
public:
inline Parser( const Config::BlockHandle & config );
inline Parser( std::array< std::string, 3 > & equations );
inline Parser( const std::array< std::string, 3 > & equations );
Vector3< real_t > operator()( const Vector3< real_t > & x, const real_t t ) const;
Vector3< real_t > operator()( const Vector3< real_t > & x ) const;
bool isTimeDependent() const { return timeDependent_; }
......@@ -207,7 +207,7 @@ inline ParserUBB<LatticeModel_T, flag_t, AdaptVelocityToExternalForce, StoreForc
}
template< typename LatticeModel_T, typename flag_t, bool AdaptVelocityToExternalForce, bool StoreForce>
inline ParserUBB<LatticeModel_T, flag_t, AdaptVelocityToExternalForce, StoreForce>::Parser::Parser( std::array< std::string, 3 > & equations )
inline ParserUBB<LatticeModel_T, flag_t, AdaptVelocityToExternalForce, StoreForce>::Parser::Parser( const std::array< std::string, 3 > & equations )
: parsers_(), equations_( equations ), timeDependent_( false )
{
if( equations_[0].length() > 0 )
......@@ -370,7 +370,7 @@ inline void ParserUBB< LatticeModel_T, flag_t, AdaptVelocityToExternalForce, Sto
if( p.isTimeDependent() )
{
parserField_->get( x, y, z ) = make_shared<Parser>(p);
parserField_->get( x, y, z ) = make_shared<Parser>( p.equations() );
}
else
{
......@@ -404,7 +404,7 @@ inline void ParserUBB< LatticeModel_T, flag_t, AdaptVelocityToExternalForce, Sto
if( p.isTimeDependent() )
{
auto shared_p = make_shared<Parser>(p);
auto shared_p = make_shared<Parser>( p.equations() );
for( auto cell = parserField_->beginSliceXYZ( cells ); cell != parserField_->end(); ++cell )
*cell = shared_p;
}
......