/[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/finley/src/Mesh_markNodes.c revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC branches/domexper/dudley/src/Mesh_markNodes.c revision 3126 by jfenwick, Wed Sep 1 00:37:53 2010 UTC
# Line 1  Line 1 
 /*  
  ************************************************************  
  *          Copyright 2006 by ACcESS MNRF                   *  
  *                                                          *  
  *              http://www.access.edu.au                    *  
  *       Primary Business: Queensland, Australia            *  
  *  Licensed under the Open Software License version 3.0    *  
  *     http://www.opensource.org/licenses/osl-3.0.php       *  
  *                                                          *  
  ************************************************************  
 */  
1    
2  /**************************************************************/  /*******************************************************
3    *
4  /*   Finley: Mesh */  * Copyright (c) 2003-2010 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
12    *******************************************************/
13    
 /*   mark the used nodes with offeset: */  
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /*  Author: gross@access.edu.au */  /*   Dudley: Mesh */
18  /*  Version: $Id$ */  
19    /*   mark the used nodes with offeset: */
20    
21  /**************************************************************/  /**************************************************************/
22    
# Line 27  Line 24 
24    
25  /**************************************************************/  /**************************************************************/
26    
27  void Finley_Mesh_markNodes(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear) {  void Dudley_Mesh_markNodes(index_t* mask,index_t offset,Dudley_Mesh* in,bool_t useLinear) {
28            Finley_ElementFile_markNodes(mask,offset,in->Elements,useLinear);            Dudley_ElementFile_markNodes(mask,offset,in->Nodes->numNodes,in->Elements,useLinear);
29            Finley_ElementFile_markNodes(mask,offset,in->FaceElements,useLinear);            Dudley_ElementFile_markNodes(mask,offset,in->Nodes->numNodes,in->FaceElements,useLinear);
30            Finley_ElementFile_markNodes(mask,offset,in->ContactElements,useLinear);            Dudley_ElementFile_markNodes(mask,offset,in->Nodes->numNodes,in->Points,useLinear);
           Finley_ElementFile_markNodes(mask,offset,in->Points,useLinear);  
31  }  }
32    
33  #ifdef PASO_MPI  void Dudley_Mesh_markDOFsConnectedToRange(index_t* mask, index_t offset, index_t marker,
34                                              index_t firstDOF,index_t lastDOF,Dudley_Mesh* in, bool_t useLinear)
 /* assumes that mask has length in->Nodes->numNodes  
    hence, it assumes that nodes are dense and offset==0  
    offset must ==0  
    assumes mask[i]==-1, i=0:in->Nodes->numNodes  
     */  
 void Finley_Mesh_markOrderedNodesLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)  
35  {  {
36    index_t *internalMask=NULL, *boundaryMask=NULL, i;     index_t *dofIndex;
37       if (useLinear) {
38    if( offset )         dofIndex=in->Nodes->globalReducedDOFIndex;
39    {     } else {
40      Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");         dofIndex=in->Nodes->globalDegreesOfFreedom;
41      return;     }
42    }     Dudley_ElementFile_markDOFsConnectedToRange(mask,offset,marker,firstDOF,lastDOF,dofIndex,in->Elements,useLinear);
43       Dudley_ElementFile_markDOFsConnectedToRange(mask,offset,marker,firstDOF,lastDOF,dofIndex,in->FaceElements,useLinear);
44    internalMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );     Dudley_ElementFile_markDOFsConnectedToRange(mask,offset,marker,firstDOF,lastDOF,dofIndex,in->Points,useLinear);
   boundaryMask = TMPMEMALLOC( in->Nodes->numNodes, index_t );  
   for( i=0; i<in->Nodes->numNodes; i++ )  
     internalMask[i] = boundaryMask[i] = 0;  
   
   Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Elements,useLinear);  
   Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->FaceElements,useLinear);  
   Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->ContactElements,useLinear);  
   Finley_ElementFile_markInternalElementNodes(internalMask,offset,in->Points,useLinear);  
   
   Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Elements,useLinear);  
   Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->FaceElements,useLinear);  
   Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->ContactElements,useLinear);  
   Finley_ElementFile_markBoundaryElementNodes(boundaryMask,offset,in->Points,useLinear);  
   
   for( i=0; i<in->Nodes->numNodes; i++ )  
     if( internalMask[i] && boundaryMask[i] )  
       mask[i] = 2;  /* boundary */  
     else if( internalMask[i] )  
       mask[i] = 1;  /* internal */  
     else if( boundaryMask[i] )  
       mask[i] = 3;  /* external */  
     else  
       mask[i] = -1; /* not referenced */  
45  }  }
   
 void Finley_Mesh_markOrderedDegreesOfFreedomLocation(index_t* mask,index_t offset,Finley_Mesh* in,bool_t useLinear)  
 {  
   index_t *internalMask=NULL, *boundaryMask=NULL, i,startElement;  
   
   if( offset )  
   {  
     Finley_setError(VALUE_ERROR, "Finley_Mesh_markNodesExternal() : yet to implement offest!=0");  
     return;  
   }  
   
   internalMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );  
   boundaryMask = TMPMEMALLOC( in->Nodes->numDegreesOfFreedom, index_t );  
   for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )  
     internalMask[i] = boundaryMask[i] = 0;  
   
     startElement = 0;  
   Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);  
     startElement += in->Elements->numElements;  
   Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);  
     startElement += in->FaceElements->numElements;  
   Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);  
     startElement += in->ContactElements->numElements;  
   Finley_ElementFile_markInternalElementDOF(internalMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);  
   
     startElement = 0;  
   Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Elements,useLinear,startElement);  
     startElement += in->Elements->numElements;  
   Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->FaceElements,useLinear,startElement);  
     startElement += in->FaceElements->numElements;  
   Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->ContactElements,useLinear,startElement);  
     startElement += in->ContactElements->numElements;  
   Finley_ElementFile_markBoundaryElementDOF(boundaryMask,offset,in->Nodes->degreeOfFreedom,in->Points,useLinear,startElement);  
   
   for( i=0; i<in->Nodes->numDegreesOfFreedom; i++ )  
     if( internalMask[i] && boundaryMask[i] )  
       mask[i] = 2;  /* boundary */  
     else if( internalMask[i] )  
       mask[i] = 1;  /* internal */  
     else if( boundaryMask[i] )  
       mask[i] = 3;  /* external */  
     else  
       mask[i] = -1; /* not referenced */  
 }  
 #endif  
   
 /*  
 * $Log$  
 * Revision 1.3  2005/09/15 03:44:22  jgs  
 * Merge of development branch dev-02 back to main trunk on 2005-09-15  
 *  
 * Revision 1.2.2.1  2005/09/07 06:26:19  gross  
 * the solver from finley are put into the standalone package paso now  
 *  
 * Revision 1.2  2005/07/08 04:07:53  jgs  
 * Merge of development branch back to main trunk on 2005-07-08  
 *  
 * Revision 1.1.1.1.2.1  2005/06/29 02:34:52  gross  
 * some changes towards 64 integers in finley  
 *  
 * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
 * initial import of project esys2  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
 *  
 *  
 */  
   

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

  ViewVC Help
Powered by ViewVC 1.1.26