Load balancing development 2

This commit is contained in:
Hrvoje Jasak 2018-03-16 20:44:06 +00:00
parent bd5f2bb4f4
commit ebfa7840c2
4 changed files with 58 additions and 38 deletions

View file

@ -34,16 +34,19 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void fvBoundaryMesh::addPatches(const polyBoundaryMesh& basicBdry) void fvBoundaryMesh::addFvPatches()
{ {
setSize(basicBdry.size()); const polyBoundaryMesh& bMesh = mesh_.boundaryMesh();
setSize(bMesh.size());
// Set boundary patches // Set boundary patches, using the patches added to the polyMesh
// Bug fix. HJ, 1/Mar/2018
fvPatchList& Patches = *this; fvPatchList& Patches = *this;
forAll(Patches, patchI) forAll(Patches, patchI)
{ {
Patches.set(patchI, fvPatch::New(basicBdry[patchI], *this)); Patches.set(patchI, fvPatch::New(bMesh[patchI], *this));
} }
} }
@ -55,21 +58,10 @@ fvBoundaryMesh::fvBoundaryMesh
const fvMesh& m const fvMesh& m
) )
: :
fvPatchList(0), fvPatchList(m.boundaryMesh().size()),
mesh_(m)
{}
fvBoundaryMesh::fvBoundaryMesh
(
const fvMesh& m,
const polyBoundaryMesh& basicBdry
)
:
fvPatchList(basicBdry.size()),
mesh_(m) mesh_(m)
{ {
addPatches(basicBdry); addFvPatches();
} }
@ -109,10 +101,10 @@ lduInterfacePtrsList fvBoundaryMesh::interfaces() const
} }
void fvBoundaryMesh::readUpdate(const polyBoundaryMesh& basicBdry) void fvBoundaryMesh::readUpdate()
{ {
clear(); clear();
addPatches(basicBdry); addFvPatches();
} }

View file

@ -47,7 +47,7 @@ class fvMesh;
class polyBoundaryMesh; class polyBoundaryMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class fvBoundaryMesh Declaration Class fvBoundaryMesh Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class fvBoundaryMesh class fvBoundaryMesh
@ -70,14 +70,14 @@ private:
//- Disallow assignment //- Disallow assignment
void operator=(const fvBoundaryMesh&); void operator=(const fvBoundaryMesh&);
//- Add fvPatches corresponding to the given polyBoundaryMesh //- Add fvPatches corresponding to the polyBoundaryMesh
void addPatches(const polyBoundaryMesh&); void addFvPatches();
protected: protected:
//- Update boundary based on new polyBoundaryMesh //- Update boundary based on new polyBoundaryMesh
void readUpdate(const polyBoundaryMesh&); void readUpdate();
public: public:
@ -87,18 +87,8 @@ public:
// Constructors // Constructors
//- Construct with zero size
fvBoundaryMesh
(
const fvMesh&
);
//- Construct from polyBoundaryMesh //- Construct from polyBoundaryMesh
fvBoundaryMesh fvBoundaryMesh(const fvMesh&);
(
const fvMesh&,
const polyBoundaryMesh&
);
// Destructor - default // Destructor - default

View file

@ -124,7 +124,7 @@ Foam::fvMesh::fvMesh(const IOobject& io)
: :
polyMesh(io), polyMesh(io),
surfaceInterpolation(*this), surfaceInterpolation(*this),
boundary_(*this, boundaryMesh()), boundary_(*this),
lduPtr_(NULL), lduPtr_(NULL),
curTimeIndex_(time().timeIndex()), curTimeIndex_(time().timeIndex()),
VPtr_(NULL), VPtr_(NULL),
@ -245,6 +245,34 @@ Foam::fvMesh::fvMesh
} }
Foam::fvMesh::fvMesh
(
const IOobject& io,
Istream& is,
const bool syncPar
)
:
polyMesh(io, is, syncPar),
surfaceInterpolation(*this),
boundary_(*this),
lduPtr_(NULL),
curTimeIndex_(time().timeIndex()),
VPtr_(NULL),
V0Ptr_(NULL),
V00Ptr_(NULL),
SfPtr_(NULL),
magSfPtr_(NULL),
CPtr_(NULL),
CfPtr_(NULL),
phiPtr_(NULL)
{
if (debug)
{
Info<< "Constructing fvMesh from Istream" << endl;
}
}
Foam::fvMesh::fvMesh Foam::fvMesh::fvMesh
( (
const IOobject& io, const IOobject& io,
@ -347,9 +375,9 @@ void Foam::fvMesh::addFvPatches
<< abort(FatalError); << abort(FatalError);
} }
// first add polyPatches // First add polyPatches
addPatches(p, validBoundary); addPatches(p, validBoundary);
boundary_.addPatches(boundaryMesh()); boundary_.addFvPatches();
} }
@ -390,7 +418,7 @@ Foam::polyMesh::readUpdateState Foam::fvMesh::readUpdate()
Info << "Boundary and topological update" << endl; Info << "Boundary and topological update" << endl;
} }
boundary_.readUpdate(boundaryMesh()); boundary_.readUpdate();
clearOut(); clearOut();

View file

@ -178,6 +178,14 @@ public:
//- Construct from IOobject //- Construct from IOobject
explicit fvMesh(const IOobject& io); explicit fvMesh(const IOobject& io);
//- Construct from Istream
fvMesh
(
const IOobject& io,
Istream& is,
const bool syncPar = true
);
//- Construct from components without boundary. //- Construct from components without boundary.
// Boundary is added using addFvPatches() member function // Boundary is added using addFvPatches() member function
fvMesh fvMesh
@ -226,6 +234,8 @@ public:
// Helpers // Helpers
//- Add boundary patches. Constructor helper //- Add boundary patches. Constructor helper
// Note: adding polyPatches to polyMesh patches and
// fvPatches to fvMesh
void addFvPatches void addFvPatches
( (
const List<polyPatch*>&, const List<polyPatch*>&,