/[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 201 - (show annotations)
Wed Nov 23 04:10:21 2005 UTC (13 years, 10 months ago) by jgs
File MIME type: text/plain
File size: 4396 byte(s)
copy finleyC and CPPAdapter to finley and finley/CPPAdapter to
facilitate scons builds

1 /*
2 ******************************************************************************
3 * *
4 * COPYRIGHT ACcESS 2003,2004,2005 - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 ******************************************************************************
13 */
14
15 /**************************************************************/
16
17 /* Updates the element matrices: */
18
19 /* assembles the system of numEq components right hand side F */
20
21 /* -div X + Y */
22
23 /* -(X_{k,i})_i + Y_k */
24
25 /* Shape of the coefficients: */
26
27 /* X = numEqu x numDim */
28 /* Y = numEqu */
29
30
31 /**************************************************************/
32
33 /* Author: gross@access.edu.au */
34 /* Version: $Id$ */
35
36 /**************************************************************/
37
38 #include "Assemble.h"
39
40 /**************************************************************/
41
42 void Finley_Assemble_RHSMatrix_System(dim_t NS,dim_t numDim,dim_t numQuad,dim_t numEqu,
43 double* S,double* DSDX,double* Vol,
44 dim_t NN, double* EM_F,
45 double* X, bool_t extendedX,
46 double* Y, bool_t extendedY) {
47 dim_t s,k,q,i;
48 double rtmp;
49
50 /**************************************************************/
51 /* process X: */
52 /**************************************************************/
53 if (NULL!=X) {
54 if (extendedX) {
55 for (s=0;s<NS;s++) {
56 for (k=0;k<numEqu;k++) {
57 for (i=0;i<numDim;i++) {
58 for (q=0;q<numQuad;q++) {
59 EM_F[INDEX2(k,s,numEqu)]+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)]*X[INDEX3(k,i,q,numEqu,numDim)];
60 }
61 }
62 }
63 }
64 } else {
65 for (s=0;s<NS;s++) {
66 for (i=0;i<numDim;i++) {
67 rtmp=0;
68 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)];
69 for (k=0;k<numEqu;k++) EM_F[INDEX2(k,s,numEqu)]+=rtmp*X[INDEX2(k,i,numEqu)];
70 }
71 }
72 }
73 }
74 /**************************************************************/
75 /* process Y: */
76 /**************************************************************/
77 if (NULL!=Y) {
78 if (extendedY) {
79 for (s=0;s<NS;s++) {
80 for (k=0;k<numEqu;k++) {
81 for (q=0;q<numQuad;q++) EM_F[INDEX2(k,s,numEqu)]+=Vol[q]*S[INDEX2(s,q,NS)]*Y[INDEX2(k,q,numEqu)];
82 }
83 }
84 } else {
85 for (s=0;s<NS;s++) {
86 rtmp=0;
87 for (q=0;q<numQuad;q++) rtmp+=Vol[q]*S[INDEX2(s,q,NS)];
88 for (k=0;k<numEqu;k++) EM_F[INDEX2(k,s,numEqu)]+=rtmp*Y[k];
89 }
90 }
91 }
92 }
93
94 /*
95 * $Log$
96 * Revision 1.3 2005/09/15 03:44:21 jgs
97 * Merge of development branch dev-02 back to main trunk on 2005-09-15
98 *
99 * Revision 1.2.2.1 2005/09/07 06:26:17 gross
100 * the solver from finley are put into the standalone package paso now
101 *
102 * Revision 1.2 2005/07/08 04:07:46 jgs
103 * Merge of development branch back to main trunk on 2005-07-08
104 *
105 * Revision 1.1.1.1.2.1 2005/06/29 02:34:47 gross
106 * some changes towards 64 integers in finley
107 *
108 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
109 * initial import of project esys2
110 *
111 * Revision 1.2 2004/07/30 04:37:06 gross
112 * escript and finley are linking now and RecMeshTest.py has been passed
113 *
114 * Revision 1.1 2004/07/02 04:21:13 gross
115 * Finley C code has been included
116 *
117 *
118 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26