lduPrimitiveMesh Class Reference

Simplest concrete lduMesh that stores the addressing needed by lduMatrix. More...

Inheritance diagram for lduPrimitiveMesh:
[legend]
Collaboration diagram for lduPrimitiveMesh:
[legend]

Public Member Functions

 ClassName ("lduPrimitiveMesh")
 
 lduPrimitiveMesh (const label nCells)
 Construct from number of cells. More...
 
 lduPrimitiveMesh (const label nCells, labelList &l, labelList &u, const label comm, bool reuse)
 Construct from components but without interfaces. Add interfaces. More...
 
void addInterfaces (lduInterfacePtrsList &interfaces, const lduSchedule &ps)
 Add interfaces to a mesh constructed without. More...
 
 lduPrimitiveMesh (const label nCells, labelList &l, labelList &u, PtrList< const lduInterface > &primitiveInterfaces, const lduSchedule &ps, const label comm)
 Construct from components and re-use storage. More...
 
 lduPrimitiveMesh (const label comm, const labelList &procAgglomMap, const labelList &procIDs, const lduMesh &myMesh, const PtrList< lduPrimitiveMesh > &otherMeshes, labelList &cellOffsets, labelList &faceOffsets, labelListList &faceMap, labelListList &boundaryMap, labelListListList &boundaryFaceMap)
 Construct by combining multiple meshes. The meshes come from. More...
 
virtual ~lduPrimitiveMesh ()=default
 Destructor. More...
 
virtual bool hasDb () const
 Return true if thisDb() is a valid DB. More...
 
virtual const lduAddressinglduAddr () const
 Return ldu addressing. More...
 
virtual lduAddressinglduAddr ()
 Return non-const ldu addressing. More...
 
virtual lduInterfacePtrsList interfaces () const
 
virtual lduInterfacePtrsListinterfaces ()
 
PtrList< const lduInterface > & primitiveInterfaces ()
 Return a non-const list of primitive interfaces. More...
 
const lduInterfacePtrsListrawInterfaces () const
 Return a list of pointers for each patch. More...
 
virtual label comm () const
 Return communicator used for parallel communication. More...
 
virtual const labelUListlowerAddr () const
 Return Lower addressing. More...
 
virtual const labelUListupperAddr () const
 Return Upper addressing. More...
 
virtual labelListlowerAddr ()
 Return non-const Lower addressing. More...
 
virtual labelListupperAddr ()
 Return non-const Upper addressing. More...
 
virtual const labelUListpatchAddr (const label i) const
 Return patch addressing. More...
 
virtual const lduSchedulepatchSchedule () const
 Return patch evaluation schedule. More...
 
template<class ProcPatch >
Foam::lduSchedule nonBlockingSchedule (const lduInterfacePtrsList &interfaces)
 
- Public Member Functions inherited from lduMesh
 TypeName ("lduMesh")
 Runtime type information. More...
 
virtual ~lduMesh ()=default
 Destructor. More...
 
virtual const objectRegistrythisDb () const
 Return the object registry. More...
 
template<class T , class BinaryOp >
void reduce (T &Value, const BinaryOp &bop) const
 Helper: reduce with current communicator. More...
 
InfoProxy< lduMeshinfo () const
 Return info proxy. More...
 
- Public Member Functions inherited from lduAddressing
 lduAddressing (const label nEqns)
 Construct with size (number of equations) More...
 
virtual ~lduAddressing ()
 Destructor. More...
 
label size () const
 Return number of equations. More...
 
void clearOut ()
 Clear additional addressing. More...
 
const labelUListlosortAddr () const
 Return losort addressing. More...
 
const labelUListownerStartAddr () const
 Return owner start addressing. More...
 
const labelUListlosortStartAddr () const
 Return losort start addressing. More...
 
label triIndex (const label a, const label b) const
 Return off-diagonal index given owner and neighbour label. More...
 
Tuple2< label, scalar > band () const
 Calculate bandwidth and profile of addressing. More...
 

Static Public Member Functions

static const lduMeshmesh (const lduMesh &mesh0, const PtrList< lduPrimitiveMesh > &otherMeshes, const label meshI)
 Select either mesh0 (meshI is 0) or otherMeshes[meshI-1]. More...
 
static void gather (const label comm, const lduMesh &mesh, const labelList &procIDs, PtrList< lduPrimitiveMesh > &otherMeshes)
 Gather meshes from other processors onto procIDs[0]. More...
 
template<class ProcPatch >
static lduSchedule nonBlockingSchedule (const lduInterfacePtrsList &)
 Get non-scheduled send/receive schedule. More...
 
static labelList upperTriOrder (const label nCells, const labelUList &lower, const labelUList &upper)
 Calculate upper-triangular order. More...
 
static void checkUpperTriangular (const label size, const labelUList &l, const labelUList &u)
 Check if in upper-triangular ordering. More...
 
static labelListList globalCellCells (const lduMesh &mesh, const globalIndex &globalNumbering)
 Calculate global cell-cells. More...
 

