/[escript]/trunk/finley/src/Util.c
ViewVC logotype

Diff of /trunk/finley/src/Util.c

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

revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
2     ******************************************************************************
3     *                                                                            *
4     *       COPYRIGHT  ACcESS 2003,2004,2005 -  All Rights Reserved              *
5     *                                                                            *
6     * This software is the property of ACcESS. No part of this code              *
7     * may be copied in any form or by any means without the expressed written    *
8     * consent of ACcESS.  Copying, use or modification of this software          *
9     * by any unauthorised person is illegal unless that person has a software    *
10     * license agreement with ACcESS.                                             *
11     *                                                                            *
12     ******************************************************************************
13    */
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 6  Line 18 
18    
19  /**************************************************************/  /**************************************************************/
20    
 /*   Copyrights by ACcESS Australia, 2003 */  
21  /*   author: gross@access.edu.au */  /*   author: gross@access.edu.au */
22  /*   Version: $Id$ */  /*   Version: $Id$ */
23    
24  /**************************************************************/  /**************************************************************/
25    
 #include "Common.h"  
26  #include "Finley.h"  #include "Finley.h"
27  #include "Util.h"  #include "Util.h"
28  #ifdef _OPENMP  #ifdef _OPENMP
# Line 124  void Finley_Util_InvertSmallMat(dim_t le Line 134  void Finley_Util_InvertSmallMat(dim_t le
134                 D=1./D;                 D=1./D;
135                 invA[q]=D;                 invA[q]=D;
136              } else {              } else {
137                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
138                 return;                 return;
139              }              }
140           }           }
# Line 147  void Finley_Util_InvertSmallMat(dim_t le Line 156  void Finley_Util_InvertSmallMat(dim_t le
156                 invA[INDEX3(0,1,q,2,2)]=-A12*D;                 invA[INDEX3(0,1,q,2,2)]=-A12*D;
157                 invA[INDEX3(1,1,q,2,2)]= A11*D;                 invA[INDEX3(1,1,q,2,2)]= A11*D;
158              } else {              } else {
159                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
160                 return;                 return;
161              }              }
162           }           }
# Line 180  void Finley_Util_InvertSmallMat(dim_t le Line 188  void Finley_Util_InvertSmallMat(dim_t le
188                 invA[INDEX3(1,2,q,3,3)]=(A13*A21-A11*A23)*D;                 invA[INDEX3(1,2,q,3,3)]=(A13*A21-A11*A23)*D;
189                 invA[INDEX3(2,2,q,3,3)]=(A11*A22-A12*A21)*D;                 invA[INDEX3(2,2,q,3,3)]=(A11*A22-A12*A21)*D;
190              } else {              } else {
191                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: Non-regular matrix");
                sprintf(Finley_ErrorMsg,"Non-regular matrix");  
192                 return;                 return;
193              }              }
194           }           }
# Line 251  void  Finley_NormalVector(dim_t len, dim Line 258  void  Finley_NormalVector(dim_t len, dim
258              A21=A[INDEX3(1,0,q,2,dim1)];              A21=A[INDEX3(1,0,q,2,dim1)];
259              length = sqrt(A11*A11+A21*A21);              length = sqrt(A11*A11+A21*A21);
260              if (! length>0) {              if (! length>0) {
261                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: area equals zero.");
                sprintf(Finley_ErrorMsg,"area equals zero.");  
262                 return;                 return;
263              } else {              } else {
264                 invlength=1./length;                 invlength=1./length;
# Line 274  void  Finley_NormalVector(dim_t len, dim Line 280  void  Finley_NormalVector(dim_t len, dim
280              CO_A33=A11*A22-A21*A12;              CO_A33=A11*A22-A21*A12;
281              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);
282              if (! length>0) {              if (! length>0) {
283                 Finley_ErrorCode=ZERO_DIVISION_ERROR;                 Finley_setError(ZERO_DIVISION_ERROR,"__FILE__: area equals zero.");
                sprintf(Finley_ErrorMsg,"area equals zero.");  
284                 return;                 return;
285              } else {              } else {
286                 invlength=1./length;                 invlength=1./length;
# Line 473  void Finley_copyDouble(dim_t n,double* s Line 478  void Finley_copyDouble(dim_t n,double* s
478  }  }
479    
480  /*  /*
  * $Log$  
481   * Revision 1.8  2005/08/12 01:45:43  jgs   * Revision 1.8  2005/08/12 01:45:43  jgs
482   * 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
483   *   *
484     * Revision 1.7.2.2  2005/09/07 06:26:22  gross
485     * the solver from finley are put into the standalone package paso now
486     *
487   * Revision 1.7.2.1  2005/08/04 22:41:11  gross   * Revision 1.7.2.1  2005/08/04 22:41:11  gross
488   * 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)
489   *   *

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

  ViewVC Help
Powered by ViewVC 1.1.26