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>>
meshOctreeCubeCoordinates& cc
)
{
// Read beginning of meshOctreeCubeCoordinates
//- Read beginning of meshOctreeCubeCoordinates
is.readBegin("meshOctreeCubeCoordinates");
//- read the level in the octree structure
label l;
is >> l;
cc.level_ = l;
//- read x, y and z coordinates
is.readBegin("meshOctreeCubeCoordinates");
is >> cc.posX_;
is >> cc.posY_;
is >> cc.posZ_;
is.readEnd("meshOctreeCubeCoordinates");
// Read end of meshOctreeCubeCoordinates
is.readEnd("meshOctreeCubeCoordinates");
......@@ -551,10 +558,15 @@ inline Ostream& operator<<
os << token::BEGIN_LIST;
os << label(cc.level_) << token::SPACE;
os << token::BEGIN_LIST;
os << cc.posX_ << token::SPACE;
os << cc.posY_ << token::SPACE;
os << cc.posZ_ << token::END_LIST;
os << token::END_LIST;
// Check state of Ostream
os.check("operator<<(Ostream&, const meshOctreeCubeCoordinates");
......
......@@ -26,7 +26,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "meshOctreeModifier.H"
#include "helperFunctionsPar.H"
#include "helperFunctions.H"
#include "triSurf.H"
#include <map>
......@@ -203,8 +203,6 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
return;
const LongList<meshOctreeCube*>& leaves = octree_.leaves_;
const labelList& neiProcs = octree_.neiProcs_;
const List<Pair<meshOctreeCubeCoordinates> >& neiRange = octree_.neiRange_;
forAll(leaves, leafI)
if( leaves[leafI]->procNo() != Pstream::myProcNo() )
......@@ -212,6 +210,9 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
Info << "Adding an additional layer of cells" << endl;
const labelList& neiProcs = octree_.neiProcs_;
const List<Pair<meshOctreeCubeCoordinates> >& neiRange = octree_.neiRange_;
meshOctreeCubeCoordinates minCoord, maxCoord;
std::map<label, LongList<meshOctreeCubeBasic> > toProcs;
forAll(neiProcs, i)
......@@ -227,19 +228,25 @@ void meshOctreeModifier::addLayerFromNeighbouringProcessors()
forAll(neiProcs, procI)
{
if(
if
(
(maxCoord >= neiRange[procI].first()) &&
(minCoord <= neiRange[procI].second())
)
{
toProcs[neiProcs[procI]].append(*leaves[leafI]);
}
}
}
# ifdef OCTREE_DEBUG
for(label i=0;i<Pstream::nProcs();++i)
{
if( i == Pstream::myProcNo() )
{
Pout << "Neighbour processors " << neiProcs << endl;
Pout << "Neighbour range " << neiRange << endl;
std::map<label, LongList<meshOctreeCubeBasic> >::iterator it;
for(it=toProcs.begin();it!=toProcs.end();++it)
{
......
......@@ -489,8 +489,12 @@ void meshOctreeModifier::refineSelectedBoxes
}
}
//- update the list of leaves
createListOfLeaves();
//- update the communication pattern
updateCommunicationPattern();
# ifdef OCTREETiming
Info << "Time for actual refinement " << (omp_get_wtime()-regTime) << endl;
# 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