CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

init() method of class UpStream

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

LinkBack Thread Tools Display Modes
Old   November 26, 2013, 17:19
Default init() method of class UpStream
Senior Member
Join Date: Jan 2012
Posts: 160
Rep Power: 7
maybee is on a distinguished road
Hi, in one constructor that I am analysing are the methods below:

if (validParOptions.found(optionName))
parRunControl_.runPar(argc, argv); 
break;  //leave loop
ParRunControl parRunControl_ //- Switch on/off parallel mode.
void runPar(int& argc, char**& argv)
RunPar = true;  //bool RunPar;
if (!Pstream::init(argc, argv))
Info<< "Failed to start parallel run" << endl;
and herein
bool Foam::UPstream::init(int& argc, char**& argv) //Spawns slave processes and                      
{                                                  //initialises inter-communication                                                                                  
FatalErrorIn("UPstream::init(int& argc, char**& argv)")
<< "Trying to use the dummy Pstream library." << nl                                                                                                                             
<< "This dummy library cannot be used in parallel mode"                                                                                                                               
<< Foam::exit(FatalError);                                                                                                                               
return false;                                                                                                                               
Within the first if condition the existance of options of commandlinearguments are checked and like the description of the last method init tells a slave process should be spawned und inter-communication should be initialised. Two quesitons:

  1. I don't see where in method init() which I found in class reference of class UpStream a process is spawned. Rather I only see a error message within the method. Am I missing something? Furthermore when searching my PC for Files of class U
    class UpStreampstream I get three different .H and .C Files with different definitions for init() and therefore don't know which one is taken in the above example.
    The paths of the different .C files are:
    • /opt/openfoam221/src/Pstream/dummy
    • /opt/openfoam221/src/Pstream/mpi
    • /opt/openfoam221/src/OpenFOAM/db/IOstreams/Pstreams
  2. Do Options in commandlinearguments generally spawn slave process?

maybee 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
On the alpha Eqn of VOF method when using Immersed boundary method in OpenFOAM keepfit OpenFOAM 4 January 31, 2014 15:32
The finite element method - “displacement” or “stiffness” method 3Lin7 ANSYS 0 February 15, 2013 19:36
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Info on method of lines approach charlie ryan Main CFD Forum 2 August 9, 2007 11:06
How to add a new class locally ville OpenFOAM 4 December 11, 2006 14:20

All times are GMT -4. The time now is 02:00.