Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Nektar::NekMeshUtils::linesource Struct Reference
Collaboration diagram for Nektar::NekMeshUtils::linesource:
Collaboration graph
[legend]

Public Member Functions

 linesource (Array< OneD, NekDouble > p1, Array< OneD, NekDouble > p2, NekDouble r, NekDouble d)
 
bool withinRange (Array< OneD, NekDouble > p)
 
NekDouble Length ()
 

Public Attributes

Array< OneD, NekDoublex1
 
Array< OneD, NekDoublex2
 
NekDouble R
 
NekDouble delta
 

Detailed Description

Definition at line 793 of file Octree.cpp.

Constructor & Destructor Documentation

Nektar::NekMeshUtils::linesource::linesource ( Array< OneD, NekDouble p1,
Array< OneD, NekDouble p2,
NekDouble  r,
NekDouble  d 
)
inline

Definition at line 797 of file Octree.cpp.

801  : x1(p1), x2(p2), R(r), delta(d)
802  {
803  }
Array< OneD, NekDouble > x1
Definition: Octree.cpp:795
Array< OneD, NekDouble > x2
Definition: Octree.cpp:795

Member Function Documentation

NekDouble Nektar::NekMeshUtils::linesource::Length ( )
inline

Definition at line 837 of file Octree.cpp.

838  {
839  return sqrt((x1[0] - x2[0]) * (x1[0] - x2[0]) +
840  (x1[1] - x2[1]) * (x1[1] - x2[1]) +
841  (x1[2] - x2[2]) * (x1[2] - x2[2]));
842  }
Array< OneD, NekDouble > x1
Definition: Octree.cpp:795
Array< OneD, NekDouble > x2
Definition: Octree.cpp:795
bool Nektar::NekMeshUtils::linesource::withinRange ( Array< OneD, NekDouble p)
inline

Definition at line 805 of file Octree.cpp.

806  {
807  Array<OneD, NekDouble> Le(3), Re(3), s(3);
808  for (int i = 0; i < 3; i++)
809  {
810  Le[i] = p[i] - x1[i];
811  Re[i] = p[i] - x2[i];
812  s[i] = x2[i] - x1[i];
813  }
814  Array<OneD, NekDouble> dev(3);
815  dev[0] = Le[1] * Re[2] - Re[1] * Le[2];
816  dev[1] = Le[0] * Re[2] - Re[0] * Le[2];
817  dev[2] = Le[0] * Re[1] - Re[0] * Le[1];
818 
819  NekDouble dist =
820  sqrt(dev[0] * dev[0] + dev[1] * dev[1] + dev[2] * dev[2]) /
821  sqrt(s[0] * s[0] + s[1] * s[1] + s[2] * s[2]);
822 
823  NekDouble t = -1.0 * ((x1[0] - p[0]) * s[0] + (x1[1] - p[1]) * s[1] +
824  (x1[1] - p[1]) * s[1]) /
825  Length() / Length();
826 
827  if (dist < R && !(t > 1) && !(t < 0))
828  {
829  return true;
830  }
831  else
832  {
833  return false;
834  }
835  }
Array< OneD, NekDouble > x1
Definition: Octree.cpp:795
Array< OneD, NekDouble > x2
Definition: Octree.cpp:795
double NekDouble

Member Data Documentation

NekDouble Nektar::NekMeshUtils::linesource::delta

Definition at line 796 of file Octree.cpp.

NekDouble Nektar::NekMeshUtils::linesource::R

Definition at line 796 of file Octree.cpp.

Array<OneD, NekDouble> Nektar::NekMeshUtils::linesource::x1

Definition at line 795 of file Octree.cpp.

Array<OneD, NekDouble> Nektar::NekMeshUtils::linesource::x2

Definition at line 795 of file Octree.cpp.