Merge branch 'master' into sixDofPatch

This commit is contained in:
graham
2009-09-30 18:28:45 +01:00
41 changed files with 843 additions and 148 deletions

View File

@ -270,6 +270,10 @@ int main(int argc, char *argv[])
{
mesh.setInstance(oldInstance);
}
else
{
mesh.setInstance(runTime.timeName());
}
Info<< "Writing mesh to " << runTime.timeName() << endl;
if (!mesh.write())

View File

@ -334,7 +334,7 @@ int main(int argc, char *argv[])
}
else
{
mesh.setInstance(oldInstance);
subsetter.subMesh().setInstance(oldInstance);
}
Info<< "Writing subsetted mesh and fields to time " << runTime.timeName()

View File

@ -34,6 +34,7 @@ License
#include "Map.H"
#include "globalMeshData.H"
#include "DynamicList.H"
#include "fvFieldDecomposer.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -306,12 +307,29 @@ bool domainDecomposition::writeDecomposition()
forAll (curPatchSizes, patchi)
{
// Get the face labels consistent with the field mapping
// (reuse the patch field mappers)
const polyPatch& meshPatch =
meshPatches[curBoundaryAddressing[patchi]];
fvFieldDecomposer::patchFieldDecomposer patchMapper
(
SubList<label>
(
curFaceLabels,
curPatchSizes[patchi],
curPatchStarts[patchi]
),
meshPatch.start()
);
// Map existing patches
procPatches[nPatches] =
meshPatches[curBoundaryAddressing[patchi]].clone
(
procMesh.boundaryMesh(),
nPatches,
curPatchSizes[patchi],
patchMapper.directAddressing(),
curPatchStarts[patchi]
).ptr();

View File

@ -445,6 +445,19 @@ Foam::coupledPolyPatch::coupledPolyPatch
{}
Foam::coupledPolyPatch::coupledPolyPatch
(
const coupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::coupledPolyPatch::~coupledPolyPatch()

View File

@ -221,6 +221,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
coupledPolyPatch
(
const coupledPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
// Destructor

View File

@ -94,6 +94,21 @@ Foam::genericPolyPatch::genericPolyPatch
{}
Foam::genericPolyPatch::genericPolyPatch
(
const genericPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
actualTypeName_(pp.actualTypeName_),
dict_(pp.dict_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::genericPolyPatch::~genericPolyPatch()

View File

@ -106,6 +106,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
genericPolyPatch
(
const genericPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -128,6 +138,22 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new genericPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Destructor

View File

@ -826,6 +826,26 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
{}
Foam::cyclicPolyPatch::cyclicPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
coupledPointsPtr_(NULL),
coupledEdgesPtr_(NULL),
featureCos_(pp.featureCos_),
transform_(pp.transform_),
rotationAxis_(pp.rotationAxis_),
rotationCentre_(pp.rotationCentre_),
separationVector_(pp.separationVector_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicPolyPatch::~cyclicPolyPatch()

View File

@ -234,6 +234,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
cyclicPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -256,6 +266,22 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Destructor

View File

@ -87,4 +87,17 @@ Foam::emptyPolyPatch::emptyPolyPatch
{}
Foam::emptyPolyPatch::emptyPolyPatch
(
const emptyPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* //

View File

@ -92,6 +92,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
emptyPolyPatch
(
const emptyPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -113,6 +123,22 @@ public:
new emptyPolyPatch(*this, bm, index, newSize, newStart)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new emptyPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
};

View File

@ -124,6 +124,26 @@ Foam::processorPolyPatch::processorPolyPatch
{}
Foam::processorPolyPatch::processorPolyPatch
(
const processorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, mapAddressing, newStart),
myProcNo_(pp.myProcNo_),
neighbProcNo_(pp.neighbProcNo_),
neighbFaceCentres_(),
neighbFaceAreas_(),
neighbFaceCellCentres_(),
neighbPointsPtr_(NULL),
neighbEdgesPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorPolyPatch::~processorPolyPatch()

View File

@ -158,6 +158,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
processorPolyPatch
(
const processorPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -178,7 +188,7 @@ public:
(
new processorPolyPatch
(
refCast<const processorPolyPatch>(*this),
*this,
bm,
index,
newSize,
@ -187,6 +197,29 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new processorPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Destructor

View File

@ -87,4 +87,17 @@ Foam::symmetryPolyPatch::symmetryPolyPatch
{}
Foam::symmetryPolyPatch::symmetryPolyPatch
(
const symmetryPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* //

View File

@ -92,6 +92,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
symmetryPolyPatch
(
const symmetryPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -113,6 +123,22 @@ public:
new symmetryPolyPatch(*this, bm, index, newSize, newStart)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new symmetryPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
};

View File

@ -157,4 +157,19 @@ Foam::wedgePolyPatch::wedgePolyPatch
}
Foam::wedgePolyPatch::wedgePolyPatch
(
const wedgePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{
initTransforms();
}
// ************************************************************************* //

View File

@ -113,6 +113,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
wedgePolyPatch
(
const wedgePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -135,6 +145,22 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new wedgePolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Member functions

View File

@ -87,4 +87,17 @@ Foam::wallPolyPatch::wallPolyPatch
{}
Foam::wallPolyPatch::wallPolyPatch
(
const wallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart)
{}
// ************************************************************************* //

View File

@ -92,6 +92,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
wallPolyPatch
(
const wallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -113,6 +123,22 @@ public:
new wallPolyPatch(*this, bm, index, newSize, newStart)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new wallPolyPatch(*this, bm, index, mapAddressing, newStart)
);
}
};

View File

@ -167,6 +167,33 @@ Foam::polyPatch::polyPatch
{}
Foam::polyPatch::polyPatch
(
const polyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
patchIdentifier(pp, index),
primitivePatch
(
faceSubList
(
bm.mesh().faces(),
mapAddressing.size(),
newStart
),
bm.mesh().points()
),
start_(newStart),
boundaryMesh_(bm),
faceCellsPtr_(NULL),
mePtr_(NULL)
{}
Foam::polyPatch::polyPatch(const polyPatch& p)
:
patchIdentifier(p),

View File

@ -199,6 +199,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
polyPatch
(
const polyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct as copy
polyPatch(const polyPatch&);
@ -224,6 +234,22 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new polyPatch(*this, bm, index, mapAddressing, newStart)
);
}
// Selectors

View File

@ -134,16 +134,24 @@ void Foam::faceZone::calcCellLayers() const
forAll (mf, faceI)
{
label ownCellI = own[mf[faceI]];
label neiCellI =
(
zoneMesh().mesh().isInternalFace(mf[faceI])
? nei[mf[faceI]]
: -1
);
if (!faceFlip[faceI])
{
// Face is oriented correctly, no flip needed
mc[faceI] = nei[mf[faceI]];
sc[faceI] = own[mf[faceI]];
mc[faceI] = neiCellI;
sc[faceI] = ownCellI;
}
else
{
mc[faceI] = own[mf[faceI]];
sc[faceI] = nei[mf[faceI]];
mc[faceI] = ownCellI;
sc[faceI] = neiCellI;
}
}
//Info << "masterCells: " << mc << endl;

View File

@ -37,7 +37,7 @@ License
#include "mapDistributePolyMesh.H"
#include "featureEdgeMesh.H"
#include "Cloud.H"
#include "globalIndex.H"
//#include "globalIndex.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -188,7 +188,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const
{
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
}
if (phiName_ != "psi")
if (psiName_ != "psi")
{
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
}

View File

@ -50,6 +50,34 @@ namespace Foam
const NamedEnum<directMappedPatchBase::sampleMode, 3>
directMappedPatchBase::sampleModeNames_;
//- Private class for finding nearest
// - point+local index
// - sqr(distance)
// - processor
typedef Tuple2<pointIndexHit, Tuple2<scalar, label> > nearInfo;
class nearestEqOp
{
public:
void operator()(nearInfo& x, const nearInfo& y) const
{
if (y.first().hit())
{
if (!x.first().hit())
{
x = y;
}
else if (y.second().first() < x.second().first())
{
x = y;
}
}
}
};
}
@ -70,7 +98,7 @@ void Foam::directMappedPatchBase::collectSamples
labelListList globalFaces(Pstream::nProcs());
globalFc[Pstream::myProcNo()] = patch_.faceCentres();
globalSamples[Pstream::myProcNo()] = globalFc[Pstream::myProcNo()]+offset_;
globalSamples[Pstream::myProcNo()] = globalFc[Pstream::myProcNo()]+offsets_;
globalFaces[Pstream::myProcNo()] = identity(patch_.size());
// Distribute to all processors
@ -365,17 +393,17 @@ void Foam::directMappedPatchBase::calcMapping() const
if
(
offset_ == vector::zero
gAverage(mag(offsets_)) <= ROOTVSMALL
&& mode_ == NEARESTPATCHFACE
&& sampleRegion_ == patch_.boundaryMesh().mesh().name()
&& samplePatch_ == patch_.name()
)
{
WarningIn("directMappedPatchBase::calcMapping() const")
<< "Invalid offset " << offset_ << endl
<< "Invalid offset " << offsets_ << endl
<< "Offset is the vector added to the patch face centres to"
<< " find the patch face supplying the data." << endl
<< "Setting it to " << offset_
<< "Setting it to " << offsets_
<< " on the same patch, on the same region"
<< " will find the faces themselves which does not make sense"
<< " for anything but testing." << endl
@ -383,7 +411,7 @@ void Foam::directMappedPatchBase::calcMapping() const
<< "sampleRegion_:" << sampleRegion_ << endl
<< "mode_:" << sampleModeNames_[mode_] << endl
<< "samplePatch_:" << samplePatch_ << endl
<< "offset_:" << offset_ << endl;
<< "offsets_:" << offsets_ << endl;
}
@ -447,34 +475,38 @@ void Foam::directMappedPatchBase::calcMapping() const
}
// Check that actual offset vector (sampleLocations - patchFc) is more or
// less constant.
if (Pstream::master())
{
const scalarField magOffset(mag(sampleLocations - patchFc));
const scalar avgOffset(average(magOffset));
forAll(magOffset, sampleI)
{
if (mag(magOffset[sampleI]-avgOffset) > max(SMALL, 0.001*avgOffset))
{
WarningIn("directMappedPatchBase::calcMapping() const")
<< "The actual cell/face centres picked up using offset "
<< offset_ << " are not" << endl
<< " on a single plane."
<< " This might give numerical problems." << endl
<< " At patchface " << patchFc[sampleI]
<< " the sampled cell/face " << sampleLocations[sampleI]
<< endl
<< " is not on a plane " << avgOffset
<< " offset from the patch." << endl
<< " You might want to shift your plane offset."
<< " Set the debug flag to get a dump of sampled cells."
<< endl;
break;
}
}
}
//// Check that actual offset vector (sampleLocations - patchFc) is more or
//// less constant.
//if (Pstream::master())
//{
// const scalarField magOffset(mag(sampleLocations - patchFc));
// const scalar avgOffset(average(magOffset));
//
// forAll(magOffset, sampleI)
// {
// if
// (
// mag(magOffset[sampleI]-avgOffset)
// > max(SMALL, 0.001*avgOffset)
// )
// {
// WarningIn("directMappedPatchBase::calcMapping() const")
// << "The actual cell/face centres picked up using offset "
// << offsets_ << " are not" << endl
// << " on a single plane."
// << " This might give numerical problems." << endl
// << " At patchface " << patchFc[sampleI]
// << " the sampled cell/face " << sampleLocations[sampleI]
// << endl
// << " is not on a plane " << avgOffset
// << " offset from the patch." << endl
// << " You might want to shift your plane offset."
// << " Set the debug flag to get a dump of sampled cells."
// << endl;
// break;
// }
// }
//}
// Determine schedule.
@ -556,14 +588,36 @@ void Foam::directMappedPatchBase::calcMapping() const
Foam::directMappedPatchBase::directMappedPatchBase
(
const polyPatch& pp
const polyPatch& pp
)
:
patch_(pp),
sampleRegion_(patch_.boundaryMesh().mesh().name()),
mode_(NEARESTPATCHFACE),
samplePatch_("none"),
uniformOffset_(true),
offset_(vector::zero),
offsets_(pp.size(), offset_),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mapPtr_(NULL)
{}
Foam::directMappedPatchBase::directMappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode mode,
const word& samplePatch,
const vectorField& offsets
)
:
patch_(pp),
sampleRegion_(sampleRegion),
mode_(mode),
samplePatch_(samplePatch),
uniformOffset_(false),
offsets_(offsets),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mapPtr_(NULL)
{}
@ -586,7 +640,19 @@ Foam::directMappedPatchBase::directMappedPatchBase
),
mode_(sampleModeNames_.read(dict.lookup("sampleMode"))),
samplePatch_(dict.lookup("samplePatch")),
offset_(dict.lookup("offset")),
uniformOffset_(dict.found("offset")),
offset_
(
uniformOffset_
? point(dict.lookup("offset"))
: vector::zero
),
offsets_
(
uniformOffset_
? pointField(patch_.size(), offset_)
: dict.lookup("offsets")
),
sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()),
mapPtr_(NULL)
{}
@ -602,7 +668,28 @@ Foam::directMappedPatchBase::directMappedPatchBase
sampleRegion_(dmp.sampleRegion_),
mode_(dmp.mode_),
samplePatch_(dmp.samplePatch_),
uniformOffset_(dmp.uniformOffset_),
offset_(dmp.offset_),
offsets_(dmp.offsets_),
sameRegion_(dmp.sameRegion_),
mapPtr_(NULL)
{}
Foam::directMappedPatchBase::directMappedPatchBase
(
const polyPatch& pp,
const directMappedPatchBase& dmp,
const unallocLabelList& mapAddressing
)
:
patch_(pp),
sampleRegion_(dmp.sampleRegion_),
mode_(dmp.mode_),
samplePatch_(dmp.samplePatch_),
uniformOffset_(dmp.uniformOffset_),
offset_(dmp.offset_),
offsets_(dmp.offsets_, mapAddressing),
sameRegion_(dmp.sameRegion_),
mapPtr_(NULL)
{}
@ -660,7 +747,14 @@ void Foam::directMappedPatchBase::write(Ostream& os) const
<< token::END_STATEMENT << nl;
os.writeKeyword("samplePatch") << samplePatch_
<< token::END_STATEMENT << nl;
os.writeKeyword("offset") << offset_ << token::END_STATEMENT << nl;
if (uniformOffset_)
{
os.writeKeyword("offset") << offset_ << token::END_STATEMENT << nl;
}
else
{
os.writeKeyword("offsets") << offsets_ << token::END_STATEMENT << nl;
}
}

View File

@ -87,12 +87,18 @@ private:
//- What to sample
const sampleMode mode_;
//- Patch (only if NEARESTBOUNDARY)
//- Patch (only if NEARESTPATCHFACE)
const word samplePatch_;
//- Offset vector
//- For backwards compatibility : reading/writing of uniform offset.
const bool uniformOffset_;
//- Offset vector (uniform)
const vector offset_;
//- Offset vector
const vectorField offsets_;
//- Same region
const bool sameRegion_;
@ -130,36 +136,6 @@ private:
void calcMapping() const;
// Private class
//- Private class for finding nearest
// - point+local index
// - sqr(distance)
// - processor
typedef Tuple2<pointIndexHit, Tuple2<scalar, label> > nearInfo;
class nearestEqOp
{
public:
void operator()(nearInfo& x, const nearInfo& y) const
{
if (y.first().hit())
{
if (!x.first().hit())
{
x = y;
}
else if (y.second().first() < x.second().first())
{
x = y;
}
}
}
};
public:
//- Runtime type information
@ -168,15 +144,33 @@ public:
// Constructors
//- Construct from components
//- Construct from patch
directMappedPatchBase(const polyPatch&);
//- Construct from components
directMappedPatchBase
(
const polyPatch& pp,
const word& sampleRegion,
const sampleMode sampleMode,
const word& samplePatch,
const vectorField& offset
);
//- Construct from dictionary
directMappedPatchBase(const polyPatch&, const dictionary&);
//- Construct as copy, resetting patch
directMappedPatchBase(const polyPatch&, const directMappedPatchBase&);
//- Construct as copy, resetting patch, map original data
directMappedPatchBase
(
const polyPatch&,
const directMappedPatchBase&,
const unallocLabelList& mapAddressing
);
//- Destructor
virtual ~directMappedPatchBase();
@ -210,6 +204,12 @@ public:
return offset_;
}
//- Offset vector (from patch faces to destination mesh objects)
const vectorField& offsets() const
{
return offsets_;
}
//- Return reference to the parallel distribution map
const mapDistribute& map() const
{

View File

@ -57,6 +57,31 @@ Foam::directMappedPolyPatch::directMappedPolyPatch
{}
Foam::directMappedPolyPatch::directMappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const directMappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
)
:
polyPatch(name, size, start, index, bm),
directMappedPatchBase
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{}
Foam::directMappedPolyPatch::directMappedPolyPatch
(
const word& name,
@ -95,6 +120,20 @@ Foam::directMappedPolyPatch::directMappedPolyPatch
{}
Foam::directMappedPolyPatch::directMappedPolyPatch
(
const directMappedPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
polyPatch(pp, bm, index, mapAddressing, newStart),
directMappedPatchBase(*this, pp, mapAddressing)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directMappedPolyPatch::~directMappedPolyPatch()

View File

@ -101,6 +101,20 @@ public:
const polyBoundaryMesh& bm
);
//- Construct from components
directMappedPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const directMappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
);
//- Construct from dictionary
directMappedPolyPatch
(
@ -128,6 +142,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
directMappedPolyPatch
(
const directMappedPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -150,6 +174,29 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new directMappedPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor
virtual ~directMappedPolyPatch();

View File

@ -62,6 +62,31 @@ Foam::directMappedWallPolyPatch::directMappedWallPolyPatch
{}
Foam::directMappedWallPolyPatch::directMappedWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const directMappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
)
:
wallPolyPatch(name, size, start, index, bm),
directMappedPatchBase
(
static_cast<const polyPatch&>(*this),
sampleRegion,
mode,
samplePatch,
offset
)
{}
Foam::directMappedWallPolyPatch::directMappedWallPolyPatch
(
const word& name,
@ -100,6 +125,20 @@ Foam::directMappedWallPolyPatch::directMappedWallPolyPatch
{}
Foam::directMappedWallPolyPatch::directMappedWallPolyPatch
(
const directMappedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
wallPolyPatch(pp, bm, index, mapAddressing, newStart),
directMappedPatchBase(*this, pp, mapAddressing)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directMappedWallPolyPatch::~directMappedWallPolyPatch()

View File

@ -101,6 +101,20 @@ public:
const polyBoundaryMesh& bm
);
//- Construct from components
directMappedWallPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const word& sampleRegion,
const directMappedPatchBase::sampleMode mode,
const word& samplePatch,
const vectorField& offset,
const polyBoundaryMesh& bm
);
//- Construct from dictionary
directMappedWallPolyPatch
(
@ -128,6 +142,16 @@ public:
const label newStart
);
//- Construct given the original patch and a map
directMappedWallPolyPatch
(
const directMappedWallPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
@ -157,6 +181,29 @@ public:
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new directMappedWallPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
//- Destructor
virtual ~directMappedWallPolyPatch();

View File

@ -125,6 +125,31 @@ public:
// Member Functions
//- scaling vector per subsurface
const vectorField& scale() const
{
return scale_;
}
//- scaling vector per subsurface
vectorField& scale()
{
return scale_;
}
//- coordinate system per subsurface
const PtrList<coordinateSystem>& transform() const
{
return transform_;
}
//- coordinate system per subsurface
PtrList<coordinateSystem>& transform()
{
return transform_;
}
virtual const wordList& regions() const;
//- Whether supports volume type below

View File

@ -136,7 +136,7 @@ void Foam::setToFaceZone::applyToSet
if (!fzSet.found(faceI))
{
newAddressing.append(faceI);
newFlipMap.append(true);
newFlipMap.append(false);
}
}

View File

@ -50,6 +50,10 @@ addToRunTimeSelectionTable(topoSet, cellZoneSet, set);
void cellZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
inplaceReorder(order, addressing_);
cellSet::clearStorage();
cellSet::resize(2*addressing_.size());
forAll(addressing_, i)

View File

@ -58,9 +58,6 @@ class cellZoneSet
labelList addressing_;
// Private Member Functions
public:
//- Runtime type information
@ -115,7 +112,7 @@ public:
return addressing_;
}
//- Make cellSet part consistent with addressing
//- Sort addressing and make cellSet part consistent with addressing
void updateSet();
//- Invert contents. (insert all members 0..maxLen-1 which were not in

View File

@ -50,6 +50,11 @@ addToRunTimeSelectionTable(topoSet, faceZoneSet, set);
void faceZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
inplaceReorder(order, addressing_);
inplaceReorder(order, flipMap_);
faceSet::clearStorage();
faceSet::resize(2*addressing_.size());
forAll(addressing_, i)
@ -145,7 +150,7 @@ void faceZoneSet::invert(const label maxLen)
if (!found(faceI))
{
addressing_[n] = faceI;
flipMap_[n] = true; //? or false?
flipMap_[n] = false; //? or true?
n++;
}
}

View File

@ -129,7 +129,7 @@ public:
}
//- Make faceSet part consistent with addressing
//- Sort addressing and make faceSet part consistent with addressing
void updateSet();
//- Invert contents. (insert all members 0..maxLen-1 which were not in

View File

@ -50,6 +50,10 @@ addToRunTimeSelectionTable(topoSet, pointZoneSet, set);
void pointZoneSet::updateSet()
{
labelList order;
sortedOrder(addressing_, order);
inplaceReorder(order, addressing_);
pointSet::clearStorage();
pointSet::resize(2*addressing_.size());
forAll(addressing_, i)

View File

@ -115,7 +115,7 @@ public:
return addressing_;
}
//- Make pointSet part consistent with addressing
//- Sort addressing and make pointSet part consistent with addressing
void updateSet();
//- Invert contents. (insert all members 0..maxLen-1 which were not in

View File

@ -1,60 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object motionU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
movingWall
{
type fixedValue;
value uniform 1;
}
farFieldMoving
{
type slip;
}
fixedWall
{
type fixedValue;
value uniform 0;
}
axis
{
type symmetryPlane;
}
left
{
type fixedValue;
value uniform 0;
}
farField
{
type slip;
}
back
{
type wedge;
}
front
{
type wedge;
}
}
// ************************************************************************* //

View File

@ -27,7 +27,33 @@ boundaryField
}
farFieldMoving
{
type slip;
//type slip;
type surfaceSlipDisplacement;
geometry
{
top
{
type searchablePlane;
planeType pointAndNormal;
basePoint (0 0.0025 0);
normalVector (0 1 0);
}
};
// Find projection with surface:
// fixedNormal : intersections along prespecified direction
// pointNormal : intersections along current pointNormal of patch
// nearest : nearest point on surface
followMode fixedNormal;
// if fixedNormal : normal
projectDirection (0 1 0);
//- -1 or component to knock out before doing projection
//wedgePlane -1;
//- Points that should remain fixed
//frozenPointsZone fixedPointsZone;
}
fixedWall
{
@ -45,7 +71,28 @@ boundaryField
}
farField
{
type slip;
//type slip;
type surfaceSlipDisplacement;
geometry
{
top
{
type searchablePlane;
planeType pointAndNormal;
basePoint (0 0.0025 0);
normalVector (0 1 0);
}
};
followMode fixedNormal;
projectDirection (0 1 0);
//- -1 or component to knock out before doing projection
wedgePlane -1;
//- Points that should remain fixed
//frozenPointsZone fixedPointsZone;
}
back
{

View File

@ -17,6 +17,9 @@ FoamFile
application pimpleDyMFoam;
// For surfaceSlip boundary conditions
libs ("libfvMotionSolvers.so");
startFrom startTime;
startTime 0;