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

Go to the source code of this file.

Namespaces

namespace  util
 Collection of methods useful in simulation.
 

Functions

std::vector< util::Pointutil::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 > > util::getEdges (size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns all corner points in the box.
 
util::Point util::getCenter (size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns center point.
 
double util::inscribedRadiusInBox (size_t dim, const std::pair< util::Point, util::Point > &box)
 Computes the radius of biggest circle/sphere completely within the object.
 
double util::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 util::getPointOnLine (const util::Point &p1, const util::Point &p2, const double &s)
 Returns point in line formed by points p1 and p2.
 
double util::computeMeshSize (const std::vector< util::Point > &nodes)
 Computes minimum distance between any two nodes.
 
double util::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::Pointutil::computeBBox (const std::vector< util::Point > &nodes)
 Computes bounding box for vector nodes.
 
double util::computeInscribedRadius (const std::pair< util::Point, util::Point > &box)
 Computes maximum radius of circle/sphere within a given box.
 
std::pair< util::Point, util::Pointutil::toPointBox (const std::vector< double > &p1, const std::vector< double > &p2)
 Create box from two coordinate data.
 
double util::triangleArea (const util::Point &x1, const util::Point &x2, const util::Point &x3)
 Compute area of triangle.
 
template<class T >
util::l2Dist (const std::vector< T > &x1, const std::vector< T > &x2)
 Computes l2 distance between two vectors.
 
Methods to check point in domain
bool util::isPointInsideBox (util::Point x, size_t dim, const std::pair< util::Point, util::Point > &box)
 Returns true if point is inside box.
 
bool util::isPointInsideRectangle (util::Point x, double x_min, double x_max, double y_min, double y_max)
 Checks if point is inside a rectangle.
 
bool util::isPointInsideRectangle (util::Point x, util::Point x_lb, util::Point x_rt)
 Checks if point is inside a rectangle.
 
bool util::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 util::isPointInsideCuboid (util::Point x, util::Point x_lbb, util::Point x_rtf)
 Checks if point is inside a cuboid.
 
bool util::isPointInsideCylinder (const util::Point &p, const double &length, const double &radius, const util::Point &axis)
 Returns true if point is inside the cylinder.
 
bool util::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 util::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 util::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 util::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 util::doLinesIntersect (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Do lines intersect.
 
double util::distanceBetweenLines (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Compute distance between lines.
 
double util::distanceBetweenSegments (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2)
 Compute distance between lines.
 
double util::distanceBetweenPlanes (const std::pair< util::Point, util::Point > &plane_1, const std::pair< util::Point, util::Point > &plane_2)
 Compute distance between planes.
 
double util::pointDistanceLine (const util::Point &p, const std::pair< util::Point, util::Point > &line)
 Compute distance between point and line.
 
double util::pointDistanceSegment (const util::Point &p, const std::pair< util::Point, util::Point > &line)
 Compute distance between point and line.
 
double util::pointDistancePlane (const util::Point &p, const std::pair< util::Point, util::Point > &plane)
 Compute distance between point and plane.