/[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 123 by jgs, Fri Jul 8 04:08:13 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
1    /*
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    
17  /*   Finley: Mesh */  /*   Finley: Mesh */
# Line 6  Line 20 
20    
21  /**************************************************************/  /**************************************************************/
22    
23  /*   Copyrights by ACcESS Australia 2003/04 */  /*  Author: gross@access.edu.au */
24  /*   Author: gross@access.edu.au */  /*  Version: $Id$
 /*   Version: $Id$ */  
25    
26  /**************************************************************/  /**************************************************************/
27    
 #include "Common.h"  
 #include "Finley.h"  
28  #include "Mesh.h"  #include "Mesh.h"
29    
30  /**************************************************************/  /**************************************************************/
31    
32    
33  void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance) {  void Finley_Mesh_glueFaces(Finley_Mesh* self,double safety_factor,double tolerance) {
34       char error_msg[LenErrorMsg_MAX];
35     Finley_NodeFile *newNodeFile=NULL;     Finley_NodeFile *newNodeFile=NULL;
36     Finley_ElementFile *newFaceElementsFile=NULL;     Finley_ElementFile *newFaceElementsFile=NULL;
37     dim_t numPairs,e,i,n;     dim_t numPairs,e,i,n;
# Line 28  void Finley_Mesh_glueFaces(Finley_Mesh* Line 40  void Finley_Mesh_glueFaces(Finley_Mesh*
40     if (self->FaceElements==NULL) return;     if (self->FaceElements==NULL) return;
41    
42     if (self->FaceElements->ReferenceElement->Type->numNodesOnFace<=0) {     if (self->FaceElements->ReferenceElement->Type->numNodesOnFace<=0) {
43       Finley_ErrorCode=TYPE_ERROR;       sprintf(error_msg,"__FILE__:glueing faces cannot be applied to face elements pf type %s",self->FaceElements->ReferenceElement->Type->Name);
44       sprintf(Finley_ErrorMsg,"glueing faces cannot be applied to face elements pf type %s",self->FaceElements->ReferenceElement->Type->Name);       Finley_setError(TYPE_ERROR,error_msg);
45       return;       return;
46     }     }
47    
# Line 47  void Finley_Mesh_glueFaces(Finley_Mesh* Line 59  void Finley_Mesh_glueFaces(Finley_Mesh*
59     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)) ) {
60        /* find the matching face elements */        /* find the matching face elements */
61        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);
62        if (Finley_ErrorCode==NO_ERROR) {        if (Finley_noError()) {
63           for(e=0;e<self->FaceElements->numElements;e++) elem_mask[e]=0;           for(e=0;e<self->FaceElements->numElements;e++) elem_mask[e]=0;
64           for(n=0;n<self->Nodes->numNodes;n++) new_node_label[n]=n;           for(n=0;n<self->Nodes->numNodes;n++) new_node_label[n]=n;
65           /* remove mark imatching face elements to be removed */           /* remove mark imatching face elements to be removed */
# Line 81  void Finley_Mesh_glueFaces(Finley_Mesh* Line 93  void Finley_Mesh_glueFaces(Finley_Mesh*
93           for (n=0;n<self->Nodes->numNodes;n++) new_node_label[n]=new_node_mask[new_node_label[n]];           for (n=0;n<self->Nodes->numNodes;n++) new_node_label[n]=new_node_mask[new_node_label[n]];
94           /* allocate new node and element files */           /* allocate new node and element files */
95           newNodeFile=Finley_NodeFile_alloc(numDim);           newNodeFile=Finley_NodeFile_alloc(numDim);
96           if (Finley_ErrorCode==NO_ERROR) {           if (Finley_noError()) {
97               Finley_NodeFile_allocTable(newNodeFile,newNumNodes);               Finley_NodeFile_allocTable(newNodeFile,newNumNodes);
98               if (Finley_ErrorCode==NO_ERROR) {               if (Finley_noError()) {
99                  newFaceElementsFile=Finley_ElementFile_alloc(self->FaceElements->ReferenceElement->Type->TypeId,self->FaceElements->order);                  newFaceElementsFile=Finley_ElementFile_alloc(self->FaceElements->ReferenceElement->Type->TypeId,self->FaceElements->order);
100                  if (Finley_ErrorCode==NO_ERROR) {                  if (Finley_noError()) {
101                     Finley_ElementFile_allocTable(newFaceElementsFile,new_numFaceElements);                     Finley_ElementFile_allocTable(newFaceElementsFile,new_numFaceElements);
102                   }                   }
103                }                }
104           }           }
105           if (Finley_ErrorCode==NO_ERROR) {           if (Finley_noError()) {
106              /* get the new nodes :*/              /* get the new nodes :*/
107              Finley_NodeFile_gather(new_node_list,self->Nodes,newNodeFile);              Finley_NodeFile_gather(new_node_list,self->Nodes,newNodeFile);
108              /* they are the new nodes*/              /* they are the new nodes*/
# Line 121  void Finley_Mesh_glueFaces(Finley_Mesh* Line 133  void Finley_Mesh_glueFaces(Finley_Mesh*
133    
134  /*  /*
135  * $Log$  * $Log$
136    * Revision 1.6  2005/09/15 03:44:22  jgs
137    * Merge of development branch dev-02 back to main trunk on 2005-09-15
138    *
139    * Revision 1.5.2.1  2005/09/07 06:26:19  gross
140    * the solver from finley are put into the standalone package paso now
141    *
142  * Revision 1.5  2005/07/08 04:07:52  jgs  * Revision 1.5  2005/07/08 04:07:52  jgs
143  * Merge of development branch back to main trunk on 2005-07-08  * Merge of development branch back to main trunk on 2005-07-08
144  *  *

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

  ViewVC Help
Powered by ViewVC 1.1.26