Commit c8581361 authored by Nils Kohl's avatar Nils Kohl 🌝
Browse files

Fixing some apps.

parent 513aead8
Pipeline #34482 failed with stages
in 13 minutes and 26 seconds
......@@ -32,6 +32,7 @@
#include "hyteg/dataexport/SQL.hpp"
#include "hyteg/dataexport/TimingOutput.hpp"
#include "hyteg/dataexport/VTKOutput.hpp"
#include "hyteg/elementwiseoperators/P2P1ElementwiseBlendingStokesOperator.hpp"
#include "hyteg/functions/FunctionProperties.hpp"
#include "hyteg/geometry/AnnulusMap.hpp"
#include "hyteg/geometry/IcosahedralShellMap.hpp"
......
......@@ -91,12 +91,11 @@ void solveProblem( std::shared_ptr< hyteg::PrimitiveStorage >& storage, uint_t l
uint_t localDoFs = numberOfLocalDoFs< enumTag >( *storage, level );
// assemble matrices
PETScSparseMatrix< opType, funcType > lapMat( localDoFs, globalDoFs );
PETScSparseMatrix< opType > lapMat( localDoFs, globalDoFs );
switch ( verbosity )
{
case 2:
{
case 2: {
lapMat.createMatrixFromOperator( lapOp, level, enumerator, All );
lapMat.applyDirichletBC( enumerator, level );
......@@ -116,17 +115,16 @@ void solveProblem( std::shared_ptr< hyteg::PrimitiveStorage >& storage, uint_t l
// << globalDoFCount );
// break;
}
[[fallthrough]];
case 1:
{
[[fallthrough]];
case 1: {
WALBERLA_LOG_INFO_ON_ROOT( "* no. of global DoFs (HyTeG) ............. " << globalDoFs );
WALBERLA_LOG_INFO_ON_ROOT( "* no. of local DoFs (HyTeG) .............. " << localDoFs );
uint_t globalDoFCount = numberOfGlobalInnerDoFs< enumTag >( *storage, level );
WALBERLA_LOG_INFO_ON_ROOT( "* no. of global inner DoFs (HyTeG) ....... " << globalDoFCount );
break;
}
default:
{}
default: {
}
}
WALBERLA_LOG_INFO_ON_ROOT( " Entering PETSc solve " );
......@@ -137,7 +135,7 @@ void solveProblem( std::shared_ptr< hyteg::PrimitiveStorage >& storage, uint_t l
// check size of error
funcType< real_t > error( "error", storage, level, level );
error.assign( {1.0, -1.0}, {u_exact, u}, level, All );
error.assign( { 1.0, -1.0 }, { u_exact, u }, level, All );
VTKOutput vtkOutput( "../output", fileName, storage );
// VTKOutput vtkOutput( "../output", "annulus", storage );
......
......@@ -133,7 +133,7 @@ int main( int argc, char* argv[] )
LIKWID_MARKER_START( "PETSc-setup" );
wcTimingTreeApp.start( "Petsc setup" );
hyteg::PETScSparseMatrix< hyteg::P2ConstantLaplaceOperator, hyteg::P2Function > matPetsc( localDoFs, globalDoFs );
hyteg::PETScSparseMatrix< hyteg::P2ConstantLaplaceOperator > matPetsc( localDoFs, globalDoFs );
matPetsc.createMatrixFromOperator( mass, level, numerator, hyteg::Inner );
hyteg::PETScVector< real_t, hyteg::P2Function > vecPetsc( localDoFs );
vecPetsc.createVectorFromFunction( x, numerator, level, hyteg::Inner );
......
......@@ -21,9 +21,9 @@
#include "core/DataTypes.h"
#include "core/Environment.h"
#include "core/config/Config.h"
#include "core/math/Constants.h"
#include "core/mpi/MPIManager.h"
#include "core/timing/TimingJSON.h"
#include "core/math/Constants.h"
#include "hyteg/LikwidWrapper.hpp"
#include "hyteg/dataexport/VTKOutput.hpp"
......@@ -55,12 +55,13 @@ int main( int argc, char* argv[] )
PETScManager petscManager( &argc, &argv );
auto cfg = std::make_shared< walberla::config::Config >();
if( env.config() == nullptr )
if ( env.config() == nullptr )
{
auto defaultFile = "./PetscCompare-3D-P1-Apply.prm";
WALBERLA_LOG_PROGRESS_ON_ROOT( "No Parameter file given loading default parameter file: " << defaultFile );
cfg->readParameterFile( defaultFile );
} else
}
else
{
cfg = env.config();
}
......@@ -70,14 +71,15 @@ int main( int argc, char* argv[] )
wcTimingTreeApp.start( "Mesh setup + load balancing" );
std::shared_ptr< hyteg::MeshInfo > meshInfo;
if( mainConf.getParameter< bool >( "useMeshFile" ) )
if ( mainConf.getParameter< bool >( "useMeshFile" ) )
{
std::string meshFileName = mainConf.getParameter< std::string >( "mesh" );
meshInfo = std::make_shared< hyteg::MeshInfo >( hyteg::MeshInfo::fromGmshFile( meshFileName ) );
} else
}
else
{
uint_t numberOfFaces = mainConf.getParameter< uint_t >( "numberOfFaces" );
if( mainConf.getParameter< bool >( "facesTimesProcs" ) )
if ( mainConf.getParameter< bool >( "facesTimesProcs" ) )
{
meshInfo = std::make_shared< hyteg::MeshInfo >(
hyteg::MeshInfo::meshFaceChain( numberOfFaces * uint_c( walberla::MPIManager::instance()->numProcesses() ) ) );
......@@ -85,13 +87,13 @@ int main( int argc, char* argv[] )
}
hyteg::SetupPrimitiveStorage setupStorage( *meshInfo,
walberla::uint_c( walberla::mpi::MPIManager::instance()->numProcesses() ) );
walberla::uint_c( walberla::mpi::MPIManager::instance()->numProcesses() ) );
uint_t numberOfFaces = setupStorage.getNumberOfFaces();
hyteg::loadbalancing::roundRobin( setupStorage );
std::shared_ptr< walberla::WcTimingTree > timingTree( new walberla::WcTimingTree() );
std::shared_ptr< walberla::WcTimingTree > timingTree( new walberla::WcTimingTree() );
std::shared_ptr< hyteg::PrimitiveStorage > storage = std::make_shared< hyteg::PrimitiveStorage >( setupStorage, timingTree );
wcTimingTreeApp.stop( "Mesh setup + load balancing" );
......@@ -130,7 +132,7 @@ int main( int argc, char* argv[] )
LIKWID_MARKER_START( "PETSc-setup" );
wcTimingTreeApp.start( "Petsc setup" );
hyteg::PETScSparseMatrix< hyteg::P1ConstantLaplaceOperator, hyteg::P1Function > matPetsc( localDoFs, globalDoFs );
hyteg::PETScSparseMatrix< hyteg::P1ConstantLaplaceOperator > matPetsc( localDoFs, globalDoFs );
matPetsc.createMatrixFromOperator( mass, level, numerator, hyteg::Inner );
hyteg::PETScVector< real_t, hyteg::P1Function > vecPetsc( localDoFs );
vecPetsc.createVectorFromFunction( x, numerator, level, hyteg::Inner );
......@@ -162,7 +164,7 @@ int main( int argc, char* argv[] )
//dstvecPetsc.print("../output/vector1.vec");
if( mainConf.getParameter< bool >( "printTiming" ) )
if ( mainConf.getParameter< bool >( "printTiming" ) )
{
auto wcTPReduced = wcTimingTreeApp.getReduced();
WALBERLA_LOG_INFO_ON_ROOT( wcTPReduced );
......@@ -179,12 +181,12 @@ int main( int argc, char* argv[] )
jsonOutput.close();
}
diff.assign( {1.0, -1.0}, {z, y}, level, hyteg::All );
diff.assign( { 1.0, -1.0 }, { z, y }, level, hyteg::All );
if( mainConf.getParameter< bool >( "VTKOutput" ) )
if ( mainConf.getParameter< bool >( "VTKOutput" ) )
{
WALBERLA_LOG_INFO_ON_ROOT( "writing VTK output" );
hyteg::VTKOutput vtkOutput("./output", "PetscCompare-2D-P2-Apply", storage);
hyteg::VTKOutput vtkOutput( "./output", "PetscCompare-2D-P2-Apply", storage );
vtkOutput.add( x );
vtkOutput.add( z );
vtkOutput.add( y );
......
......@@ -162,7 +162,7 @@ int main( int argc, char* argv[] )
numerator.enumerate( level );
LIKWID_MARKER_START( "PETSc-setup" );
hyteg::PETScSparseMatrix< hyteg::P1ConstantLaplaceOperator, hyteg::P1Function > matPetsc( localDoFs, totalDoFs );
hyteg::PETScSparseMatrix< hyteg::P1ConstantLaplaceOperator > matPetsc( localDoFs, totalDoFs );
matPetsc.createMatrixFromOperator( mass, level, numerator, hyteg::Inner );
hyteg::PETScVector< real_t, hyteg::P1Function > vecPetsc( localDoFs );
vecPetsc.createVectorFromFunction( x, numerator, level, hyteg::Inner );
......
......@@ -30,6 +30,7 @@
#include "hyteg/composites/petsc/P1StokesPetsc.hpp"
#include "hyteg/composites/petsc/P2P1TaylorHoodPetsc.hpp"
#include "hyteg/elementwiseoperators/DiagonalNonConstantOperator.hpp"
#include "hyteg/elementwiseoperators/P1ElementwiseOperator.hpp"
#include "hyteg/p1functionspace/P1Petsc.hpp"
#include "hyteg/p2functionspace/P2Petsc.hpp"
#include "hyteg/p2functionspace/P2ProjectNormalOperator.hpp"
......
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