PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
geomUtilFunctions.h File Reference
#include "util/point.h"
#include <vector>
Include dependency graph for geomUtilFunctions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  geom
 

Functions

std::vector< util::Pointgeom::getCornerPoints (size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns all corner points in the box.
 
std::vector< std::pair< util::Point, util::Point > > geom::getEdges (size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns all corner points in the box.
 
util::Point geom::getCenter (size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns center point.
 
double geom::inscribedRadiusInBox (size_t dim, const std::pair< util::Point, util::Point > &box)
 Computes the radius of biggest circle/sphere completely within the object.
 
double geom::circumscribedRadiusInBox (size_t dim, const std::pair< util::Point, util::Point > &box)
 Computes the radius of smallest circle/sphere which can have the box inside.
 
util::Point geom::getPointOnLine (const util::Point &p1, const util::Point &p2, const double &s)
 Returns point in line formed by points p1 and p2.
 
double geom::computeMeshSize (const std::vector< util::Point > &nodes)
 Computes minimum distance between any two nodes.
 
double geom::computeMeshSize (const std::vector< util::Point > &nodes, size_t start, size_t end)
 Computes minimum distance between any two nodes.
 
std::pair< util::Point, util::Pointgeom::computeBBox (const std::vector< util::Point > &nodes)
 Computes bounding box for vector nodes.
 
double geom::computeInscribedRadius (const std::pair< util::Point, util::Point > &box)
 Computes maximum radius of circle/sphere within a given box.
 
std::pair< util::Point, util::Pointgeom::toPointBox (const std::vector< double > &p1, const std::vector< double > &p2)
 Create box from two coordinate data.
 
double geom::triangleArea (const util::Point &x1, const util::Point &x2, const util::Point &x3)
 Compute area of triangle.
 
void geom::computeNonlocalNeighborhood (const std::vector< util::Point > &nodes, double horizon, std::vector< std::vector< size_t > > &nodeNeighs)
 Partitions the nodes based on node neighborlist supplied. Function first creates a graph with nodes as vertices and edges given by node neighbors. Then the metis function is called to partition the graph into specified number of parts.
 
void geom::ellipsoidRotationMatrix (const Ellipsoid &e, double R[9])
 Row-major 3×3 rotation \(\mathbf R\) from ellipsoid axis–angle (identity if \(\theta=0\)).
 
Methods to check point in domain
bool geom::isPointInsideBox (util::Point x, size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns true if point is inside box.
 
bool geom::isPointInsideRectangle (util::Point x, double x_min, double x_max, double y_min, double y_max)
 Checks if point is inside a rectangle.
 
bool geom::isPointInsideRectangle (util::Point x, util::Point x_lb, util::Point x_rt)
 Checks if point is inside a rectangle.
 
bool geom::isPointInsideAngledRectangle (util::Point x, double x_min, double x_max, double y_min, double y_max, double theta)
 Checks if point is inside an angled rectangle.
 
bool geom::isPointInsideCuboid (util::Point x, util::Point x_lbb, util::Point x_rtf)
 Checks if point is inside a cuboid.
 
bool geom::isPointInsideCylinder (const util::Point &p, const double &length, const double &radius, const util::Point &axis)
 Returns true if point is inside the cylinder.
 
bool geom::isPointInsideCylinder (const util::Point &p, const double &radius, const util::Point &x1, const util::Point &x2)
 Returns true if point is inside the cylinder.
 
bool geom::isPointInsideEllipse (const util::Point &p, const util::Point &center, const std::vector< double > &radius_vec, unsigned int dim)
 Returns true if point is inside the ellipsoid.
 
bool geom::isPointInsideEllipse (const util::Point &p, const util::Point &center, const std::vector< double > &radius_vec, unsigned int dim, double &d)
 Returns true if point is inside the ellipsoid.
 
Methods to check intersection of various objects
bool geom::areBoxesNear (const std::pair< util::Point, util::Point > &b1, const std::pair< util::Point, util::Point > &b2, const double &tol, size_t dim)
 Checks if given two boxes are within given distance from each other.
 
bool geom::doLinesIntersect (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Do lines intersect.
 
double geom::distanceBetweenLines (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Compute distance between lines.
 
double geom::distanceBetweenSegments (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Compute distance between lines.
 
double geom::distanceBetweenPlanes (const std::pair< util::Point, util::Point > &plane_1, const std::pair< util::Point, util::Point > &plane_2)
 Compute distance between planes.
 
double geom::pointDistanceLine (const util::Point &p, const std::pair< util::Point, util::Point > &line)
 Compute distance between point and line.
 
double geom::pointDistanceSegment (const util::Point &p, const std::pair< util::Point, util::Point > &line)
 Compute distance between point and line.
 
double geom::pointDistancePlane (const util::Point &p, const std::pair< util::Point, util::Point > &plane)
 Compute distance between point and plane.