|
[Sponsors] |
August 13, 2012, 14:59 |
How to access procNo
|
#1 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
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; ii1++; } if ((mesh.C()[pointI].x()>0.2)&&(mesh.C()[pointI].x()<0.4)) { in2[ii2] = pointI; ii2++; } if ((mesh.C()[pointI].x()>0.4)&&(mesh.C()[pointI].x()<0.6)) { in3[ii3] = pointI; ii3++; } }; But when I wmake it and the error message is error procNo is not declared in this scope |
|
August 14, 2012, 04:18 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
It should work with
Code:
if (Pstream::myProcNo() == 0) { ... } Code:
if (Pstream::master()) { ... } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting access to mesh (fvMesh) via object registry | Chris Lucas | OpenFOAM Programming & Development | 18 | January 15, 2024 03:57 |
[DesignModeler] DesignModeler Scripting: How to get Full Command Access | ANT | ANSYS Meshing & Geometry | 53 | February 16, 2020 16:13 |
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 08:55 |