Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hyteg
hyteg
Commits
a9505c0f
Commit
a9505c0f
authored
Apr 04, 2022
by
Nils Kohl
🌝
Browse files
Merge branch 'master' into kohl/dg-3D-rebased-01
parents
921463aa
47f72935
Pipeline
#38938
canceled with stages
in 76 minutes and 53 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
a9505c0f
...
...
@@ -197,6 +197,7 @@ endif()
string
(
TOUPPER
${
CMAKE_BUILD_TYPE
}
CMAKE_BUILD_TYPE_UPPER
)
set
(
HYTEG_BUILD_TYPE
${
CMAKE_BUILD_TYPE
}
)
set
(
HYTEG_COMPILER_INFO
"
${
CMAKE_CXX_COMPILER_ID
}
${
CMAKE_CXX_COMPILER_VERSION
}
"
)
set
(
HYTEG_COMPILER_FLAGS
"
${
CMAKE_CXX_FLAGS_
${
CMAKE_BUILD_TYPE_UPPER
}}
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"
\"
"
"
\\\"
"
HYTEG_COMPILER_FLAGS
${
HYTEG_COMPILER_FLAGS
}
)
...
...
src/hyteg/BuildInfo.in.hpp
View file @
a9505c0f
...
...
@@ -24,7 +24,7 @@
namespace
hyteg
{
std
::
string
build
Flavour
()
std
::
string
build
Type
()
{
return
"@HYTEG_BUILD_TYPE@"
;
}
...
...
@@ -34,11 +34,17 @@ std::string compilerFlags()
return
"@HYTEG_COMPILER_FLAGS@"
;
}
std
::
string
compilerInfo
()
{
return
"@HYTEG_COMPILER_INFO@"
;
}
void
printBuildInfo
()
{
WALBERLA_LOG_INFO_ON_ROOT
(
"Build info:"
)
WALBERLA_LOG_INFO_ON_ROOT
(
" - flavour: "
<<
buildFlavour
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler flags: "
<<
compilerFlags
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - build type ....... "
<<
buildType
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler ......... "
<<
compilerInfo
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler flags ... "
<<
compilerFlags
()
);
}
}
src/hyteg/elementwiseoperators/P2P1ElementwiseBlendingStokesOperator.hpp
View file @
a9505c0f
...
...
@@ -55,7 +55,7 @@ class P2P1ElementwiseBlendingStokesOperator
void
computeAndStoreLocalElementMatrices
()
{
auto
scalarA
=
dynamic_cast
<
P2ElementwiseLaplaceOperator
&
>
(
*
lapl
.
getSubOperator
(
0
,
0
)
);
auto
scalarA
=
dynamic_cast
<
P2Elementwise
Blending
LaplaceOperator
&
>
(
*
lapl
.
getSubOperator
(
0
,
0
)
);
scalarA
.
computeAndStoreLocalElementMatrices
();
div
.
getSubOperator
<
0
>
().
computeAndStoreLocalElementMatrices
();
...
...
tests/hyteg/CMakeLists.txt
View file @
a9505c0f
...
...
@@ -661,9 +661,9 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
waLBerla_execute_test
(
NAME AffineMap3DTest1 COMMAND $<TARGET_FILE:AffineMap3DTest>
)
endif
()
waLBerla_compile_test
(
FILES blending/P2P1StokesElementwiseAnnulusBlendingTest.cpp DEPENDS hyteg core
)
if
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
if
(
NOT WALBERLA_CXX_COMPILER_IS_INTEL
)
waLBerla_compile_test
(
FILES blending/P2P1StokesElementwiseAnnulusBlendingTest.cpp DEPENDS hyteg core
)
waLBerla_execute_test
(
NAME P2P1StokesElementwiseAnnulusBlendingTest COMMAND $<TARGET_FILE:P2P1StokesElementwiseAnnulusBlendingTest>
)
endif
()
endif
()
...
...
@@ -810,3 +810,6 @@ waLBerla_execute_test(NAME VectorToVectorOperatorCGTest)
waLBerla_compile_test
(
FILES smooth+solve/VectorToVectorOperatorChebyshevTest.cpp DEPENDS hyteg core
)
waLBerla_execute_test
(
NAME VectorToVectorOperatorChebyshevTest
)
## Structural
waLBerla_compile_test
(
FILES PrintInfoTest.cpp
)
waLBerla_execute_test
(
NAME PrintInfoTest
)
tests/hyteg/PrintInfoTest.cpp
0 → 100644
View file @
a9505c0f
/*
* Copyright (c) 2022 Marcus Mohr.
*
* This file is part of HyTeG
* (see https://i10git.cs.fau.de/hyteg/hyteg).
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Check that we get neither compile- nor run-time errors, when
// trying to print meta information on the build
#include
"core/Environment.h"
#include
"core/logging/Logging.h"
#include
"core/math/Constants.h"
#include
"core/timing/Timer.h"
#include
"hyteg/BuildInfo.hpp"
#include
"hyteg/Git.hpp"
using
namespace
hyteg
;
int
main
(
int
argc
,
char
*
argv
[]
)
{
walberla
::
Environment
walberlaEnv
(
argc
,
argv
);
walberla
::
logging
::
Logging
::
instance
()
->
setLogLevel
(
walberla
::
logging
::
Logging
::
PROGRESS
);
walberla
::
MPIManager
::
instance
()
->
useWorldComm
();
std
::
string
separator
{
"--------------------------------------------------"
};
printBuildInfo
();
WALBERLA_LOG_INFO_ON_ROOT
(
separator
);
WALBERLA_LOG_INFO_ON_ROOT
(
"buildType() returned ........ "
<<
buildType
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
"compilerInfo() returned ..... "
<<
compilerInfo
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
"compilerFlags() returned .... "
<<
compilerFlags
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
separator
);
printGitInfo
();
WALBERLA_LOG_INFO_ON_ROOT
(
separator
);
WALBERLA_LOG_INFO_ON_ROOT
(
"gitSHA1() returned .......... "
<<
gitSHA1
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
"gitBranch() returned ........ "
<<
gitBranch
()
);
return
0
;
}
tests/hyteg/blending/P2P1StokesElementwiseAnnulusBlendingTest.cpp
View file @
a9505c0f
...
...
@@ -58,7 +58,7 @@ std::function< real_t( const hyteg::Point3D& ) > radius = []( const hyteg::Point
std
::
function
<
real_t
(
const
hyteg
::
Point3D
&
)
>
angle
=
[](
const
hyteg
::
Point3D
&
x
)
{
return
std
::
atan2
(
x
[
1
],
x
[
0
]
);
};
/// \brief Benchmark taken from Master's thesis of Leonard Schlag.
void
runTest
()
void
runTest
(
bool
preCompute
)
{
WALBERLA_LOG_INFO_ON_ROOT
(
"P2-P1 Stokes elementwise blending operator on annulus with Uzawa GMG solver"
)
...
...
@@ -70,7 +70,7 @@ void runTest()
const
uint_t
innerJacSmooth
=
4
;
const
real_t
uzawaOmega
=
0.37
;
const
real_t
jacobiOmega
=
0.66
;
const
uint_t
numIterations
=
4
;
const
uint_t
numIterations
=
2
;
const
uint_t
nTan
=
12
;
const
uint_t
nRad
=
2
;
...
...
@@ -174,7 +174,12 @@ void runTest()
typedef
P2ElementwiseBlendingMassOperator
MassOperator
;
StokesOperator
L
(
storage
,
minLevel
,
maxLevel
);
MassOperator
M
(
storage
,
maxLevel
,
maxLevel
);
if
(
preCompute
)
{
WALBERLA_LOG_INFO_ON_ROOT
(
" Precomputing local element Matrices."
)
L
.
computeAndStoreLocalElementMatrices
();
}
MassOperator
M
(
storage
,
maxLevel
,
maxLevel
);
u
.
uvw
().
interpolate
(
{
uSolution
,
vSolution
},
maxLevel
,
DirichletBoundary
);
f_strong
.
uvw
().
interpolate
(
{
uRhs
,
vRhs
},
maxLevel
,
All
);
...
...
@@ -275,7 +280,7 @@ void runTest()
}
}
WALBERLA_CHECK_LESS
(
currRes
,
1.0e-0
8
);
WALBERLA_CHECK_LESS
(
currRes
,
1.0e-0
6
);
WALBERLA_CHECK_LESS
(
discr_l2_err_u
,
4.0e-04
);
WALBERLA_CHECK_LESS
(
discr_l2_err_v
,
4.0e-04
);
WALBERLA_CHECK_LESS
(
discr_l2_err_p
,
4.0e-02
);
...
...
@@ -285,10 +290,10 @@ void runTest()
fineGridSolver
->
solve
(
L
,
u
,
f
,
maxLevel
);
L
.
apply
(
u
,
Au
,
maxLevel
,
Inner
|
NeumannBoundary
);
r
.
assign
(
{
1.0
,
-
1.0
},
{
f
,
Au
},
maxLevel
,
Inner
|
NeumannBoundary
);
r
.
assign
(
{
1.0
,
-
1.0
},
{
f
,
Au
},
maxLevel
,
Inner
|
NeumannBoundary
);
currRes
=
std
::
sqrt
(
r
.
dotGlobal
(
r
,
maxLevel
,
All
)
)
/
real_c
(
npoints
);
err
.
assign
(
{
1.0
,
-
1.0
},
{
u
,
u_exact
},
maxLevel
);
err
.
assign
(
{
1.0
,
-
1.0
},
{
u
,
u_exact
},
maxLevel
);
discr_l2_err_u
=
std
::
sqrt
(
err
.
uvw
()[
0
].
dotGlobal
(
err
.
uvw
()[
0
],
maxLevel
,
Inner
|
NeumannBoundary
)
/
real_c
(
numberOfGlobalDoFs
<
P2FunctionTag
>
(
*
storage
,
maxLevel
)
)
);
discr_l2_err_v
=
std
::
sqrt
(
err
.
uvw
()[
1
].
dotGlobal
(
err
.
uvw
()[
1
],
maxLevel
,
Inner
|
NeumannBoundary
)
/
...
...
@@ -304,7 +309,7 @@ void runTest()
vtkOutput
.
write
(
maxLevel
,
numIterations
+
1
);
}
WALBERLA_CHECK_LESS
(
currRes
,
5.0e-
11
);
WALBERLA_CHECK_LESS
(
currRes
,
5.0e-
9
);
WALBERLA_CHECK_LESS
(
discr_l2_err_u
,
4.0e-04
);
WALBERLA_CHECK_LESS
(
discr_l2_err_v
,
4.0e-04
);
WALBERLA_CHECK_LESS
(
discr_l2_err_p
,
4.0e-02
);
...
...
@@ -315,7 +320,8 @@ int main( int argc, char* argv[] )
walberla
::
logging
::
Logging
::
instance
()
->
setLogLevel
(
walberla
::
logging
::
Logging
::
PROGRESS
);
walberla
::
MPIManager
::
instance
()
->
useWorldComm
();
runTest
();
runTest
(
false
);
runTest
(
true
);
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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