Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (29)
Showing
with 100 additions and 33 deletions
......@@ -29,8 +29,10 @@ volVectorField U
#include "createPhi.H"
// Creating e based thermo
autoPtr<twoPhaseMixtureEThermo> thermo;
thermo.set(new twoPhaseMixtureEThermo(U, phi));
autoPtr<twoPhaseMixtureEThermo> thermo
(
new twoPhaseMixtureEThermo(U, phi)
);
// Create mixture and
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n" << endl;
......
......@@ -49,7 +49,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::ThermoPhaseModel
{
if (createThermo)
{
thermoPtr_.set
thermoPtr_.reset
(
ThermoType::New(fluid.mesh(), this->name()).ptr()
);
......
......@@ -76,7 +76,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
{
if (modelTable.found(pair_))
{
model_.set
model_.reset
(
modelType::New
(
......@@ -88,7 +88,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
if (modelTable.found(pair1In2_))
{
model1In2_.set
model1In2_.reset
(
modelType::New
(
......@@ -100,7 +100,7 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
if (modelTable.found(pair2In1_))
{
model2In1_.set
model2In1_.reset
(
modelType::New
(
......
......@@ -41,7 +41,7 @@ Foam::orderedPhasePair::orderedPhasePair
{
if (aspectRatioTable.found(*this))
{
aspectRatio_.set
aspectRatio_.reset
(
aspectRatioModel::New
(
......
......@@ -132,7 +132,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
phasePair::scalarTable sigmaTable(lookup("sigma"));
phasePair::dictTable aspectRatioTable(lookup("aspectRatio"));
pair_.set
pair_.reset
(
new phasePair
(
......@@ -143,7 +143,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
pair1In2_.set
pair1In2_.reset
(
new orderedPhasePair
(
......@@ -155,7 +155,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
pair2In1_.set
pair2In1_.reset
(
new orderedPhasePair
(
......@@ -170,7 +170,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
// Models
drag_.set
drag_.reset
(
new BlendedInterfacialModel<dragModel>
(
......@@ -187,7 +187,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
virtualMass_.set
virtualMass_.reset
(
new BlendedInterfacialModel<virtualMassModel>
(
......@@ -203,7 +203,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
heatTransfer_.set
heatTransfer_.reset
(
new BlendedInterfacialModel<heatTransferModel>
(
......@@ -219,7 +219,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
lift_.set
lift_.reset
(
new BlendedInterfacialModel<liftModel>
(
......@@ -235,7 +235,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
wallLubrication_.set
wallLubrication_.reset
(
new BlendedInterfacialModel<wallLubricationModel>
(
......@@ -251,7 +251,7 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
);
turbulentDispersion_.set
turbulentDispersion_.reset
(
new BlendedInterfacialModel<turbulentDispersionModel>
(
......
......@@ -103,7 +103,7 @@ public:
int main(int argc, char *argv[])
{
argList::validArgs.append("ODESolver");
argList::addArgument("ODESolver");
argList args(argc, argv);
// Create the ODE system
......
......@@ -82,7 +82,7 @@ inline void reportInfo()
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.insert("file .. fileN");
argList::addArgument("file .. fileN");
argList::addBoolOption("mask", "report information about the bit masks");
argList::addBoolOption("count", "test the count() method");
......
......@@ -40,7 +40,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::validArgs.append("patch");
argList::addArgument("patch");
#include "setRootCase.H"
#include "createTime.H"
......
......@@ -201,7 +201,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
argList::validArgs.append("patch");
argList::addArgument("patch");
#include "setRootCase.H"
#include "createTime.H"
......
......@@ -41,7 +41,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::validArgs.append("(patches)");
argList::addArgument("(patches)");
#include "setRootCase.H"
#include "createTime.H"
......
......@@ -38,12 +38,24 @@ int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::noFunctionObjects();
// argList::noFunctionObjects();
argList::removeOption("case");
argList::addOption("label", "value", "Test parsing of label");
argList::addOption("scalar", "value", "Test parsing of scalar");
// These are actually lies (never had -parseLabel, -parseScalar etc),
// but good for testing...
// Emits warning about it being old
argList::addOptionCompat("label", {"parseLabel", 1612});
// Specifying version=0 to use alias without any warnings
argList::addOptionCompat("scalar", {"parseScalar", 0});
// Fake a future option...
argList::addOptionCompat("label", {"parse-label", 2112});
argList args(argc, argv);
label ival;
......
......@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
"more information about decomposition"
);
argList::validArgs.append("kaffpa-output-file");
argList::addArgument("kaffpa-output-file");
// Include explicit constant options, have zero from time range
timeSelector::addOptions(true, false);
......
......@@ -42,7 +42,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.insert("dict .. dictN");
argList::addArgument("dict .. dictN");
argList args(argc, argv, false, true);
Info<< nl
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -30,8 +30,10 @@ Description
#include "DynamicList.H"
#include "IOstreams.H"
#include "fileNameList.H"
#include "stringOps.H"
#include "stringList.H"
#include "wordList.H"
#include "SubStrings.H"
using namespace Foam;
......@@ -53,6 +55,26 @@ int print(const CStringList& cstrLst)
}
// Using nullptr termination
int print(char *argv[])
{
if (!argv)
{
Info<< "argv=null" << endl;
return 0;
}
int i=0;
while (argv[i])
{
Info<< " argv[" << i << "] = \"" << argv[i] << "\"" << endl;
++i;
}
return i;
}
// Main program:
int main(int argc, char *argv[])
......@@ -62,18 +84,49 @@ int main(int argc, char *argv[])
dynlst.append("string1 with content");
dynlst.append("string2 other content");
dynlst.append("string3 done");
dynlst.append("string3 more");
dynlst.append("string4 done");
{
CStringList inC(dynlst);
Info<< "input: " << dynlst << endl;
Info<< "input: " << dynlst << nl;
print(inC);
Info<< "null-terminated string list" << nl;
print(inC.strings());
Info<< "sublist: starting at " << inC.size()/2 << nl;
print(inC.strings(inC.size()/2));
Info<< nl;
}
{
string testInput
(
" A test input line with various spacing "
" and text to be split on whitespace "
);
Info<< testInput << nl;
SubStrings<string> args = stringOps::splitSpace(testInput);
Info<< "split into " << args.size() << " args" << nl;
CStringList inC(args);
print(inC);
Info<< "sublist: starting at " << inC.size()/2 << nl;
print(inC.strings(inC.size()/2));
Info<< nl;
}
Info<<"command-line with " << CStringList::count(argv) << " items"<< endl;
print(argc, argv);
Info<< nl;
{
dynlst.clear();
for (int i=0; i<argc; ++i)
......
......@@ -41,7 +41,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::validArgs.append("file");
argList::addArgument("file");
#include "setRootCase.H"
if (!Pstream::parRun())
......
......@@ -43,7 +43,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.insert("dict .. dictN");
argList::addArgument("dict .. dictN");
argList args(argc, argv, false, true);
{
......
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
argList::addBoolOption("info", "report token info");
argList::addBoolOption("value", "report token value");
argList::validArgs.insert("dict .. dictN");
argList::addArgument("dict .. dictN");
argList args(argc, argv, false, true);
const bool optInfo = args.optionFound("info");
......
......@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::validArgs.insert("fileName .. fileNameN");
argList::addArgument("fileName .. fileNameN");
argList args(argc, argv, false, true);
......
......@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
"list",
"List directories or files to be checked"
);
argList::validArgs.insert("file...");
argList::addArgument("file...");
argList::addNote
(
......
......@@ -57,7 +57,7 @@ bool notEqual(const scalar s1, const scalar s2, const scalar tol)
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
argList::validArgs.append("inflate (true|false)");
argList::addArgument("inflate (true|false)");
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
......