← Back to team overview

ufl team mailing list archive

Re: ListTensor

 

On Tue, Mar 3, 2009 at 7:28 PM, Kristian Oelgaard
<k.b.oelgaard@xxxxxxxxxx> wrote:
> Quoting Martin Sandve Alnæs <martinal@xxxxxxxxx>:
>
>> On Tue, Mar 3, 2009 at 6:50 PM, Kristian Oelgaard
>> <k.b.oelgaard@xxxxxxxxxx> wrote:
>> > Quoting Martin Sandve Alnæs <martinal@xxxxxxxxx>:
>> >
>> >> On Tue, Mar 3, 2009 at 6:29 PM, Kristian Oelgaard
>> >> <k.b.oelgaard@xxxxxxxxxx> wrote:
>> >> > Quoting Martin Sandve Alnæs <martinal@xxxxxxxxx>:
>> >> >
>> >> >> On Tue, Mar 3, 2009 at 4:37 PM, Kristian Oelgaard
>> >> >> <k.b.oelgaard@xxxxxxxxxx> wrote:
>> >> >> > Quoting Martin Sandve Alnæs <martinal@xxxxxxxxx>:
>> >> >> >
>> >> >> >> Nothing implemented, no.
>> >> >> >> I'll have to think about it.
>> >> >> >>
>> >> >> >> Martin
>> >> >> >
>> >> >> > Could someone please fill me in on the most important details of
>> >> >> ListTensor?
>> >> >> > Looking at the sub tree I get a strong urge to just ignoring it,
>> would
>> >> that
>> >> >> be safe?
>> >> >> >
>> >> >> > Kristian
>> >> >>
>> >> >> I don't get what you're asking for here. Temporarily you can
>> >> >> probably ignore it, but in the end it should be supported.
>> >> >
>> >> > I had a second look at Indexed vs. ComponentTensor (and ListTensor) and
>> I
>> >> think
>> >> > I managed to make some sense out of it. But why does ListTensor not
>> have
>> >> indices
>> >> > like ComponentTensor?
>> >> >
>> >> > Kristian
>> >>
>> >> Why should it have indices? It represents a tensor composed of an
>> >> explicit list of arbitrary subtensors with no connection whatsoever.
>> >> (If its subtensors are scalar expressions, think of it as ListVector,
>> >> which it was in the first version)
>> >>
>> >> Example:
>> >>   w = as_vector((1.0, 2.0)) # -> ListTensor((FloatValue(1.0),
>> >> FloatValue(2.0))
>> >>   fixed_convection = dot(w, grad(u))
>> >
>> > Maybe it's just because I don't see what ListTensor does which
>> ComponentTensor
>> > can't.
>> >
>> > Kristian
>>
>> For starters, ComponentTensor can't represent the constant vector
>> (1.0, 2.0) shown above.
>
> A_j = j + 1 ?

That's not a valid expression for two reasons.

The first is that you (currently) can't use the indices as values in
an expression.

The second is that summands must have the exact same sets of free indices,
otherwise we get inconsistencies (see the ROADMAP file).

But to give another concrete example, ComponentTensor can't
represent the vector (f, f**2) where f is a scalar Function.

Martin


>> Take a scalar expression Aij with A.free_indices() being
>> a superset of all indices in the MultiIndex ij, and let
>>   A = ComponentTensor(Aij, ij)
>> Here A represents the tensor-valued expression with components given by Aij.
>> The rank of A equals len(ij).
>>
>> Then assume (a, b, c) three distinct unrelated scalar expressions, and let
>>   B = ListTensor(a, b, c)
>> Here B represents the vector with components a, b, and c.
>
> I'll look at it some more, but I think I've figured it out.
>
> Kristian
>
>> Martin
>>
>
>
> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev
>


References