mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
update/remove some tests from applications/test
This commit is contained in:
@ -1,2 +0,0 @@
|
|||||||
getRoots.C
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/getRoots
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
|
|
||||||
/* EXE_LIBS = -lfiniteVolume */
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
#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;
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
calcEntry/calcEntry.C
|
|
||||||
dictionaryTest.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/dictionaryTest
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
|
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "calcEntry.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "IStringStream.H"
|
|
||||||
#include "OStringStream.H"
|
|
||||||
#include "addToMemberFunctionSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionEntries
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(calcEntry, 0);
|
|
||||||
|
|
||||||
addToMemberFunctionSelectionTable
|
|
||||||
(
|
|
||||||
functionEntry,
|
|
||||||
calcEntry,
|
|
||||||
insert,
|
|
||||||
primitiveEntryIstream
|
|
||||||
);
|
|
||||||
|
|
||||||
addToMemberFunctionSelectionTable
|
|
||||||
(
|
|
||||||
functionEntry,
|
|
||||||
calcEntry,
|
|
||||||
insert,
|
|
||||||
dictionaryIstream
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
bool Foam::functionEntries::calcEntry::insert
|
|
||||||
(
|
|
||||||
const dictionary& parentDict,
|
|
||||||
primitiveEntry& entry,
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
{
|
|
||||||
dictionary args(parentDict, is);
|
|
||||||
OStringStream resultStream;
|
|
||||||
resultStream
|
|
||||||
<< (args.lookup("x")[0].number() + args.lookup("y")[0].number());
|
|
||||||
entry.read(parentDict, IStringStream(resultStream.str())());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionEntries::calcEntry::insert
|
|
||||||
(
|
|
||||||
dictionary& parentDict,
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
|
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::functionEntries::calcEntry
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
calcEntry.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef calcEntry_H
|
|
||||||
#define calcEntry_H
|
|
||||||
|
|
||||||
#include "functionEntry.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace functionEntries
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class calcEntry Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class calcEntry
|
|
||||||
:
|
|
||||||
public functionEntry
|
|
||||||
{
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
calcEntry(const calcEntry&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const calcEntry&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("calc");
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
static bool insert
|
|
||||||
(
|
|
||||||
const dictionary& parentDict,
|
|
||||||
primitiveEntry& entry,
|
|
||||||
Istream& is
|
|
||||||
);
|
|
||||||
|
|
||||||
static bool insert
|
|
||||||
(
|
|
||||||
dictionary& parentDict,
|
|
||||||
Istream& is
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace functionEntries
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation,
|
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Application
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "IOstreams.H"
|
|
||||||
#include "IFstream.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
|
|
||||||
using namespace Foam;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
// Main program:
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
IFstream dictStream("testDict");
|
|
||||||
dictionary testDict(dictStream);
|
|
||||||
|
|
||||||
Info<< testDict << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
|
|
||||||
root "";
|
|
||||||
case "";
|
|
||||||
instance "";
|
|
||||||
local "";
|
|
||||||
|
|
||||||
class dictionary;
|
|
||||||
object testDict;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dimensions [ 0 2 -2 0 0 0 0 ];
|
|
||||||
internalField uniform 1;
|
|
||||||
|
|
||||||
active
|
|
||||||
{
|
|
||||||
type turbulentIntensityKineticEnergyInlet;
|
|
||||||
intensity 0.1;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inactive
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
Default_Boundary_Region
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
inlet_1 { $active }
|
|
||||||
inlet_2 { $inactive }
|
|
||||||
inlet_3 { $inactive }
|
|
||||||
|
|
||||||
#include "testDictInc"
|
|
||||||
|
|
||||||
outlet
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value #include "value";
|
|
||||||
x 5;
|
|
||||||
y 6;
|
|
||||||
another #calc{x $x; y $y;};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
inlet_4
|
|
||||||
{
|
|
||||||
type inletOutlet;
|
|
||||||
inletValue $internalField;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uniform 2
|
|
||||||
@ -59,23 +59,24 @@ Gather<T0>::Gather(const T0& localData, const bool redistribute)
|
|||||||
// Receive data
|
// Receive data
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
int slave=Pstream::firstSlave(), procIndex = 1;
|
int slave = Pstream::firstSlave(), procIndex = 1;
|
||||||
slave<=Pstream::lastSlave();
|
slave <= Pstream::lastSlave();
|
||||||
slave++, procIndex++
|
slave++, procIndex++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
fromSlave >> this->operator[](procIndex);
|
fromSlave >> this->operator[](procIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send data
|
// Send data
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
int slave=Pstream::firstSlave(), procIndex = 1;
|
int slave = Pstream::firstSlave(), procIndex = 1;
|
||||||
slave<=Pstream::lastSlave();
|
slave <= Pstream::lastSlave();
|
||||||
slave++, procIndex++
|
slave++, procIndex++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OPstream toSlave(slave);
|
OPstream toSlave(Pstream::scheduled, slave);
|
||||||
|
|
||||||
if (redistribute)
|
if (redistribute)
|
||||||
{
|
{
|
||||||
@ -92,12 +93,13 @@ Gather<T0>::Gather(const T0& localData, const bool redistribute)
|
|||||||
{
|
{
|
||||||
// Slave: send my local data to master
|
// Slave: send my local data to master
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster << localData;
|
toMaster << localData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receive data from master
|
// Receive data from master
|
||||||
{
|
{
|
||||||
IPstream fromMaster(Pstream::masterNo());
|
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
if (redistribute)
|
if (redistribute)
|
||||||
{
|
{
|
||||||
fromMaster >> *this;
|
fromMaster >> *this;
|
||||||
|
|||||||
Reference in New Issue
Block a user