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

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

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

revision 122 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 23  static double  Finley_Mesh_lockingGridSi Line 23  static double  Finley_Mesh_lockingGridSi
23    
24  int Finley_Mesh_findMatchingFaces_compar(const void *arg1 , const void *arg2 ) {  int Finley_Mesh_findMatchingFaces_compar(const void *arg1 , const void *arg2 ) {
25     Finley_Mesh_findMatchingFaces_center *e1,*e2;     Finley_Mesh_findMatchingFaces_center *e1,*e2;
26     int i,l,g;     bool_t l,g;
27       dim_t i;
28     e1=(Finley_Mesh_findMatchingFaces_center*) arg1;     e1=(Finley_Mesh_findMatchingFaces_center*) arg1;
29     e2=(Finley_Mesh_findMatchingFaces_center*) arg2;     e2=(Finley_Mesh_findMatchingFaces_center*) arg2;
30     for (i=0;i<MAX_numDim;i++) {     for (i=0;i<MAX_numDim;i++) {
# Line 38  int Finley_Mesh_findMatchingFaces_compar Line 39  int Finley_Mesh_findMatchingFaces_compar
39  }  }
40    
41  void Finley_Mesh_findMatchingFaces(Finley_NodeFile *nodes, Finley_ElementFile *faces, double safety_factor,double tolerance,  void Finley_Mesh_findMatchingFaces(Finley_NodeFile *nodes, Finley_ElementFile *faces, double safety_factor,double tolerance,
42                                     int* numPairs, int* elem0,int* elem1,int* matching_nodes_in_elem1) {                                     dim_t* numPairs, index_t* elem0,index_t* elem1,index_t* matching_nodes_in_elem1) {
43  #define getDist(_dist_,_e0_,_i0_,_e1_,_i1_) \  #define getDist(_dist_,_e0_,_i0_,_e1_,_i1_) \
44        {int i;   \        {dim_t i;   \
45        _dist_=0; \        _dist_=0; \
46        for (i=0;i<numDim;i++) _dist_=MAX(_dist_,ABS(X[INDEX3(i,_i0_,_e0_,numDim,NN)]-X[INDEX3(i,_i1_,_e1_,numDim,NN)])); \        for (i=0;i<numDim;i++) _dist_=MAX(_dist_,ABS(X[INDEX3(i,_i0_,_e0_,numDim,NN)]-X[INDEX3(i,_i1_,_e1_,numDim,NN)])); \
47        }        }
48    
49  #define SWAP(_i1_,_i2_) \  #define SWAP(_i1_,_i2_) \
50              {int* i;  \              {index_t* i;  \
51                i=(_i2_); \                i=(_i2_); \
52                (_i2_)=(_i1_); \                (_i2_)=(_i1_); \
53                (_i1_)=i; \                (_i1_)=i; \
54               }               }
55    
     int e,i,i0,i1,e_0,e_1;  
56      double h=DBLE(HUGE_VAL),h_local,dist,*X=NULL;      double h=DBLE(HUGE_VAL),h_local,dist,*X=NULL;
57      int NN=faces->ReferenceElement->Type->numNodes;      dim_t NN=faces->ReferenceElement->Type->numNodes;
58      int numDim=nodes->numDim;      dim_t numDim=nodes->numDim;
     int a1[NN],a2[NN],*perm,*perm_tmp,n;  
59      Finley_Mesh_findMatchingFaces_center *center;      Finley_Mesh_findMatchingFaces_center *center;
60        index_t e_0,e_1,a1[NN],a2[NN],*perm,*perm_tmp;
61        dim_t e,i,i0,i1,n;
62    
63      X=TMPMEMALLOC(NN*numDim*faces->numElements,double);      X=TMPMEMALLOC(NN*numDim*faces->numElements,double);
64      center=TMPMEMALLOC(faces->numElements,Finley_Mesh_findMatchingFaces_center);      center=TMPMEMALLOC(faces->numElements,Finley_Mesh_findMatchingFaces_center);
# Line 171  void Finley_Mesh_findMatchingFaces(Finle Line 172  void Finley_Mesh_findMatchingFaces(Finle
172    
173  /*  /*
174  * $Log$  * $Log$
175    * Revision 1.5  2005/07/08 04:07:51  jgs
176    * Merge of development branch back to main trunk on 2005-07-08
177    *
178  * Revision 1.4  2004/12/15 07:08:32  jgs  * Revision 1.4  2004/12/15 07:08:32  jgs
179  * *** empty log message ***  * *** empty log message ***
180    * Revision 1.1.1.1.2.2  2005/06/29 02:34:51  gross
181    * some changes towards 64 integers in finley
182    *
183    * Revision 1.1.1.1.2.1  2004/11/24 01:37:14  gross
184    * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
185  *  *
186  *  *
187  *  *

Legend:
Removed from v.122  
changed lines
  Added in v.123

  ViewVC Help
Powered by ViewVC 1.1.26