Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2010-08-27 10:42:11 +01:00
85 changed files with 2303 additions and 506 deletions

View File

@ -321,7 +321,7 @@ endOfSection {space}")"{space}
pointGroupEndIndex.append(strtol(endPtr, &endPtr, 16) - 1);
// point group type skipped
strtol(endPtr, &endPtr, 16);
(void)strtol(endPtr, &endPtr, 16);
pointi = pointGroupStartIndex.last();
@ -435,7 +435,7 @@ endOfSection {space}")"{space}
faceGroupEndIndex.append(strtol(endPtr, &endPtr, 16) - 1);
// face group type
strtol(endPtr, &endPtr, 16);
(void)strtol(endPtr, &endPtr, 16);
faceGroupElementType = strtol(endPtr, &endPtr, 16);
@ -583,7 +583,7 @@ endOfSection {space}")"{space}
cellGroupType.append(strtol(endPtr, &endPtr, 16));
// Note. Potentially skip cell set if type is zero.
strtol(endPtr, &endPtr, 16);
(void)strtol(endPtr, &endPtr, 16);
Info<< "CellGroup: "
<< cellGroupZoneID.last()

View File

@ -955,6 +955,12 @@ int main(int argc, char *argv[])
argList::validArgs.append("faceZones");
argList::validArgs.append("thickness");
Foam::argList::addBoolOption
(
"oneD",
"generate columns of 1D cells"
);
#include "addRegionOption.H"
#include "addOverwriteOption.H"
#include "setRootCase.H"
@ -966,6 +972,7 @@ int main(int argc, char *argv[])
const wordList zoneNames(IStringStream(args.additionalArgs()[1])());
scalar thickness = readScalar(IStringStream(args.additionalArgs()[2])());
bool overwrite = args.optionFound("overwrite");
bool oneD = args.optionFound("oneD");
Info<< "Extruding zones " << zoneNames
@ -1225,9 +1232,25 @@ int main(int argc, char *argv[])
label nSide = 0;
forAll(zoneSidePatch, zoneI)
{
if (zoneSidePatch[zoneI] > 0)
if (oneD)
{
// Always add empty patches, one per zone.
word patchName = faceZones[zoneI].name() + "_" + "side";
zoneSidePatch[zoneI] = addPatch<emptyPolyPatch>
(
mesh,
patchName
);
Info<< zoneSidePatch[zoneI] << '\t' << patchName << nl;
nSide++;
}
else if (zoneSidePatch[zoneI] > 0)
{
word patchName = faceZones[zoneI].name() + "_" + "side";
zoneSidePatch[zoneI] = addPatch<polyPatch>
(
mesh,
@ -1257,47 +1280,53 @@ int main(int argc, char *argv[])
);
label nInter = 0;
forAll(zoneZonePatch_min, minZone)
if (!oneD)
{
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
forAll(zoneZonePatch_min, minZone)
{
label index = minZone*faceZones.size()+maxZone;
if (zoneZonePatch_min[index] > 0)
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
{
word minToMax =
faceZones[minZone].name()
+ "_to_"
+ faceZones[maxZone].name();
word maxToMin =
faceZones[maxZone].name()
+ "_to_"
+ faceZones[minZone].name();
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
minToMax,
transformDict
);
Info<< zoneZonePatch_min[index] << '\t' << minToMax << nl;
nInter++;
}
{
transformDict.set("neighbourPatch", minToMax);
zoneZonePatch_max[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
maxToMin,
transformDict
);
Info<< zoneZonePatch_max[index] << '\t' << maxToMin << nl;
nInter++;
}
label index = minZone*faceZones.size()+maxZone;
if (zoneZonePatch_min[index] > 0)
{
word minToMax =
faceZones[minZone].name()
+ "_to_"
+ faceZones[maxZone].name();
word maxToMin =
faceZones[maxZone].name()
+ "_to_"
+ faceZones[minZone].name();
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
minToMax,
transformDict
);
Info<< zoneZonePatch_min[index] << '\t' << minToMax
<< nl;
nInter++;
}
{
transformDict.set("neighbourPatch", minToMax);
zoneZonePatch_max[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
maxToMin,
transformDict
);
Info<< zoneZonePatch_max[index] << '\t' << maxToMin
<< nl;
nInter++;
}
}
}
}
}
@ -1323,7 +1352,16 @@ int main(int argc, char *argv[])
labelList& ePatches = extrudeEdgePatches[edgeI];
if (eFaces.size() == 2)
if (oneD)
{
nonManifoldEdge[edgeI] = 1;
ePatches.setSize(eFaces.size());
forAll(eFaces, i)
{
ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
}
}
else if (eFaces.size() == 2)
{
label zone0 = zoneID[eFaces[0]];
label zone1 = zoneID[eFaces[1]];

View File

@ -1171,7 +1171,11 @@ int main(int argc, char *argv[])
+ "_"
+ procFile.name()
);
system(cmd.c_str());
if (system(cmd.c_str()) == -1)
{
WarningIn(args.executable())
<< "Could not execute command " << cmd << endl;
}
}
}
}

View File

@ -6,6 +6,13 @@ if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
case "$ParaView_VERSION" in
3* | git)
if [ ! -d "${PV_PLUGIN_PATH}" ]
then
echo "$0 : PV_PLUGIN_PATH not a valid directory."
exit 1
fi
wmake libso vtkPV3Readers
PV3blockMeshReader/Allwmake
PV3FoamReader/Allwmake

View File

@ -398,7 +398,12 @@ int main(int argc, char *argv[])
)
{
// Make the eigenvectors a right handed orthogonal triplet
eVec.z() *= sign((eVec.x() ^ eVec.y()) & eVec.z());
eVec = tensor
(
eVec.x(),
eVec.y(),
eVec.z() * sign((eVec.x() ^ eVec.y()) & eVec.z())
);
// Finding the most natural transformation. Using Lists
// rather than tensors to allow indexed permutation.
@ -557,9 +562,7 @@ int main(int argc, char *argv[])
eVal = tEVal;
}
eVec.x() = principal[0];
eVec.y() = principal[1];
eVec.z() = principal[2];
eVec = tensor(principal[0], principal[1], principal[2]);
// {
// tensor R = rotationTensor(vector(1, 0, 0), eVec.x());