How to evaluate a surfaceScalarField face by face?
rhoPhi is defined as
surfaceScalarField rhoPhi ( IOobject ( "rhoPhi", runTime.timeName(), mesh ), dimensionedScalar("0",dimensionSet(1,0,-1,0,0),0) ); and it is updated after alphaEqn solved. Now I want to create a new surfaceScalarField rhoPhi2 ,which is a function of rhoPhi, so I define surfaceScalarField rhoPhi2 ( IOobject ( "rhoPhi2", runTime.timeName(), mesh ), dimensionedScalar("0",dimensionSet(1,0,-1,0,0),0) ); and evaluate rhoPhi2 face by face : forAll (rhoPhi2 , facei) { rhoPhi2[facei] = rhoPhi[facei]; } but it doesn't work as same as rhoPhi2 = rhoPhi; Is there any mistake in my testing code? And How to evaluate a surfaceScalarField face by face? Thanks! |
Have a look at what operator= does for fields in GeometricField.C
You need to also loop over boundaries. I would question why you need to loop though. |
All times are GMT -4. The time now is 07:53. |