patch decomposition through mapping

This commit is contained in:
mattijs
2009-09-29 22:53:17 +01:00
parent 85a2dbaf59
commit c3519f5b4a
25 changed files with 515 additions and 2 deletions

View File

@ -34,6 +34,7 @@ License
#include "Map.H" #include "Map.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "fvFieldDecomposer.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -306,12 +307,29 @@ bool domainDecomposition::writeDecomposition()
forAll (curPatchSizes, patchi) 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] = procPatches[nPatches] =
meshPatches[curBoundaryAddressing[patchi]].clone meshPatches[curBoundaryAddressing[patchi]].clone
( (
procMesh.boundaryMesh(), procMesh.boundaryMesh(),
nPatches, nPatches,
curPatchSizes[patchi], patchMapper.directAddressing(),
curPatchStarts[patchi] curPatchStarts[patchi]
).ptr(); ).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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::coupledPolyPatch::~coupledPolyPatch() Foam::coupledPolyPatch::~coupledPolyPatch()

View File

@ -221,6 +221,16 @@ public:
const label newStart 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 // 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::genericPolyPatch::~genericPolyPatch() Foam::genericPolyPatch::~genericPolyPatch()

View File

@ -106,6 +106,16 @@ public:
const label newStart 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const 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 // 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cyclicPolyPatch::~cyclicPolyPatch() Foam::cyclicPolyPatch::~cyclicPolyPatch()

View File

@ -234,6 +234,16 @@ public:
const label newStart 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const 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 // 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 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -113,6 +123,22 @@ public:
new emptyPolyPatch(*this, bm, index, newSize, newStart) 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::processorPolyPatch::~processorPolyPatch() Foam::processorPolyPatch::~processorPolyPatch()

View File

@ -158,6 +158,16 @@ public:
const label newStart 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -178,7 +188,7 @@ public:
( (
new processorPolyPatch new processorPolyPatch
( (
refCast<const processorPolyPatch>(*this), *this,
bm, bm,
index, index,
newSize, 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 // 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 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -113,6 +123,22 @@ public:
new symmetryPolyPatch(*this, bm, index, newSize, newStart) 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 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const 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 // 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 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -113,6 +123,22 @@ public:
new wallPolyPatch(*this, bm, index, newSize, newStart) 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) Foam::polyPatch::polyPatch(const polyPatch& p)
: :
patchIdentifier(p), patchIdentifier(p),

View File

@ -199,6 +199,16 @@ public:
const label newStart 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 //- Construct as copy
polyPatch(const polyPatch&); 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 // Selectors

View File

@ -676,6 +676,25 @@ Foam::directMappedPatchBase::directMappedPatchBase
{} {}
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)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directMappedPatchBase::~directMappedPatchBase() Foam::directMappedPatchBase::~directMappedPatchBase()

View File

@ -163,6 +163,14 @@ public:
//- Construct as copy, resetting patch //- Construct as copy, resetting patch
directMappedPatchBase(const polyPatch&, const directMappedPatchBase&); directMappedPatchBase(const polyPatch&, const directMappedPatchBase&);
//- Construct as copy, resetting patch, map original data
directMappedPatchBase
(
const polyPatch&,
const directMappedPatchBase&,
const unallocLabelList& mapAddressing
);
//- Destructor //- Destructor
virtual ~directMappedPatchBase(); virtual ~directMappedPatchBase();

View File

@ -120,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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directMappedPolyPatch::~directMappedPolyPatch() Foam::directMappedPolyPatch::~directMappedPolyPatch()

View File

@ -142,6 +142,16 @@ public:
const label newStart 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -164,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 //- Destructor
virtual ~directMappedPolyPatch(); virtual ~directMappedPolyPatch();

View File

@ -125,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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directMappedWallPolyPatch::~directMappedWallPolyPatch() Foam::directMappedWallPolyPatch::~directMappedWallPolyPatch()

View File

@ -142,6 +142,16 @@ public:
const label newStart 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 //- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{ {
@ -171,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 //- Destructor
virtual ~directMappedWallPolyPatch(); virtual ~directMappedWallPolyPatch();