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

Revision 616 - (show annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 6 months ago) by elspeth
File MIME type: text/plain
File size: 5106 byte(s)
```Copyright added to more source files.

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

## Properties

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