I managed to get it working using the programmable filter. The script will attach the vector to the nearest node wrt to the coordinates you put in manually. Hereâ€™s how I went about it:

- Put the mesh, the
**warped** mesh and the mooring (vector) in a GroupDataSet
- Push the GroupDataSet through a programmable filter with the code below.

```
import numpy as np
# Input coordinates. The script will find the nearest node in the mesh.
x,y,z = 0,0,-1e3
input = self.GetInputDataObject(0, 0)
iter = input.NewIterator()
iter.UnRegister(None)
iter.InitTraversal()
# Warped mesh data set
curInput1 = iter.GetCurrentDataObject()
iter.GoToNextItem()
# Vector data set
curInput2 = iter.GetCurrentDataObject()
iter.GoToNextItem()
# Mesh data set
curInput3 = iter.GetCurrentDataObject()
# initialize currOutput
curOutput = curInput2.NewInstance()
curOutput.UnRegister(None)
curOutput.ShallowCopy(curInput2)
# create output and attach curOutput
output = self.GetOutputDataObject(0)
output.CopyStructure(input)
output.SetDataSet(iter, curOutput)
loc = []
NrOfPt = curInput3.GetNumberOfPoints()
for i in range(0,NrOfPt):
loc.append(curInput3.GetPoint(i))
loc = np.asarray(loc)
loc[:,0]-=x
loc[:,1]-=y
loc[:,2]-=z
lsq = lambda x: x[:,0]**2+x[:,1]**2+x[:,2]**2
NodeNr = np.argmin(lsq(loc))
# Set currOutput to the node
loc = curInput1.GetPoint(NodeNr)
newPoints = vtk.vtkPoints()
newPoints.InsertPoint(0,loc[0],loc[1],loc[2])
curOutput.SetPoints(newPoints)
```

- Create an arrow glyph.

DRAWBACK:

Slow. Every time step the nearest node is calculated (which is always the same). It would be better to do this calculation independent of time, but I donâ€™t know how to do that yet. Any advice is welcome!

KR, Eelco