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

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

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 22  Line 22 
22  void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance) {  void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance) {
23     Finley_NodeFile *newNodeFile=NULL;     Finley_NodeFile *newNodeFile=NULL;
24     Finley_ElementFile *newFaceElementsFile=NULL;     Finley_ElementFile *newFaceElementsFile=NULL;
25     int numPairs,*elem1=NULL,*elem0=NULL,*elem_mask=NULL,*new_node_label=NULL,*new_node_list=NULL,*new_node_mask=NULL,*matching_nodes_in_elem1=NULL;     dim_t numPairs,e,i,n;
26     int e,i,n,face_node;     index_t face_node, *elem1=NULL,*elem0=NULL,*elem_mask=NULL,*new_node_label=NULL,*new_node_list=NULL,*new_node_mask=NULL,*matching_nodes_in_elem1=NULL;
27    
28     if (self->FaceElements==NULL) return;     if (self->FaceElements==NULL) return;
29    
30     if (self->FaceElements->ReferenceElement->Type->numNodesOnFace<=0) {     if (self->FaceElements->ReferenceElement->Type->numNodesOnFace<=0) {
# Line 32  void Finley_Mesh_glueFaces(Finley_Mesh* Line 33  void Finley_Mesh_glueFaces(Finley_Mesh*
33       return;       return;
34     }     }
35    
36     int NNFace=self->FaceElements->ReferenceElement->Type->numNodesOnFace;     dim_t NNFace=self->FaceElements->ReferenceElement->Type->numNodesOnFace;
37     int NN=self->FaceElements->ReferenceElement->Type->numNodes;     dim_t NN=self->FaceElements->ReferenceElement->Type->numNodes;
38     int numDim=self->Nodes->numDim;     dim_t numDim=self->Nodes->numDim;
39     /* allocate work arrays */     /* allocate work arrays */
40     elem1=TMPMEMALLOC(self->FaceElements->numElements,int);     elem1=TMPMEMALLOC(self->FaceElements->numElements,index_t);
41     elem0=TMPMEMALLOC(self->FaceElements->numElements,int);     elem0=TMPMEMALLOC(self->FaceElements->numElements,index_t);
42     elem_mask=TMPMEMALLOC(self->FaceElements->numElements,int);     elem_mask=TMPMEMALLOC(self->FaceElements->numElements,index_t);
43     matching_nodes_in_elem1=TMPMEMALLOC(self->FaceElements->numElements*NN,int);     matching_nodes_in_elem1=TMPMEMALLOC(self->FaceElements->numElements*NN,index_t);
44     new_node_label=TMPMEMALLOC(self->Nodes->numNodes,int);     new_node_label=TMPMEMALLOC(self->Nodes->numNodes,index_t);
45     new_node_list=TMPMEMALLOC(self->Nodes->numNodes,int);     new_node_list=TMPMEMALLOC(self->Nodes->numNodes,index_t);
46     new_node_mask=TMPMEMALLOC(self->Nodes->numNodes,int);     new_node_mask=TMPMEMALLOC(self->Nodes->numNodes,index_t);
47     if (!(Finley_checkPtr(elem1) || Finley_checkPtr(elem0) || Finley_checkPtr(elem_mask) || Finley_checkPtr(new_node_label) || Finley_checkPtr(new_node_list) || Finley_checkPtr(new_node_mask) || Finley_checkPtr(matching_nodes_in_elem1)) ) {     if (!(Finley_checkPtr(elem1) || Finley_checkPtr(elem0) || Finley_checkPtr(elem_mask) || Finley_checkPtr(new_node_label) || Finley_checkPtr(new_node_list) || Finley_checkPtr(new_node_mask) || Finley_checkPtr(matching_nodes_in_elem1)) ) {
48        /* find the matching face elements */        /* find the matching face elements */
49        Finley_Mesh_findMatchingFaces(self->Nodes,self->FaceElements,safety_factor,tolerance,&numPairs,elem0,elem1,matching_nodes_in_elem1);        Finley_Mesh_findMatchingFaces(self->Nodes,self->FaceElements,safety_factor,tolerance,&numPairs,elem0,elem1,matching_nodes_in_elem1);
# Line 59  void Finley_Mesh_glueFaces(Finley_Mesh* Line 60  void Finley_Mesh_glueFaces(Finley_Mesh*
60               }               }
61           }           }
62           /* create an index of face elements */           /* create an index of face elements */
63           int new_numFaceElements=0;           dim_t new_numFaceElements=0;
64           for(e=0;e<self->FaceElements->numElements;e++) {           for(e=0;e<self->FaceElements->numElements;e++) {
65               if (elem_mask[e]<1) {               if (elem_mask[e]<1) {
66                 elem_mask[new_numFaceElements]=e;                 elem_mask[new_numFaceElements]=e;
# Line 67  void Finley_Mesh_glueFaces(Finley_Mesh* Line 68  void Finley_Mesh_glueFaces(Finley_Mesh*
68               }               }
69           }           }
70           /* get the new number of nodes */           /* get the new number of nodes */
71           int newNumNodes=0;           dim_t newNumNodes=0;
72           for (n=0;n<self->Nodes->numNodes;n++) new_node_mask[n]=-1;           for (n=0;n<self->Nodes->numNodes;n++) new_node_mask[n]=-1;
73           for (n=0;n<self->Nodes->numNodes;n++) new_node_mask[new_node_label[n]]=1;           for (n=0;n<self->Nodes->numNodes;n++) new_node_mask[new_node_label[n]]=1;
74           for (n=0;n<self->Nodes->numNodes;n++) {           for (n=0;n<self->Nodes->numNodes;n++) {
# Line 120  void Finley_Mesh_glueFaces(Finley_Mesh* Line 121  void Finley_Mesh_glueFaces(Finley_Mesh*
121    
122  /*  /*
123  * $Log$  * $Log$
124    * Revision 1.5  2005/07/08 04:07:52  jgs
125    * Merge of development branch back to main trunk on 2005-07-08
126    *
127  * Revision 1.4  2004/12/15 07:08:33  jgs  * Revision 1.4  2004/12/15 07:08:33  jgs
128  * *** empty log message ***  * *** empty log message ***
129    * Revision 1.1.1.1.2.2  2005/06/29 02:34:51  gross
130    * some changes towards 64 integers in finley
131    *
132    * Revision 1.1.1.1.2.1  2004/11/24 01:37:14  gross
133    * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
134  *  *
135  *  *
136  *  *

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

  ViewVC Help
Powered by ViewVC 1.1.26