Detailed Description

Simplest concrete lduMesh that stores the addressing needed by lduMatrix.

Source files

Definition at line 52 of file lduPrimitiveMesh.H.

Constructor & Destructor Documentation

◆ lduPrimitiveMesh() [1/4]

lduPrimitiveMesh ( const label  nCells)
explicit

Construct from number of cells.

Definition at line 370 of file lduPrimitiveMesh.C.

◆ lduPrimitiveMesh() [2/4]

lduPrimitiveMesh ( const label  nCells,
labelList l,
labelList u,
const label  comm,
bool  reuse 
)

Construct from components but without interfaces. Add interfaces.

separately using addInterfaces

Definition at line 334 of file lduPrimitiveMesh.C.

◆ lduPrimitiveMesh() [3/4]

lduPrimitiveMesh ( const label  nCells,
labelList l,
labelList u,
PtrList< const lduInterface > &  primitiveInterfaces,
const lduSchedule ps,
const label  comm 
)

Construct from components and re-use storage.

Definition at line 380 of file lduPrimitiveMesh.C.

References forAll.

◆ lduPrimitiveMesh() [4/4]

lduPrimitiveMesh ( const label  comm,
const labelList procAgglomMap,
const labelList procIDs,
const lduMesh myMesh,
const PtrList< lduPrimitiveMesh > &  otherMeshes,
labelList cellOffsets,
labelList faceOffsets,
labelListList faceMap,
labelListList boundaryMap,
labelListListList boundaryFaceMap 
)

Construct by combining multiple meshes. The meshes come from.

processors procIDs: procIDs[0] : local processor (myMesh) procIDs[i] : processor where otherMeshes[i-1] comes from procAgglomMap : for every processor which processor it agglomerates onto. The new processor numbers are in compact numbering (so ranks in communicator comm), i.e. similar to cell-restrict-addressing. We need this information to be able to map inter-processor interfaces cellOffsets : for every processor the offset it gets in the mesh faceMap : for every processor, for every face, the destination face. Negative for flipped faces. boundaryMap : for every processor, for every patch, -1 or the new patch index in the mesh. boundaryFaceMap : for every processor, for every patch, for every patch face:

  • the new internal face (if boundaryMap=-1)
  • the new patch face (if boundaryMap>=0) Faces becoming internal are negative for flipped faces.

Definition at line 411 of file lduPrimitiveMesh.C.

References Foam::abort(), lduMesh::comm(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), lduInterface::faceCells(), Foam::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, forAllConstIters(), Foam::inplaceReorder(), lduMesh::interfaces(), fvMesh::interfaces(), lduMesh::lduAddr(), lduAddressing::lowerAddr(), Foam::max(), mesh, Foam::min(), UPstream::msgType(), processorLduInterface::myProcNo(), UPstream::myProcNo(), n, processorLduInterface::neighbProcNo(), Foam::Pout, UPtrList< T >::set(), List< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), lduAddressing::size(), Foam::sortedOrder(), lduAddressing::upperAddr(), WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ ~lduPrimitiveMesh()

virtual ~lduPrimitiveMesh ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "lduPrimitiveMesh"  )

◆ addInterfaces()

void addInterfaces ( lduInterfacePtrsList interfaces,
const lduSchedule ps 
)

Add interfaces to a mesh constructed without.

Definition at line 349 of file lduPrimitiveMesh.C.

References forAll, and List< T >::setSize().

Here is the call graph for this function:

◆ hasDb()

virtual bool hasDb ( ) const
inlinevirtual

Return true if thisDb() is a valid DB.

Implements lduMesh.

Reimplemented in lduPrimitiveMeshAssembly.

Definition at line 181 of file lduPrimitiveMesh.H.

◆ lduAddr() [1/2]

virtual const lduAddressing& lduAddr ( ) const
inlinevirtual

Return ldu addressing.

Implements lduMesh.

Definition at line 187 of file lduPrimitiveMesh.H.

Referenced by fvMatrix< Type >::createOrUpdateLduPrimitiveAssembly().

Here is the caller graph for this function:

◆ lduAddr() [2/2]

virtual lduAddressing& lduAddr ( )
inlinevirtual

Return non-const ldu addressing.

Definition at line 193 of file lduPrimitiveMesh.H.

◆ interfaces() [1/2]

virtual lduInterfacePtrsList interfaces ( ) const
inlinevirtual

Return a list of pointers for each patch with only those pointing to interfaces being set

Implements lduMesh.

Definition at line 200 of file lduPrimitiveMesh.H.

◆ interfaces() [2/2]

virtual lduInterfacePtrsList& interfaces ( )
inlinevirtual

Return a non-const list of pointers for each patch with only those pointing to interfaces being set

Definition at line 207 of file lduPrimitiveMesh.H.

◆ primitiveInterfaces()

PtrList<const lduInterface>& primitiveInterfaces ( )
inline

Return a non-const list of primitive interfaces.

