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

Revision 1387 - (show annotations)
Fri Jan 11 07:45:26 2008 UTC (12 years, 2 months ago) by trankine
Original Path: temp/finley/src/Assemble_PDE_Single2_3D.c
File MIME type: text/plain
File size: 17300 byte(s)
```Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
```
 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 /* assembles the system of numEq PDEs into the stiffness matrix S right hand side F */ 19 /* the shape functions for test and solution must be identical */ 20 21 22 /* -(A_{i,j} u_,j)_i-(B_{i} u)_i+C_{j} u_,j-D u_m and -(X_,i)_i + Y */ 23 24 /* in a 3D domain. The shape functions for test and solution must be identical */ 25 /* and row_NS == row_NN */ 26 27 /* Shape of the coefficients: */ 28 29 /* A = 3 x 3 */ 30 /* B = 3 */ 31 /* C = 3 */ 32 /* D = scalar */ 33 /* X = 3 */ 34 /* Y = scalar */ 35 36 37 /**************************************************************/ 38 39 40 #include "Assemble.h" 41 #include "Util.h" 42 #ifdef _OPENMP 43 #include 44 #endif 45 46 47 /**************************************************************/ 48 49 void Finley_Assemble_PDE_Single2_3D(Assemble_Parameters p, Finley_ElementFile* elements, 50 Paso_SystemMatrix* Mat, escriptDataC* F, 51 escriptDataC* A, escriptDataC* B, escriptDataC* C, escriptDataC* D, escriptDataC* X, escriptDataC* Y) { 52 53 #define DIM 3 54 index_t color; 55 dim_t e; 56 double *EM_S, *EM_F, *Vol, *DSDX, *A_p, *B_p, *C_p, *D_p, *X_p, *Y_p; 57 index_t *row_index; 58 register dim_t q, s,r; 59 register double rtmp, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22, rtmp0, rtmp1, rtmp2; 60 bool_t add_EM_F, add_EM_S; 61 62 bool_t extendedA=isExpanded(A); 63 bool_t extendedB=isExpanded(B); 64 bool_t extendedC=isExpanded(C); 65 bool_t extendedD=isExpanded(D); 66 bool_t extendedX=isExpanded(X); 67 bool_t extendedY=isExpanded(Y); 68 double *F_p=getSampleData(F,0); 69 double *S=p.row_jac->ReferenceElement->S; 70 dim_t len_EM_S=p.row_NN*p.col_NN; 71 dim_t len_EM_F=p.row_NN; 72 73 74 #pragma omp parallel private(color,EM_S, EM_F, Vol, DSDX, A_p, B_p, C_p, D_p, X_p, Y_p,row_index,q, s,r,rtmp, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22, rtmp0, rtmp1, rtmp2,add_EM_F, add_EM_S) 75 { 76 EM_S=THREAD_MEMALLOC(len_EM_S,double); 77 EM_F=THREAD_MEMALLOC(len_EM_F,double); 78 row_index=THREAD_MEMALLOC(p.row_NN,index_t); 79 80 if (!Finley_checkPtr(EM_S) && !Finley_checkPtr(EM_F) && !Finley_checkPtr(row_index) ) { 81 82 for (color=elements->minColor;color<=elements->maxColor;color++) { 83 /* open loop over all elements: */ 84 #pragma omp for private(e) schedule(static) 85 for(e=0;enumElements;e++){ 86 if (elements->Color[e]==color) { 87 Vol=&(p.row_jac->volume[INDEX2(0,e,p.numQuad)]); 88 DSDX=&(p.row_jac->DSDX[INDEX4(0,0,0,e,p.row_NN,DIM,p.numQuad)]); 89 for (q=0;qNodes[INDEX2(p.row_node[q],e,p.NN)]]; 309 if (add_EM_F) Finley_Util_AddScatter(p.row_NN,row_index,p.numEqu,EM_F,F_p, p.row_DOF_UpperBound); 310 if (add_EM_S) Finley_Assemble_addToSystemMatrix(Mat,p.row_NN,row_index,p.numEqu,p.col_NN,row_index,p.numComp,EM_S); 311 312 } /* end color check */ 313 } /* end element loop */ 314 } /* end color loop */ 315 316 THREAD_MEMFREE(EM_S); 317 THREAD_MEMFREE(EM_F); 318 THREAD_MEMFREE(row_index); 319 320 } /* end of pointer check */ 321 } /* end parallel region */ 322 } 323 /* 324 * \$Log\$ 325 */

 ViewVC Help Powered by ViewVC 1.1.26