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

Functions

void checkPoint (const std::vector< double > &p, const std::vector< util::Point > &nodes)
 

Function Documentation

◆ checkPoint()

void anonymous_namespace{tetElem.cpp}::checkPoint ( const std::vector< double > &  p,
const std::vector< util::Point > &  nodes 
)

Definition at line 22 of file tetElem.cpp.

22 {
23
24 // check to see if p is in reference tet element
25 bool check = false;
26 if (util::isLess(p[0], -1.0E-5) || util::isLess(p[1], -1.0E-5) || util::isLess(p[2], -1.0E-5) ||
27 util::isGreater(p[0], 1. + 1.0E-5) ||
28 util::isGreater(p[1], 1. + 1.0E-5) ||
29 util::isGreater(p[2], 1. + 1.0E-5)) {
30
31 check = true;
32 }
33
34 if (!check) {
35
36 // check if projection of point in x, y, z plane is within the limit
37 if (util::isGreater(p[0], 1. + 1.0E-5 - p[1]))
38 check = true;
39
40 if (util::isGreater(p[1], 1. + 1.0E-5 - p[2]))
41 check = true;
42
43 if (util::isGreater(p[2], 1. + 1.0E-5 - p[0]))
44 check = true;
45 }
46
47 if (check) {
48 throw std::runtime_error(
50 << "Error: Point p = ("
51 << p[0] << ", " << p[1] << ", " << p[2]
52 << ") does not belong to reference tet element = {("
53 << nodes[0].d_x << ", " << nodes[0].d_y << ", " << nodes[0].d_z
54 << "), ("
55 << nodes[1].d_x << "," << nodes[1].d_y << ", " << nodes[1].d_z
56 << "), ("
57 << nodes[2].d_x << "," << nodes[2].d_y << ", " << nodes[2].d_z
58 << "), ("
59 << nodes[3].d_x << "," << nodes[3].d_y << ", " << nodes[3].d_z
60 << ")}.\n"
61 << "Coordinates in reference element are: "
62 << "xi = " << p[0]
63 << ", eta = " << p[1]
64 << ", zeta = " << p[2] << "\n");
65 }
66}
Collects a message with stream syntax for use in an exception.
Definition io.h:52
bool isGreater(const double &a, const double &b)
Returns true if a > b.
Definition function.cpp:17
bool isLess(const double &a, const double &b)
Returns true if a < b.
Definition function.cpp:22

References util::isGreater(), and util::isLess().

Here is the call graph for this function: