# Contents of /trunk/ripley/src/Assemble_PDE_Single_3D_reduced.c

Revision 3641 - (show annotations)
Thu Oct 27 02:16:12 2011 UTC (8 years, 1 month ago) by gross
File MIME type: text/plain
File size: 14943 byte(s)
```more work on the assemblage
```
 1 /******************************************************* 2 * 3 * Copyright (c) 2003-2010 by University of Queensland 4 * Earth Systems Science Computational Center (ESSCC) 5 * http://www.uq.edu.au/esscc 6 * 7 * Primary Business: Queensland, Australia 8 * Licensed under the Open Software License version 3.0 9 * http://www.opensource.org/licenses/osl-3.0.php 10 * 11 *******************************************************/ 12 /**************************************************************/ 13 /* */ 14 /* assembles single PDEs into the stiffness matrix S right hand side F */ 15 /* for coefficients on the reduced integration scheme */ 16 /* */ 17 /* -(A_{i,j} u=,j)_i-(B_{i} u)_i+C_{j} u,j-D u and -(X_{,i})_i + Y */ 18 /* */ 19 /* u is a scalar in a 3D domain. The shape functions for test and solution must be identical */ 20 /* */ 21 /* Shape of the coefficients: */ 22 /* A = DIM x DIM */ 23 /* B = DIM */ 24 /* C = DIM */ 25 /* D = scalar */ 26 /* X = DIM */ 27 /* Y = scalar */ 28 /* */ 29 /**************************************************************/ 30 #include "Assemble.h" 31 #include "Util.h" 32 #ifdef _OPENMP 33 #include 34 #endif 35 /**************************************************************/ 36 void Finley_Assemble_PDE_Single_3D_reduced(Finley_Assemble_Parameters p, 37 Finley_ElementFile* elements, 38 Paso_SystemMatrix* Mat, escriptDataC* F, 39 escriptDataC* A, escriptDataC* B, escriptDataC* C, escriptDataC* D, escriptDataC* X, escriptDataC* Y) { 40 #define DIM 3 41 index_t color; 42 dim_t e, isub; 43 __const double *A_p, *B_p, *C_p, *D_p, *X_p, *Y_p, *A_q, *B_q, *C_q, *D_q, *X_q, *Y_q; 44 double *EM_S, *EM_F, *Vol, *DSDX; 45 index_t *row_index; 46 register dim_t q, s,r,k,m; 47 register double rtmp, rtmp0, rtmp1, rtmp2, rtmp00, rtmp01, rtmp02, rtmp10, rtmp11, rtmp12, rtmp20, rtmp21, rtmp22; 48 bool_t add_EM_F, add_EM_S; 49 bool_t extendedA=isExpanded(A); 50 bool_t extendedB=isExpanded(B); 51 bool_t extendedC=isExpanded(C); 52 bool_t extendedD=isExpanded(D); 53 bool_t extendedX=isExpanded(X); 54 bool_t extendedY=isExpanded(Y); 55 double *F_p=(requireWrite(F), getSampleDataRW(F,0)); /* use comma, to get around the mixed code and declarations thing */ 56 dim_t len_EM_S=p.row_numShapesTotal*p.col_numShapesTotal*p.numEqu*p.numComp; 57 dim_t len_EM_F=p.row_numShapesTotal*p.numEqu; 58 { 59 /* GENERATOR SNIP_PRE TOP */ 60 const double w12 = -0.5*h0; 61 const double w2 = -0.25000000000000000000; 62 const double w1 = 0.25000000000000000000; 63 const double w0 = -0.25*h1/h0; 64 const double w15 = 0.25*h0*h1; 65 const double w7 = -0.125*h0; 66 const double w9 = 0.125*h0; 67 const double w14 = 0.5*h0; 68 const double w11 = -0.5*h1; 69 const double w4 = -0.25*h0/h1; 70 const double w10 = 0.0625*h0*h1; 71 const double w13 = 0.5*h1; 72 const double w8 = 0.125*h1; 73 const double w6 = -0.125*h1; 74 const double w3 = 0.25*h0/h1; 75 const double w5 = 0.25*h1/h0; 76 /* GENERATOR SNIP_PRE BOTTOM */ 77 #pragma omp parallel private(EM_S, EM_F,k2_0, k0, k1, k2, *A_p, *B_p, *C_p, *D_p, *X_p, *Y_p) 78 { 79 EM_S=THREAD_MEMALLOC(len_EM_S,double); 80 EM_F=THREAD_MEMALLOC(len_EM_F,double); 81 if (!Finley_checkPtr(EM_S) && !Finley_checkPtr(EM_F) && !Finley_checkPtr(row_index) ) { 82 for (k2_0 = 0; k2_0 <2; k2_0++) { /* coloring */ 83 #pragma omp parallel for private(i2, i1,i0) 84 for (k2 = k2_0; k2< N0; k2=k2+2) { 85 for (k1 = 0; k1< N1; ++k1) { 86 for (k0 = 0; k0< N0; ++k0) { 87 bool_t add_EM_F=FALSE; 88 bool_t add_EM_S=FALSE; 89 index_t e = k0 + M0 * k1 + M0*M1 * k2; 90 A_p=getSampleDataRO(A,e); 91 B_p=getSampleDataRO(B,e); 92 C_p=getSampleDataRO(C,e); 93 D_p=getSampleDataRO(D,e); 94 X_p=getSampleDataRO(X,e); 95 Y_p=getSampleDataRO(Y,e); 96 for (q=0;q

 ViewVC Help Powered by ViewVC 1.1.26