Merge branch 'master' of ssh://hunt/home/hunt2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2008-08-15 11:30:32 +01:00
100 changed files with 3031 additions and 1413 deletions

View File

@ -1,19 +1,19 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
# run from this directory only
cd ${0%/*} || exit 1
# wmake is required for subsequent targets
(cd wmake/src && make)
( cd wmake/src && make )
(cd $WM_THIRD_PARTY_DIR && ./Allwmake)
( cd $WM_THIRD_PARTY_DIR && ./Allwmake )
(cd src && ./Allwmake)
( cd src && ./Allwmake )
(cd applications && ./Allwmake)
( cd applications && ./Allwmake )
if [ "$1" = doc ]
then
(cd doc && ./Allwmake)
( cd doc && ./Allwmake )
fi
# ----------------------------------------------------------------- end-of-file

View File

@ -1,5 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
( cd solvers && wmake all )
( cd solvers && wmake all )
( cd utilities && wmake all )
# ----------------------------------------------------------------- end-of-file

View File

@ -1,9 +1,11 @@
#!/bin/sh
#
# Build optional components (eg, may depend on third-party libraries)
# -----------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
set -x
# run from this directory only
cd ${0%/*} || exit 1
# build libccmio and create lnInclude directory
(

View File

@ -1,19 +0,0 @@
// check for lagrangian/positions information in the final directory
bool hasLagrangian = false;
if (timeDirs.size() > 1)
{
IOobject io
(
"positions",
timeDirs[timeDirs.size() - 1].name(),
"lagrangian",
mesh,
IOobject::NO_READ
);
if (io.headerOk())
{
hasLagrangian = true;
}
}

View File

@ -1,15 +0,0 @@
// check that the spray variable is present for this time
//
bool hasSprayField = true;
{
IOobject ioHeader
(
fieldName,
mesh.time().timeName(),
"lagrangian",
mesh,
IOobject::NO_READ
);
hasSprayField = ioHeader.headerOk();
}

View File

@ -1,23 +0,0 @@
// check that the variable is present for all times
//
bool hasValidField = true;
{
for (label i=0; i < timeDirs.size() && hasValidField; ++i)
{
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
{
hasValidField = false;
break;
}
IOobject ioHeader
(
fieldName,
timeDirs[i].name(),
mesh,
IOobject::NO_READ
);
hasValidField = ioHeader.headerOk();
}
}

View File

@ -1,91 +0,0 @@
// write time values to case file
{
scalar timeCorrection = 0;
if (timeDirs[0].value() < 0)
{
timeCorrection = - timeDirs[0].value();
Info<< "Correcting time values. Adding " << timeCorrection << endl;
}
caseFile.setf(ios_base::scientific, ios_base::floatfield);
caseFile.precision(5);
// time set 1 - geometry and volume fields
if (fieldFileNumbers.size())
{
caseFile
<< "time set: " << 1 << nl
<< "number of steps: " << fieldFileNumbers.size() << nl
<< "filename numbers:" << nl;
label count = 0;
forAll (fieldFileNumbers, i)
{
caseFile
<< " " << setw(12) << fieldFileNumbers[i];
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile
<< nl << "time values:" << nl;
count = 0;
forAll (fieldFileNumbers, i)
{
caseFile
<< " " << setw(12)
<< timeIndices[fieldFileNumbers[i]] + timeCorrection;
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile << nl << nl;
}
// time set 2 - lagrangian fields
if (hasLagrangian && sprayFileNumbers.size())
{
caseFile
<< "time set: " << 2 << nl
<< "number of steps: " << sprayFileNumbers.size() << nl
<< "filename numbers:" << nl;
label count = 0;
forAll (sprayFileNumbers, i)
{
caseFile
<< " " << setw(12) << sprayFileNumbers[i];
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile
<< nl << "time values:" << nl;
count = 0;
forAll (sprayFileNumbers, i)
{
caseFile
<< " " << setw(12)
<< timeIndices[sprayFileNumbers[i]] + timeCorrection;
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile << nl << nl;
}
caseFile << "# end" << nl;
}

View File

@ -0,0 +1,224 @@
// write time values to case file
scalar timeCorrection = 0;
if (timeDirs[0].value() < 0)
{
timeCorrection = - timeDirs[0].value();
Info<< "Correcting time values. Adding " << timeCorrection << endl;
}
// the case file is always ASCII
Info << "write case: " << caseFileName.c_str() << endl;
OFstream caseFile(ensightDir/caseFileName, IOstream::ASCII);
caseFile.setf(ios_base::left);
caseFile.setf(ios_base::scientific, ios_base::floatfield);
caseFile.precision(5);
caseFile
<< "FORMAT" << nl
<< setw(16) << "type:" << "ensight gold" << nl << nl;
if (hasMovingMesh)
{
caseFile
<< "GEOMETRY" << nl
<< setw(16) << "model: 1" << (dataMask/geometryName).c_str() << nl;
}
else
{
caseFile
<< "GEOMETRY" << nl
<< setw(16) << "model:" << geometryName << nl;
}
// add information for clouds
// multiple clouds currently require the same time index
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
{
const word& cloudName = cloudIter.key();
caseFile
<< setw(16) << "measured: 2"
<< fileName(dataMask/"lagrangian"/cloudName/"positions").c_str()
<< nl;
}
caseFile
<< nl << "VARIABLE" << nl;
forAllConstIter(HashTable<word>, volumeFields, fieldIter)
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
string ensightType;
if (fieldType == volScalarField::typeName)
{
ensightType = "scalar";
}
else if (fieldType == volVectorField::typeName)
{
ensightType = "vector";
}
else if (fieldType == volSphericalTensorField::typeName)
{
ensightType = "tensor symm";
}
else if (fieldType == volSymmTensorField::typeName)
{
ensightType = "tensor symm";
}
else if (fieldType == volTensorField::typeName)
{
ensightType = "tensor asym";
}
if (ensightType.size())
{
ensightCaseEntry
(
caseFile,
ensightType,
fieldName,
dataMask
);
}
}
// TODO: allow similar/different time-steps for each cloud
label cloudNo = 0;
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
{
const word& cloudName = cloudIter.key();
forAllConstIter(HashTable<word>, cloudIter(), fieldIter)
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
string ensightType;
if (fieldType == scalarIOField::typeName)
{
ensightType = "scalar";
}
else if (fieldType == vectorIOField::typeName)
{
ensightType = "vector";
}
else if (fieldType == tensorIOField::typeName)
{
ensightType = "tensor";
}
if (ensightType.size())
{
ensightCaseEntry
(
caseFile,
ensightType,
fieldName,
dataMask,
"lagrangian"/cloudName,
cloudNo,
2
);
}
}
cloudNo++;
}
// add time values
caseFile << nl << "TIME" << nl;
// time set 1 - geometry and volume fields
if (fieldTimesUsed.size())
{
caseFile
<< "time set: " << 1 << nl
<< "number of steps: " << fieldTimesUsed.size() << nl
<< "filename numbers:" << nl;
label count = 0;
forAll (fieldTimesUsed, i)
{
caseFile
<< " " << setw(12) << fieldTimesUsed[i];
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile
<< nl << "time values:" << nl;
count = 0;
forAll (fieldTimesUsed, i)
{
caseFile
<< " " << setw(12)
<< timeIndices[fieldTimesUsed[i]] + timeCorrection;
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile << nl << nl;
}
// TODO: allow similar/different time-steps for each cloud
cloudNo = 0;
forAllConstIter(HashTable<DynamicList<label> >, cloudTimesUsed, cloudIter)
{
// const word& cloudName = cloudIter.key();
const DynamicList<label>& timesUsed = cloudIter();
if (timesUsed.size() && cloudNo == 0)
{
caseFile
<< "time set: " << 2 << nl
<< "number of steps: " << timesUsed.size() << nl
<< "filename numbers:" << nl;
label count = 0;
forAll (timesUsed, i)
{
caseFile
<< " " << setw(12) << timesUsed[i];
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile
<< nl << "time values:" << nl;
count = 0;
forAll (timesUsed, i)
{
caseFile
<< " " << setw(12)
<< timeIndices[timesUsed[i]] + timeCorrection;
if (++count % 6 == 0)
{
caseFile << nl;
}
}
caseFile << nl << nl;
cloudNo++;
}
}
caseFile << "# end" << nl;

View File

@ -22,7 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
$Date: 2008/04/02 11:37:10 $
\*---------------------------------------------------------------------------*/
#include "ensightOutputFunctions.H"
@ -41,36 +40,51 @@ namespace Foam
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class Type>
void ensightCaseEntry
(
OFstream& caseFile,
const IOobject& fieldObject,
const string& ensightType,
const word& fieldName,
const fileName& dataMask,
bool measured
const fileName& local,
const label cloudNo,
const label timeSet
)
{
caseFile.setf(ios_base::left);
if (measured)
fileName dirName(dataMask);
if (local.size())
{
dirName = dirName/local;
}
if (cloudNo >= 0)
{
label ts = 1;
if (timeSet > ts)
{
ts = timeSet;
}
// prefix variables with 'c' (cloud)
caseFile
<< pTraits<Type>::typeName
<< " per measured node: 2 "
<< ensightType.c_str()
<< " per measured node: " << ts << " "
<< setw(15)
<< ("s" + fieldObject.name()).c_str()
<< ("c" + Foam::name(cloudNo) + fieldName).c_str()
<< " "
<< (dataMask/"lagrangian"/fieldObject.name()).c_str()
<< (dirName/fieldName).c_str()
<< nl;
}
else
{
caseFile
<< pTraits<Type>::typeName
<< " per element: "
<< setw(15) << fieldObject.name()
<< ensightType.c_str()
<< " per element: "
<< setw(15) << fieldName
<< " "
<< (dataMask/fieldObject.name()).c_str()
<< (dirName/fieldName).c_str()
<< nl;
}
}
@ -81,16 +95,17 @@ void ensightParticlePositions
const polyMesh& mesh,
const fileName& dataDir,
const fileName& subDir,
const word& cloudName,
IOstream::streamFormat format
)
{
Cloud<passiveParticle> parcels(mesh);
Cloud<passiveParticle> parcels(mesh, cloudName, false);
fileName lagrangianDir = subDir/"lagrangian";
fileName postFileName = lagrangianDir/"positions";
fileName cloudDir = subDir/"lagrangian"/cloudName;
fileName postFileName = cloudDir/"positions";
// the ITER/lagrangian subdirectory must exist
mkDir(dataDir/lagrangianDir);
mkDir(dataDir/cloudDir);
ensightFile os(dataDir/postFileName, format);
// tag binary format (just like geometry files)
@ -139,20 +154,22 @@ void ensightParticlePositions
template<class Type>
void ensightSprayField
void ensightLagrangianField
(
const IOobject& fieldObject,
const fileName& dataDir,
const fileName& subDir,
const word& cloudName,
IOstream::streamFormat format
)
{
Info<< " " << fieldObject.name() << flush;
fileName lagrangianDir = subDir/"lagrangian";
fileName postFileName = lagrangianDir/fieldObject.name();
fileName cloudDir = subDir/"lagrangian"/cloudName;
fileName postFileName = cloudDir/fieldObject.name();
string title = postFileName + " with " + pTraits<Type>::typeName + " values";
string title =
postFileName + " with " + pTraits<Type>::typeName + " values";
ensightFile os(dataDir/postFileName, format);
os.write(title);
@ -225,9 +242,9 @@ void ensightVolField
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // end namespace Foam
} // namespace Foam
// ************************************************************************* //

View File

@ -44,13 +44,15 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void ensightCaseEntry
(
OFstream& caseFile,
const IOobject& fieldObject,
const string& ensightType,
const word& fieldName,
const fileName& dataMask,
bool measured = false
const fileName& local=fileName::null,
const label cloudNo=-1,
const label timeSet=1
);
@ -59,17 +61,19 @@ void ensightParticlePositions
const polyMesh& mesh,
const fileName& dataDir,
const fileName& subDir,
const word& cloudName,
IOstream::streamFormat format
);
//- write spray parcels
//- write lagrangian parcels
template<class Type>
void ensightSprayField
void ensightLagrangianField
(
const IOobject& fieldObject,
const fileName& dataDir,
const fileName& subDir,
const word& cloudName,
IOstream::streamFormat format
);
@ -87,7 +91,7 @@ void ensightVolField
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // end namespace Foam
} // namespace Foam
#ifdef NoRepository
# include "ensightOutputFunctions.C"

View File

@ -0,0 +1,88 @@
// check the final time directory for
// 1. volume fields
HashTable<word> volumeFields;
// 2. the fields for each cloud:
HashTable<HashTable<word> > cloudFields;
if (timeDirs.size() > 1)
{
IOobjectList objs(mesh, timeDirs[timeDirs.size()-1].name());
forAllConstIter(IOobjectList, objs, fieldIter)
{
const IOobject& obj = *fieldIter();
if
(
obj.headerClassName() == volScalarField::typeName
|| obj.headerClassName() == volVectorField::typeName
)
{
// Add field and field type
volumeFields.insert
(
obj.name(),
obj.headerClassName()
);
}
}
// now check for lagrangian/<cloudName>
fileNameList cloudDirs = readDir
(
runTime.path()
/ timeDirs[timeDirs.size() - 1].name()
/ regionPrefix
/ "lagrangian",
fileName::DIRECTORY
);
forAll(cloudDirs, cloudI)
{
const word& cloudName = cloudDirs[cloudI];
// Create a new hash table for each cloud
cloudFields.insert(cloudName, HashTable<word>());
// Identify the new cloud in the hash table
HashTable<HashTable<word> >::iterator cloudIter =
cloudFields.find(cloudName);
IOobjectList cloudObjs
(
mesh,
timeDirs[timeDirs.size() - 1].name(),
"lagrangian"/cloudName
);
bool hasPositions = false;
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
{
const IOobject obj = *fieldIter();
if (obj.name() == "positions")
{
hasPositions = true;
}
else
{
// Add field and field type
cloudIter().insert
(
obj.name(),
obj.headerClassName()
);
}
}
// drop this cloud if it has no positions
if (!hasPositions)
{
cloudFields.erase(cloudIter);
}
}
}

