How to set initial field value by every point's position

Your question is very general, and would depend on the structure of the data from the other software.

In general, you can

  1. Create a relation between the location of each degree of freedom and its physical coordinate in space by using FunctionSpace.tabulate_dof_coordinates()
  2. You can then directly assign data to the underlying vector in 'Function.vector()`

See for instance