Skip to content

Commit

Permalink
Correct initialisation overlaps for MD-DSMC coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
SLongshaw committed Nov 21, 2019
1 parent 8b1c025 commit 9b8a299
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,18 +558,6 @@ void dsmcControllers::initialConfig()
couplingControllers_[cC]->initialConfiguration(1);
}

//- Wait here until other side has finished sending initialisation values (blocking)
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->barrier(static_cast<label>(1));
}

//- Forget initial configuration time frame
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->forget(static_cast<label>(1), true);
}

//- Run initial configuration stage 2
forAll(couplingControllers_, cC)
{
Expand All @@ -579,13 +567,13 @@ void dsmcControllers::initialConfig()
//- Wait here until other side has finished sending initialisation values (blocking)
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->barrier(static_cast<label>(1));
couplingControllers_[cC]->barrier(static_cast<label>(0));
}

//- Forget initial configuration time frame
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->forget(static_cast<label>(1), true);
couplingControllers_[cC]->forget(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ void dsmcMdCoupling::initialConfiguration(label stage)

forAll(sendInterfaces_, iface)
{
sendInterfaces_[iface]->commit(static_cast<label>(1));
sendInterfaces_[iface]->commit(static_cast<label>(-1));
interfaceCommits.append(sendInterfaceNames_[iface]);
}

Expand All @@ -706,7 +706,7 @@ void dsmcMdCoupling::initialConfiguration(label stage)
label index = findIndex(interfaceCommits, recvInterfaceNames_[iface]);
if(index == -1)
{
recvInterfaces_[iface]->commit(static_cast<label>(1));
recvInterfaces_[iface]->commit(static_cast<label>(-1));
}
}
#endif
Expand Down Expand Up @@ -754,11 +754,6 @@ void dsmcMdCoupling::controlParcelsAfterCollisions(int stage)
void dsmcMdCoupling::sendCoupledRegion(bool init)
{
#ifdef USE_MUI
if(init)
{
currIteration_ = 1;
}

dsmcParcel* parcel = NULL;

// Iterate through all sending interfaces for this controller
Expand Down Expand Up @@ -829,11 +824,6 @@ void dsmcMdCoupling::sendCoupledRegion(bool init)
sendInterfaces_[iface]->commit(currIteration_);
}
}

if(init)
{
currIteration_ = 0;
}
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,18 +579,6 @@ void polyControllers::initialConfig()
couplingControllers_[cC]->initialConfiguration(1);
}

//- Wait here until other side has finished sending initialisation values (blocking)
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->barrier(static_cast<label>(1));
}

//- Forget initial configuration time frame and reset log to -inf
forAll(couplingControllers_, cC)
{
couplingControllers_[cC]->forget(true);
}

//- Run initial configuration stage 2 (blocking)
forAll(couplingControllers_, cC)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ bool mdDsmcCoupling::initialConfiguration(label stage)

forAll(sendInterfaces_, iface)
{
sendInterfaces_[iface]->commit(static_cast<label>(1));
sendInterfaces_[iface]->commit(static_cast<label>(-1));
interfaceCommits.append(sendInterfaceNames_[iface]);
}

Expand All @@ -663,7 +663,7 @@ bool mdDsmcCoupling::initialConfiguration(label stage)
label index = findIndex(interfaceCommits, recvInterfaceNames_[iface]);
if(index == -1)
{
recvInterfaces_[iface]->commit(static_cast<label>(1));
recvInterfaces_[iface]->commit(static_cast<label>(-1));
}
}
#endif
Expand Down Expand Up @@ -719,11 +719,6 @@ bool mdDsmcCoupling::receiveCoupledRegion(bool init)
{
bool molChanged = false;
#ifdef USE_MUI
if(init)
{
currIteration_ = 1;
}

if(receivingRegion_)
{
label molCount = 0;
Expand Down Expand Up @@ -1030,8 +1025,6 @@ bool mdDsmcCoupling::receiveCoupledRegion(bool init)
recvInterfaces_[iface]->commit(currIteration_);
}
}

currIteration_ = 0;
}
#endif
return molChanged;
Expand Down

0 comments on commit 9b8a299

Please sign in to comment.