diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc index 1178e701991d05f4dce6ed99aad013f21457fe54..197b500921cc8cf16f9de2205d355fc2ea2904d9 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.cc +++ b/AMDiS/src/parallel/PetscSolverFeti.cc @@ -14,6 +14,7 @@ #include "parallel/PetscSolverFetiStructs.h" #include "parallel/StdMpi.h" #include "parallel/MpiHelper.h" +#include "parallel/SubDomainSolver.h" #include "io/VtkWriter.h" namespace AMDiS { @@ -185,7 +186,8 @@ namespace AMDiS { PetscSolverFeti::PetscSolverFeti() : PetscSolver(), - schurPrimalSolver(0) + schurPrimalSolver(0), + multiLevelTest(false) { FUNCNAME("PetscSolverFeti::PetscSolverFeti()"); @@ -209,6 +211,12 @@ namespace AMDiS { TEST_EXIT(schurPrimalSolver == 0 || schurPrimalSolver == 1) ("Wrong solver \"%d\"for the Schur primal complement!\n", schurPrimalSolver); + + Parameters::get("parallel->multi level test", multiLevelTest); + + if (multiLevelTest) { + // subDomainSolver = new SubDomainSolver(meshDistributor, mpiComm, &PETSC_COMM_SELF); + } } @@ -260,6 +268,12 @@ namespace AMDiS { static_cast<unsigned int>(feSpace->getAdmin()->getUsedDofs())) ("Should not happen!\n"); } + + + // If multi level test, inform sub domain solver about coarse space. + if (multiLevelTest) { + subDomainSolver->setCoarseSpace(&primalDofMap); + } } diff --git a/AMDiS/src/parallel/PetscSolverFeti.h b/AMDiS/src/parallel/PetscSolverFeti.h index 580f3ba085493e9030efd7f3406fff0537466465..357b4fe4698f2f9522c5081bb1d1c591a3052453 100644 --- a/AMDiS/src/parallel/PetscSolverFeti.h +++ b/AMDiS/src/parallel/PetscSolverFeti.h @@ -26,6 +26,7 @@ #include "parallel/PetscSolverFetiStructs.h" #include "parallel/ParallelDofMapping.h" #include "parallel/ParallelTypes.h" +#include "parallel/SubDomainSolver.h" #ifndef AMDIS_PETSC_SOLVER_FETI_H #define AMDIS_PETSC_SOLVER_FETI_H @@ -240,6 +241,10 @@ namespace AMDiS { Mat mat_interior_interior, mat_duals_duals, mat_interior_duals, mat_duals_interior; KSP ksp_interior; + + bool multiLevelTest; + + SubDomainSolver *subDomainSolver; }; } diff --git a/AMDiS/src/parallel/SubDomainSolver.h b/AMDiS/src/parallel/SubDomainSolver.h new file mode 100644 index 0000000000000000000000000000000000000000..4ba8443b1713d4da87574a11cdf9284b6a50b5c6 --- /dev/null +++ b/AMDiS/src/parallel/SubDomainSolver.h @@ -0,0 +1,67 @@ +// ============================================================================ +// == == +// == AMDiS - Adaptive multidimensional simulations == +// == == +// == http://www.amdis-fem.org == +// == == +// ============================================================================ +// +// Software License for AMDiS +// +// Copyright (c) 2010 Dresden University of Technology +// All rights reserved. +// Authors: Simon Vey, Thomas Witkowski et al. +// +// This file is part of AMDiS +// +// See also license.opensource.txt in the distribution. + + + +/** \file SubDomainSolver.h */ + +#ifndef AMDIS_SUBDOMAIN_SOLVER_H +#define AMDIS_SUBDOMAIN_SOLVER_H + +#include <map> +#include <set> +#include <mpi.h> +#include <petsc.h> +#include "parallel/MeshDistributor.h" +#include "parallel/ParallelDofMapping.h" + +namespace AMDiS { + + using namespace std; + + class SubDomainSolver { + public: + SubDomainSolver(MeshDistributor *md, + MPI::Intracomm* mpiComm0, + MPI::Intracomm* mpiComm1) + : meshDistributor(md), + coarseSpaceMpiComm(mpiComm0), + subDomainMpiComm(mpiComm1), + coarseSpace(NULL) + {} + + void setCoarseSpace(ParallelDofMapping *coarseDofs) + { + coarseSpace = coarseDofs; + } + + void solve(Vec &rhs, Vec &sol) + {} + + protected: + MeshDistributor *meshDistributor; + + MPI::Intracomm* coarseSpaceMpiComm; + + MPI::Intracomm* subDomainMpiComm; + + ParallelDofMapping* coarseSpace; + }; +} + +#endif