|
[Sponsors] |
findMax not working in parallel with scalarField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 3, 2011, 11:47 |
findMax not working in parallel with scalarField
|
#1 |
Senior Member
Pablo
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
hello,
I found that findMax not working in parallel with scalarField. I want to find the min coordinate_X for my pacht and at the same time with coordinate_Z <= 0. Any idea? Thanks |
|
November 3, 2011, 12:17 |
|
#2 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
I've never tried to use findMax, but this should work:
Code:
scalar whatever = findMax...; reduce(whatever, maxOp<scalar>()); Regards |
|
November 3, 2011, 12:25 |
|
#3 |
Senior Member
Pablo
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
So it would be;
label whatever = findMax...; reduce(whatever, maxOp<label>()); I am using gMax, so get the max value, but now how can i get what label is the max value (and working in parallel) Thanks |
|
November 3, 2011, 12:50 |
|
#4 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
Just loop the entire patch:
Code:
vectorField coord = patch().Cf(); scalar auxiliar = 999999.0; forAll(coord.component(2), index) { if(coord.component(2)[index]<=0.0) { if(coord.component(0)[index]<auxiliar) { auxiliar = coord.component(0)[index]; } } } reduce(auxiliar, minOp<scalar>()); |
|
November 3, 2011, 13:38 |
|
#5 |
Senior Member
Pablo
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
thank you, but still i can not get the label for the value, any idea?
Pablo |
|
November 3, 2011, 13:55 |
|
#6 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
Another loop...
Code:
label auxiliarLabel = -999999; forAll(coord.component(2), index2) { if(coord.component(2)[index2]<=0.0) { if(coord.component(0)[index2]==auxiliar) { auxiliarLabel = index2; break; } } } reduce(auxiliarLabel, maxOp<label>()); |
|
November 3, 2011, 14:28 |
|
#7 |
Senior Member
Pablo
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
the second loop to find the cell is not working; i mean it is not giving the correct label
label celdabuscada = -99999; scalar pto_X = -10000.0; forAll(mesh.boundary()[patchK], faceI) { if (NN2[faceI].component(vector::Z) <= 0.0) { if (NN2[faceI].component(vector::X) >= pto_X){ pto_X=NN2[faceI].component(vector::X); } } } reduce(pto_X, maxOp<scalar>()); forAll(mesh.boundary()[patchK], face2) { if (NN2[face2].component(vector::Z) <= 0.0) { if (NN2[face2].component(vector::X)==pto_X){ celdabuscada=face2; Info <<"////celda buscada " << celdabuscada << nl; break; } } } reduce(celdabuscada, maxOp<label>()); more ideas?? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
parallel fluent under pbs not working | kharnabnew | FLUENT | 0 | January 6, 2011 04:28 |
Problem on Parallel Run Setup | Hamidur Rahman | CFX | 0 | September 23, 2007 18:11 |
Replacing components in a scalarField | grtabor | OpenFOAM Running, Solving & CFD | 1 | February 5, 2007 13:24 |
OpenCFD enhances OpenFOAM's parallel communications | OpenFOAM discussion board administrator | OpenFOAM Announcements from ESI-OpenCFD | 0 | October 2, 2006 09:36 |
MPICH Parallel Run Error on the Windows Server2003 | Saturn | CFX | 3 | August 29, 2006 09:42 |