mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
conflict resolution
This commit is contained in:
@ -28,6 +28,8 @@ Description
|
||||
|
||||
#include "UIndirectList.H"
|
||||
#include "IOstreams.H"
|
||||
#include "ListOps.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -52,29 +54,32 @@ int main(int argc, char *argv[])
|
||||
|
||||
UIndirectList<double> idl(completeList, addresses);
|
||||
|
||||
forAll(idl, i)
|
||||
{
|
||||
Info<< idl[i] << token::SPACE;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
Info<< idl << "\n";
|
||||
|
||||
idl[1] = -666;
|
||||
|
||||
Info<< "idl[1] changed:" << idl() << endl;
|
||||
Info<< "idl[1] changed:" << idl << endl;
|
||||
|
||||
idl = -999;
|
||||
|
||||
Info<< "idl changed:" << idl() << endl;
|
||||
Info<< "idl changed:" << idl << endl;
|
||||
|
||||
UIndirectList<double> idl2(idl);
|
||||
|
||||
Info<< "idl2:" << idl2() << endl;
|
||||
Info<< "idl2: " << idl2 << endl;
|
||||
|
||||
idl = idl2();
|
||||
|
||||
Info<< "idl assigned from UList:" << idl() << endl;
|
||||
{
|
||||
List<double> ident(idl.size());
|
||||
|
||||
forAll(ident, i)
|
||||
{
|
||||
ident[i] = ident.size() - i;
|
||||
}
|
||||
idl = ident;
|
||||
}
|
||||
|
||||
Info<< "idl assigned from UList:" << idl << endl;
|
||||
|
||||
List<double> realList = UIndirectList<double>(completeList, addresses);
|
||||
|
||||
|
||||
@ -70,6 +70,28 @@ int main(int argc, char *argv[])
|
||||
string test2("~OpenFOAM/controlDict");
|
||||
Info<< test2 << " => " << test2.expand() << endl;
|
||||
|
||||
// replace controlDict with "newName"
|
||||
{
|
||||
string::size_type i = test2.rfind('/');
|
||||
|
||||
if (i == string::npos)
|
||||
{
|
||||
test2 = "newName";
|
||||
}
|
||||
else
|
||||
{
|
||||
// this uses the std::string::replace
|
||||
test2.replace(i+1, string::npos, "newName");
|
||||
}
|
||||
Info<< "after replace: " << test2 << endl;
|
||||
|
||||
// do another replace
|
||||
// this uses the Foam::string::replace
|
||||
test2.replace("OpenFOAM", "openfoam");
|
||||
|
||||
Info<< "after replace: " << test2 << endl;
|
||||
}
|
||||
|
||||
string s;
|
||||
Sin.getLine(s);
|
||||
|
||||
@ -78,8 +100,7 @@ int main(int argc, char *argv[])
|
||||
cout<< "output string with " << s2.length() << " characters\n";
|
||||
cout<< "ostream<< >" << s2 << "<\n";
|
||||
Info<< "Ostream<< >" << s2 << "<\n";
|
||||
Info<< "hash:" << unsigned(string::hash()(s2)) << endl;
|
||||
|
||||
Info<< "hash:" << hex << string::hash()(s2) << endl;
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
|
||||
@ -30,8 +30,7 @@ Description
|
||||
|
||||
#include "arcEdge.H"
|
||||
#include "mathematicalConstants.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -40,8 +39,7 @@ namespace Foam
|
||||
defineTypeNameAndDebug(arcEdge, 0);
|
||||
|
||||
// Add the curvedEdge constructor functions to the hash tables
|
||||
curvedEdge::addIstreamConstructorToTable<arcEdge>
|
||||
addArcEdgeIstreamConstructorToTable_;
|
||||
addToRunTimeSelectionTable(curvedEdge, arcEdge, Istream);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,26 +41,7 @@ namespace Foam
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(curvedEdge, 0);
|
||||
|
||||
// Define the constructor function hash tables
|
||||
HashTable<curvedEdge::IstreamConstructorPtr_>*
|
||||
curvedEdge::IstreamConstructorTablePtr_;
|
||||
|
||||
|
||||
// Hash table Constructor called from the table add functions.
|
||||
|
||||
void curvedEdge::constructTables()
|
||||
{
|
||||
static bool constructed = false;
|
||||
|
||||
if (!constructed)
|
||||
{
|
||||
curvedEdge::IstreamConstructorTablePtr_
|
||||
= new HashTable<curvedEdge::IstreamConstructorPtr_>;
|
||||
|
||||
constructed = true;
|
||||
}
|
||||
}
|
||||
defineRunTimeSelectionTable(curvedEdge, Istream);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -117,10 +98,11 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
|
||||
|
||||
word curvedEdgeType(is);
|
||||
|
||||
HashTable<IstreamConstructorPtr_>::iterator curvedEdgeConstructorIter =
|
||||
IstreamConstructorTablePtr_->find(curvedEdgeType);
|
||||
IstreamConstructorTable::iterator cstrIter =
|
||||
IstreamConstructorTablePtr_
|
||||
->find(curvedEdgeType);
|
||||
|
||||
if (curvedEdgeConstructorIter == IstreamConstructorTablePtr_->end())
|
||||
if (cstrIter == IstreamConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
|
||||
<< "Unknown curvedEdge type " << curvedEdgeType << endl << endl
|
||||
@ -129,7 +111,7 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<curvedEdge>(curvedEdgeConstructorIter()(points, is));
|
||||
return autoPtr<curvedEdge>(cstrIter()(points, is));
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +159,6 @@ Ostream& operator<<(Ostream& os, const curvedEdge& p)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -63,51 +63,23 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
// Constructor Hash tables
|
||||
|
||||
//- Construct from Istream function pointer type
|
||||
typedef autoPtr<curvedEdge> (*IstreamConstructorPtr_)
|
||||
(const pointField&, Istream&);
|
||||
|
||||
//- Construct from Istream function pointer table pointer
|
||||
static HashTable<IstreamConstructorPtr_>*
|
||||
IstreamConstructorTablePtr_;
|
||||
//- Runtime type information
|
||||
TypeName("curvedEdge");
|
||||
|
||||
|
||||
// Hash table constructor classes and functions
|
||||
// Declare run-time constructor selection tables
|
||||
|
||||
//- Hash table Constructor.
|
||||
// Must be called from the table add functions below.
|
||||
static void constructTables();
|
||||
|
||||
|
||||
//- Class to add constructor from Istream to Hash table
|
||||
template<class curvedEdgeType>
|
||||
class addIstreamConstructorToTable
|
||||
{
|
||||
public:
|
||||
|
||||
static autoPtr<curvedEdge> New
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
curvedEdge,
|
||||
Istream,
|
||||
(
|
||||
const pointField& points,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
return autoPtr<curvedEdge>(new curvedEdgeType(points, is));
|
||||
}
|
||||
|
||||
addIstreamConstructorToTable()
|
||||
{
|
||||
curvedEdge::constructTables();
|
||||
|
||||
curvedEdge::IstreamConstructorTablePtr_
|
||||
->insert(curvedEdgeType::typeName, New);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("curvedEdge");
|
||||
),
|
||||
(points, is)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
|
||||
#include "polySplineEdge.H"
|
||||
#include "BSpline.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,8 +35,7 @@ namespace Foam
|
||||
defineTypeNameAndDebug(polySplineEdge, 0);
|
||||
|
||||
// Add the curvedEdge constructor functions to the hash tables
|
||||
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
||||
addPolySplineEdgeIstreamConstructorToTable_;
|
||||
addToRunTimeSelectionTable(curvedEdge, polySplineEdge, Istream);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from Istream setting pointsList
|
||||
polySplineEdge(const pointField& points,Istream& is);
|
||||
polySplineEdge(const pointField& points, Istream& is);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
@ -27,9 +27,8 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "simpleSplineEdge.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -39,10 +38,8 @@ namespace Foam
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(simpleSplineEdge, 0);
|
||||
addToRunTimeSelectionTable(curvedEdge, simpleSplineEdge, Istream);
|
||||
|
||||
// Add the curvedEdge constructor functions to the hash tables
|
||||
curvedEdge::addIstreamConstructorToTable<simpleSplineEdge>
|
||||
addSimpleSplineEdgeIstreamConstructorToTable_;
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -29,6 +29,9 @@ Description
|
||||
|
||||
#include "argList.H"
|
||||
#include "dictionary.H"
|
||||
#include "IFstream.H"
|
||||
#include "IOobject.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -38,18 +41,108 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::validOptions.insert("new", "");
|
||||
argList::validOptions.insert("old", "");
|
||||
|
||||
wordList ds(debug::debugSwitches().toc());
|
||||
sort(ds);
|
||||
Info<< "debug switches: " << ds << endl;
|
||||
Foam::argList args(argc, argv);
|
||||
|
||||
wordList currDebug(debug::debugSwitches().toc());
|
||||
wordList currInfo(debug::infoSwitches().toc());
|
||||
wordList currOpt(debug::optimisationSwitches().toc());
|
||||
|
||||
if (args.options().found("old") || args.options().found("new"))
|
||||
{
|
||||
dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
|
||||
|
||||
wordHashSet oldDebug
|
||||
(
|
||||
controlDict.subDict("DebugSwitches").toc()
|
||||
);
|
||||
|
||||
wordHashSet oldInfo
|
||||
(
|
||||
controlDict.subDict("InfoSwitches").toc()
|
||||
);
|
||||
|
||||
wordHashSet oldOpt
|
||||
(
|
||||
controlDict.subDict("OptimisationSwitches").toc()
|
||||
);
|
||||
|
||||
|
||||
wordHashSet hashset;
|
||||
wordList listing;
|
||||
|
||||
|
||||
// list old switches - but this can't work since the (old) inserted
|
||||
// switches are in both sets
|
||||
// Workaround:
|
||||
// 1. run without any options (get complete list)
|
||||
// 2. comment out DebugSwitches, run again with -new to find new ones
|
||||
// and do a diff
|
||||
if (args.options().found("old"))
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
hashset = oldDebug;
|
||||
hashset -= currDebug;
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "old DebugSwitches: " << listing << endl;
|
||||
|
||||
hashset = oldInfo;
|
||||
hashset -= currInfo;
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "old InfoSwitches: " << listing << endl;
|
||||
|
||||
hashset = oldOpt;
|
||||
hashset -= currOpt;
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "old OptimisationSwitches: " << listing << endl;
|
||||
}
|
||||
|
||||
// list new switches
|
||||
if (args.options().found("new"))
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
hashset = currDebug;
|
||||
hashset -= oldDebug;
|
||||
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "new DebugSwitches: " << listing << endl;
|
||||
|
||||
hashset = currInfo;
|
||||
hashset -= oldInfo;
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "new InfoSwitches: " << listing << endl;
|
||||
|
||||
hashset = currOpt;
|
||||
hashset -= oldOpt;
|
||||
listing = hashset.toc();
|
||||
sort(listing);
|
||||
Info<< "new OptimisationSwitches: " << listing << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
|
||||
sort(currDebug);
|
||||
Info<< "DebugSwitches: " << currDebug << endl;
|
||||
|
||||
sort(currInfo);
|
||||
Info<< "InfoSwitches: " << currInfo << endl;
|
||||
|
||||
sort(currOpt);
|
||||
Info<< "OptimisationSwitches: " << currOpt << endl;
|
||||
}
|
||||
|
||||
wordList is(debug::infoSwitches().toc());
|
||||
sort(is);
|
||||
Info<< "info switches: " << is << endl;
|
||||
|
||||
wordList os(debug::optimisationSwitches().toc());
|
||||
sort(os);
|
||||
Info<< "optimisation switches: " << os << endl;
|
||||
|
||||
Info<< "done" << endl;
|
||||
|
||||
|
||||
@ -312,7 +312,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir(runTime.timePath()/"lagrangian", fileName::DIRECTORY)
|
||||
readDir(runTime.timePath()/cloud::prefix, fileName::DIRECTORY)
|
||||
);
|
||||
|
||||
// Particles
|
||||
@ -344,7 +344,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
@ -418,7 +418,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::prefix/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
|
||||
@ -88,7 +88,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
(
|
||||
field.name(),
|
||||
procMesh_.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
procMesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef reconstructLagrangian_H
|
||||
#define reconstructLagrangian_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
@ -47,7 +47,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -64,7 +64,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
(
|
||||
fieldName,
|
||||
meshes[i].time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
meshes[i],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -282,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
readDir
|
||||
(
|
||||
databases[procI].timePath()/regionPrefix/"lagrangian",
|
||||
databases[procI].timePath()/regionPrefix/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -300,7 +300,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
procMeshes.meshes()[procI],
|
||||
databases[procI].timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
@ -35,6 +35,7 @@ SourceFiles
|
||||
#ifndef ensightCloudField_H
|
||||
#define ensightCloudField_H
|
||||
|
||||
#include "Cloud.H"
|
||||
#include "IOobject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -211,7 +211,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList cloudDirs = readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::prefix/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = cloudObjs.lookup("positions");
|
||||
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudIter.key()
|
||||
cloud::prefix/cloudIter.key()
|
||||
);
|
||||
|
||||
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
|
||||
@ -426,7 +426,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList currentCloudDirs = readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -449,7 +449,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
@ -42,7 +42,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
||||
|
||||
caseFile
|
||||
<< setw(16) << "measured: 2"
|
||||
<< fileName(dataMask/"lagrangian"/cloudName/"positions").c_str()
|
||||
<< fileName(dataMask/cloud::prefix/cloudName/"positions").c_str()
|
||||
<< nl;
|
||||
}
|
||||
caseFile
|
||||
@ -122,7 +122,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
||||
ensightType,
|
||||
fieldName,
|
||||
dataMask,
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
cloudNo,
|
||||
2
|
||||
);
|
||||
|
||||
@ -27,7 +27,6 @@ License
|
||||
#include "ensightOutputFunctions.H"
|
||||
|
||||
#include "passiveParticle.H"
|
||||
#include "Cloud.H"
|
||||
#include "IOField.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
@ -101,7 +100,7 @@ void ensightParticlePositions
|
||||
{
|
||||
Cloud<passiveParticle> parcels(mesh, cloudName, false);
|
||||
|
||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
||||
fileName cloudDir = subDir/cloud::prefix/cloudName;
|
||||
fileName postFileName = cloudDir/"positions";
|
||||
|
||||
// the ITER/lagrangian subdirectory must exist
|
||||
@ -165,7 +164,7 @@ void ensightLagrangianField
|
||||
{
|
||||
Info<< " " << fieldObject.name() << flush;
|
||||
|
||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
||||
fileName cloudDir = subDir/cloud::prefix/cloudName;
|
||||
fileName postFileName = cloudDir/fieldObject.name();
|
||||
|
||||
string title =
|
||||
|
||||
@ -23,9 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
miscellaneous collection of functions and template related
|
||||
to Ensight data
|
||||
Miscellaneous collection of functions and template related to Ensight data
|
||||
|
||||
SourceFiles
|
||||
ensightOutputFunctions.C
|
||||
@ -36,6 +34,7 @@ SourceFiles
|
||||
#define ensightOutputFunctions_H
|
||||
|
||||
#include "ensightFile.H"
|
||||
#include "Cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobject.H"
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ if (timeDirs.size() > 1)
|
||||
runTime.path()
|
||||
/ timeDirs[timeDirs.size() - 1].name()
|
||||
/ regionPrefix
|
||||
/ "lagrangian",
|
||||
/ cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -55,7 +55,7 @@ if (timeDirs.size() > 1)
|
||||
(
|
||||
mesh,
|
||||
timeDirs[timeDirs.size() - 1].name(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::prefix/cloudName
|
||||
);
|
||||
|
||||
bool hasPositions = false;
|
||||
|
||||
@ -324,7 +324,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const word& cloudName = cloudIter.key();
|
||||
|
||||
if (!isDir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
|
||||
if
|
||||
(
|
||||
!isDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/
|
||||
cloud::prefix/cloudName
|
||||
)
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -333,7 +340,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::prefix/cloudName
|
||||
);
|
||||
|
||||
// check that the positions field is present for this time
|
||||
@ -365,7 +372,8 @@ int main(int argc, char *argv[])
|
||||
if (!fieldObject)
|
||||
{
|
||||
Info<< "missing "
|
||||
<< runTime.timeName()/"lagrangian"/cloudName/fieldName
|
||||
<< runTime.timeName()/cloud::prefix/cloudName
|
||||
/ fieldName
|
||||
<< endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
||||
(
|
||||
sprayScalarNames[fieldI],
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -53,7 +53,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
||||
(
|
||||
sprayVectorNames[fieldI],
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -42,7 +42,7 @@ forAll(Times, timeI)
|
||||
|
||||
|
||||
// Same for spray
|
||||
IOobjectList sprayObjects(mesh, runTime.timeName(), "lagrangian");
|
||||
IOobjectList sprayObjects(mesh, runTime.timeName(), cloud::prefix);
|
||||
{
|
||||
wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
|
||||
forAll(fieldNames, fieldI)
|
||||
|
||||
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
||||
"volScalarField",
|
||||
"volVectorField",
|
||||
"surfaceScalarField",
|
||||
"lagrangian"
|
||||
cloud::prefix
|
||||
};
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
for(label i=0; i < nTypes; i++)
|
||||
for (label i=0; i < nTypes; i++)
|
||||
{
|
||||
wordList fieldNames = objects.names(fieldTypes[i]);
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
if (fieldTypes[i] == "volScalarField")
|
||||
{
|
||||
gmvFile << "variable" << nl;
|
||||
}
|
||||
for(label j=0; j < fieldNames.size(); j++)
|
||||
for (label j=0; j < fieldNames.size(); j++)
|
||||
{
|
||||
|
||||
word fieldName = fieldNames[j];
|
||||
@ -20,7 +20,7 @@ for(label i=0; i < nTypes; i++)
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
if (fieldTypes[i] == "volScalarField")
|
||||
{
|
||||
volScalarField gmvScalarField(fieldObject, mesh);
|
||||
gmvFile << fieldName << " 0" << nl;
|
||||
@ -31,21 +31,21 @@ for(label i=0; i < nTypes; i++)
|
||||
gmvFile << nl;
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "volVectorField" )
|
||||
if (fieldTypes[i] == "volVectorField")
|
||||
{
|
||||
if (fieldName == vComp)
|
||||
{
|
||||
volVectorField gmvVectorField(fieldObject, mesh);
|
||||
gmvFile << "velocity 0" << nl;
|
||||
for(label indx=0;indx<mesh.nCells();indx++)
|
||||
for (label indx=0;indx<mesh.nCells();indx++)
|
||||
{
|
||||
gmvFile << gmvVectorField[indx].x() << " ";
|
||||
}
|
||||
for(label indx=0;indx<mesh.nCells();indx++)
|
||||
for (label indx=0;indx<mesh.nCells();indx++)
|
||||
{
|
||||
gmvFile << gmvVectorField[indx].y() << " ";
|
||||
}
|
||||
for(label indx=0;indx<mesh.nCells();indx++)
|
||||
for (label indx=0;indx<mesh.nCells();indx++)
|
||||
{
|
||||
gmvFile << gmvVectorField[indx].z() << " ";
|
||||
}
|
||||
@ -53,20 +53,20 @@ for(label i=0; i < nTypes; i++)
|
||||
}
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "surfaceScalarField" )
|
||||
if (fieldTypes[i] == "surfaceScalarField")
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "lagrangian")
|
||||
if (fieldTypes[i] == cloud::prefix)
|
||||
{
|
||||
IOobject lagrangianHeader
|
||||
(
|
||||
"positions",
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
@ -75,7 +75,7 @@ for(label i=0; i < nTypes; i++)
|
||||
{
|
||||
Cloud<passiveParticle> particles(mesh);
|
||||
|
||||
IOobjectList objects(mesh, runTime.timeName(), "lagrangian");
|
||||
IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
|
||||
|
||||
wordList lagrangianScalarNames = objects.names("scalarField");
|
||||
wordList lagrangianVectorNames = objects.names("vectorField");
|
||||
@ -87,7 +87,7 @@ for(label i=0; i < nTypes; i++)
|
||||
}
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
if (fieldTypes[i] == "volScalarField")
|
||||
{
|
||||
gmvFile << "endvars" << nl;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ forAll(lagrangianScalarNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -73,7 +73,7 @@ forAll(lagrangianVectorNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -40,7 +40,7 @@ forAll(lagrangianScalarNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -914,7 +914,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -925,18 +925,18 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
if (positionsPtr)
|
||||
{
|
||||
mkDir(fvPath/"lagrangian"/cloudDirs[i]);
|
||||
mkDir(fvPath/cloud::prefix/cloudDirs[i]);
|
||||
|
||||
fileName lagrFileName
|
||||
(
|
||||
fvPath/"lagrangian"/cloudDirs[i]/cloudDirs[i]
|
||||
fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i]
|
||||
+ "_" + name(timeI) + ".vtk"
|
||||
);
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ SourceFiles
|
||||
|
||||
#include "globalPointPatch.H"
|
||||
#include "OFstream.H"
|
||||
#include "Cloud.H"
|
||||
#include "volFields.H"
|
||||
#include "pointFields.H"
|
||||
#include "vtkMesh.H"
|
||||
|
||||
@ -41,7 +41,7 @@ void Foam::lagrangianWriter::writeIOField(const wordList& objects)
|
||||
(
|
||||
object,
|
||||
vMesh_.mesh().time().timeName(),
|
||||
"lagrangian"/cloudName_,
|
||||
cloud::prefix/cloudName_,
|
||||
vMesh_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
||||
@ -58,6 +58,11 @@ SourceFiles
|
||||
#ifndef vtkPV3Foam_H
|
||||
#define vtkPV3Foam_H
|
||||
|
||||
// do not include legacy strstream headers
|
||||
#ifndef VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||
# define VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||
#endif
|
||||
|
||||
#include "className.H"
|
||||
#include "fileName.H"
|
||||
#include "stringList.H"
|
||||
|
||||
@ -266,7 +266,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
|
||||
(
|
||||
mesh,
|
||||
dbPtr_().timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::prefix/cloudName
|
||||
);
|
||||
pruneObjectList(objects, selectedFields);
|
||||
|
||||
|
||||
@ -30,6 +30,8 @@ InClass
|
||||
#ifndef vtkPV3FoamLagrangianFields_H
|
||||
#define vtkPV3FoamLagrangianFields_H
|
||||
|
||||
#include "Cloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -53,7 +53,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::lagrangianVTKMesh - timePath "
|
||||
<< mesh.time().timePath()/"lagrangian"/cloudName << endl;
|
||||
<< mesh.time().timePath()/cloud::prefix/cloudName << endl;
|
||||
printMemory();
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
(
|
||||
mesh,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::prefix/cloudName
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
@ -34,6 +34,7 @@ License
|
||||
#include "IOPtrList.H"
|
||||
#include "polyBoundaryMeshEntries.H"
|
||||
#include "entry.H"
|
||||
#include "Cloud.H"
|
||||
#include "vtkPV3FoamReader.h"
|
||||
|
||||
// local headers
|
||||
@ -148,16 +149,16 @@ void Foam::vtkPV3Foam::updateInfoLagrangian()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfoLagrangian" << nl
|
||||
<< " " << dbPtr_->timePath()/"lagrangian" << endl;
|
||||
<< " " << dbPtr_->timePath()/cloud::prefix << endl;
|
||||
}
|
||||
|
||||
|
||||
// use the db directly since this might be called without a mesh,
|
||||
// but the region must get added back in
|
||||
fileName lagrangianPrefix("lagrangian");
|
||||
fileName lagrangianPrefix(cloud::prefix);
|
||||
if (meshRegion_ != polyMesh::defaultRegion)
|
||||
{
|
||||
lagrangianPrefix = meshRegion_/"lagrangian";
|
||||
lagrangianPrefix = meshRegion_/cloud::prefix;
|
||||
}
|
||||
|
||||
// Search for list of lagrangian objects for this time
|
||||
@ -463,10 +464,10 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
|
||||
|
||||
// use the db directly since this might be called without a mesh,
|
||||
// but the region must get added back in
|
||||
fileName lagrangianPrefix("lagrangian");
|
||||
fileName lagrangianPrefix(cloud::prefix);
|
||||
if (meshRegion_ != polyMesh::defaultRegion)
|
||||
{
|
||||
lagrangianPrefix = meshRegion_/"lagrangian";
|
||||
lagrangianPrefix = meshRegion_/cloud::prefix;
|
||||
}
|
||||
|
||||
IOobjectList objects
|
||||
|
||||
@ -137,7 +137,12 @@ int USERD_get_gold_part_build_info
|
||||
|
||||
if (Numparts_available > nPatches+1)
|
||||
{
|
||||
strncpy(part_descriptions[nPatches+1], sprayName.c_str(), Z_BUFL);
|
||||
strncpy
|
||||
(
|
||||
part_descriptions[nPatches+1],
|
||||
cloud::prefix.c_str(),
|
||||
Z_BUFL
|
||||
);
|
||||
number_of_elements[nPatches+1][Z_POINT] = sprayPtr->size();
|
||||
number_of_nodes[nPatches+1] = sprayPtr->size();
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ int USERD_set_filenames
|
||||
(
|
||||
"positions",
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -179,7 +179,7 @@ int USERD_set_filenames
|
||||
|
||||
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
|
||||
|
||||
IOobjectList objects(*meshPtr, runTime.timeName(), "lagrangian");
|
||||
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
|
||||
|
||||
lagrangianScalarNames =
|
||||
(const wordList&)objects.names(sprayScalarFieldName);
|
||||
|
||||
@ -12,7 +12,7 @@ if (nVar >= 0)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -14,7 +14,7 @@ if (nVar >= 0)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::prefix,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -32,7 +32,6 @@ static bool isSpray[maxNames];
|
||||
static word scalarName = "volScalarField";
|
||||
static word vectorName = "volVectorField";
|
||||
static word tensorName = "volTensorField";
|
||||
static word sprayName = "lagrangian";
|
||||
static word sprayScalarFieldName = "scalarField";
|
||||
static word sprayVectorFieldName = "vectorField";
|
||||
static word sprayTensorFieldName = "tensorField";
|
||||
|
||||
@ -39,10 +39,12 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
# include "addRegionOption.H"
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
# include "createNamedMesh.H"
|
||||
|
||||
IOprobes sniff
|
||||
(
|
||||
|
||||
@ -2,6 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
@ -9,5 +10,6 @@ EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lsurfMesh \
|
||||
-ltriSurface \
|
||||
-llagrangian
|
||||
|
||||
@ -40,6 +40,7 @@ Description
|
||||
- dx : DX scalar or vector format
|
||||
- vtk : VTK ascii format
|
||||
- raw : x y z value format for use with e.g. gnuplot 'splot'.
|
||||
- obj : Wavefron stl. Does not contain values!
|
||||
- stl : ascii stl. Does not contain values!
|
||||
|
||||
@param interpolationScheme : interpolation scheme, choice of \n
|
||||
|
||||
@ -30,7 +30,10 @@ setFormat raw;
|
||||
// dx : DX scalar or vector format
|
||||
// vtk : VTK ascii format
|
||||
// raw : x y z value format for use with e.g. gnuplot 'splot'.
|
||||
// stl : ascii stl. Does not contain values!
|
||||
//
|
||||
// Note:
|
||||
// other formats such as obj, stl, etc can also be written (by proxy)
|
||||
// but without any values!
|
||||
surfaceFormat vtk;
|
||||
|
||||
// interpolationScheme. choice of
|
||||
|
||||
@ -34,6 +34,7 @@ Description
|
||||
#ifndef MapLagrangianFields_H
|
||||
#define MapLagrangianFields_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "GeometricField.H"
|
||||
#include "meshToMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
@ -60,8 +61,7 @@ void MapLagrangianFields
|
||||
|
||||
forAllIter(IOobjectList, fields, fieldIter)
|
||||
{
|
||||
Info<< " mapping lagrangian field "
|
||||
<< fieldIter()->name() << endl;
|
||||
Info<< " mapping lagrangian field " << fieldIter()->name() << endl;
|
||||
|
||||
// Read field (does not need mesh)
|
||||
IOField<Type> fieldSource(*fieldIter());
|
||||
@ -73,7 +73,7 @@ void MapLagrangianFields
|
||||
(
|
||||
fieldIter()->name(),
|
||||
meshTarget.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
meshTarget,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
||||
@ -94,7 +94,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
||||
(
|
||||
readDir
|
||||
(
|
||||
meshSource.time().timePath()/"lagrangian",
|
||||
meshSource.time().timePath()/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -106,7 +106,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
||||
(
|
||||
meshSource,
|
||||
meshSource.time().timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::prefix/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = objects.lookup("positions");
|
||||
|
||||
@ -271,13 +271,57 @@ int main(int argc, char *argv[])
|
||||
args.caseName()
|
||||
);
|
||||
|
||||
// start with "constant"
|
||||
runTime.setTime(instant(0, runTime.constant()), 0);
|
||||
|
||||
Info<< "runTime.instance() = " << runTime.instance() << endl;
|
||||
Info<< "runTime.timeName() = " << runTime.timeName() << endl;
|
||||
|
||||
|
||||
Info<< "write MeshedSurface 'yetAnother' via proxy as surfMesh"
|
||||
<< endl;
|
||||
surf.write
|
||||
(
|
||||
runTime,
|
||||
"yetAnother"
|
||||
);
|
||||
|
||||
surfMesh surfIn
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"default",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
MeshedSurface<face> surfIn2(runTime, "foobar");
|
||||
|
||||
Info<<"surfIn2 = " << surfIn2.size() << endl;
|
||||
|
||||
Info<< "surfIn = " << surfIn.size() << endl;
|
||||
|
||||
|
||||
Info<< "writing surfMesh as obj = oldSurfIn.obj" << endl;
|
||||
surfIn.write("oldSurfIn.obj");
|
||||
|
||||
|
||||
Info<< "runTime.instance() = " << runTime.instance() << endl;
|
||||
|
||||
surfMesh surfOut
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mySurf",
|
||||
runTime.instance(),
|
||||
runTime
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
surf.xfer()
|
||||
);
|
||||
@ -299,6 +343,25 @@ int main(int argc, char *argv[])
|
||||
dimless
|
||||
);
|
||||
|
||||
Info<<" surf name= " << surfOut.name() <<nl;
|
||||
Info<< "rename to anotherSurf" << endl;
|
||||
surfOut.rename("anotherSurf");
|
||||
|
||||
Info<<" surf name= " << surfOut.name() <<nl;
|
||||
|
||||
// advance time to 1
|
||||
runTime.setTime(instant(1), 1);
|
||||
surfOut.setInstance(runTime.timeName());
|
||||
|
||||
|
||||
|
||||
Info<< "writing surfMesh again well: " << surfOut.objectPath() << endl;
|
||||
surfOut.write();
|
||||
|
||||
// write directly
|
||||
surfOut.write("someName.ofs");
|
||||
|
||||
#if 1
|
||||
const surfZoneList& zones = surfOut.surfZones();
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
@ -318,9 +381,10 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pointIds",
|
||||
"zoneIds.",
|
||||
// "pointIds",
|
||||
surfOut.instance(),
|
||||
"pointFields",
|
||||
// "pointFields",
|
||||
surfOut,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -337,6 +401,10 @@ int main(int argc, char *argv[])
|
||||
Info<< "write pointIds (for testing only): "
|
||||
<< pointIds.objectPath() << endl;
|
||||
pointIds.write();
|
||||
|
||||
Info<<"surfMesh with these names: " << surfOut.names() << endl;
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
146
etc/controlDict
146
etc/controlDict
@ -34,6 +34,7 @@ Documentation
|
||||
|
||||
DebugSwitches
|
||||
{
|
||||
Analytical 0;
|
||||
APIdiffCoefFunc 0;
|
||||
Ar 0;
|
||||
BICCG 0;
|
||||
@ -57,18 +58,25 @@ DebugSwitches
|
||||
C8H18 0;
|
||||
C9H20 0;
|
||||
CH3OH 0;
|
||||
CallbackRegistry 0;
|
||||
CH4N2O 0;
|
||||
CarnahanStarling 0;
|
||||
CallbackRegistry 0;
|
||||
CentredFitData<biLinearFitPolynomial> 0;
|
||||
CentredFitData<linearFitPolynomial> 0;
|
||||
CentredFitData<quadraticFitPolynomial> 0;
|
||||
CentredFitData<quadraticLinearFitPolynomial> 0;
|
||||
ChomiakInjector 0;
|
||||
Cloud<basicKinematicParcel> 0;
|
||||
Cloud<basicReactingParcel> 0;
|
||||
Cloud<basicThermoParcel> 0;
|
||||
Cloud<indexedParticle> 0;
|
||||
Cloud<kinematicParcel> 0;
|
||||
Cloud<parcel> 0;
|
||||
Cloud<passiveParticle> 0;
|
||||
Cloud<reactingParcel> 0;
|
||||
Cloud<thermoParcel> 0;
|
||||
Cloud<trackedParticle> 0;
|
||||
CoEuler 0;
|
||||
CompositionModel 0;
|
||||
ConeInjection 0;
|
||||
Constant 0;
|
||||
ConstantRateDevolatilisation 0;
|
||||
CrankNicholson 0;
|
||||
CrossPowerLaw 0;
|
||||
@ -77,6 +85,7 @@ DebugSwitches
|
||||
DICGaussSeidel 0;
|
||||
DILU 0;
|
||||
DILUGaussSeidel 0;
|
||||
DataEntry 0;
|
||||
DeardorffDiffStress 0;
|
||||
DispersionModel 0;
|
||||
DispersionRASModel 0;
|
||||
@ -107,39 +116,40 @@ DebugSwitches
|
||||
H2O 0;
|
||||
HashTable 0;
|
||||
HeatTransferModel 0;
|
||||
HerschelBulkley 0;
|
||||
HrenyaSinclair 0;
|
||||
IC8H18 0;
|
||||
ICCG 0;
|
||||
IDDESDelta 0;
|
||||
IDEA 0;
|
||||
IFstream 0;
|
||||
IOMap<dictionary> 0;
|
||||
IOPtrList<MRFZone> 0;
|
||||
IOPtrList<coordinateSystem> 0;
|
||||
IOPtrList<injector> 0;
|
||||
IOPtrList<porousZone> 0;
|
||||
IOobject 0;
|
||||
InjectionModel 0;
|
||||
IntegrationScheme 0;
|
||||
JohnsonJackson 0;
|
||||
KRR4 0;
|
||||
KinematicCloud<kinematicParcel> 0;
|
||||
KinematicCloud<reactingParcel> 0;
|
||||
KinematicCloud<thermoParcel> 0;
|
||||
KinematicParcel<reactingParcel> 0;
|
||||
KinematicParcel<thermoParcel> 0;
|
||||
KinematicCloud<basicKinematicParcel> 0;
|
||||
KinematicCloud<basicReactingParcel> 0;
|
||||
KinematicCloud<basicThermoParcel> 0;
|
||||
KinematicParcel<basicReactingParcel> 0;
|
||||
KinematicParcel<basicThermoParcel> 0;
|
||||
LESModel 0;
|
||||
LESdelta 0;
|
||||
LESfilter 0;
|
||||
LESmodel 0;
|
||||
LISA 0;
|
||||
LRR 0;
|
||||
LRRDiffStress 0;
|
||||
LamBremhorstKE 0;
|
||||
LaunderGibsonRSTM 0;
|
||||
LaunderSharmaKE 0;
|
||||
LduMatrix 1;
|
||||
LienCubicKE 0;
|
||||
LienCubicKELowRe 0;
|
||||
LienLeschzinerLowRe 0;
|
||||
Lun 0;
|
||||
LunSavage 0;
|
||||
MB 0;
|
||||
MC 0;
|
||||
MCV 0;
|
||||
@ -191,11 +201,12 @@ DebugSwitches
|
||||
QUICK 0;
|
||||
QUICKV 0;
|
||||
QZeta 0;
|
||||
RASModel 0;
|
||||
RK 0;
|
||||
RNGkEpsilon 0;
|
||||
RanzMarshall 0;
|
||||
ReactingCloud<reactingParcel> 0;
|
||||
ReactingParcel<reactingParcel> 0;
|
||||
ReactingCloud<basicReactingParcel> 0;
|
||||
ReactingParcel<basicReactingParcel> 0;
|
||||
Rebound 0;
|
||||
ReitzDiwakar 0;
|
||||
ReitzKHRT 0;
|
||||
@ -208,6 +219,8 @@ DebugSwitches
|
||||
SIBS 0;
|
||||
SKA 0;
|
||||
SLTS 0;
|
||||
SRFModel 0;
|
||||
SRFVelocity 0;
|
||||
STARCDRotation 0;
|
||||
Schaeffer 0;
|
||||
SchillerNaumann 0;
|
||||
@ -215,8 +228,9 @@ DebugSwitches
|
||||
SingleKineticRateDevolatilisation 0;
|
||||
SingleMixtureFraction 0;
|
||||
Smagorinsky 0;
|
||||
SmoothSolver 0;
|
||||
SpalartAllmaras 0;
|
||||
SpalartAllmarasDDES 0;
|
||||
SpalartAllmarasIDDES 0;
|
||||
SphereDrag 0;
|
||||
StandardWallInteraction 0;
|
||||
StaticHashTable 0;
|
||||
@ -228,13 +242,17 @@ DebugSwitches
|
||||
SyamlalOBrien 0;
|
||||
SyamlalRogersOBrien 0;
|
||||
TAB 0;
|
||||
ThermoCloud<reactingParcel> 0;
|
||||
ThermoCloud<thermoParcel> 0;
|
||||
ThermoParcel<reactingParcel> 0;
|
||||
ThermoParcel<thermoParcel> 0;
|
||||
Table 0;
|
||||
ThermoCloud<basicReactingParcel> 0;
|
||||
ThermoCloud<basicThermoParcel> 0;
|
||||
ThermoParcel<basicReactingParcel> 0;
|
||||
ThermoParcel<basicThermoParcel> 0;
|
||||
UMIST 0;
|
||||
UMISTV 0;
|
||||
Unix 0;
|
||||
UpwindFitData<cubicUpwindFitPolynomial> 0;
|
||||
UpwindFitData<quadraticLinearUpwindFitPolynomial> 0;
|
||||
UpwindFitData<quadraticUpwindFitPolynomial> 0;
|
||||
WallInteractionModel 0;
|
||||
WenYu 0;
|
||||
aC11H10 0;
|
||||
@ -245,6 +263,9 @@ DebugSwitches
|
||||
addPoint 0;
|
||||
advective 0;
|
||||
algebraicPair 0;
|
||||
alphaContactAngle 0;
|
||||
alphaFixedPressure 0;
|
||||
alphatWallFunction 0;
|
||||
angularOscillatingDisplacement 0;
|
||||
angularOscillatingVelocity 0;
|
||||
anisotropic 0;
|
||||
@ -252,14 +273,21 @@ DebugSwitches
|
||||
atomizationModel 0;
|
||||
attachDetach 0;
|
||||
autoHexMeshDriver 0;
|
||||
autoLayerDriver 0;
|
||||
autoRefineDriver 0;
|
||||
autoSnapDriver 0;
|
||||
bC11H10 0;
|
||||
backward 0;
|
||||
basePatch 0;
|
||||
basicKinematicCloud 0;
|
||||
basicKinematicParcel 0;
|
||||
basicMixture 0;
|
||||
basicReactingCloud 0;
|
||||
basicReactingParcel 0;
|
||||
basicThermo 0;
|
||||
basicThermoCloud 0;
|
||||
basicThermoParcel 0;
|
||||
biLinearFit 0;
|
||||
binaryAbsorptionEmission 0;
|
||||
blended 0;
|
||||
blobsSheetAtomization 0;
|
||||
@ -274,7 +302,6 @@ DebugSwitches
|
||||
boxToPoint 0;
|
||||
breakupModel 0;
|
||||
calculated 0;
|
||||
cartesian 0;
|
||||
cell 0;
|
||||
cellClassification 0;
|
||||
cellCuts 0;
|
||||
@ -292,6 +319,8 @@ DebugSwitches
|
||||
cellToFace 0;
|
||||
cellToPoint 0;
|
||||
cellZone 0;
|
||||
centredCECStencil 0;
|
||||
centredCFCStencil 0;
|
||||
chemistryReader 0;
|
||||
chemistrySolver 0;
|
||||
chemkinReader 0;
|
||||
@ -304,24 +333,25 @@ DebugSwitches
|
||||
commSchedule 0;
|
||||
commonRailInjector 0;
|
||||
compound 0;
|
||||
conductivityModel 0;
|
||||
constInjector 0;
|
||||
constant 0;
|
||||
constantAbsorptionEmission 0;
|
||||
constantGammaContactAngle 0;
|
||||
constantAlphaContactAngle 0;
|
||||
constantScatter 0;
|
||||
coordinateRotation 0;
|
||||
coordinateSystem 0;
|
||||
coordinateSystems 0;
|
||||
corrected 0;
|
||||
coupled 0;
|
||||
cubeRootVol 0;
|
||||
cubic 0;
|
||||
cubicUpwindFit 0;
|
||||
curve 0;
|
||||
cyclic 0;
|
||||
cyclicLduInterface 0;
|
||||
cyclicLduInterfaceField 0;
|
||||
cylinderToCell 0;
|
||||
cylindrical 0;
|
||||
dataSchedule 0;
|
||||
decompositionMethod 0;
|
||||
definedHollowConeInjector 0;
|
||||
definedInjector 0;
|
||||
@ -332,6 +362,7 @@ DebugSwitches
|
||||
dimensionSet 1;
|
||||
directMapped 0;
|
||||
directMappedPatch 0;
|
||||
directMappedVelocityFlux 0;
|
||||
directionMixed 0;
|
||||
directional 0;
|
||||
disallowDefaultFvsPatchField 0;
|
||||
@ -345,6 +376,7 @@ DebugSwitches
|
||||
displacementInterpolation 0;
|
||||
displacementLaplacian 0;
|
||||
displacementSBRStress 0;
|
||||
distanceSurface 0;
|
||||
downwind 0;
|
||||
dragModel 0;
|
||||
duplicatePoints 0;
|
||||
@ -352,8 +384,8 @@ DebugSwitches
|
||||
dynMixedSmagorinsky 0;
|
||||
dynOneEqEddy 0;
|
||||
dynSmagorinsky 0;
|
||||
dynamicAlphaContactAngle 0;
|
||||
dynamicFvMesh 0;
|
||||
dynamicGammaContactAngle 0;
|
||||
dynamicInkJetFvMesh 0;
|
||||
dynamicMotionSolverFvMesh 0;
|
||||
dynamicRefineFvMesh 0;
|
||||
@ -363,6 +395,7 @@ DebugSwitches
|
||||
empty 0;
|
||||
engineMesh 0;
|
||||
enrichedPatch 0;
|
||||
epsilonWallFunction 0;
|
||||
errorDrivenRefinement 0;
|
||||
evaporationModel 0;
|
||||
exponential 0;
|
||||
@ -387,13 +420,20 @@ DebugSwitches
|
||||
filteredLinear 0;
|
||||
filteredLinear2 0;
|
||||
filteredLinear2V 0;
|
||||
filteredLinear3 0;
|
||||
filteredLinear3V 0;
|
||||
fixedEnthalpy 0;
|
||||
fixedFluxBuoyantPressure 0;
|
||||
fixedFluxBoussinesqBuoyantPressure 0;
|
||||
fixedFluxPressure 0;
|
||||
fixedGradient 0;
|
||||
fixedInternalEnergy 0;
|
||||
fixedInternalValue 0;
|
||||
fixedNormalSlip 0;
|
||||
fixedPressureCompressibleDensity 0;
|
||||
fixedUnburntEnthalpy 0;
|
||||
fixedValue 0;
|
||||
flowRateInletVelocity 0;
|
||||
fluxCorrectedVelocity 0;
|
||||
foamChemistryReader 0;
|
||||
foamFile 0;
|
||||
@ -416,8 +456,6 @@ DebugSwitches
|
||||
fvTensorMatrix 0;
|
||||
fvVectorMatrix 0;
|
||||
fvsPatchField 0;
|
||||
gammaContactAngle 0;
|
||||
gammaFixedPressure 0;
|
||||
general 0;
|
||||
generic 0;
|
||||
genericPatch 0;
|
||||
@ -429,6 +467,7 @@ DebugSwitches
|
||||
gnuplot 0;
|
||||
gradientDispersionRAS 0;
|
||||
gradientEnthalpy 0;
|
||||
gradientInternalEnergy 0;
|
||||
gradientUnburntEnthalpy 0;
|
||||
granularPressureModel 0;
|
||||
hCombustionThermo 0;
|
||||
@ -459,25 +498,29 @@ DebugSwitches
|
||||
hhuMixtureThermo<veryInhomogeneousMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>> 0;
|
||||
hierarchical 0;
|
||||
hollowConeInjector 0;
|
||||
iC3H8O 0;
|
||||
indexedOctree 0;
|
||||
indexedParticle 0;
|
||||
injectorModel 0;
|
||||
injectorType 0;
|
||||
inletOutlet 0;
|
||||
inletOutletTotalTemperature 0;
|
||||
inputMode 0;
|
||||
interfaceCompression 0;
|
||||
intersectedSurface 0;
|
||||
inverseDistance 0;
|
||||
inverseFaceDistance 0;
|
||||
inversePointDistance 0;
|
||||
inverseVolume 0;
|
||||
isoSurface 0;
|
||||
isoSurfaceCell 0;
|
||||
jplot 0;
|
||||
jumpCyclic 0;
|
||||
kEpsilon 0;
|
||||
kOmega 0;
|
||||
kOmegaSST 0;
|
||||
kOmegaSSTSAS 0;
|
||||
kQRWallFunction 0;
|
||||
kinematicCloud 0;
|
||||
kinematicParcel 0;
|
||||
labelField 0;
|
||||
labelList 0;
|
||||
labelListList 0;
|
||||
@ -496,6 +539,7 @@ DebugSwitches
|
||||
leastSquares 0;
|
||||
leastSquaresVectors 0;
|
||||
level 2;
|
||||
limitWith 0;
|
||||
limited 0;
|
||||
limitedCubic 0;
|
||||
limitedCubic01 0;
|
||||
@ -510,6 +554,7 @@ DebugSwitches
|
||||
limitedSurfaceInterpolationScheme 0;
|
||||
limitedVanLeer 0;
|
||||
linear 0;
|
||||
linearFit 0;
|
||||
linearUpwind 0;
|
||||
linearUpwindV 0;
|
||||
liquid 0;
|
||||
@ -520,7 +565,6 @@ DebugSwitches
|
||||
localPointRegion 0;
|
||||
lowReOneEqEddy 0;
|
||||
manual 0;
|
||||
massFlowRateInletVelocity 0;
|
||||
meshCutAndRemove 0;
|
||||
meshCutter 0;
|
||||
meshModifier 0;
|
||||
@ -532,6 +576,7 @@ DebugSwitches
|
||||
midPointAndFace 0;
|
||||
mixed 0;
|
||||
mixedEnthalpy 0;
|
||||
mixedInternalEnergy 0;
|
||||
mixedSmagorinsky 0;
|
||||
mixedUnburntEnthalpy 0;
|
||||
mixerFvMesh 0;
|
||||
@ -544,22 +589,32 @@ DebugSwitches
|
||||
motionSolver 0;
|
||||
movingConeTopoFvMesh 0;
|
||||
movingWallVelocity 0;
|
||||
muSgsWallFunction 0;
|
||||
muSgsSpalartAllmarasWallFunction 0;
|
||||
multiDirRefinement 0;
|
||||
multiHoleInjector 0;
|
||||
multivariateSelection 0;
|
||||
mutStandardRoughWallFunction 0;
|
||||
mutRoughWallFunction 0;
|
||||
mutSpalartAllmarasStandardRoughWallFunction 0;
|
||||
mutSpalartAllmarasStandardWallFunction 0;
|
||||
mutSpalartAllmarasWallFunction 0;
|
||||
mutWallFunction 0;
|
||||
nC3H8O 0;
|
||||
nbrToCell 0;
|
||||
nearestToCell 0;
|
||||
nearestToPoint 0;
|
||||
noAbsorptionEmission 0;
|
||||
noDragModel 0;
|
||||
noRadiation 0;
|
||||
none 0;
|
||||
normal 0;
|
||||
normalToFace 0;
|
||||
nuSgsWallFunction 0;
|
||||
nutStandardRoughWallFunction 0;
|
||||
nutStandardWallFunction 0;
|
||||
nuSgsSpalartAllmarasWallFunction 0;
|
||||
nutRoughWallFunction 0;
|
||||
nutSpalartAllmarasStandardRoughWallFunction 0;
|
||||
nutSpalartAllmarasStandardWallFunction 0;
|
||||
nutSpalartAllmarasWallFunction 0;
|
||||
nutWallFunction 0;
|
||||
obj 0;
|
||||
objectRegistry 0;
|
||||
octree 0;
|
||||
octreeDataEdges 0;
|
||||
@ -567,7 +622,7 @@ DebugSwitches
|
||||
octreeDataFaceList 0;
|
||||
octreeDataTriSurface 0;
|
||||
off 0;
|
||||
offsetTriSurfaceMesh 0;
|
||||
omegaWallFunction 0;
|
||||
oneEqEddy 0;
|
||||
orientedSurface 0;
|
||||
oscillatingDisplacement 0;
|
||||
@ -609,11 +664,13 @@ DebugSwitches
|
||||
polyMeshInfo 0;
|
||||
polyTopoChange 0;
|
||||
polyTopoChanger 0;
|
||||
powerLaw 0;
|
||||
pressureDirectedInletOutletVelocity 0;
|
||||
pressureDirectedInletVelocity 0;
|
||||
pressureInletOutletVelocity 0;
|
||||
pressureInletUniformVelocity 0;
|
||||
pressureInletVelocity 0;
|
||||
pressureNormalInletOutletVelocity 0;
|
||||
pressureSwirlInjector 0;
|
||||
primitiveMesh 0;
|
||||
primitiveMeshGeometry 0;
|
||||
@ -625,11 +682,13 @@ DebugSwitches
|
||||
pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>> 0;
|
||||
pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>> 0;
|
||||
quadratic 0;
|
||||
radialModel 0;
|
||||
quadraticFit 0;
|
||||
quadraticLinearFit 0;
|
||||
quadraticLinearUpwindFit 0;
|
||||
quadraticUpwindFit 0;
|
||||
radiationModel 0;
|
||||
raw 0;
|
||||
reactingCloud 0;
|
||||
reactingParcel 0;
|
||||
reaction 0;
|
||||
realizableKE 0;
|
||||
refinementHistory 0;
|
||||
@ -637,6 +696,7 @@ DebugSwitches
|
||||
reflect 0;
|
||||
regIOobject 0;
|
||||
regionSplit 0;
|
||||
regionToCell 0;
|
||||
remove 0;
|
||||
removeCell 0;
|
||||
removeCells 0;
|
||||
@ -720,11 +780,12 @@ DebugSwitches
|
||||
tensorAverageField 0;
|
||||
tensorField 0;
|
||||
thermoCloud 0;
|
||||
thermoParcel 0;
|
||||
thermophysicalFunction 0;
|
||||
time 0;
|
||||
timeVaryingGammaContactAngle 0;
|
||||
timeVaryingAlphaContactAngle 0;
|
||||
timeVaryingFlowRateInletVelocity 0;
|
||||
timeVaryingMappedFixedValue 0;
|
||||
timeVaryingTotalPressure 0;
|
||||
timeVaryingUniformFixedValue 0;
|
||||
timer 0;
|
||||
topoAction 0;
|
||||
@ -745,17 +806,19 @@ DebugSwitches
|
||||
treeNode 0;
|
||||
triSurface 0;
|
||||
triSurfaceMesh 0;
|
||||
triSurfaceMeshes 0;
|
||||
turbulenceModel 0;
|
||||
turbulentHeatFluxTemperature 0;
|
||||
turbulentInlet 0;
|
||||
turbulentIntensityKineticEnergyInlet 0;
|
||||
turbulentMixingLengthDissipationRateInlet 0;
|
||||
turbulentMixingLengthFrequencyInlet 0;
|
||||
uncorrected 0;
|
||||
undoableMeshCutter 0;
|
||||
uniform 0;
|
||||
uniformFixedValue 0;
|
||||
unitInjector 0;
|
||||
upwind 0;
|
||||
upwindCFCStencil 0;
|
||||
value 0;
|
||||
vanAlbada 0;
|
||||
vanAlbadaV 0;
|
||||
@ -828,7 +891,6 @@ DimensionedConstants
|
||||
//- Stefan-Boltzmann constant [J/(K4 m2 s)]
|
||||
sigmaSB sigmaSB [1 0 -3 -4 0 0 0] 5.670e-08;
|
||||
|
||||
|
||||
/* USCS units
|
||||
|
||||
//- Universal gas constant [lbm ft2/(s2 kmol R)]
|
||||
|
||||
@ -87,8 +87,8 @@ switch ("$compilerInstall")
|
||||
case OpenFOAM:
|
||||
switch ("$WM_COMPILER")
|
||||
case Gcc:
|
||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
breaksw
|
||||
case Gcc42:
|
||||
|
||||
@ -111,8 +111,8 @@ case "$compilerInstall" in
|
||||
OpenFOAM)
|
||||
case "$WM_COMPILER" in
|
||||
Gcc)
|
||||
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
|
||||
;;
|
||||
Gcc42)
|
||||
|
||||
@ -152,17 +152,12 @@ inline void Foam::FixedList<T, Size>::checkSize(const label size) const
|
||||
}
|
||||
|
||||
|
||||
// Check index i is within valid range (0 ... size-1).
|
||||
// Check index i is within valid range (0 ... size-1)
|
||||
// The check for zero-sized list is already done in static assert
|
||||
template<class T, unsigned Size>
|
||||
inline void Foam::FixedList<T, Size>::checkIndex(const label i) const
|
||||
{
|
||||
if (!Size)
|
||||
{
|
||||
FatalErrorIn("FixedList<T, Size>::checkIndex(const label)")
|
||||
<< "attempt to access element from zero-sized list"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
else if (i < 0 || i >= label(Size))
|
||||
if (i < 0 || unsigned(i) >= Size)
|
||||
{
|
||||
FatalErrorIn("FixedList<T, Size>::checkIndex(const label)")
|
||||
<< "index " << i << " out of range 0 ... " << (Size-1)
|
||||
|
||||
@ -58,10 +58,6 @@ Foam::List<T>::List(const label s)
|
||||
{
|
||||
this->v_ = new T[this->size_];
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,10 +83,6 @@ Foam::List<T>::List(const label s, const T& a)
|
||||
List_ELEM((*this), vp, i) = a;
|
||||
List_END_FOR_ALL
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -119,16 +111,12 @@ Foam::List<T>::List(const List<T>& a)
|
||||
List_END_FOR_ALL
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Construct by transferring the parameter contents
|
||||
template<class T>
|
||||
Foam::List<T>::List(const Xfer<List<T> >& lst)
|
||||
Foam::List<T>::List(const Xfer< List<T> >& lst)
|
||||
{
|
||||
transfer(lst());
|
||||
}
|
||||
@ -165,10 +153,6 @@ Foam::List<T>::List(List<T>& a, bool reUse)
|
||||
List_END_FOR_ALL
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -188,10 +172,6 @@ Foam::List<T>::List(const UList<T>& a, const unallocLabelList& map)
|
||||
List_ELEM((*this), vp, i) = List_ELEM(a, ap, (map[i]));
|
||||
List_END_FOR_ALL
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -234,7 +214,7 @@ Foam::List<T>::List(const FixedList<T, Size>& lst)
|
||||
:
|
||||
UList<T>(NULL, Size)
|
||||
{
|
||||
if (Size)
|
||||
if (this->size_)
|
||||
{
|
||||
this->v_ = new T[this->size_];
|
||||
|
||||
@ -243,10 +223,6 @@ Foam::List<T>::List(const FixedList<T, Size>& lst)
|
||||
this->operator[](i) = lst[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -265,10 +241,6 @@ Foam::List<T>::List(const PtrList<T>& lst)
|
||||
this->operator[](i) = lst[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -293,10 +265,6 @@ Foam::List<T>::List(const SLList<T>& lst)
|
||||
this->operator[](i++) = iter();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -315,10 +283,6 @@ Foam::List<T>::List(const IndirectList<T>& lst)
|
||||
this->operator[](i) = lst[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -337,10 +301,6 @@ Foam::List<T>::List(const UIndirectList<T>& lst)
|
||||
this->operator[](i) = lst[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -359,10 +319,6 @@ Foam::List<T>::List(const BiIndirectList<T>& lst)
|
||||
this->operator[](i) = lst[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->v_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ Class
|
||||
Foam::UIndirectList
|
||||
|
||||
Description
|
||||
A List with indirect addressing. Like IndirectList but does not store
|
||||
addressing.
|
||||
A List with indirect addressing.
|
||||
Like IndirectList but does not store addressing.
|
||||
|
||||
SourceFiles
|
||||
UIndirectListI.H
|
||||
@ -44,6 +44,10 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
template<class T> class UIndirectList;
|
||||
template<class T> Ostream& operator<<(Ostream&, const UIndirectList<T>&);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class UIndirectList Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -92,6 +96,17 @@ public:
|
||||
|
||||
//- Assignment of all entries to the given value
|
||||
inline void operator=(const T&);
|
||||
|
||||
// Ostream operator
|
||||
|
||||
//- Write UIndirectList to Ostream
|
||||
// Binary output is currently still a bit of a problem
|
||||
friend Ostream& operator<<
|
||||
#ifndef __CINT__
|
||||
<T>
|
||||
#endif
|
||||
(Ostream&, const UIndirectList<T>&);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -103,6 +118,10 @@ public:
|
||||
|
||||
#include "UIndirectListI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "UIndirectListIO.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
126
src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
Normal file
126
src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListIO.C
Normal file
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "UIndirectList.H"
|
||||
#include "Ostream.H"
|
||||
#include "token.H"
|
||||
#include "contiguous.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Foam::Ostream& os,
|
||||
const Foam::UIndirectList<T>& L
|
||||
)
|
||||
{
|
||||
// Write list contents depending on data format
|
||||
if (os.format() == IOstream::ASCII || !contiguous<T>())
|
||||
{
|
||||
bool uniform = false;
|
||||
|
||||
if (L.size() > 1 && contiguous<T>())
|
||||
{
|
||||
uniform = true;
|
||||
|
||||
forAll(L, i)
|
||||
{
|
||||
if (L[i] != L[0])
|
||||
{
|
||||
uniform = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uniform)
|
||||
{
|
||||
// Write size and start delimiter
|
||||
os << L.size() << token::BEGIN_BLOCK;
|
||||
|
||||
// Write contents
|
||||
os << L[0];
|
||||
|
||||
// Write end delimiter
|
||||
os << token::END_BLOCK;
|
||||
}
|
||||
else if (L.size() < 11 && contiguous<T>())
|
||||
{
|
||||
// Write size and start delimiter
|
||||
os << L.size() << token::BEGIN_LIST;
|
||||
|
||||
// Write contents
|
||||
forAll(L, i)
|
||||
{
|
||||
if (i) os << token::SPACE;
|
||||
os << L[i];
|
||||
}
|
||||
|
||||
// Write end delimiter
|
||||
os << token::END_LIST;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write size and start delimiter
|
||||
os << nl << L.size() << nl << token::BEGIN_LIST;
|
||||
|
||||
// Write contents
|
||||
forAll(L, i)
|
||||
{
|
||||
os << nl << L[i];
|
||||
}
|
||||
|
||||
// Write end delimiter
|
||||
os << nl << token::END_LIST << nl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is annoying, and wasteful, but there's currently no alternative
|
||||
|
||||
os << nl << L.size() << nl;
|
||||
|
||||
if (L.size())
|
||||
{
|
||||
List<T> lst = L();
|
||||
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(lst.cdata()),
|
||||
lst.byteSize()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Check state of IOstream
|
||||
os.check("Ostream& operator<<(Ostream&, const UIndirectList&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -359,6 +359,10 @@ public:
|
||||
template<class Stream>
|
||||
static inline Stream& writeDivider(Stream& os);
|
||||
|
||||
//- Write the standard end file divider
|
||||
template<class Stream>
|
||||
static inline Stream& writeEndDivider(Stream& os);
|
||||
|
||||
//- Write header
|
||||
bool writeHeader(Ostream&) const;
|
||||
|
||||
|
||||
@ -82,5 +82,14 @@ inline Stream& Foam::IOobject::writeDivider(Stream& os)
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
inline Stream& Foam::IOobject::writeEndDivider(Stream& os)
|
||||
{
|
||||
os << "\n\n"
|
||||
"// ************************************************************************* //\n";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -45,7 +45,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
//- Read a hex label from an input stream
|
||||
label readHexLabel(ISstream& is);
|
||||
label readHexLabel(ISstream&);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -36,16 +36,16 @@ const char* const Foam::instant::typeName = "instant";
|
||||
Foam::instant::instant()
|
||||
{}
|
||||
|
||||
Foam::instant::instant(const scalar tval, const word& tname)
|
||||
Foam::instant::instant(const scalar val, const word& tname)
|
||||
:
|
||||
value_(tval),
|
||||
value_(val),
|
||||
name_(tname)
|
||||
{}
|
||||
|
||||
Foam::instant::instant(const scalar tval)
|
||||
Foam::instant::instant(const scalar val)
|
||||
:
|
||||
value_(tval),
|
||||
name_(Time::timeName(tval))
|
||||
value_(val),
|
||||
name_(Time::timeName(val))
|
||||
{}
|
||||
|
||||
Foam::instant::instant(const word& tname)
|
||||
@ -57,20 +57,19 @@ Foam::instant::instant(const word& tname)
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
int Foam::operator==(const instant& I1, const instant& I2)
|
||||
bool Foam::operator==(const instant& a, const instant& b)
|
||||
{
|
||||
return
|
||||
(
|
||||
I1.value_ < I2.value_ + SMALL
|
||||
&& I1.value_ > I2.value_ - SMALL
|
||||
a.value_ < b.value_ + SMALL
|
||||
&& a.value_ > b.value_ - SMALL
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
int Foam::operator != (const instant& I1, const instant& I2)
|
||||
bool Foam::operator!=(const instant& a, const instant& b)
|
||||
{
|
||||
// Invert the '==' operator ('0'='false')
|
||||
return I1 == I2 ? 0 : 1;
|
||||
return !operator==(a, b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -50,8 +50,8 @@ class instant;
|
||||
|
||||
// Friend Operators
|
||||
|
||||
int operator==(const instant&, const instant&);
|
||||
int operator!=(const instant&, const instant&);
|
||||
bool operator==(const instant&, const instant&);
|
||||
bool operator!=(const instant&, const instant&);
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
@ -79,9 +79,9 @@ public:
|
||||
{
|
||||
public:
|
||||
|
||||
bool operator()(const instant& one, const instant& two) const
|
||||
bool operator()(const instant& a, const instant& b) const
|
||||
{
|
||||
return one.value() < two.value();
|
||||
return a.value() < b.value();
|
||||
}
|
||||
};
|
||||
|
||||
@ -137,8 +137,8 @@ public:
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend int operator==(const instant&, const instant&);
|
||||
friend int operator!=(const instant&, const instant&);
|
||||
friend bool operator==(const instant&, const instant&);
|
||||
friend bool operator!=(const instant&, const instant&);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
@ -117,12 +117,7 @@ Foam::dictionary::dictionary
|
||||
name_(dict.name()),
|
||||
parent_(parentDict)
|
||||
{
|
||||
for
|
||||
(
|
||||
IDLList<entry>::iterator iter = begin();
|
||||
iter != end();
|
||||
++iter
|
||||
)
|
||||
forAllIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
hashedEntries_.insert(iter().keyword(), &iter());
|
||||
|
||||
@ -147,12 +142,7 @@ Foam::dictionary::dictionary
|
||||
name_(dict.name()),
|
||||
parent_(dictionary::null)
|
||||
{
|
||||
for
|
||||
(
|
||||
IDLList<entry>::iterator iter = begin();
|
||||
iter != end();
|
||||
++iter
|
||||
)
|
||||
forAllIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
hashedEntries_.insert(iter().keyword(), &iter());
|
||||
|
||||
@ -238,12 +228,7 @@ Foam::SHA1Digest Foam::dictionary::digest() const
|
||||
OSHA1stream os;
|
||||
|
||||
// process entries
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = begin();
|
||||
iter != end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
os << *iter;
|
||||
}
|
||||
@ -262,7 +247,8 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
|
||||
{
|
||||
if (patternEntries_.size())
|
||||
{
|
||||
DLList<entry*>::const_iterator wcLink = patternEntries_.begin();
|
||||
DLList<entry*>::const_iterator wcLink =
|
||||
patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::const_iterator reLink =
|
||||
patternRegexps_.begin();
|
||||
|
||||
@ -475,12 +461,7 @@ Foam::wordList Foam::dictionary::toc() const
|
||||
wordList keys(size());
|
||||
|
||||
label nKeys = 0;
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = begin();
|
||||
iter != end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>::const_iterator, *this, iter)
|
||||
{
|
||||
keys[nKeys++] = iter().keyword();
|
||||
}
|
||||
@ -494,12 +475,7 @@ Foam::List<Foam::keyType> Foam::dictionary::keys(bool patterns) const
|
||||
List<keyType> keys(size());
|
||||
|
||||
label nKeys = 0;
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = begin();
|
||||
iter != end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
if (iter().keyword().isPattern() ? patterns : !patterns)
|
||||
{
|
||||
@ -665,8 +641,10 @@ bool Foam::dictionary::remove(const word& Keyword)
|
||||
if (iter != hashedEntries_.end())
|
||||
{
|
||||
// Delete from patterns first
|
||||
DLList<entry*>::iterator wcLink = patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink = patternRegexps_.begin();
|
||||
DLList<entry*>::iterator wcLink =
|
||||
patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink =
|
||||
patternRegexps_.begin();
|
||||
|
||||
// Find in pattern using exact match only
|
||||
if (findInPatterns(false, Keyword, wcLink, reLink))
|
||||
@ -792,12 +770,7 @@ bool Foam::dictionary::merge(const dictionary& dict)
|
||||
|
||||
bool changed = false;
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = dict.begin();
|
||||
iter != dict.end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, *this, iter)
|
||||
{
|
||||
HashTable<entry*>::iterator fnd = hashedEntries_.find(iter().keyword());
|
||||
|
||||
@ -882,12 +855,7 @@ void Foam::dictionary::operator=(const dictionary& rhs)
|
||||
// Create clones of the entries in the given dictionary
|
||||
// resetting the parentDict to this dictionary
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = rhs.begin();
|
||||
iter != rhs.end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, rhs, iter)
|
||||
{
|
||||
add(iter().clone(*this).ptr());
|
||||
}
|
||||
@ -904,12 +872,7 @@ void Foam::dictionary::operator+=(const dictionary& rhs)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = rhs.begin();
|
||||
iter != rhs.end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, rhs, iter)
|
||||
{
|
||||
add(iter().clone(*this).ptr());
|
||||
}
|
||||
@ -926,12 +889,7 @@ void Foam::dictionary::operator|=(const dictionary& rhs)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = rhs.begin();
|
||||
iter != rhs.end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, rhs, iter)
|
||||
{
|
||||
if (!found(iter().keyword()))
|
||||
{
|
||||
@ -951,12 +909,7 @@ void Foam::dictionary::operator<<=(const dictionary& rhs)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
IDLList<entry>::const_iterator iter = rhs.begin();
|
||||
iter != rhs.end();
|
||||
++iter
|
||||
)
|
||||
forAllConstIter(IDLList<entry>, rhs, iter)
|
||||
{
|
||||
set(iter().clone(*this).ptr());
|
||||
}
|
||||
|
||||
@ -154,12 +154,8 @@ void Foam::dictionary::write(Ostream& os, bool subDict) const
|
||||
// Write entry
|
||||
os << e;
|
||||
|
||||
// Add new line if applicable
|
||||
if
|
||||
(
|
||||
(e.isDict() || (!e.isDict() && parent()==dictionary::null))
|
||||
&& e != *last()
|
||||
)
|
||||
// Add extra new line between entries for "top-level" dictionaries
|
||||
if (!subDict && parent() == dictionary::null && e != *last())
|
||||
{
|
||||
os << nl;
|
||||
}
|
||||
@ -167,7 +163,7 @@ void Foam::dictionary::write(Ostream& os, bool subDict) const
|
||||
// Check stream before going to next entry.
|
||||
if (!os.good())
|
||||
{
|
||||
WarningIn("dictionary::write(Ostream& os, bool subDict)")
|
||||
WarningIn("dictionary::write(Ostream&, bool subDict)")
|
||||
<< "Can't write entry " << iter().keyword()
|
||||
<< " for dictionary " << name()
|
||||
<< endl;
|
||||
|
||||
@ -103,14 +103,13 @@ bool Foam::functionEntry::execute
|
||||
is.fatalCheck
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, const dictionary& parentDict, "
|
||||
"primitiveEntry&, Istream&)"
|
||||
"(const word&, const dictionary&, primitiveEntry&, Istream&)"
|
||||
);
|
||||
|
||||
if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
|
||||
{
|
||||
cerr<<"functionEntry::execute"
|
||||
<< "(const word&, dictionary&, primitiveEntry&, Istream&)"
|
||||
<< "(const word&, const dictionary&, primitiveEntry&, Istream&)"
|
||||
<< " not yet initialized, function = "
|
||||
<< functionName.c_str() << std::endl;
|
||||
|
||||
@ -126,8 +125,7 @@ bool Foam::functionEntry::execute
|
||||
FatalErrorIn
|
||||
(
|
||||
"functionEntry::execute"
|
||||
"(const word& functionName, const dictionary& parentDict, "
|
||||
"primitiveEntry&, Istream&)"
|
||||
"(const word&, const dictionary&, primitiveEntry&, Istream&)"
|
||||
) << "Unknown functionEntry " << functionName
|
||||
<< endl << endl
|
||||
<< "Valid functionEntries are :" << endl
|
||||
|
||||
@ -95,7 +95,7 @@ public:
|
||||
(
|
||||
const word& functionName,
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
Istream&
|
||||
);
|
||||
|
||||
declareMemberFunctionSelectionTable
|
||||
@ -117,8 +117,8 @@ public:
|
||||
(
|
||||
const word& functionName,
|
||||
const dictionary& parentDict,
|
||||
primitiveEntry& entry,
|
||||
Istream& is
|
||||
primitiveEntry&,
|
||||
Istream&
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -62,8 +62,7 @@ namespace functionEntries
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::fileName Foam::functionEntries::includeEntry::includeFileName
|
||||
(
|
||||
@ -73,6 +72,7 @@ Foam::fileName Foam::functionEntries::includeEntry::includeFileName
|
||||
fileName fName(is);
|
||||
fName.expand();
|
||||
|
||||
// relative name
|
||||
if (fName.size() && fName[0] != '/')
|
||||
{
|
||||
fName = fileName(is.name()).path()/fName;
|
||||
@ -82,17 +82,19 @@ Foam::fileName Foam::functionEntries::includeEntry::includeFileName
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionEntries::includeEntry::execute
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream fileStream(includeFileName(is));
|
||||
IFstream ifs(includeFileName(is));
|
||||
|
||||
if (fileStream)
|
||||
if (ifs)
|
||||
{
|
||||
parentDict.read(fileStream);
|
||||
parentDict.read(ifs);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -100,9 +102,9 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"functionEntries::includeEntry::includeEntry"
|
||||
"(dictionary& parentDict,Istream& is)",
|
||||
"(dictionary& parentDict, Istream&)",
|
||||
is
|
||||
) << "Cannot open include file " << fileStream.name()
|
||||
) << "Cannot open include file " << ifs.name()
|
||||
<< " while reading dictionary " << parentDict.name()
|
||||
<< exit(FatalIOError);
|
||||
|
||||
@ -117,11 +119,11 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream fileStream(includeFileName(is));
|
||||
IFstream ifs(includeFileName(is));
|
||||
|
||||
if (fileStream)
|
||||
if (ifs)
|
||||
{
|
||||
entry.read(parentDict, fileStream);
|
||||
entry.read(parentDict, ifs);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -129,9 +131,9 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"functionEntries::includeEntry::includeEntry"
|
||||
"(dictionary& parentDict, primitiveEntry& entry, Istream& is)",
|
||||
"(dictionary& parentDict, primitiveEntry& entry, Istream&)",
|
||||
is
|
||||
) << "Cannot open include file " << fileStream.name()
|
||||
) << "Cannot open include file " << ifs.name()
|
||||
<< " while reading dictionary " << parentDict.name()
|
||||
<< exit(FatalIOError);
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ class includeEntry
|
||||
// Private Member Functions
|
||||
|
||||
//- Read the include fileName from Istream, expand and return
|
||||
static fileName includeFileName(Istream& is);
|
||||
static fileName includeFileName(Istream&);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
includeEntry(const includeEntry&);
|
||||
@ -86,18 +86,14 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Execute the functionEntry in a sub-dict context
|
||||
static bool execute
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
);
|
||||
static bool execute(dictionary& parentDict, Istream&);
|
||||
|
||||
//- Execute the functionEntry in a primitiveEntry context
|
||||
static bool execute
|
||||
(
|
||||
const dictionary& parentDict,
|
||||
primitiveEntry& entry,
|
||||
Istream& is
|
||||
primitiveEntry&,
|
||||
Istream&
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
@ -39,6 +39,9 @@ const Foam::word Foam::functionEntries::inputModeEntry::typeName
|
||||
// might include inputModeEntries
|
||||
int Foam::functionEntries::inputModeEntry::debug(0);
|
||||
|
||||
Foam::functionEntries::inputModeEntry::inputMode
|
||||
Foam::functionEntries::inputModeEntry::mode_(MERGE);
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionEntries
|
||||
@ -53,10 +56,6 @@ namespace functionEntries
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Private Data * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::functionEntries::inputModeEntry::mode_ = imError;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// we could combine this into execute() directly, but leave it here for now
|
||||
@ -65,17 +64,17 @@ void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
|
||||
clear();
|
||||
|
||||
word mode(is);
|
||||
if (mode == "merge")
|
||||
if (mode == "merge" || mode == "default")
|
||||
{
|
||||
mode_ = imMerge;
|
||||
mode_ = MERGE;
|
||||
}
|
||||
else if (mode == "overwrite")
|
||||
{
|
||||
mode_ = imOverwrite;
|
||||
mode_ = OVERWRITE;
|
||||
}
|
||||
else if (mode == "error" || mode == "default")
|
||||
else if (mode == "error")
|
||||
{
|
||||
mode_ = imError;
|
||||
mode_ = ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -101,33 +100,19 @@ bool Foam::functionEntries::inputModeEntry::execute
|
||||
|
||||
void Foam::functionEntries::inputModeEntry::clear()
|
||||
{
|
||||
mode_ = imError;
|
||||
mode_ = MERGE;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntries::inputModeEntry::merge()
|
||||
{
|
||||
if (mode_ & imMerge)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return mode_ == MERGE;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionEntries::inputModeEntry::overwrite()
|
||||
{
|
||||
if (mode_ & imOverwrite)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return mode_ == OVERWRITE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ Description
|
||||
@param merge merge sub-dictionaries when possible
|
||||
@param overwrite keep last entry and silently remove previous ones
|
||||
@param error flag duplicate entry as an error
|
||||
@param default currently the same as error
|
||||
@param default currently the same as merge
|
||||
|
||||
SourceFiles
|
||||
inputModeEntry.C
|
||||
@ -68,13 +68,13 @@ class inputModeEntry
|
||||
//- input mode options
|
||||
enum inputMode
|
||||
{
|
||||
imError = 0,
|
||||
imMerge = 0x1,
|
||||
imOverwrite = 0x2
|
||||
ERROR,
|
||||
MERGE,
|
||||
OVERWRITE
|
||||
};
|
||||
|
||||
//- current input mode
|
||||
static label mode_;
|
||||
static inputMode mode_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -98,19 +98,15 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Execute the functionEntry in a sub-dict context
|
||||
static bool execute
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream&
|
||||
);
|
||||
static bool execute(dictionary& parentDict, Istream&);
|
||||
|
||||
//- Reset the inputMode to 'default'
|
||||
//- Reset the inputMode to %default
|
||||
static void clear();
|
||||
|
||||
//- Return true if the inputMode is 'merge'
|
||||
//- Return true if the inputMode is %merge
|
||||
static bool merge();
|
||||
|
||||
//- Return true if the inputMode is 'overwrite'
|
||||
//- Return true if the inputMode is %overwrite
|
||||
static bool overwrite();
|
||||
|
||||
};
|
||||
|
||||
@ -80,11 +80,7 @@ public:
|
||||
// Member Functions
|
||||
|
||||
//- Execute the functionEntry in a sub-dict context
|
||||
static bool execute
|
||||
(
|
||||
dictionary& parentDict,
|
||||
Istream& is
|
||||
);
|
||||
static bool execute(dictionary& parentDict, Istream&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ Foam::wordList Foam::objectRegistry::names() const
|
||||
wordList objectNames(size());
|
||||
|
||||
label count=0;
|
||||
for (const_iterator iter = begin(); iter != end(); ++iter)
|
||||
for (const_iterator iter = cbegin(); iter != cend(); ++iter)
|
||||
{
|
||||
objectNames[count++] = iter()->name();
|
||||
}
|
||||
@ -115,7 +115,7 @@ Foam::wordList Foam::objectRegistry::names(const word& ClassName) const
|
||||
wordList objectNames(size());
|
||||
|
||||
label count=0;
|
||||
for (const_iterator iter = begin(); iter != end(); ++iter)
|
||||
for (const_iterator iter = cbegin(); iter != cend(); ++iter)
|
||||
{
|
||||
if (iter()->type() == ClassName)
|
||||
{
|
||||
@ -234,15 +234,33 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const
|
||||
<< " in registry " << name()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::objectRegistry::rename(const word& newName)
|
||||
{
|
||||
regIOobject::rename(newName);
|
||||
|
||||
// adjust dbDir_ as well
|
||||
string::size_type i = dbDir_.rfind('/');
|
||||
|
||||
if (i == string::npos)
|
||||
{
|
||||
dbDir_ = newName;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbDir_.replace(i+1, string::npos, newName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::objectRegistry::modified() const
|
||||
{
|
||||
for (const_iterator iter = begin(); iter != end(); ++iter)
|
||||
for (const_iterator iter = cbegin(); iter != cend(); ++iter)
|
||||
{
|
||||
if (iter()->modified())
|
||||
{
|
||||
@ -287,7 +305,7 @@ bool Foam::objectRegistry::writeObject
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
for (const_iterator iter = begin(); iter != end(); ++iter)
|
||||
for (const_iterator iter = cbegin(); iter != cend(); ++iter)
|
||||
{
|
||||
if (objectRegistry::debug)
|
||||
{
|
||||
|
||||
@ -160,6 +160,9 @@ public:
|
||||
|
||||
// Edit
|
||||
|
||||
//- Rename
|
||||
virtual void rename(const word& newName);
|
||||
|
||||
//- Add an regIOobject to registry
|
||||
bool checkIn(regIOobject&) const;
|
||||
|
||||
|
||||
@ -147,8 +147,7 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const
|
||||
}
|
||||
}
|
||||
|
||||
const Type* dummyPtr_ = NULL;
|
||||
return *dummyPtr_;
|
||||
return *reinterpret_cast< const Type* >(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -103,9 +103,7 @@ bool Foam::regIOobject::writeObject
|
||||
return false;
|
||||
}
|
||||
|
||||
os << "\n\n"
|
||||
"// ************************************************************************* //"
|
||||
<< endl;
|
||||
writeEndDivider(os);
|
||||
|
||||
osGood = os.good();
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ Description
|
||||
(baseType,thisType,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
baseType::add##argNames##ConstructorToTable< thisType > \
|
||||
add##thisType##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ Description
|
||||
(baseType,thisType,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType> \
|
||||
baseType::add##argNames##ConstructorToTable< thisType > \
|
||||
add_##lookup##_##thisType##argNames##ConstructorTo##baseType##Table_(#lookup)
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -62,7 +62,7 @@ Description
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ> > \
|
||||
baseType::add##argNames##ConstructorToTable< thisType< Targ > > \
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Table_
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ Description
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType::add##argNames##ConstructorToTable<thisType<Targ> > \
|
||||
baseType::add##argNames##ConstructorToTable< thisType< Targ > > \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Table_(#lookup)
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ Description
|
||||
(baseType,thisType,Targ,argNames) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ> > \
|
||||
baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \
|
||||
add##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ Description
|
||||
(baseType,thisType,Targ,argNames,lookup) \
|
||||
\
|
||||
/* Add the thisType constructor function to the table, find by lookup */ \
|
||||
baseType<Targ>::add##argNames##ConstructorToTable<thisType<Targ> > \
|
||||
baseType< Targ >::add##argNames##ConstructorToTable< thisType< Targ > > \
|
||||
add_##lookup##_##thisType##Targ##argNames##ConstructorTo##baseType##Targ##Table_(#lookup)
|
||||
|
||||
|
||||
|
||||
@ -54,24 +54,24 @@ Description
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
typedef autoPtr< baseType > (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
typedef HashTable< argNames##ConstructorPtr, word, string::hash > \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
template< class baseType##Type > \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New argList \
|
||||
static autoPtr< baseType > New argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(new baseType##Type parList); \
|
||||
return autoPtr< baseType >(new baseType##Type parList); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
@ -103,24 +103,24 @@ Description
|
||||
(autoPtr,baseType,argNames,argList,parList) \
|
||||
\
|
||||
/* Construct from argList function pointer type */ \
|
||||
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
|
||||
typedef autoPtr< baseType > (*argNames##ConstructorPtr)argList; \
|
||||
\
|
||||
/* Construct from argList function table type */ \
|
||||
typedef HashTable<argNames##ConstructorPtr, word, string::hash> \
|
||||
typedef HashTable< argNames##ConstructorPtr, word, string::hash > \
|
||||
argNames##ConstructorTable; \
|
||||
\
|
||||
/* Construct from argList function pointer table pointer */ \
|
||||
static argNames##ConstructorTable* argNames##ConstructorTablePtr_; \
|
||||
\
|
||||
/* Class to add constructor from argList to table */ \
|
||||
template<class baseType##Type> \
|
||||
template< class baseType##Type > \
|
||||
class add##argNames##ConstructorToTable \
|
||||
{ \
|
||||
public: \
|
||||
\
|
||||
static autoPtr<baseType> New##baseType argList \
|
||||
static autoPtr< baseType > New##baseType argList \
|
||||
{ \
|
||||
return autoPtr<baseType>(baseType##Type::New parList.ptr()); \
|
||||
return autoPtr< baseType >(baseType##Type::New parList.ptr()); \
|
||||
} \
|
||||
\
|
||||
add##argNames##ConstructorToTable \
|
||||
@ -213,7 +213,7 @@ Description
|
||||
(baseType,argNames) \
|
||||
\
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames) \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
defineRunTimeSelectionTableDestructor(baseType,argNames)
|
||||
|
||||
|
||||
@ -227,7 +227,7 @@ Description
|
||||
template<> \
|
||||
defineRunTimeSelectionTablePtr(baseType,argNames); \
|
||||
template<> \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames) \
|
||||
defineRunTimeSelectionTableConstructor(baseType,argNames); \
|
||||
template<> \
|
||||
defineRunTimeSelectionTableDestructor(baseType,argNames)
|
||||
|
||||
@ -242,14 +242,14 @@ Description
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table constructor called from the table add function */ \
|
||||
void baseType<Targ>::construct##argNames##ConstructorTables() \
|
||||
void baseType< Targ >::construct##argNames##ConstructorTables() \
|
||||
{ \
|
||||
static bool constructed = false; \
|
||||
\
|
||||
if (!constructed) \
|
||||
{ \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ \
|
||||
= new baseType<Targ>::argNames##ConstructorTable; \
|
||||
baseType< Targ >::argNames##ConstructorTablePtr_ \
|
||||
= new baseType< Targ >::argNames##ConstructorTable; \
|
||||
\
|
||||
constructed = true; \
|
||||
} \
|
||||
@ -263,12 +263,12 @@ Description
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Table destructor called from the table add function destructor */ \
|
||||
void baseType<Targ>::destroy##argNames##ConstructorTables() \
|
||||
void baseType< Targ >::destroy##argNames##ConstructorTables() \
|
||||
{ \
|
||||
if (baseType<Targ>::argNames##ConstructorTablePtr_) \
|
||||
if (baseType< Targ >::argNames##ConstructorTablePtr_) \
|
||||
{ \
|
||||
delete baseType<Targ>::argNames##ConstructorTablePtr_; \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL; \
|
||||
delete baseType< Targ >::argNames##ConstructorTablePtr_; \
|
||||
baseType< Targ >::argNames##ConstructorTablePtr_ = NULL; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -280,8 +280,8 @@ Description
|
||||
(baseType,argNames,Targ) \
|
||||
\
|
||||
/* Define the constructor function table */ \
|
||||
baseType<Targ>::argNames##ConstructorTable* \
|
||||
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL
|
||||
baseType< Targ >::argNames##ConstructorTable* \
|
||||
baseType< Targ >::argNames##ConstructorTablePtr_ = NULL
|
||||
|
||||
|
||||
// external use:
|
||||
@ -294,7 +294,7 @@ Description
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ) \
|
||||
defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ); \
|
||||
template<> \
|
||||
defineTemplatedRunTimeSelectionTableDestructor(baseType,argNames,Targ)
|
||||
|
||||
|
||||
@ -44,13 +44,13 @@ Description
|
||||
// Without debug information
|
||||
#define ClassNameNoDebug(TypeNameString) \
|
||||
static const char* typeName_() { return TypeNameString; } \
|
||||
static const ::Foam::word typeName;
|
||||
static const ::Foam::word typeName
|
||||
|
||||
//- Add typeName information from argument @a TypeNameString to a namespace.
|
||||
// Without debug information.
|
||||
#define NamespaceNameNoDebug(TypeNameString) \
|
||||
inline const char* typeName_() { return TypeNameString; } \
|
||||
extern const ::Foam::word typeName;
|
||||
extern const ::Foam::word typeName
|
||||
|
||||
//- Add typeName information from argument @a TemplateNameString to a template class.
|
||||
// Without debug information.
|
||||
@ -60,7 +60,7 @@ class TemplateNameString##Name \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassNameNoDebug(#TemplateNameString); \
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ class TemplateNameString##Name \
|
||||
public: \
|
||||
TemplateNameString##Name() {} \
|
||||
ClassName(#TemplateNameString); \
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -100,30 +100,30 @@ public: \
|
||||
|
||||
//- Define the typeName, with alternative lookup as @a Name
|
||||
#define defineTypeNameWithName(Type, Name) \
|
||||
const ::Foam::word Type::typeName(Name);
|
||||
const ::Foam::word Type::typeName(Name)
|
||||
|
||||
//- Define the typeName
|
||||
#define defineTypeName(Type) \
|
||||
defineTypeNameWithName(Type, Type::typeName_());
|
||||
defineTypeNameWithName(Type, Type::typeName_())
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
//- Define the typeName as @a Name for template classes
|
||||
# define defineTemplateTypeNameWithName(Type, Name) \
|
||||
defineTypeNameWithName(Type, Name);
|
||||
defineTypeNameWithName(Type, Name)
|
||||
#else
|
||||
//- Define the typeName as @a Name for template classes
|
||||
# define defineTemplateTypeNameWithName(Type, Name) \
|
||||
template<> \
|
||||
defineTypeNameWithName(Type, Name);
|
||||
defineTypeNameWithName(Type, Name)
|
||||
#endif
|
||||
|
||||
//- Define the typeName for template classes, useful with typedefs
|
||||
#define defineTemplateTypeName(Type) \
|
||||
defineTemplateTypeNameWithName(Type, #Type);
|
||||
defineTemplateTypeNameWithName(Type, #Type)
|
||||
|
||||
//- Define the typeName directly for template classes
|
||||
#define defineNamedTemplateTypeName(Type) \
|
||||
defineTemplateTypeNameWithName(Type, Type::typeName_());
|
||||
defineTemplateTypeNameWithName(Type, Type::typeName_())
|
||||
|
||||
|
||||
|
||||
@ -134,31 +134,31 @@ public: \
|
||||
|
||||
//- Define the debug information, lookup as @a Name
|
||||
#define defineDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
int Type::debug(::Foam::debug::debugSwitch(Name, DebugSwitch));
|
||||
int Type::debug(::Foam::debug::debugSwitch(Name, DebugSwitch))
|
||||
|
||||
//- Define the debug information
|
||||
#define defineDebugSwitch(Type, DebugSwitch) \
|
||||
defineDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch);
|
||||
defineDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch)
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
//- Define the debug information for templates, lookup as @a Name
|
||||
# define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch);
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch)
|
||||
#else
|
||||
//- Define the debug information for templates, lookup as @a Name
|
||||
# define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \
|
||||
template<> \
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch);
|
||||
defineDebugSwitchWithName(Type, Name, DebugSwitch)
|
||||
#endif
|
||||
|
||||
//- Define the debug information for templates
|
||||
// Useful with typedefs
|
||||
#define defineTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplateDebugSwitchWithName(Type, #Type, DebugSwitch);
|
||||
defineTemplateDebugSwitchWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
//- Define the debug information directly for templates
|
||||
#define defineNamedTemplateDebugSwitch(Type, DebugSwitch) \
|
||||
defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch);
|
||||
defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch)
|
||||
|
||||
|
||||
|
||||
@ -170,21 +170,21 @@ public: \
|
||||
//- Define the typeName and debug information
|
||||
#define defineTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTypeName(Type); \
|
||||
defineDebugSwitch(Type, DebugSwitch);
|
||||
defineDebugSwitch(Type, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information, lookup as @a Name
|
||||
#define defineTemplateTypeNameAndDebugWithName(Type, Name, DebugSwitch) \
|
||||
defineTemplateTypeNameWithName(Type, Name); \
|
||||
defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch);
|
||||
defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information for templates, useful with typedefs
|
||||
#define defineTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineTemplateTypeNameAndDebugWithName(Type, #Type, DebugSwitch);
|
||||
defineTemplateTypeNameAndDebugWithName(Type, #Type, DebugSwitch)
|
||||
|
||||
//- Define the typeName and debug information for templates
|
||||
#define defineNamedTemplateTypeNameAndDebug(Type, DebugSwitch) \
|
||||
defineNamedTemplateTypeName(Type); \
|
||||
defineNamedTemplateDebugSwitch(Type, DebugSwitch);
|
||||
defineNamedTemplateDebugSwitch(Type, DebugSwitch)
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -29,10 +29,10 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(cloud, 0);
|
||||
}
|
||||
defineTypeNameAndDebug(Foam::cloud, 0);
|
||||
|
||||
const Foam::word Foam::cloud::prefix("lagrangian");
|
||||
Foam::word Foam::cloud::defaultName("defaultCloud");
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -42,9 +42,9 @@ Foam::cloud::cloud(const objectRegistry& obr, const word& cloudName)
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
cloudName,
|
||||
( cloudName.size() ? cloudName : defaultName ),
|
||||
obr.time().timeName(),
|
||||
"lagrangian",
|
||||
prefix,
|
||||
obr,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
||||
@ -69,15 +69,16 @@ public:
|
||||
//- Runtime type information
|
||||
TypeName("cloud");
|
||||
|
||||
//- The prefix to local: %lagrangian
|
||||
static const word prefix;
|
||||
|
||||
//- The default cloud name: %defaultCloud
|
||||
static word defaultName;
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct for the given objectRegistry and named cloud instance
|
||||
cloud
|
||||
(
|
||||
const objectRegistry& obr,
|
||||
const word& cloudName = "defaultCloud"
|
||||
);
|
||||
cloud(const objectRegistry&, const word& cloudName = "");
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
@ -162,10 +162,7 @@ bool Foam::solution::read()
|
||||
relaxationFactors_ = dict.subDict("relaxationFactors");
|
||||
}
|
||||
|
||||
if (relaxationFactors_.found("default"))
|
||||
{
|
||||
relaxationFactors_.lookup("default") >> defaultRelaxationFactor_;
|
||||
}
|
||||
relaxationFactors_.readIfPresent("default", defaultRelaxationFactor_);
|
||||
|
||||
if (dict.found("solvers"))
|
||||
{
|
||||
@ -227,7 +224,7 @@ Foam::scalar Foam::solution::relaxationFactor(const word& name) const
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::solution::relaxationFactor(const word& name)",
|
||||
"Foam::solution::relaxationFactor(const word&)",
|
||||
relaxationFactors_
|
||||
) << "Cannot find relaxationFactor for '" << name
|
||||
<< "' or a suitable default value."
|
||||
@ -242,7 +239,7 @@ const Foam::dictionary& Foam::solution::solverDict(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
InfoIn("solution::solverDict(const word& name)")
|
||||
InfoIn("solution::solverDict(const word&)")
|
||||
<< "Lookup solver for " << name << endl;
|
||||
}
|
||||
|
||||
@ -254,7 +251,7 @@ const Foam::dictionary& Foam::solution::solver(const word& name) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
InfoIn("solution::solver(const word& name)")
|
||||
InfoIn("solution::solver(const word&)")
|
||||
<< "Lookup solver for " << name << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ void Foam::processorPolyPatch::initGeometry()
|
||||
(
|
||||
Pstream::blocking,
|
||||
neighbProcNo(),
|
||||
3*(sizeof(label) + size()*sizeof(vector) + sizeof(float))
|
||||
3*(sizeof(label) + size()*sizeof(vector) + sizeof(scalar))
|
||||
);
|
||||
|
||||
toNeighbProc
|
||||
@ -163,7 +163,7 @@ void Foam::processorPolyPatch::calcGeometry()
|
||||
(
|
||||
Pstream::blocking,
|
||||
neighbProcNo(),
|
||||
3*(sizeof(label) + size()*sizeof(vector) + sizeof(float))
|
||||
3*(sizeof(label) + size()*sizeof(vector) + sizeof(scalar))
|
||||
);
|
||||
fromNeighbProc
|
||||
>> neighbFaceCentres_
|
||||
|
||||
@ -176,9 +176,10 @@ public:
|
||||
}
|
||||
|
||||
//- Assignment from bool
|
||||
void operator=(const bool b)
|
||||
const Switch& operator=(const bool b)
|
||||
{
|
||||
switch_ = (b ? Switch::TRUE : Switch::FALSE);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -51,13 +51,13 @@ namespace Foam
|
||||
|
||||
class complex;
|
||||
|
||||
inline scalar magSqr(const complex& c);
|
||||
inline complex sqr(const complex& c);
|
||||
inline scalar mag(const complex& c);
|
||||
inline const complex& max(const complex& c1, const complex& c2);
|
||||
inline const complex& min(const complex& c1, const complex& c2);
|
||||
inline complex limit(const complex& c1, const complex& c2);
|
||||
inline const complex& sum(const complex& c);
|
||||
inline scalar magSqr(const complex&);
|
||||
inline complex sqr(const complex&);
|
||||
inline scalar mag(const complex&);
|
||||
inline const complex& max(const complex&, const complex&);
|
||||
inline const complex& min(const complex&, const complex&);
|
||||
inline complex limit(const complex&, const complex&);
|
||||
inline const complex& sum(const complex&);
|
||||
inline complex operator+(const complex&, const complex&);
|
||||
inline complex operator-(const complex&);
|
||||
inline complex operator-(const complex&, const complex&);
|
||||
@ -67,8 +67,8 @@ inline complex operator*(const scalar, const complex&);
|
||||
inline complex operator*(const complex&, const scalar);
|
||||
inline complex operator/(const complex&, const scalar);
|
||||
inline complex operator/(const scalar, const complex&);
|
||||
Istream& operator>>(Istream& is, complex&);
|
||||
Ostream& operator<<(Ostream& os, const complex& C);
|
||||
Istream& operator>>(Istream&, complex&);
|
||||
Ostream& operator<<(Ostream&, const complex&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -127,13 +127,13 @@ public:
|
||||
|
||||
// Member operators
|
||||
|
||||
inline void operator=(const complex&);
|
||||
inline const complex& operator=(const complex&);
|
||||
inline void operator+=(const complex&);
|
||||
inline void operator-=(const complex&);
|
||||
inline void operator*=(const complex&);
|
||||
inline void operator/=(const complex&);
|
||||
|
||||
inline void operator=(const scalar);
|
||||
inline const complex& operator=(const scalar);
|
||||
inline void operator+=(const scalar);
|
||||
inline void operator-=(const scalar);
|
||||
inline void operator*=(const scalar);
|
||||
@ -150,12 +150,12 @@ public:
|
||||
friend scalar magSqr(const complex& c);
|
||||
friend complex sqr(const complex& c);
|
||||
friend scalar mag(const complex& c);
|
||||
friend const complex& max(const complex& c1, const complex& c2);
|
||||
friend const complex& min(const complex& c1, const complex& c2);
|
||||
friend const complex& max(const complex&, const complex&);
|
||||
friend const complex& min(const complex&, const complex&);
|
||||
|
||||
friend complex limit(const complex& c1, const complex& c2);
|
||||
friend complex limit(const complex&, const complex&);
|
||||
|
||||
friend const complex& sum(const complex& c);
|
||||
friend const complex& sum(const complex&);
|
||||
|
||||
|
||||
// Friend operators
|
||||
|
||||
@ -76,10 +76,11 @@ inline complex complex::conjugate() const
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void complex::operator=(const complex& c)
|
||||
inline const complex& complex::operator=(const complex& c)
|
||||
{
|
||||
re = c.re;
|
||||
im = c.im;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@ -109,10 +110,11 @@ inline void complex::operator/=(const complex& c)
|
||||
}
|
||||
|
||||
|
||||
inline void complex::operator=(const scalar s)
|
||||
inline const complex& complex::operator=(const scalar s)
|
||||
{
|
||||
re = s;
|
||||
im = 0.0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@ -234,8 +236,8 @@ inline complex operator+(const complex& c1, const complex& c2)
|
||||
{
|
||||
return complex
|
||||
(
|
||||
c1.re+c2.re,
|
||||
c1.im+c2.im
|
||||
c1.re + c2.re,
|
||||
c1.im + c2.im
|
||||
);
|
||||
}
|
||||
|
||||
@ -254,8 +256,8 @@ inline complex operator-(const complex& c1, const complex& c2)
|
||||
{
|
||||
return complex
|
||||
(
|
||||
c1.re-c2.re,
|
||||
c1.im-c2.im
|
||||
c1.re - c2.re,
|
||||
c1.im - c2.im
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -196,36 +196,41 @@ Foam::word Foam::fileName::component
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::fileName::operator=(const fileName& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const fileName& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const word& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const word& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const string& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const std::string& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const std::string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const char* str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const char* str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -158,11 +158,11 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
void operator=(const fileName&);
|
||||
void operator=(const word&);
|
||||
void operator=(const string&);
|
||||
void operator=(const std::string&);
|
||||
void operator=(const char*);
|
||||
const fileName& operator=(const fileName&);
|
||||
const fileName& operator=(const word&);
|
||||
const fileName& operator=(const string&);
|
||||
const fileName& operator=(const std::string&);
|
||||
const fileName& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -106,12 +106,12 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
inline void operator=(const keyType&);
|
||||
inline void operator=(const word&);
|
||||
inline const keyType& operator=(const keyType&);
|
||||
inline const keyType& operator=(const word&);
|
||||
|
||||
//- Assign from regular expression.
|
||||
inline void operator=(const string&);
|
||||
inline void operator=(const char*);
|
||||
inline const keyType& operator=(const string&);
|
||||
inline const keyType& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -89,34 +89,38 @@ inline bool Foam::keyType::isPattern() const
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::keyType::operator=(const keyType& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const keyType& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = s.isPattern_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const word& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const word& s)
|
||||
{
|
||||
word::operator=(s);
|
||||
isPattern_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const string& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const string& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const char* s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const char* s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -144,6 +144,9 @@ public:
|
||||
template<class String>
|
||||
static inline string quotemeta(const string&, const char quote='\\');
|
||||
|
||||
//- Avoid masking the normal std::string replace
|
||||
using std::string::replace;
|
||||
|
||||
//- Replace first occurence of sub-string oldStr with newStr
|
||||
// starting at start
|
||||
string& replace
|
||||
|
||||
@ -117,10 +117,10 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
inline void operator=(const word&);
|
||||
inline void operator=(const string&);
|
||||
inline void operator=(const std::string&);
|
||||
inline void operator=(const char*);
|
||||
inline const word& operator=(const word&);
|
||||
inline const word& operator=(const string&);
|
||||
inline const word& operator=(const std::string&);
|
||||
inline const word& operator=(const char*);
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
@ -132,30 +132,34 @@ inline bool Foam::word::valid(char c)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::word::operator=(const word& q)
|
||||
inline const Foam::word& Foam::word::operator=(const word& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const string& q)
|
||||
inline const Foam::word& Foam::word::operator=(const string& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const std::string& q)
|
||||
inline const Foam::word& Foam::word::operator=(const std::string& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const char* q)
|
||||
inline const Foam::word& Foam::word::operator=(const char* q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ Description
|
||||
Note
|
||||
If the string contents are changed - eg, by the operator+=() or by
|
||||
string::replace(), etc - it will be necessary to use compile() or
|
||||
recompile() to sychronize the regular expression.
|
||||
recompile() to synchronize the regular expression.
|
||||
|
||||
SourceFiles
|
||||
wordRe.C
|
||||
@ -187,22 +187,22 @@ public:
|
||||
|
||||
//- Assign copy
|
||||
// Always case sensitive
|
||||
inline void operator=(const wordRe&);
|
||||
inline const wordRe& operator=(const wordRe&);
|
||||
|
||||
//- Copy word, never a regular expression
|
||||
inline void operator=(const word&);
|
||||
inline const wordRe& operator=(const word&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const string&);
|
||||
inline const wordRe& operator=(const string&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const std::string&);
|
||||
inline const wordRe& operator=(const std::string&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const char*);
|
||||
inline const wordRe& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -213,7 +213,7 @@ inline void Foam::wordRe::set(const char* str, const compOption opt)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::wordRe::operator=(const wordRe& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const wordRe& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
|
||||
@ -225,34 +225,39 @@ inline void Foam::wordRe::operator=(const wordRe& str)
|
||||
{
|
||||
re_.clear();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const word& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const word& str)
|
||||
{
|
||||
word::operator=(str);
|
||||
re_.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const string& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const std::string& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const std::string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const char* str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const char* str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -97,10 +97,8 @@ void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
|
||||
OFstream os(ioObj.objectPath());
|
||||
ioObj.writeHeader(os);
|
||||
|
||||
os << interfaces_
|
||||
<< "// *************************************"
|
||||
<< "************************************ //"
|
||||
<< endl;
|
||||
os << interfaces_;
|
||||
ioObj.writeEndDivider(os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
fvMotionSolvers/fvMotionSolver/fvMotionSolver.C
|
||||
fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C
|
||||
fvMotionSolvers/displacement/displacementFvMotionSolver/displacementFvMotionSolver.C
|
||||
fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C
|
||||
fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C
|
||||
fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C
|
||||
|
||||
@ -55,25 +55,10 @@ namespace Foam
|
||||
Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream&
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
fvMotionSolver(mesh),
|
||||
points0_
|
||||
(
|
||||
pointIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
time().constant(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
),
|
||||
displacementFvMotionSolver(mesh, is),
|
||||
pointDisplacement_
|
||||
(
|
||||
IOobject
|
||||
@ -132,7 +117,7 @@ Foam::displacementSBRStressFvMotionSolver::curPoints() const
|
||||
|
||||
tmp<pointField> tcurPoints
|
||||
(
|
||||
points0_ + pointDisplacement_.internalField()
|
||||
points0() + pointDisplacement_.internalField()
|
||||
);
|
||||
|
||||
twoDCorrectPoints(tcurPoints());
|
||||
@ -208,63 +193,7 @@ void Foam::displacementSBRStressFvMotionSolver::updateMesh
|
||||
const mapPolyMesh& mpm
|
||||
)
|
||||
{
|
||||
fvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Map points0_
|
||||
// Map points0_. Bit special since we somehow have to come up with
|
||||
// a sensible points0 position for introduced points.
|
||||
// Find out scaling between points0 and current points
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
mpm.hasMotionPoints()
|
||||
? mpm.preMotionPoints()
|
||||
: fvMesh_.points()
|
||||
);
|
||||
|
||||
// Note: boundBox does reduce
|
||||
const vector span0 = boundBox(points0_).span();
|
||||
const vector span = boundBox(points).span();
|
||||
|
||||
vector scaleFactors(cmptDivide(span0, span));
|
||||
|
||||
pointField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point. Assume motion is scaling.
|
||||
newPoints0[pointI] = points0_[oldPointI] + cmptMultiply
|
||||
(
|
||||
scaleFactors,
|
||||
points[pointI]-points[masterPointI]
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"displacementSBRStressFvMotionSolver::updateMesh"
|
||||
"(const mapPolyMesh& mpm)"
|
||||
) << "Cannot work out coordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at coordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
points0_.transfer(newPoints0);
|
||||
displacementFvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Update diffusivity. Note two stage to make sure old one is de-registered
|
||||
// before creating/registering new one.
|
||||
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#ifndef displacementSBRStressFvMotionSolver_H
|
||||
#define displacementSBRStressFvMotionSolver_H
|
||||
|
||||
#include "fvMotionSolver.H"
|
||||
#include "displacementFvMotionSolver.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -53,13 +53,10 @@ class motionDiffusivity;
|
||||
|
||||
class displacementSBRStressFvMotionSolver
|
||||
:
|
||||
public fvMotionSolver
|
||||
public displacementFvMotionSolver
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference point field
|
||||
pointField points0_;
|
||||
|
||||
//- Point motion field
|
||||
mutable pointVectorField pointDisplacement_;
|
||||
|
||||
@ -105,12 +102,6 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return reference to the reference field
|
||||
const pointField& points0() const
|
||||
{
|
||||
return points0_;
|
||||
}
|
||||
|
||||
//- Return reference to the point motion displacement field
|
||||
pointVectorField& pointDisplacement()
|
||||
{
|
||||
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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 "displacementFvMotionSolver.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "mapPolyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
// defineTypeNameAndDebug(displacementFvMotionSolver, 0);
|
||||
//
|
||||
// addToRunTimeSelectionTable
|
||||
// (
|
||||
// fvMotionSolver,
|
||||
// displacementFvMotionSolver,
|
||||
// dictionary
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::displacementFvMotionSolver::
|
||||
displacementFvMotionSolver
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream&
|
||||
)
|
||||
:
|
||||
fvMotionSolver(mesh),
|
||||
points0_
|
||||
(
|
||||
pointIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
mesh.time().constant(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::displacementFvMotionSolver::~displacementFvMotionSolver()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::displacementFvMotionSolver::updateMesh(const mapPolyMesh& mpm)
|
||||
{
|
||||
fvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Map points0_. Bit special since we somehow have to come up with
|
||||
// a sensible points0 position for introduced points.
|
||||
// Find out scaling between points0 and current points
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
mpm.hasMotionPoints()
|
||||
? mpm.preMotionPoints()
|
||||
: fvMesh_.points()
|
||||
);
|
||||
|
||||
// Note: boundBox does reduce
|
||||
const vector span0 = boundBox(points0_).span();
|
||||
const vector span = boundBox(points).span();
|
||||
|
||||
vector scaleFactors(cmptDivide(span0, span));
|
||||
|
||||
pointField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point. Assume motion is scaling.
|
||||
newPoints0[pointI] = points0_[oldPointI] + cmptMultiply
|
||||
(
|
||||
scaleFactors,
|
||||
points[pointI]-points[masterPointI]
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"displacementLaplacianFvMotionSolver::updateMesh"
|
||||
"(const mapPolyMesh& mpm)"
|
||||
) << "Cannot work out coordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at coordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
points0_.transfer(newPoints0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,114 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 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::displacementFvMotionSolver.H
|
||||
|
||||
Description
|
||||
Base class for fvMotionSolvers which calculate displacement.
|
||||
|
||||
SourceFiles
|
||||
displacementFvMotionSolver.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef displacementFvMotionSolver_H
|
||||
#define displacementFvMotionSolver_H
|
||||
|
||||
#include "fvMotionSolver.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class displacementFvMotionSolver Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class displacementFvMotionSolver
|
||||
:
|
||||
public fvMotionSolver
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference point field
|
||||
pointField points0_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
displacementFvMotionSolver
|
||||
(
|
||||
const displacementFvMotionSolver&
|
||||
);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const displacementFvMotionSolver&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("displacementInterpolation");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from polyMesh and data stream
|
||||
displacementFvMotionSolver
|
||||
(
|
||||
const polyMesh&,
|
||||
Istream& msDataUnused
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~displacementFvMotionSolver();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return reference to the reference field
|
||||
const pointField& points0() const
|
||||
{
|
||||
return points0_;
|
||||
}
|
||||
|
||||
//- Update topology
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -58,26 +58,10 @@ Foam::displacementInterpolationFvMotionSolver::
|
||||
displacementInterpolationFvMotionSolver
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream&
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
fvMotionSolver(mesh),
|
||||
points0_
|
||||
(
|
||||
pointIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
mesh.time().constant(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
)
|
||||
),
|
||||
displacementFvMotionSolver(mesh, is),
|
||||
dynamicMeshCoeffs_
|
||||
(
|
||||
IOdictionary
|
||||
@ -174,7 +158,7 @@ displacementInterpolationFvMotionSolver
|
||||
forAll(fz().meshPoints(), localI)
|
||||
{
|
||||
label pointI = fz().meshPoints()[localI];
|
||||
const scalar coord = points0_[pointI][dir];
|
||||
const scalar coord = points0()[pointI][dir];
|
||||
minCoord = min(minCoord, coord);
|
||||
maxCoord = max(maxCoord, coord);
|
||||
}
|
||||
@ -198,7 +182,7 @@ displacementInterpolationFvMotionSolver
|
||||
zoneCoordinates[zoneCoordinates.size()-1] += SMALL;
|
||||
|
||||
// Check if we have static min and max mesh bounds
|
||||
const scalarField meshCoords = points0_.component(dir);
|
||||
const scalarField meshCoords = points0().component(dir);
|
||||
|
||||
scalar minCoord = gMin(meshCoords);
|
||||
scalar maxCoord = gMax(meshCoords);
|
||||
@ -288,7 +272,7 @@ displacementInterpolationFvMotionSolver
|
||||
"displacementInterpolationFvMotionSolver::"
|
||||
"displacementInterpolationFvMotionSolver"
|
||||
"(const polyMesh&, Istream&)"
|
||||
) << "Did not find point " << points0_[pointI]
|
||||
) << "Did not find point " << points0()[pointI]
|
||||
<< " coordinate " << meshCoords[pointI]
|
||||
<< " in ranges " << rangeToCoord
|
||||
<< abort(FatalError);
|
||||
@ -344,18 +328,18 @@ Foam::displacementInterpolationFvMotionSolver::
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::displacementInterpolationFvMotionSolver::curPoints() const
|
||||
{
|
||||
if (mesh().nPoints() != points0_.size())
|
||||
if (mesh().nPoints() != points0().size())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"displacementInterpolationFvMotionSolver::curPoints() const"
|
||||
) << "The number of points in the mesh seems to have changed." << endl
|
||||
<< "In constant/polyMesh there are " << points0_.size()
|
||||
<< "In constant/polyMesh there are " << points0().size()
|
||||
<< " points; in the current mesh there are " << mesh().nPoints()
|
||||
<< " points." << exit(FatalError);
|
||||
}
|
||||
|
||||
tmp<pointField> tcurPoints(new pointField(points0_));
|
||||
tmp<pointField> tcurPoints(new pointField(points0()));
|
||||
pointField& curPoints = tcurPoints();
|
||||
|
||||
// Interpolate the diplacement of the face zones.
|
||||
@ -413,68 +397,4 @@ Foam::displacementInterpolationFvMotionSolver::curPoints() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::displacementInterpolationFvMotionSolver::updateMesh
|
||||
(
|
||||
const mapPolyMesh& mpm
|
||||
)
|
||||
{
|
||||
fvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Map points0_. Bit special since we somehow have to come up with
|
||||
// a sensible points0 position for introduced points.
|
||||
// Find out scaling between points0 and current points
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
mpm.hasMotionPoints()
|
||||
? mpm.preMotionPoints()
|
||||
: fvMesh_.points()
|
||||
);
|
||||
|
||||
// Note: boundBox does reduce
|
||||
const vector span0 = boundBox(points0_).span();
|
||||
const vector span = boundBox(points).span();
|
||||
|
||||
vector scaleFactors(cmptDivide(span0, span));
|
||||
|
||||
pointField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point. Assume motion is scaling.
|
||||
newPoints0[pointI] = points0_[oldPointI] + cmptMultiply
|
||||
(
|
||||
scaleFactors,
|
||||
points[pointI]-points[masterPointI]
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"displacementLaplacianFvMotionSolver::updateMesh"
|
||||
"(const mapPolyMesh& mpm)"
|
||||
) << "Cannot work out coordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at coordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
points0_.transfer(newPoints0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -48,7 +48,7 @@ SourceFiles
|
||||
#ifndef displacementInterpolationFvMotionSolver_H
|
||||
#define displacementInterpolationFvMotionSolver_H
|
||||
|
||||
#include "fvMotionSolver.H"
|
||||
#include "displacementFvMotionSolver.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -61,13 +61,10 @@ namespace Foam
|
||||
|
||||
class displacementInterpolationFvMotionSolver
|
||||
:
|
||||
public fvMotionSolver
|
||||
public displacementFvMotionSolver
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference point field
|
||||
pointField points0_;
|
||||
|
||||
//- Additional settings for motion solver
|
||||
dictionary dynamicMeshCoeffs_;
|
||||
|
||||
@ -130,21 +127,12 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return reference to the reference field
|
||||
const pointField& points0() const
|
||||
{
|
||||
return points0_;
|
||||
}
|
||||
|
||||
//- Return point location obtained from the current motion field
|
||||
virtual tmp<pointField> curPoints() const;
|
||||
|
||||
//- Solve for motion
|
||||
virtual void solve()
|
||||
{}
|
||||
|
||||
//- Update topology
|
||||
virtual void updateMesh(const mapPolyMesh&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -53,26 +53,10 @@ namespace Foam
|
||||
Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
Istream&
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
fvMotionSolver(mesh),
|
||||
points0_
|
||||
(
|
||||
pointIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
time().constant(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
)
|
||||
),
|
||||
displacementFvMotionSolver(mesh, is),
|
||||
pointDisplacement_
|
||||
(
|
||||
IOobject
|
||||
@ -186,7 +170,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
|
||||
}
|
||||
|
||||
pointLocation_().internalField() =
|
||||
points0_
|
||||
points0()
|
||||
+ pointDisplacement_.internalField();
|
||||
|
||||
pointLocation_().correctBoundaryConditions();
|
||||
@ -198,7 +182,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
|
||||
|
||||
forAll(pz, i)
|
||||
{
|
||||
pointLocation_()[pz[i]] = points0_[pz[i]];
|
||||
pointLocation_()[pz[i]] = points0()[pz[i]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,7 +194,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
|
||||
{
|
||||
tmp<pointField> tcurPoints
|
||||
(
|
||||
points0_ + pointDisplacement_.internalField()
|
||||
points0() + pointDisplacement_.internalField()
|
||||
);
|
||||
|
||||
// Implement frozen points
|
||||
@ -220,7 +204,7 @@ Foam::displacementLaplacianFvMotionSolver::curPoints() const
|
||||
|
||||
forAll(pz, i)
|
||||
{
|
||||
tcurPoints()[pz[i]] = points0_[pz[i]];
|
||||
tcurPoints()[pz[i]] = points0()[pz[i]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,74 +241,7 @@ void Foam::displacementLaplacianFvMotionSolver::updateMesh
|
||||
const mapPolyMesh& mpm
|
||||
)
|
||||
{
|
||||
fvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Map points0_. Bit special since we somehow have to come up with
|
||||
// a sensible points0 position for introduced points.
|
||||
// Find out scaling between points0 and current points
|
||||
|
||||
// Get the new points either from the map or the mesh
|
||||
const pointField& points =
|
||||
(
|
||||
mpm.hasMotionPoints()
|
||||
? mpm.preMotionPoints()
|
||||
: fvMesh_.points()
|
||||
);
|
||||
|
||||
// Note: boundBox does reduce
|
||||
const vector span0 = boundBox(points0_).span();
|
||||
const vector span = boundBox(points).span();
|
||||
|
||||
vector scaleFactors(cmptDivide(span0, span));
|
||||
|
||||
pointField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point. Assume motion is scaling.
|
||||
newPoints0[pointI] = points0_[oldPointI] + cmptMultiply
|
||||
(
|
||||
scaleFactors,
|
||||
points[pointI]-points[masterPointI]
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"displacementLaplacianFvMotionSolver::updateMesh"
|
||||
"(const mapPolyMesh& mpm)"
|
||||
) << "Cannot work out coordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at coordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
points0_.transfer(newPoints0);
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
OFstream str(time().timePath()/"points0.obj");
|
||||
Pout<< "displacementLaplacianFvMotionSolver :"
|
||||
<< " Writing points0_ to " << str.name() << endl;
|
||||
|
||||
forAll(points0_, pointI)
|
||||
{
|
||||
meshTools::writeOBJ(str, points0_[pointI]);
|
||||
}
|
||||
}
|
||||
displacementFvMotionSolver::updateMesh(mpm);
|
||||
|
||||
// Update diffusivity. Note two stage to make sure old one is de-registered
|
||||
// before creating/registering new one.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user