Commit 483c4502 authored by Franjo's avatar Franjo
Browse files

Merge branch 'defect-MPICrashAdditionalOctreeLayers' into development

parents 9943ea6e 74f2447b
...@@ -523,16 +523,23 @@ inline Istream& operator>> ...@@ -523,16 +523,23 @@ inline Istream& operator>>
meshOctreeCubeCoordinates& cc meshOctreeCubeCoordinates& cc
) )
{ {
// Read beginning of meshOctreeCubeCoordinates //- Read beginning of meshOctreeCubeCoordinates
is.readBegin("meshOctreeCubeCoordinates"); is.readBegin("meshOctreeCubeCoordinates");
//- read the level in the octree structure
label l; label l;
is >> l; is >> l;
cc.level_ = l; cc.level_ = l;
//- read x, y and z coordinates
is.readBegin("meshOctreeCubeCoordinates");
is >> cc.posX_; is >> cc.posX_;
is >> cc.posY_; is >> cc.posY_;
is >> cc.posZ_; is >> cc.posZ_;
is.readEnd("meshOctreeCubeCoordinates");
// Read end of meshOctreeCubeCoordinates // Read end of meshOctreeCubeCoordinates
is.readEnd("meshOctreeCubeCoordinates"); is.readEnd("meshOctreeCubeCoordinates");
...@@ -551,10 +558,15 @@ inline Ostream& operator<< ...@@ -551,10 +558,15 @@ inline Ostream& operator<<
os << token::BEGIN_LIST; os << token::BEGIN_LIST;
os << label(cc.level_) << token::SPACE; os << label(cc.level_) << token::SPACE;
os << token::BEGIN_LIST;
os << cc.posX_ << token::SPACE; os << cc.posX_ << token::SPACE;
os << cc.posY_ << token::SPACE; os << cc.posY_ << token::SPACE;
os << cc.posZ_ << token::END_LIST; os << cc.posZ_ << token::END_LIST;
os << token::END_LIST;
// Check state of Ostream // Check state of Ostream
os.check("operator<<(Ostream&, const meshOctreeCubeCoordinates"); os.check("operator<<(Ostream&, const meshOctreeCubeCoordinates");
......
...@@ -26,7 +26,7 @@ Description ...@@ -26,7 +26,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "meshOctreeModifier.H" #include "meshOctreeModifier.H"
#include "helperFunctionsPar.H" #include "helperFunctions.H"
#include "triSurf.H" #include "triSurf.H"
#include <map> #include <map>
...@@ -203,8 +203,6 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors() ...@@ -203,8 +203,6 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
return; return;
const LongList<meshOctreeCube*>& leaves = octree_.leaves_; const LongList<meshOctreeCube*>& leaves = octree_.leaves_;
const labelList& neiProcs = octree_.neiProcs_;
const List<Pair<meshOctreeCubeCoordinates> >& neiRange = octree_.neiRange_;
forAll(leaves, leafI) forAll(leaves, leafI)
if( leaves[leafI]->procNo() != Pstream::myProcNo() ) if( leaves[leafI]->procNo() != Pstream::myProcNo() )
...@@ -212,6 +210,9 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors() ...@@ -212,6 +210,9 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
Info << "Adding an additional layer of cells" << endl; Info << "Adding an additional layer of cells" << endl;
const labelList& neiProcs = octree_.neiProcs_;
const List<Pair<meshOctreeCubeCoordinates> >& neiRange = octree_.neiRange_;
meshOctreeCubeCoordinates minCoord, maxCoord; meshOctreeCubeCoordinates minCoord, maxCoord;
std::map<label, LongList<meshOctreeCubeBasic> > toProcs; std::map<label, LongList<meshOctreeCubeBasic> > toProcs;
forAll(neiProcs, i) forAll(neiProcs, i)
...@@ -227,11 +228,14 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors() ...@@ -227,11 +228,14 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
forAll(neiProcs, procI) forAll(neiProcs, procI)
{ {
if( if
(
(maxCoord >= neiRange[procI].first()) && (maxCoord >= neiRange[procI].first()) &&
(minCoord <= neiRange[procI].second()) (minCoord <= neiRange[procI].second())
) )
{
toProcs[neiProcs[procI]].append(*leaves[leafI]); toProcs[neiProcs[procI]].append(*leaves[leafI]);
}
} }
} }
...@@ -240,6 +244,9 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors() ...@@ -240,6 +244,9 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
{ {
if( i == Pstream::myProcNo() ) if( i == Pstream::myProcNo() )
{ {
Pout << "Neighbour processors " << neiProcs << endl;
Pout << "Neighbour range " << neiRange << endl;
std::map<label, LongList<meshOctreeCubeBasic> >::iterator it; std::map<label, LongList<meshOctreeCubeBasic> >::iterator it;
for(it=toProcs.begin();it!=toProcs.end();++it) for(it=toProcs.begin();it!=toProcs.end();++it)
{ {
......
...@@ -489,8 +489,12 @@ void meshOctreeModifier::refineSelectedBoxes ...@@ -489,8 +489,12 @@ void meshOctreeModifier::refineSelectedBoxes
} }
} }
//- update the list of leaves
createListOfLeaves(); createListOfLeaves();
//- update the communication pattern
updateCommunicationPattern();
# ifdef OCTREETiming # ifdef OCTREETiming
Info << "Time for actual refinement " << (omp_get_wtime()-regTime) << endl; Info << "Time for actual refinement " << (omp_get_wtime()-regTime) << endl;
# endif # endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment