/[escript]/trunk/paso/src/SchurComplement.cpp
ViewVC logotype

Diff of /trunk/paso/src/SchurComplement.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/paso/src/Solver_SchurComplement.c revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC trunk/paso/src/SchurComplement.cpp revision 4797 by caltinay, Mon Mar 24 05:42:42 2014 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*****************************************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2014 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * http://www.uq.edu.au
 * http://www.uq.edu.au/esscc  
6  *  *
7  * Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
8  * Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
9  * http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
10  *  *
11  *******************************************************/  * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12    * Development 2012-2013 by School of Earth Sciences
13    * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14    *
15    *****************************************************************************/
16    
17    
18  /**************************************************************/  /************************************************************************************/
19    
20  /* Paso: updates A_CC <- ACC-ACF AFF^{-1} AFC                 */  /* Paso: updates A_CC <- ACC-ACF AFF^{-1} AFC                 */
21    
22  /* no check of consistency of matrices !!!!                   */  /* no check of consistency of matrices !!!!                   */
23    
24  /**************************************************************/  /************************************************************************************/
25    
26  /* Copyrights by ACcESS Australia 2003,2004,2005              */  /* Copyrights by ACcESS Australia 2003,2004,2005              */
27  /* Author: gross@access.edu.au                                */  /* Author: Lutz Gross, l.gross@uq.edu.au                      */
28    
29  /**************************************************************/  /************************************************************************************/
30    
31  #include "Paso.h"  #include "Paso.h"
32  #include "SparseMatrix.h"  #include "SparseMatrix.h"
33  #include "Solver.h"  #include "Solver.h"
34    
35  /**************************************************************/  /************************************************************************************/
36    
37    
38    
39  void Paso_Solver_updateIncompleteSchurComplement(Paso_SparseMatrix* A_CC,Paso_SparseMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,Paso_SparseMatrix *A_FC) {  void Paso_Solver_updateIncompleteSchurComplement(paso::SparseMatrix* A_CC,paso::SparseMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,paso::SparseMatrix *A_FC) {
40    
41    index_t iPtr_CC,*index_CC,col_CF,col_FC, *where_p,iPtr_CC_2,i,iPtr_CF,iPtr_FC;    index_t iPtr_CC,*index_CC,col_CF,col_FC, *where_p,iPtr_CC_2,i,iPtr_CF,iPtr_FC;
42    dim_t index_CC_len;    dim_t index_CC_len;
43    bool_t set_A;    bool set_A;
44    dim_t n_loc_rows=A_CC->numRows;    dim_t n_loc_rows=A_CC->numRows;
45    dim_t n_block=A_CC->row_block_size;    dim_t n_block=A_CC->row_block_size;
46    register double A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,    register double A_CF_11,A_CF_21,A_CF_31,A_CF_12,A_CF_22,A_CF_32,A_CF_13,A_CF_23,A_CF_33,
# Line 83  void Paso_Solver_updateIncompleteSchurCo Line 86  void Paso_Solver_updateIncompleteSchurCo
86                  where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);                  where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);
87                  if (where_p!=NULL) {                  if (where_p!=NULL) {
88                      iPtr_CC_2=iPtr_CC+(index_t)(where_p-index_CC);                      iPtr_CC_2=iPtr_CC+(index_t)(where_p-index_CC);
89                      /* this calculutes A_CF*invA_FF(i,col_CF) */                      /* this calculates A_CF*invA_FF(i,col_CF) */
90                      if (set_A) {                      if (set_A) {
91                         A_CF_11=A_CF->val[4*iPtr_CF  ];                         A_CF_11=A_CF->val[4*iPtr_CF  ];
92                         A_CF_21=A_CF->val[4*iPtr_CF+1];                         A_CF_21=A_CF->val[4*iPtr_CF+1];
# Line 133  void Paso_Solver_updateIncompleteSchurCo Line 136  void Paso_Solver_updateIncompleteSchurCo
136                  where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);                  where_p=(index_t*)bsearch(&col_FC,index_CC,index_CC_len,sizeof(index_t),Paso_comparIndex);
137                  if (where_p!=NULL) {                  if (where_p!=NULL) {
138                      iPtr_CC_2=iPtr_CC+(index_t)(where_p-index_CC);                      iPtr_CC_2=iPtr_CC+(index_t)(where_p-index_CC);
139                      /* this calculutes A_CF*invA_FF(i,col_CF) */                      /* this calculates A_CF*invA_FF(i,col_CF) */
140                      if (set_A) {                      if (set_A) {
141                         A_CF_11=A_CF->val[9*iPtr_CF  ];                         A_CF_11=A_CF->val[9*iPtr_CF  ];
142                         A_CF_21=A_CF->val[9*iPtr_CF+1];                         A_CF_21=A_CF->val[9*iPtr_CF+1];
# Line 200  void Paso_Solver_updateIncompleteSchurCo Line 203  void Paso_Solver_updateIncompleteSchurCo
203   * Merge of development branch dev-02 back to main trunk on 2005-09-15   * Merge of development branch dev-02 back to main trunk on 2005-09-15
204   *   *
205   * Revision 1.1.2.1  2005/09/05 06:29:50  gross   * Revision 1.1.2.1  2005/09/05 06:29:50  gross
206   * These files have been extracted from finley to define a stand alone libray for iterative   * These files have been extracted from finley to define a stand alone library for iterative
207   * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but   * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
208   * has not been tested yet.   * has not been tested yet.
209   *   *

Legend:
Removed from v.2548  
changed lines
  Added in v.4797

  ViewVC Help
Powered by ViewVC 1.1.26