Commit 37d98272 authored by Michael Turner's avatar Michael Turner

Julians comments

parent 9e5d9b6e
......@@ -192,7 +192,7 @@ public:
* @brief Returns the normal to the curve which is orientate with respect
* to the surface surf
*/
virtual Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf) = 0;
Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf);
/**
* @brief Returns the normal to a curve, it will always point in the concave
......
......@@ -127,7 +127,7 @@ public:
* @brief Get the x,y,z at parametric point u,v.
*
* @param uv Array of u and v parametric coords.
* @return Array of xyz location.
* @return Array of x,y,z location.
*/
virtual Array<OneD, NekDouble> P(Array<OneD, NekDouble> uv) = 0;
......
......@@ -67,17 +67,12 @@ public:
virtual Array<OneD, NekDouble> D2(NekDouble t);
virtual NekDouble Curvature(NekDouble t)
{
ASSERTL0(false, "not implemented in CFI engine");
ASSERTL0(false, "Function: Curvature not implemented in CFI engine");
return 0;
}
virtual Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf)
{
ASSERTL0(false, "not implemented in CFI engine");
return Array<OneD, NekDouble>();
}
virtual Array<OneD, NekDouble> N(NekDouble t)
{
ASSERTL0(false, "not implemented in CFI engine");
ASSERTL0(false, "Function: N not implemented in CFI engine");
return Array<OneD, NekDouble>();
}
virtual NekDouble tAtArcLength(NekDouble s);
......
......@@ -123,46 +123,6 @@ Array<OneD, NekDouble> CADCurveOCE::D2(NekDouble t)
return out;
}
Array<OneD, NekDouble> CADCurveOCE::NormalWRT(NekDouble t, int surf)
{
Array<OneD, NekDouble> p = P(t);
pair<CADSurfSharedPtr, CADOrientation::Orientation> surface;
ASSERTL0(m_adjSurfs.size() == 1, "This will only work in 2D for one surface at the moment");
surface = m_adjSurfs[0];
Array<OneD, NekDouble> uv;
surface.first->locuv(p, uv);
Array<OneD, NekDouble> d1 = surface.first->D1(uv);
NekDouble t1 = t - 1e-8;
NekDouble t2 = t + 1e-8;
if(surface.second == CADOrientation::eBackwards)
{
swap(t1, t2);
}
Array<OneD, NekDouble> uv1;
surface.first->locuv(P(t1), uv1);
Array<OneD, NekDouble> uv2;
surface.first->locuv(P(t2), uv2);
NekDouble du = uv2[1] - uv1[1];
NekDouble dv = -1.0*(uv2[0] - uv1[0]);
Array<OneD, NekDouble> N(3,0.0);
N[0] = (d1[3] * du + d1[6] * dv) / 2.0;
N[1] = (d1[4] * du + d1[7] * dv) / 2.0;
N[2] = (d1[5] * du + d1[8] * dv) / 2.0;
NekDouble mag = sqrt(N[0]*N[0] + N[1]*N[1] + N[2]*N[2]);
N[0] /= mag;
N[1] /= mag;
N[2] /= mag;
return N;
}
Array<OneD, NekDouble> CADCurveOCE::N(NekDouble t)
{
GeomLProp_CLProps d(m_c,2,1e-8);
......
......@@ -71,7 +71,6 @@ public:
virtual Array<OneD, NekDouble> GetMinMax();
virtual NekDouble loct(Array<OneD, NekDouble> xyz, NekDouble &t);
virtual NekDouble Curvature(NekDouble t);
virtual Array<OneD, NekDouble> NormalWRT(NekDouble t, int surf);
virtual Array<OneD, NekDouble> N(NekDouble t);
void Initialise(int i, TopoDS_Shape in)
......
......@@ -16,6 +16,7 @@ SET(NEKMESHUTILS_SOURCES
CADSystem/CADSystem.cpp
CADSystem/CADSurf.cpp
CADSystem/CADVert.cpp
CADSystem/CADCurve.cpp
CADSystem/ProcessLoadCAD.cpp
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment