PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
util::geometry::BoxPartition Struct Reference

Defines simple rectangle domain. More...

#include <geomObjectsUtil.h>

Collaboration diagram for util::geometry::BoxPartition:

Public Member Functions

 BoxPartition ()
 
bool isNear (const BoxPartition &box, const double &tol) const
 
bool isNear (const util::Point &x, const double &tol) const
 
void addNode (const size_t &i)
 

Data Fields

util::Point d_xc
 
std::pair< util::Point, util::Pointd_box
 
double d_r
 
std::vector< size_t > d_nodes
 

Detailed Description

Defines simple rectangle domain.

Definition at line 147 of file geomObjectsUtil.h.

Constructor & Destructor Documentation

◆ BoxPartition()

util::geometry::BoxPartition::BoxPartition ( )
inline

Definition at line 154 of file geomObjectsUtil.h.

154 : d_xc(util::Point()),
156 d_r(0.) {}
A structure to represent 3d vectors.
Definition point.h:30
std::pair< util::Point, util::Point > d_box

Member Function Documentation

◆ addNode()

void util::geometry::BoxPartition::addNode ( const size_t &  i)
inline

Definition at line 176 of file geomObjectsUtil.h.

176 {
177 for (const auto &j: d_nodes)
178 if (j == i)
179 return;
180
181 d_nodes.push_back(i);
182}
std::vector< size_t > d_nodes

References d_nodes.

◆ isNear() [1/2]

bool util::geometry::BoxPartition::isNear ( const BoxPartition box,
const double &  tol 
) const
inline

Definition at line 158 of file geomObjectsUtil.h.

158 {
159 auto dx = d_xc - box.d_xc;
160 return dx.length() < d_r + box.d_r + tol;
161}
double length() const
Computes the Euclidean length of the vector.
Definition point.h:118

References d_r, d_xc, and util::Point::length().

Here is the call graph for this function:

◆ isNear() [2/2]

bool util::geometry::BoxPartition::isNear ( const util::Point x,
const double &  tol 
) const
inline

Definition at line 163 of file geomObjectsUtil.h.

163 {
164
165 if (util::isLess(x.d_x, d_box.first.d_x - tol) or
166 util::isLess(x.d_y, d_box.first.d_y - tol) or
167 util::isLess(x.d_z, d_box.first.d_z - tol) or
168 util::isGreater(x.d_x, d_box.second.d_x + tol) or
169 util::isGreater(x.d_y, d_box.second.d_y + tol) or
170 util::isGreater(x.d_z, d_box.second.d_z + tol))
171 return false;
172
173 return true;
174}
bool isGreater(const double &a, const double &b)
Returns true if a > b.
Definition function.cpp:15
bool isLess(const double &a, const double &b)
Returns true if a < b.
Definition function.cpp:20
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 d_box, util::Point::d_x, util::Point::d_y, util::Point::d_z, util::isGreater(), and util::isLess().

Here is the call graph for this function:

Field Documentation

◆ d_box

std::pair<util::Point, util::Point> util::geometry::BoxPartition::d_box

Definition at line 150 of file geomObjectsUtil.h.

Referenced by isNear().

◆ d_nodes

std::vector<size_t> util::geometry::BoxPartition::d_nodes

Definition at line 152 of file geomObjectsUtil.h.

Referenced by addNode().

◆ d_r

double util::geometry::BoxPartition::d_r

Definition at line 151 of file geomObjectsUtil.h.

Referenced by isNear().

◆ d_xc

util::Point util::geometry::BoxPartition::d_xc

Definition at line 149 of file geomObjectsUtil.h.

Referenced by isNear().


The documentation for this struct was generated from the following file: