Skip to content

Commit

Permalink
dsmcFoam+: load balancing #76: adjustments to the decomposeDSMCLoadBa…
Browse files Browse the repository at this point in the history
…lancePar application to detele balanceParDict and only use loadBalanceDict for domain repartitioning
  • Loading branch information
vincentcasseau committed May 29, 2021
1 parent 4a40ae8 commit 40ac293
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 22 deletions.
Expand Up @@ -266,7 +266,7 @@ int main(int argc, char *argv[])
(
IOobject
(
"balanceParDict",
"decomposeParDict",
runTime.time().system(),
regionDir, // use region if non-standard
runTime,
Expand All @@ -287,7 +287,7 @@ int main(int argc, char *argv[])
<< nProcs << " domains"
<< nl
<< "instead of " << nDomains
<< " domains as specified in balanceParDict"
<< " domains as specified in decomposeParDict"
<< nl
<< exit(FatalError);
}
Expand Down
Expand Up @@ -95,28 +95,51 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
(
IOobject
(
"balanceParDict",
"loadBalanceDict",
time().system(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
nProcs_(readInt(decompositionDict_.lookup("numberOfSubdomains"))),
distributed_(false),
cellToProc_(nCells()),
procPointAddressing_(nProcs_),
procFaceAddressing_(nProcs_),
procCellAddressing_(nProcs_),
procPatchSize_(nProcs_),
procPatchStartIndex_(nProcs_),
procNeighbourProcessors_(nProcs_),
procProcessorPatchSize_(nProcs_),
procProcessorPatchStartIndex_(nProcs_),
procProcessorPatchSubPatchIDs_(nProcs_),
procProcessorPatchSubPatchStarts_(nProcs_)
cellToProc_(nCells())
{
decompositionDict_.readIfPresent("distributed", distributed_);
word method = word::null;

{
IOdictionary decomposeParDict
(
IOobject
(
"decomposeParDict",
time().system(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);

nProcs_ = readLabel(decomposeParDict.lookup("numberOfSubdomains"));
method = word(decomposeParDict.lookup("method"));
decomposeParDict.readIfPresent("distributed", distributed_);
}

procPointAddressing_.setSize(nProcs_);
procFaceAddressing_.setSize(nProcs_);
procCellAddressing_.setSize(nProcs_);
procPatchSize_.setSize(nProcs_);
procPatchStartIndex_.setSize(nProcs_);
procNeighbourProcessors_.setSize(nProcs_);
procProcessorPatchSize_.setSize(nProcs_);
procProcessorPatchStartIndex_.setSize(nProcs_);
procProcessorPatchSubPatchIDs_.setSize(nProcs_);
procProcessorPatchSubPatchStarts_.setSize(nProcs_);

decompositionDict_.add("numberOfSubdomains", nProcs_);
decompositionDict_.add("method", method);
decompositionDict_.add("distributed", distributed_);
}


Expand Down Expand Up @@ -207,8 +230,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::MUST_READ,
IOobject::NO_WRITE
);
//if (io.headerOk())
if (io.typeHeaderOk<labelIOList>()) // NEW VINCENT
if (io.typeHeaderOk<labelIOList>())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
cellLevelPtr.reset(new labelIOList(io));
Expand All @@ -225,8 +247,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::MUST_READ,
IOobject::NO_WRITE
);
//if (io.headerOk())
if (io.typeHeaderOk<labelIOList>()) // NEW VINCENT

if (io.typeHeaderOk<labelIOList>())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
pointLevelPtr.reset(new labelIOList(io));
Expand All @@ -243,8 +265,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::MUST_READ,
IOobject::NO_WRITE
);
//if (io.headerOk())
if (io.typeHeaderOk<uniformDimensionedScalarField>()) // NEW VINCENT

if (io.typeHeaderOk<uniformDimensionedScalarField>())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
level0EdgePtr.reset(new uniformDimensionedScalarField(io));
Expand Down

0 comments on commit 40ac293

Please sign in to comment.