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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 616 - (show annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 5 months ago) by elspeth
File MIME type: text/plain
File size: 4074 byte(s)
Copyright added to more source files.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26