Commit 36fcd1cd authored by mattijs's avatar mattijs
Browse files

binary read/write

parent 72325bfc
...@@ -88,7 +88,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment ...@@ -88,7 +88,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment
const point& start, const point& start,
const point& end, const point& end,
DynamicList<Pair<point> >& allSegments, DynamicList<segment>& allSegments,
DynamicList<label>& allSegmentMap, DynamicList<label>& allSegmentMap,
List<DynamicList<label> >& sendMap List<DynamicList<label> >& sendMap
) const ) const
...@@ -117,7 +117,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment ...@@ -117,7 +117,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment
// << start << end << " on proc:" << procI << endl; // << start << end << " on proc:" << procI << endl;
sendMap[procI].append(allSegments.size()); sendMap[procI].append(allSegments.size());
allSegmentMap.append(segmentI); allSegmentMap.append(segmentI);
allSegments.append(Pair<point>(start, end)); allSegments.append(segment(start, end));
return; return;
} }
} }
...@@ -148,7 +148,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment ...@@ -148,7 +148,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment
// through proc. // through proc.
sendMap[procI].append(allSegments.size()); sendMap[procI].append(allSegments.size());
allSegmentMap.append(segmentI); allSegmentMap.append(segmentI);
allSegments.append(Pair<point>(start, clipPt0)); allSegments.append(segment(start, clipPt0));
} }
} }
else if (bb.contains(end)) else if (bb.contains(end))
...@@ -163,7 +163,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment ...@@ -163,7 +163,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment
// << " at " << clipPt0 << endl; // << " at " << clipPt0 << endl;
sendMap[procI].append(allSegments.size()); sendMap[procI].append(allSegments.size());
allSegmentMap.append(segmentI); allSegmentMap.append(segmentI);
allSegments.append(Pair<point>(clipPt0, end)); allSegments.append(segment(clipPt0, end));
} }
} }
else else
...@@ -184,7 +184,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment ...@@ -184,7 +184,7 @@ void Foam::distributedTriSurfaceMesh::splitSegment
// proc. // proc.
sendMap[procI].append(allSegments.size()); sendMap[procI].append(allSegments.size());
allSegmentMap.append(segmentI); allSegmentMap.append(segmentI);
allSegments.append(Pair<point>(clipPt0, clipPt1)); allSegments.append(segment(clipPt0, clipPt1));
} }
} }
} }
...@@ -199,7 +199,7 @@ Foam::distributedTriSurfaceMesh::constructSegments ...@@ -199,7 +199,7 @@ Foam::distributedTriSurfaceMesh::constructSegments
const pointField& start, const pointField& start,
const pointField& end, const pointField& end,
List<Pair<point> >& allSegments, List<segment>& allSegments,
labelList& allSegmentMap labelList& allSegmentMap
) const ) const
{ {
...@@ -214,7 +214,7 @@ Foam::distributedTriSurfaceMesh::constructSegments ...@@ -214,7 +214,7 @@ Foam::distributedTriSurfaceMesh::constructSegments
// in the correct bin. // in the correct bin.
// Segments to test // Segments to test
DynamicList<Pair<point> > dynAllSegments(start.size()); DynamicList<segment> dynAllSegments(start.size());
// Original index of segment // Original index of segment
DynamicList<label> dynAllSegmentMap(start.size()); DynamicList<label> dynAllSegmentMap(start.size());
// Per processor indices into allSegments to send // Per processor indices into allSegments to send
...@@ -364,7 +364,7 @@ void Foam::distributedTriSurfaceMesh::findLine ...@@ -364,7 +364,7 @@ void Foam::distributedTriSurfaceMesh::findLine
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Segments to test // Segments to test
List<Pair<point> > allSegments(start.size()); List<segment> allSegments(start.size());
// Original index of segment // Original index of segment
labelList allSegmentMap(start.size()); labelList allSegmentMap(start.size());
......
...@@ -48,6 +48,12 @@ namespace Foam ...@@ -48,6 +48,12 @@ namespace Foam
class mapDistribute; class mapDistribute;
// Typedefs
typedef Pair<point> segment;
template<>
inline bool contiguous<segment>() {return contiguous<point>();}
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class distributedTriSurfaceMesh Declaration Class distributedTriSurfaceMesh Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -101,7 +107,7 @@ private: ...@@ -101,7 +107,7 @@ private:
const point& start, const point& start,
const point& end, const point& end,
DynamicList<Pair<point> >&, DynamicList<segment>&,
DynamicList<label>&, DynamicList<label>&,
List<DynamicList<label> >& List<DynamicList<label> >&
) const; ) const;
...@@ -113,7 +119,7 @@ private: ...@@ -113,7 +119,7 @@ private:
const pointField& start, const pointField& start,
const pointField& end, const pointField& end,
List<Pair<point> >& allSegments, List<segment>& allSegments,
List<label>& allSegmentMap List<label>& allSegmentMap
) const; ) const;
......
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