Given a triangulation of a compact, orientable and differentiable manifold $M^m$, it is possible to give a formula (in terms of real coordinates of the ambient space) for a vector field with only non-degenerated zeros which is "good" in the sense that there is exactly $\beta_q$=($q$-Betti number of $M^m$) zeros, each one with index $(-1)^q$, over the barycentre of each $q$-cell of the triangulation, $q=0,\cdots, m$?

For example, if $P=(a_0,\cdots,a_k)$ is the barycentre of a $q$-cell, it seems to me that the gradient $v$ of the function $f:M^m\rightarrow\mathbb{R}$ given by $f=(x_0-a_0)^2-(x_1-a_1)^2+\cdots+(-1)^q(x_q-a_q)^2+(x_{q+1}-a_{q+1})^2+\cdots+(x_k-a_k)^2$ works, since in this case $sign (\ det \ d_Pv)=(-1)^q$.

But how we can "glue" these gradient fields to give a global vector field on $M^m$?