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

Revision 798 - (show annotations)
Fri Aug 4 01:05:36 2006 UTC (14 years ago) by gross
Original Path: trunk/finley/src/Assemble_PDE_System2_3D.c
File MIME type: text/plain
File size: 19623 byte(s)
```Reimplementation of the assemblage with persistent jacobeans.
There are also a few changes to the tests which has now
dramatically reduced the memory demand.

```
 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 /* assembles the system of numEq PDEs into the stiffness matrix S right hand side F */ 16 /* the shape functions for test and solution must be identical */ 17 18 19 /* -(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 */ 20 21 /* u has p.numComp components in a 3D domain. The shape functions for test and solution must be identical */ 22 /* and row_NS == row_NN */ 23 24 /* Shape of the coefficients: */ 25 26 /* A = p.numEqu x 3 x p.numComp x 3 */ 27 /* B = 3 x p.numEqu x p.numComp */ 28 /* C = p.numEqu x 3 x p.numComp */ 29 /* D = p.numEqu x p.numComp */ 30 /* X = p.numEqu x 3 */ 31 /* Y = p.numEqu */ 32 33 34 /**************************************************************/ 35 36 /* Author: gross@access.edu.au */ 37 /* Version: \$Id:\$ */ 38 39 /**************************************************************/ 40 41 42 #include "Assemble.h" 43 #include "Util.h" 44 45 /**************************************************************/ 46 47 void Finley_Assemble_PDE_System2_3D(Assemble_Parameters p, Finley_ElementFile* elements, 48 Paso_SystemMatrix* Mat, escriptDataC* F, 49 escriptDataC* A, escriptDataC* B, escriptDataC* C, escriptDataC* D, escriptDataC* X, escriptDataC* Y) { 50 51 #define DIM 3 52 index_t color; 53 dim_t e; 54 bool_t extendedA=isExpanded(A); 55 bool_t extendedB=isExpanded(B); 56 bool_t extendedC=isExpanded(C); 57 bool_t extendedD=isExpanded(D); 58 bool_t extendedX=isExpanded(X); 59 bool_t extendedY=isExpanded(Y); 60 double *F_p=getSampleData(F,0); 61 double *S=p.row_jac->ReferenceElement->S; 62 dim_t len_EM_S=p.row_NN*p.col_NN*p.numEqu*p.numComp; 63 dim_t len_EM_F=p.row_NN*p.numEqu; 64 65 66 #pragma omp parallel private(color) 67 { 68 double EM_S[len_EM_S], EM_F[len_EM_F]; 69 index_t row_index[p.row_NN]; 70 register dim_t q, s,r,k,m; 71 register double rtmp, rtmp0, rtmp1, rtmp2, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22; 72 double *Vol, *DSDX, *A_p, *B_p, *C_p, *D_p, *X_p, *Y_p; 73 bool_t add_EM_F, add_EM_S; 74 75 #ifndef PASO_MPI 76 for (color=elements->minColor;color<=elements->maxColor;color++) { 77 /* open loop over all elements: */ 78 #pragma omp for private(e) schedule(static) 79 for(e=0;enumElements;e++){ 80 if (elements->Color[e]==color) { 81 #else 82 { 83 for(e=0;enumElements;e++) { 84 { 85 #endif 86 Vol=&(p.row_jac->volume[INDEX2(0,e,p.numQuad)]); 87 DSDX=&(p.row_jac->DSDX[INDEX4(0,0,0,e,p.row_NN,DIM,p.numQuad)]); 88 for (q=0;qNodes[INDEX2(p.row_node[q],e,p.NN)]]; 355 if (add_EM_F) Finley_Util_AddScatter(p.row_NN,row_index,p.numEqu,EM_F,F_p, p.row_DOF_UpperBound); 356 if (add_EM_S) Finley_Assemble_addToSystemMatrix(Mat,p.row_NN,row_index,p.numEqu,p.col_NN,row_index,p.numComp,EM_S); 357 358 } /* end color check */ 359 } /* end element loop */ 360 } /* end color loop */ 361 } /* end parallel region */ 362 } 363 /* 364 * \$Log\$ 365 */

 ViewVC Help Powered by ViewVC 1.1.26