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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years, 3 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Assemble_RHSMatrix_Single.c
File MIME type: text/plain
File size: 2577 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_i)_i + Y */
12
13 /* Shape of the coefficients: */
14
15 /* X = numDim */
16 /* Y = 1 */
17
18 /**************************************************************/
19
20 /* Copyrights by ACcESS Australia, 2003 */
21 /* author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "Common.h"
27
28 /**************************************************************/
29
30 void Finley_Assemble_RHSMatrix_Single(int NS,int numDim,int numQuad,
31 double* S,double* DSDX,double* Vol,
32 int NN, double* EM_F,
33 double* X, int extendedX,
34 double* Y, int extendedY) {
35 int s,q,i;
36 double rtmp;
37
38 for (s=0;s<NS;s++) {
39 /**************************************************************/
40 /* process X: */
41 /**************************************************************/
42 if (NULL!=X) {
43 if (extendedX) {
44 for (i=0;i<numDim;i++) {
45 for (q=0;q<numQuad;q++) {
46 EM_F[INDEX2(0,s,1)]+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)]*X[INDEX2(i,q,numDim)];
47 }
48 }
49 } else {
50 for (i=0;i<numDim;i++) {
51 if (X[i]!=0.) {
52 rtmp=0;
53 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)];
54 EM_F[INDEX2(0,s,1)]+=rtmp*X[i];
55 }
56 }
57 }
58 }
59 /**************************************************************/
60 /* process Y: */
61 /**************************************************************/
62 if (NULL!=Y) {
63 if (extendedY) {
64 for (q=0;q<numQuad;q++) EM_F[INDEX2(0,s,1)]+=Vol[q]*S[INDEX2(s,q,NS)]*Y[q];
65 } else {
66 if (Y[0]!=0.) {
67 rtmp=0;
68 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*S[INDEX2(s,q,NS)];
69 EM_F[INDEX2(0,s,1)]+=rtmp*Y[0];
70 }
71 }
72 }
73 }
74 }
75
76 /*
77 * $Log$
78 * Revision 1.1 2004/10/26 06:53:57 jgs
79 * Initial revision
80 *
81 * Revision 1.2 2004/07/30 04:37:06 gross
82 * escript and finley are linking now and RecMeshTest.py has been passed
83 *
84 * Revision 1.1 2004/07/02 04:21:13 gross
85 * Finley C code has been included
86 *
87 *
88 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26