const qualifier problems
Hi my createField.H has defination of T as
const volScalarField& T = thermo.T(); I want to impliment my code on boundaryCondition correction as forAll(T.boundaryField()[patchID],i) { T.boundaryField)([patchID][i] = T.boundaryField()[patchID][i]-DT; ------------ -------------------------- (some code for spoces) ........ T.write(); } I am getting following error error: assignment of read-only location ‘(&(&(& T)->Foam::GeometricField<Type, PatchField, GeoMesh>::boundaryField<double,..... How to resolve this condition I want to correct the temperature T with some differet function based on spices flux. please help |
As of OpenFOAM 4.0 you need to use boundaryFieldRef() instead of boundaryField() if you want a non-const access to the boundaries. Same goes for internalField() and internalFieldRef() (and possibly other functions as well).
|
Quote:
instead of Code:
const volScalarField& T = thermo.T(); Code:
volScalarField& T = thermo.T(); |
Hi wang,
As others have already mentioned above, you shouldn't use that Quote:
|
All times are GMT -4. The time now is 15:18. |