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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years ago) by jgs
File MIME type: text/plain
File size: 3081 byte(s)
Initial revision

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(int NS,int numDim,int numQuad,int numEqu,
32 double* S,double* DSDX,double* Vol,
33 int NN, double* EM_F,
34 double* X, int extendedX,
35 double* Y, int extendedY) {
36 int 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.1 2004/10/26 06:53:57 jgs
86 * Initial revision
87 *
88 * Revision 1.2 2004/07/30 04:37:06 gross
89 * escript and finley are linking now and RecMeshTest.py has been passed
90 *
91 * Revision 1.1 2004/07/02 04:21:13 gross
92 * Finley C code has been included
93 *
94 *
95 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26