Commit 98309936 authored by Thomas's avatar Thomas

CellMarkerStore destructor + particleCell3D update

parent 04f8ebe8
......@@ -21,6 +21,12 @@ namespace Algo
namespace MovingObjects
{
enum {
NO_CROSS,
CROSS_FACE,
CROSS_OTHER
};
template <typename PFP>
class ParticleCell3D : public ParticleBase
{
......@@ -96,6 +102,8 @@ public :
void move(const VEC3& newCurrent)
{
crossCell = NO_CROSS ;
if(!Geom::arePointsEquals(newCurrent, m_position))
{
switch(state) {
......
......@@ -242,13 +242,19 @@ Dart ParticleCell3D<PFP>::nextFaceNotMarked(Dart d,CellMarker& mark)
if(!mark.isMarked(d1))
{
break;
for (std::list<Dart>::iterator it=darts_list.begin(); it!=darts_list.end(); ++it)
{
markCC.unmark(*it);
}
return d1;
}
// add phi1, phi2 and phi3 successor if they are not yet marked
Dart d2 = m.phi1(d1);
Dart d3 = m.phi2(d1);
Dart d4 = m.phi_1(d1);
if (!markCC.isMarked(d2))
{
darts_list.push_back(d2);
......@@ -272,10 +278,10 @@ Dart ParticleCell3D<PFP>::nextFaceNotMarked(Dart d,CellMarker& mark)
markCC.unmark(*it);
}
if(beg==darts_list.end())
// if(beg==darts_list.end())
return d;
return d1;
// return d1;
}
template <typename PFP>
......@@ -318,6 +324,8 @@ void ParticleCell3D<PFP>::vertexState(const VEC3& current)
std::cout << "vertexState" << d << std::endl;
#endif
crossCell = CROSS_OTHER ;
VEC3 som = position[d];
if(Geom::arePointsEquals(current, m_position)) {
......@@ -429,6 +437,8 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
#endif
crossCell = CROSS_OTHER ;
bool onEdge=false;
Dart dd=d;
Geom::Orientation3D wsof = whichSideOfFace(current,m.alpha2(d));
......@@ -441,7 +451,7 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
if(d==dd)
onEdge = true;
if(wsof==0) {
if(wsof==Geom::ON) {
switch(whichSideOfEdge(current,d)) {
case Geom::ON :
onEdge=true;
......@@ -459,7 +469,7 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
else {
wsof = whichSideOfFace(current,d);
while(wsof==1 && dd != m.alpha_2(d)) {
while(wsof==Geom::UNDER && dd != m.alpha_2(d)) {
d = m.alpha_2(d);
wsof = whichSideOfFace(current,d);
}
......@@ -510,6 +520,7 @@ void ParticleCell3D<PFP>::edgeState(const VEC3& current)
std::cout << "faceState" << d << std::endl;
#endif
crossCell = CROSS_FACE ;
if(wsof==Geom::ON)
wsof = whichSideOfFace(current,d);
......
......@@ -74,7 +74,7 @@ public:
virtual ~CellMarker()
{
unmarkAll();
m_map.releaseMarker(m_marker,m_thread);
m_map.releaseMarker(m_marker, m_thread);
}
protected:
......@@ -183,15 +183,20 @@ public:
CellMarkerStore(AttribMap& map, unsigned int cell): CellMarker(map, cell)
{}
CellMarkerStore(AttribMap& map, unsigned int cell, unsigned int thread): CellMarker(map, cell,thread)
CellMarkerStore(AttribMap& map, unsigned int cell, unsigned int thread): CellMarker(map, cell, thread)
{}
~CellMarkerStore()
{
unmarkAll();
m_map.releaseMarker(m_marker, m_thread);
}
protected:
// protected copy constructor to forbid its usage
CellMarkerStore(const CellMarkerStore& cm) : CellMarker(cm)
{}
public:
/**
* mark the cell of dart
......
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