MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / isPointInVolume

Method isPointInVolume

SRC/domain/pattern/drm/GeometricBrickDecorator.cpp:57–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool
58GeometricBrickDecorator::isPointInVolume(const Vector &pP)
59{
60 if ( (this->isClear()) || (this->isEmpty()) ) {
61 return false;
62 }
63
64 const ID extNodes = this->myBrick->getExternalNodes();
65
66 int numExtNodes = this->myBrick->getNumExternalNodes();
67
68 if ( numExtNodes != 8) {
69 return false;
70 }
71
72 // Calculate signed volumes for point and four faces of brick
73 // in order for the point to be included they must all be
74 // of negative sign given the orientations used
75 // also global X+ is 1-4
76 // global Y+ is 2-3
77 // global Z+ is 1-5
78 // implicit is the assupmtion that element is created
79 // as such that lower left node is node 1, total = 8
80 // bottom plane is nodes : 1-2-3-4
81 // top plane is nodes : 5-6-7-8
82 // and this is the order by which the element is
83 // defined
84
85
86 // must be less than 0
87 double bFSV = this->evalSignedVol(
88 this->myDomain->getNode(extNodes(0))->getCrds(),
89 this->myDomain->getNode(extNodes(1))->getCrds(),
90 this->myDomain->getNode(extNodes(2))->getCrds(),
91 pP);
92 // must be less than 0
93 double tFSV = this->evalSignedVol(
94 this->myDomain->getNode(extNodes(6))->getCrds(),
95 this->myDomain->getNode(extNodes(5))->getCrds(),
96 this->myDomain->getNode(extNodes(4))->getCrds(),
97 pP);
98 // must be less than 0
99 double lFSV = this->evalSignedVol(
100 this->myDomain->getNode(extNodes(3))->getCrds(),
101 this->myDomain->getNode(extNodes(7))->getCrds(),
102 this->myDomain->getNode(extNodes(4))->getCrds(),
103 pP);
104 // must be less than 0
105 double rFSV = this->evalSignedVol(
106 this->myDomain->getNode(extNodes(2))->getCrds(),
107 this->myDomain->getNode(extNodes(1))->getCrds(),
108 this->myDomain->getNode(extNodes(5))->getCrds(),
109 pP);
110 if ( (bFSV < 0) && (tFSV < 0) && (lFSV < 0)
111 && (rFSV < 0)) {
112 return true;
113 }
114

Callers

nothing calls this directly

Calls 6

isClearMethod · 0.95
isEmptyMethod · 0.95
evalSignedVolMethod · 0.95
getCrdsMethod · 0.80
getNumExternalNodesMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected