Support for overset functionality. More...
Public Member Functions | |
TypeName ("oversetFvMeshBase") | |
Runtime type information. More... | |
oversetFvMeshBase (const fvMesh &mesh, const bool doInit=true) | |
Construct from IOobject. More... | |
virtual | ~oversetFvMeshBase () |
Destructor. More... | |
const fvMeshPrimitiveLduAddressing & | primitiveLduAddr () const |
Return extended ldu addressing. More... | |
virtual const lduAddressing & | lduAddr () const |
Return ldu addressing. If active: is (extended) More... | |
virtual lduInterfacePtrsList | interfaces () const |
Return a list of pointers for each patch. More... | |
const labelList & | reverseFaceMap () const |
Return old to new face addressing. More... | |
bool | active () const |
Return true if using extended addressing. More... | |
void | active (const bool f) const |
Enable/disable extended addressing. More... | |
template<class Type > | |
void | addInterpolation (fvMatrix< Type > &m, const scalarField &normalisation, const bool setHoleCellValue, const Type &holeCellValue) const |
Manipulate the matrix to add the interpolation/set hole. More... | |
virtual bool | update () |
Update the mesh for both mesh motion and topology change. More... | |
virtual bool | interpolateFields () |
Update fields when mesh is updated. More... | |
virtual bool | writeObject (IOstreamOption streamOpt, const bool writeOnProc) const |
Write using stream options. More... | |
template<class Type > | |
tmp< scalarField > | normalisation (const fvMatrix< Type > &m) const |
Determine normalisation for interpolation. This equals the original diagonal except stabilised for zero diagonals (possible in hole cells) More... | |
template<class Type > | |
Foam::tmp< Foam::scalarField > | normalisation (const fvMatrix< Type > &m) const |
template<class Type > | |
Foam::SolverPerformance< Type > | solveOverset (fvMatrix< Type > &m, const dictionary &dict) const |
Static Public Member Functions | |
template<class GeoField > | |
static void | checkCoupledBC (const GeoField &fld) |
Debug: check halo swap is ok. More... | |
template<class GeoField , class PatchType > | |
static void | correctBoundaryConditions (typename GeoField::Boundary &bfld, const bool typeOnly) |
Correct boundary conditions of certain type (typeOnly = true) More... | |
Protected Member Functions | |
virtual bool | updateAddressing () const |
Calculate the extended lduAddressing. More... | |
template<class Type > | |
void | write (Ostream &, const fvMatrix< Type > &, const lduAddressing &, const lduInterfacePtrsList &) const |
Debug: print matrix. More... | |
template<class Type > | |
void | scaleConnection (Field< Type > &coeffs, const labelUList &types, const scalarList &factor, const bool setHoleCellValue, const label celli, const label facei) const |
Freeze values at holes. More... | |
template<class Type > | |
SolverPerformance< Type > | solveOverset (fvMatrix< Type > &m, const dictionary &) const |
Solve given dictionary with settings. More... | |
scalar | cellAverage (const labelList &types, const labelList &nbrTypes, const scalarField &norm, const scalarField &nbrNorm, const label celli, bitSet &isFront) const |
Average norm of valid neighbours. More... | |
void | writeAgglomeration (const GAMGAgglomeration &agglom) const |
Debug: dump agglomeration. More... | |
Static Protected Member Functions | |
template<class GeoField > | |
static void | correctCoupledBoundaryConditions (GeoField &fld) |
Debug: correct coupled bc. More... | |
Protected Attributes | |
const fvMesh & | mesh_ |
Reference to mesh. More... | |
bool | active_ |
Select base addressing (false) or locally stored extended. More... | |
autoPtr< fvMeshPrimitiveLduAddressing > | lduPtr_ |
Extended addressing (extended with local interpolation stencils) More... | |
PtrList< const lduPrimitiveProcessorInterface > | remoteStencilInterfaces_ |
Added (processor)lduInterfaces for remote bits of stencil. More... | |
lduInterfacePtrsList | allInterfaces_ |
Interfaces for above mesh. Contains both original and above added processorLduInterfaces. More... | |
labelListList | stencilFaces_ |
Corresponding faces (in above lduPtr) to the stencil. More... | |
labelListList | stencilPatches_ |
Corresponding patches (in above lduPtr) to the stencil. More... | |
labelList | reverseFaceMap_ |
From old to new face labels. More... | |
oversetFvMeshBase | ( | const fvMesh & | mesh, |
const bool | doInit = true |
||
) |
Construct from IOobject.
Definition at line 512 of file oversetFvMeshBase.C.
References oversetFvMeshBase::mesh_, and MeshObject< Mesh, MeshObjectType, Type >::New().
|
virtual |
Destructor.
Definition at line 524 of file oversetFvMeshBase.C.
|
protectedvirtual |
Calculate the extended lduAddressing.
Definition at line 39 of file oversetFvMeshBase.C.
References fvMeshPrimitiveLduAddressing::addAddressing(), oversetFvMeshBase::allInterfaces_, List< T >::append(), boundary, fvMesh::boundary(), Foam::ensightOutput::debug, Foam::endl(), forAll, interface(), fvMesh::interfaces(), oversetFvMeshBase::lduPtr_, lduAddressing::lowerAddr(), oversetFvMeshBase::mesh_, UPstream::msgType(), UPstream::myProcNo(), primitiveMesh::nCells(), MeshObject< Mesh, MeshObjectType, Type >::New(), UPstream::nProcs(), overlap, lduAddressing::patchAddr(), patches, Foam::Pout, pp(), oversetFvMeshBase::remoteStencilInterfaces_, oversetFvMeshBase::reverseFaceMap_, UPtrList< T >::set(), List< T >::setSize(), UPtrList< T >::setSize(), UList< T >::size(), lduAddressing::size(), UPtrList< T >::size(), oversetFvMeshBase::stencilFaces_, oversetFvMeshBase::stencilPatches_, and lduAddressing::upperAddr().
|
protected |
Debug: print matrix.
Definition at line 857 of file oversetFvMeshBaseTemplates.C.
References fvMatrix< Type >::boundaryCoeffs(), Foam::diag(), lduMatrix::diag(), Foam::endl(), forAll, fvMatrix< Type >::internalCoeffs(), lduAddressing::losortAddr(), lduAddressing::losortStartAddr(), Foam::stringOps::lower(), lduMatrix::lower(), lduAddressing::lowerAddr(), processorLduInterface::myProcNo(), processorLduInterface::neighbProcNo(), os(), lduAddressing::ownerStartAddr(), lduAddressing::patchAddr(), fvMatrix< Type >::psi(), UPtrList< T >::set(), UList< T >::size(), lduAddressing::size(), fvMatrix< Type >::source(), Foam::stringOps::upper(), lduMatrix::upper(), and lduAddressing::upperAddr().
|
protected |
Freeze values at holes.
template<class Type> void freezeHoles(fvMatrix<Type>&) const;
Scale coefficient depending on cell type
Definition at line 33 of file oversetFvMeshBaseTemplates.C.
References f().
|
protected |
Solve given dictionary with settings.
|
staticprotected |
Debug: correct coupled bc.
Definition at line 983 of file oversetFvMeshBaseTemplates.C.
References coupled(), UPstream::defaultCommsType, fld, forAll, UPstream::nonBlocking, UPstream::nRequests(), and UPstream::waitRequests().
|
protected |
Average norm of valid neighbours.
Definition at line 354 of file oversetFvMeshBase.C.
References bitSet::set().
|
protected |
Debug: dump agglomeration.
Definition at line 412 of file oversetFvMeshBase.C.
References correctBoundaryConditions(), Foam::dimless, Foam::endl(), fld, forAll, Foam::identity(), Foam::Info, Foam::invertOneToMany(), Foam::max(), Foam::name(), IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, GAMGAgglomeration::restrictAddressing(), Foam::returnReduce(), UList< T >::size(), GAMGAgglomeration::size(), oversetFvPatchField< Type >::write(), and Foam::Zero.
TypeName | ( | "oversetFvMeshBase" | ) |
Runtime type information.
const Foam::fvMeshPrimitiveLduAddressing & primitiveLduAddr | ( | ) | const |
Return extended ldu addressing.
Definition at line 562 of file oversetFvMeshBase.C.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by oversetFvMeshBase::active().
|
virtual |
Return ldu addressing. If active: is (extended)
primitiveLduAddr
Reimplemented in dynamicOversetFvMesh, and staticOversetFvMesh.
Definition at line 530 of file oversetFvMeshBase.C.
Referenced by dynamicOversetFvMesh::lduAddr(), and staticOversetFvMesh::lduAddr().
|
virtual |
Return a list of pointers for each patch.
with only those pointing to interfaces being set. If active: return additional remoteStencilInterfaces_
Reimplemented in dynamicOversetFvMesh, and staticOversetFvMesh.
Definition at line 546 of file oversetFvMeshBase.C.
Referenced by dynamicOversetFvMesh::interfaces(), and staticOversetFvMesh::interfaces().
|
inline |
Return old to new face addressing.
Definition at line 243 of file oversetFvMeshBase.H.
References oversetFvMeshBase::reverseFaceMap_.
|
inline |
Return true if using extended addressing.
Definition at line 251 of file oversetFvMeshBase.H.
References oversetFvMeshBase::active_.
|
inline |
Enable/disable extended addressing.
Definition at line 259 of file oversetFvMeshBase.H.
References oversetFvMeshBase::active_, oversetFvMeshBase::allInterfaces_, DebugInfo, Foam::endl(), f(), fvMeshPrimitiveLduAddressing::lowerAddr(), oversetFvMeshBase::mesh_, oversetFvMeshBase::primitiveLduAddr(), UList< T >::size(), UPtrList< T >::size(), and HashTable< T, Key, Hash >::size().
void addInterpolation | ( | fvMatrix< Type > & | m, |
const scalarField & | normalisation, | ||
const bool | setHoleCellValue, | ||
const Type & | holeCellValue | ||
) | const |
Manipulate the matrix to add the interpolation/set hole.
values
Definition at line 287 of file oversetFvMeshBaseTemplates.C.
References fvMatrix< Type >::boundaryCoeffs(), boundaryFieldRef(), Foam::diag(), lduMatrix::diag(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::inplaceReorder(), fvMatrix< Type >::internalCoeffs(), Foam::stringOps::lower(), lduMatrix::lower(), lduAddressing::lowerAddr(), Foam::New(), overlap, Foam::foamVersion::patch, lduAddressing::patchAddr(), fvMatrix< Type >::psi(), s, UList< T >::size(), UPtrList< T >::size(), fvMatrix< Type >::source(), Foam::stringOps::upper(), lduMatrix::upper(), lduAddressing::upperAddr(), and Foam::Zero.
|
virtual |
Update the mesh for both mesh motion and topology change.
Reimplemented in dynamicOversetFvMesh, and staticOversetFvMesh.
Definition at line 574 of file oversetFvMeshBase.C.
Referenced by staticOversetFvMesh::staticOversetFvMesh(), staticOversetFvMesh::update(), and dynamicOversetFvMesh::update().
|
virtual |
Update fields when mesh is updated.
Definition at line 592 of file oversetFvMeshBase.C.
References cellCellStencil::interpolate(), MeshObject< Mesh, MeshObjectType, Type >::New(), cellCellStencilObject::nonInterpolatedFields(), and overlap.
|
virtual |
Write using stream options.
Do not correctBoundaryConditions since re-interpolates!
volDonorZoneID.correctBoundaryConditions();
Reimplemented in dynamicOversetFvMesh, and staticOversetFvMesh.
Definition at line 620 of file oversetFvMeshBase.C.
References cellCellStencilObject::cellInterpolationMap(), cellCellStencilObject::cellStencil(), cellTypes, cellCellStencilObject::cellTypes(), cellCellStencil::correctBoundaryConditions(), Foam::ensightOutput::debug, Foam::dimless, mapDistribute::distribute(), Foam::endl(), forAll, MeshObject< Mesh, MeshObjectType, Type >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, overlap, UList< T >::size(), WarningInFunction, regIOobject::writeObject(), Foam::Zero, fvPatchFieldBase::zeroGradientType(), and cellCellStencil::zoneID().
Referenced by staticOversetFvMesh::writeObject(), and dynamicOversetFvMesh::writeObject().
|
static |
Debug: check halo swap is ok.
Definition at line 1017 of file oversetFvMeshBaseTemplates.C.
References Foam::endl(), fld, forAll, OSstream::name(), and Foam::Pout.
|
static |
Correct boundary conditions of certain type (typeOnly = true)
or explicitly not of the type (typeOnly = false)
Definition at line 71 of file oversetFvMeshBaseTemplates.C.
References forAll.
Referenced by trackingInverseDistance::update(), cellVolumeWeight::update(), and inverseDistance::update().
tmp<scalarField> normalisation | ( | const fvMatrix< Type > & | m | ) | const |
Determine normalisation for interpolation. This equals the original diagonal except stabilised for zero diagonals (possible in hole cells)
Foam::tmp<Foam::scalarField> normalisation | ( | const fvMatrix< Type > & | m | ) | const |
Definition at line 105 of file oversetFvMeshBaseTemplates.C.
References Field< Type >::component(), Foam::ensightOutput::debug, lduMatrix::diag(), Foam::endl(), forAll, fvMatrix< Type >::internalCoeffs(), Foam::magSqr(), n, Foam::New(), overlap, Foam::Pout, fvMatrix< Type >::psi(), tmp< T >::ref(), Foam::returnReduce(), Foam::returnReduceOr(), List< T >::set(), Foam::sqr(), and List< T >::transfer().
Foam::SolverPerformance<Type> solveOverset | ( | fvMatrix< Type > & | m, |
const dictionary & | dict | ||
) | const |
Definition at line 698 of file oversetFvMeshBaseTemplates.C.
References fvMatrix< Type >::boundaryCoeffs(), boundaryFieldRef(), fvMatrix< Type >::boundaryManipulate(), correctBoundaryConditions(), Foam::ensightOutput::debug, lduMatrix::diag(), dict, Foam::dimless, Foam::endl(), DimensionedField< Type, GeoMesh >::field(), forAll, fvMatrix< Type >::internalCoeffs(), Foam::isA(), lduMatrix::lower(), Foam::New(), overlap, Foam::Pout, psi, fvMatrix< Type >::psi(), GeometricField< Type, PatchField, GeoMesh >::ref(), s, UList< T >::size(), fvMatrix< Type >::source(), lduMatrix::upper(), oversetFvPatchField< Type >::write(), and Foam::Zero.
|
protected |
Reference to mesh.
Definition at line 74 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::active(), oversetFvMeshBase::oversetFvMeshBase(), and oversetFvMeshBase::updateAddressing().
|
mutableprotected |
Select base addressing (false) or locally stored extended.
lduAddressing (true)
Definition at line 81 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::active().
|
mutableprotected |
Extended addressing (extended with local interpolation stencils)
Definition at line 86 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::updateAddressing().
|
mutableprotected |
Added (processor)lduInterfaces for remote bits of stencil.
Definition at line 92 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::updateAddressing().
|
mutableprotected |
Interfaces for above mesh. Contains both original and above added processorLduInterfaces.
Definition at line 98 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::active(), and oversetFvMeshBase::updateAddressing().
|
mutableprotected |
Corresponding faces (in above lduPtr) to the stencil.
Definition at line 103 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::updateAddressing().
|
mutableprotected |
Corresponding patches (in above lduPtr) to the stencil.
Definition at line 108 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::updateAddressing().
|
mutableprotected |
From old to new face labels.
Definition at line 113 of file oversetFvMeshBase.H.
Referenced by oversetFvMeshBase::reverseFaceMap(), and oversetFvMeshBase::updateAddressing().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.