mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Creation of OpenFOAM-dev repository 15/04/2008
This commit is contained in:
2
applications/test/getRoots/Make/files
Normal file
2
applications/test/getRoots/Make/files
Normal file
@ -0,0 +1,2 @@
|
||||
getRoots.C
|
||||
EXE = $(FOAM_USER_APPBIN)/getRoots
|
||||
2
applications/test/getRoots/Make/options
Normal file
2
applications/test/getRoots/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
|
||||
/* EXE_LIBS = -lfiniteVolume */
|
||||
30
applications/test/getRoots/getRoots.C
Normal file
30
applications/test/getRoots/getRoots.C
Normal file
@ -0,0 +1,30 @@
|
||||
#include "dictionary.H"
|
||||
#include "fileNameList.H"
|
||||
#include "IFstream.H"
|
||||
#include "OSspecific.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
Info << "\nReading Roots" << endl;
|
||||
|
||||
IFstream rootsFile(home()/".foam/apps/openDX/roots");
|
||||
fileNameList rootsList(dictionary(rootsFile).lookup("roots"));
|
||||
|
||||
char** rootsStrings = new char*[rootsList.size() + 1];
|
||||
rootsStrings[rootsList.size()] = 0;
|
||||
|
||||
if (rootsList.size())
|
||||
{
|
||||
for (int i=0; i<rootsList.size(); i++)
|
||||
{
|
||||
rootsStrings[i] = new char[rootsList[i].size() + 1];
|
||||
strcpy(rootsStrings[i], rootsList[i].c_str());
|
||||
|
||||
Info<< rootsStrings[i] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user