/[escript]/branches/domexper/dudley/src/Util.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Util.c

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

trunk/esys2/finley/src/finleyC/Util.c revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC trunk/finley/src/Util.c revision 616 by elspeth, Wed Mar 22 02:46:56 2006 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
2     ************************************************************
3     *          Copyright 2006 by ACcESS MNRF                   *
4     *                                                          *
5     *              http://www.access.edu.au                    *
6     *       Primary Business: Queensland, Australia            *
7     *  Licensed under the Open Software License version 3.0    *
8     *     http://www.opensource.org/licenses/osl-3.0.php       *
9     *                                                          *
10     ************************************************************
11    */
12    
13  /**************************************************************/  /**************************************************************/
14    
# Line 6  Line 16 
16    
17  /**************************************************************/  /**************************************************************/
18    
 /*   Copyrights by ACcESS Australia, 2003 */  
19  /*   author: gross@access.edu.au */  /*   author: gross@access.edu.au */
20  /*   Version: $Id$ */  /*   Version: $Id$ */
21    
22  /**************************************************************/  /**************************************************************/
23    
 #include "Common.h"  
24  #include "Finley.h"  #include "Finley.h"
25  #include "Util.h"  #include "Util.h"
26  #ifdef _OPENMP  #ifdef _OPENMP
# Line 124  void Finley_Util_InvertSmallMat(dim_t le Line 132  void Finley_Util_InvertSmallMat(dim_t le
132                 D=1./D;                 D=1./D;
133                 invA[q]=D;                 invA[q]=D;
134              } else {              } else {
135                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
136                 return;                 return;
137              }              }
138           }           }
# Line 147  void Finley_Util_InvertSmallMat(dim_t le Line 154  void Finley_Util_InvertSmallMat(dim_t le
154                 invA[INDEX3(0,1,q,2,2)]=-A12*D;                 invA[INDEX3(0,1,q,2,2)]=-A12*D;
155                 invA[INDEX3(1,1,q,2,2)]= A11*D;                 invA[INDEX3(1,1,q,2,2)]= A11*D;
156              } else {              } else {
157                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
158                 return;                 return;
159              }              }
160           }           }
# Line 180  void Finley_Util_InvertSmallMat(dim_t le Line 186  void Finley_Util_InvertSmallMat(dim_t le
186                 invA[INDEX3(1,2,q,3,3)]=(A13*A21-A11*A23)*D;                 invA[INDEX3(1,2,q,3,3)]=(A13*A21-A11*A23)*D;
187                 invA[INDEX3(2,2,q,3,3)]=(A11*A22-A12*A21)*D;                 invA[INDEX3(2,2,q,3,3)]=(A11*A22-A12*A21)*D;
188              } else {              } else {
189                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
190                 return;                 return;
191              }              }
192           }           }
# Line 251  void  Finley_NormalVector(dim_t len, dim Line 256  void  Finley_NormalVector(dim_t len, dim
256              A21=A[INDEX3(1,0,q,2,dim1)];              A21=A[INDEX3(1,0,q,2,dim1)];
257              length = sqrt(A11*A11+A21*A21);              length = sqrt(A11*A11+A21*A21);
258              if (! length>0) {              if (! length>0) {
259                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: area equals zero.");
                sprintf(Finley_ErrorMsg,"area equals zero.");  
260                 return;                 return;
261              } else {              } else {
262                 invlength=1./length;                 invlength=1./length;
# Line 274  void  Finley_NormalVector(dim_t len, dim Line 278  void  Finley_NormalVector(dim_t len, dim
278              CO_A33=A11*A22-A21*A12;              CO_A33=A11*A22-A21*A12;
279              length=sqrt(CO_A13*CO_A13+CO_A23*CO_A23+CO_A33*CO_A33);              length=sqrt(CO_A13*CO_A13+CO_A23*CO_A23+CO_A33*CO_A33);
280              if (! length>0) {              if (! length>0) {
281                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: area equals zero.");
                sprintf(Finley_ErrorMsg,"area equals zero.");  
282                 return;                 return;
283              } else {              } else {
284                 invlength=1./length;                 invlength=1./length;
# Line 473  void Finley_copyDouble(dim_t n,double* s Line 476  void Finley_copyDouble(dim_t n,double* s
476  }  }
477    
478  /*  /*
  * $Log$  
479   * Revision 1.8  2005/08/12 01:45:43  jgs   * Revision 1.8  2005/08/12 01:45:43  jgs
480   * erge of development branch dev-02 back to main trunk on 2005-08-12   * erge of development branch dev-02 back to main trunk on 2005-08-12
481   *   *
482     * Revision 1.7.2.2  2005/09/07 06:26:22  gross
483     * the solver from finley are put into the standalone package paso now
484     *
485   * Revision 1.7.2.1  2005/08/04 22:41:11  gross   * Revision 1.7.2.1  2005/08/04 22:41:11  gross
486   * some extra routines for finley that might speed-up RHS assembling in some cases (not actived right now)   * some extra routines for finley that might speed-up RHS assembling in some cases (not actived right now)
487   *   *

Legend:
Removed from v.147  
changed lines
  Added in v.616

  ViewVC Help
Powered by ViewVC 1.1.26