![]() |
PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
Defines complex geometrical object. More...
#include <complexGeomObjects.h>
Public Member Functions | |
| ComplexGeomObject () | |
| Constructor. | |
| ComplexGeomObject (std::vector< std::shared_ptr< GeomObject > > &obj, std::vector< std::string > obj_flag, std::string description="") | |
| Constructor. | |
| ComplexGeomObject (const ComplexGeomObject &other) | |
| Copy constructor. | |
| ComplexGeomObject & | operator= (const ComplexGeomObject &other) |
| Assignment operator. | |
| void | transform (const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override |
| double | volume () const override |
| Computes the volume (area in 2d, length in 1d) of object. | |
| util::Point | center () const override |
| Computes the center of object. | |
| std::pair< util::Point, util::Point > | box () const override |
| Computes the bounding box of object. | |
| std::pair< util::Point, util::Point > | box (const double &tol) const override |
| Computes the bounding box of object. | |
| double | inscribedRadius () const override |
| Computes the radius of biggest circle/sphere completely within the object. | |
| double | boundingRadius () const override |
| Computes the radius of smallest circle/sphere such that object can be fit into it. | |
| std::string | printStr (int nt, int lvl) const override |
| Returns the string containing printable information about the object. | |
| void | print (int nt, int lvl) const override |
| Prints the information about the object. | |
| void | print () const override |
| Prints the information about the object. | |
Interaction with point | |
| bool | isInside (const util::Point &x) const override |
| Checks if point is inside this object. | |
| bool | isOutside (const util::Point &x) const override |
| Checks if point is outside of this object. | |
| bool | isNear (const util::Point &x, const double &tol) const override |
| Checks if point is within given distance of this object. | |
| bool | isNearBoundary (const util::Point &x, const double &tol, const bool &within) const override |
| cons | |
| bool | doesIntersect (const util::Point &x) const override |
| Checks if point lies exactly on the boundary. | |
Interaction with box | |
| bool | isInside (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box is completely inside. | |
| bool | isOutside (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box is outside of the object. | |
| bool | isNear (const std::pair< util::Point, util::Point > &box, const double &tol) const override |
| Checks if box is within given distance of this object. | |
| bool | doesIntersect (const std::pair< util::Point, util::Point > &box) const override |
| Checks if box intersects this object. | |
Public Member Functions inherited from geom::GeomObject | |
| GeomObject (std::string name="", std::string description="") | |
| Constructor. | |
| virtual bool | wallContactQuery (const util::Point &x, WallContactHit &hit) const |
Closest-point / signed-gap query for analytical wall contact. Default: unsupported (returns false, clears hit). | |
Data Fields | |
| std::vector< std::shared_ptr< GeomObject > > | d_obj |
| Object. | |
| std::vector< std::string > | d_objFlag |
| Object flag. | |
| std::vector< int > | d_objFlagInt |
| Object integer flags. Here, +1 means object is filling and -1 means object is void. | |
| size_t | d_dim |
| Dimension objects live in. | |
Data Fields inherited from geom::GeomObject | |
| const std::string | d_name |
| name of object | |
| const std::string | d_description |
| Further description of object. | |
| std::vector< std::string > | d_tags |
| Tags/attributes about the object. | |
Defines complex geometrical object.
Definition at line 263 of file complexGeomObjects.h.
|
inline |
Constructor.
Definition at line 291 of file complexGeomObjects.h.
|
inline |
Constructor.
| obj | Vector of geometrical objects |
| obj_flag | Specifies which objects are filling and which are void |
| description | Description of object (e.g., further classification or any tag) |
Definition at line 301 of file complexGeomObjects.h.
References d_dim, geom::GeomObject::d_name, d_obj, d_objFlag, d_objFlagInt, and geom::getGeomTypeToDim().
|
inline |
Copy constructor.
| other | Object to copy from |
Definition at line 328 of file complexGeomObjects.h.
References geom::createGeomDeepCopy(), d_obj, and geom::GeomObject::d_tags.
|
overridevirtual |
Computes the radius of smallest circle/sphere such that object can be fit into it.
Reimplemented from geom::GeomObject.
Definition at line 251 of file complexGeomObjects.cpp.
References box().
|
overridevirtual |
Computes the bounding box of object.
Reimplemented from geom::GeomObject.
Definition at line 217 of file complexGeomObjects.cpp.
References box().
Referenced by boundingRadius(), box(), doesIntersect(), inscribedRadius(), isInside(), isNear(), isOutside(), and printStr().
|
overridevirtual |
Computes the bounding box of object.
| tol | Tolerance/padding used in creating bounding box |
Reimplemented from geom::GeomObject.
Definition at line 223 of file complexGeomObjects.cpp.
|
overridevirtual |
Computes the center of object.
Reimplemented from geom::GeomObject.
Definition at line 194 of file complexGeomObjects.cpp.
References center(), d_obj, d_objFlag, d_objFlagInt, util::isGreater(), util::methods::maxIndex(), and volume().
Referenced by center(), printStr(), and transform().
|
overridevirtual |
Checks if box intersects this object.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 348 of file complexGeomObjects.cpp.
References box(), d_dim, geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point lies exactly on the boundary.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 308 of file complexGeomObjects.cpp.
References isNearBoundary().
|
overridevirtual |
Computes the radius of biggest circle/sphere completely within the object.
Reimplemented from geom::GeomObject.
Definition at line 245 of file complexGeomObjects.cpp.
References box().
|
overridevirtual |
Checks if box is completely inside.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 314 of file complexGeomObjects.cpp.
References box(), d_dim, geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point is inside this object.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 258 of file complexGeomObjects.cpp.
References d_obj, d_objFlag, and d_objFlagInt.
Referenced by doesIntersect(), isInside(), isOutside(), and isOutside().
|
overridevirtual |
Checks if box is within given distance of this object.
| box | Box |
| tol | Tolerance used in checking the nearness |
Reimplemented from geom::GeomObject.
Definition at line 334 of file complexGeomObjects.cpp.
References box(), d_obj, and d_objFlag.
|
overridevirtual |
Checks if point is within given distance of this object.
| x | Point |
| tol | Tolerance used in checking the nearness |
Reimplemented from geom::GeomObject.
Definition at line 280 of file complexGeomObjects.cpp.
|
overridevirtual |
cons
cons
Reimplemented from geom::GeomObject.
Definition at line 293 of file complexGeomObjects.cpp.
References d_obj, and d_objFlag.
Referenced by doesIntersect().
|
overridevirtual |
Checks if box is outside of the object.
| box | Box |
Reimplemented from geom::GeomObject.
Definition at line 324 of file complexGeomObjects.cpp.
References box(), d_dim, geom::getCornerPoints(), and isInside().
|
overridevirtual |
Checks if point is outside of this object.
| x | Point |
Reimplemented from geom::GeomObject.
Definition at line 276 of file complexGeomObjects.cpp.
References isInside().
|
inline |
Assignment operator.
| other | Object to copy from |
Definition at line 354 of file complexGeomObjects.h.
References geom::createGeomDeepCopy(), d_dim, d_obj, d_objFlag, d_objFlagInt, and geom::GeomObject::d_tags.
|
inlineoverridevirtual |
Prints the information about the object.
Reimplemented from geom::GeomObject.
Definition at line 515 of file complexGeomObjects.h.
References print().
Referenced by print().
|
inlineoverridevirtual |
Prints the information about the object.
| nt | Number of tabs to append before printing |
| lvl | Information level (higher means more information) |
Reimplemented from geom::GeomObject.
Definition at line 508 of file complexGeomObjects.h.
References printStr().
|
overridevirtual |
Returns the string containing printable information about the object.
| nt | Number of tabs to append before printing |
| lvl | Information level (higher means more information) |
Reimplemented from geom::GeomObject.
Definition at line 360 of file complexGeomObjects.cpp.
References box(), center(), geom::GeomObject::d_name, d_obj, d_objFlag, d_objFlagInt, util::io::getTabS(), util::io::printBoxStr(), and util::Point::printStr().
Referenced by print().
|
inlineoverridevirtual |
If rotationPoint is null, pivot is center() (signed-volume centroid of the composite).
Reimplemented from geom::GeomObject.
Definition at line 384 of file complexGeomObjects.h.
References center(), and d_obj.
|
overridevirtual |
Computes the volume (area in 2d, length in 1d) of object.
Reimplemented from geom::GeomObject.
Definition at line 185 of file complexGeomObjects.cpp.
References d_obj, d_objFlag, d_objFlagInt, and volume().
Referenced by center(), and volume().
| size_t geom::ComplexGeomObject::d_dim |
Dimension objects live in.
Definition at line 285 of file complexGeomObjects.h.
Referenced by ComplexGeomObject(), doesIntersect(), isInside(), isOutside(), and operator=().
| std::vector<std::shared_ptr<GeomObject> > geom::ComplexGeomObject::d_obj |
Object.
Definition at line 267 of file complexGeomObjects.h.
Referenced by box(), mesh_gen::anonymous_namespace{builtinGmshGeometry.cpp}::buildComplexRectangles2DOcc(), center(), ComplexGeomObject(), ComplexGeomObject(), isInside(), isNear(), isNear(), isNearBoundary(), operator=(), printStr(), transform(), and volume().
| std::vector<std::string> geom::ComplexGeomObject::d_objFlag |
Object flag.
Ordering of objects is important. To describe a rectangle with circular hole, we will have d_obj = {rectangle, circle} and have flag = {plus, minus}. This means final object is rectangle - circle
Definition at line 277 of file complexGeomObjects.h.
Referenced by box(), center(), ComplexGeomObject(), isInside(), isNear(), isNear(), isNearBoundary(), operator=(), printStr(), and volume().
| std::vector<int> geom::ComplexGeomObject::d_objFlagInt |
Object integer flags. Here, +1 means object is filling and -1 means object is void.
Definition at line 282 of file complexGeomObjects.h.
Referenced by mesh_gen::anonymous_namespace{builtinGmshGeometry.cpp}::buildComplexRectangles2DOcc(), center(), ComplexGeomObject(), isInside(), operator=(), printStr(), and volume().