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 * * * * * * * * * * * //
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;
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
)
:
fvPatchList(0),
mesh_(m)
{}
fvBoundaryMesh::fvBoundaryMesh
(
const fvMesh& m,
const polyBoundaryMesh& basicBdry
)
:
fvPatchList(basicBdry.size()),
fvPatchList(m.boundaryMesh().size()),
mesh_(m)
{
addPatches(basicBdry);
addFvPatches();
}
@ -109,10 +101,10 @@ lduInterfacePtrsList fvBoundaryMesh::interfaces() const
}
void fvBoundaryMesh::readUpdate(const polyBoundaryMesh& basicBdry)
void fvBoundaryMesh::readUpdate()
{
clear();
addPatches(basicBdry);
addFvPatches();
}

View file

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

View file

@ -124,7 +124,7 @@ Foam::fvMesh::fvMesh(const IOobject& io)
:
polyMesh(io),
surfaceInterpolation(*this),
boundary_(*this, boundaryMesh()),
boundary_(*this),
lduPtr_(NULL),
curTimeIndex_(time().timeIndex()),
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
(
const IOobject& io,
@ -347,9 +375,9 @@ void Foam::fvMesh::addFvPatches
<< abort(FatalError);
}
// first add polyPatches
// First add polyPatches
addPatches(p, validBoundary);
boundary_.addPatches(boundaryMesh());
boundary_.addFvPatches();
}
@ -390,7 +418,7 @@ Foam::polyMesh::readUpdateState Foam::fvMesh::readUpdate()
Info << "Boundary and topological update" << endl;
}
boundary_.readUpdate(boundaryMesh());
boundary_.readUpdate();
clearOut();

View file

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