48 #ifndef CORE_DATATYPES_STRUCTHEXVOLMESH_H
49 #define CORE_DATATYPES_STRUCTHEXVOLMESH_H 1
74 template <
class Basis>
88 #if (SCIRUN_STRUCTHEXVOL_SUPPORT > 0)
95 template <
class Basis>
96 class StructHexVolMesh :
public LatVolMesh<Basis>
134 return (index_.i_ + mesh_.get_ni()*index_.j_ +
135 mesh_.get_ni()*mesh_.get_nj()*index_.k_);
139 return (index_.i_+ 1 + mesh_.get_ni()*index_.j_ +
140 mesh_.get_ni()*mesh_.get_nj()*index_.k_);
144 return (index_.i_ + 1 + mesh_.get_ni()*(index_.j_ + 1) +
145 mesh_.get_ni()*mesh_.get_nj()*index_.k_);
150 return (index_.i_ + mesh_.get_ni()*(index_.j_ + 1) +
151 mesh_.get_ni()*mesh_.get_nj()*index_.k_);
155 return (index_.i_ + mesh_.get_ni()*index_.j_ +
156 mesh_.get_ni()*mesh_.get_nj()*(index_.k_ + 1));
160 return (index_.i_ + 1 + mesh_.get_ni()*index_.j_ +
161 mesh_.get_ni()*mesh_.get_nj()*(index_.k_ + 1));
166 return (index_.i_ + 1 + mesh_.get_ni()*(index_.j_ + 1) +
167 mesh_.get_ni()*mesh_.get_nj()*(index_.k_ + 1));
171 return (index_.i_ + mesh_.get_ni()*(index_.j_ + 1) +
172 mesh_.get_ni()*mesh_.get_nj()*(index_.k_ + 1));
177 return mesh_.points_(index_.k_, index_.j_, index_.i_);
181 return mesh_.points_(index_.k_, index_.j_, index_.i_+1);
185 return mesh_.points_(index_.k_, index_.j_+1, index_.i_+1);
189 return mesh_.points_(index_.k_, index_.j_+1, index_.i_);
193 return mesh_.points_(index_.k_+1, index_.j_, index_.i_);
197 return mesh_.points_(index_.k_+1, index_.j_, index_.i_+1);
201 return mesh_.points_(index_.k_+1, index_.j_+1, index_.i_+1);
205 return mesh_.points_(index_.k_+1, index_.j_+1, index_.i_);
220 virtual bool get_dim(std::vector<size_type>&)
const;
221 virtual void set_dim(
const std::vector<size_type>& dims) {
226 points_.resize(dims[2], dims[1], dims[0]);
275 std::vector<double>& coords,
288 template<
class INDEX>
298 template<
class INDEX,
class ARRAY>
308 template<
class INDEX,
class ARRAY>
314 double maxdist)
const
320 if (this->
ni_ == 0 || this->
nj_ == 0 || this->
nk_ == 0)
return (
false);
322 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
325 if (elem.i_ >= 0 && elem.i_ < (this->ni_-1) &&
326 elem.j_ >= 0 && elem.j_ < (this->nj_-1) &&
327 elem.k_ >= 0 && elem.k_ < (this->nk_-1))
333 this->
basis_.get_coords(coords,p,ed);
341 "StructHexVolMesh: need to synchronize ELEM_LOCATE_E first");
345 if (elem_grid_->lookup(it, eit, p))
353 this->
basis_.get_coords(coords,p,ed);
366 const size_type ni = elem_grid_->get_ni()-1;
367 const size_type nj = elem_grid_->get_nj()-1;
368 const size_type nk = elem_grid_->get_nk()-1;
372 elem_grid_->unsafe_locate(bi, bj, bk, p);
375 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
376 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
377 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
379 ei = bi; ej = bj; ek = bk;
381 double dmin = maxdist;
383 bool found_one =
false;
392 if (i < 0 || i > ni)
continue;
395 if (j < 0 || j > nj)
continue;
398 if (k < 0 || k > nk)
continue;
399 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
401 if (elem_grid_->min_distance_squared(p, i, j, k) < dmin)
405 elem_grid_->lookup_ijk(it,eit, i, j, k);
420 points_(kk+1,jj+1,ii),
421 points_(kk+1,jj,ii));
422 const double dtmp = (p - r).length2();
430 if (dmin < epsilon2_)
433 this->
basis_.get_coords(coords,result,ed);
435 result = this->
basis_.interpolate(coords,ed);
436 pdist = sqrt((result-p).length2());
442 if (ii == this->
ni_-2)
446 points_(kk,jj+1,ii+1),
447 points_(kk+1,jj+1,ii+1),
448 points_(kk+1,jj,ii+1));
449 const double dtmp = (p - r).length2();
457 if (dmin < epsilon2_)
460 this->
basis_.get_coords(coords,result,ed);
462 result = this->
basis_.interpolate(coords,ed);
463 pdist = sqrt((result-p).length2());
474 points_(kk+1,jj,ii+1),
475 points_(kk+1,jj,ii));
476 const double dtmp = (p - r).length2();
484 if (dmin < epsilon2_)
487 this->
basis_.get_coords(coords,result,ed);
489 result = this->
basis_.interpolate(coords,ed);
490 pdist = sqrt((result-p).length2());
496 if (jj == this->
nj_-2)
500 points_(kk,jj+1,ii+1),
501 points_(kk+1,jj+1,ii+1),
502 points_(kk+1,jj+1,ii));
503 const double dtmp = (p - r).length2();
511 if (dmin < epsilon2_)
514 this->
basis_.get_coords(coords,result,ed);
516 result = this->
basis_.interpolate(coords,ed);
517 pdist = sqrt((result-p).length2());
528 points_(kk,jj+1,ii+1),
529 points_(kk,jj+1,ii));
530 const double dtmp = (p - r).length2();
538 if (dmin < epsilon2_)
541 this->
basis_.get_coords(coords,result,ed);
543 result = this->
basis_.interpolate(coords,ed);
544 pdist = sqrt((result-p).length2());
550 if (kk == this->
nk_-2)
554 points_(kk+1,jj,ii+1),
555 points_(kk+1,jj+1,ii+1),
556 points_(kk+1,jj+1,ii));
557 const double dtmp = (p - r).length2();
565 if (dmin < epsilon2_)
568 this->
basis_.get_coords(coords,result,ed);
570 result = this->
basis_.interpolate(coords,ed);
571 pdist = sqrt((result-p).length2());
590 if (!found_one)
return (
false);
593 this->
basis_.get_coords(coords,result,ed);
595 result = this->
basis_.interpolate(coords,ed);
596 dmin = (result-p).length2();
610 {
ASSERTFAIL(
"StructHexVolMesh::get_weights for edges isn't supported"); }
613 {
ASSERTFAIL(
"StructHexVolMesh::get_weights for faces isn't supported"); }
631 template<
class VECTOR>
636 return this->
basis_.get_coords(coords, p, ed);
641 template<
class VECTOR>
646 pt = this->
basis_.interpolate(coords, ed);
653 template<
class VECTOR1,
class VECTOR2>
659 this->
basis_.derivate(coords, ed, J);
665 template<
class VECTOR>
677 template<
class VECTOR>
684 this->
basis_.derivate(coords,ed,Jv);
700 template<
class VECTOR>
707 this->
basis_.derivate(coords,ed,Jv);
731 size_t num_vertices = this->
basis_.number_of_vertices();
732 for (
size_t j=0;j < num_vertices;j++)
734 this->
basis_.derivate(this->
basis_.unit_vertices[j],ed,Jv);
736 if(temp < min_jacobian) min_jacobian = temp;
739 return (min_jacobian);
751 size_t num_vertices = this->
basis_.number_of_vertices();
752 for (
size_t j=0;j < num_vertices;j++)
754 this->
basis_.derivate(this->
basis_.unit_vertices[j],ed,Jv);
756 if(temp < min_jacobian) min_jacobian = temp;
759 return (min_jacobian);
764 {
return (epsilon_); }
774 static const std::string
type_name(
int n = -1);
795 return boost::make_shared<StructHexVolMesh<Basis>>(x,y,z);
816 bbox.
extend(points_(nodes[0].k_,nodes[0].j_,nodes[0].i_));
817 bbox.
extend(points_(nodes[1].k_,nodes[1].j_,nodes[1].i_));
818 bbox.
extend(points_(nodes[2].k_,nodes[2].j_,nodes[2].i_));
819 bbox.
extend(points_(nodes[3].k_,nodes[3].j_,nodes[3].i_));
820 bbox.
extend(points_(nodes[4].k_,nodes[4].j_,nodes[4].i_));
821 bbox.
extend(points_(nodes[5].k_,nodes[5].j_,nodes[5].i_));
822 bbox.
extend(points_(nodes[6].k_,nodes[6].j_,nodes[6].i_));
823 bbox.
extend(points_(nodes[7].k_,nodes[7].j_,nodes[7].i_));
830 if(this->
basis_.get_coords(coords, p, ed))
return (
true);
838 template <
class INDEX>
846 if (this->
ni_ == 0 || this->
nj_ == 0 || this->
nk_ == 0)
return (
false);
849 if (elem.i_ >= 0 && elem.i_ < (this->ni_-1) &&
850 elem.j_ >= 0 && elem.j_ < (this->
nj_-1) &&
851 elem.k_ >= 0 && elem.k_ < (this->nk_-1))
854 if (
inside(elem,p))
return (
true);
858 "StructHexVolMesh: need to synchronize ELEM_LOCATE_E first");
861 if (elem_grid_->lookup(it, eit, p))
876 template <
class ARRAY>
881 "StructHexVolMesh::locate_elems requires synchronize(ELEM_LOCATE_E).")
886 elem_grid_->locate_clamp(is,js,ks,b.
min());
887 elem_grid_->locate_clamp(ie,je,ke,b.
max());
893 elem_grid_->lookup_ijk(it, eit, i, j, k);
897 for (;p<array.size();p++)
if (array[p] ==
typename ARRAY::value_type(*it))
break;
898 if (p == array.size()) array.push_back(
typename ARRAY::value_type(*it));
903 return (array.size() > 0);
907 template <
class INDEX,
class ARRAY>
915 if (this->
ni_ == 0 || this->
nj_ == 0 || this->
nk_ == 0)
return (
false);
918 if (elem.i_ >= 0 && elem.i_ < (this->ni_-1) &&
919 elem.j_ >= 0 && elem.j_ < (this->
nj_-1) &&
920 elem.k_ >= 0 && elem.k_ < (this->nk_-1))
926 this->
basis_.get_coords(coords,p,ed);
932 "StructHexVolMesh: need to synchronize ELEM_LOCATE_E first");
935 if (elem_grid_->lookup(it, eit, p))
943 this->
basis_.get_coords(coords,p,ed);
953 template <
class INDEX>
957 if (this->
ni_ == 0 || this->
nj_ == 0 || this->
nk_ == 0)
return (
false);
960 if (node.i_ >= 0 && node.i_ < this->ni_ &&
961 node.j_ >= 0 && node.j_ < this->nj_ &&
962 node.k_ >= 0 && node.k_ < this->nk_)
965 if ((p - points_(node.k_,node.j_,node.i_)).length2() < epsilon2_)
970 "StructHexVolMesh::locate_node requires synchronize(NODE_LOCATE_E).")
973 const size_type ni = node_grid_->get_ni()-1;
974 const size_type nj = node_grid_->get_nj()-1;
975 const size_type nk = node_grid_->get_nk()-1;
979 node_grid_->unsafe_locate(bi, bj, bk, p);
982 if (bi > ni) bi =ni;
if (bi < 0) bi = 0;
983 if (bj > nj) bj =nj;
if (bj < 0) bj = 0;
984 if (bk > nk) bk =nk;
if (bk < 0) bk = 0;
990 double dmin = DBL_MAX;
1000 if (i < 0 || i > ni)
continue;
1003 if (j < 0 || j > nj)
continue;
1006 if (k < 0 || k > nk)
continue;
1007 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
1009 if (node_grid_->min_distance_squared(p, i, j, k) < dmin)
1013 node_grid_->lookup_ijk(it, eit, i, j, k);
1019 const double dist = (p-point).length2();
1026 if (dist < epsilon2_)
return (
true);
1039 while ((!found)||(dmin == DBL_MAX)) ;
1062 {
return points_(idx.
k_, idx.
j_, idx.
i_); }
1065 Array3<Core::Geometry::Point> points_;
1077 template <
class Basis>
1082 template <
class Basis>
1084 synchronize_lock_(
"Synchronize lock"),
1085 synchronized_(
Mesh::ALL_ELEMENTS_E),
1098 template <
class Basis>
1102 LatVolMesh<Basis>(i, j, k, Core::Geometry::
Point(0.0, 0.0, 0.0), Core::Geometry::
Point(1.0, 1.0, 1.0)),
1104 synchronize_lock_(
"Synchronize lock"),
1105 synchronized_(
Mesh::ALL_ELEMENTS_E),
1118 template <
class Basis>
1121 synchronize_lock_(
"Synchronize lock"),
1122 synchronized_(
Mesh::ALL_ELEMENTS_E),
1129 copy.synchronize_lock_.lock();
1131 points_ = copy.points_;
1135 epsilon_ = copy.epsilon_;
1136 epsilon2_ = copy.epsilon2_;
1137 epsilon3_ = copy.epsilon3_;
1139 copy.synchronize_lock_.unlock();
1148 template <
class Basis>
1155 array.push_back(this->ni_);
1156 array.push_back(this->nj_);
1157 array.push_back(this->nk_);
1163 template <
class Basis>
1182 template <
class Basis>
1192 points_((*i).k_,(*i).j_,(*i).i_) =
1193 t.
project(points_((*i).k_,(*i).j_,(*i).i_));
1198 synchronize_lock_.lock();
1199 if (node_grid_) { node_grid_->transform(t); }
1200 if (elem_grid_) { elem_grid_->transform(t); }
1201 synchronize_lock_.unlock();
1206 template <
class Basis>
1211 result = points_(idx.
k_, idx.
j_, idx.
i_);
1214 template <
class Basis>
1220 this->get_nodes(arr, idx);
1222 get_center(result, arr[0]);
1223 get_center(p1, arr[1]);
1230 template <
class Basis>
1236 this->get_nodes(nodes, idx);
1237 ASSERT(nodes.size() == 4);
1239 get_point(result, *nai);
1242 while (nai != nodes.end())
1244 get_point(pp, *nai);
1248 result *= (1.0 / 4.0);
1252 template <
class Basis>
1258 this->get_nodes(nodes, idx);
1259 ASSERT(nodes.size() == 8);
1261 get_point(result, *nai);
1264 while (nai != nodes.end())
1266 get_point(pp, *nai);
1270 result *= (1.0 / 8.0);
1273 template <
class Basis>
1277 double maxdist)
const
1280 if (this->ni_ == 0 || this->nj_ == 0 || this->nk_ == 0)
return (
false);
1282 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
1285 if (node.
i_ >= 0 && node.
i_ < this->ni_ &&
1286 node.
j_ >= 0 && node.
j_ < this->nj_ &&
1287 node.
k_ >= 0 && node.
k_ < this->nk_)
1291 double dist = (point-p).length2();
1293 if ( dist < epsilon2_ )
1302 "StructHexVolMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
1305 const size_type ni = node_grid_->get_ni()-1;
1306 const size_type nj = node_grid_->get_nj()-1;
1307 const size_type nk = node_grid_->get_nk()-1;
1311 node_grid_->unsafe_locate(bi, bj, bk, p);
1314 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1315 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1316 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1318 ei = bi; ej = bj; ek = bk;
1320 double dmin = maxdist;
1322 bool found_one =
false;
1332 if (i < 0 || i > ni)
continue;
1335 if (j < 0 || j > nj)
continue;
1338 if (k < 0 || k > nk)
continue;
1339 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
1341 if (node_grid_->min_distance_squared(p, i, j, k) < dmin)
1351 const double dist = (p-point).length2();
1360 if (dmin < epsilon2_)
1377 while ((!found)||(dmin == DBL_MAX)) ;
1379 if (!found_one)
return (
false);
1386 template<
class Basis>
1392 ASSERTFAIL(
"StructHexVolMesh: Find closest element has not yet been implemented.");
1398 template <
class Basis>
1405 if (locate_elem(idx, p))
1407 this->get_nodes(l,idx);
1408 std::vector<double> coords(3);
1409 if (get_coords(coords, p, idx))
1411 this->basis_.get_weights(coords, w);
1412 return this->basis_.dofs();
1419 template <
class Basis>
1426 if (locate_elem(idx, p))
1452 template <
class Basis>
1458 double an, ax, ay, az;
1464 ax = (N.
x()>0 ? N.
x() : -N.
x());
1465 ay = (N.
y()>0 ? N.
y() : -N.
y());
1466 az = (N.
z()>0 ? N.
z() : -N.
z());
1471 if (ax > az) coord = 1;
1473 else if (ay > az) coord = 2;
1476 for (i=1, j=2, k=0; i<=
n; i++, j++, k++)
1480 area += (point(ni[i%n]).y() *
1481 (point(ni[j%n]).z() - point(ni[k%n]).z()));
1484 area += (point(ni[i%n]).x() *
1485 (point(ni[j%n]).z() - point(ni[k%n]).z()));
1488 area += (point(ni[i%n]).x() *
1489 (point(ni[j%n]).y() - point(ni[k%n]).y()));
1494 an = sqrt( ax*ax + ay*ay + az*az);
1498 area *= (an / (2*ax));
1501 area *= (an / (2*ay));
1504 area *= (an / (2*az));
1512 return (0.5*
Cross((a-b),(b-c)).length());
1515 template <
class Basis>
1523 template <
class Basis>
1528 this->get_nodes(arr, idx);
1530 get_center(p0, arr[0]);
1531 get_center(p1, arr[1]);
1533 return (p1 - p0).length();
1537 template <
class Basis>
1542 this->get_nodes(nodes, idx);
1544 get_point(p0, nodes[0]);
1545 get_point(p1, nodes[1]);
1546 get_point(p2, nodes[2]);
1547 get_point(p3, nodes[3]);
1549 return ((
Cross(p0-p1,p2-p0)).length()+(
Cross(p0-p3,p2-p0)).length())*0.5;
1553 template <
class Basis>
1558 this->get_nodes(nodes, idx);
1560 get_point(p0, nodes[0]);
1561 get_point(p1, nodes[1]);
1562 get_point(p2, nodes[2]);
1563 get_point(p3, nodes[3]);
1564 get_point(p4, nodes[4]);
1565 get_point(p5, nodes[5]);
1566 get_point(p6, nodes[6]);
1567 get_point(p7, nodes[7]);
1575 return (a0 + a1 + a2 + a3 + a4);
1579 template <
class Basis>
1584 points_(idx.
k_, idx.
j_, idx.
i_) = p;
1587 template<
class Basis>
1608 const double w = rng() * (a0 + a1 + a2 + a3 + a4);
1624 const double tmp =
v;
1628 else if (t + u + v > 1.0)
1630 const double tmp =
v;
1631 v = t + u + v - 1.0;
1636 const double a = 1.0 - t - u -
v;
1638 if (w > (a0 + a1 + a2 + a3))
1642 else if (w > (a0 + a1 + a2))
1646 else if (w > (a0 + a1))
1660 template <
class Basis>
1664 synchronize_lock_.lock();
1678 !(synchronized_ & Mesh::EPSILON_E))
1680 compute_epsilon(bb);
1685 !(synchronized_ & Mesh::NODE_LOCATE_E))
1687 compute_node_grid(bb);
1692 !(synchronized_ & Mesh::ELEM_LOCATE_E))
1694 compute_elem_grid(bb);
1698 synchronize_lock_.unlock();
1703 template <
class Basis>
1710 template <
class Basis>
1714 synchronize_lock_.lock();
1724 synchronize_lock_.unlock();
1729 template <
class Basis>
1746 elem_grid_->insert(idx, box);
1750 template <
class Basis>
1754 Core::Geometry::BBox box;
1755 box.
extend(points_(idx.k_,idx.j_,idx.i_));
1756 box.
extend(points_(idx.k_+1,idx.j_,idx.i_));
1757 box.
extend(points_(idx.k_,idx.j_+1,idx.i_));
1758 box.
extend(points_(idx.k_+1,idx.j_+1,idx.i_));
1759 box.
extend(points_(idx.k_,idx.j_,idx.i_+1));
1760 box.
extend(points_(idx.k_+1,idx.j_,idx.i_+1));
1761 box.
extend(points_(idx.k_,idx.j_+1,idx.i_+1));
1762 box.
extend(points_(idx.k_+1,idx.j_+1,idx.i_+1));
1764 elem_grid_->remove(idx, box);
1767 template <
class Basis>
1773 node_grid_->insert(ni,points_[ni]);
1777 template <
class Basis>
1781 node_grid_->remove(ni,points_[ni]);
1784 template <
class Basis>
1786 StructHexVolMesh<Basis>::compute_elem_grid(Core::Geometry::BBox& bb)
1792 const size_type esz = (this->ni_-1)*(this->nj_-1)*(this->nk_-1);
1795 3*
static_cast<size_type>((ceil(pow(static_cast<double>(esz) , (1.0/3.0))))/2.0 + 1.0);
1797 Core::Geometry::Vector diag = bb.diagonal();
1798 double trace = (diag.x()+diag.y()+diag.z());
1803 Core::Geometry::BBox b = bb; b.extend(10*epsilon_);
1811 insert_elem_into_grid(*ci);
1819 template <
class Basis>
1821 StructHexVolMesh<Basis>::compute_node_grid(Core::Geometry::BBox& bb)
1827 const size_type esz = (this->ni_)*(this->nj_)*(this->nk_);
1830 ((ceil(pow(static_cast<double>(esz) , (1.0/3.0))))/2.0 + 1.0);
1832 Core::Geometry::Vector diag = bb.diagonal();
1833 double trace = (diag.x()+diag.y()+diag.z());
1838 Core::Geometry::BBox b = bb; b.extend(10*epsilon_);
1846 insert_node_into_grid(*ni);
1856 template <
class Basis>
1858 StructHexVolMesh<Basis>::compute_epsilon(Core::Geometry::BBox& bb)
1860 epsilon_ = bb.diagonal().length()*1e-8;
1861 epsilon2_ = epsilon_*epsilon_;
1862 epsilon3_ = epsilon_*epsilon_*epsilon_;
1866 #define STRUCT_HEX_VOL_MESH_VERSION 2
1868 template <
class Basis>
1880 Pio(stream, tpoints);
1886 points_.resize(dim3,dim2,dim1);
1890 points_(k,j,i) = tpoints(i,j,k);
1894 Pio(stream, points_);
1902 template <
class Basis>
1906 ASSERT((n >= -1) && n <= 1);
1914 static const std::string nm(
"StructHexVolMesh");
1923 template <
class Basis>
1934 std::string(__FILE__),
1942 template <
class Basis>
1943 const TypeDescription*
1950 template <
class Basis>
1960 std::string(__FILE__),
1968 template <
class Basis>
1978 std::string(__FILE__),
1986 template <
class Basis>
1996 std::string(__FILE__),
2004 template <
class Basis>
2014 std::string(__FILE__),
NodeIter iterator
Definition: LatVolMesh.h:425
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:299
double get_epsilon() const
Definition: StructHexVolMesh.h:763
bool reading() const
Definition: Persistent.h:164
index_type i_
Definition: LatVolMesh.h:127
std::vector< index_type > array_type
Definition: LatVolMesh.h:449
index_type node4_index() const
Definition: StructHexVolMesh.h:154
int get_weights(const Core::Geometry::Point &, typename LatVolMesh< Basis >::Edge::array_type &, double *)
Definition: StructHexVolMesh.h:608
Definition: FieldRNG.h:37
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: StructHexVolMesh.h:1870
SCIRun::mask_type mask_type
Definition: StructHexVolMesh.h:107
size_type nj_
Definition: LatVolMesh.h:1111
std::string get_name(const std::string &type_sep_start="<", const std::string &type_sep_end="> ") const
Definition: TypeDescription.cc:135
static MeshHandle structhexvol_maker(size_type x, size_type y, size_type z)
This function returns a handle for the virtual interface.
Definition: StructHexVolMesh.h:791
static const TypeDescription * node_type_description()
Definition: StructHexVolMesh.h:1952
StructHexVolMesh()
Definition: StructHexVolMesh.h:1083
double get_length(typename LatVolMesh< Basis >::Edge::index_type idx) const
Definition: StructHexVolMesh.h:252
Point max() const
Definition: BBox.h:195
ElemData(const StructHexVolMesh< Basis > &msh, const typename LatVolMesh< Basis >::Cell::index_type ind)
Definition: StructHexVolMesh.h:125
#define ASSERTMSG(condition, message)
Definition: Exception.h:113
Array3< Core::Geometry::Point > & get_points()
Definition: StructHexVolMesh.h:798
virtual void transform(const Core::Geometry::Transform &t)
Definition: StructHexVolMesh.h:1184
const Core::Geometry::Point & node3() const
Definition: StructHexVolMesh.h:188
bool locate(typename LatVolMesh< Basis >::Node::index_type &node, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:260
static const TypeDescription * elem_type_description()
Definition: StructHexVolMesh.h:783
bool locate(typename LatVolMesh< Basis >::Cell::index_type &elem, std::vector< double > &coords, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:274
Definition: LatVolMesh.h:63
Definition: Persistent.h:89
StructHexVolMesh< Basis >::index_type index_type
Definition: StructHexVolMesh.h:123
bool locate(typename LatVolMesh< Basis >::Edge::index_type &, const Core::Geometry::Point &) const
Definition: StructHexVolMesh.h:264
index_type node5_index() const
Definition: StructHexVolMesh.h:159
size_t dim2() const
Definition: Array3.h:109
Definition: Persistent.h:187
void lookup_ijk(iterator &begin, iterator &end, size_type i, size_type j, size_type k)
Definition: SearchGridT.h:207
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
void get_random_point(Core::Geometry::Point &p, const typename LatVolMesh< Basis >::Elem::index_type &i, FieldRNG &rng) const
Definition: StructHexVolMesh.h:1589
Definition: TypeDescription.h:50
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, INDEX &elem, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:289
int get_weights(const Core::Geometry::Point &, typename LatVolMesh< Basis >::Face::array_type &, double *)
Definition: StructHexVolMesh.h:611
static PersistentTypeID structhexvol_typeid
Definition: StructHexVolMesh.h:772
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, typename LatVolMesh< Basis >::Elem::index_type idx) const
Definition: StructHexVolMesh.h:632
size_type nk_
Definition: LatVolMesh.h:1111
double tetrahedra_volume(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
Definition: CompGeom.cc:389
virtual int topology_geometry() const
Definition: StructHexVolMesh.h:234
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
NodeIndex index_type
Definition: LatVolMesh.h:424
unsigned int mask_type
Definition: Types.h:45
bool find_closest_elems(double &pdist, Core::Geometry::Point &result, std::vector< typename LatVolMesh< Basis >::Elem::index_type > &elems, const Core::Geometry::Point &p) const
Find the closest elements to a point.
Definition: StructHexVolMesh.h:1388
SCIRun::size_type size_type
Definition: StructHexVolMesh.h:106
#define ASSERT(condition)
Definition: Assert.h:110
const Core::Geometry::Point & node5() const
Definition: StructHexVolMesh.h:196
size_t dim3() const
Definition: Array3.h:110
const Core::Geometry::Point & node6() const
Definition: StructHexVolMesh.h:200
Declarations for virtual interface.
Definition: StructHexVolMesh.h:75
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
bool inside(typename LatVolMesh< Basis >::Elem::index_type idx, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:800
bool locate(typename LatVolMesh< Basis >::Face::index_type &, const Core::Geometry::Point &) const
Definition: StructHexVolMesh.h:267
Definition: BoostGraphExampleTests.cc:86
virtual void set_dim(const std::vector< size_type > &dims)
Definition: StructHexVolMesh.h:221
double DetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:120
index_type j_
Definition: LatVolMesh.h:127
const string find_type_name(float *)
Definition: TypeName.cc:63
size_type ni_
Definition: LatVolMesh.h:1111
virtual ~StructHexVolMesh()
Definition: StructHexVolMesh.h:115
const Core::Geometry::Point & node2() const
Definition: StructHexVolMesh.h:184
bool locate(typename LatVolMesh< Basis >::Cell::index_type &elem, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:270
virtual Core::Geometry::BBox get_bounding_box() const
get the mesh statistics
Definition: StructHexVolMesh.h:1165
T DetMatrix3x3(const T *p)
Definition: Locate.h:95
index_type node7_index() const
Definition: StructHexVolMesh.h:170
VMesh * CreateVStructHexVolMesh(MESH *mesh)
Definition: StructHexVolMesh.h:81
double inverse_jacobian(const VECTOR &coords, typename LatVolMesh< Basis >::Elem::index_type idx, double *Ji) const
Definition: StructHexVolMesh.h:701
static Persistent * maker()
This function returns a maker for Pio.
Definition: StructHexVolMesh.h:787
const Core::Geometry::Point & node7() const
Definition: StructHexVolMesh.h:204
Definition: SearchGridT.h:47
const char * name[]
Definition: BoostGraphExampleTests.cc:87
double scaled_jacobian_metric(typename LatVolMesh< Basis >::Elem::index_type idx) const
Definition: StructHexVolMesh.h:722
void est_closest_point_on_quad(Point &result, const Point &orig, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const double epsilon)
Definition: CompGeom.cc:226
index_type node6_index() const
Definition: StructHexVolMesh.h:165
long long size_type
Definition: Types.h:40
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: StructHexVolMesh.h:1904
Vector Cross(const Vector &v1, const Vector &v2)
Definition: Vector.h:378
double ScaledDetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:132
void jacobian(const VECTOR &coords, typename LatVolMesh< Basis >::Elem::index_type idx, double *J) const
Definition: StructHexVolMesh.h:678
Definition: LatVolMesh.h:208
double det_jacobian(const VECTOR &coords, typename LatVolMesh< Basis >::Elem::index_type idx) const
Definition: StructHexVolMesh.h:666
const Core::Geometry::Point & node1() const
Definition: StructHexVolMesh.h:180
virtual bool get_dim(std::vector< size_type > &) const
Definition: StructHexVolMesh.h:1150
bool find_closest_node(double &pdist, Core::Geometry::Point &result, typename LatVolMesh< Basis >::Node::index_type &node, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:279
double get_size(const typename LatVolMesh< Basis >::Node::index_type &idx) const
Definition: StructHexVolMesh.h:1517
index_type node1_index() const
Definition: StructHexVolMesh.h:138
Point min() const
Definition: BBox.h:192
Distinct type for face index.
Definition: FieldIndex.h:90
void get_point(Core::Geometry::Point &point, const typename LatVolMesh< Basis >::Node::index_type &index) const
Definition: StructHexVolMesh.h:617
void x(double)
Definition: Vector.h:175
Basis basis_
Definition: LatVolMesh.h:1114
virtual const TypeDescription * get_type_description() const
Definition: StructHexVolMesh.h:1944
double tri_area(const Core::Geometry::Point &a, const Core::Geometry::Point &b, const Core::Geometry::Point &c)
Definition: StructHexVolMesh.h:1510
virtual bool unsynchronize(mask_type)
Definition: StructHexVolMesh.h:1705
std::vector< index_type > array_type
Definition: LatVolMesh.h:435
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
bool inside(const Point &p) const
Definition: BBox.h:205
static const TypeDescription * cell_type_description()
Definition: StructHexVolMesh.h:2006
v
Definition: readAllFields.py:42
Definition: LatVolMesh.h:146
bool locate_node(INDEX &node, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:954
double get_area(typename LatVolMesh< Basis >::Face::index_type idx) const
Definition: StructHexVolMesh.h:254
std::vector< index_type > array_type
Definition: LatVolMesh.h:442
SCIRun::index_type under_type
Types that change depending on 32 or 64bits.
Definition: StructHexVolMesh.h:104
void y(double)
Definition: Vector.h:185
#define ASSERTFAIL(string)
Definition: Assert.h:52
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
size_t dim1() const
Definition: Array3.h:108
double jacobian_metric(typename LatVolMesh< Basis >::Elem::index_type idx) const
Definition: StructHexVolMesh.h:742
bool clear_synchronization()
Definition: StructHexVolMesh.h:1712
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p, double maxdist) const
Definition: StructHexVolMesh.h:309
void get_center(Core::Geometry::Point &, const typename LatVolMesh< Basis >::Node::index_type &) const
get the center point (in object space) of an element
Definition: StructHexVolMesh.h:1208
friend class VStructHexVolMesh
Definition: StructHexVolMesh.h:100
CellIndex index_type
Definition: LatVolMesh.h:446
virtual void end_class()
Definition: Persistent.cc:178
CellIter iterator
Definition: LatVolMesh.h:447
Definition: StructHexVolMesh.h:120
int get_weights(const Core::Geometry::Point &, typename LatVolMesh< Basis >::Node::array_type &, double *)
Definition: StructHexVolMesh.h:1400
long long index_type
Definition: Types.h:39
const Core::Geometry::Point & node4() const
Definition: StructHexVolMesh.h:192
#define STRUCT_HEX_VOL_MESH_VERSION
Definition: StructHexVolMesh.h:1866
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, typename LatVolMesh< Basis >::Elem::index_type idx) const
Definition: StructHexVolMesh.h:642
boost::shared_ptr< StructHexVolMesh< Basis > > handle_type
Definition: StructHexVolMesh.h:109
Definition: LatVolMesh.h:133
virtual bool synchronize(mask_type)
Definition: StructHexVolMesh.h:1662
Definition: Persistent.h:64
static const TypeDescription * edge_type_description()
Definition: StructHexVolMesh.h:1970
Distinct type for edge index.
Definition: FieldIndex.h:81
int n
Definition: eab.py:9
SCIRun::mask_type mask_type
Definition: LatVolMesh.h:96
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: StructHexVolMesh.h:789
T InverseMatrix3x3(const T *p, T *q)
Definition: Locate.h:47
void set_point(const Core::Geometry::Point &point, const typename LatVolMesh< Basis >::Node::index_type &index)
Definition: StructHexVolMesh.h:1581
Interface to dynamic 3D array class.
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: LatVolMesh.h:2378
static const TypeDescription * face_type_description()
Definition: StructHexVolMesh.h:1988
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
const LatVolMesh * mesh_
Definition: LatVolMesh.h:130
SCIRun::size_type size_type
Definition: LatVolMesh.h:95
boost::shared_ptr< VMesh > vmesh_
Definition: LatVolMesh.h:1125
void z(double)
Definition: Vector.h:195
SCIRun::index_type index_type
Definition: StructHexVolMesh.h:105
index_type k_
Definition: LatVolMesh.h:127
double get_volume(const typename LatVolMesh< Basis >::Cell::index_type &i) const
Definition: StructHexVolMesh.h:256
boost::mutex Mutex
Definition: SchedulingWithBoostGraph.cc:434
bool locate_elem(INDEX &elem, ARRAY &coords, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:908
index_type node3_index() const
Definition: StructHexVolMesh.h:149
void derivate(const VECTOR1 &coords, typename LatVolMesh< Basis >::Elem::index_type idx, VECTOR2 &J) const
Definition: StructHexVolMesh.h:654
virtual StructHexVolMesh * clone() const
Definition: StructHexVolMesh.h:114
index_type node2_index() const
Definition: StructHexVolMesh.h:143
bool locate_elem(INDEX &elem, const Core::Geometry::Point &p) const
Definition: StructHexVolMesh.h:839
void get_nodes(typename Node::array_type &, typename Edge::index_type) const
get the child elements of the given index
Definition: LatVolMesh.h:1386
const Core::Geometry::Point & node0() const
Definition: StructHexVolMesh.h:176
bool locate_elems(ARRAY &array, const Core::Geometry::BBox &b) const
Definition: StructHexVolMesh.h:877
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
index_type node0_index() const
the following designed to coordinate with ::get_nodes
Definition: StructHexVolMesh.h:133
bool elem_locate(INDEX &elem, MESH &msh, const Core::Geometry::Point &p)
General case locate, search each elem.
Definition: Mesh.h:188