I’m new to fenics and just got the tutorial working on my PC, however the problem I want to solve has a source term from other simulation so that it’s not an analytic function. According to my best understanding it‘s possible to define a Function over the same mesh and use it as an input source term. is this the best method?

the second question is that is it necessary to use the same order element for input and the output? for example, if I want to solve Poisson equation using Order 1 Triangular Lagrange, is it necessary to also use order 1 element as manual input, will a function over order 0 element (cell level constant) be ok? Will there just be some more noise or some bad issue that I don’t see for now?

A source to an equation can have different levels of continuity, depending on the PDE. Often you have an L2 requirement (meaning that a DG-0 field would be ok). See page 13 of: https://wiki.math.ntnu.no/_media/tma4212/2018v/master2.pdf

However, for other problems such as a projection, you might observe Gibb’s phenomenon:

https://jsdokken.com/FEniCS23-tutorial/src/approximations.html