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

Pcg

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2013, 00:52
Default Pcg
  #1
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13
luckycfd is on a distinguished road
Hi,
line below is from PCG.C source code:
Code:
register label nCells = psi.size();
I'm looking for some annotaions about the task of this line in the code.

Regards,
Hassan

Last edited by luckycfd; September 22, 2013 at 01:38.
luckycfd is offline   Reply With Quote

Old   September 22, 2013, 02:33
Default
  #2
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13
luckycfd is on a distinguished road
I need a highly annotated version of the PCG.C source code in openFoam,
please help me in this way.

regards,
Hassan
luckycfd is offline   Reply With Quote

Old   September 22, 2013, 02:58
Default
  #3
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Dear Hasan

Quote:
line below is from PCG.C source code:
Code:
register label nCells = psi.size();
I'm looking for some annotaions about the task of this line in the code.
well, psi should be a variable , or in other word its an array . so that line return the size of array
Quote:
need a highly annotated version of the PCG.C source code in openFoam,
could you please be more specific? what do you want?

and extra comment , post your question just one place at forum (another similar post is:http://www.cfd-online.com/Forums/ope...tml#post452938)

Best Regards
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   September 22, 2013, 03:11
Default
  #4
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13
luckycfd is on a distinguished road
Hi,
According to part of PCG.C code that shown below;
Code:
register label nCells = psi.size();  
scalar* __restrict__ psiPtr = psi.begin();   
scalarField pA(nCells); 
scalar* __restrict__ pAPtr = pA.begin();   
scalarField wA(nCells); 
scalar* __restrict__ wAPtr = wA.begin();   
scalar wArA = solverPerf.great_; 
scalar wArAold = wArA;
What is the task of begin() and great_ functions?

Regards,
Hassan
Attached Files
File Type: c PCG.C (5.2 KB, 4 views)

Last edited by luckycfd; September 23, 2013 at 09:42.
luckycfd is offline   Reply With Quote

Old   September 23, 2013, 09:40
Default
  #5
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13
luckycfd is on a distinguished road
Post changed.
luckycfd is offline   Reply With Quote

Old   September 23, 2013, 11:46
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Dear Hassan!
as you pointed, its a function , you should look at the definition of that function
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   September 23, 2013, 13:24
Wink
  #7
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13
luckycfd is on a distinguished road
Dear Nima,
wow... now how ca I access to their definition?
Thanks
luckycfd is offline   Reply With Quote

Old   September 23, 2013, 15:47
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Hassan:
  1. Start from the code documentation: http://foam.sourceforge.net/docs/cpp/index.html
  2. Search for "scalarField" and pick the first one -> http://foam.sourceforge.net/docs/cpp...86e99235e0a397
  3. It tells you that:
    Quote:
    scalarField Specialisation of Field<T> for scalar.
  4. So you click on "Field" -> http://foam.sourceforge.net/docs/cpp/a00627.html
  5. This is a template class, which actually inherits a lot of its own characteristics from other template classes, so the quickest now if to search the page for "List of all members." and click on it -> http://foam.sourceforge.net/docs/cpp/a12154.html
  6. In this page, you can see all of the methods available for this class, including the method "begin()".

If you haven't studied C++ yet, you can start here: http://www.cplusplus.com/doc/tutorial/


As for other ways of investigating where the code comes from: http://openfoamwiki.net/index.php/Ho...M_with_Eclipse


Best regards,
Bruno
nimasam, sharonyue and luckycfd like this.
__________________
wyldckat 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
Floating point exception error Alan OpenFOAM Running, Solving & CFD 11 July 1, 2021 21:51
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Velocity blows up suddenly after 30,000+ iterations lordvon OpenFOAM Running, Solving & CFD 15 October 19, 2015 13:52
Do residuals mean the same in PCG and AMG? santiagomarquezd OpenFOAM Programming & Development 1 August 31, 2012 17:46
Dynamic moving mesh Pei-Ying Hsieh (Hsieh) OpenFOAM Running, Solving & CFD 64 June 7, 2012 10:04


All times are GMT -4. The time now is 09:23.