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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 471 - (show annotations)
Fri Jan 27 01:33:02 2006 UTC (13 years, 8 months ago) by jgs
File MIME type: text/plain
File size: 6500 byte(s)
reorganise finley src tree to remove inc dir and src/finley directory

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26