View File

@ -71,20 +71,26 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validOptions.insert("ascii", "");
const label nTypes = 2;
const word fieldTypes[] =
const word volFieldTypes[] =
{
volScalarField::typeName,
volVectorField::typeName
volVectorField::typeName,
volSphericalTensorField::typeName,
volSymmTensorField::typeName,
volTensorField::typeName,
word::null
};
const label nSprayFieldTypes = 2;
const word sprayFieldTypes[] =
{
scalarIOField::typeName,
vectorIOField::typeName
vectorIOField::typeName,
tensorIOField::typeName,
word::null
};
const char* geometryName = "geometry";
# include "setRootCase.H"
# include "createTime.H"
@ -104,14 +110,26 @@ int main(int argc, char *argv[])
fileName dataMask = fileName("data")/ensightFile::mask();
// Ensight and Ensight/data directories must exist
// do not remove old data - we might wish to convert new results
// or a particular time interval
if (dir(ensightDir))
{
rmDir(ensightDir);
Info<<"Warning: reusing existing directory" << nl
<< " " << ensightDir << endl;
}
mkDir(ensightDir);
mkDir(dataDir);
# include "createMesh.H"
# include "createNamedMesh.H"
// Mesh instance (region0 gets filtered out)
fileName regionPrefix;
if (regionName != polyMesh::defaultRegion)
{
regionPrefix = regionName;
}
// Construct the list of ensight parts for the entire mesh
ensightParts partsList(mesh);
@ -125,53 +143,24 @@ int main(int argc, char *argv[])
}
# include "checkHasMovingMesh.H"
# include "checkHasLagrangian.H"
# include "findFields.H"
# include "validateFields.H"
// only take the objects that exists at the end of the calculation
IOobjectList objects(mesh, timeDirs[timeDirs.size()-1].name());
IOobjectList sprayObjects(mesh, timeDirs[timeDirs.size()-1].name(), "lagrangian");
// write single geometry or one per time step
fileName geometryFileName("geometry");
if (hasMovingMesh)
{
geometryFileName = dataMask/geometryFileName;
}
// the case file is always ASCII
Info << "write case: " << caseFileName.c_str() << endl;
OFstream caseFile(ensightDir/caseFileName, IOstream::ASCII);
caseFile.setf(ios_base::left);
caseFile
<< "FORMAT" << nl
<< setw(16) << "type:" << "ensight gold" << nl << nl
<< "GEOMETRY" << nl
<< setw(16) << "model: 1" << geometryFileName.c_str() << nl;
if (hasLagrangian)
{
caseFile
<< setw(16) << "measured: 2"
<< fileName(dataMask/"lagrangian"/"positions").c_str() << nl;
}
caseFile
<< nl << "VARIABLE" << nl;
label nFieldTime = timeDirs.size();
if (nFieldTime < 0)
{
nFieldTime = 0;
}
List<label> fieldFileNumbers(nFieldTime);
List<label> sprayFileNumbers(nFieldTime);
// map used times used
// map times used
Map<scalar> timeIndices;
nFieldTime = 0;
label nSprayTime = 0;
// Track the time indices used by the volume fields
DynamicList<label> fieldTimesUsed;
// Track the time indices used by each cloud
HashTable<DynamicList<label> > cloudTimesUsed;
// Create a new DynamicList for each cloud
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
{
cloudTimesUsed.insert(cloudIter.key(), DynamicList<label>());
}
forAll(timeDirs, timeI)
{
@ -179,7 +168,8 @@ int main(int argc, char *argv[])
# include "getTimeIndex.H"
fieldFileNumbers[nFieldTime++] = timeIndex;
// remember the time index
fieldTimesUsed.append(timeIndex);
// the data/ITER subdirectory must exist
fileName subDir = ensightFile::subDir(timeIndex);
@ -195,300 +185,203 @@ int main(int argc, char *argv[])
# include "moveMesh.H"
if (nFieldTime == 1 || mesh.moving())
if (timeI == 0 || mesh.moving())
{
if (hasMovingMesh)
{
geometryFileName = dataDir/subDir/"geometry";
}
if (mesh.moving())
{
partsList.recalculate(mesh);
}
ensightGeoFile geoFile(ensightDir/geometryFileName, format);
fileName geomDir;
if (hasMovingMesh)
{
geomDir = dataDir/subDir;
}
ensightGeoFile geoFile(ensightDir/geomDir/geometryName, format);
partsList.writeGeometry(geoFile);
Info << nl;
}
Info<< "write volume field: " << flush;
Info<< "write volume field (" << flush;
for (label i=0; i < nTypes; i++)
forAllConstIter(HashTable<word>, volumeFields, fieldIter)
{
wordList fieldNames = objects.names(fieldTypes[i]);
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
forAll (fieldNames, fieldI)
IOobject fieldObject
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (fieldType == volScalarField::typeName)
{
word fieldName = fieldNames[fieldI];
ensightVolField<scalar>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
# include "checkHasValidField.H"
}
else if (fieldType == volVectorField::typeName)
{
ensightVolField<vector>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
if (!hasValidField)
}
else if (fieldType == volSphericalTensorField::typeName)
{
ensightVolField<sphericalTensor>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
}
else if (fieldType == volSymmTensorField::typeName)
{
ensightVolField<symmTensor>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
}
else if (fieldType == volTensorField::typeName)
{
ensightVolField<tensor>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
}
}
Info<< " )" << endl;
// check for clouds
forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
{
const word& cloudName = cloudIter.key();
if (!dir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
{
continue;
}
IOobjectList cloudObjs
(
mesh,
runTime.timeName(),
"lagrangian"/cloudName
);
// check that the positions field is present for this time
if (cloudObjs.lookup("positions"))
{
ensightParticlePositions
(
mesh,
dataDir,
subDir,
cloudName,
format
);
}
else
{
continue;
}
Info<< "write " << cloudName << " (" << flush;
forAllConstIter(HashTable<word>, cloudIter(), fieldIter)
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
IOobject *fieldObject = cloudObjs.lookup(fieldName);
if (!fieldObject)
{
Info<< "missing "
<< runTime.timeName()/"lagrangian"/cloudName/fieldName
<< endl;
continue;
}
IOobject fieldObject
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (fieldTypes[i] == volScalarField::typeName)
if (fieldType == scalarIOField::typeName)
{
if (nFieldTime == 1)
{
ensightCaseEntry<scalar>
(
caseFile,
fieldObject,
dataMask
);
}
ensightVolField<scalar>
ensightLagrangianField<scalar>
(
partsList,
fieldObject,
mesh,
*fieldObject,
dataDir,
subDir,
cloudName,
format
);
}
else if (fieldTypes[i] == volVectorField::typeName)
else if (fieldType == vectorIOField::typeName)
{
if (nFieldTime == 1)
{
ensightCaseEntry<vector>
(
caseFile,
fieldObject,
dataMask
);
}
ensightVolField<vector>
ensightLagrangianField<vector>
(
partsList,
fieldObject,
mesh,
*fieldObject,
dataDir,
subDir,
cloudName,
format
);
}
else if (fieldTypes[i] == volSphericalTensorField::typeName)
else if (fieldType == tensorIOField::typeName)
{
if (nFieldTime == 1)
{
ensightCaseEntry<sphericalTensor>
(
caseFile,
fieldObject,
dataMask
);
}
ensightVolField<sphericalTensor>
ensightLagrangianField<tensor>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
}
else if (fieldTypes[i] == volSymmTensorField::typeName)
{
if (nFieldTime == 1)
{
ensightCaseEntry<symmTensor>
(
caseFile,
fieldObject,
dataMask
);
}
ensightVolField<symmTensor>
(
partsList,
fieldObject,
mesh,
dataDir,
subDir,
format
);
}
else if (fieldTypes[i] == volTensorField::typeName)
{
if (nFieldTime == 1)
{
ensightCaseEntry<tensor>
(
caseFile,
fieldObject,
dataMask
);
}
ensightVolField<tensor>
(
partsList,
fieldObject,
mesh,
*fieldObject,
dataDir,
subDir,
cloudName,
format
);
}
}
}
Info<< endl;
Info<< " )" << endl;
if (hasLagrangian)
{
// check that the positions field is present for this time
{
IOobject ioHeader
(
"positions",
mesh.time().timeName(),
"lagrangian",
mesh,
IOobject::NO_READ
);
if (ioHeader.headerOk())
{
sprayFileNumbers[nSprayTime++] = timeIndex;
}
}
Info<< "write spray field: " << flush;
ensightParticlePositions
(
mesh,
dataDir,
subDir,
format
);
for (label i=0; i < nSprayFieldTypes; i++)
{
wordList fieldNames = sprayObjects.names(sprayFieldTypes[i]);
forAll (fieldNames, fieldI)
{
word fieldName = fieldNames[fieldI];
# include "checkHasSprayField.H"
if (!hasSprayField)
{
continue;
}
IOobject fieldObject
(
fieldName,
mesh.time().timeName(),
"lagrangian",
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (sprayFieldTypes[i] == scalarIOField::typeName)
{
if (nSprayTime == 1)
{
ensightCaseEntry<scalar>
(
caseFile,
fieldObject,
dataMask,
true
);
}
ensightSprayField<scalar>
(
fieldObject,
dataDir,
subDir,
format
);
}
else if (sprayFieldTypes[i] == vectorIOField::typeName)
{
if (nSprayTime == 1)
{
ensightCaseEntry<vector>
(
caseFile,
fieldObject,
dataMask,
true
);
}
ensightSprayField<vector>
(
fieldObject,
dataDir,
subDir,
format
);
}
else if (sprayFieldTypes[i] == tensorIOField::typeName)
{
if (nSprayTime == 1)
{
ensightCaseEntry<tensor>
(
caseFile,
fieldObject,
dataMask,
true
);
}
ensightSprayField<tensor>
(
fieldObject,
dataDir,
subDir,
format
);
}
}
}
Info<< endl;
// remember the time index
cloudTimesUsed[cloudName].append(timeIndex);
}
}
fieldFileNumbers.setSize(nFieldTime);
sprayFileNumbers.setSize(nSprayTime);
// add time values
caseFile << nl << "TIME" << nl;
# include "ensightCaseTimes.H"
# include "ensightOutputCase.H"
Info<< "\nEnd\n"<< endl;

View File

@ -0,0 +1,104 @@
// ignore special fields or fields that we don't handle
//
forAllIter(HashTable<word>, volumeFields, fieldIter)
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) != "_0")
{
volumeFields.erase(fieldIter);
}
else
{
// remove types that we don't handle:
bool invalid = true;
for (label typeI=0; invalid && volFieldTypes[typeI].size(); ++typeI)
{
if (fieldType == volFieldTypes[typeI])
{
invalid = false;
}
}
if (invalid)
{
Info<< "ignoring " << fieldType << ": " << fieldName << endl;
volumeFields.erase(fieldIter);
}
}
}
// verify that the variable is present for all times
//
for (label i=0; volumeFields.size() && i < timeDirs.size(); ++i)
{
IOobjectList objs(mesh, timeDirs[i].name());
forAllIter(HashTable<word>, volumeFields, fieldIter)
{
const word& fieldName = fieldIter.key();
if (!objs.found(fieldName))
{
volumeFields.erase(fieldIter);
}
}
}
// ignore fields that we don't handle
//
forAllIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
{
const word& cloudName = cloudIter.key();
forAllIter(HashTable<word>, cloudIter(), fieldIter)
{
const word& fieldName = fieldIter.key();
const word& fieldType = fieldIter();
// remove types that we don't handle:
bool invalid = true;
for (label typeI=0; invalid && sprayFieldTypes[typeI].size(); ++typeI)
{
if (fieldType == sprayFieldTypes[typeI])
{
invalid = false;
}
}
if (invalid)
{
Info<< "ignoring " << fieldType << ": " << fieldName << endl;
cloudIter().erase(fieldIter);
}
}
if (!cloudIter().size())
{
Info<< "removing cloud " << cloudName<< endl;
cloudFields.erase(cloudIter);
}
}
// DEBUGGING
// Info<<"final fields (";
// forAllConstIter(HashTable<word>, volumeFields, fieldIter)
// {
// Info<< " " << fieldIter.key();
// }
//
// Info<< " )\n";
//
// forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
// {
// Info<<"final fields for lagrangian/" << cloudIter.key() << " (";
// forAllConstIter(HashTable<word>, cloudIter(), fieldIter)
// {
// Info<< " " << fieldIter.key();
// }
// Info<< " )\n";
// }

View File

@ -1,4 +1,5 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
rm -rf PV3FoamReader/Make

View File

@ -1,4 +1,5 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]

View File

@ -27,13 +27,6 @@
</Documentation>
</DoubleVectorProperty>
<!-- Send continuous time info to the animation panel -->
<DoubleVectorProperty
name="TimeRange"
information_only="1">
<TimeRangeInformationHelper/>
</DoubleVectorProperty>
<!-- Available Parts (volume, patches, lagrangian) array -->
<StringVectorProperty
name="PartArrayInfo"

