# Laplacian of vector

**URL:** https://discourse.paraview.org/t/laplacian-of-vector/9144
**Category:** ParaView Support
**Tags:** python
**Created:** [March 8, 2022, 5:43pm UTC](https://discourse.paraview.org/t/laplacian-of-vector/9144 "2022-03-08T17:43:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Darshan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/darshan/32/8807_2.png) [@Darshan](https://discourse.paraview.org/u/Darshan)
#### Post date: [March 8, 2022, 5:43pm UTC](https://discourse.paraview.org/t/laplacian-of-vector/9144/1 "2022-03-08T17:43:09Z")

</div>

Hello everyone,

I am struggling to calculate the Laplacian of vorticity vector with python calculator filter. However, I didn’t face any problem in calculating the divergence of 2D vectors and gradient of 2D vector and scalar. But I get error in calculating the laplacian since it only can be calculated to 3D vector. Any tips for calculating the laplacian of 2D vector.  
[vortiicty\_terms.pvsm](https://discourse.paraview.org/uploads/short-url/jrzCIaMFcwV9TGSSTdHfDOwMkuw.pvsm) (1.7 MB)

File “C:\Program Files\ParaView 5.10.0-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\vtkmodules\numpy\_interface\internal\_algorithms.py”, line 254, in divergence  
raise RuntimeError(‘Divergence only works with an array of 3D vectors.’ +  
RuntimeError: Divergence only works with an array of 3D vectors. Input shape (42681, 3, 3)

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [March 12, 2022, 5:37am UTC](https://discourse.paraview.org/t/laplacian-of-vector/9144/2 "2022-03-12T05:37:54Z")

</div>

Since **laplacian** takes a scalar array as input, you need to pass an array of each component of the 2-dimensional vector:

```python
laplacian(vector_array[:, 0])

```

or

```python
laplacian(vector_array[:, 1])

```

---

<div class="post-metadata">

### Author: ![Darshan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/darshan/32/8807_2.png) [@Darshan](https://discourse.paraview.org/u/Darshan)
#### Post date: [March 13, 2022, 3:38pm UTC](https://discourse.paraview.org/t/laplacian-of-vector/9144/3 "2022-03-13T15:38:27Z")

</div>

yes, I found the laplacian of each component and it worked. Thank you
