diff --git a/src/dynamicMesh/topoChangerFvMesh/linearValveFvMesh/linearValveFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/linearValveFvMesh/linearValveFvMesh.C index fc1d48b96..c3ae1e99a 100644 --- a/src/dynamicMesh/topoChangerFvMesh/linearValveFvMesh/linearValveFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/linearValveFvMesh/linearValveFvMesh.C @@ -363,26 +363,52 @@ bool Foam::linearValveFvMesh::update() Info << "Moving points post slider attach" << endl; - if (topoChangeMap3->morphing()) + bool localMorphing3 = topoChangeMap3->morphing(); + bool globalMorphing3 = localMorphing3; + + reduce(globalMorphing3, orOp()); + + if (globalMorphing3) { - msPtr_->updateMesh(topoChangeMap3()); - - if (debug) - { - Info << "Moving points post slider attach" << endl; - } - pointField newPoints = allPoints(); - pointField mappedOldPointsNew(newPoints.size()); - mappedOldPointsNew.map(oldPointsNew, topoChangeMap3->pointMap()); + if (localMorphing3) + { + msPtr_->updateMesh(topoChangeMap3()); - // Solve the correct mesh motion to make sure motion fluxes - // are solved for and not mapped - movePoints(mappedOldPointsNew); - resetMotion(); - setV0(); - movePoints(newPoints); + pointField mappedOldPointsNew(newPoints.size()); + + mappedOldPointsNew.map + ( + oldPointsNew, + topoChangeMap3->pointMap() + ); + + // Solve the correct mesh motion to make sure motion fluxes + // are solved for and not mapped + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(mappedOldPointsNew); + + resetMotion(); + setV0(); + + fvMesh::movePoints(newPoints); + } + else + { + // No local topological change. Execute double motion for + // sync with topological changes + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(oldPointsNew); + + resetMotion(); + setV0(); + + // Set new point motion + fvMesh::movePoints(newPoints); + } } } diff --git a/src/dynamicMesh/topoChangerFvMesh/linearValveLayersFvMesh/linearValveLayersFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/linearValveLayersFvMesh/linearValveLayersFvMesh.C index 96c68072d..77d65d147 100644 --- a/src/dynamicMesh/topoChangerFvMesh/linearValveLayersFvMesh/linearValveLayersFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/linearValveLayersFvMesh/linearValveLayersFvMesh.C @@ -532,12 +532,16 @@ bool Foam::linearValveLayersFvMesh::update() if (localMorphing2) { Info << "Topology change; executing pre-motion" << endl; - movePoints(topoChangeMap2->preMotionPoints()); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(topoChangeMap2->preMotionPoints()); newPoints = topoChangeMap2->preMotionPoints(); } else { - movePoints(newPoints); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(newPoints); } setV0(); @@ -589,7 +593,9 @@ bool Foam::linearValveLayersFvMesh::update() // Solve the correct mesh motion to make sure motion fluxes // are solved for and not mapped - movePoints(mappedOldPointsNew); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(mappedOldPointsNew); resetMotion(); setV0(); @@ -601,7 +607,9 @@ bool Foam::linearValveLayersFvMesh::update() { // No local topological change. Execute double motion for // sync with topological changes - movePoints(oldPointsNew); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(oldPointsNew); resetMotion(); setV0(); diff --git a/src/dynamicMesh/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C index fdfa15ef4..a720f80b2 100644 --- a/src/dynamicMesh/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C @@ -477,7 +477,9 @@ bool Foam::mixerFvMesh::update() pointField mappedOldPointsNew(allPoints().size()); mappedOldPointsNew.map(oldPointsNew, topoChangeMap->pointMap()); - movePoints(mappedOldPointsNew); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(mappedOldPointsNew); resetMotion(); setV0(); @@ -488,7 +490,10 @@ bool Foam::mixerFvMesh::update() else { pointField newPoints = allPoints(); - movePoints(oldPointsNew); + + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(oldPointsNew); resetMotion(); setV0(); diff --git a/src/dynamicMesh/topoChangerFvMesh/movingBodyTopoFvMesh/movingBodyTopoFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/movingBodyTopoFvMesh/movingBodyTopoFvMesh.C index 0dd388e74..18bbaa85c 100644 --- a/src/dynamicMesh/topoChangerFvMesh/movingBodyTopoFvMesh/movingBodyTopoFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/movingBodyTopoFvMesh/movingBodyTopoFvMesh.C @@ -276,7 +276,9 @@ bool Foam::movingBodyTopoFvMesh::update() // pointField mappedOldPointsNew(allPoints().size()); // mappedOldPointsNew.map(oldPointsNew, topoChangeMap->pointMap()); -// movePoints(mappedOldPointsNew); +// // Note: using setOldPoints instead of movePoints. +// // HJ, 23/Aug/2015 +// setOldPoints(mappedOldPointsNew); // resetMotion(); // setV0(); @@ -286,7 +288,9 @@ bool Foam::movingBodyTopoFvMesh::update() // else // { // // No change, use old points -// movePoints(oldPointsNew); +// // Note: using setOldPoints instead of movePoints. +// // HJ, 23/Aug/2015 +// setOldPoints(oldPointsNew); // resetMotion(); // setV0(); // } diff --git a/src/dynamicMesh/topoChangerFvMesh/multiMixerFvMesh/multiMixerFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/multiMixerFvMesh/multiMixerFvMesh.C index 3cc6f44ed..cd16d0d3c 100644 --- a/src/dynamicMesh/topoChangerFvMesh/multiMixerFvMesh/multiMixerFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/multiMixerFvMesh/multiMixerFvMesh.C @@ -284,7 +284,10 @@ bool Foam::multiMixerFvMesh::update() pointField mappedOldPointsNew(allPoints().size()); mappedOldPointsNew.map(oldPointsNew, topoChangeMap->pointMap()); - movePoints(mappedOldPointsNew); + // Note: using setOldPoints instead of movePoints. + // HJ, 23/Aug/2015 + setOldPoints(mappedOldPointsNew); + resetMotion(); setV0(); diff --git a/src/dynamicMesh/topoChangerFvMesh/multiTopoBodyFvMesh/multiTopoBodyFvMesh.C b/src/dynamicMesh/topoChangerFvMesh/multiTopoBodyFvMesh/multiTopoBodyFvMesh.C index c3ac7ae81..f931abf6f 100644 --- a/src/dynamicMesh/topoChangerFvMesh/multiTopoBodyFvMesh/multiTopoBodyFvMesh.C +++ b/src/dynamicMesh/topoChangerFvMesh/multiTopoBodyFvMesh/multiTopoBodyFvMesh.C @@ -236,7 +236,9 @@ bool Foam::multiTopoBodyFvMesh::update() // pointField mappedOldPointsNew(allPoints().size()); // mappedOldPointsNew.map(oldPointsNew, topoChangeMap->pointMap()); -// movePoints(mappedOldPointsNew); +// // Note: using setOldPoints instead of movePoints. +// // HJ, 23/Aug/2015 +// setOldPoints(mappedOldPointsNew); // resetMotion(); // setV0();