[cig-commits] [commit] rajesh-petsc, rajesh-petsc-schur: Started on the solve_Ahat_p_fhat_PETSc_Schur implementation (f90ce24)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:02:45 PST 2014


Repository : https://github.com/geodynamics/citcoms

On branches: rajesh-petsc,rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd

>---------------------------------------------------------------

commit f90ce2429918389a360687891af7ea0a17074938
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Aug 20 12:36:02 2014 -0700

    Started on the solve_Ahat_p_fhat_PETSc_Schur implementation


>---------------------------------------------------------------

f90ce2429918389a360687891af7ea0a17074938
 lib/Stokes_flow_Incomp.c | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/lib/Stokes_flow_Incomp.c b/lib/Stokes_flow_Incomp.c
index 3a711a3..defeb0a 100644
--- a/lib/Stokes_flow_Incomp.c
+++ b/lib/Stokes_flow_Incomp.c
@@ -39,9 +39,6 @@
 
 void myerror(struct All_variables *,char *);
 
-static PetscErrorCode solve_Ahat_p_fhat_petsc(struct All_variables *E,
-    Vec V, Vec P, Vec F, double imp, int *steps_max);
-
 static void solve_Ahat_p_fhat(struct All_variables *E,
                               double **V, double **P, double **F,
                               double imp, int *steps_max);
@@ -55,12 +52,17 @@ static void solve_Ahat_p_fhat_iterCG(struct All_variables *E,
                                       double **V, double **P, double **F,
                                       double imp, int *steps_max);
 
+static PetscErrorCode solve_Ahat_p_fhat_petsc(struct All_variables *E,
+    Vec V, Vec P, Vec F, double imp, int *steps_max);
+
+static PetscErrorCode solve_Ahat_p_fhat_PETSc_Schur(struct All_variables *E,
+    double **V, double **P, double **F, double imp, int *steps_max);
+
 static PetscErrorCode solve_Ahat_p_fhat_CG_PETSc(struct All_variables *E, 
-                                 double **V, double **P, double **F,
-                                 double imp, int *steps_max);
+    double **V, double **P, double **F, double imp, int *steps_max);
+
 static PetscErrorCode solve_Ahat_p_fhat_BiCG_PETSc(struct All_variables *E,
-                                    double **V, double **P, double **F,
-                                    double imp, int *steps_max);
+    double **V, double **P, double **F, double imp, int *steps_max);
 
 static void initial_vel_residual(struct All_variables *E,
                                  double **V, double **P, double **F,
@@ -185,7 +187,7 @@ static void solve_Ahat_p_fhat(struct All_variables *E,
   {
     if(E->control.petsc_schur) // use Schur complement reduction
     {
-      myerror(E, "Error: Schur complement reduction not implemented\n");
+      solve_Ahat_p_fhat_PETSc_Schur(E, V, P, F, imp, steps_max);
     }
     else                       // use the Uzawa algorithm
     {
@@ -217,6 +219,17 @@ static void solve_Ahat_p_fhat(struct All_variables *E,
   }
 }
 
+static PetscErrorCode solve_Ahat_p_fhat_PETSc_Schur(struct All_variables *E,
+  double **V, double **P, double **F, double imp, int *steps_max)
+{
+  PetscErrorCode ierr;
+
+  Mat S;
+  ierr = MatCreateSchurComplement(E->K,E->K,E->G,E->D,PETSC_NULL, &S); 
+  CHKERRQ(ierr);
+
+  PetscFunctionReturn(0);
+}
 
 /* Solve incompressible Stokes flow using
  * conjugate gradient (CG) iterations



More information about the CIG-COMMITS mailing list