|
[Sponsors] |
September 6, 2016, 06:53 |
reduce an equal operation
|
#1 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Dear Foamers,
I am looking for a "reduce" function but on an "equal operation". For example, we know that reduce function is already Ok for: sumOp, minOp and maxOp How to do it (or extend it) for an "equal operation" and a "pow operation". I need to make the following code to work also in parallel: Code:
forAll(mesh.C(),celli) { Sens[celli] = Foam::pow(SSS[celli], 0.5) ; } // Sens and SSS are both volScalarField type T.D. |
|
September 6, 2016, 13:00 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Your code should run without modification in multi process mode. Each processor has its own mesh with the cells of that fluid partition it is responsible for. So no need for any reduce operation. The latter would only be necessary if data from all processors should be put together, e.g. the sum of a value of all cells of all the meshes on all the processors/processes.
But your equal and pow operation only uses local information. So also no need for data exchange between processors. This would become much more complicate, if values of neighbor cells should be used. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
loading issue libraries:libsimpleFunctionObjects.so libsimpleSwakFunctionObjects.so | immortality | OpenFOAM Pre-Processing | 15 | April 7, 2024 13:35 |
Reduce operation for an array | xiao | OpenFOAM Running, Solving & CFD | 10 | June 21, 2022 11:01 |
Hi Do mesh have to do to reduce the temperature at the outlet? i need the reduce temp | reslan | FLUENT | 0 | March 16, 2016 03:10 |
Incompatible dimensions for operation | ruben23 | OpenFOAM Running, Solving & CFD | 2 | June 12, 2015 05:14 |
openfoam reduce() and MPI_barrier | mechy | OpenFOAM Programming & Development | 3 | October 7, 2013 10:11 |