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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (14 years, 3 months ago) by jgs
Original Path: trunk/finley/src/finleyC/Assemble_RHSMatrix_System.c
File MIME type: text/plain
File size: 4396 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 jgs 150 /*
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 jgs 82
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 jgs 150 /* Author: gross@access.edu.au */
34     /* Version: $Id$ */
35 jgs 82
36     /**************************************************************/
37    
38 jgs 150 #include "Assemble.h"
39 jgs 82
40     /**************************************************************/
41    
42 jgs 123 void Finley_Assemble_RHSMatrix_System(dim_t NS,dim_t numDim,dim_t numQuad,dim_t numEqu,
43 jgs 82 double* S,double* DSDX,double* Vol,
44 jgs 123 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 jgs 82 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 jgs 150 * 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 jgs 123 * Revision 1.2 2005/07/08 04:07:46 jgs
103     * Merge of development branch back to main trunk on 2005-07-08
104 jgs 82 *
105 jgs 123 * 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 jgs 82 * 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