mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use HashTable for mapping codeStream entries
- write intermediate code to _SHA1 directories - add Test-codeStream
This commit is contained in:
3
applications/test/codeStream/Make/files
Normal file
3
applications/test/codeStream/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-codeStream.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-codeStream
|
||||
1
applications/test/codeStream/Make/options
Normal file
1
applications/test/codeStream/Make/options
Normal file
@ -0,0 +1 @@
|
||||
EXE_INC =
|
||||
75
applications/test/codeStream/Test-codeStream.C
Normal file
75
applications/test/codeStream/Test-codeStream.C
Normal file
@ -0,0 +1,75 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
Test-codeStream
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "IOstreams.H"
|
||||
#include "IOobject.H"
|
||||
#include "IFstream.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validArgs.insert("dict .. dictN");
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
Info<< nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||
<< endl;
|
||||
|
||||
if (args.size() <= 1)
|
||||
{
|
||||
Info<<"specify dictionaries to test\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& dictFile = args[argI];
|
||||
IFstream is(dictFile);
|
||||
|
||||
dictionary dict(is);
|
||||
|
||||
Info<< dict << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
43
applications/test/codeStream/codeStreamDict1
Normal file
43
applications/test/codeStream/codeStreamDict1
Normal file
@ -0,0 +1,43 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: Any |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object testDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// #include "codeStreamDefaults"
|
||||
|
||||
writeInterval #codeStream
|
||||
{
|
||||
codeInclude
|
||||
#{
|
||||
#include "fvCFD.H"
|
||||
#};
|
||||
|
||||
codeOptions
|
||||
#{
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
#};
|
||||
|
||||
code
|
||||
#{
|
||||
scalar start = 0;
|
||||
scalar end = 100;
|
||||
label nDumps = 5;
|
||||
label interval = end - start;
|
||||
Info<<"on-the-fly: " << ((interval)/nDumps) << endl;
|
||||
os << ((interval)/nDumps);
|
||||
#};
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
Reference in New Issue
Block a user