3568 |
if not shape01==shape10: |
if not shape01==shape10: |
3569 |
raise ValueError,"dimensions of last %s components in left argument don't match the first %s components in the right argument."%(offset,offset) |
raise ValueError,"dimensions of last %s components in left argument don't match the first %s components in the right argument."%(offset,offset) |
3570 |
|
|
3571 |
|
# whatr function space should be used? (this here is not good!) |
3572 |
|
fs=(escript.Scalar(0.,arg0.getFunctionSpace())+escript.Scalar(0.,arg1.getFunctionSpace())).getFunctionspace() |
3573 |
# create return value: |
# create return value: |
3574 |
out=escript.Data(0.,tuple(shape0+shape1),arg0.getFunctionSpace()) |
out=escript.Data(0.,tuple(shape0+shape1),fs) |
3575 |
# |
# |
3576 |
s0=[[]] |
s0=[[]] |
3577 |
for k in shape0: |
for k in shape0: |
3594 |
|
|
3595 |
for i0 in s0: |
for i0 in s0: |
3596 |
for i1 in s1: |
for i1 in s1: |
3597 |
s=escript.Scalar(0.,arg0.getFunctionSpace()) |
s=escript.Scalar(0.,fs) |
3598 |
for i01 in s01: |
for i01 in s01: |
3599 |
s+=arg0.__getitem__(tuple(i0+i01))*arg1.__getitem__(tuple(i01+i1)) |
s+=arg0.__getitem__(tuple(i0+i01))*arg1.__getitem__(tuple(i01+i1)) |
3600 |
out.__setitem__(tuple(i0+i1),s) |
out.__setitem__(tuple(i0+i1),s) |