/[escript]/trunk/esys2/finley/src/finleyC/Assemble_handelShapeMissMatch.c
ViewVC logotype

Annotation of /trunk/esys2/finley/src/finleyC/Assemble_handelShapeMissMatch.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (hide annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 5407 byte(s)
Merge of development branch back to main trunk on 2005-07-08

1 jgs 82 /* $Id$ */
2    
3     /**************************************************************/
4    
5     /* assemblage routines: */
6    
7     /* these routines handel cases where there ia a miss match in the number of nodes and the number of shape funtion: */
8    
9     /* _in: V[N,numNodes0,numNodes1] is reduced into V[N,numShapes0,numShapes1] */
10     /* _out: V[N,numShapes0,numShapes1] is expanded into V[N,numNodes0,numNodes1] */
11     /* in both cases the leading dimenisons are unchanged */
12    
13    
14     /**************************************************************/
15    
16     /* Copyrights by ACcESS Australia, 2003,2004 */
17     /* author: gross@access.edu.au */
18     /* Version: $Id$ */
19    
20     /**************************************************************/
21    
22     #include "Common.h"
23     #include "Assemble.h"
24    
25    
26     /**************************************************************/
27    
28     /* this takes the mean value: */
29    
30 jgs 123 void Finley_Assemble_handelShapeMissMatch_Mean_in(dim_t N, dim_t numNodes0,dim_t numNodes1, double* V,dim_t numShapes0, dim_t numShapes1) {
31     dim_t l0=MIN(numShapes0,numNodes0-numShapes0);
32     dim_t l1=MIN(numShapes1,numNodes1-numShapes1);
33     dim_t i,k0,k1;
34 jgs 82 if (MAX(l0,l1)>0) {
35     if (numNodes1==numShapes1) {
36     for (k0=0;k0<l0;k0++) {
37     for (i=0;i<N;i++) V[INDEX2(i,k0,N)]= ( V[INDEX2(i,k0,N)]+V[INDEX2(i,k0+numShapes0,N)])/2.;
38     }
39     } else {
40     for (k0=0;k0<l0;k0++) {
41     for (k1=0;k1<l1;k1++) {
42     for (i=0;i<N;i++) {
43     V[INDEX3(i,k0,k1,N,numNodes0)]=
44     ( V[INDEX3(i,k0 ,k1 ,N,numNodes0)]+
45     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]+
46     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]+
47     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)])/4.;
48     }
49     }
50     }
51     }
52     }
53     }
54    
55 jgs 123 void Finley_Assemble_handelShapeMissMatch_Mean_out(dim_t N, dim_t numNodes0,dim_t numNodes1, double* V,dim_t numShapes0, dim_t numShapes1) {
56 jgs 82 double RTMP;
57 jgs 123 dim_t i,k0,k1;
58     dim_t l0=MIN(numShapes0,numNodes0-numShapes0);
59     dim_t l1=MIN(numShapes1,numNodes1-numShapes1);
60 jgs 82 if (MAX(l0,l1)>0) {
61     if (numNodes1==numShapes1) {
62     for (k0=0;k0<l0;k0++) {
63     for (i=0;i<N;i++) {
64     RTMP=V[INDEX2(i,k0,N)];
65     V[INDEX2(i,k0 ,N)]=0.;
66     V[INDEX2(i,k0+numShapes0,N)]=0.;
67    
68     V[INDEX2(i,k0 ,N)]+=RTMP/2.;
69     V[INDEX2(i,k0+numShapes0,N)]+=RTMP/2.;
70     }
71     }
72     } else {
73     for (k0=0;k0<l0;k0++) {
74     for (k1=0;k1<l1;k1++) {
75     for (i=0;i<N;i++) {
76     RTMP=V[INDEX3(i,k0,k1,N,numNodes0)];
77     V[INDEX3(i,k0 ,k1 ,N,numNodes0)]=0.;
78     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]=0.;
79     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]=0.;
80     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)]=0.;
81    
82     V[INDEX3(i,k0 ,k1 ,N,numNodes0)]+=RTMP/4.;
83     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]+=RTMP/4.;
84     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]+=RTMP/4.;
85     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)]+=RTMP/4.;
86     }
87     }
88     }
89     }
90     }
91     }
92    
93 jgs 123 void Finley_Assemble_handelShapeMissMatch_Step_in(dim_t N, dim_t numNodes0,dim_t numNodes1, double* V,dim_t numShapes0, dim_t numShapes1) {
94     dim_t l0=MIN(numShapes0,numNodes0-numShapes0);
95     dim_t l1=MIN(numShapes1,numNodes1-numShapes1);
96     dim_t i,k0,k1;
97 jgs 82 if (MAX(l0,l1)>0) {
98     if (numNodes1==numShapes1) {
99     for (k0=0;k0<l0;k0++) {
100     for (i=0;i<N;i++) {
101     V[INDEX2(i,k0,N)]= -V[INDEX2(i,k0,N)]+V[INDEX2(i,k0+numShapes0,N)];
102     }
103     }
104     } else {
105     for (k0=0;k0<l0;k0++) {
106     for (k1=0;k1<l1;k1++) {
107     for (i=0;i<N;i++) {
108     V[INDEX3(i,k0,k1,N,numNodes0)]=
109     V[INDEX3(i,k0 ,k1 ,N,numNodes0)]+
110     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]-
111     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]-
112     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)];
113     }
114     }
115     }
116     }
117     }
118     }
119    
120 jgs 123 void Finley_Assemble_handelShapeMissMatch_Step_out(dim_t N, dim_t numNodes0,dim_t numNodes1, double* V,dim_t numShapes0, dim_t numShapes1) {
121 jgs 82 double RTMP;
122 jgs 123 dim_t i,k0,k1;
123     dim_t l0=MIN(numShapes0,numNodes0-numShapes0);
124     dim_t l1=MIN(numShapes1,numNodes1-numShapes1);
125 jgs 82 if (MAX(l0,l1)>0) {
126     if (numNodes1==numShapes1) {
127     for (k0=0;k0<l0;k0++) {
128     for (i=0;i<N;i++) {
129     RTMP=V[INDEX2(i,k0,N)];
130     V[INDEX2(i,k0 ,N)]=0.;
131     V[INDEX2(i,k0+numShapes0,N)]=0.;
132    
133     V[INDEX2(i,k0 ,N)]-=RTMP;
134     V[INDEX2(i,k0+numShapes0,N)]+=RTMP;
135     }
136     }
137     } else {
138     for (k0=0;k0<l0;k0++) {
139     for (k1=0;k1<l1;k1++) {
140     for (i=0;i<N;i++) {
141     RTMP=V[INDEX3(i,k0,k1,N,numNodes0)];
142     V[INDEX3(i,k0 ,k1 ,N,numNodes0)]=0.;
143     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]=0.;
144     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]=0.;
145     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)]=0.;
146    
147     V[INDEX3(i,k0 ,k1 ,N,numNodes0)]+=RTMP;
148     V[INDEX3(i,k0+numShapes0,k1 ,N,numNodes0)]-=RTMP;
149     V[INDEX3(i,k0 ,k1+numShapes1,N,numNodes0)]-=RTMP;
150     V[INDEX3(i,k0+numShapes0,k1+numShapes1,N,numNodes0)]+=RTMP;
151     }
152     }
153     }
154     }
155     }
156     }
157    
158     /*
159     * $Log$
160 jgs 123 * Revision 1.2 2005/07/08 04:07:47 jgs
161     * Merge of development branch back to main trunk on 2005-07-08
162 jgs 82 *
163 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:48 gross
164     * some changes towards 64 integers in finley
165     *
166     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
167     * initial import of project esys2
168     *
169 jgs 82 * Revision 1.1 2004/07/02 04:21:13 gross
170     * Finley C code has been included
171     *
172     *
173     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26