View File

@ -112,10 +112,7 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
{
vtkDebugMacro(<<"Deconstructor");
if (foamData_)
{
delete foamData_;
}
delete foamData_;
if (FileName)
{
@ -186,6 +183,15 @@ int vtkPV3FoamReader::RequestInformation
int nTimeSteps = 0;
double* timeSteps = foamData_->findTimes(nTimeSteps);
if (!nTimeSteps)
{
vtkErrorMacro("could not find valid OpenFOAM mesh");
// delete foamData and flag it as fatal error
delete foamData_;
foamData_ = NULL;
return 0;
}
// set identical time steps for all ports
for (int infoI = 0; infoI < nInfo; ++infoI)
@ -249,6 +255,13 @@ int vtkPV3FoamReader::RequestData
return 0;
}
// catch previous error
if (!foamData_)
{
vtkErrorMacro("Reader failed - perhaps no mesh?");
return 0;
}
int nInfo = outputVector->GetNumberOfInformationObjects();
if (Foam::vtkPV3Foam::debug)
@ -263,6 +276,7 @@ int vtkPV3FoamReader::RequestData
// take port0 as the lead for other outputs
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
(
outInfo->Get

View File

@ -103,10 +103,8 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
// Get times list
instantList Times = runTime.times();
int foundIndex = Time::findClosestTimeIndex(Times, requestedTime);
int nearestIndex = foundIndex;
if (foundIndex < 0)
int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
if (nearestIndex < 0)
{
nearestIndex = 0;
}
@ -146,7 +144,7 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
<< " fieldsChanged=" << fieldsChanged_ << endl;
}
return foundIndex;
return nearestIndex;
}
@ -206,7 +204,8 @@ Foam::vtkPV3Foam::vtkPV3Foam
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
nMesh_(0),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
timeIndex_(-1),
meshChanged_(true),
fieldsChanged_(true),
@ -248,10 +247,38 @@ Foam::vtkPV3Foam::vtkPV3Foam
setEnv("FOAM_CASE", fullCasePath, true);
}
// look for 'case{region}.OpenFOAM'
// could be stringent and insist the prefix match the directory name...
// Note: cannot use fileName::name() due to the embedded '{}'
string caseName(fileName(FileName).lessExt());
string::size_type beg = caseName.find_last_of("/{");
string::size_type end = caseName.find('}', beg);
if
(
beg != string::npos && caseName[beg] == '{'
&& end != string::npos && end == caseName.size()-1
)
{
meshRegion_ = caseName.substr(beg+1, end-beg-1);
// some safety
if (!meshRegion_.size())
{
meshRegion_ = polyMesh::defaultRegion;
}
if (meshRegion_ != polyMesh::defaultRegion)
{
meshDir_ = meshRegion_/polyMesh::meshSubDir;
}
}
if (debug)
{
Info<< "fullCasePath=" << fullCasePath << nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << endl;
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "region=" << meshRegion_ << endl;
}
// Create time object
@ -368,15 +395,20 @@ void Foam::vtkPV3Foam::updateFoamMesh()
{
if (debug)
{
Info<< "Creating Foam mesh" << endl;
Info<< "Creating Foam mesh for region " << meshRegion_
<< " at time=" << dbPtr_().timeName()
<< endl;
}
meshPtr_ = new fvMesh
(
IOobject
(
fvMesh::defaultRegion,
meshRegion_,
dbPtr_().timeName(),
dbPtr_()
dbPtr_(),
IOobject::MUST_READ
)
);
@ -478,11 +510,26 @@ double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
Time& runTime = dbPtr_();
instantList timeLst = runTime.times();
// always skip "constant" time, unless there are no other times
nTimes = timeLst.size();
// find the first time for which this mesh appears to exist
label timeI = 0;
for (; timeI < timeLst.size(); ++timeI)
{
const word& timeName = timeLst[timeI].name();
if (nTimes > 1)
if
(
file(runTime.path()/timeName/meshDir_/"points")
&& IOobject("points", timeName, meshDir_, runTime).headerOk()
)
{
break;
}
}
nTimes = timeLst.size() - timeI;
// always skip "constant" time if possible
if (timeI == 0 && nTimes > 1)
{
timeI = 1;
--nTimes;
@ -699,7 +746,6 @@ void Foam::vtkPV3Foam::removePatchNames(vtkRenderer* renderer)
void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const
{
os << indent << "Number of meshes: " << nMesh_ << "\n";
os << indent << "Number of nodes: "
<< (meshPtr_ ? meshPtr_->nPoints() : 0) << "\n";
@ -708,6 +754,8 @@ void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const
os << indent << "Number of available time steps: "
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl;
os << indent << "mesh region: " << meshRegion_ << "\n";
}
// ************************************************************************* //

View File

@ -92,11 +92,8 @@ class polyPatch;
class faceSet;
class pointSet;
template<class Type>
class IOField;
template<class Type>
class List;
template<class Type> class IOField;
template<class Type> class List;
/*---------------------------------------------------------------------------*\
Class vtkPV3Foam Declaration
@ -248,9 +245,11 @@ class vtkPV3Foam
//- Foam mesh
fvMesh* meshPtr_;
//- Number of meshes
// TODO - for info only - only set up to process ONE mesh
int nMesh_;
//- The mesh region
word meshRegion_;
//- The mesh directory for the region
fileName meshDir_;
//- The time index
int timeIndex_;
@ -716,6 +715,7 @@ public:
return timeIndex_;
}
// Access
//- Debug information

View File

@ -72,6 +72,8 @@ void Foam::vtkPV3Foam::convertVolFields
vtkMultiBlockDataSet* output
)
{
const fvMesh& mesh = *meshPtr_;
wordHashSet selectedFields = getSelected
(
reader_->GetVolFieldSelection()
@ -82,8 +84,8 @@ void Foam::vtkPV3Foam::convertVolFields
return;
}
const fvMesh& mesh = *meshPtr_;
// Get objects (fields) for this time - only keep selected fields
// the region name is already in the mesh db
IOobjectList objects(mesh, dbPtr_().timeName());
pruneObjectList(objects, selectedFields);
@ -158,6 +160,8 @@ void Foam::vtkPV3Foam::convertPointFields
vtkMultiBlockDataSet* output
)
{
const fvMesh& mesh = *meshPtr_;
wordHashSet selectedFields = getSelected
(
reader_->GetPointFieldSelection()
@ -168,8 +172,8 @@ void Foam::vtkPV3Foam::convertPointFields
return;
}
const fvMesh& mesh = *meshPtr_;
// Get objects (fields) for this time - only keep selected fields
// the region name is already in the mesh db
IOobjectList objects(mesh, dbPtr_().timeName());
pruneObjectList(objects, selectedFields);
@ -257,8 +261,10 @@ void Foam::vtkPV3Foam::convertLagrangianFields
continue;
}
// Get the Lagrangian fields for this time and this cloud
// but only keep selected fields
// the region name is already in the mesh db
IOobjectList objects
(
mesh,

View File

@ -64,7 +64,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
}
// Convert the internalMesh
// TODO: multiple mesh regions
// this looks like more than one part, but it isn't
for (int partId = selector.start(); partId < selector.end(); ++partId)
{
const word partName = "internalMesh";
@ -239,7 +239,6 @@ void Foam::vtkPV3Foam::convertMeshCellZones
}
const cellZoneMesh& zMesh = mesh.cellZones();
for (int partId = selector.start(); partId < selector.end(); ++partId)
{
const word zoneName = getPartName(partId);
@ -408,7 +407,6 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
}
const faceZoneMesh& zMesh = mesh.faceZones();
for (int partId = selector.start(); partId < selector.end(); ++partId)
{
const word zoneName = getPartName(partId);
@ -515,6 +513,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
partInfo& selector = partInfoPointZones_;
selector.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0
const fvMesh& mesh = *meshPtr_;
if (debug)
{
@ -522,12 +521,9 @@ void Foam::vtkPV3Foam::convertMeshPointZones
printMemory();
}
const fvMesh& mesh = *meshPtr_;
if (selector.size())
{
const pointZoneMesh& zMesh = mesh.pointZones();
for (int partId = selector.start(); partId < selector.end(); ++partId)
{
word zoneName = getPartName(partId);

View File

@ -36,6 +36,7 @@ Description
#include "vtkPV3FoamPoints.H"
// VTK includes
#include "vtkCellArray.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
@ -56,6 +57,8 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
printMemory();
}
// the region name is already in the mesh db
IOobjectList sprayObjs
(
mesh,
@ -75,15 +78,25 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
vtkmesh = vtkPolyData::New();
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate( parcels.size() );
vtkCellArray* vtkcells = vtkCellArray::New();
vtkpoints->Allocate( parcels.size() );
vtkcells->Allocate( parcels.size() );
vtkIdType particleId = 0;
forAllConstIter(Cloud<passiveParticle>, parcels, iter)
{
vtkPV3FoamInsertNextPoint(vtkpoints, iter().position());
vtkcells->InsertNextCell(1, &particleId);
particleId++;
}
vtkmesh->SetPoints(vtkpoints);
vtkpoints->Delete();
vtkmesh->SetVerts(vtkcells);
vtkcells->Delete();
}
if (debug)

View File

@ -35,8 +35,8 @@ Description
// VTK includes
#include "vtkCellArray.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkUnstructuredGrid.h"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -91,11 +91,11 @@ Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
zoneType,
dbPtr_().findInstance
(
polyMesh::meshSubDir,
meshDir_,
zoneType,
IOobject::READ_IF_PRESENT
),
polyMesh::meshSubDir,
meshDir_,
dbPtr_(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
@ -126,10 +126,6 @@ void Foam::vtkPV3Foam::updateInfoInternalMesh()
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
// Determine number of meshes available
HashTable<const fvMesh*> meshObjects = dbPtr_().lookupClass<const fvMesh>();
nMesh_ = meshObjects.size();
// Determine mesh parts (internalMesh, patches...)
//- Add internal mesh as first entry
partInfoVolume_ = partSelection->GetNumberOfArrays();
@ -155,10 +151,19 @@ void Foam::vtkPV3Foam::updateInfoLagrangian()
<< " " << dbPtr_->timePath()/"lagrangian" << endl;
}
// use the db directly since this might be called without a mesh,
// but the region must get added back in
fileName lagrangianPrefix("lagrangian");
if (meshRegion_ != polyMesh::defaultRegion)
{
lagrangianPrefix = meshRegion_/"lagrangian";
}
// Search for list of lagrangian objects for this time
fileNameList cloudDirs
(
readDir(dbPtr_->timePath()/"lagrangian", fileName::DIRECTORY)
readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY)
);
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
@ -221,43 +226,50 @@ void Foam::vtkPV3Foam::updateInfoPatches()
}
else
{
// Read patches
polyBoundaryMeshEntries patchEntries
// mesh not loaded - read from file
// but this could fail if we've supplied a bad region name
IOobject ioObj
(
IOobject
"boundary",
dbPtr_().findInstance
(
meshDir_,
"boundary",
dbPtr_().findInstance(polyMesh::meshSubDir, "boundary"),
polyMesh::meshSubDir,
dbPtr_(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
IOobject::READ_IF_PRESENT
),
meshDir_,
dbPtr_(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
);
// Add (non-zero) patches to the list of mesh parts
forAll(patchEntries, entryI)
// this should only ever fail if the mesh region doesn't exist
if (ioObj.headerOk())
{
label nFaces
(
readLabel(patchEntries[entryI].dict().lookup("nFaces"))
);
polyBoundaryMeshEntries patchEntries(ioObj);
// Valid patch if nFace > 0
if (nFaces)
// Add (non-zero) patches to the list of mesh parts
forAll(patchEntries, entryI)
{
// Add patch to GUI list
partSelection->AddArray
label nFaces
(
(patchEntries[entryI].keyword() + " - patch").c_str()
readLabel(patchEntries[entryI].dict().lookup("nFaces"))
);
++nPatches;
// Valid patch if nFace > 0 - add patch to GUI list
if (nFaces)
{
partSelection->AddArray
(
(patchEntries[entryI].keyword() + " - patch").c_str()
);
++nPatches;
}
}
}
}
partInfoPatches_ += nPatches;
if (debug)
@ -380,8 +392,8 @@ void Foam::vtkPV3Foam::updateInfoSets()
IOobjectList objects
(
dbPtr_(),
dbPtr_().findInstance(polyMesh::meshSubDir, "faces"),
polyMesh::meshSubDir/"sets"
dbPtr_().findInstance(meshDir_, "faces", IOobject::READ_IF_PRESENT),
meshDir_/"sets"
);
@ -449,11 +461,19 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
word cloudName = getPartName(partId);
// use the db directly since this might be called without a mesh,
// but the region must get added back in
fileName lagrangianPrefix("lagrangian");
if (meshRegion_ != polyMesh::defaultRegion)
{
lagrangianPrefix = meshRegion_/"lagrangian";
}
IOobjectList objects
(
dbPtr_(),
dbPtr_().timeName(),
"lagrangian"/cloudName
lagrangianPrefix/cloudName
);
addToSelection<IOField<label> >

View File

@ -59,8 +59,16 @@ void Foam::vtkPV3Foam::updateInfoFields
select->RemoveAllArrays();
// Search for list of objects for this time
IOobjectList objects(dbPtr_(), dbPtr_().timeName());
// use the db directly since this might be called without a mesh,
// but the region must get added back in
word regionPrefix;
if (meshRegion_ != polyMesh::defaultRegion)
{
regionPrefix = meshRegion_;
}
// Search for list of objects for this time and mesh region
IOobjectList objects(dbPtr_(), dbPtr_().timeName(), regionPrefix);
//- Add volume fields to GUI
addToSelection<GeometricField<scalar, patchType, meshType> >

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
@ -61,7 +60,6 @@ dictionaryReplacement
}
}
K
{
internalField uniform 80;
@ -83,7 +81,6 @@ dictionaryReplacement
}
}
cp
{
internalField uniform 450;

View File

@ -29,66 +29,108 @@
# Description
# Build and install ParaView
# - run from folder above ParaView source folder or place the
# ParaView source under $WM_PROJECT_INST_DIR
# ParaView source under $WM_THIRD_PARTY_DIR
#
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
# set -x
PARAVIEW_SRC="ParaView3.3-cvs"
PARAVIEW_MAJOR_VERSION="3.3"
VERBOSE=OFF
# User options:
# ~~~~~~~~~~~~~
# User options
# ~~~~~~~~~~~~
# MPI suport
INCLUDE_MPI=OFF
# MPI support:
WITH_MPI=OFF
MPI_MAX_PROCS=32
# Python
# note: script will try to determine python library. If it fails, specify the
# path using the PYTHON_LIBRARY variable
INCLUDE_PYTHON=OFF
#PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
# Python support:
# note: script will try to determine python library.
# If it fails, specify the path using the PYTHON_LIBRARY variable
WITH_PYTHON=OFF
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
# MESA graphics
INCLUDE_MESA=OFF
# MESA graphics support:
WITH_MESA=OFF
#
# No further editing below this line
#------------------------------------------------------------------------------
Script=${0##*/}
# No further editing should be required below this line
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
set +x
usage: ${0##*/} [OPTION]
options:
-fast skip cmake for repeated builds - use with caution
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
-mesa with mesa (if not already enabled)
-verbose verbose cmake output
-help
# Provide a shortcut for repeated builds - use with caution
if [ "$#" -gt 0 ]
then
CMAKE_SKIP=YES
fi
Build and install $PARAVIEW_SRC
- run from folder above the ParaView source folder or place the
ParaView source under \$WM_THIRD_PARTY_DIR
USAGE
exit 1
}
# Initialisation
#~~~~~~~~~~~~~~~
initialiseVariables
# options based on the script name:
case "$Script" in *-fast*) CMAKE_SKIP=ON;; esac
case "$Script" in *-mpi*) WITH_MPI=ON;; esac
case "$Script" in *-python*) WITH_PYTHON=ON;; esac
case "$Script" in *-mesa*) WITH_MESA=ON;; esac
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-fast)
CMAKE_SKIP=YES
shift
;;
-mpi)
WITH_MPI=ON
shift
;;
-python)
WITH_PYTHON=ON
shift
;;
-mesa)
WITH_MESA=ON
shift
;;
-verbose)
VERBOSE=ON
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addMpiSupport # set MPI specific options
addPythonSupport # set python specific options
addMesaSupport # set MESA specific options
addVerbosity # set CMake verbosity
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
# Build and install
# ~~~~~~~~~~~~~~~~~
buildParaView
installParaView
echo "done"
#------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
buildParaView3.3-cvs

