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: 109
Rep Power: 7
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: 11
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 48 November 17, 2016 05:12
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 15 July 29, 2016 21:17
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 04:14.