fvMeshSubset Class Reference

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 &region, 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 &region, const label currentRegion, const bool syncCouples=true) const
 Get labels of exposed faces. More...
 
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) More...
 
const fvMeshbaseMesh () const
 Original mesh. More...
 
bool hasSubMesh () const
 Have subMesh? More...
 
const fvMeshsubMesh () const
 Return reference to subset mesh. More...
 
fvMeshsubMesh ()
 
const labelListpointMap () const
 Return point map. More...
 
const labelListfaceMap () const
 Return face map. More...
 
const labelListfaceFlipMap () const
 Return face map with sign to encode flipped faces. More...
 
const labelListcellMap () const
 Return cell map. More...
 
const labelListpatchMap () 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...
 

Detailed Description

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

  • a user supplied patch
  • a newly created patch "oldInternalFaces"
  • setCellSubset is for small subsets. Uses Maps to minimise memory.
  • setLargeCellSubset is for largish subsets (>10% of mesh). Uses labelLists instead.
  • setLargeCellSubset does coupled patch subsetting as well. If it detects a face on a coupled patch 'losing' its neighbour it will move the face into the oldInternalFaces patch.
  • if a user supplied patch is used it is up to the destination patchField to handle exposed internal faces (mapping from face -1). If not provided the default is to assign the internalField. All the basic patch field types (e.g. fixedValue) will give a warning and preferably derived patch field types should be used that know how to handle exposed faces (e.g. use uniformFixedValue instead of fixedValue)
Source files

Definition at line 73 of file fvMeshSubset.H.

Constructor & Destructor Documentation

◆ fvMeshSubset() [1/2]

fvMeshSubset ( const fvMesh baseMesh)
explicit

Construct given a mesh to subset.

Definition at line 472 of file fvMeshSubset.C.

◆ fvMeshSubset() [2/2]

fvMeshSubset ( const fvMeshSubset )
delete

Disallow default bitwise copy construction.

◆ ~fvMeshSubset()

~fvMeshSubset ( )
virtual

Destructor.

Definition at line 486 of file fvMeshSubset.C.

References fvMeshSubset::setCellSubset().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "fvMeshSubset"  )

Runtime type information.

◆ setCellSubset()

◆ setLargeCellSubset() [1/3]

void setLargeCellSubset ( const labelList region,
const label  currentRegion,
const label  patchID = -1,
const bool  syncCouples = true 
)

◆ setLargeCellSubset() [2/3]

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().

Here is the call graph for this function:

◆ getExposedFaces()

Foam::labelList getExposedFaces ( const labelList region,
const label  currentRegion,
const bool  syncCouples = true 
) const

Get labels of exposed faces.

These are

  • internal faces that become boundary faces
  • coupled faces that become uncoupled (since one of the sides gets deleted)

Definition at line 1501 of file fvMeshSubset.C.

References fvMeshSubset::baseMesh(), removeCells::getExposedFaces(), and fvMeshSubset::setLargeCellSubset().

Referenced by fvMeshSubset::setLargeCellSubset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLargeCellSubset() [3/3]

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.

Here is the call graph for this function:

◆ baseMesh()

◆ hasSubMesh()

bool hasSubMesh ( ) const

Have subMesh?

Definition at line 1562 of file fvMeshSubset.C.

Referenced by fvMeshSubset::baseMesh().

Here is the caller graph for this function:

◆ subMesh() [1/2]

◆ subMesh() [2/2]

Foam::fvMesh & subMesh ( )

Definition at line 1576 of file fvMeshSubset.C.

◆ pointMap()

const Foam::labelList & pointMap ( ) const

Return point map.

Definition at line 1584 of file fvMeshSubset.C.

Referenced by fvMeshSubset::baseMesh(), and fvMeshDistribute::distribute().

Here is the caller graph for this function:

◆ faceMap()

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().

Here is the caller graph for this function:

◆ faceFlipMap()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cellMap()

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().

Here is the caller graph for this function:

◆ patchMap()

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().

Here is the caller graph for this function:

◆ interpolate() [1/16]

static tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate ( const GeometricField< Type, fvPatchField, volMesh > &  ,
const fvMesh sMesh,
const labelList patchMap,
const labelList cellMap,
const labelList faceMap 
)
static

Map volume field.

Referenced by fvMeshSubset::baseMesh(), fvMeshSubset::interpolate(), vtkMesh::interpolate(), Foam::min(), and fvMeshDistribute::printFieldInfo().

Here is the caller graph for this function:

◆ interpolate() [2/16]

tmp<GeometricField<Type, fvPatchField, volMesh> > interpolate ( const GeometricField< Type, fvPatchField, volMesh > &  ) const

◆ interpolate() [3/16]

static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  ,
const fvMesh sMesh,
const labelList patchMap,
const labelList cellMap,
const labelList faceMap 
)
static

Map surface field. Optionally negates value if flipping.

a face (from exposing an internal face)

◆ interpolate() [4/16]

tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  ) const

◆ interpolate() [5/16]

static tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate ( const GeometricField< Type, pointPatchField, pointMesh > &  ,
const pointMesh sMesh,
const labelList patchMap,
const labelList pointMap 
)
static

Map point field.

◆ interpolate() [6/16]

tmp<GeometricField<Type, pointPatchField, pointMesh> > interpolate ( const GeometricField< Type, pointPatchField, pointMesh > &  ) const

◆ interpolate() [7/16]

static tmp<DimensionedField<Type, volMesh> > interpolate ( const DimensionedField< Type, volMesh > &  ,
const fvMesh sMesh,
const labelList cellMap 
)
static

Map dimensioned field.

◆ interpolate() [8/16]

tmp<DimensionedField<Type, volMesh> > interpolate ( const DimensionedField< Type, volMesh > &  ) const

◆ operator=()

void operator= ( const fvMeshSubset )
delete

Disallow default bitwise assignment.

Referenced by fvMeshSubset::baseMesh().

Here is the caller graph for this function:

◆ interpolate() [9/16]

◆ interpolate() [10/16]

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().

Here is the call graph for this function:

◆ interpolate() [11/16]

◆ interpolate() [12/16]

Definition at line 349 of file fvMeshSubsetInterpolate.C.

References Foam::faceMap(), Foam::fvc::interpolate(), and fvMeshSubset::interpolate().

Here is the call graph for this function:

◆ interpolate() [13/16]

◆ interpolate() [14/16]

Definition at line 499 of file fvMeshSubsetInterpolate.C.

References Foam::fvc::interpolate(), fvMeshSubset::interpolate(), and Foam::compressible::New().

Here is the call graph for this function:

◆ interpolate() [15/16]

Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > interpolate ( const DimensionedField< Type, volMesh > &  df,
const fvMesh sMesh,
const labelList cellMap 
)

◆ interpolate() [16/16]

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().

Here is the call graph for this function:

The documentation for this class was generated from the following files: