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