Definition at line 213 of file lduPrimitiveMesh.H.

◆ rawInterfaces()

const lduInterfacePtrsList& rawInterfaces ( ) const
inline

Return a list of pointers for each patch.

with only those pointing to interfaces being set (reference to cached interfaces)

Definition at line 221 of file lduPrimitiveMesh.H.

◆ comm()

virtual label comm ( ) const
inlinevirtual

Return communicator used for parallel communication.

Implements lduMesh.

Definition at line 227 of file lduPrimitiveMesh.H.

◆ lowerAddr() [1/2]

virtual const labelUList& lowerAddr ( ) const
inlinevirtual

Return Lower addressing.

Implements lduAddressing.

Definition at line 233 of file lduPrimitiveMesh.H.

◆ upperAddr() [1/2]

virtual const labelUList& upperAddr ( ) const
inlinevirtual

Return Upper addressing.

Implements lduAddressing.

Definition at line 239 of file lduPrimitiveMesh.H.

◆ lowerAddr() [2/2]

virtual labelList& lowerAddr ( )
inlinevirtual

Return non-const Lower addressing.

Definition at line 245 of file lduPrimitiveMesh.H.

◆ upperAddr() [2/2]

virtual labelList& upperAddr ( )
inlinevirtual

Return non-const Upper addressing.

Definition at line 251 of file lduPrimitiveMesh.H.

◆ patchAddr()

virtual const labelUList& patchAddr ( const label  i) const
inlinevirtual

Return patch addressing.

Implements lduAddressing.

Reimplemented in lduPrimitiveMeshAssembly.

Definition at line 257 of file lduPrimitiveMesh.H.

◆ patchSchedule()

virtual const lduSchedule& patchSchedule ( ) const
inlinevirtual

Return patch evaluation schedule.

Implements lduAddressing.

Definition at line 263 of file lduPrimitiveMesh.H.

◆ mesh()

const Foam::lduMesh & mesh ( const lduMesh mesh0,
const PtrList< lduPrimitiveMesh > &  otherMeshes,
const label  meshI 
)
static

Select either mesh0 (meshI is 0) or otherMeshes[meshI-1].

Definition at line 1072 of file lduPrimitiveMesh.C.

Referenced by fvMatrix< Type >::lduMeshPtr().

Here is the caller graph for this function:

◆ gather()

void gather ( const label  comm,
const lduMesh mesh,
const labelList procIDs,
PtrList< lduPrimitiveMesh > &  otherMeshes 
)
static

Gather meshes from other processors onto procIDs[0].

Received meshes get GAMGInterface and communicator comm

Definition at line 1083 of file lduPrimitiveMesh.C.

References forAll, interface(), fvMesh::interfaces(), fvMesh::lduAddr(), lduAddressing::lowerAddr(), mesh, UPstream::msgType(), UPstream::myProcNo(), GAMGInterface::New(), lduAddressing::patchSchedule(), Foam::readLabel(), Foam::refCast(), UPstream::scheduled, PtrList< T >::set(), UPtrList< T >::set(), PtrList< T >::setSize(), UPtrList< T >::size(), lduAddressing::size(), and lduAddressing::upperAddr().

Here is the call graph for this function:

◆ nonBlockingSchedule() [1/2]

static lduSchedule nonBlockingSchedule ( const lduInterfacePtrsList )
static

Get non-scheduled send/receive schedule.

◆ upperTriOrder()

Foam::labelList upperTriOrder ( const label  nCells,
const labelUList lower,
const labelUList upper 
)
static

Calculate upper-triangular order.

Definition at line 259 of file lduPrimitiveMesh.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::stringOps::lower(), DynamicList< T, SizeMin >::resize(), Foam::sortedOrder(), Foam::stringOps::upper(), and Foam::Zero.

Here is the call graph for this function:

◆ checkUpperTriangular()

void checkUpperTriangular ( const label  size,
const labelUList l,
const labelUList u 
)
static

Check if in upper-triangular ordering.

Definition at line 65 of file lduPrimitiveMesh.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and UList< T >::size().

Here is the call graph for this function:

◆ globalCellCells()

Foam::labelListList globalCellCells ( const lduMesh mesh,
const globalIndex globalNumbering 
)
static

Calculate global cell-cells.

Definition at line 118 of file lduPrimitiveMesh.C.

References Foam::constant::physicoChemical::c1, forAll, Foam::identity(), globalIndex::localStart(), lduAddressing::lowerAddr(), mesh, UPtrList< T >::set(), UPtrList< T >::size(), lduAddressing::size(), lduAddressing::upperAddr(), and Foam::Zero.

Here is the call graph for this function:

◆ nonBlockingSchedule() [2/2]

Foam::lduSchedule nonBlockingSchedule ( const lduInterfacePtrsList interfaces)

Definition at line 34 of file lduPrimitiveMeshTemplates.C.

References forAll, UPtrList< T >::set(), and UPtrList< T >::size().

Here is the call graph for this function:

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