CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   read user input value for post-processing utility (http://www.cfd-online.com/Forums/openfoam-post-processing/76641-read-user-input-value-post-processing-utility.html)

Pascal_doran May 31, 2010 20:37

read user's input for post-processing utility
 
Hi all,

I've been able to read input value for a pre-processing utility:

Code:

int main(int argc, char *argv[]) 

 
  argList::validArgs.append("value_h");
  argList::validArgs.append("value_b");
  argList::validArgs.append("value_r_c");
  argList::validArgs.append("value_alpha");

# include "setRootCase.H" 
# include "createTime.H" 
# include "createMesh.H" 
# include "createFields.H"

  const scalar h(readScalar(IStringStream(args.args()[1])()));
  const scalar b(readScalar(IStringStream(args.args()[2])()));
  const scalar r_c(readScalar(IStringStream(args.args()[3])()));
  const scalar alpha(readScalar(IStringStream(args.args()[4])()));
 
.....
 
return(0); 
}

but when I do the same thing for a post-processing utility named 'trace_max_vor_droite' (based on 'vorticity' utility) it doesn't work.

Here's what I tried:
Code:

void Foam::calc(int argc, char *argv[], const Time& runTime, const fvMesh& mesh)  // Line 41
{

    argList::validArgs.append("valeur Z");
    # include "setRootCase.H"
    const scalar coord_z(readScalar(IStringStream(args.args()[1])()));

....

}

The error message:

Code:

SOURCE=trace_max_vor_droite.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/postProcessing/postCalc -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/trace_max_vor_droite.o
trace_max_vor_droite.C:41: error: ‘void Foam::calc(int, char**, const Foam::argList&, const Foam::Time&, const Foam::fvMesh&)’ should have been declared inside ‘Foam’
make: *** [Make/linux64GccDPOpt/trace_max_vor_droite.o] Error 1

I'm very interested to learn how OpenFOAM works! Help would be very appreciated

Thank you,

Pascal

Pascal_doran June 3, 2010 17:41

Somebody has suggestions?

Pascal

Newtein June 11, 2010 12:03

Ideas/suggestions would be greatly appreciate

thank you


All times are GMT -4. The time now is 10:22.