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

Reducing pointfield values on proc boundaries

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2018, 07:40
Default Reducing pointfield values on proc boundaries
  #1
Member
 
Victor Koppejan
Join Date: May 2015
Posts: 40
Rep Power: 11
vkoppejan is on a distinguished road
I trying to follow the topic below:

transforming a function defined on mesh().points() into a pointScalarField

I'd like to do something similar.

1 loop over the the points of a cell and add values to the value at the points
2 Sum up the values off the points on the located on the proc boundaries. In other words, if a point resides on two procs, addup the values on each domain and scatter the result back to the procs again.

How can I perform action 2 using a collective operation on the point field?

Thanks in advance,

Victor

Last edited by vkoppejan; January 19, 2018 at 11:01.
vkoppejan is offline   Reply With Quote

Old   January 20, 2018, 12:38
Default
  #2
Member
 
Victor Koppejan
Join Date: May 2015
Posts: 40
Rep Power: 11
vkoppejan is on a distinguished road
To (partly) answer my own question, this is done usin the syncPointData, as is shown below for (taken from AveragingMethods/Dual/Dual.C ).

Note how "plusEqOp<Type>()" allows summing up of the values.

Code:
template<class Type>
void Foam::AveragingMethods::Dual<Type>::syncDualData()
{
    this->mesh_.globalData().syncPointData
    (
        dataDual_,
        plusEqOp<Type>(),
        mapDistribute::transform()
    );
}
vkoppejan is offline   Reply With Quote

Old   January 20, 2018, 13:37
Default
  #3
Member
 
Victor Koppejan
Join Date: May 2015
Posts: 40
Rep Power: 11
vkoppejan is on a distinguished road
To (partly) answer my own question, this is done usin the syncPointData, as is shown below for (taken from AveragingMethods/Dual/Dual.C ).

Note how "plusEqOp<Type>()" allows summing up of the values.

Code:
template<class Type>
void Foam::AveragingMethods::Dual<Type>::syncDualData()
{
    this->mesh_.globalData().syncPointData
    (
        dataDual_,
        plusEqOp<Type>(),
        mapDistribute::transform()
    );
}
vkoppejan 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
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 07:55
Ensight - node values -cell values leo FLUENT 1 May 12, 2010 09:47
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 13:04
updating values at inlet boundaries Stefano Siemens 3 March 20, 2007 11:13
node values or cell values? aPpA FLUENT 0 November 10, 2006 09:56


All times are GMT -4. The time now is 16:54.