# defining Expression as a product

Suppose,

v0 = Expression(

p0 = Expression(

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:
- Answered

- Assignee:
- No assignee Edit question

- Last query:
- 2013-02-18

- Last reply:
- 2013-02-18

Johan Hake (johan-hake) said : | #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:

> https:/

>

> Suppose,

> v0 = Expression(

> 'cos(pi*

> p0 = Expression(

> 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.

>

## Can you help with this problem?

Provide an answer of your own, or ask shriram for more information if necessary.