23 min[0] = max[0] = v->
x();
24 min[1] = max[1] = v->
y();
25 min[2] = max[2] = v->
z();
28 min[0] = std::min(min[0], v->
x());
29 max[0] = std::max(max[0], v->
x());
30 min[1] = std::min(min[1], v->
y());
31 max[1] = std::max(max[1], v->
y());
32 min[2] = std::min(min[2], v->
z());
33 max[2] = std::max(max[2], v->
z());
39 min[0] = max[0] = bezNodes(0, 0);
40 min[1] = max[1] = bezNodes(0, 1);
41 min[2] = max[2] = bezNodes(0, 2);
43 min[0] = std::min(min[0], bezNodes(i, 0));
44 max[0] = std::max(max[0], bezNodes(i, 0));
45 min[1] = std::min(min[1], bezNodes(i, 1));
46 max[1] = std::max(max[1], bezNodes(i, 1));
47 min[2] = std::min(min[2], bezNodes(i, 2));
48 max[2] = std::max(max[2], bezNodes(i, 2));
56 max[0] = bb.
max().
x();
57 max[1] = bb.
max().
y();
58 max[2] = bb.
max().
z();
59 min[0] = bb.
min().
x();
60 min[1] = bb.
min().
y();
61 min[2] = bb.
min().
z();
72 for(
int i = 1; i < n; i++) {
78 double oc = 1. / (double)n;
89 return e->
isInside(uvw[0], uvw[1], uvw[2]) ? 1 : 0;
97 double min[3] = {bbmin.
x(), bbmin.
y(), bbmin.
z()};
98 double size[3] = {bbmax.x() - bbmin.
x(), bbmax.y() - bbmin.
y(),
99 bbmax.z() - bbmin.
z()};
100 const int maxElePerBucket = 100;
103 std::vector<GEntity *> entities;
106 for(std::size_t i = 0; i < entities.size(); i++) {
107 for(std::size_t j = 0; j < entities[i]->getNumMeshElements(); j++) {
108 if(entities[i]->dim() == 0) {
110 if(gv && gv->
edges().size() > 0) {
122 : _gm(nullptr), _elems(v)
125 for(std::size_t i = 0; i < v.size(); i++) {
126 for(std::size_t j = 0; j < v[i]->getNumVertices(); j++) {
127 bb +=
SPoint3(v[i]->getVertex(j)->x(), v[i]->getVertex(j)->y(),
128 v[i]->getVertex(j)->
z());
133 double min[3] = {bbmin.
x(), bbmin.
y(), bbmin.
z()};
134 double size[3] = {bbmax.x() - bbmin.
x(), bbmax.y() - bbmin.
y(),
135 bbmax.z() - bbmin.
z()};
136 const int maxElePerBucket = 100;
146 int dim,
bool strict)
const
149 double tolIncr = 10.;
151 double P[3] = {x, y,
z};
152 std::vector<void *> v;
153 std::vector<MElement *> e;
155 for(
auto it = v.begin(); it != v.end(); ++it) {
157 if(dim == -1 || el->
getDim() == dim) e.push_back(el);
159 if(e.empty() && !strict &&
_gm) {
161 double tol = initialTol;
162 while(tol < maxTol) {
165 std::vector<GEntity *> entities;
167 for(std::size_t i = 0; i < entities.size(); i++) {
168 for(std::size_t j = 0; j < entities[i]->getNumMeshElements(); j++) {
169 MElement *el = entities[i]->getMeshElement(j);
170 if(dim == -1 || el->
getDim() == dim) {
182 else if(e.empty() && !strict && !
_gm) {
184 double tol = initialTol;
185 while(tol < maxTol) {
188 for(std::size_t i = 0; i <
_elems.size(); i++) {
190 if(dim == -1 || el->
getDim() == dim) {
208 double P[3] = {x, y,
z};
210 if(e && (dim == -1 || e->
getDim() == dim))
return e;
211 std::vector<void *> l;
212 if(e && e->
getDim() != dim) {
214 for(
auto it = l.begin(); it != l.end(); it++) {
216 if(el->
getDim() == dim) {
return el; }
221 double tol = initialTol;
225 std::vector<GEntity *> entities;
227 for(std::size_t i = 0; i < entities.size(); i++) {
228 for(std::size_t j = 0; j < entities[i]->getNumMeshElements(); j++) {
229 e = entities[i]->getMeshElement(j);
230 if(dim == -1 || e->
getDim() == dim) {
242 else if(!strict && !
_gm) {
244 double tol = initialTol;
248 for(std::size_t i = 0; i <
_elems.size(); i++) {
250 if(dim == -1 || e->
getDim() == dim) {