# defining Expression as a product

Suppose,
v0 = Expression(('sin(pi*x)*sin(pi*x)*(exp(t) -1)', 'cos(pi*x)*cos(pi*x)*(exp(t) -1)'), t=0.1)
p0 = Expression('x*(x - 1)*x*(x - 1)*cos(pi*t)', t=0.1)
In the above expressions, the term (exp(t)-1) is a common factor in v0 while cos(pi*t) is so in p0. Is there any way to write these terms as product of 2 expressions. When I try doing that, I get an error when I define DirichletBC for V.
Thanks,
Shriram

## Question information

Language:
English Edit question
Status:
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Johan Hake (johan-hake) said on 2013-02-18: #1

Not without writing a complex C++ Expression. Look at the doc string of
Expression for hints of how to do this.
Johan
On Feb 18, 2013 5:41 AM, "shriram" <email address hidden>
wrote:

> New question #222168 on FEniCS Project:
>
> Suppose,
> v0 = Expression(('sin(pi*x)*sin(pi*x)*(exp(t) -1)',
> 'cos(pi*x)*cos(pi*x)*(exp(t) -1)'), t=0.1)
> p0 = Expression('x*(x - 1)*x*(x - 1)*cos(pi*t)', t=0.1)
> In the above expressions, the term (exp(t)-1) is a common factor in v0
> while cos(pi*t) is so in p0. Is there any way to write these terms as
> product of 2 expressions. When I try doing that, I get an error when I
> define DirichletBC for V.
> Thanks,
> Shriram
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>