/[escript]/trunk/finley/src/finley/Assemble_RHSMatrix_System.c
ViewVC logotype

Contents of /trunk/finley/src/finley/Assemble_RHSMatrix_System.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (show annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Assemble_RHSMatrix_System.c
File MIME type: text/plain
File size: 3328 byte(s)
Merge of development branch back to main trunk on 2005-07-08

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Updates the element matrices: */
6
7 /* assembles the system of numEq components right hand side F */
8
9 /* -div X + Y */
10
11 /* -(X_{k,i})_i + Y_k */
12
13 /* Shape of the coefficients: */
14
15 /* X = numEqu x numDim */
16 /* Y = numEqu */
17
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia, 2003 */
22 /* author: gross@access.edu.au */
23 /* Version: $Id$ */
24
25 /**************************************************************/
26
27 #include "Common.h"
28
29 /**************************************************************/
30
31 void Finley_Assemble_RHSMatrix_System(dim_t NS,dim_t numDim,dim_t numQuad,dim_t numEqu,
32 double* S,double* DSDX,double* Vol,
33 dim_t NN, double* EM_F,
34 double* X, bool_t extendedX,
35 double* Y, bool_t extendedY) {
36 dim_t s,k,q,i;
37 double rtmp;
38
39 /**************************************************************/
40 /* process X: */
41 /**************************************************************/
42 if (NULL!=X) {
43 if (extendedX) {
44 for (s=0;s<NS;s++) {
45 for (k=0;k<numEqu;k++) {
46 for (i=0;i<numDim;i++) {
47 for (q=0;q<numQuad;q++) {
48 EM_F[INDEX2(k,s,numEqu)]+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)]*X[INDEX3(k,i,q,numEqu,numDim)];
49 }
50 }
51 }
52 }
53 } else {
54 for (s=0;s<NS;s++) {
55 for (i=0;i<numDim;i++) {
56 rtmp=0;
57 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)];
58 for (k=0;k<numEqu;k++) EM_F[INDEX2(k,s,numEqu)]+=rtmp*X[INDEX2(k,i,numEqu)];
59 }
60 }
61 }
62 }
63 /**************************************************************/
64 /* process Y: */
65 /**************************************************************/
66 if (NULL!=Y) {
67 if (extendedY) {
68 for (s=0;s<NS;s++) {
69 for (k=0;k<numEqu;k++) {
70 for (q=0;q<numQuad;q++) EM_F[INDEX2(k,s,numEqu)]+=Vol[q]*S[INDEX2(s,q,NS)]*Y[INDEX2(k,q,numEqu)];
71 }
72 }
73 } else {
74 for (s=0;s<NS;s++) {
75 rtmp=0;
76 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*S[INDEX2(s,q,NS)];
77 for (k=0;k<numEqu;k++) EM_F[INDEX2(k,s,numEqu)]+=rtmp*Y[k];
78 }
79 }
80 }
81 }
82
83 /*
84 * $Log$
85 * Revision 1.2 2005/07/08 04:07:46 jgs
86 * Merge of development branch back to main trunk on 2005-07-08
87 *
88 * Revision 1.1.1.1.2.1 2005/06/29 02:34:47 gross
89 * some changes towards 64 integers in finley
90 *
91 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
92 * initial import of project esys2
93 *
94 * Revision 1.2 2004/07/30 04:37:06 gross
95 * escript and finley are linking now and RecMeshTest.py has been passed
96 *
97 * Revision 1.1 2004/07/02 04:21:13 gross
98 * Finley C code has been included
99 *
100 *
101 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26