CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

How to access procNo

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

LinkBack Thread Tools Display Modes
Old   August 13, 2012, 13:59
Default How to access procNo
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 108
Rep Power: 5
zxj160 is on a distinguished road
I want to access the procNo in the main solver code. as follows:

if (ProcNo==0)
forAll(mesh.C(), pointI)
if ((mesh.C()[pointI].x()>0)&&(mesh.C()[pointI].x()<0.2))
in1[ii1] = pointI;
if ((mesh.C()[pointI].x()>0.2)&&(mesh.C()[pointI].x()<0.4))
in2[ii2] = pointI;
if ((mesh.C()[pointI].x()>0.4)&&(mesh.C()[pointI].x()<0.6))
in3[ii3] = pointI;

But when I wmake it and the error message is
error procNo is not declared in this scope
zxj160 is offline   Reply With Quote

Old   August 14, 2012, 03:18
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
It should work with
if (Pstream::myProcNo() == 0)
if (Pstream::master())
Arnoldinho is offline   Reply With Quote


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
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 29 September 3, 2015 03:09
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 14 June 4, 2014 05:52
UDF Data Access Macro Woo Meng Wai FLUENT 0 November 6, 2007 21:23
Error: access: unbound variable,HELP sudhakar FLUENT 0 January 16, 2007 00:21
Access Density Allan Walsh FLUENT 3 October 4, 2005 07:55

All times are GMT -4. The time now is 15:31.