41 namespace NekMeshUtils
64 : m_id(i), m_parent(p)
71 m_delta = pair<bool, NekDouble>(
false, 0.0);
73 NekDouble minDif = numeric_limits<double>::max();
79 m_neigbours[
eForward] = vector<OctantSharedPtr>();
80 m_neigbours[
eBack] = vector<OctantSharedPtr>();
81 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
82 m_neigbours[
eRight] = vector<OctantSharedPtr>();
113 vector<CurvaturePointSharedPtr> CurvaturePointList =
m_parent->GetCPList();
120 for (
int i = 0; i < CurvaturePointList.size(); i++)
129 if (CurvaturePointList[i]->IsValid())
131 if (CurvaturePointList[i]->
GetDelta() > maxDif)
133 maxDif = CurvaturePointList[i]->GetDelta();
136 if (CurvaturePointList[i]->
GetDelta() < minDif)
138 minDif = CurvaturePointList[i]->GetDelta();
142 if (CurvaturePointList[i]->Isboundary())
153 if (maxDif / minDif > 1.5)
178 const vector<CurvaturePointSharedPtr> &cplist)
183 m_neigbours[
eForward] = vector<OctantSharedPtr>();
184 m_neigbours[
eBack] = vector<OctantSharedPtr>();
185 m_neigbours[
eLeft] = vector<OctantSharedPtr>();
186 m_neigbours[
eRight] = vector<OctantSharedPtr>();
192 m_delta = pair<bool, NekDouble>(
false, 0.0);
219 for (
int i = 0; i < 6; i++)
223 for (
int j = 0; j < os.size(); j++)
231 for (
int i = 0; i < 8; i++)
246 if (i == 0 || i == 2)
266 if (i == 4 || i == 6)
276 children[i] = boost::shared_ptr<Octant>(
new Octant(numoct++, p, dir));
283 children[0]->SetNeigbour(children[1],
eRight);
284 children[0]->SetNeigbour(children[4],
eBack);
285 children[0]->SetNeigbour(children[2],
eDown);
287 children[1]->SetNeigbour(children[0],
eLeft);
288 children[1]->SetNeigbour(children[5],
eBack);
289 children[1]->SetNeigbour(children[3],
eDown);
291 children[2]->SetNeigbour(children[3],
eRight);
292 children[2]->SetNeigbour(children[6],
eBack);
293 children[2]->SetNeigbour(children[0],
eUp);
295 children[3]->SetNeigbour(children[2],
eLeft);
296 children[3]->SetNeigbour(children[7],
eBack);
297 children[3]->SetNeigbour(children[1],
eUp);
299 children[4]->SetNeigbour(children[5],
eRight);
300 children[4]->SetNeigbour(children[0],
eForward);
301 children[4]->SetNeigbour(children[6],
eDown);
303 children[5]->SetNeigbour(children[4],
eLeft);
304 children[5]->SetNeigbour(children[1],
eForward);
305 children[5]->SetNeigbour(children[7],
eDown);
307 children[6]->SetNeigbour(children[7],
eRight);
308 children[6]->SetNeigbour(children[2],
eForward);
309 children[6]->SetNeigbour(children[4],
eUp);
311 children[7]->SetNeigbour(children[6],
eLeft);
312 children[7]->SetNeigbour(children[3],
eForward);
313 children[7]->SetNeigbour(children[5],
eUp);
321 children[1]->SetNeigbour(
m_neigbours[eUp][0], eUp);
322 children[4]->SetNeigbour(
m_neigbours[eUp][0], eUp);
323 children[5]->SetNeigbour(
m_neigbours[eUp][0], eUp);
332 children[1]->SetNeigbour(
m_neigbours[eUp][1], eUp);
333 children[4]->SetNeigbour(
m_neigbours[eUp][2], eUp);
334 children[5]->SetNeigbour(
m_neigbours[eUp][3], eUp);
350 children[3]->SetNeigbour(
m_neigbours[eDown][0], eDown);
351 children[6]->SetNeigbour(
m_neigbours[eDown][0], eDown);
352 children[7]->SetNeigbour(
m_neigbours[eDown][0], eDown);
361 children[3]->SetNeigbour(
m_neigbours[eDown][1], eDown);
362 children[6]->SetNeigbour(
m_neigbours[eDown][2], eDown);
363 children[7]->SetNeigbour(
m_neigbours[eDown][3], eDown);
379 children[1]->SetNeigbour(
m_neigbours[eForward][0], eForward);
380 children[2]->SetNeigbour(
m_neigbours[eForward][0], eForward);
381 children[3]->SetNeigbour(
m_neigbours[eForward][0], eForward);
390 children[1]->SetNeigbour(
m_neigbours[eForward][1], eForward);
391 children[2]->SetNeigbour(
m_neigbours[eForward][2], eForward);
392 children[3]->SetNeigbour(
m_neigbours[eForward][3], eForward);
408 children[5]->SetNeigbour(
m_neigbours[eBack][0], eBack);
409 children[6]->SetNeigbour(
m_neigbours[eBack][0], eBack);
410 children[7]->SetNeigbour(
m_neigbours[eBack][0], eBack);
419 children[5]->SetNeigbour(
m_neigbours[eBack][1], eBack);
420 children[6]->SetNeigbour(
m_neigbours[eBack][2], eBack);
421 children[7]->SetNeigbour(
m_neigbours[eBack][3], eBack);
437 children[2]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
438 children[4]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
439 children[6]->SetNeigbour(
m_neigbours[eLeft][0], eLeft);
448 children[2]->SetNeigbour(
m_neigbours[eLeft][1], eLeft);
449 children[4]->SetNeigbour(
m_neigbours[eLeft][2], eLeft);
450 children[6]->SetNeigbour(
m_neigbours[eLeft][3], eLeft);
467 children[3]->SetNeigbour(
m_neigbours[eRight][0], eRight);
468 children[5]->SetNeigbour(
m_neigbours[eRight][0], eRight);
469 children[7]->SetNeigbour(
m_neigbours[eRight][0], eRight);
478 children[3]->SetNeigbour(
m_neigbours[eRight][1], eRight);
479 children[5]->SetNeigbour(
m_neigbours[eRight][2], eRight);
480 children[7]->SetNeigbour(
m_neigbours[eRight][3], eRight);
499 for (
int i = 0; i < tmp.size(); i++)
501 if (tmp[i]->
GetId() == id)
518 if (p1->GetId() == p2->GetId())
NekDouble GetDelta()
Get value of delta.
#define ASSERTL0(condition, msg)
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.
std::vector< CurvaturePointSharedPtr > m_localCPList
curvature sampling point list
bool operator==(ElmtConfig const &c1, ElmtConfig const &c2)
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