Commit a9505c0f authored by Nils Kohl's avatar 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
......@@ -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} )
......
......@@ -24,7 +24,7 @@
namespace hyteg {
std::string buildFlavour()
std::string buildType()
{
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() );
}
}
......@@ -55,7 +55,7 @@ class P2P1ElementwiseBlendingStokesOperator
void computeAndStoreLocalElementMatrices()
{
auto scalarA = dynamic_cast< P2ElementwiseLaplaceOperator& >( *lapl.getSubOperator( 0, 0 ) );
auto scalarA = dynamic_cast< P2ElementwiseBlendingLaplaceOperator& >( *lapl.getSubOperator( 0, 0 ) );
scalarA.computeAndStoreLocalElementMatrices();
div.getSubOperator< 0 >().computeAndStoreLocalElementMatrices();
......
......@@ -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)
/*
* 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;
}
......@@ -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-08 );
WALBERLA_CHECK_LESS( currRes, 1.0e-06 );
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;
}
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