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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (show annotations)
Fri Jul 8 04:08:13 2005 UTC (15 years ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Assemble_RHSMatrix_Single.c
File MIME type: text/plain
File size: 2822 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_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(dim_t NS,dim_t numDim,dim_t numQuad,
31 double* S,double* DSDX,double* Vol,
32 dim_t NN, double* EM_F,
33 double* X, bool_t extendedX,
34 double* Y, bool_t extendedY) {
35 dim_t 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.2 2005/07/08 04:07:46 jgs
79 * Merge of development branch back to main trunk on 2005-07-08
80 *
81 * Revision 1.1.1.1.2.1 2005/06/29 02:34:47 gross
82 * some changes towards 64 integers in finley
83 *
84 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
85 * initial import of project esys2
86 *
87 * Revision 1.2 2004/07/30 04:37:06 gross
88 * escript and finley are linking now and RecMeshTest.py has been passed
89 *
90 * Revision 1.1 2004/07/02 04:21:13 gross
91 * Finley C code has been included
92 *
93 *
94 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26