[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] Slicing in generic_assembly

From: Jehanzeb Hameed
Subject: [Getfem-users] Slicing in generic_assembly
Date: Wed, 8 Jul 2009 18:24:49 -0500


Is it possible to take a summed slice in generic_assembly. For example
comp(Grad(#1).Grad(#1))(:,i,:,i) , the sum on i is over all gradient
components, (e.g it will be over  3 components in 3 dimensions). Is it
possible to do a sum over just 2 components, like
comp(Grad(#1).Grad(#1))(1:2,i,1:2,i) ?

One way is to ofcourse take a slice for 1 and 2, i.e,
comp(Grad(#1).Grad(#1))(1,i,1,i) + comp(Grad(#1).Grad(#1))(2,i,2,i),
and this works, but this gets messy pretty quickily.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]