/[escript]/trunk/dudley/src/Mesh_markNodes.c
ViewVC logotype

Diff of /trunk/dudley/src/Mesh_markNodes.c

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

trunk/esys2/finley/src/finleyC/Mesh_markNodes.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/Mesh_markNodes.c revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC
# Line 1  Line 1 
1    /*
2     ************************************************************
3     *          Copyright 2006 by ACcESS MNRF                   *
4     *                                                          *
5     *              http://www.access.edu.au                    *
6     *       Primary Business: Queensland, Australia            *
7     *  Licensed under the Open Software License version 3.0    *
8     *     http://www.opensource.org/licenses/osl-3.0.php       *
9     *                                                          *
10     ************************************************************
11    */
12    
13  /**************************************************************/  /**************************************************************/
14    
15  /*   Finley: Mesh */  /*   Finley: Mesh */
# Line 6  Line 18 
18    
19  /**************************************************************/  /**************************************************************/
20    
21  /*   Copyrights by ACcESS Australia 2003/04 */  /*  Author: gross@access.edu.au */
22  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
23    
24  /**************************************************************/  /**************************************************************/
25    
# Line 16  Line 27 
27    
28  /**************************************************************/  /**************************************************************/
29    
30  void Finley_Mesh_markNodes(int* mask,int offset,Finley_Mesh* in,int useLinear) {  void Finley_Mesh_markNodes(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear) {
31            Finley_ElementFile_markNodes(mask,offset,in->Elements,useLinear);            Finley_ElementFile_markNodes(mask,offset,in->Elements,useLinear);
32            Finley_ElementFile_markNodes(mask,offset,in->FaceElements,useLinear);            Finley_ElementFile_markNodes(mask,offset,in->FaceElements,useLinear);
33            Finley_ElementFile_markNodes(mask,offset,in->ContactElements,useLinear);            Finley_ElementFile_markNodes(mask,offset,in->ContactElements,useLinear);
34            Finley_ElementFile_markNodes(mask,offset,in->Points,useLinear);            Finley_ElementFile_markNodes(mask,offset,in->Points,useLinear);
35  }  }
36    
37    #ifdef PASO_MPI
38    
39    /* assumes that mask has length in->Nodes->numNodes
40       hence, it assumes that nodes are dense and offset==0
41       offset must ==0
42       assumes mask[i]==-1, i=0:in->Nodes->numNodes
43        */
44    void Finley_Mesh_markOrderedNodesLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)
45    {
46      index_t *internalMask=NULL, *boundaryMask=NULL, i;
47    
48      if( offset )
49      {
50        Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");
51        return;
52      }
53    
54      internalMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );
55      boundaryMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );
56      for( i=0; i<in->Nodes->numNodes; i++ )
57        internalMask[i] = boundaryMask[i] = 0;
58    
59      Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Elements,useLinear);
60      Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->FaceElements,useLinear);
61      Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->ContactElements,useLinear);
62      Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Points,useLinear);
63    
64      Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Elements,useLinear);
65      Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->FaceElements,useLinear);
66      Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->ContactElements,useLinear);
67      Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Points,useLinear);
68    
69      for( i=0; i<in->Nodes->numNodes; i++ )
70        if( internalMask[i] && boundaryMask[i] )
71          mask[i] = 2;  /* boundary */
72        else if( internalMask[i] )
73          mask[i] = 1;  /* internal */
74        else if( boundaryMask[i] )
75          mask[i] = 3;  /* external */
76        else
77          mask[i] = -1; /* not referenced */
78    }
79    
80    void Finley_Mesh_markOrderedDegreesOfFreedomLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)
81    {
82      index_t *internalMask=NULL, *boundaryMask=NULL, i;
83    
84      if( offset )
85      {
86        Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");
87        return;
88      }
89    
90      internalMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );
91      boundaryMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );
92      for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
93        internalMask[i] = boundaryMask[i] = 0;
94    
95      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear);
96      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear);
97      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear);
98      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear);
99    
100      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear);
101      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear);
102      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear);
103      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear);
104    
105      for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
106        if( internalMask[i] && boundaryMask[i] )
107          mask[i] = 2;  /* boundary */
108        else if( internalMask[i] )
109          mask[i] = 1;  /* internal */
110        else if( boundaryMask[i] )
111          mask[i] = 3;  /* external */
112        else
113          mask[i] = -1; /* not referenced */
114    }
115    #endif
116    
117  /*  /*
118  * $Log$  * $Log$
119  * Revision 1.1  2004/10/26 06:53:57  jgs  * Revision 1.3  2005/09/15 03:44:22  jgs
120  * Initial revision  * Merge of development branch dev-02 back to main trunk on 2005-09-15
121    *
122    * Revision 1.2.2.1  2005/09/07 06:26:19  gross
123    * the solver from finley are put into the standalone package paso now
124    *
125    * Revision 1.2  2005/07/08 04:07:53  jgs
126    * Merge of development branch back to main trunk on 2005-07-08
127    *
128    * Revision 1.1.1.1.2.1  2005/06/29 02:34:52  gross
129    * some changes towards 64 integers in finley
130    *
131    * Revision 1.1.1.1  2004/10/26 06:53:57  jgs
132    * initial import of project esys2
133  *  *
134  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  * Revision 1.1.1.1  2004/06/24 04:00:40  johng
135  * Initial version of eys using boost-python.  * Initial version of eys using boost-python.

Legend:
Removed from v.82  
changed lines
  Added in v.751

  ViewVC Help
Powered by ViewVC 1.1.26