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

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

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

revision 750 by elspeth, Wed Mar 22 02:46:56 2006 UTC revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC
# Line 33  void Finley_Mesh_markNodes(index_t* mask Line 33  void Finley_Mesh_markNodes(index_t* mask
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.3  2005/09/15 03:44:22  jgs  * Revision 1.3  2005/09/15 03:44:22  jgs

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

  ViewVC Help
Powered by ViewVC 1.1.26