41 namespace NekMeshUtils
66 : m_id(i), m_parent(p)
73 m_delta = pair<bool, NekDouble>(
false, 0.0);
75 NekDouble minDif = numeric_limits<double>::max();
81 m_neigbours[
eForward] = vector<OctantSharedPtr>();
82 m_neigbours[
eBack] = vector<OctantSharedPtr>();
83 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
84 m_neigbours[
eRight] = vector<OctantSharedPtr>();
115 vector<SPBaseSharedPtr> SourcePointList =
m_parent->GetSPList();
122 for (
int i = 0; i < SourcePointList.size(); i++)
131 if (SourcePointList[i]->HasDelta())
133 if (SourcePointList[i]->
GetDelta() > maxDif)
135 maxDif = SourcePointList[i]->GetDelta();
138 if (SourcePointList[i]->
GetDelta() < minDif)
140 minDif = SourcePointList[i]->GetDelta();
144 if (SourcePointList[i]->Isboundary())
155 if (maxDif / minDif > 1.5)
181 const vector<SPBaseSharedPtr> &splist)
186 m_neigbours[
eForward] = vector<OctantSharedPtr>();
187 m_neigbours[
eBack] = vector<OctantSharedPtr>();
188 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
189 m_neigbours[
eRight] = vector<OctantSharedPtr>();
195 m_delta = pair<bool, NekDouble>(
false, 0.0);
222 for (
int i = 0; i < 6; i++)
226 for (
int j = 0; j < os.size(); j++)
234 for (
int i = 0; i < 8; i++)
249 if (i == 0 || i == 2)
269 if (i == 4 || i == 6)
279 children[i] = boost::shared_ptr<Octant>(
new Octant(numoct++, p, dir));
286 children[0]->SetNeigbour(children[1],
eRight);
287 children[0]->SetNeigbour(children[4],
eBack);
288 children[0]->SetNeigbour(children[2],
eDown);
290 children[1]->SetNeigbour(children[0],
eLeft);
291 children[1]->SetNeigbour(children[5],
eBack);
292 children[1]->SetNeigbour(children[3],
eDown);
294 children[2]->SetNeigbour(children[3],
eRight);
295 children[2]->SetNeigbour(children[6],
eBack);
296 children[2]->SetNeigbour(children[0],
eUp);
298 children[3]->SetNeigbour(children[2],
eLeft);
299 children[3]->SetNeigbour(children[7],
eBack);
300 children[3]->SetNeigbour(children[1],
eUp);
302 children[4]->SetNeigbour(children[5],
eRight);
303 children[4]->SetNeigbour(children[0],
eForward);
304 children[4]->SetNeigbour(children[6],
eDown);
306 children[5]->SetNeigbour(children[4],
eLeft);
307 children[5]->SetNeigbour(children[1],
eForward);
308 children[5]->SetNeigbour(children[7],
eDown);
310 children[6]->SetNeigbour(children[7],
eRight);
311 children[6]->SetNeigbour(children[2],
eForward);
312 children[6]->SetNeigbour(children[4],
eUp);
314 children[7]->SetNeigbour(children[6],
eLeft);
315 children[7]->SetNeigbour(children[3],
eForward);
316 children[7]->SetNeigbour(children[5],
eUp);
324 children[1]->SetNeigbour(
m_neigbours[eUp][0], eUp);
325 children[4]->SetNeigbour(
m_neigbours[eUp][0], eUp);
326 children[5]->SetNeigbour(
m_neigbours[eUp][0], eUp);
335 children[1]->SetNeigbour(
m_neigbours[eUp][1], eUp);
336 children[4]->SetNeigbour(
m_neigbours[eUp][2], eUp);
337 children[5]->SetNeigbour(
m_neigbours[eUp][3], eUp);
353 children[3]->SetNeigbour(
m_neigbours[eDown][0], eDown);
354 children[6]->SetNeigbour(
m_neigbours[eDown][0], eDown);
355 children[7]->SetNeigbour(
m_neigbours[eDown][0], eDown);
364 children[3]->SetNeigbour(
m_neigbours[eDown][1], eDown);
365 children[6]->SetNeigbour(
m_neigbours[eDown][2], eDown);
366 children[7]->SetNeigbour(
m_neigbours[eDown][3], eDown);
382 children[1]->SetNeigbour(
m_neigbours[eForward][0], eForward);
383 children[2]->SetNeigbour(
m_neigbours[eForward][0], eForward);
384 children[3]->SetNeigbour(
m_neigbours[eForward][0], eForward);
393 children[1]->SetNeigbour(
m_neigbours[eForward][1], eForward);
394 children[2]->SetNeigbour(
m_neigbours[eForward][2], eForward);
395 children[3]->SetNeigbour(
m_neigbours[eForward][3], eForward);
411 children[5]->SetNeigbour(
m_neigbours[eBack][0], eBack);
412 children[6]->SetNeigbour(
m_neigbours[eBack][0], eBack);
413 children[7]->SetNeigbour(
m_neigbours[eBack][0], eBack);
422 children[5]->SetNeigbour(
m_neigbours[eBack][1], eBack);
423 children[6]->SetNeigbour(
m_neigbours[eBack][2], eBack);
424 children[7]->SetNeigbour(
m_neigbours[eBack][3], eBack);
440 children[2]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
441 children[4]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
442 children[6]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
451 children[2]->SetNeigbour(
m_neigbours[eLeft][1], eLeft);
452 children[4]->SetNeigbour(
m_neigbours[eLeft][2], eLeft);
453 children[6]->SetNeigbour(
m_neigbours[eLeft][3], eLeft);
470 children[3]->SetNeigbour(
m_neigbours[eRight][0], eRight);
471 children[5]->SetNeigbour(
m_neigbours[eRight][0], eRight);
472 children[7]->SetNeigbour(
m_neigbours[eRight][0], eRight);
481 children[3]->SetNeigbour(
m_neigbours[eRight][1], eRight);
482 children[5]->SetNeigbour(
m_neigbours[eRight][2], eRight);
483 children[7]->SetNeigbour(
m_neigbours[eRight][3], eRight);
501 for (
int i = 0; i < tmp.size(); i++)
503 if (tmp[i]->
GetId() != id)
512 if (p1->GetId() == p2->GetId())
NekDouble GetDelta()
Get value of delta.
#define ASSERTL0(condition, msg)
std::vector< SPBaseSharedPtr > m_localSPList
curvature sampling point list
OctantLocation m_location
idenify if delta has ben set
void RemoveNeigbour(int id, OctantFace f)
Remove a neigbour from this octants list.
bool m_leaf
leaf identifer
OctantSharedPtr m_parent
parent id
void SetDelta(NekDouble d)
Set the value for delta for this octant.
NekDouble m_hd
half dimension of the octant
NekDouble DX()
Get the octants half dimension.
Octant(int i, OctantSharedPtr p, Array< OneD, OctantFace > dir)
Defualt constructor.
bool operator==(ElmtConfig const &c1, ElmtConfig const &c2)
Compares two element config structs.
void Subdivide(OctantSharedPtr p, int &numoct)
Subdivide the octant.
int m_numValidPoints
number of valid cp points
int GetId()
Get the Id of the octant.
int NumValidCurvePoint()
Get the number of valid cp points in the octants list.
OctantFace GetReverseFace(OctantFace f)
Array< OneD, NekDouble > m_loc
x,y,z location of the octant
boost::shared_ptr< Octant > OctantSharedPtr
OctantFace
enumeration of the 6 faces of a cube/octant
bool m_needToDivide
idenify if division is needed
void SetChildren(Array< OneD, OctantSharedPtr > c)
Set the children of this octant.
std::map< OctantFace, std::vector< OctantSharedPtr > > m_neigbours
list of neighbours
std::pair< bool, NekDouble > m_delta
mesh sizing parameter