Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Arash Partow
waLBerla
Commits
47c60d32
Commit
47c60d32
authored
Jan 08, 2021
by
Markus Holzer
Browse files
Merge master into branch
parents
033ef4fb
09281516
Changes
38
Hide whitespace changes
Inline
Side-by-side
AUTHORS.txt
View file @
47c60d32
...
...
@@ -14,7 +14,9 @@ Ehsan Fattahi
Felix Winterhalter
Florian Schornbaum
Frederik Hennig
Grigorii Drozdov
Helen Schottenhamml
Igor Ostanin
Jan Götz
Jan Hönig
João Victor Tozatti Risso
...
...
CMakeLists.txt
View file @
47c60d32
...
...
@@ -225,16 +225,21 @@ else()
endif
()
mark_as_advanced
(
WALBERLA_CXX_COMPILER_IS_CLANG
)
# Check for Cray compiler
if
(
CMAKE_CXX_COMPILER_ID MATCHES Cray
)
option
(
WALBERLA_CXX_COMPILER_IS_CRAY
"Use Cray compiler"
ON
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.4
)
message
(
FATAL_ERROR
"Insufficient Cray Compiler Environment version"
)
endif
()
else
()
option
(
WALBERLA_CXX_COMPILER_IS_CRAY
"Use Cray compiler"
OFF
)
endif
()
mark_as_advanced
(
WALBERLA_CXX_COMPILER_IS_CRAY
)
if
(
CMAKE_CXX_COMPILER MATCHES
"pgc
\\
+
\\
+"
OR CMAKE_CXX_COMPILER_ARG1 MATCHES
"pgc
\\
+
\\
+"
)
option
(
WALBERLA_CXX_COMPILER_IS_PGI
"Use PGI compiler"
ON
)
else
()
option
(
WALBERLA_CXX_COMPILER_IS_PGI
"Use PGI compiler"
OFF
)
endif
()
mark_as_advanced
(
WALBERLA_CXX_COMPILER_IS_PGI
)
# Check for MPI wrapper
get_filename_component
(
CXX_COMPILER_WITHOUT_PATH
${
CMAKE_CXX_COMPILER
}
NAME
)
if
(
CXX_COMPILER_WITHOUT_PATH MATCHES
"mpi"
OR CMAKE_CXX_COMPILER_ARG1 MATCHES
"mpi"
)
...
...
@@ -333,6 +338,21 @@ if( WALBERLA_CXX_COMPILER_IS_CRAY )
add_flag
(
CMAKE_CXX_FLAGS
"-DSQLITE_HAVE_ISNAN"
)
# SQLite will not work correctly with the -ffast-math option of GCC.
endif
()
# Silences compiler and linker warnings and information with the PGI compiler
if
(
WALBERLA_CXX_COMPILER_IS_PGI
)
add_flag
(
CMAKE_CXX_FLAGS
"--display_error_number"
)
add_flag
(
CMAKE_C_FLAGS
"--display_error_number"
)
if
(
CMAKE_VERSION VERSION_LESS
"3.19"
)
# https://github.com/Kitware/CMake/commit/52eee1938919deb59cc2b51d44f365f0d9a418e5
set
(
CMAKE_CXX
${
CMAKE_CXX_STANDARD
}
_STANDARD_COMPILE_OPTION
"--c++
${
CMAKE_CXX_STANDARD
}
"
)
endif
()
add_flag
(
CMAKE_CXX_FLAGS
"--diag_suppress=1"
)
# last line of file ends without a newline
add_flag
(
CMAKE_CXX_FLAGS
"--diag_suppress=111"
)
# statement is unreachable
add_flag
(
CMAKE_C_FLAGS
"--diag_suppress=111"
)
# statement is unreachable
add_flag
(
CMAKE_C_FLAGS
"--diag_suppress=550"
)
# variable [...] was set but never used
add_flag
(
CMAKE_C_FLAGS
"--diag_suppress=191"
)
# type qualifier is meaningless on cast type
endif
()
# architecture optimization
if
(
WALBERLA_OPTIMIZE_FOR_LOCALHOST
)
if
(
WALBERLA_CXX_COMPILER_IS_GNU OR WALBERLA_CXX_COMPILER_IS_INTEL OR WALBERLA_CXX_COMPILER_IS_CLANG
)
...
...
@@ -690,8 +710,14 @@ endif( Boost_FOUND )
##
############################################################################################################################
if
(
NOT WIN32
)
add_flag
(
CMAKE_CXX_FLAGS
"-pthread"
)
set
(
THREADS_PREFER_PTHREAD_FLAG TRUE
)
find_package
(
Threads
)
if
(
Threads_FOUND
)
if
(
CMAKE_USE_PTHREADS_INIT
)
add_flag
(
CMAKE_CXX_FLAGS
"-pthread"
)
else
()
add_flag
(
CMAKE_CXX_FLAGS
"
${
CMAKE_THREAD_LIBS_INIT
}
"
)
endif
()
endif
()
...
...
@@ -975,10 +1001,7 @@ endif()
option
(
WALBERLA_THREAD_SAFE_LOGGING
"Enables/Disables thread-safe logging"
ON
)
if
(
WALBERLA_BUILD_WITH_OPENMP
)
if
(
WALBERLA_CXX_COMPILER_IS_INTEL AND
"
${
CMAKE_CXX_COMPILER_VERSION
}
"
VERSION_LESS
"16.0.3"
)
add_flag
(
CMAKE_C_FLAGS
"-openmp"
)
add_flag
(
CMAKE_CXX_FLAGS
"-openmp"
)
elseif
(
WALBERLA_CXX_COMPILER_IS_NEC
)
if
(
WALBERLA_CXX_COMPILER_IS_NEC
)
add_flag
(
CMAKE_C_FLAGS
"-Popenmp"
)
add_flag
(
CMAKE_CXX_FLAGS
"-Popenmp"
)
else
()
...
...
@@ -1089,31 +1112,7 @@ endif()
##
############################################################################################################################
if
(
WALBERLA_BUILD_WITH_LTO
)
if
(
WALBERLA_CXX_COMPILER_IS_INTEL
)
add_flag
(
CMAKE_CXX_FLAGS_RELEASE
"-ip -ipo3"
)
add_flag
(
CMAKE_C_FLAGS_RELEASE
"-ip -ipo3"
)
endif
()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
add_flag
(
CMAKE_C_FLAGS_RELEASE
"-flto=3"
)
add_flag
(
CMAKE_CXX_FLAGS_RELEASE
"-flto=3"
)
add_flag
(
CMAKE_EXE_LINKER_FLAGS
"-fuse-linker-plugin"
)
endif
(
)
if
(
WALBERLA_CXX_COMPILER_IS_MSVC
)
add_flag
(
CMAKE_CXX_FLAGS_RELEASE
"/GL"
)
add_flag
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"/LTCG"
)
add_flag
(
CMAKE_SHARED_LINKER_FLAGS_RELEASE
"/LTCG"
)
add_flag
(
CMAKE_MODULE_LINKER_FLAGS_RELEASE
"/LTCG"
)
endif
(
)
if
(
WALBERLA_CXX_COMPILER_IS_IBM
)
add_flag
(
CMAKE_C_FLAGS_RELEASE
"-qipa"
)
add_flag
(
CMAKE_CXX_FLAGS_RELEASE
"-qipa"
)
add_flag
(
CMAKE_EXE_LINKER_FLAGS
"-qipa"
)
endif
(
)
set
(
CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE
)
endif
(
)
############################################################################################################################
...
...
README.md
View file @
47c60d32
# waLBerla
waLBerla (widely applicable Lattice Boltzmann from Erlangen) is a massively
parallel framework for multi physics applications. Besides its original
objective, Lattice Boltzmann solvers for hydrodynamics, it now contains
modules for other applications like Multigrid and rigid body dynamics
as well. Great emphasis is placed on the interoperability between the modules
in particular the fluid-particle coupling.
It scales from laptops to current and future supercomputers while maintaining
waLBerla (widely applicable Lattice Boltzmann from Erlangen) is a massively
parallel framework for multi physics applications. Besides its original
objective, Lattice Boltzmann solvers for hydrodynamics, it now contains
modules for other applications like Multigrid and rigid body dynamics
as well. Great emphasis is placed on the interoperability between the modules
in particular the fluid-particle coupling.
It scales from laptops to current and future supercomputers while maintaining
near-perfect efficiency.
See https://www.walberla.net/ for more information and a showcase of applications.
...
...
@@ -47,15 +47,30 @@ Many thanks go to waLBerla's [contributors](AUTHORS.txt)
If you use waLBerla in a publication, please cite the following articles:
-
C. Godenschwager, F. Schornbaum, M. Bauer, H. Köstler, and U. Rüde. A
framework for hybrid parallel flow simulations with a trillion cells in complex
geometries. In: Proceedings of the International Conference on High Performance
Computing, Networking, Storage and Analysis, page 35. ACM, 2013.
-
M. Bauer, S. Eibl, C. Godenschwager, N. Kohl, M. Kuron, C. Rettinger,
F. Schornbaum, C. Schwarzmeier, D. Thönnes, H. Köstler, and U. Rüde. waLBerla:
A block-structured high-performance framework for multiphysics simulations. In:
Computers & Mathematics with Applications, doi:10.1016/j.camwa.2020.01.007.
Elsevier, 2020.
Overview:
-
M. Bauer et al,
*
waLBerla: A block-structured high-performance framework for
multiphysics simulations
*
. Computers & Mathematics with Applications, 2020.
https://doi.org/10.1016/j.camwa.2020.01.007.
Grid Refinement:
-
F. Schornbaum and U. Rüde,
*
Massively parallel algorithms for the lattice boltzmann
method on nonuniform grids
*
. SIAM Journal on Scientific Computing, 2016.
https://doi.org/10.1137/15M1035240
LBM - Particle Coupling:
-
C. Rettinger and U. Rüde,
*
A comparative study of fluid-particle coupling methods for
fully resolved lattice Boltzmann simulations
*
. Computers & Fluids, 2017.
https://doi.org/10.1016/j.compfluid.2017.05.033
MESA-PD:
-
S. Eibl and U. Rüde,
*A Modular and Extensible Software Architecture for Particle Dynamics*
.
Proceedings Of The 8Th International Conference On Discrete Element Methods.
https://mercurylab.co.uk/dem8/full-papers/#page-content
Carbon Nanotubes:
-
G. Drozdov et al,
*
Densification of single-walled carbon nanotube films:
Mesoscopic distinct element method simulations and experimental validation
*
.
Journal of Applied Physics, 2020. https://doi.org/10.1063/5.0025505
## License
...
...
apps/benchmarks/CMakeLists.txt
View file @
47c60d32
add_subdirectory
(
AdaptiveMeshRefinementFluidParticleCoupling
)
add_subdirectory
(
ComplexGeometry
)
add_subdirectory
(
DEM
)
add_subdirectory
(
FieldCommunication
)
add_subdirectory
(
MeshDistance
)
add_subdirectory
(
CouetteFlow
)
add_subdirectory
(
FluidParticleCoupling
)
...
...
@@ -15,10 +14,20 @@ add_subdirectory( PoiseuilleChannel )
add_subdirectory
(
ProbeVsExtraMessage
)
add_subdirectory
(
SchaeferTurek
)
add_subdirectory
(
UniformGrid
)
if
(
WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_PYTHON
)
add_subdirectory
(
UniformGridGenerated
)
add_subdirectory
(
PhaseFieldAllenCahn
)
endif
()
if
(
WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_CUDA
)
add_subdirectory
(
UniformGridGPU
)
if
(
WALBERLA_BUILD_WITH_PYTHON
)
add_subdirectory
(
FieldCommunication
)
if
(
WALBERLA_BUILD_WITH_CODEGEN
)
add_subdirectory
(
UniformGridGenerated
)
add_subdirectory
(
PhaseFieldAllenCahn
)
endif
()
if
(
WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_CUDA
)
add_subdirectory
(
UniformGridGPU
)
endif
()
endif
()
apps/benchmarks/UniformGridGPU/CMakeLists.txt
View file @
47c60d32
waLBerla_link_files_to_builddir
(
"*.prm"
)
waLBerla_link_files_to_builddir
(
"*.py"
)
waLBerla_link_files_to_builddir
(
"simulation_setup"
)
...
...
apps/showcases/CMakeLists.txt
View file @
47c60d32
...
...
@@ -3,6 +3,6 @@ add_subdirectory( CombinedResolvedUnresolved )
add_subdirectory
(
HeatConduction
)
add_subdirectory
(
Mixer
)
add_subdirectory
(
PegIntoSphereBed
)
if
(
WALBERLA_BUILD_WITH_CODEGEN
)
if
(
WALBERLA_BUILD_WITH_CODEGEN
AND WALBERLA_BUILD_WITH_PYTHON
)
add_subdirectory
(
PhaseFieldAllenCahn
)
endif
()
apps/showcases/PhaseFieldAllenCahn/CPU/contact.cpp
View file @
47c60d32
...
...
@@ -36,7 +36,7 @@ namespace lbm
namespace
internal_boundary_contact
{
static
FUNC_PREFIX
void
contact_angle_treatment
(
uint8_t
*
RESTRICT
const
_data_indexVector
,
double
*
RESTRICT
_data_phase
,
static
FUNC_PREFIX
void
contact_angle_treatment
(
uint8_t
*
WALBERLA_
RESTRICT
const
_data_indexVector
,
double
*
WALBERLA_
RESTRICT
_data_phase
,
int64_t
const
_stride_phase_0
,
int64_t
const
_stride_phase_1
,
int64_t
const
_stride_phase_2
,
int64_t
indexVectorSize
,
double
alpha
)
{
...
...
@@ -58,8 +58,8 @@ static FUNC_PREFIX void contact_angle_treatment(uint8_t* RESTRICT const _data_in
const
double
a
=
cos
(
alpha
);
const
double
W
=
5
;
double
*
RESTRICT
_phase_wall
=
_data_phase
+
_stride_phase_1
*
y
+
_stride_phase_2
*
z
;
double
*
RESTRICT
_phase_interior
=
_data_phase
+
_stride_phase_1
*
y1
+
_stride_phase_2
*
z1
;
double
*
WALBERLA_
RESTRICT
_phase_wall
=
_data_phase
+
_stride_phase_1
*
y
+
_stride_phase_2
*
z
;
double
*
WALBERLA_
RESTRICT
_phase_interior
=
_data_phase
+
_stride_phase_1
*
y1
+
_stride_phase_2
*
z1
;
if
(
h
<
0.001
)
{
_phase_wall
[
_stride_phase_0
*
x
]
=
1.0
;
}
else
if
(
a
>
1e-8
||
a
<
-
1e-8
)
{
...
...
@@ -98,7 +98,7 @@ void contact::run(IBlock* block, IndexVectors::Type type)
auto
&
alpha
=
this
->
alpha_
;
WALBERLA_ASSERT_GREATER_EQUAL
(
0
,
-
int_c
(
phaseField
->
nrOfGhostLayers
()))
double
*
RESTRICT
_data_phase
=
phaseField
->
dataAt
(
0
,
0
,
0
,
0
);
double
*
WALBERLA_
RESTRICT
_data_phase
=
phaseField
->
dataAt
(
0
,
0
,
0
,
0
);
const
auto
_stride_pdfs_0
=
int64_t
(
phaseField
->
xStride
());
const
auto
_stride_pdfs_1
=
int64_t
(
phaseField
->
yStride
());
const
auto
_stride_pdfs_2
=
int64_t
(
phaseField
->
zStride
());
...
...
apps/showcases/PhaseFieldAllenCahn/CPU/contact.h
View file @
47c60d32
...
...
@@ -31,14 +31,6 @@
#include <set>
#include <vector>
#ifdef __GNUC__
# define RESTRICT __restrict__
#elif _MSC_VER
# define RESTRICT __restrict
#else
# define RESTRICT
#endif
namespace
walberla
{
namespace
lbm
...
...
apps/showcases/PhaseFieldAllenCahn/GPU/contact.cu
View file @
47c60d32
...
...
@@ -41,25 +41,25 @@ namespace lbm
namespace
internal_boundary_contact
{
static
FUNC_PREFIX
void
contact_angle_treatment
(
uint8_t
*
RESTRICT
const
_data_indexVector
,
double
*
RESTRICT
_data_phase
,
static
FUNC_PREFIX
void
contact_angle_treatment
(
uint8_t
*
WALBERLA_
RESTRICT
const
_data_indexVector
,
double
*
WALBERLA_
RESTRICT
_data_phase
,
int64_t
const
_stride_phase_0
,
int64_t
const
_stride_phase_1
,
int64_t
const
_stride_phase_2
,
int64_t
indexVectorSize
,
double
alpha
)
{
if
(
blockDim
.
x
*
blockIdx
.
x
+
threadIdx
.
x
<
indexVectorSize
)
{
uint8_t
*
RESTRICT
_data_indexVector_10
=
_data_indexVector
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_10
=
_data_indexVector
;
const
int32_t
x
=
*
((
int32_t
*
)
(
&
_data_indexVector_10
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
uint8_t
*
RESTRICT
_data_indexVector_14
=
_data_indexVector
+
4
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_14
=
_data_indexVector
+
4
;
const
int32_t
y
=
*
((
int32_t
*
)
(
&
_data_indexVector_14
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
uint8_t
*
RESTRICT
_data_indexVector_18
=
_data_indexVector
+
8
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_18
=
_data_indexVector
+
8
;
const
int32_t
z
=
*
((
int32_t
*
)
(
&
_data_indexVector_18
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
uint8_t
*
RESTRICT
_data_indexVector_112
=
_data_indexVector
+
12
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_112
=
_data_indexVector
+
12
;
const
int32_t
nx
=
*
((
int32_t
*
)
(
&
_data_indexVector_112
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
const
int32_t
x1
=
x
+
nx
;
uint8_t
*
RESTRICT
_data_indexVector_116
=
_data_indexVector
+
16
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_116
=
_data_indexVector
+
16
;
const
int32_t
ny
=
*
((
int32_t
*
)
(
&
_data_indexVector_116
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
const
int32_t
y1
=
y
+
ny
;
uint8_t
*
RESTRICT
_data_indexVector_200
=
_data_indexVector
+
20
;
uint8_t
*
WALBERLA_
RESTRICT
_data_indexVector_200
=
_data_indexVector
+
20
;
const
int32_t
nz
=
*
((
int32_t
*
)
(
&
_data_indexVector_200
[
24
*
blockDim
.
x
*
blockIdx
.
x
+
24
*
threadIdx
.
x
]));
const
int32_t
z1
=
z
+
nz
;
...
...
@@ -67,8 +67,8 @@ static FUNC_PREFIX void contact_angle_treatment(uint8_t* RESTRICT const _data_in
const
double
a
=
cos
(
alpha
);
const
double
W
=
5
;
double
*
RESTRICT
_phase_wall
=
_data_phase
+
_stride_phase_1
*
y
+
_stride_phase_2
*
z
;
double
*
RESTRICT
_phase_interior
=
_data_phase
+
_stride_phase_1
*
y1
+
_stride_phase_2
*
z1
;
double
*
WALBERLA_
RESTRICT
_phase_wall
=
_data_phase
+
_stride_phase_1
*
y
+
_stride_phase_2
*
z
;
double
*
WALBERLA_
RESTRICT
_phase_interior
=
_data_phase
+
_stride_phase_1
*
y1
+
_stride_phase_2
*
z1
;
if
(
h
<
0.001
)
{
_phase_wall
[
_stride_phase_0
*
x
]
=
1.0
;
}
else
if
(
a
>
1e-8
||
a
<
-
1e-8
)
{
...
...
@@ -107,7 +107,7 @@ void contact::run(IBlock* block, IndexVectors::Type type, cudaStream_t stream)
auto
&
alpha
=
this
->
alpha_
;
WALBERLA_ASSERT_GREATER_EQUAL
(
0
,
-
int_c
(
phaseField
->
nrOfGhostLayers
()))
double
*
RESTRICT
_data_phase
=
phaseField
->
dataAt
(
0
,
0
,
0
,
0
);
double
*
WALBERLA_
RESTRICT
_data_phase
=
phaseField
->
dataAt
(
0
,
0
,
0
,
0
);
const
auto
_stride_pdfs_0
=
int64_t
(
phaseField
->
xStride
());
const
auto
_stride_pdfs_1
=
int64_t
(
phaseField
->
yStride
());
const
auto
_stride_pdfs_2
=
int64_t
(
phaseField
->
zStride
());
...
...
apps/showcases/PhaseFieldAllenCahn/GPU/contact.h
View file @
47c60d32
...
...
@@ -32,14 +32,6 @@
#include <set>
#include <vector>
#ifdef __GNUC__
# define RESTRICT __restrict__
#elif _MSC_VER
# define RESTRICT __restrict
#else
# define RESTRICT
#endif
namespace
walberla
{
namespace
lbm
...
...
src/blockforest/BlockForest.cpp
View file @
47c60d32
...
...
@@ -1661,7 +1661,7 @@ bool BlockForest::determineBlockTargetLevels( bool & additionalRefreshCycleRequi
minTargetLevels
[
id
]
=
minTargetLevel
;
}
}
#ifndef NDEBU
F
#ifndef NDEBU
G
else
{
WALBERLA_ASSERT_LESS_EQUAL
(
minTargetLevel
,
level
+
uint_t
(
1
)
);
...
...
src/blockforest/BlockID.cpp
View file @
47c60d32
...
...
@@ -135,11 +135,9 @@ void BlockID::toByteArray( std::vector< uint8_t >& array, const uint_t offset, c
#else
#ifdef WALBERLA_CXX_COMPILER_IS_MSVC
namespace
{
char
dummy
;
}
// disable MSVC warning LNK4221: This object file does not define any previously
// undefined public symbols, so it will not be used by any link operation that
// consumes this library
#endif
namespace
internal
{
char
dummy
;
// silence linker warning about object file with no symbols
}
#endif
...
...
src/boundary/BoundaryHandling.h
View file @
47c60d32
...
...
@@ -2230,7 +2230,7 @@ inline void BoundaryHandling< FlagField_T, Stencil, Boundaries... >::operator()(
WALBERLA_ASSERT
(
checkConsistency
(
localCells
)
);
#ifdef
_OPENMP
#if
def
ined(
_OPENMP
) && !(defined(_MSC_VER) && _MSC_VER < 1925)
const
int
zMin
=
int_c
(
localCells
.
zMin
()
);
const
int
zMax
=
int_c
(
localCells
.
zMax
()
);
#pragma omp parallel for schedule(static) if(threadSafeBCs_)
...
...
src/core/NonCreateable.h
View file @
47c60d32
...
...
@@ -35,34 +35,8 @@ namespace walberla{
class
NonCreateable
{
#ifndef _MSC_VER
// non-MSVC-Build
private:
NonCreateable
();
~
NonCreateable
();
NonCreateable
(
const
NonCreateable
&
);
NonCreateable
&
operator
=
(
const
NonCreateable
&
);
#else
// MSVC-Build (eliminating warning C4624)
private:
NonCreateable
();
NonCreateable
(
const
NonCreateable
&
);
NonCreateable
&
operator
=
(
const
NonCreateable
&
);
protected:
~
NonCreateable
();
#endif
public:
NonCreateable
()
=
delete
;
};
...
...
src/core/Sanitizer.h
View file @
47c60d32
...
...
@@ -21,16 +21,15 @@
#pragma once
#if (( defined WALBERLA_CXX_COMPILER_IS_CLANG ) && ( __clang_major__ >=4 ) ) \
|| (( defined WALBERLA_CXX_COMPILER_IS_GNU ) && ( __GNUC__ >= 5 ) )
#if defined(WALBERLA_CXX_COMPILER_IS_CLANG) || defined(WALBERLA_CXX_COMPILER_IS_GNU)
# define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#else
# define ATTRIBUTE_NO_SANITIZE_ADDRESS
#endif
#if
( (
defined
WALBERLA_CXX_COMPILER_IS_GNU
) && ( __GNUC__ >= 5 )
)
#if defined
(
WALBERLA_CXX_COMPILER_IS_GNU)
# define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined))
#elif
((
defined
WALBERLA_CXX_COMPILER_IS_CLANG
) && ( __clang_major__ >= 4 )
)
#elif defined
(
WALBERLA_CXX_COMPILER_IS_CLANG)
# define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
#else
# define ATTRIBUTE_NO_SANITIZE_UNDEFINED
...
...
src/core/Sleep.cpp
View file @
47c60d32
...
...
@@ -22,36 +22,13 @@
#include "Sleep.h"
#include "waLBerlaDefinitions.h"
#ifdef WALBERLA_CXX_COMPILER_IS_MSVC
#include <windows.h>
#include <thread>
namespace
walberla
{
void
sleep
(
uint_t
seconds
)
{
::
Sleep
(
static_cast
<
DWORD
>
(
uint_t
(
1000
)
*
seconds
)
);
}
void
sleep
(
uint_t
seconds
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
static_cast
<
int
>
(
seconds
)));
}
#else
#ifdef WALBERLA_CXX_COMPILER_IS_IBM
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE
#endif
#endif
#include <unistd.h>
namespace
walberla
{
void
sleep
(
uint_t
seconds
)
{
::
sleep
(
static_cast
<
unsigned
int
>
(
seconds
)
);
}
}
#endif
\ No newline at end of file
src/core/
Template
.h
→
src/core/
math/Angles
.h
View file @
47c60d32
...
...
@@ -13,53 +13,22 @@
// 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 Template.h
//! \ingroup core
//! \author Klaus Iglberger
//! \file
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#pragma once
#include "Constants.h"
//*************************************************************************************************
/*! \cond internal */
/*!\brief Compiler specific patch for nested template disambiguation.
* \ingroup util
*
* The WALBERLA_TEMPLATE is a patch for the Microsoft Visual C++ compiler that does not correctly
* parse definitions of nested templates of the following form:
\code
template< typename T >
class Alloc {
public:
...
template< typename Other >
class rebind {
public:
typedef Alloc<Other> other;
};
...
};
typedef Alloc<int> AI;
typedef AI::template rebind<double>::other Other; // Compilation error with Visual C++
\endcode
* In order to circumvent this compilation error, the WALBERLA_TEMPLATE macro should be used instead
* the \a template keyword:
\code
...
typedef AI::WALBERLA_TEMPLATE rebind<double>::other Other; // No compilation errors
\endcode
*/
#if defined(_MSC_VER)
# define WALBERLA_TEMPLATE
#else
# define WALBERLA_TEMPLATE template
#endif
/*! \endcond */
//*************************************************************************************************
namespace
walberla
{
namespace
math
{
///Converts a degrees angle to radians.
constexpr
real_t
degToRad
(
real_t
deg
)
{
return
deg
*
(
pi
/
real_t
(
180
));}
///Converts a radians angle to degrees.
constexpr
real_t
radToDeg
(
real_t
rad
)
{
return
rad
*
(
real_t
(
180
)
/
pi
);}
}
// namespace math
}
// namespace walberla
src/core/math/Constants.h
View file @
47c60d32
...
...
@@ -30,12 +30,6 @@
#include <cmath>
#include <core/DataTypes.h>
// Disable false warnings in GCC 5
#if (defined __GNUC__) && (__GNUC__ == 5) && (__GNUC_MINOR__ == 1)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-variable"
#endif
namespace
walberla
{
namespace
math
...
...
src/core/math/Parser.cpp
View file @
47c60d32
...
...
@@ -31,9 +31,7 @@
# pragma warning( disable : 4706 )
#elif ( defined WALBERLA_CXX_COMPILER_IS_GNU ) || ( defined WALBERLA_CXX_COMPILER_IS_CLANG )
# pragma GCC diagnostic push
# if !( ( __clang_major__ == 3 ) && ( __clang_minor__ <= 4 ) )
# pragma GCC diagnostic ignored "-Wpragmas"
# endif
# pragma GCC diagnostic ignored "-Wpragmas"
# pragma GCC diagnostic ignored "-Wsign-conversion"
# pragma GCC diagnostic ignored "-Wconversion"
# pragma GCC diagnostic ignored "-Wshorten-64-to-32"
...
...
src/core/math/Uint.cpp
View file @
47c60d32
...
...
@@ -49,11 +49,5 @@ template<> uint_t uintMSBPosition< uint64_t >( uint64_t value ) { // for the doc
return
(
i
!=
0
)
?
(
8
+
msbLookupTable
[
i
])
:
msbLookupTable
[
value
];
}
#ifndef WALBERLA_CXX_COMPILER_IS_MSVC
const
uint_t
int_ld
<
1
>::
exp
;
#endif
}
// namespace math
}
// namespace walberla
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment