mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ bool Foam::timeSelector::selected(const instant& value) const
|
||||
}
|
||||
|
||||
|
||||
Foam::List<bool> Foam::timeSelector::selected(const List<instant>& Times) const
|
||||
Foam::List<bool> Foam::timeSelector::selected(const instantList& Times) const
|
||||
{
|
||||
List<bool> lst(Times.size(), false);
|
||||
|
||||
@ -97,19 +97,14 @@ Foam::List<bool> Foam::timeSelector::selected(const List<instant>& Times) const
|
||||
}
|
||||
|
||||
|
||||
Foam::List<Foam::instant> Foam::timeSelector::select
|
||||
(
|
||||
const List<instant>& Times
|
||||
) const
|
||||
Foam::List<Foam::instant> Foam::timeSelector::select(const instantList& Times)
|
||||
const
|
||||
{
|
||||
return subset(selected(Times), Times);
|
||||
}
|
||||
|
||||
|
||||
void Foam::timeSelector::inplaceSelect
|
||||
(
|
||||
List<instant>& Times
|
||||
) const
|
||||
void Foam::timeSelector::inplaceSelect(instantList& Times) const
|
||||
{
|
||||
inplaceSubset(selected(Times), Times);
|
||||
}
|
||||
@ -159,7 +154,7 @@ void Foam::timeSelector::addOptions
|
||||
|
||||
Foam::List<Foam::instant> Foam::timeSelector::select
|
||||
(
|
||||
const List<instant>& timeDirs,
|
||||
const instantList& timeDirs,
|
||||
const argList& args
|
||||
)
|
||||
{
|
||||
@ -270,4 +265,29 @@ Foam::List<Foam::instant> Foam::timeSelector::select0
|
||||
}
|
||||
|
||||
|
||||
Foam::List<Foam::instant> Foam::timeSelector::selectIfPresent
|
||||
(
|
||||
Time& runTime,
|
||||
const argList& args
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
args.optionFound("latestTime")
|
||||
|| args.optionFound("time")
|
||||
|| args.optionFound("constant")
|
||||
|| args.optionFound("noZero")
|
||||
|| args.optionFound("zeroTime")
|
||||
)
|
||||
{
|
||||
return select0(runTime, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No timeSelector option specified. Do not change runTime.
|
||||
return instantList(1, instant(runTime.value(), runTime.timeName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -72,7 +72,7 @@ SourceFiles
|
||||
#define timeSelector_H
|
||||
|
||||
#include "scalarRanges.H"
|
||||
#include "instant.H"
|
||||
#include "instantList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -109,13 +109,13 @@ public:
|
||||
|
||||
//- Return the set of selected instants in the given list that are
|
||||
// within the ranges
|
||||
List<bool> selected(const List<instant>&) const;
|
||||
List<bool> selected(const instantList&) const;
|
||||
|
||||
//- Select a list of Time values that are within the ranges
|
||||
List<instant> select(const List<instant>&) const;
|
||||
instantList select(const instantList&) const;
|
||||
|
||||
//- Select a list of Time values that are within the ranges
|
||||
void inplaceSelect(List<instant>&) const;
|
||||
void inplaceSelect(instantList&) const;
|
||||
|
||||
//- Add the options handled by timeSelector to argList::validOptions
|
||||
//
|
||||
@ -135,15 +135,24 @@ public:
|
||||
);
|
||||
|
||||
//- Return the set of times selected based on the argList options
|
||||
static List<instant> select
|
||||
static instantList select
|
||||
(
|
||||
const List<instant>&,
|
||||
const instantList&,
|
||||
const argList& args
|
||||
);
|
||||
|
||||
//- Return the set of times selected based on the argList options
|
||||
// also set the runTime to the first instance
|
||||
static List<instant> select0
|
||||
static instantList select0
|
||||
(
|
||||
Time& runTime,
|
||||
const argList& args
|
||||
);
|
||||
|
||||
//- If any time option provided return the set of times (as select0)
|
||||
// otherwise return just the current time.
|
||||
// Also set the runTime to the first instance
|
||||
static instantList selectIfPresent
|
||||
(
|
||||
Time& runTime,
|
||||
const argList& args
|
||||
|
||||
@ -85,6 +85,14 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
|
||||
stringOps::inplaceExpand(libs_, dict);
|
||||
}
|
||||
|
||||
// optional
|
||||
const entry* localPtr = dict.lookupEntryPtr("localCode", false, false);
|
||||
if (localPtr)
|
||||
{
|
||||
localCode_ = stringOps::trim(localPtr->stream());
|
||||
stringOps::inplaceExpand(localCode_, dict);
|
||||
}
|
||||
|
||||
// calculate SHA1 digest from include, options, localCode, code
|
||||
OSHA1stream os;
|
||||
os << include_ << options_ << libs_ << localCode_ << code_;
|
||||
@ -103,14 +111,18 @@ Foam::dynamicCodeContext::dynamicCodeContext(const dictionary& dict)
|
||||
{
|
||||
addLineDirective(include_, includePtr->startLineNumber(), dict.name());
|
||||
}
|
||||
if (optionsPtr)
|
||||
{
|
||||
addLineDirective(options_, optionsPtr->startLineNumber(), dict.name());
|
||||
}
|
||||
|
||||
// Do not add line directive to options_ (Make/options) since at it is a
|
||||
// single line at this point. Can be fixed.
|
||||
|
||||
if (libsPtr)
|
||||
{
|
||||
addLineDirective(libs_, libsPtr->startLineNumber(), dict.name());
|
||||
}
|
||||
if (localPtr)
|
||||
{
|
||||
addLineDirective(localCode_, localPtr->startLineNumber(), dict.name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,6 +46,12 @@ namespace Foam
|
||||
gasThermoPhysics
|
||||
);
|
||||
makeChemistryModel
|
||||
(
|
||||
ODEChemistryModel,
|
||||
psiChemistryModel,
|
||||
constGasThermoPhysics
|
||||
);
|
||||
makeChemistryModel
|
||||
(
|
||||
ODEChemistryModel,
|
||||
psiChemistryModel,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,6 +46,12 @@ namespace Foam
|
||||
gasThermoPhysics
|
||||
);
|
||||
makeChemistryModel
|
||||
(
|
||||
ODEChemistryModel,
|
||||
rhoChemistryModel,
|
||||
constGasThermoPhysics
|
||||
);
|
||||
makeChemistryModel
|
||||
(
|
||||
ODEChemistryModel,
|
||||
rhoChemistryModel,
|
||||
|
||||
@ -34,8 +34,10 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics);
|
||||
makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics);
|
||||
makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics);
|
||||
makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics);
|
||||
makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics);
|
||||
makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -889,12 +889,12 @@ Foam::chemkinReader::chemkinReader(const dictionary& thermoDict)
|
||||
fileName relPath = thermoDict.name().path();
|
||||
if (relPath.size())
|
||||
{
|
||||
if (chemkinFile.size() && chemkinFile[0] != '/')
|
||||
if (!chemkinFile.isAbsolute())
|
||||
{
|
||||
chemkinFile = relPath/chemkinFile;
|
||||
}
|
||||
|
||||
if (thermoFile.size() && thermoFile[0] != '/')
|
||||
if (!thermoFile.isAbsolute())
|
||||
{
|
||||
thermoFile = relPath/thermoFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user