I'm writing a code using continuous piecewise linear finite elements on triangulargrids to solve the diffusion-reaction problem. the source function f is a Dirac mass at the center. How can i compute the mesh in order to have the dirac in the baricenter of almost one triangle of the mesh?thanks  
Finite element discretization of Reaction-diffusion problem with Dirac source term
finite element;numerical analysis;mesh generation;elliptic pde
Since you are creating the mesh specifically for this right-hand side in order to have a correct solution, it would make more sense to have the Dirac located on a node instead: On the one hand, this is likely to be easier to realize in the mesh generator, and on the other hand the assembly is easier: Since you are using continuous piecewise linear elements and (presumably) nodal basis functions $\psi_i$, you have for $f=\delta_{x_i}$ (where $x_i$ is one of the nodes of your triangulation) that$$\langle f,\psi_j\rangle_{C^*,C} = \psi_j(x_i) = \begin{cases} 1 &\text{if } i=j,\\0 &\text{if } i\neq j,\end{cases}$$i.e., your load vector is just the vector with $1$ in the $i$th component and $0$ else. (This also works if you have linear combinations of Dirac measures located on the nodes. This also explains what happens when you forget the mass matrix on the right hand side...)