diff --git a/src/ASM/ASMs2D.C b/src/ASM/ASMs2D.C index c238d12b..31cea23e 100644 --- a/src/ASM/ASMs2D.C +++ b/src/ASM/ASMs2D.C @@ -3279,29 +3279,10 @@ void ASMs2D::generateThreadGroupsFromElms (const IntVec& elms) bool ASMs2D::addRigidCpl (int lindx, int ldim, int basis, int& gMaster, const Vec3& Xmaster, bool extraPt) { - if (ldim == 1) - { - ThreadGroups::StripDirection useDir = ThreadGroups::ANY; - switch (lindx) { - case 1: - case 2: - useDir = ThreadGroups::U; - break; - case 3: - case 4: - useDir = ThreadGroups::V; - break; - } - - if (threadGroups.stripDir == ThreadGroups::ANY) - threadGroups.stripDir = useDir; - else if (threadGroups.stripDir != useDir) - { - threadGroups.stripDir = ThreadGroups::NONE; - IFEM::cout <<" ** ASMs2D::addRigidCpl: Conflicting strip directions." - << std::endl; - } - } + if (threadGroups.stripDir != ThreadGroups::NONE) + IFEM::cout <<" ** ASMs2D::addRigidCpl: Multi-threading deactivated" + <<" for Patch "<< idx+1 << std::endl; + threadGroups.stripDir = ThreadGroups::NONE; return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt); } diff --git a/src/ASM/ASMs2DC1.C b/src/ASM/ASMs2DC1.C index d986a77e..3ef26b74 100644 --- a/src/ASM/ASMs2DC1.C +++ b/src/ASM/ASMs2DC1.C @@ -20,6 +20,7 @@ #include "Vec3Oper.h" #include "Vec3.h" #include "MPC.h" +#include "IFEM.h" //! \brief Solves A1j*xi*eta + A2j*ci + A3j*eta = A4j, j=1,2 for xi,eta. extern "C" void dslbln_(const int& ipsw, const int& iwr, const double& eps, @@ -318,6 +319,11 @@ bool ASMs2DC1::addRigidCpl (int lindx, int ldim, int basis, } } + if (threadGroups.stripDir != ThreadGroups::NONE) + IFEM::cout <<" ** ASMs2DC1::addRigidCpl: Multi-threading deactivated" + <<" for Patch "<< idx+1 << std::endl; + threadGroups.stripDir = ThreadGroups::NONE; + return extraPt; } diff --git a/src/ASM/ASMs3D.C b/src/ASM/ASMs3D.C index 1b2f3c45..aed1ee23 100644 --- a/src/ASM/ASMs3D.C +++ b/src/ASM/ASMs3D.C @@ -3505,7 +3505,13 @@ void ASMs3D::generateThreadGroups (size_t strip1, size_t strip2, size_t strip3, void ASMs3D::generateThreadGroups (char lIndex, bool silence, bool) { - if (threadGroupsFace.find(lIndex) != threadGroupsFace.end()) return; + std::map::iterator tit = threadGroupsFace.find(lIndex); + if (tit != threadGroupsFace.end()) + { + if (tit->second.stripDir == ThreadGroups::NONE) + tit->second.oneGroup(nel); + return; + } const int p1 = svol->order(0) - 1; const int p2 = svol->order(1) - 1; @@ -3820,33 +3826,11 @@ void ASMs3D::generateThreadGroupsFromElms (const IntVec& elms) bool ASMs3D::addRigidCpl (int lindx, int ldim, int basis, int& gMaster, const Vec3& Xmaster, bool extraPt) { - if (ldim == 2) - { - ThreadGroups::StripDirection useDir = ThreadGroups::ANY; - switch (lindx) { - case 1: - case 2: - useDir = ThreadGroups::U; - break; - case 3: - case 4: - useDir = ThreadGroups::V; - break; - case 5: - case 6: - useDir = ThreadGroups::W; - break; - } - - if (threadGroupsVol.stripDir == ThreadGroups::ANY) - threadGroupsVol.stripDir = useDir; - else if (threadGroupsVol.stripDir != useDir) - { - threadGroupsVol.stripDir = ThreadGroups::NONE; - IFEM::cout <<" ** ASMs3D::addRigidCpl: Conflicting strip directions." - << std::endl; - } - } + if (threadGroupsVol.stripDir != ThreadGroups::NONE) + IFEM::cout <<" ** ASMs3D::addRigidCpl: Multi-threading deactivated" + <<" for Patch "<< idx+1 << std::endl; + threadGroupsVol.stripDir = ThreadGroups::NONE; + threadGroupsFace[lindx].stripDir = ThreadGroups::NONE; return this->ASMstruct::addRigidCpl(lindx,ldim,basis,gMaster,Xmaster,extraPt); }