View File

@ -121,17 +121,18 @@ do
if grep FoamFile $caseFile >/dev/null 2>&1
then
echo "Updating case file: $caseFile"
sed -n '/FoamFile/,/}/p' $caseFile > FoamFile
sed -n '/FoamFile/,/}/p' $caseFile > FoamFile.tmp
CLASS=`FoamFileAttribute class FoamFile`
OBJECT=`FoamFileAttribute object FoamFile`
FORMAT=`FoamFileAttribute format FoamFile`
CLASS=`FoamFileAttribute class FoamFile.tmp`
OBJECT=`FoamFileAttribute object FoamFile.tmp`
FORMAT=`FoamFileAttribute format FoamFile.tmp`
printHeader $FORMAT $CLASS $OBJECT $NOTE > FoamFile.tmp
sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> FoamFile.tmp
mv FoamFile.tmp $caseFile
rm FoamFile
# use cat to avoid removing/replace soft-links
[ -s FoamFile.tmp ] && cat FoamFile.tmp >| $caseFile
rm FoamFile.tmp
else
echo " Invalid case file: $caseFile"
fi

View File

@ -57,15 +57,20 @@ USAGE
#
convertDict()
{
echo "Identified $1 turbulence model in '$3'"
outputPath=`dirname $3`
echo "Identified $1 turbulence model in '$3'"
outputPath=`dirname $3`
sed -e "s/turbulenceProperties/$1Properties/" \
-e "s/$2/$1Model/" \
-e "s/[a-zA-Z0-9]* [ ]*\[[0-9 ]*\]//" \
$3 > "$outputPath/$1Properties"
if [ -e "$outputPath/$1Properties" ]
then
echo "Error: file already exists $outputPath/$1Properties'"
else
sed -e "s/turbulenceProperties/$1Properties/" \
-e "s/$2/$1Model/" \
-e "s/[a-zA-Z0-9]* [ ]*\[[0-9 ]*\]//" \
$3 > "$outputPath/$1Properties"
echo " wrote $outputPath/$1Properties"
echo " wrote $outputPath/$1Properties"
fi
}
[ $# -ge 1 ] || usage

View File

@ -34,7 +34,11 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [-case dir]
usage: ${0##*/} [OPTION]
options:
-case dir specify alternative case directory
-region name specify mesh region name
-touch create the .OpenFOAM file only and exit
* start paraview $ParaView_VERSION with the OpenFOAM libraries
@ -42,6 +46,8 @@ USAGE
exit 1
}
unset regionName touchOnly
# parse options
while [ "$#" -gt 0 ]
do
@ -55,6 +61,15 @@ do
shift 2
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
;;
-region)
[ "$#" -ge 2 ] || usage "'-region' option requires an argument"
regionName=$2
shift 2
;;
-touch)
touchOnly=1
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
@ -64,6 +79,17 @@ done
# get a sensible caseName
caseName=${PWD##*/}
caseFile="$caseName.OpenFOAM"
if [ -n "$regionName" ]
then
caseFile="$caseName{$regionName}.OpenFOAM"
fi
if [ -n "$touchOnly" ];
then
touch "$caseFile"
echo "created '$caseFile'"
exit 0
fi
# parent directory for normal or parallel results
case "$caseName" in
@ -80,7 +106,6 @@ done
case "$ParaView_VERSION" in
2*)
# Clean up on termination and on Ctrl-C
trap "rm -f paraFoam.pvs $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch $caseFile
@ -92,10 +117,14 @@ case "$ParaView_VERSION" in
;;
*)
# Clean up on termination and on Ctrl-C
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch $caseFile
paraview --data=$caseFile
# only create/remove caseFile if it doesn't exist
[ -e $caseFile ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"
echo "created temporary '$caseFile'"
}
paraview --data="$caseFile"
;;
esac

View File

@ -1,2 +1,24 @@
#!/bin/sh
find . \( -name '*.class' \) -print | xargs -t rm
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " remove all .class files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "removing all .class files"
find $i -name '*.class' -print | xargs -t rm
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -1,3 +1,25 @@
#!/bin/sh
# find . \( -name 'core' \) -exec ls -l {} \; -exec rm {} \;
find . \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " remove all core files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "removing all core files"
find $i \( -type f -name 'core' -o -name 'core.[1-9]*' -o -name 'vgcore.*' \) -print | xargs -t rm
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -1,15 +1,19 @@
#!/bin/sh
if [ $# -eq 0 ]
if [ "$1" = "-h" -o "$1" = "-help" -o "$#" -gt 1 ]
then
find . \( -name '*.dep' \) -print | xargs -t rm
elif [ $# -eq 1 ]
then
echo "Removing all dep files containing $1..."
find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \;
else
echo "Usage: ${0##/} to remove all .dep files"
echo " ${0##/} <file> to remove all .dep files referring to <file>"
echo "Usage: ${0##*/} : remove all .dep files"
echo " ${0##*/} <file> : remove all .dep files referring to <file>"
exit 1
fi
if [ "$#" -eq 0 ]
then
echo "removing all .dep files"
find . -name '*.dep' -print | xargs -t rm
else
echo "removing all .dep files containing $1..."
find . -name '*.dep' -exec grep "$1" '{}' \; -exec rm '{}' \;
fi
#------------------------------------------------------------------------------

View File

@ -1,2 +1,24 @@
#!/bin/sh
find . \( -name '*.o' \) -print | xargs -t rm
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " remove all .o files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "removing all .o files: $i"
find $i -name '*.o' -print | xargs -t rm
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -1,3 +1,24 @@
#!/bin/sh
# find . \( -name '*~' -o -name '.*~' \) -exec ls -l {} \; -exec rm {} \;
find . \( -name '*~' -o -name '.*~' \) -print | xargs -t rm
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " remove all *~ files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "removing all *~ files"
find $i \( -name '*~' -o -name '.*~' \) -print | xargs -t rm
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -40,7 +40,7 @@
# rm -rf ${T} > /dev/null 2>&1
# fi
# done
# rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
# rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
#}
cleanTimeDirectories ()
@ -55,7 +55,7 @@ cleanTimeDirectories ()
zeros=`printf %0${nZeros}d 0`
nZeros=$(($nZeros + 1))
done
rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.foam} > /dev/null 2>&1
rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
}
cleanCase ()

View File

@ -24,7 +24,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# buildParaView
# buildParaView3.2.1
#
# Description
# Build and install ParaView
@ -34,34 +34,38 @@
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
# set -x
PARAVIEW_SRC="ParaView3.2.1"
PARAVIEW_MAJOR_VERSION="3.2"
VERBOSE=OFF
INCLUDE_MPI=ON
# User options:
# ~~~~~~~~~~~~~
WITH_MPI=ON
MPI_MAX_PROCS=32
INCLUDE_PYTHON=ON
WITH_PYTHON=ON
PYTHON_LIBRARY=""
INCLUDE_MESA=OFF
WITH__MESA=OFF
set +x
#
# No further editing below this line
#------------------------------------------------------------------------------
# provide a shortcut for repeated builds - use with caution
if [ "$#" -gt 0 ]
# shortcut for repeated builds - use with caution
if [ "$1" = "-fast" ]
then
CMAKE_SKIP=YES
elif [ "$#" -gt 0 ]
then
echo "$0: only supports a -fast option"
exit 1
fi
# set paraview environment
PARAVIEW_SRC_DIR=$PWD/$PARAVIEW_SRC
#PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_ARCH$WM_COMPILER
addMpiSupport # set MPI specific options
addPythonSupport # set python specific options
addMesaSupport # set MESA specific options
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # set cmake verbosity
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
buildParaView
installParaView

View File

