I am updating old version of program to a new version.
In old version, result of function internalField() was non-const reference, and in new program, result of that function is a const reference. When I compile program, I have errors due to this reason. For example,
Sadly, many people will really not open the links. They don't want to wait or do some extra steps to be able to see yours. And remember, this is not a homework site.
You need to post your code and your stuff here. This is a forum. Once you make your thread interactive enough, people will start to interact. And there's also a Job section if you want someone to do it entirely & privately for you.
If you do want to modify the scalarField object then you have to change internalField() to return a non-const reference. Another possibility is to add additional functions the volScalarField class to set/update the object.
That way you can call internalField() in both const and non-const situations. The non-const version will be preferred but if it's not possible (because the volVectorField is const) it will instead call the const version.