Commit b34af719 authored by Michael Turner's avatar Michael Turner

fix cfi

parent 2fc453a4
......@@ -65,9 +65,10 @@ Array<OneD, NekDouble> CADSurfCFI::GetBounds()
return b;
}
NekDouble CADSurfCFI::locuv(Array<OneD, NekDouble> p, Array<OneD, NekDouble> &uv)
Array<OneD, NekDouble> CADSurfCFI::locuv(Array<OneD, NekDouble> p,
NekDouble &dist)
{
uv = Array<OneD, NekDouble>(2);
Array<OneD, NekDouble> uv(2);
cfi::Position px;
px.x = p[0] / m_scal;
px.y = p[1] / m_scal;
......@@ -80,11 +81,11 @@ NekDouble CADSurfCFI::locuv(Array<OneD, NekDouble> p, Array<OneD, NekDouble> &uv
Array<OneD, NekDouble> p2 = P(uv);
NekDouble dist =
dist =
sqrt((p[0] - p2[0]) * (p[0] - p2[0]) + (p[1] - p2[1]) * (p[1] - p2[1]) +
(p[2] - p2[2]) * (p[2] - p2[2]));
(p[2] - p2[2]) * (p[2] - p2[2])) * m_scal;
return dist * m_scal;
return uv;
}
NekDouble CADSurfCFI::Curvature(Array<OneD, NekDouble> uv)
......
......@@ -74,7 +74,7 @@ public:
Array<OneD, NekDouble> P(Array<OneD, NekDouble> uv);
NekDouble locuv(Array<OneD, NekDouble> p, Array<OneD, NekDouble> &uv);
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p, NekDouble &dist);
NekDouble Curvature(Array<OneD, NekDouble> uv);
......
......@@ -113,8 +113,7 @@ void CFIMesh::Process()
c->GetAdjSurf();
for (int j = 0; j < ss.size(); j++)
{
Array<OneD, NekDouble> uv(2);
ss[j].first->locuv(xyz, uv);
Array<OneD, NekDouble> uv = ss[j].first->locuv(xyz);
n->SetCADSurf(ss[j].first, uv);
}
}
......@@ -125,8 +124,7 @@ void CFIMesh::Process()
if (f != m_nameToFaceId.end())
{
CADSurfSharedPtr s = m_mesh->m_cad->GetSurf(f->second);
Array<OneD, NekDouble> uv(2);
s->locuv(xyz, uv);
Array<OneD, NekDouble> uv = s->locuv(xyz);
n->SetCADSurf(s, uv);
}
}
......@@ -146,8 +144,7 @@ void CFIMesh::Process()
ss = cs[i]->GetAdjSurf();
for (int j = 0; j < ss.size(); j++)
{
Array<OneD, NekDouble> uv;
ss[j].first->locuv(xyz, uv);
Array<OneD, NekDouble> uv = ss[j].first->locuv(xyz);
n->SetCADSurf(ss[j].first, uv);
}
}
......
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