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

Pcg

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 3 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   September 21, 2013, 00:52
Default Pcg
  #1
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 62
Rep Power: 4
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: 62
Rep Power: 4
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 Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,124
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
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
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is online now   Reply With Quote

Old   September 22, 2013, 03:11
Default
  #4
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 62
Rep Power: 4
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: 62
Rep Power: 4
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 Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,124
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Dear Hassan!
as you pointed, its a function , you should look at the definition of that function
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is online now   Reply With Quote

Old   September 23, 2013, 13:24
Wink
  #7
Member
 
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 62
Rep Power: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
Velocity blows up suddenly after 30,000+ iterations lordvon OpenFOAM 14 October 27, 2010 11:13


All times are GMT -4. The time now is 14:21.