PeriDEM 0.2.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 21 of file tetElem.cpp.

21 {
22
23 // check to see if p is in reference tet element
24 bool check = false;
25 if (util::isLess(p[0], -1.0E-5) || util::isLess(p[1], -1.0E-5) || util::isLess(p[2], -1.0E-5) ||
26 util::isGreater(p[0], 1. + 1.0E-5) ||
27 util::isGreater(p[1], 1. + 1.0E-5) ||
28 util::isGreater(p[2], 1. + 1.0E-5)) {
29
30 check = true;
31 }
32
33 if (!check) {
34
35 // check if projection of point in x, y, z plane is within the limit
36 if (util::isGreater(p[0], 1. + 1.0E-5 - p[1]))
37 check = true;
38
39 if (util::isGreater(p[1], 1. + 1.0E-5 - p[2]))
40 check = true;
41
42 if (util::isGreater(p[2], 1. + 1.0E-5 - p[0]))
43 check = true;
44 }
45
46 if (check) {
47 std::cerr << "Error: Point p = ("
48 << p[0] << ", " << p[1] << ", " << p[2]
49 << ") does not belong to reference tet element = {("
50 << nodes[0].d_x << ", " << nodes[0].d_y << ", " << nodes[0].d_z
51 << "), ("
52 << nodes[1].d_x << "," << nodes[1].d_y << ", " << nodes[1].d_z
53 << "), ("
54 << nodes[2].d_x << "," << nodes[2].d_y << ", " << nodes[2].d_z
55 << "), ("
56 << nodes[3].d_x << "," << nodes[3].d_y << ", " << nodes[3].d_z
57 << ")}.\n"
58 << "Coordinates in reference element are: "
59 << "xi = " << p[0]
60 << ", eta = " << p[1]
61 << ", zeta = " << p[2] << "\n";
62 exit(1);
63 }
64}
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

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

Here is the call graph for this function: