From 35720ba347bd45756af6e845e2154a6753bb5ec5 Mon Sep 17 00:00:00 2001
From: Thomas Witkowski <thomas.witkowski@gmx.de>
Date: Thu, 21 Apr 2011 16:33:47 +0000
Subject: [PATCH] Fixed some parallel compilation problems and added FETI-DP
 interface.

---
 AMDiS/CMakeLists.txt                         |  1 +
 AMDiS/src/parallel/ParallelProblemStatBase.h |  4 --
 AMDiS/src/parallel/PetscProblemStat.h        | 13 +++++-
 AMDiS/src/parallel/PetscSolverFeti.cc        | 35 ++++++++++++++
 AMDiS/src/parallel/PetscSolverFeti.h         | 49 ++++++++++++++++++++
 5 files changed, 97 insertions(+), 5 deletions(-)
 create mode 100644 AMDiS/src/parallel/PetscSolverFeti.cc
 create mode 100644 AMDiS/src/parallel/PetscSolverFeti.h

diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt
index 01afc914..23daa50e 100644
--- a/AMDiS/CMakeLists.txt
+++ b/AMDiS/CMakeLists.txt
@@ -199,6 +199,7 @@ if(ENABLE_PARALLEL_DOMAIN)
                 ${SOURCE_DIR}/parallel/ParMetisPartitioner.cc
 		${SOURCE_DIR}/parallel/PetscProblemStat.cc
 		${SOURCE_DIR}/parallel/PetscSolver.cc
+		${SOURCE_DIR}/parallel/PetscSolverFeti.cc
 		${SOURCE_DIR}/parallel/PetscSolverGlobalMatrix.cc
 		${SOURCE_DIR}/parallel/PetscSolverSchur.cc
 		${SOURCE_DIR}/parallel/StdMpi.cc
diff --git a/AMDiS/src/parallel/ParallelProblemStatBase.h b/AMDiS/src/parallel/ParallelProblemStatBase.h
index 773095a9..6455158d 100644
--- a/AMDiS/src/parallel/ParallelProblemStatBase.h
+++ b/AMDiS/src/parallel/ParallelProblemStatBase.h
@@ -52,10 +52,6 @@ namespace AMDiS {
     MeshDistributor *meshDistributor;     
   };
 
-#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
-  typedef ProblemStatSeq ProblemStat;
-#endif
-
 }
 
 #endif
diff --git a/AMDiS/src/parallel/PetscProblemStat.h b/AMDiS/src/parallel/PetscProblemStat.h
index b4669ed1..4dce9b10 100644
--- a/AMDiS/src/parallel/PetscProblemStat.h
+++ b/AMDiS/src/parallel/PetscProblemStat.h
@@ -27,6 +27,7 @@
 #include "Global.h"
 #include "parallel/ParallelProblemStatBase.h"
 #include "parallel/PetscSolver.h"
+#include "parallel/PetscSolverFeti.h"
 #include "parallel/PetscSolverGlobalMatrix.h"
 #include "parallel/PetscSolverSchur.h"
 
@@ -46,7 +47,13 @@ namespace AMDiS {
 #ifdef HAVE_PETSC_DEV
 	petscSolver = new PetscSolverSchur();
 #else
-	ERROR_EXIT("Petsc schur complement solver is only supported when petsc-dev is used!\n");
+	ERROR_EXIT("PETSc schur complement solver is only supported when petsc-dev is used!\n");
+#endif
+      } else if (name == "petsc-feti") {
+#ifdef HAVE_PETSC_DEV
+	petscSolver = new PetscSolverFeti();
+#else
+	ERROR_EXIT("PETSc FETI-DP solver is only supported when petsc-dev is used!\n");
 #endif
       } else if (name == "petsc" || name == "") {
 	petscSolver = new PetscSolverGlobalMatrix();
@@ -75,6 +82,10 @@ namespace AMDiS {
 
   typedef PetscProblemStat ParallelProblemStat;
 
+#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
+  typedef PetscProblemStat ProblemStat;
+#endif
+
 } // namespace AMDiS
 
 #endif
diff --git a/AMDiS/src/parallel/PetscSolverFeti.cc b/AMDiS/src/parallel/PetscSolverFeti.cc
new file mode 100644
index 00000000..f7b9ef62
--- /dev/null
+++ b/AMDiS/src/parallel/PetscSolverFeti.cc
@@ -0,0 +1,35 @@
+//
+// 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.
+
+
+#include "parallel/PetscSolverFeti.h"
+#include "parallel/StdMpi.h"
+#include "parallel/MpiHelper.h"
+
+namespace AMDiS {
+
+  using namespace std;
+
+
+#ifdef HAVE_PETSC_DEV 
+  void PetscSolverFeti::fillPetscMatrix(Matrix<DOFMatrix*> *mat, SystemVector *vec)
+  {
+    FUNCNAME("PetscSolverFeti::fillPetscMatrix()");   
+  }
+
+
+  void PetscSolverFeti::solvePetscMatrix(SystemVector &vec, AdaptInfo *adaptInfo)
+  {
+    FUNCNAME("PetscSolverFeti::solvePetscMatrix()");
+  }
+#endif
+
+}
diff --git a/AMDiS/src/parallel/PetscSolverFeti.h b/AMDiS/src/parallel/PetscSolverFeti.h
new file mode 100644
index 00000000..4dfcb4e0
--- /dev/null
+++ b/AMDiS/src/parallel/PetscSolverFeti.h
@@ -0,0 +1,49 @@
+// ============================================================================
+// ==                                                                        ==
+// == 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 PetscSolverFeti.h */
+
+#include "parallel/PetscSolver.h"
+
+#ifndef AMDIS_PETSC_SOLVER_FETI_H
+#define AMDIS_PETSC_SOLVER_FETI_H
+
+namespace AMDiS {
+
+  using namespace std;
+
+
+#ifdef HAVE_PETSC_DEV
+  class PetscSolverFeti : public PetscSolver
+  {
+  public:
+    PetscSolverFeti() 
+      : PetscSolver()
+    {}
+
+    void fillPetscMatrix(Matrix<DOFMatrix*> *mat, SystemVector *vec);
+
+    void solvePetscMatrix(SystemVector &vec, AdaptInfo *adaptInfo);
+  };
+#endif
+
+}
+
+#endif
-- 
GitLab