37#ifndef oversetFvMeshBase_H
38#define oversetFvMeshBase_H
56class oversetFvMeshBase
61 oversetFvMeshBase(
const oversetFvMeshBase&) =
delete;
64 void operator=(
const oversetFvMeshBase&) =
delete;
125 const bool setHoleCellValue,
139 template<
class GeoField>
169 oversetFvMeshBase(
const fvMesh&
mesh,
const bool doInit=
true);
205 void active(
const bool f)
const
211 DebugInfo<<
"Switching to extended addressing with nFaces:"
218 DebugInfo<<
"Switching to base addressing with nFaces:"
219 <<
mesh_.fvMesh::lduAddr().lowerAddr().
size()
220 <<
" nInterfaces:" <<
mesh_.fvMesh::interfaces().
size()
235 const bool setHoleCellValue,
236 const Type& holeCellValue
253 const bool writeOnProc
257 template<
class GeoField>
262 template<
class GeoField,
class PatchType,
bool TypeOnly>
265 typename GeoField::Boundary& bfld
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Geometric agglomerated algebraic multigrid agglomeration class.
label size() const noexcept
The number of elements in table.
A simple container for options an IOstream can normally have.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Variant of fvMeshLduAddressing that contains addressing instead of slices.
virtual const labelUList & lowerAddr() const noexcept
Return lower addressing (i.e. lower label = upper triangle).
Mesh data needed to do the Finite Volume discretisation.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Concrete implementation of processor interface. Used to temporarily store settings.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
bool active_
Select base addressing (false) or locally stored extended.
void writeAgglomeration(const GAMGAgglomeration &agglom) const
Debug: dump agglomeration.
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.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
virtual bool interpolateFields()
Update fields when mesh is updated.
const fvMesh & mesh_
Reference to mesh.
SolverPerformance< Type > solveOverset(fvMatrix< Type > &m, const dictionary &) const
Solve given dictionary with settings.
virtual const lduAddressing & lduAddr() const
Return ldu addressing. If active: is (extended).
PtrList< const lduPrimitiveProcessorInterface > remoteStencilInterfaces_
Added (processor)lduInterfaces for remote bits of stencil.
autoPtr< fvMeshPrimitiveLduAddressing > lduPtr_
Extended addressing (extended with local interpolation stencils).
static void checkCoupledBC(const GeoField &fld)
Debug: check halo swap is ok.
labelListList stencilFaces_
Corresponding faces (in above lduPtr) to the stencil.
void active(const bool f) const
Enable/disable extended addressing.
virtual bool updateAddressing() const
Calculate the extended lduAddressing.
labelListList stencilPatches_
Corresponding patches (in above lduPtr) to the stencil.
const fvMeshPrimitiveLduAddressing & primitiveLduAddr() const
Return extended ldu addressing.
virtual bool update()
Update the mesh for both mesh motion and topology change.
void addInterpolation(fvMatrix< Type > &m, const scalarField &normalisation, const bool setHoleCellValue, const Type &holeCellValue) const
Manipulate the matrix to add the interpolation/set hole.
TypeName("oversetFvMeshBase")
Runtime type information.
lduInterfacePtrsList allInterfaces_
Interfaces for above mesh. Contains both original and above added processorLduInterfaces.
virtual ~oversetFvMeshBase()
Destructor.
tmp< scalarField > normalisation(const fvMatrix< Type > &m) const
Determine normalisation for interpolation. This equals the original diagonal except stabilised for ze...
static void correctCoupledBoundaryConditions(GeoField &fld)
Debug: correct coupled bc.
scalar cellAverage(const labelUList &types, const labelUList &nbrTypes, const scalarField &norm, const scalarField &nbrNorm, const label celli, bitSet &isFront) const
Average norm of valid neighbours.
bool active() const
Return true if using extended addressing.
const labelList & reverseFaceMap() const
Return old to new face addressing.
void clearOut()
Clear out local storage.
labelList reverseFaceMap_
From old to new face labels.
A class for managing temporary objects.
#define DebugInfo
Report an information message using Foam::Info.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UList< label > labelUList
A UList of labels.
List< scalar > scalarList
List of scalar.
cellMask correctBoundaryConditions()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.