Can I rely on consecutive state positions of a variable in discretized problem with MOL?

MethodOfLines creates a symbolic array variable indexed over discretized spaces.
After structurally simplifying the system (currently done automatically in the discretization) there are several corresponding variables in the ODE system, for which I want to update the initial state of the corresponding ODEProblem in an optimization.
I know that I cannot generally rely on the order of different state variables after simplification. However, I expect that the ODE states of one single original undiscretized variable are consecutive and accessible by indexing with a single range.

Can I rely on subsequent positions of the corresponding states in the ODEProblem?
Is there a minimum version requirement for this assumption?

For example, when a state variable Y discretized over a single a dimension, I get several variables Y[1], Y[2], ..., Y[n] in the ODEProblem.
If I find that Y[1] is at the fourth position of the ODE state vector, u[4], can I rely on finding Y[1:n] at u[3+1:n]?
This worked so far for my examples and but this might be just luck.
Or do I need to explicitly set/get states by dictionary of each entry of Y[i]?

Can can get/set by arrays. sol[Y]. See the indexing tutorials.

I wouldn’t rely on that ordering to stay. Right now that’s true, but I think one of the things that can be done to help improve some solvers is certain banded matrix restructuring, and that will give orderings that look almost random by eye on 2D/3D cases. So the blanket statement of “don’t rely on any ordering” generally holds, though of course in some limited cases and on specific versions you will see patterns that can be exploited but may go away.