@ -30,247 +30,300 @@
#
#------------------------------------------------------------------------------
addCMakeVariable ()
# ParaView_INST_DIR : location of the original sources
# ParaView_DIR : location of the compiled output
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
initialiseVariables ()
addVerbosity()
{
unset CMAKE_VARIABLES OBJ_ADD
if [ "$VERBOSE" = ON ]; then
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
fi
addCMakeVariable "VTK_USE_TK=FALSE"
[ "$VERBOSE" = ON ] && addCMakeVariable CMAKE_VERBOSE_MAKEFILE=TRUE
}
addMpiSupport ()
addMpiSupport()
{
[ "$INCLUDE_MPI" = ON ] || return
[ "$WITH_MPI" = ON ] || return
OBJ_ADD="$OBJ_ADD-mpi"
MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so
MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include
MPI_RUN=$MPI_ARCH_PATH/bin/mpirun
OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "VTK_USE_MPI=ON"
addCMakeVariable "PARAVIEW_USE_MPI=ON"
addCMakeVariable "MPI_INCLUDE_PATH=$MPI_INCLUDE_PATH"
addCMakeVariable "MPI_LIBRARY=$MPI_LIBRARY"
addCMakeVariable "VTK_MPIRUN_EXE=$MPI_RUN"
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
addCMakeVariable PARAVIEW_USE_MPI=ON
addCMakeVariable VTK_USE_MPI=ON
addCMakeVariable MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include
addCMakeVariable MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so
addCMakeVariable VTK_MPIRUN_EXE=$MPI_ARCH_PATH/bin/mpirun
addCMakeVariable VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS
}
addPythonSupport ()
addPythonSupport()
{
[ "$INCLUDE_PYTHON" = ON ] || return
[ "$WITH_PYTHON" = ON ] || return
OBJ_ADD="$OBJ_ADD-py"
WHICH_PYTHON=`which python`
if [ -n "$WHICH_PYTHON" ]; then
OBJ_ADD="$OBJ_ADD-py"
if pythonBin=$(which python 2>/dev/null)
then
if [ -n "$PYTHON_LIBRARY" ]
then
# check $PYTHON_LIBRARY if it has been set
if [ ! -e "$PYTHON_LIBRARY" ]
then
echo "*** Error: libpython not found at location specified " \
"by PYTHON_LIBRARY=$PYTHON_LIBRARY"
fi
else
# Try to get $PYTHON_LIBRARY from dynamically linked binary
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
if [ -n "$PYTHON_LIBRARY" ]; then
# check $PYTHON_LIBRARY if it has been set
if [ ! -e "$PYTHON_LIBRARY" ]; then
echo "*** Error: libpython not found at location specified " \
"by PYTHON_LIBRARY: $PYTHON_LIBRARY"
echo " Please set the variable PYTHON_LIBRARY to the full"
echo " path to (and including) libpython, or deactivate"
echo " python support by setting INCLUDE_PYTHON=OFF"
exit 1
fi
else
# Try to obtain $PYTHON_LIBRARY if not set
# - assumes dynamically linked
PYTHON_LIBRARY=`ldd $WHICH_PYTHON | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p'`
fi
if [ ! -n "$PYTHON_LIBRARY" ]; then
if [ ! -e "$PYTHON_LIBRARY" ]
then
echo "*** Error: Unable to determine path to python library."
echo " Please set the variable PYTHON_LIBRARY to the full"
echo " path to (and including) libpython, or deactivate"
echo " python support by setting INCLUDE_PYTHON=OFF"
exit 1
fi
PYTHON_MAJOR_VERSION=`echo $PYTHON_LIBRARY | \
sed 's/.*libpython\(.*\)\.so.*/\1/'`
PYTHON_INCLUDE_DIR=/usr/include/python$PYTHON_MAJOR_VERSION
fi
fi
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
addCMakeVariable "PYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_DIR"
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
else
echo "*** Error: python not installed"
echo "*** De-activate python support by setting " \
"INCLUDE_PYTHON=OFF"
exit 1
fi
[ -e "$PYTHON_LIBRARY" ] || {
echo " Please set the variable PYTHON_LIBRARY to the full"
echo " path to (and including) libpython, or deactivate"
echo " python support by setting WITH_PYTHON=OFF"
exit 1
}
pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/')
pythonInclude=/usr/include/python$pythonMajor
[ -e "$PYTHON_LIBRARY" ] || {
echo " Please set the variable PYTHON_LIBRARY to the full"
echo " path to (and including) libpython, or deactivate"
echo " python support by setting WITH_PYTHON=OFF"
exit 1
}
# note - we could also allow for a PYTHON_INCLUDE variable ...
[ -e "$pythonInclude" ] || {
echo " No python include headers found"
echo " Please install python headers or deactivate "
echo " python support by setting WITH_PYTHON=OFF"
exit 1
}
addCMakeVariable PARAVIEW_ENABLE_PYTHON=ON
addCMakeVariable PYTHON_INCLUDE_PATH=$pythonInclude
addCMakeVariable PYTHON_LIBRARY=$PYTHON_LIBRARY
echo "----"
echo "Python information:"
echo " executable : $pythonBin"
echo " version : $pythonMajor"
echo " include path : $pythonInclude"
echo " library : $PYTHON_LIBRARY"
unset pythonBin pythonInclude pythonMajor
else
echo "*** Error: python not installed"
echo "*** Deactivate python support by setting WITH_PYTHON=OFF"
exit 1
fi
}
addMesaSupport ()
addMesaSupport()
{
[ "$INCLUDE_MESA" = ON ] || return
[ "$WITH_MESA" = ON ] || return
MESA_INCLUDE_DIR=/usr/include/GL
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
MESA_INCLUDE_DIR=/usr/include/GL
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
if [ -d "$MESA_INCLUDE_DIR" -a -f "$MESA_LIBRARY" ]; then
OBJ_ADD="$OBJ_ADD-mesa"
addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON"
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR"
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
else
echo "*** Error: no MESA information found"
exit 1
fi
if [ -d "$MESA_INCLUDE_DIR" -a -f "$MESA_LIBRARY" ]
then
OBJ_ADD="$OBJ_ADD-mesa"
addCMakeVariable VTK_OPENGL_HAS_OSMESA=ON
addCMakeVariable OSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR
addCMakeVariable OSMESA_LIBRARY=$MESA_LIBRARY
else
echo "*** Error: no MESA information found"
exit 1
fi
}
buildParaView ()
buildParaView()
{
# set general options
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON"
addCMakeVariable "VTK_USE_RPATH:BOOL=OFF"
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release"
# set paraview environment
for i in $PWD $WM_THIRD_PARTY_DIR
do
ParaView_INST_DIR=$i/$PARAVIEW_SRC
[ -d $ParaView_INST_DIR ] && break
done
# set paraview environment
unset PARAVIEW_SRC_DIR
for i in $PWD $WM_THIRD_PARTY_DIR
do
if [ -d $i/$PARAVIEW_SRC ]
then
PARAVIEW_SRC_DIR=$i/$PARAVIEW_SRC
break
fi
done
if [ ! -d "$ParaView_INST_DIR" ]
then
# last chance: maybe already in the paraview directory
[ "${PWD##*/}" = $PARAVIEW_SRC ] && ParaView_INST_DIR=$PWD
[ -d "$PARAVIEW_SRC_DIR" ] || {
echo "did not find $PARAVIEW_SRC in these directories:"
echo " PWD=$PWD"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo "abort build"
exit 1
}
[ -d "$ParaView_INST_DIR" ] || {
echo "did not find $PARAVIEW_SRC in these directories:"
echo " PWD=$PWD"
echo " WM_THIRD_PARTY_DIR=$WM_THIRD_PARTY_DIR"
echo "abort build"
exit 1
}
fi
# PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_ARCH$WM_COMPILER
# provide a shortcut for repeated builds - use with caution
if [ "$CMAKE_SKIP" = YES ]
then
# ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER$OBJ_ADD
ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
# change to build folder
cd $PARAVIEW_OBJ_DIR || exit 1
# shortcut for repeated builds - use with caution
if [ "$CMAKE_SKIP" = YES ]
then
else
# change to build/install folder
cd $ParaView_DIR || exit 1
# remove existing build folder if present
if [ -e "$PARAVIEW_OBJ_DIR" ]; then
rm -rf $PARAVIEW_OBJ_DIR
fi
else
# create paraview build folder
mkdir -p $PARAVIEW_OBJ_DIR
cd $PARAVIEW_OBJ_DIR
# remove any existing build folder and recreate
rm -rf $ParaView_DIR
mkdir -p $ParaView_DIR
cd $ParaView_DIR
echo "Building $PARAVIEW_SRC"
echo " MPI support : $INCLUDE_MPI"
echo " Python support : $INCLUDE_PYTHON"
echo " MESA support : $INCLUDE_MESA"
echo " Source : $PARAVIEW_SRC_DIR"
echo " Target : $PARAVIEW_OBJ_DIR"
echo "----"
echo "Building $PARAVIEW_SRC"
echo " MPI support : $WITH_MPI"
echo " Python support : $WITH_PYTHON"
echo " MESA support : $WITH_MESA"
echo " Source : $ParaView_INST_DIR"
echo " Target : $ParaView_DIR"
echo "----"
# make paraview
cmake \
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
$CMAKE_VARIABLES \
$PARAVIEW_SRC_DIR
fi
# make paraview
cmake \
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
$CMAKE_VARIABLES \
$ParaView_INST_DIR
fi
if [ -r /proc/cpuinfo ]; then
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
# change to build folder
echo " Starting make"
if [ $WM_NCOMPPROCS -gt 8 ]; then
WM_NCOMPPROCS=8
fi
if [ -r /proc/cpuinfo ]
then
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
make -j $WM_NCOMPPROCS
else
make
fi
if [ $WM_NCOMPPROCS -gt 8 ]
then
WM_NCOMPPROCS=8
fi
make -j $WM_NCOMPPROCS
else
make
fi
}
installParaView ()
# adjust hard-links
# Note: use loop with grep to avoid touching too many files
fixCMakeHardLinks()
{
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
echo " Build complete"
fileSpec=$1
string=$2
envName=$3
cd $PARAVIEW_OBJ_DIR
# Replace PARAVIEW_SRC_DIR path with ParaView_INST_DIR
# environment variables
echo " Replacing path hard links"
find . -iname \*.cmake -execdir sed -i \
"s,$PARAVIEW_SRC_DIR,\$ENV{ParaView_INST_DIR},g" {} ';' \
-print
# Replace local MPI_ARCH_PATH path with MPI_ARCH_PATH
# environment variables
if [ "$INCLUDE_MPI" = ON ]; then
find . -iname \*.cmake -execdir sed -i \
"s,$MPI_ARCH_PATH,\$ENV{MPI_ARCH_PATH},g" {} ';' \
-print
fi
# Replace local CMAKE_HOME path with CMAKE_HOME
# environment variables
find . -iname '*cmake*' -execdir sed -i \
"s,$CMAKE_HOME,\$ENV{CMAKE_HOME},g" {} ';' \
-print
# Replace local WM_COMPILER_DIR path with WM_COMPILER_DIR
# environment variables
find . -iname '*cmake*' -execdir sed -i \
"s,$WM_COMPILER_DIR,\$ENV{WM_COMPILER_DIR},g" {} ';' \
-print
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
# - workaround for chosen install location
echo " Creating paraview $PARAVIEW_MAJOR_VERSION soft link to /bin"
( mkdir lib && cd lib && ln -s ../bin \
paraview-$PARAVIEW_MAJOR_VERSION )
# info on symlinks to screen
echo ""
echo " ---"
echo " Installation complete"
echo " Set environment variables:"
echo " - ParaView_INST_DIR to $PARAVIEW_SRC_DIR"
echo " - ParaView_DIR to $PARAVIEW_OBJ_DIR"
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
echo " Add $PARAVIEW_OBJ_DIR/bin to PATH"
# echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
echo " ---"
fi
echo -n " for \$$envName "
for i in $(find . -type f -iname "$fileSpec")
do
if grep -q "$string" $i
then
echo -n "#"
sed -i "s,$string,\$ENV{$envName},g" $i
fi
done
echo
}
# for good measure - clear a few variables before using any of the functions
installParaView()
{
if [ ! -e "$ParaView_DIR/bin/paraview" ]
then
echo " Cannot install - no paraview binary found"
return
fi
echo " Build complete"
unset VERBOSE INCLUDE_MPI INCLUDE_PYTHON INCLUDE_MESA PYTHON_LIBRARY
unset CMAKE_VARIABLES OBJ_ADD
cd $ParaView_DIR
echo " Replacing path hard links"
# Replace local ParaView_INST_DIR path with ParaView_INST_DIR
# environment variable
fixCMakeHardLinks '*.cmake' "$ParaView_INST_DIR" ParaView_INST_DIR
# Replace local MPI_ARCH_PATH path with MPI_ARCH_PATH
# environment variable
if [ "$WITH_MPI" = ON ]
then
fixCMakeHardLinks '*.cmake' "$MPI_ARCH_PATH" MPI_ARCH_PATH
fi
# Replace local CMAKE_HOME path with CMAKE_HOME
# environment variable
if [ -r "$CMAKE_HOME" ]
then
fixCMakeHardLinks '*cmake*' "$CMAKE_HOME" CMAKE_HOME
fi
# Replace local WM_COMPILER_DIR path with WM_COMPILER_DIR
# environment variable
fixCMakeHardLinks '*cmake*' "$WM_COMPILER_DIR" WM_COMPILER_DIR
# create a softlink to the $ParaView_DIR/bin folder
# - workaround for chosen install location
echo " Creating lib/paraview-$PARAVIEW_MAJOR_VERSION soft link to 'bin'"
rm -rf lib/paraview-$PARAVIEW_MAJOR_VERSION
[ -d lib ] || mkdir lib
( cd lib && ln -s ../bin paraview-$PARAVIEW_MAJOR_VERSION )
# info on symlinks to screen
echo ""
echo " ---"
echo " Installation complete"
echo " Set environment variables:"
echo " - ParaView_INST_DIR to $ParaView_INST_DIR"
echo " - ParaView_DIR to $ParaView_DIR"
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
echo " Add $ParaView_DIR/bin to PATH"
# echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
echo " ---"
}
# clear all the variables used before using any of the functions
unset VERBOSE
unset WITH_MPI
unset WITH_MESA
unset WITH_PYTHON
unset PYTHON_LIBRARY
unset CMAKE_VARIABLES
unset CMAKE_SKIP
unset OBJ_ADD
# start with these general settings
addCMakeVariable VTK_USE_TK=FALSE
addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON
addCMakeVariable VTK_USE_RPATH:BOOL=OFF
addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release
# ----------------------------------------------------------------- end-of-file

View File

@ -1,3 +1,17 @@
#!/bin/sh
touch $FOAM_APPBIN/*
if [ "$#" -ne 0 ]
then
echo "Usage: ${0##*/}"
echo " touch FOAM_APPBIN"
exit 1
fi
if [ -d "$FOAM_APPBIN" ]
then
echo "touching FOAM_APPBIN: $FOAM_APPBIN"
touch $FOAM_APPBIN/*
else
echo "no FOAM_APPBIN: $FOAM_APPBIN"
fi
#------------------------------------------------------------------------------

View File

@ -1,3 +1,24 @@
#!/bin/sh
find . \( -name '*.dep' \) -print | xargs -t touch
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " touch all .dep files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "touching all .dep files: $i"
find $i -name '*.dep' -print | xargs -t touch
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -1,3 +1,17 @@
#!/bin/sh
touch $FOAM_LIBBIN/*
if [ "$#" -ne 0 ]
then
echo "Usage: ${0##*/}"
echo " touch FOAM_LIBBIN"
exit 1
fi
if [ -d "$FOAM_LIBBIN" ]
then
echo "touching FOAM_LIBBIN: $FOAM_LIBBIN"
touch $FOAM_LIBBIN/* $FOAM_LIBBIN/*/*
else
echo "no FOAM_LIBBIN: $FOAM_LIBBIN"
fi
#------------------------------------------------------------------------------

