40 namespace NekMeshUtils
65 : m_id(i), m_parent(p)
72 m_delta = pair<bool, NekDouble>(
false, 0.0);
74 NekDouble minDif = numeric_limits<double>::max();
80 m_neigbours[
eForward] = vector<OctantSharedPtr>();
81 m_neigbours[
eBack] = vector<OctantSharedPtr>();
82 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
83 m_neigbours[
eRight] = vector<OctantSharedPtr>();
114 vector<SPBaseSharedPtr> SourcePointList =
m_parent->GetSPList();
121 for (
int i = 0; i < SourcePointList.size(); i++)
130 if (SourcePointList[i]->HasDelta())
132 if (SourcePointList[i]->
GetDelta() > maxDif)
134 maxDif = SourcePointList[i]->GetDelta();
137 if (SourcePointList[i]->
GetDelta() < minDif)
139 minDif = SourcePointList[i]->GetDelta();
143 if (SourcePointList[i]->Isboundary())
154 if (maxDif / minDif > 1.5)
180 const vector<SPBaseSharedPtr> &splist)
185 m_neigbours[
eForward] = vector<OctantSharedPtr>();
186 m_neigbours[
eBack] = vector<OctantSharedPtr>();
187 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
188 m_neigbours[
eRight] = vector<OctantSharedPtr>();
194 m_delta = pair<bool, NekDouble>(
false, 0.0);
221 for (
int i = 0; i < 6; i++)
225 for (
int j = 0; j < os.size(); j++)
233 for (
int i = 0; i < 8; i++)
248 if (i == 0 || i == 2)
268 if (i == 4 || i == 6)
278 children[i] = std::shared_ptr<Octant>(
new Octant(numoct++, p, dir));
285 children[0]->SetNeigbour(children[1],
eRight);
286 children[0]->SetNeigbour(children[4],
eBack);
287 children[0]->SetNeigbour(children[2],
eDown);
289 children[1]->SetNeigbour(children[0],
eLeft);
290 children[1]->SetNeigbour(children[5],
eBack);
291 children[1]->SetNeigbour(children[3],
eDown);
293 children[2]->SetNeigbour(children[3],
eRight);
294 children[2]->SetNeigbour(children[6],
eBack);
295 children[2]->SetNeigbour(children[0],
eUp);
297 children[3]->SetNeigbour(children[2],
eLeft);
298 children[3]->SetNeigbour(children[7],
eBack);
299 children[3]->SetNeigbour(children[1],
eUp);
301 children[4]->SetNeigbour(children[5],
eRight);
302 children[4]->SetNeigbour(children[0],
eForward);
303 children[4]->SetNeigbour(children[6],
eDown);
305 children[5]->SetNeigbour(children[4],
eLeft);
306 children[5]->SetNeigbour(children[1],
eForward);
307 children[5]->SetNeigbour(children[7],
eDown);
309 children[6]->SetNeigbour(children[7],
eRight);
310 children[6]->SetNeigbour(children[2],
eForward);
311 children[6]->SetNeigbour(children[4],
eUp);
313 children[7]->SetNeigbour(children[6],
eLeft);
314 children[7]->SetNeigbour(children[3],
eForward);
315 children[7]->SetNeigbour(children[5],
eUp);
323 children[1]->SetNeigbour(
m_neigbours[eUp][0], eUp);
324 children[4]->SetNeigbour(
m_neigbours[eUp][0], eUp);
325 children[5]->SetNeigbour(
m_neigbours[eUp][0], eUp);
334 children[1]->SetNeigbour(
m_neigbours[eUp][1], eUp);
335 children[4]->SetNeigbour(
m_neigbours[eUp][2], eUp);
336 children[5]->SetNeigbour(
m_neigbours[eUp][3], eUp);
352 children[3]->SetNeigbour(
m_neigbours[eDown][0], eDown);
353 children[6]->SetNeigbour(
m_neigbours[eDown][0], eDown);
354 children[7]->SetNeigbour(
m_neigbours[eDown][0], eDown);
363 children[3]->SetNeigbour(
m_neigbours[eDown][1], eDown);
364 children[6]->SetNeigbour(
m_neigbours[eDown][2], eDown);
365 children[7]->SetNeigbour(
m_neigbours[eDown][3], eDown);
381 children[1]->SetNeigbour(
m_neigbours[eForward][0], eForward);
382 children[2]->SetNeigbour(
m_neigbours[eForward][0], eForward);
383 children[3]->SetNeigbour(
m_neigbours[eForward][0], eForward);
392 children[1]->SetNeigbour(
m_neigbours[eForward][1], eForward);
393 children[2]->SetNeigbour(
m_neigbours[eForward][2], eForward);
394 children[3]->SetNeigbour(
m_neigbours[eForward][3], eForward);
410 children[5]->SetNeigbour(
m_neigbours[eBack][0], eBack);
411 children[6]->SetNeigbour(
m_neigbours[eBack][0], eBack);
412 children[7]->SetNeigbour(
m_neigbours[eBack][0], eBack);
421 children[5]->SetNeigbour(
m_neigbours[eBack][1], eBack);
422 children[6]->SetNeigbour(
m_neigbours[eBack][2], eBack);
423 children[7]->SetNeigbour(
m_neigbours[eBack][3], eBack);
439 children[2]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
440 children[4]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
441 children[6]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
450 children[2]->SetNeigbour(
m_neigbours[eLeft][1], eLeft);
451 children[4]->SetNeigbour(
m_neigbours[eLeft][2], eLeft);
452 children[6]->SetNeigbour(
m_neigbours[eLeft][3], eLeft);
469 children[3]->SetNeigbour(
m_neigbours[eRight][0], eRight);
470 children[5]->SetNeigbour(
m_neigbours[eRight][0], eRight);
471 children[7]->SetNeigbour(
m_neigbours[eRight][0], eRight);
480 children[3]->SetNeigbour(
m_neigbours[eRight][1], eRight);
481 children[5]->SetNeigbour(
m_neigbours[eRight][2], eRight);
482 children[7]->SetNeigbour(
m_neigbours[eRight][3], eRight);
500 for (
int i = 0; i < tmp.size(); i++)
502 if (tmp[i]->
GetId() != id)
511 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
std::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