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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 jgs 150 /*
2 elspeth 616 ************************************************************
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 jgs 150 */
12 jgs 82
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_i)_i + Y */
22    
23     /* Shape of the coefficients: */
24    
25     /* X = numDim */
26     /* Y = 1 */
27    
28     /**************************************************************/
29    
30 jgs 150 /* Author: gross@access.edu.au */
31     /* Version: $Id$ */
32 jgs 82
33     /**************************************************************/
34    
35 jgs 150 #include "Assemble.h"
36 jgs 82
37     /**************************************************************/
38    
39 jgs 123 void Finley_Assemble_RHSMatrix_Single(dim_t NS,dim_t numDim,dim_t numQuad,
40 jgs 82 double* S,double* DSDX,double* Vol,
41 jgs 123 dim_t NN, double* EM_F,
42     double* X, bool_t extendedX,
43     double* Y, bool_t extendedY) {
44     dim_t s,q,i;
45 jgs 82 double rtmp;
46    
47     for (s=0;s<NS;s++) {
48     /**************************************************************/
49     /* process X: */
50     /**************************************************************/
51     if (NULL!=X) {
52     if (extendedX) {
53     for (i=0;i<numDim;i++) {
54     for (q=0;q<numQuad;q++) {
55     EM_F[INDEX2(0,s,1)]+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)]*X[INDEX2(i,q,numDim)];
56     }
57     }
58     } else {
59     for (i=0;i<numDim;i++) {
60     if (X[i]!=0.) {
61     rtmp=0;
62     for (q=0;q<numQuad;q++) rtmp+=Vol[q]*DSDX[INDEX3(s,i,q,NS,numDim)];
63     EM_F[INDEX2(0,s,1)]+=rtmp*X[i];
64     }
65     }
66     }
67     }
68     /**************************************************************/
69     /* process Y: */
70     /**************************************************************/
71     if (NULL!=Y) {
72     if (extendedY) {
73     for (q=0;q<numQuad;q++) EM_F[INDEX2(0,s,1)]+=Vol[q]*S[INDEX2(s,q,NS)]*Y[q];
74     } else {
75     if (Y[0]!=0.) {
76     rtmp=0;
77     for (q=0;q<numQuad;q++) rtmp+=Vol[q]*S[INDEX2(s,q,NS)];
78     EM_F[INDEX2(0,s,1)]+=rtmp*Y[0];
79     }
80     }
81     }
82     }
83     }
84    
85     /*
86     * $Log$
87 jgs 150 * Revision 1.3 2005/09/15 03:44:21 jgs
88     * Merge of development branch dev-02 back to main trunk on 2005-09-15
89     *
90     * Revision 1.2.2.1 2005/09/07 06:26:17 gross
91     * the solver from finley are put into the standalone package paso now
92     *
93 jgs 123 * Revision 1.2 2005/07/08 04:07:46 jgs
94     * Merge of development branch back to main trunk on 2005-07-08
95 jgs 82 *
96 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:47 gross
97     * some changes towards 64 integers in finley
98     *
99     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
100     * initial import of project esys2
101     *
102 jgs 82 * Revision 1.2 2004/07/30 04:37:06 gross
103     * escript and finley are linking now and RecMeshTest.py has been passed
104     *
105     * Revision 1.1 2004/07/02 04:21:13 gross
106     * Finley C code has been included
107     *
108     *
109     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26