|
[Sponsors] |
September 5, 2016, 01:46 |
max value in parallel processing
|
#1 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Hi All,
I am running an application and the mesh was decompose for 16 processors. I submitted my job for parallel processing, but I am not receiving correct max value. I am using the following code where X and XE are defined as volScalarField and calculated before entering the given code: Code:
const volVectorField& pF = mesh.C(); for (int i=0; i<pF.size(); i++) { if (abs(X[i]-XE[i])>maxDiff) { maxDiff = fabs(X[i]-XE[i]); tempi=i; } } Info<< "Diff= " << maxDiff << " @ i = "<<tempi<<nl<<endl; Thanks |
|
September 5, 2016, 03:55 |
|
#2 |
New Member
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11 |
Hi,
use gMax function. |
|
September 5, 2016, 14:07 |
|
#3 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Thanks, this works partially.
I am alo interested to get the value of tempi at which tempDiff is maximum. I used Code:
reduce(maxDiff, maxOp<scalar>()); |
|
September 6, 2016, 01:56 |
|
#4 | |
New Member
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11 |
Quote:
look at this thread: http://www.cfd-online.com/Forums/ope...alarfield.html |
||
September 6, 2016, 07:35 |
|
#5 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Please check my code above, I am looking for tempi at which maxDiff is maximum. It is not necessary that tempi is maximum. For example:
processor 1: maxDiff = 180 ; tempi = 245 processor 1: maxDiff = 100; tempi = 3478 processor 1: maxDiff = 187; tempi = 405 processor 1: maxDiff = 89; tempi = 7656 It should be maxDiff = 187; tempi = 405 Thanks. |
|
September 6, 2016, 09:32 |
|
#6 |
New Member
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11 |
findMax returns the lable. look at here for examples:
https://github.com/OpenFOAM/OpenFOAM...MaxTemplates.C good luck |
|
May 23, 2020, 10:45 |
|
#7 |
New Member
Join Date: Apr 2020
Posts: 3
Rep Power: 6 |
hi cute. Have you resolved this issue? I encountered the same problem. could you help me?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cavitation around NACA hydrofoil using interPhaseChangeFoam | Kozan | OpenFOAM Running, Solving & CFD | 28 | March 12, 2023 00:30 |
Problem with chtMultiregionFoam radiation boundary condition | baran_foam | OpenFOAM Running, Solving & CFD | 10 | December 17, 2019 18:36 |
Parallel processing of OpenFOAM cases on multicore processor??? | g.akbari | OpenFOAM Running, Solving & CFD | 31 | November 1, 2017 10:25 |
Explicitly filtered LES | saeedi | Main CFD Forum | 16 | October 14, 2015 12:58 |