35 #ifndef NEKTAR_MESHUTILS_OCTREE_OCTREE
36 #define NEKTAR_MESHUTILS_OCTREE_OCTREE
46 namespace NekMeshUtils
65 for (
int i = 0; i < 3; i++)
72 dev[0] = Le[1] * Re[2] - Re[1] * Le[2];
73 dev[1] = Le[2] * Re[0] - Re[2] * Le[0];
74 dev[2] = Le[0] * Re[1] - Re[0] * Le[1];
77 sqrt(dev[0] * dev[0] + dev[1] * dev[1] + dev[2] * dev[2]) /
Length();
82 if (dist <
R && !(t > 1) && !(t < 0))
94 return sqrt((
x1[0] -
x2[0]) * (
x1[0] -
x2[0]) +
NekDouble m_eps
curavture sensivity paramter
void SubDivide()
Function which initiates and controls the subdivision process.
void SetParameters(NekDouble &min, NekDouble &max, NekDouble &ep)
sets the parameters used for curvature sampling
NekDouble GetMinDelta()
returns the miminum spacing in the octree (for meshing purposes)
NekDouble m_maxDelta
maximum delta in the octree
NekDouble m_dim
physical size of the octree
OctantSharedPtr m_masteroct
master octant for searching
NekDouble ddx(OctantSharedPtr i, OctantSharedPtr j)
Calculates the difference in delta divided by the difference in location between two octants i and j.
int m_numoct
number of octants made, used for id index
std::vector< linesource > m_lsources
void Refinement(std::string nm)
informs the octree there is a user defined spacing file
void WriteOctree(std::string nm)
populates the mesh m with a invalid hexahedral mesh based on the octree, used for visualisation
NekDouble Query(Array< OneD, NekDouble > loc)
once constructed queryies the octree based on x,y,z location to get a mesh spacing
std::vector< SPBaseSharedPtr > m_SPList
list of source points
void SmoothAllOctants()
Smooths specification over all octants to a gradation criteria.
void Process()
builds the octree based on curvature sampling and user defined spacing
bool VerifyNeigbours()
Looks over all leaf octants and checks that their neigbour assigments are valid.
void SmoothSurfaceOctants()
Smooths specification over the surface encompasing octants to a gradation criteria.
int CountElemt()
estimates the number of elements to be created in the mesh
Array< OneD, NekDouble > m_centroid
x,y,z location of the center of the octree
NekDouble m_minDelta
minimum delta in the octree
std::vector< OctantSharedPtr > m_octants
list of leaf octants
MeshSharedPtr m_mesh
Mesh object.
void PropagateDomain()
takes the mesh specification from surface octants and progates that through the domain so all octants...
void CompileSourcePointList()
gets an optimum number of curvature sampling points and calculates the curavture at these points
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
std::shared_ptr< Octant > OctantSharedPtr
std::shared_ptr< Octree > OctreeSharedPtr
Array< OneD, NekDouble > x2
linesource(Array< OneD, NekDouble > p1, Array< OneD, NekDouble > p2, NekDouble r, NekDouble d)
Array< OneD, NekDouble > x1
bool withinRange(Array< OneD, NekDouble > p)