View File

@ -1,3 +1,24 @@
#!/bin/sh
find . \( -name '*.o' \) -print | xargs -t touch
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " touch all .o files"
exit 1
fi
for i
do
if [ -d "$i" ]
then
echo "touching all .o files: $i"
find $i -name '*.o' -print | xargs -t touch
else
echo "no directory: $i"
fi
done
#------------------------------------------------------------------------------

View File

@ -1,4 +1,5 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
chmod a+rX $WM_PROJECT_DIR
@ -6,3 +7,5 @@ chmod a+rX $WM_PROJECT_DIR/doc
chmod -R a+rX Doxygen
( cd Doxygen && ./Allwmake )
# ----------------------------------------------------------------- end-of-file

View File

@ -5,5 +5,7 @@ umask 22
rm -rf html latex man
doxygen
# fix permissions (NB: '-X' and not '-x'!)
# fix permissions (NB: '+X' and not '+x'!)
chmod -R a+rX ./
# ----------------------------------------------------------------- end-of-file

View File

@ -1,9 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
( cd OpenFOAM && wmakeLnInclude . )
( cd Pstream && ./Allwmake )
wmake libo OSspecific/$WM_OS
wmake libo OSspecific/$WM_OS
wmake libso OpenFOAM
wmake libso lagrangian/basic

View File

