# Contents of /trunk/finley/src/Assemble_getSize.c

Revision 1384 - (show annotations)
Fri Jan 11 02:29:38 2008 UTC (11 years, 9 months ago) by phornby
Original Path: temp_trunk_copy/finley/src/Assemble_getSize.c
File MIME type: text/plain
File size: 5020 byte(s)
```Make a temp copy of the trunk before checking in the windows changes

```
 1 2 /* \$Id\$ */ 3 4 /******************************************************* 5 * 6 * Copyright 2003-2007 by ACceSS MNRF 7 * Copyright 2007 by University of Queensland 8 * 9 * http://esscc.uq.edu.au 10 * Primary Business: Queensland, Australia 11 * Licensed under the Open Software License version 3.0 12 * http://www.opensource.org/licenses/osl-3.0.php 13 * 14 *******************************************************/ 15 16 /**************************************************************/ 17 18 /* assemblage routines: */ 19 20 /* calculates the minimum distance between two vertices of elements and assigns the value to each */ 21 /* quadrature point in element_size */ 22 23 24 /**************************************************************/ 25 26 #include "Assemble.h" 27 #include "Util.h" 28 #ifdef _OPENMP 29 #include 30 #endif 31 32 /**************************************************************/ 33 void Finley_Assemble_getSize(Finley_NodeFile* nodes, Finley_ElementFile* elements, escriptDataC* element_size) { 34 35 double *local_X=NULL,*element_size_array; 36 dim_t e,n0,n1,q,i, NVertices, NN, NS, numQuad, numDim; 37 index_t node_offset; 38 double d,diff,min_diff; 39 Finley_resetError(); 40 41 if (nodes==NULL || elements==NULL) return; 42 NVertices=elements->ReferenceElement->Type->numVertices; 43 NN=elements->ReferenceElement->Type->numNodes; 44 NS=elements->ReferenceElement->Type->numShapes; 45 numDim=nodes->numDim; 46 47 if (Finley_Assemble_reducedIntegrationOrder(element_size)) { 48 numQuad=elements->ReferenceElementReducedOrder->numQuadNodes; 49 } else { 50 numQuad=elements->ReferenceElement->numQuadNodes; 51 } 52 53 /* set a few more parameters */ 54 55 if (getFunctionSpaceType(element_size)==FINLEY_CONTACT_ELEMENTS_2) { 56 node_offset=NN-NS; 57 } else { 58 node_offset=0; 59 } 60 61 /* check the dimensions of element_size */ 62 63 if (numDim!=elements->ReferenceElement->Type->numDim) { 64 Finley_setError(TYPE_ERROR,"Finley_Assemble_getSize: Gradient: Spatial and element dimension must match."); 65 } else if (! numSamplesEqual(element_size,numQuad,elements->numElements)) { 66 Finley_setError(TYPE_ERROR,"Finley_Assemble_getSize: illegal number of samples of element size Data object"); 67 } else if (! isDataPointShapeEqual(element_size,0,&(numDim))) { 68 Finley_setError(TYPE_ERROR,"Finley_Assemble_getSize: illegal data point shape of element size Data object"); 69 } else if (!isExpanded(element_size)) { 70 Finley_setError(TYPE_ERROR,"Finley_Assemble_getSize: expanded Data object is expected for element size."); 71 } 72 /* now we can start: */ 73 74 if (Finley_noError()) { 75 #pragma omp parallel private(local_X) 76 { 77 /* allocation of work arrays */ 78 local_X=THREAD_MEMALLOC(NN*numDim,double); 79 if (! Finley_checkPtr(local_X) ) { 80 /* open the element loop */ 81 #pragma omp for private(e,min_diff,diff,n0,n1,d,q,i,element_size_array) schedule(static) 82 for(e=0;enumElements;e++) { 83 /* gather local coordinates of nodes into local_X(numDim,NN): */ 84 Finley_Util_Gather_double(NS,&(elements->Nodes[INDEX2(node_offset,e,NN)]),numDim,nodes->Coordinates,local_X); 85 /* calculate minimal differences */ 86 min_diff=-1; 87 for (n0=0;n01 still needs some testing 128 * 129 * Revision 1.1.1.1.2.1 2004/11/24 01:37:12 gross 130 * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now 131 * 132 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs 133 * initial import of project esys2 134 * 135 * Revision 1.3 2004/07/30 04:37:06 gross 136 * escript and finley are linking now and RecMeshTest.py has been passed 137 * 138 * Revision 1.2 2004/07/21 05:00:54 gross 139 * name changes in DataC 140 * 141 * Revision 1.1 2004/07/02 04:21:13 gross 142 * Finley C code has been included 143 * 144 * 145 */

## Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision