[cig-commits] [commit] rajesh-petsc, rajesh-petsc-schur: started working on solve_constrained_flow_iterative_petsc and solve_ahat_p_fhat_petsc methods (f2ced72)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:02:21 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 f2ced72f158e2f3562bb94b466def2c053db5345
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Wed Aug 20 12:28:26 2014 -0700

    started working on solve_constrained_flow_iterative_petsc and solve_ahat_p_fhat_petsc methods


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

f2ced72f158e2f3562bb94b466def2c053db5345
 lib/Stokes_flow_Incomp.c | 29 +++++++++++++++++++++++++++++
 lib/global_defs.h        |  1 +
 lib/prototypes.h         |  1 +
 3 files changed, 31 insertions(+)

diff --git a/lib/Stokes_flow_Incomp.c b/lib/Stokes_flow_Incomp.c
index 3b78d4b..433943c 100644
--- a/lib/Stokes_flow_Incomp.c
+++ b/lib/Stokes_flow_Incomp.c
@@ -38,6 +38,9 @@
 
 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);
@@ -83,6 +86,27 @@ void solve_constrained_flow_iterative(E)
     return;
 }
 
+PetscErrorCode solve_constrained_flow_iterative_petsc(struct All_variables *E)
+{
+  PetscErrorCode ierr;
+  int cycles;
+
+  cycles = E->control.p_iterations;
+  ierr = solve_Ahat_p_fhat_petsc(E, E->UVec, E->PVec, E->FVec, 
+      E->control.accuracy, &cycles);
+  CHKERRQ(ierr);
+
+  /*
+  if(E->control.pseudo_free_surf)
+    v_from_vector_pseudo_surf_petsc(E);
+  else
+    v_from_vector_petsc(E);
+
+  p_to_nodes_petsc(E, E->PVec, E->NPVec, E->mesh.levmax);
+  */
+  
+  PetscFunctionReturn(0);
+}
 
 /* ========================================================================= */
 
@@ -161,6 +185,11 @@ static int keep_iterating(struct All_variables *E,
 	    (converging < required_converging_loops);
 }
 
+static PetscErrorCode solve_Ahat_p_fhat_petsc(struct All_variables *E,
+    Vec V, Vec P, Vec F, double imp, int *steps_max )
+{
+  PetscFunctionReturn(0);
+}
 
 static void solve_Ahat_p_fhat(struct All_variables *E,
                                double **V, double **P, double **F,
diff --git a/lib/global_defs.h b/lib/global_defs.h
index be70358..89d5b86 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -722,6 +722,7 @@ struct All_variables {
     KSP   ksp;
     PC    pc;
     SNES  snes;
+    Vec   PVec, NPVec, UVec, FVec;
 
     FILE *fp;
     FILE *fptime;
diff --git a/lib/prototypes.h b/lib/prototypes.h
index 6dd9ea9..d874efc 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -487,6 +487,7 @@ void get_angle_sphere_cap(double [4][5], double [6]);
 double get_angle(double [4], double [4]);
 /* Stokes_flow_Incomp.c */
 void solve_constrained_flow_iterative(struct All_variables *);
+PetscErrorCode solve_constrained_flow_iterative_petsc(struct All_variables *);
 /* Topo_gravity.c */
 void get_STD_topo(struct All_variables *, float **, float **, float **, float **, int);
 void get_STD_freesurf(struct All_variables *, float **);



More information about the CIG-COMMITS mailing list