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< VolField< Type > > | interpolate (const VolField< Type > &) const |
template<class Type > | |
tmp< SurfaceField< Type > > | interpolate (const SurfaceField< Type > &) const |
template<class Type > | |
tmp< PointField< Type > > | interpolate (const PointField< Type > &) 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::VolField< Type > > | interpolate (const VolField< Type > &vf, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
template<class Type > | |
Foam::tmp< Foam::VolField< Type > > | interpolate (const VolField< Type > &vf) const |
template<class Type > | |
Foam::tmp< Foam::SurfaceField< Type > > | interpolate (const SurfaceField< Type > &sf, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
template<class Type > | |
Foam::tmp< Foam::SurfaceField< Type > > | interpolate (const SurfaceField< Type > &sf) const |
template<class Type > | |
Foam::tmp< Foam::PointField< Type > > | interpolate (const PointField< Type > &pf, const pointMesh &sMesh, const labelList &patchMap, const labelList &pointMap) |
template<class Type > | |
Foam::tmp< Foam::PointField< Type > > | interpolate (const PointField< Type > &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< VolField< Type > > | interpolate (const VolField< Type > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap) |
Map volume field. More... | |
template<class Type > | |
static tmp< SurfaceField< Type > > | interpolate (const SurfaceField< Type > &, 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< PointField< Type > > | interpolate (const PointField< Type > &, 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 469 of file fvMeshSubset.C.
|
delete |
Disallow default bitwise copy construction.
|
virtual |
Destructor.
Definition at line 483 of file fvMeshSubset.C.
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 489 of file fvMeshSubset.C.
References Foam::abort(), IOobject::clone(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::findIndex(), forAll, HashTable< T, Key, Hash >::found(), HashTable< T, Key, Hash >::insert(), Foam::labelMax, Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, patchi, List< T >::setSize(), HashTable< T, Key, Hash >::size(), UPtrList< T >::size(), List< T >::size(), Foam::sort(), HashTable< T, Key, Hash >::toc(), and polyBoundaryMesh::whichPatch().
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 892 of file fvMeshSubset.C.
References Foam::abort(), IOobject::clone(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::findIndex(), forAll, Pstream::gatherList(), Foam::identityMap(), Foam::labelMax, Pstream::listCombineGather(), Pstream::listCombineScatter(), UPstream::myProcNo(), Foam::name(), polyBoundaryMesh::names(), IOobject::NO_READ, IOobject::NO_WRITE, UPstream::nProcs(), UPstream::parRun(), patchi, patchNames(), Foam::reduce(), Pstream::scatterList(), List< T >::setSize(), UPtrList< T >::size(), List< T >::size(), and polyPatch::start().
Referenced by structured::decompose(), fvMeshDistribute::distribute(), and structuredRenumber::renumber().
void setLargeCellSubset | ( | const labelHashSet & | globalCellMap, |
const label | patchID = -1 , |
||
const bool | syncPar = true |
||
) |
setLargeCellSubset but with labelHashSet.
Definition at line 1481 of file fvMeshSubset.C.
References forAllConstIter.
Foam::labelList getExposedFaces | ( | const labelList & | region, |
const label | currentRegion, | ||
const bool | syncCouples = true |
||
) | const |
Get labels of exposed faces.
These are
Definition at line 1498 of file fvMeshSubset.C.
References removeCells::getExposedFaces().
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 1512 of file fvMeshSubset.C.
References Foam::identityMap(), polyTopoChange::makeMesh(), Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, and removeCells::setRefinement().
|
inline |
Original mesh.
Definition at line 222 of file fvMeshSubset.H.
bool hasSubMesh | ( | ) | const |
Have subMesh?
Definition at line 1560 of file fvMeshSubset.C.
const Foam::fvMesh & subMesh | ( | ) | const |
Return reference to subset mesh.
Definition at line 1566 of file fvMeshSubset.C.
Referenced by structured::decompose(), fvMeshDistribute::distribute(), vtkMesh::mesh(), and structuredRenumber::renumber().
Foam::fvMesh & subMesh | ( | ) |
Definition at line 1574 of file fvMeshSubset.C.
const Foam::labelList & pointMap | ( | ) | const |
Return point map.
Definition at line 1582 of file fvMeshSubset.C.
Referenced by fvMeshDistribute::distribute().
const Foam::labelList & faceMap | ( | ) | const |
Return face map.
Definition at line 1590 of file fvMeshSubset.C.
Referenced by fvMeshDistribute::distribute(), and fvMeshSubset::interpolate().
const Foam::labelList & faceFlipMap | ( | ) | const |
Return face map with sign to encode flipped faces.
Definition at line 1598 of file fvMeshSubset.C.
References Foam::faceMap(), and List< T >::size().
Referenced by fvMeshDistribute::distribute().
const Foam::labelList & cellMap | ( | ) | const |
Return cell map.
Definition at line 1636 of file fvMeshSubset.C.
Referenced by structured::decompose(), fvMeshDistribute::distribute(), fvMeshSubset::interpolate(), and structuredRenumber::renumber().
const Foam::labelList & patchMap | ( | ) | const |
Return patch map.
Definition at line 1644 of file fvMeshSubset.C.
Referenced by fvMeshDistribute::distribute(), and fvMeshSubset::interpolate().
|
static |
Map surface field. Optionally negates value if flipping.
a face (from exposing an internal face)
tmp<SurfaceField<Type> > interpolate | ( | const SurfaceField< Type > & | ) | const |
|
static |
Map point field.
tmp<PointField<Type> > interpolate | ( | const PointField< Type > & | ) | const |
|
static |
Map dimensioned field.
tmp<DimensionedField<Type, volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | ) | const |
|
delete |
Disallow default bitwise assignment.
Foam::tmp<Foam::VolField<Type> > interpolate | ( | const VolField< Type > & | vf, |
const fvMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | cellMap, | ||
const labelList & | faceMap | ||
) |
Definition at line 38 of file fvMeshSubsetInterpolate.C.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), fvMeshSubset::cellMap(), DimensionedField< Type, GeoMesh >::dimensions(), fvMeshSubset::faceMap(), forAll, DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), dimensioned< Type >::name(), IOobject::NO_READ, IOobject::NO_WRITE, patchi, fvMeshSubset::patchMap(), GeometricField< Type, PatchField, GeoMesh >::primitiveField(), tmp< T >::ref(), PtrList< T >::set(), fvPatch::size(), List< T >::size(), fvPatch::start(), and fvMesh::time().
Foam::tmp<Foam::VolField<Type> > interpolate | ( | const VolField< Type > & | vf | ) | const |
Definition at line 158 of file fvMeshSubsetInterpolate.C.
References Foam::faceMap(), and Foam::fvc::interpolate().
Foam::tmp<Foam::SurfaceField<Type> > interpolate | ( | const SurfaceField< Type > & | sf, |
const fvMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | cellMap, | ||
const labelList & | faceMap | ||
) |
Definition at line 176 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(), Foam::isFlux(), DimensionedField< Type, GeoMesh >::mesh(), IOobject::name(), dimensioned< Type >::name(), primitiveMesh::nInternalFaces(), IOobject::NO_READ, IOobject::NO_WRITE, patchi, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), tmp< T >::ref(), PtrList< T >::set(), sf(), fvPatch::size(), List< T >::size(), fvPatch::start(), and fvMesh::time().
Foam::tmp<Foam::SurfaceField<Type> > interpolate | ( | const SurfaceField< Type > & | sf | ) | const |
Definition at line 340 of file fvMeshSubsetInterpolate.C.
References Foam::faceMap(), Foam::fvc::interpolate(), and sf().
Foam::tmp<Foam::PointField<Type> > interpolate | ( | const PointField< Type > & | pf, |
const pointMesh & | sMesh, | ||
const labelList & | patchMap, | ||
const labelList & | pointMap | ||
) |
Definition at line 358 of file fvMeshSubsetInterpolate.C.
References pointMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), DimensionedField< Type, GeoMesh >::dimensions(), HashTableCore::end(), HashTable< T, Key, Hash >::find(), forAll, HashTable< T, Key, Hash >::insert(), DimensionedField< Type, GeoMesh >::mesh(), pointPatch::meshPoints(), IOobject::name(), dimensioned< Type >::name(), IOobject::NO_READ, IOobject::NO_WRITE, patchi, GeometricField< Type, PatchField, GeoMesh >::primitiveField(), tmp< T >::ref(), PtrList< T >::set(), pointPatch::size(), List< T >::size(), pointMesh::thisDb(), and IOobject::time().
Foam::tmp<Foam::PointField<Type> > interpolate | ( | const PointField< Type > & | sf | ) | const |
Definition at line 490 of file fvMeshSubsetInterpolate.C.
References Foam::fvc::interpolate(), DemandDrivenMeshObject< polyMesh, RepatchableMeshObject, pointMesh >::New(), and sf().
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | df, |
const fvMesh & | sMesh, | ||
const labelList & | cellMap | ||
) |
Definition at line 507 of file fvMeshSubsetInterpolate.C.
References DimensionedField< Type, GeoMesh >::dimensions(), IOobject::name(), dimensioned< Type >::name(), IOobject::NO_READ, IOobject::NO_WRITE, and fvMesh::time().
Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > interpolate | ( | const DimensionedField< Type, volMesh > & | df | ) | const |
Definition at line 539 of file fvMeshSubsetInterpolate.C.
References Foam::fvc::interpolate().