# Multiply a Finite Element function by a vector of scalar functions

**URL:** https://community.freefem.org/t/multiply-a-finite-element-function-by-a-vector-of-scalar-functions/1430
**Category:** General Discussion
**Created:** [January 14, 2022, 10:01am UTC](https://community.freefem.org/t/multiply-a-finite-element-function-by-a-vector-of-scalar-functions/1430 "2022-01-14T10:01:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)
#### Post date: [January 14, 2022, 10:01am UTC](https://community.freefem.org/t/multiply-a-finite-element-function-by-a-vector-of-scalar-functions/1430/1 "2022-01-14T10:01:42Z")

</div>

Hello all,

I would like multiply a FE function pp by a vector of scalar functions, like this:

```auto
fespace VHK0(THK,P0); //useful to locate bubble of the coarse element
fespace PhK(ThK, P1);

func wbarre=[1,x,y];

varf vPi(p,pp)=int2d(ThK)(wbarre*pp); 
A=vPi(VHK0,PhK)

```

I am expecting thus that A will be a matrix of size (3 x ndof(PhK)).  
However it seems that doing “wbarre\*pp” is not allowed.

Could someone help me to resolve this problem ?

Thank you in advance,

Best regards,

Loïc,

---

<div class="post-metadata">

### Author: ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)
#### Post date: [January 17, 2022, 8:27am UTC](https://community.freefem.org/t/multiply-a-finite-element-function-by-a-vector-of-scalar-functions/1430/2 "2022-01-17T08:27:54Z")

</div>

Hello all, Hello @frederichecht

Should “wbarre” be a FE functions too ?

Best regards,

Loïc,
