Calculation of interpolation stencils. More...
Public Types | |
enum | patchCellType { OTHER = 0, PATCH = 1, OVERSET = 2 } |
enum | cellType { CALCULATED = 0, INTERPOLATED = 1, HOLE = 2, SPECIAL = 3, POROUS = 4 } |
Public Member Functions | |
TypeName ("cellCellStencil") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, cellCellStencil, mesh,(const fvMesh &mesh, const dictionary &dict, const bool update),(mesh, dict, update)) | |
cellCellStencil (const fvMesh &) | |
Construct from fvMesh. More... | |
virtual | ~cellCellStencil () |
Destructor. More... | |
virtual bool | update ()=0 |
Update stencils. Return false if nothing changed. More... | |
virtual const labelUList & | cellTypes () const =0 |
Return the cell type list. More... | |
virtual const labelUList & | interpolationCells () const =0 |
Indices of interpolated cells. More... | |
virtual const mapDistribute & | cellInterpolationMap () const =0 |
Return a communication schedule. More... | |
virtual const labelListList & | cellStencil () const =0 |
Per interpolated cell the neighbour cells (in terms of slots as. More... | |
virtual const List< scalarList > & | cellInterpolationWeights () const =0 |
Weights for cellStencil. More... | |
virtual const scalarList & | cellInterpolationWeight () const =0 |
Per interpolated cell the interpolation factor. (0 = use. More... | |
virtual void | stencilWeights (const point &sample, const pointList &donorCcs, scalarList &weights) const =0 |
Calculate weights for a single acceptor. More... | |
virtual const wordHashSet & | nonInterpolatedFields () const |
Return the names of any (stencil or mesh specific) fields that. More... | |
virtual wordHashSet & | nonInterpolatedFields () |
Return non-const non-interpolating fields. More... | |
bool | localStencil (const labelUList &) const |
Helper: is stencil fully local. More... | |
const labelIOList & | zoneID () const |
Helper: get reference to registered zoneID. Loads volScalarField. More... | |
template<class T > | |
void | interpolate (const fvMesh &mesh, Field< T > &psi) const |
Explicit interpolation of acceptor cells from donor cells. Looks up cellCellStencil. More... | |
template<class GeoField > | |
void | interpolate (GeoField &psi) const |
Explicit interpolation of acceptor cells from donor cells with boundary condition handling. More... | |
template<class GeoField > | |
void | interpolate (const fvMesh &mesh, const wordHashSet &suppressed) const |
Explicit interpolation of all registered fields. No boundary conditions. Excludes selected fields (and their old-time fields) More... | |
InfoProxy< cellCellStencil > | info () const |
Return info proxy. Used to print stencil information to a stream. More... | |
void | walkFront (const globalIndex &globalCells, const label layerRelax, const labelListList &allStencil, labelList &allCellTypes, scalarField &allWeight, const scalarList &compactCellVol, const labelListList &compactStencil, const labelList &zoneID, const label holeLayers, const label useLayer) const |
Surround holes with layer(s) of interpolated cells. More... | |
void | setUpFront (const labelList &allCellTypes, bitSet &isFront) const |
Set up front using allCellTypes. More... | |
void | setUpFrontOnOversetPatch (const labelList &allCellTypes, bitSet &isFront) const |
Set up front on overset patches. More... | |
void | seedCell (const label cellI, const scalar wantedFraction, bitSet &isFront, scalarField &fraction) const |
Seed faces of cell with wantedFraction (if higher than current) More... | |
template<class Type > | |
Foam::tmp< Foam::volScalarField > | createField (const fvMesh &mesh, const word &name, const UList< Type > &psi) |
Static Public Member Functions | |
static autoPtr< cellCellStencil > | New (const fvMesh &, const dictionary &dict, const bool update=true) |
New function which constructs and returns pointer to a. More... | |
static const labelIOList & | zoneID (const fvMesh &) |
Helper: get reference to registered zoneID. Loads volScalarField. More... | |
static labelList | count (const label size, const labelUList &lst) |
Count occurrences (in parallel) More... | |
static void | globalCellCells (const globalIndex &gi, const polyMesh &mesh, const boolList &isValidDonor, const labelList &selectedCells, labelListList &cellCells, pointListList &cellCellCentres) |
Helper: create cell-cell addressing in global numbering. More... | |
template<class T > | |
static void | interpolate (Field< T > &psi, const fvMesh &mesh, const cellCellStencil &overlap, const List< scalarList > &wghts) |
Interpolation of acceptor cells from donor cells. More... | |
template<class GeoField , class SuppressBC > | |
static void | correctBoundaryConditions (GeoField &psi) |
Version of correctBoundaryConditions that excludes 'overset' bcs. More... | |
Static Protected Member Functions | |
template<class Type > | |
static tmp< volScalarField > | createField (const fvMesh &mesh, const word &name, const UList< Type > &) |
Helper: create volScalarField for postprocessing. More... | |
static word | baseName (const word &name) |
Helper: strip off trailing _0. More... | |
Protected Attributes | |
const fvMesh & | mesh_ |
Reference to the mesh. More... | |
wordHashSet | nonInterpolatedFields_ |
Set of fields that should not be interpolated. More... | |
const dictionary | dict_ |
Dictionary of motion control parameters. More... | |
Static Protected Attributes | |
static const Enum< cellType > | cellTypeNames_ |
Mode type names. More... | |
Calculation of interpolation stencils.
Looks up zoneID labelIOList to give the zoning. Wrapped in MeshObject as cellCellStencilObject. Kept separate so meshes can implement more clever methods (e.g. solid body motion does not require full recalculation)
Definition at line 57 of file cellCellStencil.H.
enum patchCellType |
Enumerator | |
---|---|
OTHER | |
PATCH | |
OVERSET |
Definition at line 61 of file cellCellStencil.H.
enum cellType |
Enumerator | |
---|---|
CALCULATED | |
INTERPOLATED | |
HOLE | |
SPECIAL | |
POROUS |
Definition at line 68 of file cellCellStencil.H.
cellCellStencil | ( | const fvMesh & | mesh | ) |
Construct from fvMesh.
Definition at line 52 of file cellCellStencil.C.
|
virtual |
Destructor.
Definition at line 89 of file cellCellStencil.C.
|
staticprotected |
Helper: create volScalarField for postprocessing.
|
staticprotected |
Helper: strip off trailing _0.
Definition at line 95 of file cellCellStencil.C.
References string::ends_with(), and Foam::name().
TypeName | ( | "cellCellStencil" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
cellCellStencil | , | ||
mesh | , | ||
(const fvMesh &mesh, const dictionary &dict, const bool update) | , | ||
(mesh, dict, update) | |||
) |
|
static |
New function which constructs and returns pointer to a.
Definition at line 60 of file cellCellStencil.C.
References DebugInFunction, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), mesh, and update().
|
pure virtual |
Update stencils. Return false if nothing changed.
Implemented in inverseDistance, cellVolumeWeight, trackingInverseDistance, and cellCellStencilObject.
|
pure virtual |
Return the cell type list.
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Indices of interpolated cells.
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Return a communication schedule.
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Per interpolated cell the neighbour cells (in terms of slots as.
constructed by above cellInterpolationMap) to interpolate
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Weights for cellStencil.
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Per interpolated cell the interpolation factor. (0 = use.
calculated, 1 = use interpolated)
Implemented in inverseDistance, cellVolumeWeight, and cellCellStencilObject.
|
pure virtual |
Calculate weights for a single acceptor.
Implemented in inverseDistance, cellVolumeWeight, cellCellStencilObject, and leastSquares.
|
virtual |
Return the names of any (stencil or mesh specific) fields that.
should not be interpolated
Reimplemented in cellCellStencilObject.
Definition at line 165 of file cellCellStencil.C.
|
virtual |
Return non-const non-interpolating fields.
Definition at line 171 of file cellCellStencil.C.
bool localStencil | ( | const labelUList & | slots | ) | const |
Helper: is stencil fully local.
Definition at line 177 of file cellCellStencil.C.
References forAll.
|
static |
Helper: get reference to registered zoneID. Loads volScalarField.
if not registered.
Definition at line 106 of file cellCellStencil.C.
References polyMesh::dbDir(), polyMesh::facesInstance(), Time::findInstance(), forAll, objectRegistry::foundObject(), objectRegistry::lookupObject(), mesh, polyMesh::meshSubDir, IOobjectOption::MUST_READ, primitiveMesh::nCells(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, regIOobject::store(), and fvMesh::time().
Referenced by oversetFvMeshBase::writeObject().
|
inline |
Helper: get reference to registered zoneID. Loads volScalarField.
if not registered.
Definition at line 267 of file cellCellStencil.H.
References cellCellStencil::mesh_.
|
static |
Count occurrences (in parallel)
Definition at line 150 of file cellCellStencil.C.
References Foam::BitOps::count(), forAll, Pstream::listCombineGather(), and Foam::Zero.
|
static |
Helper: create cell-cell addressing in global numbering.
Definition at line 191 of file cellCellStencil.C.
References primitiveMesh::cellCentres(), cells, primitiveMesh::cells(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, UList< T >::found(), Foam::identity(), globalIndex::localSize(), globalIndex::localStart(), mesh, primitiveMesh::nCells(), primitiveMesh::nInternalFaces(), List< T >::setSize(), UList< T >::size(), syncTools::swapBoundaryCellList(), and globalIndex::toGlobal().
|
static |
Interpolation of acceptor cells from donor cells.
Definition at line 27 of file cellCellStencilTemplates.C.
References cellIDs, Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, forAll, mesh, overlap, psi, s, UList< T >::size(), and T.
Referenced by cellCellStencil::interpolate(), and oversetFvMeshBase::interpolateFields().
Explicit interpolation of acceptor cells from donor cells. Looks up cellCellStencil.
Definition at line 77 of file cellCellStencilTemplates.C.
References cellCellStencil::interpolate(), mesh, overlap, and psi.
void interpolate | ( | GeoField & | psi | ) | const |
Explicit interpolation of acceptor cells from donor cells with boundary condition handling.
Definition at line 92 of file cellCellStencilTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::interpolate(), DimensionedField< Type, GeoMesh >::mesh(), GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), and psi.
void interpolate | ( | const fvMesh & | mesh, |
const wordHashSet & | suppressed | ||
) | const |
Explicit interpolation of all registered fields. No boundary conditions. Excludes selected fields (and their old-time fields)
Definition at line 105 of file cellCellStencilTemplates.C.
References cellCellStencilObject::cellInterpolationWeights(), Foam::ensightOutput::debug, Foam::endl(), fld, HashTable< T, Key, Hash >::found(), Foam::interpolate(), objectRegistry::lookupClass(), mesh, Foam::name(), overlap, and Foam::Pout.
|
static |
Version of correctBoundaryConditions that excludes 'overset' bcs.
Definition at line 181 of file cellCellStencilTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryFieldRef(), forAll, UPstream::nonBlocking, UPstream::nRequests(), UPstream::parRun(), psi, and UPstream::waitRequests().
Referenced by oversetFvMeshBase::writeObject().
|
inline |
Return info proxy. Used to print stencil information to a stream.
Definition at line 337 of file cellCellStencil.H.
void walkFront | ( | const globalIndex & | globalCells, |
const label | layerRelax, | ||
const labelListList & | allStencil, | ||
labelList & | allCellTypes, | ||
scalarField & | allWeight, | ||
const scalarList & | compactCellVol, | ||
const labelListList & | compactStencil, | ||
const labelList & | zoneID, | ||
const label | holeLayers, | ||
const label | useLayer | ||
) | const |
Surround holes with layer(s) of interpolated cells.
Definition at line 405 of file cellCellStencil.C.
References Foam::abort(), bitSet::any(), DynamicList< T, SizeMin >::append(), Foam::BitOps::count(), Foam::ensightOutput::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::findMin(), forAll, Foam::gSum(), Foam::Info, Foam::mag(), Foam::name(), Foam::nl, Foam::reduce(), Foam::returnReduce(), List< T >::set(), UList< T >::size(), syncTools::syncFaceList(), bitSet::test(), List< T >::transfer(), bitSet::transfer(), and Foam::Zero.
Set up front using allCellTypes.
Definition at line 328 of file cellCellStencil.C.
References bitSet::set(), and syncTools::swapBoundaryCellList().
Set up front on overset patches.
Definition at line 376 of file cellCellStencil.C.
References fvBoundaryMesh::faceCells(), forAll, and bitSet::set().
void seedCell | ( | const label | cellI, |
const scalar | wantedFraction, | ||
bitSet & | isFront, | ||
scalarField & | fraction | ||
) | const |
Seed faces of cell with wantedFraction (if higher than current)
Definition at line 307 of file cellCellStencil.C.
References forAll, and bitSet::set().
Foam::tmp<Foam::volScalarField> createField | ( | const fvMesh & | mesh, |
const word & | name, | ||
const UList< Type > & | psi | ||
) |
Definition at line 148 of file cellCellStencilTemplates.C.
References Foam::dimless, fld, forAll, mesh, Foam::name(), tmp< T >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, psi, fvMesh::time(), Time::timeName(), and Foam::Zero.
|
staticprotected |
Mode type names.
Definition at line 85 of file cellCellStencil.H.
|
protected |
Reference to the mesh.
Definition at line 90 of file cellCellStencil.H.
Referenced by cellCellStencil::zoneID().
|
protected |
Set of fields that should not be interpolated.
Definition at line 95 of file cellCellStencil.H.
|
protected |
Dictionary of motion control parameters.
Definition at line 100 of file cellCellStencil.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.