← Back to team overview

dolfin team mailing list archive

Re: Updated elasticity: [...]

 

On Thu, Sep 15, 2005 at 10:27:46PM +0200, Johan Jansson wrote:

> Hi!
> 
> I've tested the new operators, and they seem to work without
> problems.

Great!

> I have a feature request though :). It would be nice if I
> could write this:
> 
> mult(mu, e)
> 
> like this:
> 
> mu * e
> 
> where "mu" is a Constant (scalar) and "e" is an array (epsilon(u) in
> this case). I have no problems requiring functions for esoteric
> products, but scalar-vector or scalar-scalar multiplication should
> just be "*" in my opinion, since it's used so often.
> 
> It's not very critical though, but I think it should just be adding a
> case for an array for multiplication to the FFC algebra.

I just added it. Can you try and see if it works? I've implemented
component-wise multiplication of scalar basis functions, functions and
constants with vectors (Python built-in list). It was just two lines
added to algebra.py:

if isinstance(other, list) and self.rank() == 0:
    return [self*v for v in other]

Is this enough, or are you using Numeric.array for something so I
should add that too? The new operators assume Python list.

/Anders



Follow ups

References