Stellarator and Tokamak Modeling and Meshing Software (STOMMS)
Loading...
Searching...
No Matches
Classes | Functions
util.h File Reference

Classes

struct  DomainBox
 

Functions

double convertNormToPsi (double normPsi, double psiAxis, double psiCoreBoundary)
 
std::vector< double > convertNormToPsiVector (std::vector< double > normPsi, double psiAxis, double psiCoreBoundary)
 
double convertPsiToNorm (double psi, double psiAxis, double psiCoreBoundary)
 
bool isPointOnCorner (const Point &pt1, const Point &pt2, const Point &pt3)
 
bool arePointsSame (const Point &pt1, const Point &pt2)
 
int isLeft (const Point &pt1, const Point &pt2, const Point &testPoint)
 
int windingNumberPolygonTest (const Point &pt, const std::vector< Point > &curve)
 
double distance2D (const Point &pt1, const Point &pt2)
 
double getParamatricCoordinate (const Point &pt1, const Point &pt2, const Point &pt)
 
double distanceLineToPoint (const Point &pt1, const Point &pt2, const Point &pt)
 
bool curveOrientation (const std::vector< Point > &curvePts)
 
std::array< double, 4 > getCurveBounds (const std::vector< Point > &curvePts)
 
bool isPtOnModelEdge (const Point &checkPt, const pGEdge &ge)
 
bool isPtOnCurve (const Point &pt, const std::vector< pGEdge > &edgesOnCurve)
 

Function Documentation

◆ arePointsSame()

bool arePointsSame ( const Point pt1,
const Point pt2 
)

◆ convertNormToPsi()

double convertNormToPsi ( double  normPsi,
double  psiAxis,
double  psiCoreBoundary 
)

Convert the normalized psi values to actual psi values for a single given value double normPsi (in): normalized psi values. double psiAxis (in): actual psi value at the axis (O-point). double psiCoreBoundary (in): actual psi value at the boundary of core region. returns a actual psi values.

◆ convertNormToPsiVector()

std::vector< double > convertNormToPsiVector ( std::vector< double >  normPsi,
double  psiAxis,
double  psiCoreBoundary 
)

Convert the normalized psi values to actual psi values. Takes normalized psi values in a vector and return a vector of actual psi values. std::vector <double> normPsi (in): vector of normalized psi values. double psiAxis (in): actual psi value at the axis (O-point). double psiCoreBoundary (in): actual psi value at the boundary of core region. returns a vector of actual psi values.

◆ convertPsiToNorm()

double convertPsiToNorm ( double  psi,
double  psiAxis,
double  psiCoreBoundary 
)

◆ curveOrientation()

bool curveOrientation ( const std::vector< Point > &  curvePts)

◆ distance2D()

double distance2D ( const Point pt1,
const Point pt2 
)

Function to calculate 2D distance between two points.

Parameters
pt1first point.
pt2second point.
Returns
2D distance.

◆ distanceLineToPoint()

double distanceLineToPoint ( const Point pt1,
const Point pt2,
const Point pt 
)

Function to get the distance from a point to a line segment.

Parameters
pt1start point of the line segment.
pt2end point of the line segment.
ptpoint for which distance from the line is needed.
Returns
distance from point pt to line segment(pt1—pt2).

◆ getCurveBounds()

std::array< double, 4 > getCurveBounds ( const std::vector< Point > &  curvePts)

◆ getParamatricCoordinate()

double getParamatricCoordinate ( const Point pt1,
const Point pt2,
const Point pt 
)

Function to get the parametric coordinate of a point on a line segment.

Parameters
pt1start point of the line segment.
pt2end point of the line segment.
ptpoint for which parametric value is needed.
Returns
parametric value of point pt on line segment(pt1—pt2).

◆ isLeft()

int isLeft ( const Point pt1,
const Point pt2,
const Point testPoint 
)

Given two endpoints of a line segment (p1 ... p2), and a point (testPoint), evaluate if the testPoint is on left side or right side of line segment. const Point& pt1 (in): end point 1 of line segment. const Point& pt2 (in): end point 2 of line segment. const Point& testPoint (in): point to bes tested. returns true if point is on left side, else false.

◆ isPointOnCorner()

bool isPointOnCorner ( const Point pt1,
const Point pt2,
const Point pt3 
)

Function to check if a point is on a straight line or it makes a corner on the curve. Need two intersecting lines of the curve on that point to check. Point& pt1 (in): start point of the line one. Point& pt2 (in): point to check (end point of line one and start of line two). Point& pt1 (in): end point of the line two. return true if point makes a corner, otherwise false if its on a line.

◆ isPtOnCurve()

bool isPtOnCurve ( const Point pt,
const std::vector< pGEdge > &  edgesOnCurve 
)

◆ isPtOnModelEdge()

bool isPtOnModelEdge ( const Point checkPt,
const pGEdge &  ge 
)

◆ windingNumberPolygonTest()

int windingNumberPolygonTest ( const Point pt,
const std::vector< Point > &  curve 
)

Winding number test for a point in polygon. const Point& pt (in): test point. const std::vector <Point>& curve (in): vector of points defining a closed curve (polygon). Returs 0 if point is outside the polygon.