for loop, not working in parallel
Maybe this is not a new question, but for some reason this piece of code does not work in parallel, just in serial.
This is the Bernhard answer to my email:
>Anyway: one of your problems might be that faces that were internal in
>the serial case are now boundary faces (on a processor patch). From
>what I see in your code you don't treat them at all. You'll have to do
>that treatment separately for these patches.
So I have added the boundaryField. But is still not working.
a) you'll have to loop over the individual faces in each patch (just like you did for the internal field)
b) you'll want to be sure that you do this only on processor patches. Use "isA" to find out
Have a look at $FOAM_SRC/finiteVolume/lnInclude/adjustPhi.C for inspiration
I was doing this in the wrong way, now I see that. But I can use a different and ingenious approach (without loops) for this particular case (see bellow).
Once more, thanks Bernhard you were very helpful and I think that I need to use your suggestion for another loop problem.
Following the solution of Alberto Passalacqua.
The best way in this case is to forget about the loops and treat everything as a surface scalar.
It was necessary to use Foam::pos(magMR -1.0), dont know why.
Many thanks Alberto and Bernhard
You guys are the best.
|All times are GMT -4. The time now is 02:04.|