mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: GAMGInterface: simplify stored data. Do not store processor-local data
This commit is contained in:
@ -317,6 +317,7 @@ algebraicPairGAMGAgglomeration = $(GAMGAgglomerations)/algebraicPairGAMGAgglomer
|
|||||||
$(algebraicPairGAMGAgglomeration)/algebraicPairGAMGAgglomeration.C
|
$(algebraicPairGAMGAgglomeration)/algebraicPairGAMGAgglomeration.C
|
||||||
|
|
||||||
meshes/lduMesh/lduMesh.C
|
meshes/lduMesh/lduMesh.C
|
||||||
|
meshes/lduMesh/lduPrimitiveMesh.C
|
||||||
|
|
||||||
LduMatrix = matrices/LduMatrix
|
LduMatrix = matrices/LduMatrix
|
||||||
$(LduMatrix)/LduMatrix/lduMatrices.C
|
$(LduMatrix)/LduMatrix/lduMatrices.C
|
||||||
|
|||||||
@ -355,7 +355,7 @@ int Foam::UPstream::baseProcNo(const label myComm, const int myProcID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::UPstream::myProcNo(const label myComm, const int baseProcID)
|
Foam::label Foam::UPstream::procNo(const label myComm, const int baseProcID)
|
||||||
{
|
{
|
||||||
const List<int>& parentRanks = procID(myComm);
|
const List<int>& parentRanks = procID(myComm);
|
||||||
label parentComm = parent(myComm);
|
label parentComm = parent(myComm);
|
||||||
@ -366,12 +366,24 @@ Foam::label Foam::UPstream::myProcNo(const label myComm, const int baseProcID)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label parentRank = myProcNo(parentComm, baseProcID);
|
label parentRank = procNo(parentComm, baseProcID);
|
||||||
return findIndex(parentRanks, parentRank);
|
return findIndex(parentRanks, parentRank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::UPstream::procNo
|
||||||
|
(
|
||||||
|
const label myComm,
|
||||||
|
const label currentComm,
|
||||||
|
const int currentProcID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label physProcID = UPstream::baseProcNo(currentComm, currentProcID);
|
||||||
|
return procNo(myComm, physProcID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// By default this is not a parallel run
|
// By default this is not a parallel run
|
||||||
|
|||||||
@ -336,12 +336,20 @@ public:
|
|||||||
|
|
||||||
//- Return physical processor number (i.e. processor number in
|
//- Return physical processor number (i.e. processor number in
|
||||||
// worldComm) given communicator and procssor
|
// worldComm) given communicator and procssor
|
||||||
static int baseProcNo(const label myComm, const int myProcID);
|
static int baseProcNo(const label myComm, const int procID);
|
||||||
|
|
||||||
//- Return processor number in communicator (given physical processor
|
//- Return processor number in communicator (given physical processor
|
||||||
// number) (= reverse of baseProcNo)
|
// number) (= reverse of baseProcNo)
|
||||||
static label myProcNo(const label myComm, const int baseProcID);
|
static label procNo(const label comm, const int baseProcID);
|
||||||
|
|
||||||
|
//- Return processor number in communicator (given processor number
|
||||||
|
// and communicator)
|
||||||
|
static label procNo
|
||||||
|
(
|
||||||
|
const label myComm,
|
||||||
|
const label currentComm,
|
||||||
|
const int currentProcID
|
||||||
|
);
|
||||||
|
|
||||||
//- Add the valid option this type of communications library
|
//- Add the valid option this type of communications library
|
||||||
// adds/requires on the command line
|
// adds/requires on the command line
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,7 +39,7 @@ Description
|
|||||||
order but only for groups of edges belonging to each point. An example
|
order but only for groups of edges belonging to each point. An example
|
||||||
is given below:
|
is given below:
|
||||||
\verbatim
|
\verbatim
|
||||||
owner eighbour
|
owner neighbour
|
||||||
0 1
|
0 1
|
||||||
0 20
|
0 20
|
||||||
1 2
|
1 2
|
||||||
|
|||||||
@ -65,10 +65,10 @@ protected:
|
|||||||
const lduInterfacePtrsList& coarseInterfaces_;
|
const lduInterfacePtrsList& coarseInterfaces_;
|
||||||
|
|
||||||
//- Face-cell addressing
|
//- Face-cell addressing
|
||||||
labelField faceCells_;
|
labelList faceCells_;
|
||||||
|
|
||||||
//- Face restrict addressing
|
//- Face restrict addressing
|
||||||
labelField faceRestrictAddressing_;
|
labelList faceRestrictAddressing_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -134,17 +134,11 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from fine-level interface,
|
//- Construct from interfaces, restrict addressing set later on
|
||||||
// local and neighbour restrict addressing
|
|
||||||
GAMGInterface
|
GAMGInterface
|
||||||
(
|
(
|
||||||
const label index,
|
const label index,
|
||||||
const lduInterfacePtrsList& coarseInterfaces,
|
const lduInterfacePtrsList& coarseInterfaces
|
||||||
const lduInterface&,
|
|
||||||
const labelField&,
|
|
||||||
const labelField&,
|
|
||||||
const label fineLevelIndex = -1,
|
|
||||||
const label coarseComm = UPstream::worldComm
|
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
index_(index),
|
index_(index),
|
||||||
@ -152,6 +146,22 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
//- Construct from interfaces and restrict addressing
|
||||||
|
GAMGInterface
|
||||||
|
(
|
||||||
|
const label index,
|
||||||
|
const lduInterfacePtrsList& coarseInterfaces,
|
||||||
|
const labelUList& faceCells,
|
||||||
|
const labelUList& faceRestrictAddressing
|
||||||
|
)
|
||||||
|
:
|
||||||
|
index_(index),
|
||||||
|
coarseInterfaces_(coarseInterfaces),
|
||||||
|
faceCells_(faceCells),
|
||||||
|
faceRestrictAddressing_(faceRestrictAddressing)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|||||||
@ -58,10 +58,10 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
|||||||
GAMGInterface
|
GAMGInterface
|
||||||
(
|
(
|
||||||
index,
|
index,
|
||||||
coarseInterfaces,
|
coarseInterfaces
|
||||||
fineInterface,
|
// fineInterface,
|
||||||
localRestrictAddressing,
|
// localRestrictAddressing,
|
||||||
neighbourRestrictAddressing
|
// neighbourRestrictAddressing
|
||||||
),
|
),
|
||||||
fineCyclicInterface_(refCast<const cyclicLduInterface>(fineInterface))
|
fineCyclicInterface_(refCast<const cyclicLduInterface>(fineInterface))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,13 +58,20 @@ Foam::processorGAMGInterface::processorGAMGInterface
|
|||||||
GAMGInterface
|
GAMGInterface
|
||||||
(
|
(
|
||||||
index,
|
index,
|
||||||
coarseInterfaces,
|
coarseInterfaces
|
||||||
fineInterface,
|
// fineInterface,
|
||||||
localRestrictAddressing,
|
// localRestrictAddressing,
|
||||||
neighbourRestrictAddressing
|
// neighbourRestrictAddressing
|
||||||
),
|
),
|
||||||
fineProcInterface_(refCast<const processorLduInterface>(fineInterface)),
|
// fineProcInterface_(refCast<const processorLduInterface>(fineInterface)),
|
||||||
comm_(coarseComm)
|
comm_(coarseComm),
|
||||||
|
myProcNo_(refCast<const processorLduInterface>(fineInterface).myProcNo()),
|
||||||
|
neighbProcNo_
|
||||||
|
(
|
||||||
|
refCast<const processorLduInterface>(fineInterface).neighbProcNo()
|
||||||
|
),
|
||||||
|
forwardT_(refCast<const processorLduInterface>(fineInterface).forwardT()),
|
||||||
|
tag_(refCast<const processorLduInterface>(fineInterface).tag())
|
||||||
{
|
{
|
||||||
// From coarse face to coarse cell
|
// From coarse face to coarse cell
|
||||||
DynamicList<label> dynFaceCells(localRestrictAddressing.size());
|
DynamicList<label> dynFaceCells(localRestrictAddressing.size());
|
||||||
@ -128,7 +135,37 @@ Foam::processorGAMGInterface::processorGAMGInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
Foam::processorGAMGInterface::processorGAMGInterface
|
||||||
|
(
|
||||||
|
const label index,
|
||||||
|
const lduInterfacePtrsList& coarseInterfaces,
|
||||||
|
// const lduInterface& fineInterface,
|
||||||
|
const labelUList& faceCells,
|
||||||
|
const labelUList& faceRestrictAddresssing,
|
||||||
|
const label coarseComm,
|
||||||
|
const label myProcNo,
|
||||||
|
const label neighbProcNo,
|
||||||
|
const tensorField& forwardT,
|
||||||
|
const int tag
|
||||||
|
)
|
||||||
|
:
|
||||||
|
GAMGInterface
|
||||||
|
(
|
||||||
|
index,
|
||||||
|
coarseInterfaces,
|
||||||
|
faceCells,
|
||||||
|
faceRestrictAddresssing
|
||||||
|
),
|
||||||
|
//fineProcInterface_(refCast<const processorLduInterface>(fineInterface)),
|
||||||
|
comm_(coarseComm),
|
||||||
|
myProcNo_(myProcNo),
|
||||||
|
neighbProcNo_(neighbProcNo),
|
||||||
|
forwardT_(forwardT),
|
||||||
|
tag_(tag)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::processorGAMGInterface::~processorGAMGInterface()
|
Foam::processorGAMGInterface::~processorGAMGInterface()
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -55,13 +55,25 @@ class processorGAMGInterface
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference for the processorLduInterface from which this is
|
// //- Reference to the processorLduInterface from which this is
|
||||||
// agglomerated
|
// // agglomerated
|
||||||
const processorLduInterface& fineProcInterface_;
|
// const processorLduInterface& fineProcInterface_;
|
||||||
|
|
||||||
//- Communicator to use for parallel communication
|
//- Communicator to use for parallel communication
|
||||||
const label comm_;
|
const label comm_;
|
||||||
|
|
||||||
|
//- My processor rank in communicator
|
||||||
|
label myProcNo_;
|
||||||
|
|
||||||
|
//- Neighbouring processor rank in communicator
|
||||||
|
label neighbProcNo_;
|
||||||
|
|
||||||
|
//- Transformation tensor
|
||||||
|
tensorField forwardT_;
|
||||||
|
|
||||||
|
//- Message tag used for sending
|
||||||
|
int tag_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -92,6 +104,21 @@ public:
|
|||||||
const label coarseComm
|
const label coarseComm
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
processorGAMGInterface
|
||||||
|
(
|
||||||
|
const label index,
|
||||||
|
const lduInterfacePtrsList& coarseInterfaces,
|
||||||
|
//const lduInterface& fineInterface,
|
||||||
|
const labelUList& faceCells,
|
||||||
|
const labelUList& faceRestrictAddresssing,
|
||||||
|
const label coarseComm,
|
||||||
|
const label myProcNo,
|
||||||
|
const label neighbProcNo,
|
||||||
|
const tensorField& forwardT,
|
||||||
|
const int tag
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~processorGAMGInterface();
|
virtual ~processorGAMGInterface();
|
||||||
@ -118,34 +145,34 @@ public:
|
|||||||
|
|
||||||
//- Processor interface functions
|
//- Processor interface functions
|
||||||
|
|
||||||
//- Return processor number
|
//- Return communicator used for sending
|
||||||
virtual int myProcNo() const
|
virtual int comm() const
|
||||||
{
|
{
|
||||||
return fineProcInterface_.myProcNo();
|
return comm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return neigbour processor number
|
//- Return processor number (rank in communicator)
|
||||||
|
virtual int myProcNo() const
|
||||||
|
{
|
||||||
|
return myProcNo_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return neigbour processor number (rank in communicator)
|
||||||
virtual int neighbProcNo() const
|
virtual int neighbProcNo() const
|
||||||
{
|
{
|
||||||
return fineProcInterface_.neighbProcNo();
|
return neighbProcNo_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return face transformation tensor
|
//- Return face transformation tensor
|
||||||
virtual const tensorField& forwardT() const
|
virtual const tensorField& forwardT() const
|
||||||
{
|
{
|
||||||
return fineProcInterface_.forwardT();
|
return forwardT_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return message tag used for sending
|
//- Return message tag used for sending
|
||||||
virtual int tag() const
|
virtual int tag() const
|
||||||
{
|
{
|
||||||
return fineProcInterface_.tag();
|
return tag_;
|
||||||
}
|
|
||||||
|
|
||||||
//- Return communicator used for sending
|
|
||||||
virtual int comm() const
|
|
||||||
{
|
|
||||||
return comm_;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -31,11 +31,11 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Patch, class ProcPatch>
|
template<class Container, class ProcPatch>
|
||||||
Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
Foam::labelList Foam::ProcessorTopology<Container, ProcPatch>::procNeighbours
|
||||||
(
|
(
|
||||||
const label nProcs,
|
const label nProcs,
|
||||||
const PtrList<Patch>& patches
|
const Container& patches
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Determine number of processor neighbours and max neighbour id.
|
// Determine number of processor neighbours and max neighbour id.
|
||||||
@ -48,7 +48,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const Patch& patch = patches[patchi];
|
const typename Container::const_reference patch = patches[patchi];
|
||||||
|
|
||||||
if (isA<ProcPatch>(patch))
|
if (isA<ProcPatch>(patch))
|
||||||
{
|
{
|
||||||
@ -85,7 +85,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
|||||||
|
|
||||||
forAll(patches, patchi)
|
forAll(patches, patchi)
|
||||||
{
|
{
|
||||||
const Patch& patch = patches[patchi];
|
const typename Container::const_reference patch = patches[patchi];
|
||||||
|
|
||||||
if (isA<ProcPatch>(patch))
|
if (isA<ProcPatch>(patch))
|
||||||
{
|
{
|
||||||
@ -104,10 +104,10 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
|||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
// Construct from components
|
||||||
template<class Patch, class ProcPatch>
|
template<class Container, class ProcPatch>
|
||||||
Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
Foam::ProcessorTopology<Container, ProcPatch>::ProcessorTopology
|
||||||
(
|
(
|
||||||
const PtrList<Patch>& patches,
|
const Container& patches,
|
||||||
const label comm
|
const label comm
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
@ -117,7 +117,8 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
// Fill my 'slot' with my neighbours
|
// Fill my 'slot' with my neighbours
|
||||||
operator[](Pstream::myProcNo()) = procNeighbours(this->size(), patches);
|
operator[](Pstream::myProcNo(comm)) =
|
||||||
|
procNeighbours(this->size(), patches);
|
||||||
|
|
||||||
// Distribute to all processors
|
// Distribute to all processors
|
||||||
Pstream::gatherList(*this, Pstream::msgType(), comm);
|
Pstream::gatherList(*this, Pstream::msgType(), comm);
|
||||||
@ -176,7 +177,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
(
|
(
|
||||||
Pstream::nProcs(comm),
|
Pstream::nProcs(comm),
|
||||||
comms
|
comms
|
||||||
).procSchedule()[Pstream::myProcNo()]
|
).procSchedule()[Pstream::myProcNo(comm)]
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(mySchedule, iter)
|
forAll(mySchedule, iter)
|
||||||
@ -185,13 +186,13 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
|||||||
|
|
||||||
// Get the other processor
|
// Get the other processor
|
||||||
label nb = comms[commI][0];
|
label nb = comms[commI][0];
|
||||||
if (nb == Pstream::myProcNo())
|
if (nb == Pstream::myProcNo(comm))
|
||||||
{
|
{
|
||||||
nb = comms[commI][1];
|
nb = comms[commI][1];
|
||||||
}
|
}
|
||||||
label patchi = procPatchMap_[nb];
|
label patchi = procPatchMap_[nb];
|
||||||
|
|
||||||
if (Pstream::myProcNo() > nb)
|
if (Pstream::myProcNo(comm) > nb)
|
||||||
{
|
{
|
||||||
patchSchedule_[patchEvali].patch = patchi;
|
patchSchedule_[patchEvali].patch = patchi;
|
||||||
patchSchedule_[patchEvali++].init = true;
|
patchSchedule_[patchEvali++].init = true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,7 +53,7 @@ namespace Foam
|
|||||||
Class ProcessorTopology Declaration
|
Class ProcessorTopology Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class Patch, class ProcPatch>
|
template<class Container, class ProcPatch>
|
||||||
class ProcessorTopology
|
class ProcessorTopology
|
||||||
:
|
:
|
||||||
public labelListList
|
public labelListList
|
||||||
@ -76,14 +76,14 @@ private:
|
|||||||
|
|
||||||
//- Return all neighbouring processors of this processor. Set
|
//- Return all neighbouring processors of this processor. Set
|
||||||
// procPatchMap_.
|
// procPatchMap_.
|
||||||
labelList procNeighbours(const label nProcs, const PtrList<Patch>&);
|
labelList procNeighbours(const label nProcs, const Container&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from boundaryMesh
|
//- Construct from boundaryMesh
|
||||||
ProcessorTopology(const PtrList<Patch>& patches, const label comm);
|
ProcessorTopology(const Container& patches, const label comm);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
164
src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C
Normal file
164
src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "lduPrimitiveMesh.H"
|
||||||
|
#include "processorLduInterface.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||||
|
(
|
||||||
|
const label nCells,
|
||||||
|
const labelUList& l,
|
||||||
|
const labelUList& u,
|
||||||
|
const labelListList& pa,
|
||||||
|
const lduInterfacePtrsList& interfaces,
|
||||||
|
const lduSchedule& ps,
|
||||||
|
const label comm
|
||||||
|
)
|
||||||
|
:
|
||||||
|
lduAddressing(nCells),
|
||||||
|
lowerAddr_(l),
|
||||||
|
upperAddr_(u),
|
||||||
|
patchAddr_(pa),
|
||||||
|
interfaces_(interfaces),
|
||||||
|
patchSchedule_(ps),
|
||||||
|
comm_(comm)
|
||||||
|
{
|
||||||
|
Pout<< "lduPrimitiveMesh :"
|
||||||
|
<< " nCells:" << nCells
|
||||||
|
<< " l:" << lowerAddr_.size()
|
||||||
|
<< " u:" << upperAddr_.size()
|
||||||
|
<< " pa:" << patchAddr_.size()
|
||||||
|
<< " interfaces:" << interfaces_.size()
|
||||||
|
<< " comm:" << comm_
|
||||||
|
<< endl;
|
||||||
|
forAll(interfaces_, i)
|
||||||
|
{
|
||||||
|
if (interfaces_.set(i))
|
||||||
|
{
|
||||||
|
if (isA<processorLduInterface>(interfaces_[i]))
|
||||||
|
{
|
||||||
|
const processorLduInterface& pi = refCast
|
||||||
|
<
|
||||||
|
const processorLduInterface
|
||||||
|
>(interfaces_[i]);
|
||||||
|
|
||||||
|
Pout<< " patch:" << i
|
||||||
|
<< " size:" << patchAddr_[i].size()
|
||||||
|
<< " myProcNo:" << pi.myProcNo()
|
||||||
|
<< " neighbProcNo:" << pi.neighbProcNo()
|
||||||
|
<< " comm:" << pi.comm()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||||
|
(
|
||||||
|
const label nCells,
|
||||||
|
labelList& l,
|
||||||
|
labelList& u,
|
||||||
|
labelListList& pa,
|
||||||
|
lduInterfacePtrsList& interfaces,
|
||||||
|
const lduSchedule& ps,
|
||||||
|
const label comm,
|
||||||
|
bool reUse
|
||||||
|
)
|
||||||
|
:
|
||||||
|
lduAddressing(nCells),
|
||||||
|
lowerAddr_(l, reUse),
|
||||||
|
upperAddr_(u, reUse),
|
||||||
|
patchAddr_(pa, reUse),
|
||||||
|
interfaces_(interfaces, reUse),
|
||||||
|
patchSchedule_(ps),
|
||||||
|
comm_(comm)
|
||||||
|
{
|
||||||
|
Pout<< "lduPrimitiveMesh :"
|
||||||
|
<< " nCells:" << nCells
|
||||||
|
<< " l:" << lowerAddr_.size()
|
||||||
|
<< " u:" << upperAddr_.size()
|
||||||
|
<< " pa:" << patchAddr_.size()
|
||||||
|
<< " interfaces:" << interfaces_.size()
|
||||||
|
<< " comm:" << comm_
|
||||||
|
<< endl;
|
||||||
|
forAll(interfaces_, i)
|
||||||
|
{
|
||||||
|
if (interfaces_.set(i))
|
||||||
|
{
|
||||||
|
if (isA<processorLduInterface>(interfaces_[i]))
|
||||||
|
{
|
||||||
|
const processorLduInterface& pi = refCast
|
||||||
|
<
|
||||||
|
const processorLduInterface
|
||||||
|
>(interfaces_[i]);
|
||||||
|
|
||||||
|
Pout<< " patch:" << i
|
||||||
|
<< " size:" << patchAddr_[i].size()
|
||||||
|
<< " myProcNo:" << pi.myProcNo()
|
||||||
|
<< " neighbProcNo:" << pi.neighbProcNo()
|
||||||
|
<< " comm:" << pi.comm()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Foam::lduPrimitiveMesh::lduPrimitiveMesh(Istream& is)
|
||||||
|
//:
|
||||||
|
// lduAddressing(readLabel(is)),
|
||||||
|
// lowerAddr_(is),
|
||||||
|
// upperAddr_(is),
|
||||||
|
// patchAddr_(is),
|
||||||
|
// interfaces_(is),
|
||||||
|
// patchSchedule_(is),
|
||||||
|
// comm_(readLabel(is))
|
||||||
|
//{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//Foam::Ostream& Foam::operator<<
|
||||||
|
//(
|
||||||
|
// Ostream& os,
|
||||||
|
// const Foam::lduPrimitiveMesh& mesh
|
||||||
|
//)
|
||||||
|
//{
|
||||||
|
// os << mesh.size()
|
||||||
|
// << mesh.lowerAddr_
|
||||||
|
// << mesh.upperAddr_
|
||||||
|
// << mesh.patchAddr_
|
||||||
|
// << mesh.interfaces_
|
||||||
|
// << mesh.patchSchedule_
|
||||||
|
// << mesh.comm_
|
||||||
|
//
|
||||||
|
// return os;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -27,6 +27,9 @@ Class
|
|||||||
Description
|
Description
|
||||||
Simplest contrete lduMesh which stores the addressing needed by lduMatrix.
|
Simplest contrete lduMesh which stores the addressing needed by lduMatrix.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
lduPrimitiveMesh.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef lduPrimitiveMesh_H
|
#ifndef lduPrimitiveMesh_H
|
||||||
@ -34,13 +37,18 @@ Description
|
|||||||
|
|
||||||
#include "lduMesh.H"
|
#include "lduMesh.H"
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "processorLduInterface.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//// Forward declaration of friend functions and operators
|
||||||
|
//
|
||||||
|
//class lduPrimitiveMesh;
|
||||||
|
//
|
||||||
|
//Ostream& operator<<(Ostream&, const lduPrimitiveMesh&);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class lduPrimitiveMesh Declaration
|
Class lduPrimitiveMesh Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -63,11 +71,10 @@ class lduPrimitiveMesh
|
|||||||
|
|
||||||
//- List of pointers for each patch
|
//- List of pointers for each patch
|
||||||
// with only those pointing to interfaces being set
|
// with only those pointing to interfaces being set
|
||||||
lduInterfacePtrsList interfaces_;
|
const lduInterfacePtrsList interfaces_;
|
||||||
|
|
||||||
//- Patch field evaluation schedule.
|
//- Patch field evaluation schedule
|
||||||
// Note this does not need to be held as a copy because it is invariant
|
const lduSchedule patchSchedule_;
|
||||||
const lduSchedule& patchSchedule_;
|
|
||||||
|
|
||||||
//- Communicator to use for any parallel communication
|
//- Communicator to use for any parallel communication
|
||||||
const label comm_;
|
const label comm_;
|
||||||
@ -92,49 +99,10 @@ public:
|
|||||||
const labelUList& l,
|
const labelUList& l,
|
||||||
const labelUList& u,
|
const labelUList& u,
|
||||||
const labelListList& pa,
|
const labelListList& pa,
|
||||||
lduInterfacePtrsList interfaces,
|
const lduInterfacePtrsList& interfaces,
|
||||||
const lduSchedule& ps,
|
const lduSchedule& ps,
|
||||||
const label comm
|
const label comm
|
||||||
)
|
);
|
||||||
:
|
|
||||||
lduAddressing(nCells),
|
|
||||||
lowerAddr_(l),
|
|
||||||
upperAddr_(u),
|
|
||||||
patchAddr_(pa),
|
|
||||||
interfaces_(interfaces),
|
|
||||||
patchSchedule_(ps),
|
|
||||||
comm_(comm)
|
|
||||||
{
|
|
||||||
Pout<< "lduPrimitiveMesh :"
|
|
||||||
<< " nCells:" << nCells
|
|
||||||
<< " l:" << lowerAddr_.size()
|
|
||||||
<< " u:" << upperAddr_.size()
|
|
||||||
<< " pa:" << patchAddr_.size()
|
|
||||||
<< " interfaces:" << interfaces_.size()
|
|
||||||
<< " comm:" << comm_
|
|
||||||
<< endl;
|
|
||||||
forAll(interfaces_, i)
|
|
||||||
{
|
|
||||||
if (interfaces_.set(i))
|
|
||||||
{
|
|
||||||
if (isA<processorLduInterface>(interfaces_[i]))
|
|
||||||
{
|
|
||||||
const processorLduInterface& pi = refCast
|
|
||||||
<
|
|
||||||
const processorLduInterface
|
|
||||||
>(interfaces_[i]);
|
|
||||||
|
|
||||||
Pout<< " patch:" << i
|
|
||||||
<< " size:" << patchAddr_[i].size()
|
|
||||||
<< " myProcNo:" << pi.myProcNo()
|
|
||||||
<< " neighbProcNo:" << pi.neighbProcNo()
|
|
||||||
<< " comm:" << pi.comm()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Construct from components and re-use storage as specified.
|
//- Construct from components and re-use storage as specified.
|
||||||
lduPrimitiveMesh
|
lduPrimitiveMesh
|
||||||
@ -143,49 +111,14 @@ public:
|
|||||||
labelList& l,
|
labelList& l,
|
||||||
labelList& u,
|
labelList& u,
|
||||||
labelListList& pa,
|
labelListList& pa,
|
||||||
lduInterfacePtrsList interfaces,
|
lduInterfacePtrsList& interfaces,
|
||||||
const lduSchedule& ps,
|
const lduSchedule& ps,
|
||||||
const label comm,
|
const label comm,
|
||||||
bool reUse
|
bool reUse
|
||||||
)
|
);
|
||||||
:
|
|
||||||
lduAddressing(nCells),
|
|
||||||
lowerAddr_(l, reUse),
|
|
||||||
upperAddr_(u, reUse),
|
|
||||||
patchAddr_(pa, reUse),
|
|
||||||
interfaces_(interfaces, reUse),
|
|
||||||
patchSchedule_(ps),
|
|
||||||
comm_(comm)
|
|
||||||
{
|
|
||||||
Pout<< "lduPrimitiveMesh :"
|
|
||||||
<< " nCells:" << nCells
|
|
||||||
<< " l:" << lowerAddr_.size()
|
|
||||||
<< " u:" << upperAddr_.size()
|
|
||||||
<< " pa:" << patchAddr_.size()
|
|
||||||
<< " interfaces:" << interfaces_.size()
|
|
||||||
<< " comm:" << comm_
|
|
||||||
<< endl;
|
|
||||||
forAll(interfaces_, i)
|
|
||||||
{
|
|
||||||
if (interfaces_.set(i))
|
|
||||||
{
|
|
||||||
if (isA<processorLduInterface>(interfaces_[i]))
|
|
||||||
{
|
|
||||||
const processorLduInterface& pi = refCast
|
|
||||||
<
|
|
||||||
const processorLduInterface
|
|
||||||
>(interfaces_[i]);
|
|
||||||
|
|
||||||
Pout<< " patch:" << i
|
//- Construct from Istream
|
||||||
<< " size:" << patchAddr_[i].size()
|
lduPrimitiveMesh(Istream& is);
|
||||||
<< " myProcNo:" << pi.myProcNo()
|
|
||||||
<< " neighbProcNo:" << pi.neighbProcNo()
|
|
||||||
<< " comm:" << pi.comm()
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
@ -239,6 +172,10 @@ public:
|
|||||||
{
|
{
|
||||||
return patchSchedule_;
|
return patchSchedule_;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// // Ostream operator
|
||||||
|
//
|
||||||
|
// friend Ostream& operator<<(Ostream&, const procLduMatrix&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
typedef ProcessorTopology<polyPatch, processorPolyPatch> processorTopology;
|
typedef ProcessorTopology<polyPatchList, processorPolyPatch> processorTopology;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,8 @@ Foam::UIPstream::UIPstream
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "UIPstream::UIPstream : read from:" << fromProcNo
|
Pout<< "UIPstream::UIPstream : read from:" << fromProcNo
|
||||||
<< " tag:" << tag << " wanted size:" << wantedSize
|
<< " tag:" << tag << " comm:" << comm_
|
||||||
|
<< " wanted size:" << wantedSize
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +156,8 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
|
|||||||
{
|
{
|
||||||
Pout<< "UIPstream::UIPstream PstreamBuffers :"
|
Pout<< "UIPstream::UIPstream PstreamBuffers :"
|
||||||
<< " fromProcNo:" << fromProcNo
|
<< " fromProcNo:" << fromProcNo
|
||||||
<< " tag:" << tag_ << " receive buffer size:" << messageSize_
|
<< " tag:" << tag_ << " comm:" << comm_
|
||||||
|
<< " receive buffer size:" << messageSize_
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +171,8 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
|
|||||||
{
|
{
|
||||||
Pout<< "UIPstream::UIPstream PstreamBuffers :"
|
Pout<< "UIPstream::UIPstream PstreamBuffers :"
|
||||||
<< " read from:" << fromProcNo
|
<< " read from:" << fromProcNo
|
||||||
<< " tag:" << tag_ << " wanted size:" << wantedSize
|
<< " tag:" << tag_ << " comm:" << comm_
|
||||||
|
<< " wanted size:" << wantedSize
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user