PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
geom::anonymous_namespace{openCuboidChannel3D.cpp} Namespace Reference

Functions

void validateParams (double x0, double y0, double z0, double x1, double y1, double z1, double t, int open_face)
 
void cornersFromAabb (const util::Point &lo, const util::Point &hi, util::Point *out8)
 
void aabbFromCorners (const util::Point *c, util::Point &lo, util::Point &hi)
 

Function Documentation

◆ aabbFromCorners()

void geom::anonymous_namespace{openCuboidChannel3D.cpp}::aabbFromCorners ( const util::Point c,
util::Point lo,
util::Point hi 
)

Definition at line 48 of file openCuboidChannel3D.cpp.

48 {
49 lo = hi = c[0];
50 for (int i = 1; i < 8; ++i) {
51 lo.d_x = std::min(lo.d_x, c[i].d_x);
52 lo.d_y = std::min(lo.d_y, c[i].d_y);
53 lo.d_z = std::min(lo.d_z, c[i].d_z);
54 hi.d_x = std::max(hi.d_x, c[i].d_x);
55 hi.d_y = std::max(hi.d_y, c[i].d_y);
56 hi.d_z = std::max(hi.d_z, c[i].d_z);
57 }
58}
double d_y
the y coordinate
Definition point.h:36
double d_z
the z coordinate
Definition point.h:39
double d_x
the x coordinate
Definition point.h:33

References aabbFromCorners(), util::Point::d_x, util::Point::d_y, and util::Point::d_z.

Referenced by aabbFromCorners().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cornersFromAabb()

void geom::anonymous_namespace{openCuboidChannel3D.cpp}::cornersFromAabb ( const util::Point lo,
const util::Point hi,
util::Point out8 
)

Definition at line 35 of file openCuboidChannel3D.cpp.

35 {
36 const double x0 = lo.d_x, y0 = lo.d_y, z0 = lo.d_z;
37 const double x1 = hi.d_x, y1 = hi.d_y, z1 = hi.d_z;
38 out8[0] = {x0, y0, z0};
39 out8[1] = {x1, y0, z0};
40 out8[2] = {x1, y1, z0};
41 out8[3] = {x0, y1, z0};
42 out8[4] = {x0, y0, z1};
43 out8[5] = {x1, y0, z1};
44 out8[6] = {x1, y1, z1};
45 out8[7] = {x0, y1, z1};
46}

References cornersFromAabb(), util::Point::d_x, util::Point::d_y, and util::Point::d_z.

Referenced by cornersFromAabb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateParams()

void geom::anonymous_namespace{openCuboidChannel3D.cpp}::validateParams ( double  x0,
double  y0,
double  z0,
double  x1,
double  y1,
double  z1,
double  t,
int  open_face 
)

Definition at line 22 of file openCuboidChannel3D.cpp.

23 {
24 constexpr double eps = 1.0e-12;
25 if (!(x1 > x0 + eps && y1 > y0 + eps && z1 > z0 + eps && t > eps))
26 throw std::runtime_error(
27 "OpenCuboidChannel3D: require x0<x1, y0<y1, z0<z1, t>0.");
28 if (!(x1 - x0 > 2. * t + eps && y1 - y0 > 2. * t + eps && z1 - z0 > 2. * t + eps))
29 throw std::runtime_error(
30 "OpenCuboidChannel3D: each outer span must exceed 2*t so the inner cavity exists.");
31 if (open_face < 0 || open_face > 5)
32 throw std::runtime_error("OpenCuboidChannel3D: open_face must be in 0..5 (±x,±y,±z).");
33}

References validateParams().

Referenced by validateParams().

Here is the call graph for this function:
Here is the caller graph for this function: