![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
Namespaces | |
| namespace | anonymous_namespace{geomObjects.cpp} |
| namespace | anonymous_namespace{openCuboidChannel3D.cpp} |
| namespace | anonymous_namespace{openRectChannel2D.cpp} |
Data Structures | |
| class | AnnulusGeomObject |
| Defines annulus rectangle. More... | |
| struct | BoxPartition |
| Defines simple rectangle domain. More... | |
| class | Circle |
| Defines circle. More... | |
| class | ComplexGeomObject |
| Defines complex geometrical object. More... | |
| class | Cube |
| Defines cube. More... | |
| class | Cuboid |
| Defines cuboid. More... | |
| class | Cylinder |
| Defines cylinder. More... | |
| class | Drum2D |
| Defines Drum2D. More... | |
| class | Ellipse |
| Filled ellipse in the plane z = center.d_z, semi-axes in the xy plane. More... | |
| class | Ellipsoid |
| Ellipsoid: center \(\mathbf c\), semi-axes \(r_1,r_2,r_3\) in a body frame rotated from world by axis–angle \((\hat{\mathbf a},\theta)\) (Rodrigues). Axis-aligned case: \(\theta=0\) (axis ignored). More... | |
| struct | GeomData |
| Input data for geometrical objects. More... | |
| class | GeomObject |
| Defines abstract geometrical domain. More... | |
| class | Hexagon |
| Defines Hexagon. More... | |
| class | Line |
| Defines Line. More... | |
| class | NullGeomObject |
| Defines null (empty) geom object. More... | |
| class | OpenCuboidChannel3D |
| Hollow axis-aligned cuboid shell with uniform wall thickness and one outer face open. More... | |
| class | OpenRectChannel2D |
| 2D U-shaped cavity: thick rectangular frame with the top (+y) side open. More... | |
| struct | ParticleTransform |
| A struct that stores transformation parameters and provides method to transform the particle. Basically, given a reference particle, this provides method to translate, rotate, and scale the reference particle. More... | |
| class | Plane |
| Infinite plane: free space is the half-space in the normal direction. More... | |
| class | Rectangle |
| Defines Rectangle. More... | |
| class | Sphere |
| Defines sphere. More... | |
| class | Square |
| Defines Square. More... | |
| class | Triangle |
| Defines Triangle. More... | |
| struct | WallContactHit |
| Result of a wall-contact query against a geom (analytical walls). More... | |
Functions | |
| size_t | getGeomTypeToDim (std::string type) |
| Returns list of acceptable geometries for PeriDEM simulation. | |
| util::Point | mapSimilarity (const util::Point &x, const util::Point &pivotDefault, const util::Point &t, double scale, double angle, const util::Point &axis, const util::Point *rotationPoint) |
| std::vector< size_t > | getNumParamsRequired (std::string geom_type) |
| Get num params required for creation of object. | |
| bool | isNumberOfParamForGeometryValid (size_t n, std::string geom_type) |
| Ascertain if number of parameters are correct for the given geometry. | |
| bool | isNumberOfParamForComplexGeometryValid (size_t n, std::string geom_type, std::vector< std::string > vec_type) |
| Ascertain if number of parameters are correct for the given geometry. | |
| bool | checkParamForGeometry (size_t n, std::string geom_type) |
| Check parameter data for validity. | |
| bool | checkParamForComplexGeometry (size_t n, std::string geom_type, std::vector< std::string > vec_type) |
| Check parameter data for validity. | |
| void | createGeomObjectOld (const std::string &type, const std::vector< double > ¶ms, const std::vector< std::string > &vec_type, const std::vector< std::string > &vec_flag, std::shared_ptr< geom::GeomObject > &obj, bool perform_check=true) |
| Create geometrical object from the given data. | |
| void | createGeomObject (const std::string &geom_type, const std::vector< double > ¶ms, const std::vector< std::string > &vec_type, const std::vector< std::string > &vec_flag, std::shared_ptr< geom::GeomObject > &obj, bool perform_check) |
| void | createGeomObject (GeomData &geomData, bool perform_check) |
| std::vector< double > | exampleGeomParams (const std::string &geom_type, const util::Point &c=util::Point(0., 0., 0.), double s=0.001) |
| Canonical parameter vector for examples, mesh generation tests, and demos. | |
| std::shared_ptr< GeomObject > | makeExampleGeomObject (const std::string &geom_type, const util::Point &c=util::Point(0., 0., 0.), double s=0.001) |
| One-liner: createGeomObject(exampleGeomParams(...)). Prefer this over per-class static factories so annulus and composite types stay in one place. | |
| void | writeGeometry (json &j, const geom::GeomData &geomData) |
| void | readGeometry (const json &j, geom::GeomData &geomData) |
| GeomObject * | createGeomDeepCopy (GeomObject *obj) |
| Creates a deep copy of a geometric object. | |
| const std::vector< std::string > & | getAcceptableGeometries () |
| Returns list of acceptable geometries for PeriDEM simulation. | |
| std::vector< util::Point > | 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 > > | getEdges (size_t dim, const std::pair< util::Point, util::Point > &box) |
| Returns all corner points in the box. | |
| util::Point | getCenter (size_t dim, const std::pair< util::Point, util::Point > &box) |
| Returns center point. | |
| double | inscribedRadiusInBox (size_t dim, const std::pair< util::Point, util::Point > &box) |
| Computes the radius of biggest circle/sphere completely within the object. | |
| double | 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 | getPointOnLine (const util::Point &p1, const util::Point &p2, const double &s) |
| Returns point in line formed by points p1 and p2. | |
| double | computeMeshSize (const std::vector< util::Point > &nodes) |
| Computes minimum distance between any two nodes. | |
| double | 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::Point > | computeBBox (const std::vector< util::Point > &nodes) |
| Computes bounding box for vector nodes. | |
| double | computeInscribedRadius (const std::pair< util::Point, util::Point > &box) |
| Computes maximum radius of circle/sphere within a given box. | |
| std::pair< util::Point, util::Point > | toPointBox (const std::vector< double > &p1, const std::vector< double > &p2) |
| Create box from two coordinate data. | |
| double | triangleArea (const util::Point &x1, const util::Point &x2, const util::Point &x3) |
| Compute area of triangle. | |
| void | 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 | 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 intersection of various objects | |
| bool | 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 | doLinesIntersect (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2) |
| Do lines intersect. | |
| double | distanceBetweenLines (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2) |
| Compute distance between lines. | |
| double | distanceBetweenSegments (const std::pair< util::Point, util::Point > &line_1, const std::pair< util::Point, util::Point > &line_2) |
| Compute distance between lines. | |
| double | distanceBetweenPlanes (const std::pair< util::Point, util::Point > &plane_1, const std::pair< util::Point, util::Point > &plane_2) |
| Compute distance between planes. | |
| double | pointDistanceLine (const util::Point &p, const std::pair< util::Point, util::Point > &line) |
| Compute distance between point and line. | |
| double | pointDistanceSegment (const util::Point &p, const std::pair< util::Point, util::Point > &line) |
| Compute distance between point and line. | |
| double | pointDistancePlane (const util::Point &p, const std::pair< util::Point, util::Point > &plane) |
| Compute distance between point and plane. | |
Methods to check point in domain | |
| bool | isPointInsideBox (util::Point x, size_t dim, const std::pair< util::Point, util::Point > &box) |
| Returns true if point is inside box. | |
| bool | isPointInsideRectangle (util::Point x, double x_min, double x_max, double y_min, double y_max) |
| Checks if point is inside a rectangle. | |
| bool | isPointInsideRectangle (util::Point x, util::Point x_lb, util::Point x_rt) |
| Checks if point is inside a rectangle. | |
| bool | 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 | isPointInsideCuboid (util::Point x, util::Point x_lbb, util::Point x_rtf) |
| Checks if point is inside a cuboid. | |
| bool | isPointInsideCylinder (const util::Point &p, const double &length, const double &radius, const util::Point &axis) |
| Returns true if point is inside the cylinder. | |
| bool | 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 | isPointInsideEllipse (const util::Point &p, const util::Point ¢er, const std::vector< double > &radius_vec, unsigned int dim) |
| Returns true if point is inside the ellipsoid. | |
| bool | isPointInsideEllipse (const util::Point &p, const util::Point ¢er, const std::vector< double > &radius_vec, unsigned int dim, double &d) |
| Returns true if point is inside the ellipsoid. | |
Variables | |
| const std::map< std::string, size_t > | geom_type_to_dim |
| Geometry type to dimension map. | |
| const std::vector< std::string > | acceptable_geometries |
| List of acceptable geometries for particles in PeriDEM. | |
| 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.
| b1 | Box 1 |
| b2 | Box 2 |
| tol | Tolerance for checking |
| dim | Dimension of the objects |
Definition at line 120 of file geomUtilFunctions.cpp.
References circumscribedRadiusInBox(), getCenter(), getCornerPoints(), inscribedRadiusInBox(), util::isLess(), and isPointInsideBox().
Referenced by geom::Triangle::isNear(), geom::Square::isNear(), geom::Rectangle::isNear(), geom::Hexagon::isNear(), geom::Drum2D::isNear(), geom::Cube::isNear(), geom::Cuboid::isNear(), geom::Ellipsoid::isNear(), geom::Cylinder::isNear(), geom::OpenCuboidChannel3D::isNear(), and geom::OpenRectChannel2D::isNear().
| bool geom::checkParamForComplexGeometry | ( | size_t | n, |
| std::string | geom_type, | ||
| std::vector< std::string > | vec_type | ||
| ) |
Check parameter data for validity.
| n | Number of parameters available |
| geom_type | Geometry type of object |
| vec_type | For complex objects, specify types of sub-objects |
Definition at line 132 of file geomObjectsUtil.cpp.
References isNumberOfParamForComplexGeometryValid().
| bool geom::checkParamForGeometry | ( | size_t | n, |
| std::string | geom_type | ||
| ) |
Check parameter data for validity.
| n | Number of parameters available |
| geom_type | Geometry type of object |
Definition at line 127 of file geomObjectsUtil.cpp.
References isNumberOfParamForGeometryValid().
| 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.
| dim | Dimension of the box |
| box | Pair of corner points of the box |
Definition at line 219 of file geomUtilFunctions.cpp.
References getCenter(), getCornerPoints(), and util::isGreater().
Referenced by areBoxesNear(), geom::Circle::isNear(), geom::Ellipse::isNear(), and geom::Sphere::isNear().
| std::pair< util::Point, util::Point > geom::computeBBox | ( | const std::vector< util::Point > & | nodes | ) |
Computes bounding box for vector nodes.
| nodes | List of nodal coordinates |
Definition at line 617 of file geomUtilFunctions.cpp.
References util::isLess().
| double geom::computeInscribedRadius | ( | const std::pair< util::Point, util::Point > & | box | ) |
Computes maximum radius of circle/sphere within a given box.
| box | Pair of corner points of box |
Definition at line 639 of file geomUtilFunctions.cpp.
| double geom::computeMeshSize | ( | const std::vector< util::Point > & | nodes | ) |
Computes minimum distance between any two nodes.
| nodes | List of nodal coordinates |
Definition at line 562 of file geomUtilFunctions.cpp.
References util::isLess().
Referenced by particle::BaseParticle::BaseParticle().
| double geom::computeMeshSize | ( | const std::vector< util::Point > & | nodes, |
| size_t | start, | ||
| size_t | end | ||
| ) |
Computes minimum distance between any two nodes.
This only considers the nodes between start and end
| nodes | List of nodal coordinates |
| start | Start index from where to start |
| end | End index |
Definition at line 589 of file geomUtilFunctions.cpp.
References util::isLess().
| 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.
| nodes | Nodal coordinates |
| horizon | Nonlocal radius |
| nodeNeighs | Neighborlist of nodes |
Definition at line 659 of file geomUtilFunctions.cpp.
Referenced by test::testGraphPartitioning(), and test::testMPI().
| GeomObject * geom::createGeomDeepCopy | ( | GeomObject * | obj | ) |
Creates a deep copy of a geometric object.
| obj | Pointer to the object to copy |
Definition at line 1400 of file geomObjectsUtil.cpp.
References geom::GeomObject::d_name.
Referenced by geom::AnnulusGeomObject::AnnulusGeomObject(), geom::ComplexGeomObject::ComplexGeomObject(), particle::createParticlesFromFile(), geom::AnnulusGeomObject::operator=(), and geom::ComplexGeomObject::operator=().
| void geom::createGeomObject | ( | const std::string & | geom_type, |
| const std::vector< double > & | params, | ||
| const std::vector< std::string > & | vec_type, | ||
| const std::vector< std::string > & | vec_flag, | ||
| std::shared_ptr< geom::GeomObject > & | obj, | ||
| bool | perform_check | ||
| ) |
Definition at line 665 of file geomObjectsUtil.cpp.
References createGeomObject(), and getNumParamsRequired().
Referenced by inp::BCBaseDeck::BCBaseDeck(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), anonymous_namespace{main.cpp}::buildInputJson(), geom::GeomData::copyGeometry(), geom::GeomData::copyGeometry(), createGeomObject(), createGeomObject(), createGeomObjectOld(), makeExampleGeomObject(), inp::BCBaseDeck::readFromJson(), and inp::ParticleDeck::readParticleGeomFromJson().
| void geom::createGeomObject | ( | GeomData & | geomData, |
| bool | perform_check | ||
| ) |
Definition at line 1232 of file geomObjectsUtil.cpp.
References createGeomObject(), geom::GeomData::d_geom_p, geom::GeomData::d_geomComplexInfo, geom::GeomData::d_geomName, and geom::GeomData::d_geomParams.
| void geom::createGeomObjectOld | ( | const std::string & | type, |
| const std::vector< double > & | params, | ||
| const std::vector< std::string > & | vec_type, | ||
| const std::vector< std::string > & | vec_flag, | ||
| std::shared_ptr< geom::GeomObject > & | obj, | ||
| bool | perform_check = true |
||
| ) |
Create geometrical object from the given data.
Parameter ordering matches GeomData / getNumParamsRequired (see struct GeomData above).
| type | Type of object |
| params | Vector of parameters |
| vec_type | Sub-types of complex object |
| vec_flag | Flags of sub-types of complex object |
| obj | Pointer to object to which new object will be associated |
| perform_check | Perform check for sufficient parameters |
std::cout << "creating complex object\n";
Definition at line 141 of file geomObjectsUtil.cpp.
References createGeomObject(), getNumParamsRequired(), isNumberOfParamForComplexGeometryValid(), isNumberOfParamForGeometryValid(), util::methods::isTagInList(), and util::io::printStr().
| 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.
Definition at line 398 of file geomUtilFunctions.cpp.
| 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.
| plane_1 | Plane 1 given by pair of normal and one point which it contains |
| plane_2 | Plane 2 given by pair of normal and one point which it contains |
Definition at line 501 of file geomUtilFunctions.cpp.
References util::angle().
| 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.
Definition at line 423 of file geomUtilFunctions.cpp.
| bool geom::doLinesIntersect | ( | const std::pair< util::Point, util::Point > & | line_1, |
| const std::pair< util::Point, util::Point > & | line_2 | ||
| ) |
Do lines intersect.
Definition at line 367 of file geomUtilFunctions.cpp.
References util::angle(), and util::Point::lengthSq().
| void geom::ellipsoidRotationMatrix | ( | const Ellipsoid & | e, |
| double | R[9] | ||
| ) |
Row-major 3×3 rotation \(\mathbf R\) from ellipsoid axis–angle (identity if \(\theta=0\)).
Definition at line 683 of file geomUtilFunctions.cpp.
References geom::Ellipsoid::d_axis, geom::Ellipsoid::d_theta, util::Point::d_x, util::Point::d_y, and util::Point::d_z.
Referenced by geom::Ellipsoid::box(), mesh_gen::buildEllipsoidOcc(), and geom::anonymous_namespace{geomObjects.cpp}::ellipsoidBodyCoords().
| std::vector< double > geom::exampleGeomParams | ( | const std::string & | geom_type, |
| const util::Point & | c = util::Point(0., 0., 0.), |
||
| double | s = 0.001 |
||
| ) |
Canonical parameter vector for examples, mesh generation tests, and demos.
Convention matches twop_general_inbuilt: reference center c and length scale s (typical outer half-width). Names must be from getAcceptableGeometries().
Definition at line 1241 of file geomObjectsUtil.cpp.
References util::Point::d_x, util::Point::d_y, and util::Point::d_z.
Referenced by anonymous_namespace{main.cpp}::buildInputJson(), and makeExampleGeomObject().
|
inline |
Returns list of acceptable geometries for PeriDEM simulation.
Definition at line 151 of file geomObjectsUtil.h.
References acceptable_geometries.
Referenced by mesh_gen::generateBuiltinParticleMeshGmsh(), anonymous_namespace{main.cpp}::isAcceptableGeometryName(), main(), and main().
| util::Point geom::getCenter | ( | size_t | dim, |
| const std::pair< util::Point, util::Point > & | box | ||
| ) |
Returns center point.
| dim | Dimension of the box |
| box | Pair of points representing cuboid (rectangle in 2d) |
Definition at line 102 of file geomUtilFunctions.cpp.
References util::Point::d_x.
Referenced by areBoxesNear(), circumscribedRadiusInBox(), geom::Circle::isNear(), geom::Ellipse::isNear(), geom::Sphere::isNear(), and test::testUtilMethods().
| std::vector< util::Point > geom::getCornerPoints | ( | size_t | dim, |
| const std::pair< util::Point, util::Point > & | box | ||
| ) |
Returns all corner points in the box.
| dim | Dimension of the box |
| box | Pair of points representing cuboid (rectangle in 2d) |
Definition at line 25 of file geomUtilFunctions.cpp.
References util::Point::d_x.
Referenced by areBoxesNear(), circumscribedRadiusInBox(), geom::AnnulusGeomObject::doesIntersect(), geom::ComplexGeomObject::doesIntersect(), geom::Triangle::doesIntersect(), geom::Square::doesIntersect(), geom::Rectangle::doesIntersect(), geom::Hexagon::doesIntersect(), geom::Drum2D::doesIntersect(), geom::Cube::doesIntersect(), geom::Cuboid::doesIntersect(), geom::Circle::doesIntersect(), geom::Ellipse::doesIntersect(), geom::Sphere::doesIntersect(), geom::Ellipsoid::doesIntersect(), geom::Cylinder::doesIntersect(), geom::OpenCuboidChannel3D::doesIntersect(), geom::OpenRectChannel2D::doesIntersect(), getEdges(), geom::AnnulusGeomObject::isInside(), geom::ComplexGeomObject::isInside(), geom::Triangle::isInside(), geom::Square::isInside(), geom::Rectangle::isInside(), geom::Hexagon::isInside(), geom::Drum2D::isInside(), geom::Cube::isInside(), geom::Cuboid::isInside(), geom::Circle::isInside(), geom::Ellipse::isInside(), geom::Sphere::isInside(), geom::Ellipsoid::isInside(), geom::Cylinder::isInside(), geom::OpenCuboidChannel3D::isInside(), geom::OpenRectChannel2D::isInside(), geom::Circle::isNear(), geom::Ellipse::isNear(), geom::Sphere::isNear(), geom::AnnulusGeomObject::isOutside(), geom::ComplexGeomObject::isOutside(), geom::Triangle::isOutside(), geom::Square::isOutside(), geom::Rectangle::isOutside(), geom::Hexagon::isOutside(), geom::Drum2D::isOutside(), geom::Cube::isOutside(), geom::Cuboid::isOutside(), geom::Circle::isOutside(), geom::Ellipse::isOutside(), geom::Sphere::isOutside(), geom::Ellipsoid::isOutside(), geom::Cylinder::isOutside(), geom::OpenCuboidChannel3D::isOutside(), geom::OpenRectChannel2D::isOutside(), and test::testUtilMethods().
| 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.
| dim | Dimension of the box |
| box | Pair of points representing cuboid (rectangle in 2d) |
Definition at line 54 of file geomUtilFunctions.cpp.
References getCornerPoints().
Referenced by test::testUtilMethods().
|
inline |
Returns list of acceptable geometries for PeriDEM simulation.
Definition at line 47 of file geomObjects.h.
References geom_type_to_dim.
Referenced by geom::AnnulusGeomObject::AnnulusGeomObject(), geom::ComplexGeomObject::ComplexGeomObject(), and anonymous_namespace{testMeshGen.cpp}::meshDimForBuiltin().
| std::vector< size_t > geom::getNumParamsRequired | ( | std::string | geom_type | ) |
Get num params required for creation of object.
| geom_type | Geometry type of object |
Definition at line 47 of file geomObjectsUtil.cpp.
Referenced by createGeomObject(), createGeomObjectOld(), isNumberOfParamForComplexGeometryValid(), and isNumberOfParamForGeometryValid().
| 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.
| p1 | Point 1 |
| p2 | Point 2 |
| s | Parametric coordinate |
Definition at line 361 of file geomUtilFunctions.cpp.
| 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.
| dim | Dimension of the box |
| box | Pair of corner points of the box |
Definition at line 194 of file geomUtilFunctions.cpp.
References util::isGreater().
Referenced by areBoxesNear(), geom::Circle::isNear(), geom::Ellipse::isNear(), and geom::Sphere::isNear().
| bool geom::isNumberOfParamForComplexGeometryValid | ( | size_t | n, |
| std::string | geom_type, | ||
| std::vector< std::string > | vec_type | ||
| ) |
Ascertain if number of parameters are correct for the given geometry.
| n | Number of parameters available |
| geom_type | Geometry type of object |
| vec_type | For complex objects, specify types of sub-objects |
Definition at line 107 of file geomObjectsUtil.cpp.
References getNumParamsRequired().
Referenced by checkParamForComplexGeometry(), and createGeomObjectOld().
| bool geom::isNumberOfParamForGeometryValid | ( | size_t | n, |
| std::string | geom_type | ||
| ) |
Ascertain if number of parameters are correct for the given geometry.
| n | Number of parameters available |
| geom_type | Geometry type of object |
Definition at line 102 of file geomObjectsUtil.cpp.
References getNumParamsRequired(), and util::methods::isInList().
Referenced by checkParamForGeometry(), and createGeomObjectOld().
| 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.
| x | Point |
| x_min | X coordinate of left-bottom corner point |
| x_max | X coordinate of right-top corner point |
| y_min | Y coordinate of left-bottom corner point |
| y_max | Y coordinate of right-top corner point |
| theta | Angle of orientation of rectangle from x-axis |
Definition at line 260 of file geomUtilFunctions.cpp.
References util::isGreater(), util::isLess(), and util::rotateCW2D().
| bool geom::isPointInsideBox | ( | util::Point | x, |
| size_t | dim, | ||
| const std::pair< util::Point, util::Point > & | box | ||
| ) |
Returns true if point is inside box.
| x | Point |
| dim | Dimension of the box |
| box | Pair of points representing cuboid (rectangle in 2d) |
Definition at line 170 of file geomUtilFunctions.cpp.
References util::Point::d_x, util::Point::d_y, util::Point::d_z, util::isGreater(), and util::isLess().
Referenced by areBoxesNear(), geom::Triangle::isNear(), geom::Square::isNear(), geom::Rectangle::isNear(), geom::Hexagon::isNear(), geom::Drum2D::isNear(), geom::Cube::isNear(), geom::Cuboid::isNear(), geom::OpenCuboidChannel3D::isNear(), and geom::OpenRectChannel2D::isNear().
| bool geom::isPointInsideCuboid | ( | util::Point | x, |
| util::Point | x_lbb, | ||
| util::Point | x_rtf | ||
| ) |
Checks if point is inside a cuboid.
| x | Point |
| x_lbb | Coordinate of left-bottom-back corner point |
| x_rtf | Coordinate of right-top-front corner point |
Definition at line 297 of file geomUtilFunctions.cpp.
References util::Point::d_x, util::Point::d_y, util::Point::d_z, util::isGreater(), and util::isLess().
Referenced by geom::Cube::isInside(), and geom::Cuboid::isInside().
| 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.
| p | Point |
| length | Length of cylinder |
| radius | Radius of cylinder |
| axis | Axis of cylinder |
Definition at line 307 of file geomUtilFunctions.cpp.
References util::Point::lengthSq().
| 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.
| p | Point |
| radius | Radius of cylinder |
| x1 | Point at the center of cross-section at s=0 |
| x2 | Point at the center of cross-section at s=L |
Definition at line 321 of file geomUtilFunctions.cpp.
References util::Point::lengthSq().
| 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.
| p | Point |
| center | Center of ellipse |
| radius_vec | Vector of radius describing ellipse |
| dim | Dimension |
Definition at line 339 of file geomUtilFunctions.cpp.
| 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.
Also computes d = x^2 / r1^2 + y^2 / r2^2 + z^2 / r3^2
| p | Point |
| center | Center of ellipse |
| radius_vec | Vector of radius describing ellipse |
| dim | Dimension |
| d |
Definition at line 350 of file geomUtilFunctions.cpp.
| 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.
| x | Point |
| x_min | X coordinate of left-bottom corner point |
| x_max | X coordinate of right-top corner point |
| y_min | Y coordinate of left-bottom corner point |
| y_max | Y coordinate of right-top corner point |
Definition at line 242 of file geomUtilFunctions.cpp.
References util::Point::d_x, util::Point::d_y, util::isGreater(), and util::isLess().
Referenced by geom::Square::isInside(), and geom::Rectangle::isInside().
| bool geom::isPointInsideRectangle | ( | util::Point | x, |
| util::Point | x_lb, | ||
| util::Point | x_rt | ||
| ) |
Checks if point is inside a rectangle.
| x | Point |
| x_lb | Coordinate of left-bottom corner point |
| x_rt | Coordinate of right-top corner point |
Definition at line 252 of file geomUtilFunctions.cpp.
References util::Point::d_x, util::Point::d_y, util::isGreater(), and util::isLess().
| std::shared_ptr< GeomObject > geom::makeExampleGeomObject | ( | const std::string & | geom_type, |
| const util::Point & | c, | ||
| double | s | ||
| ) |
One-liner: createGeomObject(exampleGeomParams(...)). Prefer this over per-class static factories so annulus and composite types stay in one place.
Definition at line 1308 of file geomObjectsUtil.cpp.
References createGeomObject(), and exampleGeomParams().
Referenced by anonymous_namespace{testMeshGen.cpp}::builtinMeshCheckForGeometry().
|
inline |
Rigid similarity then displacement: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). Pivot \(\mathbf p\) is rotationPoint if non-null, else pivotDefault (typically old center).
Definition at line 55 of file geomObjects.h.
References util::rotate().
Referenced by geom::Plane::transform(), geom::Line::transform(), geom::Triangle::transform(), geom::Square::transform(), geom::Rectangle::transform(), geom::Hexagon::transform(), geom::Drum2D::transform(), geom::Cube::transform(), geom::Cuboid::transform(), geom::Circle::transform(), geom::Ellipse::transform(), geom::Sphere::transform(), geom::Ellipsoid::transform(), geom::Cylinder::transform(), and geom::OpenCuboidChannel3D::transform().
| double geom::pointDistanceLine | ( | const util::Point & | p, |
| const std::pair< util::Point, util::Point > & | line | ||
| ) |
Compute distance between point and line.
| p | Point |
| line | Line |
Definition at line 513 of file geomUtilFunctions.cpp.
References util::Point::lengthSq().
| double geom::pointDistancePlane | ( | const util::Point & | p, |
| const std::pair< util::Point, util::Point > & | plane | ||
| ) |
Compute distance between point and plane.
| p | Point |
| plane | Plane given by pair of normal and one point which it contains |
Definition at line 551 of file geomUtilFunctions.cpp.
References util::Point::length().
| double geom::pointDistanceSegment | ( | const util::Point & | p, |
| const std::pair< util::Point, util::Point > & | line | ||
| ) |
Compute distance between point and line.
| p | Point |
| line | Line |
Definition at line 528 of file geomUtilFunctions.cpp.
References util::Point::length().
| void geom::readGeometry | ( | const json & | j, |
| geom::GeomData & | geomData | ||
| ) |
Definition at line 1374 of file geomObjectsUtil.cpp.
References geom::GeomData::d_geomComplexInfo, geom::GeomData::d_geomName, and geom::GeomData::d_geomParams.
Referenced by inp::BCBaseDeck::readFromJson(), and inp::ParticleDeck::readParticleGeomFromJson().
| std::pair< util::Point, util::Point > geom::toPointBox | ( | const std::vector< double > & | p1, |
| const std::vector< double > & | p2 | ||
| ) |
Create box from two coordinate data.
| p1 | Point 1 |
| p2 | Point 2 |
Definition at line 645 of file geomUtilFunctions.cpp.
| double geom::triangleArea | ( | const util::Point & | x1, |
| const util::Point & | x2, | ||
| const util::Point & | x3 | ||
| ) |
Compute area of triangle.
| x1 | Vertex 1 |
| x2 | Vertex 2 |
| x3 | Vertex 3 |
Definition at line 653 of file geomUtilFunctions.cpp.
References util::Point::d_x, and util::Point::d_y.
Referenced by geom::Triangle::isInside(), geom::Triangle::isNearBoundary(), test::testUtilMethods(), and geom::Triangle::volume().
| void geom::writeGeometry | ( | json & | j, |
| const geom::GeomData & | geomData | ||
| ) |
Definition at line 1363 of file geomObjectsUtil.cpp.
References geom::GeomData::d_geomComplexInfo, geom::GeomData::d_geomName, and geom::GeomData::d_geomParams.
Referenced by anonymous_namespace{main.cpp}::buildInputJson(), inp::BCBaseDeck::getExampleJson(), and inp::ParticleDeck::getParticleGeomExampleJson().
| const std::vector<std::string> geom::acceptable_geometries |
List of acceptable geometries for particles in PeriDEM.
Definition at line 127 of file geomObjectsUtil.h.
Referenced by getAcceptableGeometries().
| const std::map<std::string, size_t> geom::geom_type_to_dim |
Geometry type to dimension map.
Definition at line 27 of file geomObjects.h.
Referenced by getGeomTypeToDim().