@ -0,0 +1,129 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::Keyed
Description
A container with an integer key attached to any item.
The key can useful for sorting.
SourceFiles
KeyedI.H
\*---------------------------------------------------------------------------*/
#ifndef Keyed_H
#define Keyed_H
#include "List.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
template<class T> class Keyed;
template<class T> Istream& operator>>(Istream&, Keyed<T>&);
template<class T> Ostream& operator<<(Ostream&, const Keyed<T>&);
/*---------------------------------------------------------------------------*\
Class Keyed Declaration
\*---------------------------------------------------------------------------*/
template<class T>
class Keyed
:
public T
{
// Private data
label key_;
public:
// Static Members
//- Add labels to a list of values
inline static List<Keyed<T> > createList
(
const List<T>&,
const label key=0
);
//- Add labels to a list of values
inline static List<Keyed<T> > createList
(
const List<T>&,
const List<label>& keys
);
// Constructors
//- Construct null
inline Keyed();
//- Construct as a copy of item, with a key
inline Keyed(const T& item, const label key=0);
//- Construct from Istream
inline Keyed(Istream&);
// Member Functions
// Access
//- Return const access to the integer key
inline label key() const;
//- Return non-const access to the integer key
inline label& key();
// IOstream Operators
friend Istream& operator>> <T>(Istream&, Keyed<T>&);
friend Ostream& operator<< <T>(Ostream&, const Keyed<T>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "KeyedI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,146 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct null
template<class T>
inline Foam::Keyed<T>::Keyed()
:
key_(-1)
{}
//- Construct from components
template<class T>
inline Foam::Keyed<T>::Keyed(const T& item, const label key)
:
T(item),
key_(key)
{}
template<class T>
inline Foam::Keyed<T>::Keyed(Istream& is)
{
is >> *this;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline Foam::label Foam::Keyed<T>::key() const
{
return key_;
}
template<class T>
inline Foam::label& Foam::Keyed<T>::key()
{
return key_;
}
template<class T>
inline Foam::List<Foam::Keyed<T> >
Foam::Keyed<T>::createList(const List<T>& lst, const label key)
{
List<Keyed<T> > newList(lst.size());
forAll (lst, elemI)
{
newList[elemI] = Keyed(lst[elemI], key);
}
return newList;
}
template<class T>
inline Foam::List<Foam::Keyed<T> >
Foam::Keyed<T>::createList(const List<T>& lst, const List<label>& keys)
{
if (lst.size() != keys.size())
{
FatalErrorIn
(
"Foam::Keyed<T>::createList(const List<T>&, const List<label>&)"
)
<< "size mismatch adding keys to a list:" << nl
<< "List has size " << lst.size()
<< " and keys has size " << keys.size() << nl
<< abort(FatalError);
}
List<Keyed<T> > newList(lst.size());
forAll (lst, elemI)
{
newList[elemI] = Keyed(lst[elemI], keys[elemI]);
}
return newList;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class T>
inline Foam::Istream& Foam::operator>>(Istream& is, Keyed<T>& item)
{
// Read beginning of Keyed item/key pair
is.readBegin("Keyed<T>");
is >> static_cast<T&>(item);
is >> item.key_;
// Read end of Keyed item/key pair
is.readEnd("Keyed<T>");
// Check state of Ostream
is.check("Istream& operator>>(Istream&, Keyed&)");
return is;
}
template<class T>
inline Foam::Ostream& Foam::operator<<(Ostream& os, const Keyed<T>& item)
{
os << token::BEGIN_LIST
<< static_cast<const T&>(item)
<< token::SPACE << item.key_
<< token::END_LIST;
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,173 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "PrimitivePatchExtra.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
PrimitivePatchExtra
(
const ListType<Face>& faces,
const pointField& points
)
:
PrimitivePatch<Face, ListType, PointField, PointType>(faces, points),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
{}
// Construct as copy
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
PrimitivePatchExtra
(
const PrimitivePatchExtra<Face, ListType, PointField, PointType>& pp
)
:
PrimitivePatch<Face, ListType, PointField, PointType>(pp),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
~PrimitivePatchExtra()
{
clearOut();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
clearOut()
{
PrimitivePatch<Face, ListType, PointField, PointType>::clearOut();
clearTopology();
}
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
clearTopology()
{
PrimitivePatch<Face, ListType, PointField, PointType>::clearTopology();
deleteDemandDrivenData(sortedEdgeFacesPtr_);
deleteDemandDrivenData(edgeOwnerPtr_);
}
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
const Foam::labelListList&
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
sortedEdgeFaces() const
{
if (!sortedEdgeFacesPtr_)
{
calcSortedEdgeFaces();
}
return *sortedEdgeFacesPtr_;
}
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
const Foam::labelList&
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
edgeOwner() const
{
if (!edgeOwnerPtr_)
{
calcEdgeOwner();
}
return *edgeOwnerPtr_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PrimitivePatchExtraAddressing.C"
#include "PrimitivePatchExtraCleanup.C"
#include "PrimitivePatchExtraSearch.C"
// ************************************************************************* //

View File

@ -0,0 +1,208 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::PrimitivePatchExtra
Description
PrimitivePatch with some extra functionality.
SourceFiles
PrimitivePatchExtra.C
\*---------------------------------------------------------------------------*/
#ifndef PrimitivePatchExtra_H
#define PrimitivePatchExtra_H
#include "PrimitivePatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PrimitivePatchExtra Declaration
\*---------------------------------------------------------------------------*/
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType=point
>
class PrimitivePatchExtra
:
public PrimitivePatch<Face, ListType, PointField, PointType>
{
public:
// Public typedefs
typedef Face FaceType;
typedef ListType<Face> FaceListType;
typedef PointField PointFieldType;
private:
// Private typedefs
typedef PrimitivePatch<Face, ListType, PointField, PointType> TemplateType;
// Private data
// Demand driven private data
//- Edge-face addressing (sorted)
mutable labelListList* sortedEdgeFacesPtr_;
//- Label of face that 'owns' edge
// i.e. e.vec() is righthanded walk along face
mutable labelList* edgeOwnerPtr_;
// Private Member Functions
//- Calculate sorted edgeFaces
void calcSortedEdgeFaces() const;
//- Calculate owner
void calcEdgeOwner() const;
public:
// Constructors
//- Construct from components
PrimitivePatchExtra
(
const ListType<Face>& faces,
const pointField& points
);
//- Construct as copy
PrimitivePatchExtra
(
const PrimitivePatchExtra<Face, ListType, PointField, PointType>&
);
// Destructor
virtual ~PrimitivePatchExtra();
void clearOut();
void clearTopology();
// Member Functions
// Access functions for demand driven data
// Topological data; no mesh required.
//- Return edge-face addressing sorted
// (for edges with more than 2 faces) according to the
// angle around the edge.
// Orientation is anticlockwise looking from
// edge.vec(localPoints())
const labelListList& sortedEdgeFaces() const;
//- If 2 face neighbours: label of face where ordering of edge
// is consistent with righthand walk.
// If 1 neighbour: label of only face.
// If >2 neighbours: undetermined.
const labelList& edgeOwner() const;
// Addressing into mesh
// Other patch operations
// Check
//- Check multiply-connected edges.
void checkEdges(const bool verbose) const;
//- Check orientation (normals) and normals of neighbouring faces
boolList checkOrientation(const bool verbose) const;
// Edit
//- Fill faceZone with currentZone for every face reachable
// from faceI without crossing edge marked in borderEdge.
// Note: faceZone has to be sized nFaces before calling.
void markZone
(
const boolList& borderEdge,
const label faceI,
const label currentZone,
labelList& faceZone
) const;
//- (size and) fills faceZone with zone of face.
// Zone is area reachable by edge crossing without crossing borderEdge
// (bool for every edge in surface). Returns number of zones.
label markZones
(
const boolList& borderEdge,
labelList& faceZone
) const;
//- Determine the mapping for a sub-mesh.
// Only include faces for which boolList entry is true
// @param[out] pointMap mapping new to old localPoints
// @param[out] faceMap mapping new to old faces
void subsetMap
(
const boolList& include,
labelList& pointMap,
labelList& faceMap
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "PrimitivePatchExtra.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,210 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Contains fix for PrimitivePatch addressing (which doesn't work if surface
is non-manifold). Should be moved into PrimitivePatch.
\*---------------------------------------------------------------------------*/
#include "PrimitivePatchExtra.H"
#include "HashTable.H"
#include "SortableList.H"
#include "transform.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
calcSortedEdgeFaces() const
{
if (sortedEdgeFacesPtr_)
{
FatalErrorIn("PrimitivePatchExtra<Face, ListType, PointField>::calcSortedEdgeFaces()")
<< "sortedEdgeFacesPtr_ already set"
<< abort(FatalError);
}
const labelListList& eFaces = TemplateType::edgeFaces();
const edgeList& edgeLst = TemplateType::edges();
const pointField& locPointLst = TemplateType::localPoints();
const List<FaceType>& locFaceLst = TemplateType::localFaces();
// create the lists for the various results. (resized on completion)
sortedEdgeFacesPtr_ = new labelListList(eFaces.size());
labelListList& sortedEdgeFaces = *sortedEdgeFacesPtr_;
forAll(eFaces, edgeI)
{
const labelList& myFaceNbs = eFaces[edgeI];
if (myFaceNbs.size() > 2)
{
// Get point on edge and normalized direction of edge (= e2 base
// of our coordinate system)
const edge& e = edgeLst[edgeI];
const point& edgePt = locPointLst[e.start()];
vector e2 = e.vec(locPointLst);
e2 /= mag(e2) + VSMALL;
// Get opposite vertex for 0th face
const Face& f = locFaceLst[myFaceNbs[0]];
label fp0 = findIndex(f, e[0]);
label fp1 = f.fcIndex(fp0);
label vertI = (f[fp1] != e[1] ? f[fp1] : f.fcIndex(fp1));
// Get vector normal both to e2 and to edge from opposite vertex
// to edge (will be x-axis of our coordinate system)
vector e0 = e2 ^ (locPointLst[vertI] - edgePt);
e0 /= mag(e0) + VSMALL;
// Get y-axis of coordinate system
vector e1 = e2 ^ e0;
SortableList<scalar> faceAngles(myFaceNbs.size());
// e0 is reference so angle is 0
faceAngles[0] = 0;
for (label nbI = 1; nbI < myFaceNbs.size(); nbI++)
{
// Get opposite vertex
const FaceType& f = locFaceLst[myFaceNbs[nbI]];
label fp0 = findIndex(f, e[0]);
label fp1 = f.fcIndex(fp0);
label vertI = (f[fp1] != e[1] ? f[fp1] : f.fcIndex(fp1));
vector vec = e2 ^ (locPointLst[vertI] - edgePt);
vec /= mag(vec) + VSMALL;
faceAngles[nbI] = pseudoAngle
(
e0,
e1,
vec
);
}
faceAngles.sort();
sortedEdgeFaces[edgeI] = IndirectList<label>
(
myFaceNbs,
faceAngles.indices()
);
}
else
{
// No need to sort. Just copy.
sortedEdgeFaces[edgeI] = myFaceNbs;
}
}
}
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
calcEdgeOwner() const
{
if (edgeOwnerPtr_)
{
FatalErrorIn("PrimitivePatchExtra<Face, ListType, PointField>::calcEdgeOwner()")
<< "edgeOwnerPtr_ already set"
<< abort(FatalError);
}
// create the owner list
edgeOwnerPtr_ = new labelList
(
TemplateType::nEdges()
);
labelList& edgeOwner = *edgeOwnerPtr_;
const edgeList& edgeLst = TemplateType::edges();
const labelListList& eFaces = TemplateType::edgeFaces();
const List<FaceType>& locFaceLst = TemplateType::localFaces();
forAll(edgeLst, edgeI)
{
const edge& e = edgeLst[edgeI];
const labelList& myFaces = eFaces[edgeI];
if (myFaces.size() == 1)
{
edgeOwner[edgeI] = myFaces[0];
}
else
{
// Find the first face whose vertices are aligned with the edge.
// (in case of multiply connected edge the best we can do)
edgeOwner[edgeI] = -1;
forAll(myFaces, i)
{
const FaceType& f = locFaceLst[myFaces[i]];
if (f.findEdge(e) > 0)
{
edgeOwner[edgeI] = myFaces[i];
break;
}
}
if (edgeOwner[edgeI] == -1)
{
FatalErrorIn("PrimitivePatchExtra<Face, ListType, PointField>::calcEdgeOwner()")
<< "Edge " << edgeI << " vertices:" << e
<< " is used by faces " << myFaces
<< " vertices:"
<< IndirectList<FaceType>(locFaceLst, myFaces)()
<< " none of which use the edge vertices in the same order"
<< nl << "I give up" << abort(FatalError);
}
}
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,214 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "PrimitivePatchExtra.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Check/fix edges with more than two faces
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
checkEdges
(
const bool verbose
) const
{
const labelListList& eFaces = TemplateType::edgeFaces();
const edgeList& edgeLst = TemplateType::edges();
forAll(eFaces, edgeI)
{
const labelList& myFaces = eFaces[edgeI];
// boundary edges have one face
// interior edges have two faces
if (myFaces.size() == 0)
{
FatalErrorIn("PrimitivePatchExtra::checkEdges(bool verbose)")
<< "Edge " << edgeI << " with vertices " << edgeLst[edgeI]
<< " has no edgeFaces"
<< exit(FatalError);
}
else if (myFaces.size() > 2)
{
WarningIn
(
"PrimitivePatchExtra::checkEdges(bool verbose)"
) << "Edge " << edgeI << " with vertices " << edgeLst[edgeI]
<< " has more than 2 faces connected to it : " << myFaces
<< endl;
}
}
}
// Check normals and orientation
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
Foam::boolList
Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
checkOrientation
(
const bool verbose
) const
{
const ListType<FaceType>& faceLst = *this;
const edgeList& edgeLst = TemplateType::edges();
const labelListList& faceEs = TemplateType::faceEdges();
const label numEdges = TemplateType::nEdges();
const pointField& pointLst = TemplateType::points();
const vectorField& normLst = TemplateType::faceNormals();
// Check edge normals, face normals, point normals.
forAll(faceEs, faceI)
{
const labelList& edgeLabels = faceEs[faceI];
if (edgeLabels.size() < 3)
{
FatalErrorIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "face " << faceLst[faceI]
<< " has fewer than 3 edges. Edges:" << edgeLabels
<< exit(FatalError);
}
bool valid = true;
forAll(edgeLabels, i)
{
if (edgeLabels[i] < 0 || edgeLabels[i] >= numEdges)
{
WarningIn
(
"PrimitivePatchExtra::checkOrientation(bool)"
) << "edge number " << edgeLabels[i] << " on face " << faceI
<< " out-of-range\n"
<< "This usually means that the input surface has "
<< "edges with more than 2 faces connected.\n"
<< endl;
valid = false;
}
}
if (!valid)
{
continue;
}
//
//- Compute normal from 3 points, use the first as the origin
// minor warpage should not be a problem
const FaceType& f = faceLst[faceI];
const point p0(pointLst[f[0]]);
const point p1(pointLst[f[1]]);
const point p2(pointLst[f[f.size()-1]]);
const vector pointNormal((p1 - p0) ^ (p2 - p0));
if ((pointNormal & normLst[faceI]) < 0)
{
FatalErrorIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "Normal calculated from points not consistent with"
" faceNormal" << endl
<< "face: " << f << endl
<< "points: " << p0 << ' ' << p1 << ' ' << p2 << endl
<< "pointNormal:" << pointNormal << endl
<< "faceNormal:" << normLst[faceI]
<< exit(FatalError);
}
}
const labelListList& eFaces = TemplateType::edgeFaces();
const pointField& locPointsLst = TemplateType::localPoints();
// Storage for holding status of edge. True if normal flips across this
// edge
boolList borderEdge(numEdges, false);
forAll(edgeLst, edgeI)
{
const edge& e = edgeLst[edgeI];
const labelList& neighbours = eFaces[edgeI];
if (neighbours.size() == 2)
{
const FaceType& faceA = faceLst[neighbours[0]];
const FaceType& faceB = faceLst[neighbours[1]];
// The edge cannot be going in the same direction if both faces
// are oriented counterclockwise.
// Thus the next face point *must* different between the faces.
if
(
faceA[faceA.fcIndex(findIndex(faceA, e.start()))]
== faceB[faceB.fcIndex(findIndex(faceB, e.start()))]
)
{
borderEdge[edgeI] = true;
if (verbose)
{
WarningIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "face orientation incorrect." << nl
<< "edge[" << edgeI << "] " << e
<< " between faces " << neighbours << ":" << nl
<< "face[" << neighbours[0] << "] " << faceA << nl
<< "face[" << neighbours[1] << "] " << faceB << endl;
}
}
}
else if (neighbours.size() != 1)
{
if (verbose)
{
WarningIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "Wrong number of edge neighbours." << endl
<< "edge[" << edgeI << "] " << e
<< "with points:" << locPointsLst[e.start()]
<< ' ' << locPointsLst[e.end()]
<< " has neighbours:" << neighbours << endl;
}
borderEdge[edgeI] = true;
}
}
return borderEdge;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,233 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "PrimitivePatchExtra.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Finds area, starting at faceI, delimited by borderEdge. Marks all visited
// faces (from face-edge-face walk) with currentZone.
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::markZone
(
const boolList& borderEdge,
const label faceI,
const label currentZone,
labelList& faceZone
) const
{
// List of faces whose faceZone has been set.
labelList changedFaces(1, faceI);
const labelListList& faceEs = TemplateType::faceEdges();
const labelListList& eFaces = TemplateType::edgeFaces();
while (true)
{
// Pick up neighbours of changedFaces
DynamicList<label> newChangedFaces(2*changedFaces.size());
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
const labelList& fEdges = faceEs[faceI];
forAllfEdges, i)
{
label edgeI = fEdges[i];
if (!borderEdge[edgeI])
{
const labelList& eFaceLst = eFaces[edgeI];
forAll(eFaceLst, j)
{
label nbrFaceI = eFaceLst[j];
if (faceZone[nbrFaceI] == -1)
{
faceZone[nbrFaceI] = currentZone;
newChangedFaces.append(nbrFaceI);
}
else if (faceZone[nbrFaceI] != currentZone)
{
FatalErrorIn
(
"PrimitivePatchExtra<Face, ListType, PointField>::markZone"
"(const boolList&, const label, const label, labelList&) const"
)
<< "Zones " << faceZone[nbrFaceI]
<< " at face " << nbrFaceI
<< " connects to zone " << currentZone
<< " at face " << faceI
<< abort(FatalError);
}
}
}
}
}
if (newChangedFaces.size() == 0)
{
break;
}
changedFaces.transfer(newChangedFaces.shrink());
newChangedFaces.clear();
}
}
// Finds areas delimited by borderEdge (or 'real' edges).
// Fills faceZone accordingly
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
Foam::label Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
markZones
(
const boolList& borderEdge,
labelList& faceZone
) const
{
const label numEdges = TemplateType::nEdges();
const label numFaces = TemplateType::size();
faceZone.setSize(numFaces);
faceZone = -1;
if (borderEdge.size() != numEdges)
{
FatalErrorIn
(
"PrimitivePatchExtra<Face, ListType, PointField>::markZones"
"(const boolList&, labelList&)"
)
<< "borderEdge boolList not same size as number of edges" << endl
<< "borderEdge:" << borderEdge.size() << endl
<< "nEdges :" << numEdges
<< exit(FatalError);
}
label zoneI = 0;
label startFaceI = 0;
for (;;zoneI++)
{
// Find first non-coloured face
for (; startFaceI < numFaces; startFaceI++)
{
if (faceZone[startFaceI] == -1)
{
break;
}
}
if (startFaceI >= numFaces)
{
break;
}
faceZone[startFaceI] = zoneI;
markZone(borderEdge, startFaceI, zoneI, faceZone);
}
return zoneI;
}
// Finds areas delimited by borderEdge (or 'real' edges).
// Fills faceZone accordingly
template
<
class Face,
template<class> class ListType,
class PointField,
class PointType
>
void Foam::PrimitivePatchExtra<Face, ListType, PointField, PointType>::
subsetMap
(
const boolList& include,
labelList& pointMap,
labelList& faceMap
) const
{
const List<FaceType>& locFaces = TemplateType::localFaces();
const label numPoints = TemplateType::nPoints();
label faceI = 0;
label pointI = 0;
faceMap.setSize(locFaces.size());
pointMap.setSize(numPoints);
boolList pointHad(numPoints, false);
forAll(include, oldFaceI)
{
if (include[oldFaceI])
{
// Store new faces compact
faceMap[faceI++] = oldFaceI;
// Renumber labels for face
const FaceType& f = locFaces[oldFaceI];
forAll(f, fp)
{
const label ptLabel = f[fp];
if (!pointHad[ptLabel])
{
pointHad[ptLabel] = true;
pointMap[pointI++] = ptLabel;
}
}
}
}
// Trim
faceMap.setSize(faceI);
pointMap.setSize(pointI);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -12,7 +12,6 @@ FoamFile
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//dynamicFvMeshLib "libtopoChangerFvMesh.so";
@ -38,7 +37,6 @@ mixerFvMeshCoeffs
}
}
// Refinement
dynamicRefineFvMeshCoeffs
{

View File

@ -1,103 +0,0 @@
ALL FILES:
* construct null
* allow assignment of name/origin
* MAJOR CHANGE
- a point is a vector, but not vice versa
- previous methods toGlobal/toLocal include the origin translation
which is incorrect for vectors
- new methods with explicit names:
globalPosition, globalVector, relativePosition, relativeVector
* change affects:
finiteVolume/fields/fvPatchFields/derivedFvPatchFields/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
utilities/mesh/generation/blockMesh/curvedEdges/arcEdge.C
------------------------
coordinateRotation.C
coordinateRotation.H
* coordinateRotation is a tensor with restricted contructors
* null contructor yields the global coordinate system
* a null dictionary corresponds to a null constructor
* new axis/direction constructor with functionality taken from
porousZone and previous coordinateSystem implementation
* allow any combination (e1/e2), (e2/e3), (e3,e1) of local vectors
in addition to the axis/direction specification.
- Added check for co-linear axes.
- Could possibly eliminate the non-orthogonality check.
* allow assigment from dictionary, automatically descend in a
'coordinateRotation' sub-dictionary
* add hook in New() for type 'coordinateRotation' with alias 'axes'
------------------------
coordinateSystem.C
coordinateSystem.H
* remove pure virtual restriction - coordinateSystem can be used
directly and has the same properties as a cartesianCS
* null contructor yields the global coordinate system
* a null dictionary entry corresponds to the global coordinate system
* dictionary constructor w/o name uses the typeName
* the coordinateSystem now has a coordinateRotation,
use coordinateRotation constructors instead of calculating any
rotations ourselves
* allow assigment from dictionary, automatically descend into a
'coordinateSystem' sub-dictionary
This simplifies the addition to other dictionary constructors
(eg, porousZone) without requiring a flat structure or special
parsing within the constructor.
eg,
Foam::porousZone::porousZone(const fvMesh& mesh, Istream& is)
:
mesh_(mesh),
name_(is),
dict_(is),
cellZoneID_(mesh_.cellZones().findZoneID(name_)),
csys_(dict_),
C0_(0),
C1_(0),
D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
{
...
}
* could consider eliminating Rtr_ member and just use R_.T() instead
* add hook in New() for type 'coordinateSystem'
------------------------
cartesianCS.C
cartesianCS.H
* eliminate redundant virtual functions
------------------------
cylindricalCS.H
* include coordinateSystem.H and not cartesianCS.H
------------------------
coordinateSystems.C
coordinateSystems.H
* provide a means to access an invariant set of coordinate systems

View File

@ -210,25 +210,19 @@ void Foam::coordinateRotation::operator=(const dictionary& rhs)
);
vector axis1, axis2;
axisOrder order = e3e1;
axisOrder order(e3e1);
if (dict.found("e1") && dict.found("e2"))
if (dict.readIfPresent("e1", axis1) && dict.readIfPresent("e2", axis2))
{
order = e1e2;
dict.lookup("e1") >> axis1;
dict.lookup("e2") >> axis2;
}
else if (dict.found("e2") && dict.found("e3"))
else if (dict.readIfPresent("e2", axis1) && dict.readIfPresent("e3", axis2))
{
order = e2e3;
dict.lookup("e2") >> axis1;
dict.lookup("e3") >> axis2;
}
else if (dict.found("e3") && dict.found("e1"))
else if (dict.readIfPresent("e3", axis1) && dict.readIfPresent("e1", axis2))
{
order = e3e1;
dict.lookup("e3") >> axis1;
dict.lookup("e1") >> axis2;
}
else if (dict.found("axis") || dict.found("direction"))
{

View File

@ -267,14 +267,8 @@ void Foam::coordinateSystem::operator=(const dictionary& rhs)
);
// unspecified origin is (0 0 0)
if (dict.found("origin"))
{
dict.lookup("origin") >> origin_;
}
else
{
origin_ = vector::zero;
}
origin_ = vector::zero;
dict.readIfPresent("origin", origin_);
// specify via coordinateRotation
if (dict.found("coordinateRotation"))

View File

@ -117,10 +117,7 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
// default type is self
word coordType(typeName_());
if (dict.found("type"))
{
dict.lookup("type") >> coordType;
}
dict.readIfPresent("type", coordType);
// can (must) construct base class directly
if (coordType == typeName_())

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -12,7 +12,6 @@ FoamFile
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application oodles;

View File

@ -1,22 +1,19 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM 1.4.1 |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location system;
object probesDict;
version 2.0;
format ascii;
class dictionary;
object probesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Fields to be probed. runTime modifiable!
fields
(

View File

@ -161,7 +161,7 @@ void triSurface::printTriangle
const pointField& points
)
{
os
os
<< pre.c_str() << "vertex numbers:"
<< f[0] << ' ' << f[1] << ' ' << f[2] << endl
<< pre.c_str() << "vertex coords :"
@ -274,13 +274,13 @@ void triSurface::checkTriangles(const bool verbose)
"triSurface::checkTriangles(bool verbose)"
) << "triangles share the same vertices:\n"
<< " face 1 :" << faceI << endl;
printTriangle(Warning, " ", f, points());
printTriangle(Warning, " ", f, points());
Warning
<< endl
<< " face 2 :"
<< neighbours[neighbourI] << endl;
printTriangle(Warning, " ", n, points());
printTriangle(Warning, " ", n, points());
}
break;
@ -375,8 +375,8 @@ boolList triSurface::checkOrientation(const bool verbose)
(
"triSurface::checkOrientation(bool)"
) << "edge number " << edgeLabels[i] << " on face " << facei
<< " out of range"
<< "\nThis usually means that the input surface has "
<< " out-of-range\n"
<< "This usually means that the input surface has "
<< "edges with more than 2 triangles connected.\n"
<< endl;
valid = false;
@ -413,63 +413,39 @@ boolList triSurface::checkOrientation(const bool verbose)
const labelListList& eFaces = edgeFaces();
// Storage for holding status of edge. True if normal flips across this
// edge
boolList borderEdge(nEdges(), false);
forAll(es, edgei)
forAll(es, edgeI)
{
const labelList& neighbours = eFaces[edgei];
const edge& e = es[edgeI];
const labelList& neighbours = eFaces[edgeI];
if (neighbours.size() == 2)
{
// Two triangles, A and B. Check if edge orientation is
// anticlockwise on both.
const labelList& fEdgesA = faceEdges()[neighbours[0]];
const labelledTri& faceA = (*this)[neighbours[0]];
const labelledTri& faceB = (*this)[neighbours[1]];
// Get next edge after edgei
label nextEdgeA = fEdgesA.fcIndex(findIndex(fEdgesA, edgei));
const labelList& fEdgesB = faceEdges()[neighbours[1]];
label nextEdgeB = fEdgesB.fcIndex(findIndex(fEdgesB, edgei));
// Now check if nextEdgeA and nextEdgeB have any common points
// The edge cannot be going in the same direction if both faces
// are oriented counterclockwise.
// Thus the next face point *must* different between the faces.
if
(
(es[nextEdgeA].start() == es[nextEdgeB].start())
|| (es[nextEdgeA].start() == es[nextEdgeB].end())
|| (es[nextEdgeA].end() == es[nextEdgeB].start())
|| (es[nextEdgeA].end() == es[nextEdgeB].end())
faceA[faceA.fcIndex(findIndex(faceA, e.start()))]
== faceB[faceB.fcIndex(findIndex(faceB, e.start()))]
)
{
borderEdge[edgei] = true;
borderEdge[edgeI] = true;
if (verbose)
{
WarningIn("triSurface::checkOrientation(bool)")
<< "Triangle orientation incorrect." << endl
<< "edge neighbours:" << neighbours << endl
<< "triangle " << neighbours[0] << " has edges "
<< fEdgesA << endl
<< " with points " << endl
<< " " << es[fEdgesA[0]].start() << ' '
<< es[fEdgesA[0]].end() << endl
<< " " << es[fEdgesA[1]].start() << ' '
<< es[fEdgesA[1]].end() << endl
<< " " << es[fEdgesA[2]].start() << ' '
<< es[fEdgesA[2]].end() << endl
<< "triangle " << neighbours[1] << " has edges "
<< fEdgesB << endl
<< " with points " << endl
<< " " << es[fEdgesB[0]].start() << ' '
<< es[fEdgesB[0]].end() << endl
<< " " << es[fEdgesB[1]].start() << ' '
<< es[fEdgesB[1]].end() << endl
<< " " << es[fEdgesB[2]].start() << ' '
<< es[fEdgesB[2]].end() << endl
<< endl;
WarningIn("PrimitivePatchExtra::checkOrientation(bool)")
<< "face orientation incorrect." << nl
<< "edge[" << edgeI << "] " << e
<< " between faces " << neighbours << ":" << nl
<< "face[" << neighbours[0] << "] " << faceA << nl
<< "face[" << neighbours[1] << "] " << faceB << endl;
}
}
}
@ -477,15 +453,14 @@ boolList triSurface::checkOrientation(const bool verbose)
{
if (verbose)
{
const edge& e = es[edgei];
WarningIn("triSurface::checkOrientation(bool)")
<< "Wrong number of edge neighbours." << endl
<< "Edge:" << e
<< "edge[" << edgeI << "] " << e
<< "with points:" << localPoints()[e.start()]
<< ' ' << localPoints()[e.end()]
<< " has neighbours:" << neighbours << endl;
}
borderEdge[edgei] = true;
borderEdge[edgeI] = true;
}
}
@ -1109,7 +1084,7 @@ void triSurface::subsetMeshMap
if (!pointHad[a])
{
pointHad[a] = true;
pointMap[pointI++] = a;
pointMap[pointI++] = a;
}
label b = tri[1];
@ -1147,7 +1122,7 @@ triSurface triSurface::subsetMesh
// Fill pointMap, faceMap
subsetMeshMap(include, pointMap, faceMap);
// Create compact coordinate list and forward mapping array
pointField newPoints(pointMap.size());

View File

@ -30,10 +30,12 @@
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
echo "Cleaning backup files"
find . -type f \( -name "*~" -o -name "*.bak" \) -exec rm {} \;
find . \( -name 'core' -o -name 'core.[1-9]*' \) -exec rm {} \;
find . \( -name '*.pvs' -o -name '*.foam' \) -exec rm {} \;
find . \( -name '*.pvs' -o -name '*.OpenFOAM' \) -exec rm {} \;
rm logs > /dev/null 2>&1
rm testLoopReport > /dev/null 2>&1

View File

@ -30,6 +30,8 @@
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

View File

@ -30,6 +30,8 @@
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # run from this directory
# FUNCTIONS
#
printUsage () {

View File

@ -16,8 +16,7 @@ FoamFile
// General macros to create 2D/extruded-2D meshes
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'printf ($1)')])
//define(calc, [esyscmd(echo $1 | bc | tr -d \\n)])
define(calc, [esyscmd(perl -e 'print ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])
define(pi, 3.14159265)

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object K;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,5 +48,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object T;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,5 +49,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volVectorField;
object U;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,5 +54,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object cp;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,5 +48,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object epsilon;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,5 +49,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object k;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,5 +49,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object p;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,5 +53,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object p;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,5 +53,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4.2 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -11,7 +11,6 @@ FoamFile
format ascii;
class volScalarField;
object rho;
location "0.003";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,5 +48,4 @@ boundaryField
}
}
// ************************************************************************* //

View File

@ -4,4 +4,7 @@
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -r VTK
rm -rf VTK
rm -rf constant/cellToRegion constant/polyMesh/sets
# -----------------------------------------------------------------------------

View File

@ -2,18 +2,41 @@
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -r constant/polyMesh/sets
rm -rf constant/polyMesh/sets
runApplication blockMesh
runApplication setSet -batch makeCellSets.setSet
rm constant/polyMesh/sets/*_old
rm -f constant/polyMesh/sets/*_old
runApplication setsToZones -noFlipMap
runApplication splitMeshRegions -cellZones
changeDictionary -region bottomAir
changeDictionary -region topAir
changeDictionary -region heater
changeDictionary -region leftSolid
changeDictionary -region rightSolid
for i in bottomAir topAir heater leftSolid rightSolid
do
changeDictionary -region $i
done
# remove fluid fields from solid regions (important for post-processing)
for i in heater leftSolid rightSolid
do
rm -f 0*/$i/{epsilon,k,p,pd,U}
done
# remove solid fields from fluid regions (important for post-processing)
for i in bottomAir topAir
do
rm -f 0*/$i/{cp,K}
done
runApplication chtMultiRegionFoam
echo
echo "creating files for paraview post-processing"
echo
for i in bottomAir topAir heater leftSolid rightSolid
do
paraFoam -touch -region $i
done
# -----------------------------------------------------------------------------

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object RASProperties;
version 2.0;
format ascii;
class dictionary;
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
@ -101,5 +93,4 @@ wallFunctionCoeffs
E 9;
}
// ************************************************************************* //

View File

@ -1,28 +1,19 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object environmentalProperties;
version 2.0;
format ascii;
class dictionary;
object environmentalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
g g [0 1 -2 0 0 0 0] (0 -9.81 0);
// ************************************************************************* //

View File

@ -1,30 +1,21 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object thermophysicalProperties;
version 2.0;
format ascii;
class dictionary;
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
mixture air 1 28.9 1000 0 1.8e-05 0.7;
// ************************************************************************* //

View File

@ -1,28 +1,19 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object blockMeshDict;
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
@ -78,5 +69,4 @@ mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object regionProperties;
version 2.0;
format ascii;
class dictionary;
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fluidRegionNames
@ -28,7 +20,6 @@ fluidRegionNames
topAir
);
solidRegionNames
(
heater

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object RASProperties;
version 2.0;
format ascii;
class dictionary;
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
@ -102,5 +94,4 @@ wallFunctionCoeffs
E 9;
}
// ************************************************************************* //

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
U
@ -33,7 +32,6 @@ dictionaryReplacement
value uniform (0 0 0);
}
bottomAir_to_leftSolid
{
type fixedValue;
@ -53,8 +51,6 @@ dictionaryReplacement
}
}
T
{
boundaryField
@ -94,7 +90,6 @@ dictionaryReplacement
}
}
epsilon
{
// Set the value on all bc to non-zero. Not used in simulation
@ -154,7 +149,6 @@ dictionaryReplacement
}
}
k
{
internalField uniform 0.1;
@ -211,7 +205,6 @@ dictionaryReplacement
}
}
pd
{
boundaryField
@ -259,7 +252,6 @@ dictionaryReplacement
}
}
p
{
internalField uniform 1000000;

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
@ -74,5 +66,4 @@ fluxRequired
pd;
}
// ************************************************************************* //

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
@ -114,5 +106,4 @@ PISO
// U 0.9;
//}
// ************************************************************************* //

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
@ -115,7 +114,6 @@ dictionaryReplacement
}
}
K
{
internalField uniform 80;
@ -153,7 +151,6 @@ dictionaryReplacement
}
}
cp
{
internalField uniform 450;

View File

@ -1,28 +1,20 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object controlDict;
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application chtFoam;
application chtMultiRegionFoam;
startFrom latestTime;
@ -36,8 +28,8 @@ deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 5;
//writeControl timeStep;
//writeInterval 20;
// writeControl timeStep;
// writeInterval 20;
purgeWrite 0;
@ -57,5 +49,4 @@ maxCo 0.3;
adjustTimeStep yes;
// ************************************************************************* //

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
@ -64,5 +56,4 @@ fluxRequired
gamma;
}
// ************************************************************************* //

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
@ -128,5 +120,4 @@ PISO
pdRefValue 0;
}
// ************************************************************************* //

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
@ -115,7 +114,6 @@ dictionaryReplacement
}
}
K
{
internalField uniform 80;
@ -153,7 +151,6 @@ dictionaryReplacement
}
}
cp
{
internalField uniform 450;

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
@ -58,5 +50,4 @@ fluxRequired
default no;
}
// ************************************************************************* //

