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

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

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

revision 2747 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 30  void Finley_Mesh_joinFaces(Finley_Mesh* Line 30  void Finley_Mesh_joinFaces(Finley_Mesh*
30     index_t e0,e1,*elem1=NULL,*elem0=NULL,*elem_mask=NULL,*matching_nodes_in_elem1=NULL;     index_t e0,e1,*elem1=NULL,*elem0=NULL,*elem_mask=NULL,*matching_nodes_in_elem1=NULL;
31     Finley_ElementFile *newFaceElementsFile=NULL,*newContactElementsFile=NULL;     Finley_ElementFile *newFaceElementsFile=NULL,*newContactElementsFile=NULL;
32     dim_t e,i,numPairs, NN, NN_Contact,c, new_numFaceElements;     dim_t e,i,numPairs, NN, NN_Contact,c, new_numFaceElements;
33       Finley_ReferenceElement*  faceRefElement=NULL, *contactRefElement=NULL;
34    
35     if (self->MPIInfo->size>1) {     if (self->MPIInfo->size>1) {
36       Finley_setError(TYPE_ERROR,"Finley_Mesh_joinFaces: MPI is not supported yet.");       Finley_setError(TYPE_ERROR,"Finley_Mesh_joinFaces: MPI is not supported yet.");
37       return;       return;
38     }     }
39       if (self->ContactElements==NULL) {
40         Finley_setError(TYPE_ERROR,"Finley_Mesh_joinFaces: no contact element file present.");
41         return;
42       }
43     if (self->FaceElements==NULL) return;     if (self->FaceElements==NULL) return;
44       faceRefElement= Finley_ReferenceElementSet_borrowReferenceElement(self->FaceElements->referenceElementSet, FALSE);
45       contactRefElement= Finley_ReferenceElementSet_borrowReferenceElement(self->ContactElements->referenceElementSet, FALSE);
46      
47    
48       NN=self->FaceElements->numNodes;
49       NN_Contact=self->ContactElements->numNodes;
50    
51     if (self->FaceElements->ReferenceElement->Type->numNodesOnFace<=0) {     if (faceRefElement->Type->numNodesOnFace<=0) {
52       sprintf(error_msg,"Finley_Mesh_joinFaces:joining faces cannot be applied to face elements of type %s",self->FaceElements->ReferenceElement->Type->Name);       sprintf(error_msg,"Finley_Mesh_joinFaces:joining faces cannot be applied to face elements of type %s",faceRefElement->Type->Name);
53       Finley_setError(TYPE_ERROR,error_msg);       Finley_setError(TYPE_ERROR,error_msg);
54       return;       return;
55     }     }
    if (self->ContactElements==NULL) {  
      Finley_setError(TYPE_ERROR,"Finley_Mesh_joinFaces: no contact element file present.");  
      return;  
    }  
56    
    NN=self->FaceElements->ReferenceElement->Type->numNodes;  
    NN_Contact=self->ContactElements->ReferenceElement->Type->numNodes;  
57    
58     if (2*NN!=NN_Contact) {     if (contactRefElement->Type->numNodes != 2*faceRefElement->Type->numNodes) {
59       sprintf(error_msg,"Finley_Mesh_joinFaces:contact element file for %s cannot hold elements created from face elements %s",       sprintf(error_msg,"Finley_Mesh_joinFaces:contact element file for %s need to hold elements created from face elements %s", contactRefElement->Type->Name,faceRefElement->Type->Name);
            self->ContactElements->ReferenceElement->Type->Name,self->FaceElements->ReferenceElement->Type->Name);  
60       Finley_setError(TYPE_ERROR,error_msg);       Finley_setError(TYPE_ERROR,error_msg);
61       return;       return;
62     }     }
# Line 84  void Finley_Mesh_joinFaces(Finley_Mesh* Line 88  void Finley_Mesh_joinFaces(Finley_Mesh*
88               }               }
89           }           }
90           /*  allocate new face element and Contact element files */           /*  allocate new face element and Contact element files */
91           newContactElementsFile=Finley_ElementFile_alloc(self->ContactElements->ReferenceElement->Type->TypeId,self->ContactElements->order,self->ContactElements->reduced_order, self->MPIInfo);           newContactElementsFile=Finley_ElementFile_alloc(self->ContactElements->referenceElementSet, self->MPIInfo);
92           newFaceElementsFile=Finley_ElementFile_alloc(self->FaceElements->ReferenceElement->Type->TypeId,self->FaceElements->order,self->FaceElements->reduced_order, self->MPIInfo);           newFaceElementsFile=Finley_ElementFile_alloc(self->FaceElements->referenceElementSet, self->MPIInfo);
93           if (Finley_noError()) {           if (Finley_noError()) {
94                 Finley_ElementFile_allocTable(newContactElementsFile,numPairs+self->ContactElements->numElements);                 Finley_ElementFile_allocTable(newContactElementsFile,numPairs+self->ContactElements->numElements);
95                 Finley_ElementFile_allocTable(newFaceElementsFile,new_numFaceElements);                 Finley_ElementFile_allocTable(newFaceElementsFile,new_numFaceElements);

Legend:
Removed from v.2747  
changed lines
  Added in v.2748

  ViewVC Help
Powered by ViewVC 1.1.26