/[escript]/branches/domexper/dudley/src/Mesh_markNodes.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Mesh_markNodes.c

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

revision 471 by jgs, Fri Jan 27 01:33:02 2006 UTC revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC
# Line 1  Line 1 
1  /*  /*
2   ******************************************************************************   ************************************************************
3   *                                                                            *   *          Copyright 2006 by ACcESS MNRF                   *
4   *       COPYRIGHT  ACcESS 2003,2004,2005 -  All Rights Reserved              *   *                                                          *
5   *                                                                            *   *              http://www.access.edu.au                    *
6   * This software is the property of ACcESS. No part of this code              *   *       Primary Business: Queensland, Australia            *
7   * may be copied in any form or by any means without the expressed written    *   *  Licensed under the Open Software License version 3.0    *
8   * consent of ACcESS.  Copying, use or modification of this software          *   *     http://www.opensource.org/licenses/osl-3.0.php       *
9   * by any unauthorised person is illegal unless that person has a software    *   *                                                          *
10   * license agreement with ACcESS.                                             *   ************************************************************
  *                                                                            *  
  ******************************************************************************  
11  */  */
12    
13  /**************************************************************/  /**************************************************************/
# Line 35  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,startElement;
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        startElement = 0;
96      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);
97        startElement += in->Elements->numElements;
98      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);
99        startElement += in->FaceElements->numElements;
100      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);
101        startElement += in->ContactElements->numElements;
102      Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);
103    
104        startElement = 0;
105      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);
106        startElement += in->Elements->numElements;
107      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);
108        startElement += in->FaceElements->numElements;
109      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);
110        startElement += in->ContactElements->numElements;
111      Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);
112    
113      for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )
114        if( internalMask[i] && boundaryMask[i] )
115          mask[i] = 2;  /* boundary */
116        else if( internalMask[i] )
117          mask[i] = 1;  /* internal */
118        else if( boundaryMask[i] )
119          mask[i] = 3;  /* external */
120        else
121          mask[i] = -1; /* not referenced */
122    }
123    #endif
124    
125  /*  /*
126  * $Log$  * $Log$
127  * Revision 1.3  2005/09/15 03:44:22  jgs  * Revision 1.3  2005/09/15 03:44:22  jgs

Legend:
Removed from v.471  
changed lines
  Added in v.782

  ViewVC Help
Powered by ViewVC 1.1.26