# Basic Query regarding function spaces

**URL:** <https://community.freefem.org/t/basic-query-regarding-function-spaces/1675>\
**Category:** General Discussion\
**Created:** [April 16, 2022, 9:28am UTC](https://community.freefem.org/t/basic-query-regarding-function-spaces/1675 "2022-04-16T09:28:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aparna](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@aparna](https://community.freefem.org/u/aparna)\
**Post date:** [April 16, 2022, 9:28am UTC](https://community.freefem.org/t/basic-query-regarding-function-spaces/1675/1 "2022-04-16T09:28:05Z")

</div>

How we can write function space for tensor valued function ?  
how we can write exact solution if it is a vector ?

func f = [-2_pi^3_cos(pi_y)sin(piy)_(2_cos(2_pi_x) - 1), 2_pi^3_sin(pi_x)_cos(pi_x)_(2_cos(2_pi_y) - 1)];  
This is correct?

How we can calculate error in L2 norm if u is a vector ?

please explain with an example

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 18, 2022, 8:56am UTC](https://community.freefem.org/t/basic-query-regarding-function-spaces/1675/2 "2022-04-18T08:56:16Z")

</div>

Let `Th` a mesh, so

```auto
     fespace Wh(Th,[P1,P1]);// is vectoriel Finite Space with 2 componante 

   Wh [u1,u2]=[x,sin(y)]; //. Interpole of function x,y -> [x,sin(y)] 
  // v1, v2 overdose fo-unctuion 
    réal errl2 = sqrt(int2d(Th)( (u1-v1)^2 + (u2-v2)^2));

```

---

<div class="post-metadata">

**Author:** ![aparna](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@aparna](https://community.freefem.org/u/aparna)\
**Post date:** [April 18, 2022, 4:39am UTC](https://community.freefem.org/t/basic-query-regarding-function-spaces/1675/3 "2022-04-18T04:39:19Z")

</div>

Thankyou for your reply  
Can you tell how we define function space for tensor valued function?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 18, 2022, 2:57pm UTC](https://community.freefem.org/t/basic-query-regarding-function-spaces/1675/4 "2022-04-18T14:57:32Z")

</div>

Sorry only vector valued, so to do tensor you have to use vector
