CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

max value in parallel processing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2016, 01:46
Default max value in parallel processing
  #1
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
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;
I need you help. Please suggest.

Thanks
cute is offline   Reply With Quote

Old   September 5, 2016, 03:55
Default
  #2
New Member
 
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11
EhsanMh is on a distinguished road
Hi,

use gMax function.
EhsanMh is offline   Reply With Quote

Old   September 5, 2016, 14:07
Default
  #3
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
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>());
to get maxDiff but I wasn't able to get correct tempi.
cute is offline   Reply With Quote

Old   September 6, 2016, 01:56
Default
  #4
New Member
 
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11
EhsanMh is on a distinguished road
Quote:
Originally Posted by cute View Post
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>());
to get maxDiff but I wasn't able to get correct tempi.
HI again,

look at this thread:

http://www.cfd-online.com/Forums/ope...alarfield.html
EhsanMh is offline   Reply With Quote

Old   September 6, 2016, 07:35
Default
  #5
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
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.
cute is offline   Reply With Quote

Old   September 6, 2016, 09:32
Default
  #6
New Member
 
Ehsan Mahravan
Join Date: Dec 2014
Location: Tehran, Iran
Posts: 9
Rep Power: 11
EhsanMh is on a distinguished road
findMax returns the lable. look at here for examples:

https://github.com/OpenFOAM/OpenFOAM...MaxTemplates.C

good luck
EhsanMh is offline   Reply With Quote

Old   May 23, 2020, 10:45
Default
  #7
New Member
 
Join Date: Apr 2020
Posts: 3
Rep Power: 6
Wulue is on a distinguished road
hi cute. Have you resolved this issue? I encountered the same problem. could you help me?
Wulue is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 05:40.