mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,6 +67,7 @@ void Foam::createShellMesh::syncEdges
|
||||
const labelList& patchEdges,
|
||||
const labelList& coupledEdges,
|
||||
const PackedBoolList& sameEdgeOrientation,
|
||||
const bool syncNonCollocated,
|
||||
|
||||
PackedBoolList& isChangedEdge,
|
||||
DynamicList<label>& changedEdges,
|
||||
@ -111,7 +112,11 @@ void Foam::createShellMesh::syncEdges
|
||||
(
|
||||
cppEdgeData,
|
||||
globalData.globalEdgeSlaves(),
|
||||
globalData.globalEdgeTransformedSlaves(),
|
||||
(
|
||||
syncNonCollocated
|
||||
? globalData.globalEdgeTransformedSlaves() // transformed elems
|
||||
: labelListList(globalData.globalEdgeSlaves().size()) //no transformed
|
||||
),
|
||||
map,
|
||||
minEqOp<labelPair>()
|
||||
);
|
||||
@ -150,6 +155,7 @@ void Foam::createShellMesh::calcPointRegions
|
||||
const globalMeshData& globalData,
|
||||
const primitiveFacePatch& patch,
|
||||
const PackedBoolList& nonManifoldEdge,
|
||||
const bool syncNonCollocated,
|
||||
|
||||
faceList& pointGlobalRegions,
|
||||
faceList& pointLocalRegions,
|
||||
@ -243,6 +249,7 @@ void Foam::createShellMesh::calcPointRegions
|
||||
patchEdges,
|
||||
coupledEdges,
|
||||
sameEdgeOrientation,
|
||||
syncNonCollocated,
|
||||
|
||||
isChangedEdge,
|
||||
changedEdges,
|
||||
@ -356,6 +363,7 @@ void Foam::createShellMesh::calcPointRegions
|
||||
patchEdges,
|
||||
coupledEdges,
|
||||
sameEdgeOrientation,
|
||||
syncNonCollocated,
|
||||
|
||||
isChangedEdge,
|
||||
changedEdges,
|
||||
@ -509,6 +517,7 @@ void Foam::createShellMesh::setRefinement
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Introduce original points
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -525,12 +534,13 @@ void Foam::createShellMesh::setRefinement
|
||||
);
|
||||
pointToPointMap.append(pointI);
|
||||
|
||||
// Pout<< "Added bottom point " << pointToPointMap[pointI]
|
||||
// << " at " << patch_.localPoints()[pointI]
|
||||
// << " from point " << pointI
|
||||
// << endl;
|
||||
//Pout<< "Added bottom point " << addedPointI
|
||||
// << " at " << patch_.localPoints()[pointI]
|
||||
// << " from point " << pointI
|
||||
// << endl;
|
||||
}
|
||||
|
||||
|
||||
// Introduce new points (one for every region)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -541,7 +551,6 @@ void Foam::createShellMesh::setRefinement
|
||||
|
||||
point pt = patch_.localPoints()[pointI];
|
||||
point disp = firstLayerDisp[regionI];
|
||||
|
||||
for (label layerI = 0; layerI < nLayers; layerI++)
|
||||
{
|
||||
pt += disp;
|
||||
@ -675,7 +684,7 @@ void Foam::createShellMesh::setRefinement
|
||||
{
|
||||
FatalErrorIn("createShellMesh::setRefinement(..)")
|
||||
<< "external/feature edge:" << edgeI
|
||||
<< " has " << eFaces.size() << " connected extruded faces"
|
||||
<< " has " << eFaces.size() << " connected extruded faces "
|
||||
<< " but only " << ePatches.size()
|
||||
<< " boundary faces defined." << exit(FatalError);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,6 +88,8 @@ class createShellMesh
|
||||
const labelList&,
|
||||
const labelList&,
|
||||
const PackedBoolList& sameEdgeOrientation,
|
||||
const bool syncNonCollocated,
|
||||
|
||||
PackedBoolList& isChangedEdge,
|
||||
DynamicList<label>& changedEdges,
|
||||
labelPairList& allEdgeData
|
||||
@ -160,6 +162,8 @@ public:
|
||||
// same on all faces connected to a point if they can be
|
||||
// reached through a face-edge-face walk without crossing
|
||||
// the nonManifoldEdge.
|
||||
// syncNonCollocated = true: edges connected through cyclic become
|
||||
// single region. false: kept separate.
|
||||
// pointGlobalRegions : non-compact. Guaranteed to be the same
|
||||
// across processors.
|
||||
// pointLocalRegions : compact.
|
||||
@ -169,6 +173,7 @@ public:
|
||||
const globalMeshData& globalData,
|
||||
const primitiveFacePatch& patch,
|
||||
const PackedBoolList& nonManifoldEdge,
|
||||
const bool syncNonCollocated,
|
||||
faceList& pointGlobalRegions,
|
||||
faceList& pointLocalRegions,
|
||||
labelList& localToGlobalRegion
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -102,6 +102,13 @@ becomes
|
||||
BBB=mapped between original mesh and new extrusion
|
||||
CCC=polypatch
|
||||
|
||||
|
||||
Notes:
|
||||
- when extruding cyclics with only one cell inbetween it does not
|
||||
detect this as a cyclic since the face is the same face. It will
|
||||
only work if the coupled edge extrudes a different face so if there
|
||||
are more than 1 cell inbetween.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -1032,6 +1039,42 @@ label findUncoveredPatchFace
|
||||
}
|
||||
|
||||
|
||||
// Same as findUncoveredPatchFace, except explicitly checks for cyclic faces
|
||||
label findUncoveredCyclicPatchFace
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const UIndirectList<label>& extrudeMeshFaces,// mesh faces that are extruded
|
||||
const label meshEdgeI // mesh edge
|
||||
)
|
||||
{
|
||||
// Make set of extruded faces.
|
||||
labelHashSet extrudeFaceSet(extrudeMeshFaces.size());
|
||||
forAll(extrudeMeshFaces, i)
|
||||
{
|
||||
extrudeFaceSet.insert(extrudeMeshFaces[i]);
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label faceI = eFaces[i];
|
||||
label patchI = pbm.whichPatch(faceI);
|
||||
|
||||
if
|
||||
(
|
||||
patchI != -1
|
||||
&& isA<cyclicPolyPatch>(pbm[patchI])
|
||||
&& !extrudeFaceSet.found(faceI)
|
||||
)
|
||||
{
|
||||
return faceI;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// Calculate per edge min and max zone
|
||||
void calcEdgeMinMaxZone
|
||||
(
|
||||
@ -1288,12 +1331,13 @@ void addCouplingPatches
|
||||
}
|
||||
|
||||
|
||||
// Sets sidePatch[edgeI] to interprocessor patch. Adds any
|
||||
// interprocessor patches if necessary.
|
||||
void addProcPatches
|
||||
// Sets sidePatch[edgeI] to interprocessor or cyclic patch. Adds any
|
||||
// coupled patches if necessary.
|
||||
void addCoupledPatches
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const primitiveFacePatch& extrudePatch,
|
||||
const labelList& extrudeMeshFaces,
|
||||
const labelList& extrudeMeshEdges,
|
||||
const mapDistribute& extrudeEdgeFacesMap,
|
||||
const labelListList& extrudeEdgeGlobalFaces,
|
||||
@ -1342,7 +1386,7 @@ void addProcPatches
|
||||
labelMin // null value
|
||||
);
|
||||
|
||||
Pout<< "Adding inter-processor patches:" << nl << nl
|
||||
Pout<< "Adding processor or cyclic patches:" << nl << nl
|
||||
<< "patchID\tpatch" << nl
|
||||
<< "-------\t-----"
|
||||
<< endl;
|
||||
@ -1367,35 +1411,84 @@ void addProcPatches
|
||||
nbrProcI = maxProcID[edgeI];
|
||||
}
|
||||
|
||||
word name =
|
||||
"procBoundary"
|
||||
+ Foam::name(Pstream::myProcNo())
|
||||
+ "to"
|
||||
+ Foam::name(nbrProcI);
|
||||
|
||||
sidePatchID[edgeI] = findPatchID(newPatches, name);
|
||||
|
||||
if (sidePatchID[edgeI] == -1)
|
||||
if (nbrProcI == Pstream::myProcNo())
|
||||
{
|
||||
dictionary patchDict;
|
||||
patchDict.add("myProcNo", Pstream::myProcNo());
|
||||
patchDict.add("neighbProcNo", nbrProcI);
|
||||
// Cyclic patch since both procs the same. This cyclic should
|
||||
// already exist in newPatches so no adding necessary.
|
||||
|
||||
sidePatchID[edgeI] = addPatch<processorPolyPatch>
|
||||
label faceI = findUncoveredCyclicPatchFace
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
name,
|
||||
patchDict,
|
||||
newPatches
|
||||
mesh,
|
||||
UIndirectList<label>(extrudeMeshFaces, eFaces),
|
||||
extrudeMeshEdges[edgeI]
|
||||
);
|
||||
|
||||
Pout<< sidePatchID[edgeI] << '\t' << name
|
||||
<< nl;
|
||||
if (faceI != -1)
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label newPatchI = findPatchID
|
||||
(
|
||||
newPatches,
|
||||
patches[patches.whichPatch(faceI)].name()
|
||||
);
|
||||
|
||||
sidePatchID[edgeI] = newPatchI;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void addCoupledPatches"
|
||||
"("
|
||||
"const fvMesh&, "
|
||||
"const primitiveFacePatch&, "
|
||||
"const labelList&, "
|
||||
"const labelList&, "
|
||||
"const mapDistribute&, "
|
||||
"const labelListList&, "
|
||||
"labelList&, "
|
||||
"DynamicList<polyPatch*>&"
|
||||
")"
|
||||
) << "Unable to determine coupled patch addressing"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Rrocessor patch
|
||||
|
||||
word name =
|
||||
"procBoundary"
|
||||
+ Foam::name(Pstream::myProcNo())
|
||||
+ "to"
|
||||
+ Foam::name(nbrProcI);
|
||||
|
||||
sidePatchID[edgeI] = findPatchID(newPatches, name);
|
||||
|
||||
if (sidePatchID[edgeI] == -1)
|
||||
{
|
||||
dictionary patchDict;
|
||||
patchDict.add("myProcNo", Pstream::myProcNo());
|
||||
patchDict.add("neighbProcNo", nbrProcI);
|
||||
|
||||
sidePatchID[edgeI] = addPatch<processorPolyPatch>
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
name,
|
||||
patchDict,
|
||||
newPatches
|
||||
);
|
||||
|
||||
Pout<< sidePatchID[edgeI] << '\t' << name
|
||||
<< nl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Pout<< "Added " << newPatches.size()-nOldPatches
|
||||
<< " inter-processor patches." << nl
|
||||
<< " coupled patches." << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -2251,12 +2344,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Sets sidePatchID[edgeI] to interprocessor patch. Adds any
|
||||
// interprocessor patches if necessary.
|
||||
// interprocessor or cyclic patches if necessary.
|
||||
labelList sidePatchID;
|
||||
addProcPatches
|
||||
addCoupledPatches
|
||||
(
|
||||
mesh,
|
||||
extrudePatch,
|
||||
extrudeMeshFaces,
|
||||
extrudeMeshEdges,
|
||||
extrudeEdgeFacesMap,
|
||||
extrudeEdgeGlobalFaces,
|
||||
@ -2409,6 +2503,7 @@ int main(int argc, char *argv[])
|
||||
mesh.globalData(),
|
||||
extrudePatch,
|
||||
nonManifoldEdge,
|
||||
false, // keep cyclic separated regions apart
|
||||
|
||||
pointGlobalRegions,
|
||||
pointLocalRegions,
|
||||
@ -2431,7 +2526,6 @@ int main(int argc, char *argv[])
|
||||
pointField localRegionNormals(localToGlobalRegion.size());
|
||||
{
|
||||
pointField localSum(localToGlobalRegion.size(), vector::zero);
|
||||
labelList localNum(localToGlobalRegion.size(), 0);
|
||||
|
||||
forAll(pointLocalRegions, faceI)
|
||||
{
|
||||
@ -2440,32 +2534,25 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
label localRegionI = pRegions[fp];
|
||||
localSum[localRegionI] += extrudePatch.faceNormals()[faceI];
|
||||
localNum[localRegionI]++;
|
||||
}
|
||||
}
|
||||
|
||||
Map<point> globalSum(2*localToGlobalRegion.size());
|
||||
Map<label> globalNum(2*localToGlobalRegion.size());
|
||||
|
||||
forAll(localSum, localRegionI)
|
||||
{
|
||||
label globalRegionI = localToGlobalRegion[localRegionI];
|
||||
globalSum.insert(globalRegionI, localSum[localRegionI]);
|
||||
globalNum.insert(globalRegionI, localNum[localRegionI]);
|
||||
}
|
||||
|
||||
// Reduce
|
||||
Pstream::mapCombineGather(globalSum, plusEqOp<point>());
|
||||
Pstream::mapCombineScatter(globalSum);
|
||||
Pstream::mapCombineGather(globalNum, plusEqOp<label>());
|
||||
Pstream::mapCombineScatter(globalNum);
|
||||
|
||||
forAll(localToGlobalRegion, localRegionI)
|
||||
{
|
||||
label globalRegionI = localToGlobalRegion[localRegionI];
|
||||
localRegionNormals[localRegionI] =
|
||||
globalSum[globalRegionI]
|
||||
/ globalNum[globalRegionI];
|
||||
localRegionNormals[localRegionI] = globalSum[globalRegionI];
|
||||
}
|
||||
localRegionNormals /= mag(localRegionNormals);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -50,7 +50,7 @@ options:
|
||||
Prints its argument (which should be a ':' separated list) cleansed from
|
||||
- duplicate elements
|
||||
- elements whose start matches one of the wildcard(s)
|
||||
- inaccessible directories (with the -strip (at your option)
|
||||
- inaccessible directories (with the -strip option)
|
||||
|
||||
Exit status
|
||||
0 on success
|
||||
@ -86,7 +86,7 @@ done
|
||||
dirList="$1"
|
||||
shift
|
||||
|
||||
[ -n "$1" ] || exit 2 # quick exit on empty 'dirList'
|
||||
[ -n "$dirList" ] || exit 2 # quick exit on empty 'dirList'
|
||||
|
||||
|
||||
##DEBUG echo "input>$dirList<" 1>&2
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -2403,7 +2403,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
(
|
||||
masterGlobalPoint,
|
||||
pointSlaves,
|
||||
labelListList(cpp.nPoints()), // no transforms
|
||||
labelListList(0), // no transforms
|
||||
pointSlavesMap,
|
||||
maxEqOp<label>()
|
||||
);
|
||||
@ -2684,7 +2684,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
(
|
||||
globalMaster,
|
||||
pointSlaves,
|
||||
labelListList(cpp.nPoints()), // no transforms
|
||||
labelListList(0), // no transforms
|
||||
pointSlavesMap,
|
||||
maxEqOp<label>()
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -50,10 +50,17 @@ void Foam::globalMeshData::syncData
|
||||
Type& elem = elems[i];
|
||||
|
||||
const labelList& slavePoints = slaves[i];
|
||||
const labelList& transformSlavePoints = transformedSlaves[i];
|
||||
label nTransformSlavePoints =
|
||||
(
|
||||
transformedSlaves.size() == 0
|
||||
? 0
|
||||
: transformedSlaves[i].size()
|
||||
);
|
||||
|
||||
if (slavePoints.size()+transformSlavePoints.size() > 0)
|
||||
if (slavePoints.size()+nTransformSlavePoints > 0)
|
||||
{
|
||||
const labelList& transformSlavePoints = transformedSlaves[i];
|
||||
|
||||
// Combine master with untransformed slave data
|
||||
forAll(slavePoints, j)
|
||||
{
|
||||
@ -109,10 +116,17 @@ void Foam::globalMeshData::syncData
|
||||
Type& elem = elems[i];
|
||||
|
||||
const labelList& slavePoints = slaves[i];
|
||||
const labelList& transformSlavePoints = transformedSlaves[i];
|
||||
label nTransformSlavePoints =
|
||||
(
|
||||
transformedSlaves.size() == 0
|
||||
? 0
|
||||
: transformedSlaves[i].size()
|
||||
);
|
||||
|
||||
if (slavePoints.size()+transformSlavePoints.size() > 0)
|
||||
if (slavePoints.size()+nTransformSlavePoints > 0)
|
||||
{
|
||||
const labelList& transformSlavePoints = transformedSlaves[i];
|
||||
|
||||
// Combine master with untransformed slave data
|
||||
forAll(slavePoints, j)
|
||||
{
|
||||
|
||||
@ -704,8 +704,6 @@ tetSliceWithPlane
|
||||
// Tet cut into two prisms. Determine the positive one.
|
||||
label pos0 = -1;
|
||||
label pos1 = -1;
|
||||
label neg0 = -1;
|
||||
label neg1 = -1;
|
||||
forAll(d, i)
|
||||
{
|
||||
if (d[i] > 0)
|
||||
@ -719,17 +717,6 @@ tetSliceWithPlane
|
||||
pos1 = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (neg0 == -1)
|
||||
{
|
||||
neg0 = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
neg1 = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Pout<< "Split 2pos tet " << tet << " d:" << d
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,10 +44,57 @@ Foam::fileFormats::OBJedgeFormat::OBJedgeFormat
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::fileFormats::OBJedgeFormat::read
|
||||
void Foam::fileFormats::OBJedgeFormat::readVertices
|
||||
(
|
||||
const fileName& filename
|
||||
const string& line,
|
||||
string::size_type& endNum,
|
||||
DynamicList<label>& dynVertices
|
||||
)
|
||||
{
|
||||
dynVertices.clear();
|
||||
while (true)
|
||||
{
|
||||
string::size_type startNum =
|
||||
line.find_first_not_of(' ', endNum);
|
||||
|
||||
if (startNum == string::npos)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
endNum = line.find(' ', startNum);
|
||||
|
||||
string vertexSpec;
|
||||
if (endNum != string::npos)
|
||||
{
|
||||
vertexSpec = line.substr(startNum, endNum-startNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
vertexSpec = line.substr(startNum, line.size() - startNum);
|
||||
}
|
||||
|
||||
string::size_type slashPos = vertexSpec.find('/');
|
||||
|
||||
label vertI = 0;
|
||||
if (slashPos != string::npos)
|
||||
{
|
||||
IStringStream intStream(vertexSpec.substr(0, slashPos));
|
||||
|
||||
intStream >> vertI;
|
||||
}
|
||||
else
|
||||
{
|
||||
IStringStream intStream(vertexSpec);
|
||||
|
||||
intStream >> vertI;
|
||||
}
|
||||
dynVertices.append(vertI - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::fileFormats::OBJedgeFormat::read(const fileName& filename)
|
||||
{
|
||||
clear();
|
||||
|
||||
@ -66,6 +113,8 @@ bool Foam::fileFormats::OBJedgeFormat::read
|
||||
DynamicList<edge> dynEdges;
|
||||
DynamicList<label> dynUsedPoints;
|
||||
|
||||
DynamicList<label> dynVertices;
|
||||
|
||||
while (is.good())
|
||||
{
|
||||
string line = this->getLineNoComment(is);
|
||||
@ -97,50 +146,18 @@ bool Foam::fileFormats::OBJedgeFormat::read
|
||||
// Assume 'l' is followed by space.
|
||||
string::size_type endNum = 1;
|
||||
|
||||
int nVerts = 0;
|
||||
for (int count = 0; count < 2; ++count)
|
||||
readVertices
|
||||
(
|
||||
line,
|
||||
endNum,
|
||||
dynVertices
|
||||
);
|
||||
|
||||
|
||||
for (label i = 1; i < dynVertices.size(); i++)
|
||||
{
|
||||
string::size_type startNum =
|
||||
line.find_first_not_of(' ', endNum);
|
||||
edge edgeRead(dynVertices[i-1], dynVertices[i]);
|
||||
|
||||
if (startNum == string::npos)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
endNum = line.find(' ', startNum);
|
||||
|
||||
string vertexSpec;
|
||||
if (endNum != string::npos)
|
||||
{
|
||||
vertexSpec = line.substr(startNum, endNum-startNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
vertexSpec = line.substr(startNum, line.size() - startNum);
|
||||
}
|
||||
|
||||
string::size_type slashPos = vertexSpec.find('/');
|
||||
|
||||
label vertI = 0;
|
||||
if (slashPos != string::npos)
|
||||
{
|
||||
IStringStream intStream(vertexSpec.substr(0, slashPos));
|
||||
|
||||
intStream >> vertI;
|
||||
}
|
||||
else
|
||||
{
|
||||
IStringStream intStream(vertexSpec);
|
||||
|
||||
intStream >> vertI;
|
||||
}
|
||||
|
||||
edgeRead[nVerts++] = (vertI - 1); // change to zero-offset
|
||||
}
|
||||
|
||||
if (nVerts >= 2)
|
||||
{
|
||||
dynUsedPoints[edgeRead[0]] = edgeRead[0];
|
||||
dynUsedPoints[edgeRead[1]] = edgeRead[1];
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,6 +59,13 @@ class OBJedgeFormat
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
void readVertices
|
||||
(
|
||||
const string& line,
|
||||
string::size_type& endNum,
|
||||
DynamicList<label>& dynVertices
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
OBJedgeFormat(const OBJedgeFormat&);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -347,9 +347,6 @@ void Foam::rotorDiskSource::constructGeometry()
|
||||
{
|
||||
const vectorField& C = mesh_.C();
|
||||
|
||||
const vector rDir = coordSys_.e1();
|
||||
const vector zDir = coordSys_.e3();
|
||||
|
||||
forAll(cells_, i)
|
||||
{
|
||||
const label cellI = cells_[i];
|
||||
|
||||
@ -578,6 +578,12 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
|
||||
Info<< "dataType : " << dataType_ << endl;
|
||||
}
|
||||
|
||||
if (dataType_ == "BINARY")
|
||||
{
|
||||
FatalIOErrorIn("vtkUnstructuredReader::read(ISstream&)", inFile)
|
||||
<< "Binary reading not supported " << exit(FatalIOError);
|
||||
}
|
||||
|
||||
parseMode readMode = NOMODE;
|
||||
label wantedSize = -1;
|
||||
|
||||
|
||||
@ -32,6 +32,32 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
//- Helper class for list
|
||||
template<class T>
|
||||
class ListPlusEqOp
|
||||
{
|
||||
public:
|
||||
void operator()(List<T>& x, const List<T> y) const
|
||||
{
|
||||
if (y.size())
|
||||
{
|
||||
if (x.size())
|
||||
{
|
||||
label sz = x.size();
|
||||
x.setSize(sz + y.size());
|
||||
forAll(y, i)
|
||||
{
|
||||
x[sz++] = y[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//- Combine operator for interpolateToSource/Target
|
||||
template<class Type, class BinaryOp>
|
||||
class combineBinaryOp
|
||||
@ -1044,7 +1070,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
|
||||
// reset starting seed
|
||||
label startSeedI = 0;
|
||||
|
||||
label nNonOverlap = 0;
|
||||
DynamicList<label> nonOverlapFaces;
|
||||
do
|
||||
{
|
||||
nbrFaces.clear();
|
||||
@ -1085,7 +1111,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
|
||||
|
||||
if (!faceProcessed)
|
||||
{
|
||||
nNonOverlap++;
|
||||
nonOverlapFaces.append(srcFaceI);
|
||||
}
|
||||
|
||||
// choose new src face from current src face neighbour
|
||||
@ -1105,10 +1131,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
|
||||
}
|
||||
} while (nFacesRemaining > 0);
|
||||
|
||||
if (nNonOverlap != 0)
|
||||
if (nonOverlapFaces.size() != 0)
|
||||
{
|
||||
Pout<< "AMI: " << nNonOverlap << " non-overlap faces identified"
|
||||
Pout<< "AMI: " << nonOverlapFaces.size()
|
||||
<< " non-overlap faces identified"
|
||||
<< endl;
|
||||
|
||||
srcNonOverlap_.transfer(nonOverlapFaces);
|
||||
}
|
||||
|
||||
// transfer data to persistent storage
|
||||
@ -1461,6 +1490,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||
singlePatchProc_(-999),
|
||||
srcAddress_(),
|
||||
srcWeights_(),
|
||||
srcNonOverlap_(),
|
||||
tgtAddress_(),
|
||||
tgtWeights_(),
|
||||
treePtr_(NULL),
|
||||
@ -1493,6 +1523,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||
singlePatchProc_(-999),
|
||||
srcAddress_(),
|
||||
srcWeights_(),
|
||||
srcNonOverlap_(),
|
||||
tgtAddress_(),
|
||||
tgtWeights_(),
|
||||
treePtr_(NULL),
|
||||
@ -1580,6 +1611,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||
singlePatchProc_(fineAMI.singlePatchProc_),
|
||||
srcAddress_(),
|
||||
srcWeights_(),
|
||||
srcNonOverlap_(),
|
||||
tgtAddress_(),
|
||||
tgtWeights_(),
|
||||
treePtr_(NULL),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -84,32 +84,6 @@ class AMIInterpolation
|
||||
//- local typedef to octree tree-type
|
||||
typedef treeDataPrimitivePatch<face, SubList, const pointField&> treeType;
|
||||
|
||||
//- Helper class for list
|
||||
template<class T>
|
||||
class ListPlusEqOp
|
||||
{
|
||||
public:
|
||||
void operator()(List<T>& x, const List<T> y) const
|
||||
{
|
||||
if (y.size())
|
||||
{
|
||||
if (x.size())
|
||||
{
|
||||
label sz = x.size();
|
||||
x.setSize(sz + y.size());
|
||||
forAll(y, i)
|
||||
{
|
||||
x[sz++] = y[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Private data
|
||||
|
||||
@ -132,6 +106,10 @@ class AMIInterpolation
|
||||
//- Weights of target faces per source face
|
||||
scalarListList srcWeights_;
|
||||
|
||||
//- Labels of faces that are not overlapped by any target faces
|
||||
// (should be empty for correct functioning)
|
||||
labelList srcNonOverlap_;
|
||||
|
||||
|
||||
// Target patch
|
||||
|
||||
@ -141,7 +119,7 @@ class AMIInterpolation
|
||||
//- Addresses of source faces per target face
|
||||
labelListList tgtAddress_;
|
||||
|
||||
//- Weights of wource faces per target face
|
||||
//- Weights of source faces per target face
|
||||
scalarListList tgtWeights_;
|
||||
|
||||
|
||||
@ -387,6 +365,11 @@ public:
|
||||
//- Return const access to source patch weights
|
||||
inline const scalarListList& srcWeights() const;
|
||||
|
||||
//- Labels of faces that are not overlapped by any target faces
|
||||
// (should be empty for correct functioning)
|
||||
inline const labelList& srcNonOverlap() const;
|
||||
|
||||
|
||||
//- Source map pointer - valid only if singlePatchProc = -1
|
||||
// This gets source data into a form to be consumed by
|
||||
// tgtAddress, tgtWeights
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -55,6 +55,14 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcWeights() const
|
||||
}
|
||||
|
||||
|
||||
template<class SourcePatch, class TargetPatch>
|
||||
inline const Foam::labelList&
|
||||
Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcNonOverlap() const
|
||||
{
|
||||
return srcNonOverlap_;
|
||||
}
|
||||
|
||||
|
||||
template<class SourcePatch, class TargetPatch>
|
||||
inline const Foam::mapDistribute&
|
||||
Foam::AMIInterpolation<SourcePatch, TargetPatch>::srcMap() const
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,7 +52,7 @@ tmp<volScalarField> SpalartAllmaras::chi() const
|
||||
|
||||
tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const
|
||||
{
|
||||
volScalarField chi3(pow3(chi));
|
||||
const volScalarField chi3(pow3(chi));
|
||||
return chi3/(chi3 + pow3(Cv1_));
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ tmp<volScalarField> SpalartAllmaras::fv3
|
||||
const volScalarField& fv1
|
||||
) const
|
||||
{
|
||||
volScalarField chiByCv2((1/Cv2_)*chi);
|
||||
const volScalarField chiByCv2((1/Cv2_)*chi);
|
||||
|
||||
return
|
||||
(scalar(1) + chi*fv1)
|
||||
@ -96,14 +96,14 @@ tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
|
||||
Stilda,
|
||||
dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)
|
||||
)
|
||||
*sqr(kappa_*d_)
|
||||
*sqr(kappa_*d_)
|
||||
),
|
||||
scalar(10.0)
|
||||
)
|
||||
);
|
||||
r.boundaryField() == 0.0;
|
||||
|
||||
volScalarField g(r + Cw2_*(pow6(r) - r));
|
||||
const volScalarField g(r + Cw2_*(pow6(r) - r));
|
||||
|
||||
return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0);
|
||||
}
|
||||
@ -261,8 +261,7 @@ tmp<volScalarField> SpalartAllmaras::k() const
|
||||
{
|
||||
WarningIn("tmp<volScalarField> SpalartAllmaras::k() const")
|
||||
<< "Turbulence kinetic energy not defined for Spalart-Allmaras model. "
|
||||
<< "Returning zero field"
|
||||
<< endl;
|
||||
<< "Returning zero field" << endl;
|
||||
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
@ -294,7 +293,7 @@ tmp<volScalarField> SpalartAllmaras::epsilon() const
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"epslion",
|
||||
"epsilon",
|
||||
runTime_.timeName(),
|
||||
mesh_
|
||||
),
|
||||
@ -347,7 +346,7 @@ tmp<volSymmTensorField> SpalartAllmaras::devRhoReff() const
|
||||
|
||||
tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff(volVectorField& U) const
|
||||
{
|
||||
volScalarField muEff_(muEff());
|
||||
const volScalarField muEff_(muEff());
|
||||
|
||||
return
|
||||
(
|
||||
@ -404,10 +403,10 @@ void SpalartAllmaras::correct()
|
||||
d_.correct();
|
||||
}
|
||||
|
||||
volScalarField chi(this->chi());
|
||||
volScalarField fv1(this->fv1(chi));
|
||||
const volScalarField chi(this->chi());
|
||||
const volScalarField fv1(this->fv1(chi));
|
||||
|
||||
volScalarField Stilda
|
||||
const volScalarField Stilda
|
||||
(
|
||||
fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_)))
|
||||
+ fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_)
|
||||
|
||||
Reference in New Issue
Block a user