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

Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 9 months ago) by trankine
File MIME type: text/plain
File size: 20848 byte(s)
```And get the *(&(*&(* name right
```
 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_{k,i,m,j} u_m,j)_i-(B_{k,i,m} u_m)_i+C_{k,m,j} u_m,j-D_{k,m} u_m and -(X_{k,i})_i + Y_k */ 23 24 /* u has p.numComp components 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 = p.numEqu x 3 x p.numComp x 3 */ 30 /* B = 3 x p.numEqu x p.numComp */ 31 /* C = p.numEqu x 3 x p.numComp */ 32 /* D = p.numEqu x p.numComp */ 33 /* X = p.numEqu x 3 */ 34 /* Y = p.numEqu */ 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_System2_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,k,m; 59 register double rtmp, rtmp0, rtmp1, rtmp2, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22; 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*p.numEqu*p.numComp; 71 dim_t len_EM_F=p.row_NN*p.numEqu; 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,k,m,rtmp, rtmp0, rtmp1, rtmp2, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22,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)]]; 356 if (add_EM_F) Finley_Util_AddScatter(p.row_NN,row_index,p.numEqu,EM_F,F_p, p.row_DOF_UpperBound); 357 if (add_EM_S) Finley_Assemble_addToSystemMatrix(Mat,p.row_NN,row_index,p.numEqu,p.col_NN,row_index,p.numComp,EM_S); 358 359 } /* end color check */ 360 } /* end element loop */ 361 } /* end color loop */ 362 363 THREAD_MEMFREE(EM_S); 364 THREAD_MEMFREE(EM_F); 365 THREAD_MEMFREE(row_index); 366 367 } /* end of pointer check */ 368 } /* end parallel region */ 369 } 370 /* 371 * \$Log\$ 372 */

 ViewVC Help Powered by ViewVC 1.1.26