Post-processing mesh subset tool. Given the original mesh and the list of selected cells, it creates the mesh consisting only of the desired cells, with the mapping list for points, faces, and cells. More...
Public Member Functions | |
TypeName ("fvMeshSubset") | |
Runtime type information. More... | |
fvMeshSubset (const fvMesh &) | |
Construct given a mesh to subset. More... | |
fvMeshSubset (const fvMeshSubset &)=delete | |
Disallow default bitwise copy construction. More... | |
virtual | ~fvMeshSubset () |
Destructor. More... | |
void | setCellSubset (const labelHashSet &globalCellMap, const label patchID=-1, const bool syncPar=true) |
Set the subset. Create "oldInternalFaces" patch for exposed. More... | |
void | setLargeCellSubset (const labelList ®ion, const label currentRegion, const label patchID=-1, const bool syncCouples=true) |
Set the subset from all cells with region == currentRegion. More... | |
void | setLargeCellSubset (const labelHashSet &globalCellMap, const label patchID=-1, const bool syncPar=true) |
setLargeCellSubset but with labelHashSet. More... | |
labelList | getExposedFaces (const labelList ®ion, const label currentRegion, const bool syncCouples=true) const |
Get labels of exposed faces. More... | |
void | setLargeCellSubset (const labelList ®ion, const label currentRegion, const labelList &exposedFaces, const labelList &patchIDs, const bool syncCouples=true) |
For every exposed face (from above getExposedFaces) More... | |
const fvMesh & | baseMesh () const |
Original mesh. More... | |
bool | hasSubMesh () const |
Have subMesh? More... | |
const fvMesh & | subMesh () const |
Return reference to subset mesh. More... | |
fvMesh & | subMesh () |
const labelList & | pointMap () const |
Return point map. More... | |
const labelList & | faceMap () const |
Return face map. More... | |
const labelList & | faceFlipMap () const |
Return face map with sign to encode flipped faces. More... | |
const labelList & | cellMap () const |
Return cell map. More... | |
const labelList & | patchMap () const |
Return patch map. More... | |
template<class Type > | |
tmp< GeometricField< Type, fvPatchField, volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &) const |
template<class Type > | |
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | interpolate (const GeometricField< Type, fvsPatchField, surfaceMesh > &) const |
template<class Type > | |
tmp< GeometricField< Type, pointPatchField, pointMesh > > | interpolate (const GeometricField< Type, pointPatchField, pointMesh > &) const |
template<class Type > | |
tmp< DimensionedField< Type, volMesh > > | interpolate (const DimensionedField< Type, volMesh > &) const |
void | operator= (const fvMeshSubset &)=delete |
Disallow default bitwise assignment. More... | |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &vf, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &vf) const |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > | interpolate (const GeometricField< Type, fvsPatchField, surfaceMesh > &sf, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > | interpolate (const GeometricField< Type, fvsPatchField, surfaceMesh > &sf) const |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::pointPatchField, Foam::pointMesh > > | interpolate (const GeometricField< Type, pointPatchField, pointMesh > &pf, const pointMesh &sMesh, const labelList &patchMap, const labelList &pointMap) |
template<class Type > | |
Foam::tmp< Foam::GeometricField< Type, Foam::pointPatchField, Foam::pointMesh > > | interpolate (const GeometricField< Type, pointPatchField, pointMesh > &sf) const |
template<class Type > | |
Foam::tmp< Foam::DimensionedField< Type, Foam::volMesh > > | interpolate (const DimensionedField< Type, volMesh > &df, const fvMesh &sMesh, const labelList &cellMap) |
template<class Type > | |
Foam::tmp< Foam::DimensionedField< Type, Foam::volMesh > > | interpolate (const DimensionedField< Type, volMesh > &df) const |
Static Public Member Functions | |
template<class Type > | |
static tmp< GeometricField< Type, fvPatchField, volMesh > > | interpolate (const GeometricField< Type, fvPatchField, volMesh > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
Map volume field. More... | |
template<class Type > | |
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > | interpolate (const GeometricField< Type, fvsPatchField, surfaceMesh > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
Map surface field. Optionally negates value if flipping. More... | |
template<class Type > | |
static tmp< GeometricField< Type, pointPatchField, pointMesh > > | interpolate (const GeometricField< Type, pointPatchField, pointMesh > &, const pointMesh &sMesh, const labelList &patchMap, const labelList &pointMap) |
Map point field. More... | |
template<class Type > | |
static tmp< DimensionedField< Type, volMesh > > | interpolate (const DimensionedField< Type, volMesh > &, const fvMesh &sMesh, const labelList &cellMap) |
Map dimensioned field. More... | |
Post-processing mesh subset tool. Given the original mesh and the list of selected cells, it creates the mesh consisting only of the desired cells, with the mapping list for points, faces, and cells.
Puts all exposed internal faces into either
Definition at line 73 of file fvMeshSubset.H.
|
explicit |
Construct given a mesh to subset.
Definition at line 472 of file fvMeshSubset.C.
|
delete |
Disallow default bitwise copy construction.
|
virtual |
Destructor.
Definition at line 486 of file fvMeshSubset.C.
References fvMeshSubset::setCellSubset().
TypeName | ( | "fvMeshSubset" | ) |
Runtime type information.
void setCellSubset | ( | const labelHashSet & | globalCellMap, |
const label | patchID = -1 , |
||
const bool | syncPar = true |
||
) |
Set the subset. Create "oldInternalFaces" patch for exposed.
internal faces (patchID==-1) or use supplied patch. Does not handle coupled patches correctly if only one side gets deleted.
Definition at line 493 of file fvMeshSubset.C.
References Foam::abort(), fvMeshSubset::baseMesh(), polyMesh::boundaryMesh(), primitiveMesh::cells(), IOobject::clone(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::findPatchID(), forAll, HashTable< T, Key, Hash >::found(), HashTable< T, Key, Hash >::insert(), HashTable< T, label, Hash< label > >::insert(), primitiveMesh::isInternalFace(), Foam::labelMax, Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, patchi, polyMesh::points(), fvMeshSubset::setLargeCellSubset(), List< T >::setSize(), UPtrList< T >::size(), List< T >::size(), HashTable< T, Key, Hash >::size(), HashTable< T, label, Hash< label > >::size(), Foam::sort(), timeName, HashTable< T, Key, Hash >::toc(), and polyBoundaryMesh::whichPatch().
Referenced by fvMeshSubset::~fvMeshSubset().
void setLargeCellSubset | ( | const labelList & | region, |
const label | currentRegion, | ||
const label | patchID = -1 , |
||
const bool | syncCouples = true |
||
) |
Set the subset from all cells with region == currentRegion.
Create "oldInternalFaces" patch for exposed internal faces (patchID==-1) or use supplied patch. Handles coupled patches by if necessary making coupled patch face part of patchID (so uncoupled)
Definition at line 895 of file fvMeshSubset.C.
References Foam::abort(), fvMeshSubset::baseMesh(), polyMesh::boundaryMesh(), primitiveMesh::cells(), IOobject::clone(), Foam::endl(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::findPatchID(), forAll, Pstream::gatherList(), Foam::identity(), primitiveMesh::isInternalFace(), Foam::labelMax, Pstream::listCombineGather(), Pstream::listCombineScatter(), UPstream::myProcNo(), Foam::name(), polyBoundaryMesh::names(), primitiveMesh::nInternalFaces(), IOobject::NO_READ, IOobject::NO_WRITE, UPstream::nProcs(), UPstream::parRun(), patchi, patchNames(), polyMesh::points(), Foam::reduce(), Pstream::scatterList(), List< T >::setSize(), UPtrList< T >::size(), List< T >::size(), polyPatch::start(), and timeName.
Referenced by structuredDecomp::decompose(), fvMeshDistribute::distribute(), fvMeshSubset::getExposedFaces(), Foam::min(), structuredRenumber::renumber(), fvMeshSubset::setCellSubset(), and fvMeshSubset::setLargeCellSubset().
void setLargeCellSubset | ( | const labelHashSet & | globalCellMap, |
const label | patchID = -1 , |
||
const bool | syncPar = true |
||
) |
setLargeCellSubset but with labelHashSet.
Definition at line 1484 of file fvMeshSubset.C.
References fvMeshSubset::baseMesh(), forAllConstIter, fvMeshSubset::getExposedFaces(), and fvMeshSubset::setLargeCellSubset().
Foam::labelList getExposedFaces | ( | const labelList & | region, |
const label | currentRegion, | ||
const bool | syncCouples = true |
||
) | const |
Get labels of exposed faces.
These are
Definition at line 1501 of file fvMeshSubset.C.
References fvMeshSubset::baseMesh(), removeCells::getExposedFaces(), and fvMeshSubset::setLargeCellSubset().
Referenced by fvMeshSubset::setLargeCellSubset().
void setLargeCellSubset | ( | const labelList & | region, |
const label | currentRegion, | ||
const labelList & | exposedFaces, | ||
const labelList & | patchIDs, | ||
const bool | syncCouples = true |
||
) |
For every exposed face (from above getExposedFaces)
used supplied (existing!) patch
Definition at line 1515 of file fvMeshSubset.C.
References fvMeshSubset::baseMesh(), Foam::identity(), polyTopoChange::makeMesh(), Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, removeCells::setRefinement(), and timeName.
|
inline |
Original mesh.
Definition at line 222 of file fvMeshSubset.H.
References fvMeshSubset::cellMap(), fvMeshSubset::faceFlipMap(), fvMeshSubset::faceMap(), fvMeshSubset::hasSubMesh(), fvMeshSubset::interpolate(), fvMeshSubset::operator=(), fvMeshSubset::patchMap(), fvMeshSubset::pointMap(), and fvMeshSubset::subMesh().
Referenced by fvMeshSubset::getExposedFaces(), fvMeshDistribute::printFieldInfo(), fvMeshSubset::setCellSubset(), and fvMeshSubset::setLargeCellSubset().
bool hasSubMesh | ( | ) | const |
Have subMesh?
Definition at line 1562 of file fvMeshSubset.C.
Referenced by fvMeshSubset::baseMesh().
const Foam::fvMesh & subMesh | ( | ) | const |
Return reference to subset mesh.
Definition at line 1568 of file fvMeshSubset.C.
Referenced by waveAlphaFvPatchScalarField::alphan(), fvMeshSubset::baseMesh(), structuredDecomp::decompose(), fvMeshDistribute::distribute(), fvMeshSubset::faceFlipMap(), vtkMesh::mesh(), Foam::min(), structuredRenumber::renumber(), and waveVelocityFvPatchVectorField::Un().
Foam::fvMesh & subMesh | ( | ) |
Definition at line 1576 of file fvMeshSubset.C.
const Foam::labelList & pointMap | ( | ) | const |
Return point map.
Definition at line 1584 of file fvMeshSubset.C.
Referenced by fvMeshSubset::baseMesh(), and fvMeshDistribute::distribute().
const Foam::labelList & faceMap | ( | ) | const |
Return face map.
Definition at line 1592 of file fvMeshSubset.C.
Referenced by waveAlphaFvPatchScalarField::alphan(), fvMeshSubset::baseMesh(), fvMeshDistribute::distribute(), fvMeshSubset::faceFlipMap(), Foam::min(), and waveVelocityFvPatchVectorField::Un().
const Foam::labelList & faceFlipMap | ( | ) | const |
Return face map with sign to encode flipped faces.
Definition at line 1600 of file fvMeshSubset.C.
References fvMeshSubset::cellMap(), fvMeshSubset::faceMap(), polyMesh::faceOwner(), primitiveMesh::nInternalFaces(), List< T >::size(), and fvMeshSubset::subMesh().
Referenced by fvMeshSubset::baseMesh(), fvMeshDistribute::distribute(), and Foam::min().
const Foam::labelList & cellMap | ( | ) | const |
Return cell map.
Definition at line 1638 of file fvMeshSubset.C.
Referenced by fvMeshSubset::baseMesh(), structuredDecomp::decompose(), fvMeshDistribute::distribute(), fvMeshSubset::faceFlipMap(), and structuredRenumber::renumber().
const Foam::labelList & patchMap | ( | ) | const |
Return patch map.
Definition at line 1646 of file fvMeshSubset.C.
Referenced by waveAlphaFvPatchScalarField::alphan(), fvMeshSubset::baseMesh(), fvMeshDistribute::distribute(), Foam::min(), and waveVelocityFvPatchVectorField::Un().
|
static |
Map volume field.
Referenced by fvMeshSubset::baseMesh(), fvMeshSubset::interpolate(), vtkMesh::interpolate(), Foam::min(), and fvMeshDistribute::printFieldInfo().
tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate | ( | const GeometricField< Type, fvPatchField, volMesh > & | ) | const |
|
static |
Map surface field. Optionally negates value if flipping.
a face (from exposing an internal face)
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate | ( | const GeometricField< Type, fvsPatchField, surfaceMesh > & | ) | const |
|
static |
Map point field.
tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate | ( | const GeometricField< Type, pointPatchField, pointMesh > & | ) | const |
|
static |
Map dimensioned field.
tmp<DimensionedField<Type, volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | ) | const |
|
delete |
Disallow default bitwise assignment.
Referenced by fvMeshSubset::baseMesh().
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > interpolate | ( | const GeometricField< Type, fvPatchField, volMesh > & | vf, |
const fvMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | cellMap, | ||
const labelList & | faceMap | ||
) |
Definition at line 40 of file fvMeshSubsetInterpolate.C.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), forAll, fvMeshSubset::interpolate(), DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), patchi, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), GeometricField< Type, PatchField, GeoMesh >::ref(), List< T >::size(), fvPatch::size(), fvPatch::start(), fvMesh::time(), and Time::timeName().
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > interpolate | ( | const GeometricField< Type, fvPatchField, volMesh > & | vf | ) | const |
Definition at line 160 of file fvMeshSubsetInterpolate.C.
References Foam::faceMap(), Foam::fvc::interpolate(), and fvMeshSubset::interpolate().
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > interpolate | ( | const GeometricField< Type, fvsPatchField, surfaceMesh > & | sf, |
const fvMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | cellMap, | ||
const labelList & | faceMap | ||
) |
Definition at line 178 of file fvMeshSubsetInterpolate.C.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), DimensionedField< Type, GeoMesh >::dimensions(), Foam::faceMap(), forAll, GeometricField< Type, PatchField, GeoMesh >::internalField(), fvMeshSubset::interpolate(), Foam::isFlux(), DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), primitiveMesh::nInternalFaces(), fvPatch::patch(), patchi, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), tmp< T >::ref(), List< T >::size(), fvPatch::size(), fvPatch::start(), fvMesh::time(), Time::timeName(), and polyPatch::whichFace().
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > interpolate | ( | const GeometricField< Type, fvsPatchField, surfaceMesh > & | sf | ) | const |
Definition at line 349 of file fvMeshSubsetInterpolate.C.
References Foam::faceMap(), Foam::fvc::interpolate(), and fvMeshSubset::interpolate().
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > interpolate | ( | const GeometricField< Type, pointPatchField, pointMesh > & | pf, |
const pointMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | pointMap | ||
) |
Definition at line 367 of file fvMeshSubsetInterpolate.C.
References pointMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), DimensionedField< Type, GeoMesh >::dimensions(), HashTableCore::end(), HashTable< T, Key, Hash >::find(), forAll, fvMeshSubset::interpolate(), DimensionedField< Type, GeoMesh >::mesh(), pointPatch::meshPoints(), IOobject::name(), patchi, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), GeometricField< Type, PatchField, GeoMesh >::ref(), List< T >::size(), pointPatch::size(), pointMesh::thisDb(), IOobject::time(), and Time::timeName().
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> > interpolate | ( | const GeometricField< Type, pointPatchField, pointMesh > & | sf | ) | const |
Definition at line 499 of file fvMeshSubsetInterpolate.C.
References Foam::fvc::interpolate(), fvMeshSubset::interpolate(), and Foam::compressible::New().
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | df, |
const fvMesh & | sMesh, | ||
const labelList & | cellMap | ||
) |
Definition at line 516 of file fvMeshSubsetInterpolate.C.
References DimensionedField< Type, GeoMesh >::dimensions(), fvMeshSubset::interpolate(), IOobject::name(), fvMesh::time(), and Time::timeName().
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | df | ) | const |
Definition at line 548 of file fvMeshSubsetInterpolate.C.
References Foam::fvc::interpolate().