PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
openCuboidChannel3D.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2026 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0.
8 */
9
10#ifndef GEOM_OPEN_CUBOID_CHANNEL_3D_H
11#define GEOM_OPEN_CUBOID_CHANNEL_3D_H
12
13#include "geomObjects.h"
14#include <string>
15#include <utility>
16#include <vector>
17
18namespace geom {
19
35public:
41 double d_t = 0.;
45 int d_openFace = 0;
46
49
51
52 OpenCuboidChannel3D(double x0, double y0, double z0, double x1, double y1, double z1, double t,
53 int open_face, std::string description = "");
54
56
58
59 void transform(const util::Point &translation, const double &scale, const double &angle,
60 const util::Point &axis, const util::Point *rotationPoint) override;
61
62 double volume() const override;
63 util::Point center() const override;
64 std::pair<util::Point, util::Point> box() const override;
65 std::pair<util::Point, util::Point> box(const double &tol) const override;
66 double inscribedRadius() const override;
67 double boundingRadius() const override;
68
69 bool isInside(const util::Point &x) const override;
70 bool isOutside(const util::Point &x) const override;
71 bool isNear(const util::Point &x, const double &tol) const override;
72 bool isNearBoundary(const util::Point &x, const double &tol, const bool &within) const override;
73 bool doesIntersect(const util::Point &x) const override;
74
75 bool isInside(const std::pair<util::Point, util::Point> &bx) const override;
76 bool isOutside(const std::pair<util::Point, util::Point> &bx) const override;
77 bool isNear(const std::pair<util::Point, util::Point> &bx, const double &tol) const override;
78 bool doesIntersect(const std::pair<util::Point, util::Point> &bx) const override;
79
80 std::string printStr(int nt = 0, int lvl = 0) const override;
81 void print(int nt = 0, int lvl = 0) const override { std::cout << printStr(nt, lvl); };
82 void print() const override { print(0, 0); };
83
84private:
86 bool inClosedShell(const util::Point &p) const;
87 bool inRemovedFaceSlab(const util::Point &p) const;
89};
90
91} // namespace geom
92
93#endif
Defines abstract geometrical domain.
Hollow axis-aligned cuboid shell with uniform wall thickness and one outer face open.
int d_openFace
Which outer face is open: 0=+x, 1=−x, 2=+y, 3=−y, 4=+z, 5=−z (world axes after transform).
void print(int nt=0, int lvl=0) const override
Prints the information about the object.
bool inClosedShell(const util::Point &p) const
bool inRemovedFaceSlab(const util::Point &p) const
util::Point d_x
Centroid of the open shell (cached).
double volume() const override
Computes the volume (area in 2d, length in 1d) of object.
void transform(const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override
Similarity about pivot (default: old center d_x), then rigid displacement = translation: ....
bool isNear(const util::Point &x, const double &tol) const override
Checks if point is within given distance of this object.
double inscribedRadius() const override
Computes the radius of biggest circle/sphere completely within the object.
bool isInside(const util::Point &x) const override
Checks if point is inside this object.
util::Point d_lo
Outer AABB low corner.
util::Point center() const override
Computes the center of object.
bool isOutside(const util::Point &x) const override
Checks if point is outside of this object.
bool isNearBoundary(const util::Point &x, const double &tol, const bool &within) const override
Checks if point is within given distance of this object.
bool doesIntersect(const util::Point &x) const override
Checks if point lies exactly on the boundary.
OpenCuboidChannel3D & operator=(const OpenCuboidChannel3D &other)
void print() const override
Prints the information about the object.
std::pair< util::Point, util::Point > box() const override
Computes the bounding box of object.
double boundingRadius() const override
Computes the radius of smallest circle/sphere such that object can be fit into it.
double d_t
Wall thickness.
std::string printStr(int nt=0, int lvl=0) const override
Returns the string containing printable information about the object.
util::Point d_hi
Outer AABB high corner.
A structure to represent 3d vectors.
Definition point.h:30