View File

@ -1,25 +1,17 @@
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
@ -37,5 +29,4 @@ PISO
nNonOrthogonalCorrectors 1;
}
// ************************************************************************* //

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
@ -99,7 +98,6 @@ dictionaryReplacement
}
}
K
{
internalField uniform 80;
@ -133,7 +131,6 @@ dictionaryReplacement
}
}
cp
{
internalField uniform 450;

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
T
@ -98,7 +97,6 @@ dictionaryReplacement
}
}
K
{
internalField uniform 80;
@ -132,7 +130,6 @@ dictionaryReplacement
}
}
cp
{
internalField uniform 450;

View File

@ -1,20 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
U
@ -33,7 +32,6 @@ dictionaryReplacement
inletValue uniform (0 0 0);
}
topAir_to_leftSolid
{
type fixedValue;
@ -53,8 +51,6 @@ dictionaryReplacement
}
}
T
{
boundaryField
@ -95,7 +91,6 @@ dictionaryReplacement
}
}
epsilon
{
// Set the value on all bc to non-zero. Not used in simulation
@ -152,7 +147,6 @@ dictionaryReplacement
}
}
k
{
internalField uniform 0.1;
@ -210,7 +204,6 @@ dictionaryReplacement
}
}
pd
{
boundaryField

View File

@ -16,7 +16,7 @@ FoamFile
// General m4 macros
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; printf ($1)')])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; print ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])

View File

@ -16,7 +16,7 @@ FoamFile
// General m4 macros
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; printf ($1)')])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; print ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])

View File

@ -16,7 +16,7 @@ FoamFile
// General m4 macros
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; printf ($1)')])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; print ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])

View File

@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -12,7 +12,6 @@ FoamFile
class dictionary;
object motionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;

View File

@ -16,7 +16,7 @@ FoamFile
// General m4 macros
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; printf ($1)')])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; print ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])