30 #ifndef CORE_DATATYPES_LATVOLMESH_H
31 #define CORE_DATATYPES_LATVOLMESH_H 1
62 template <
class Basis>
76 #if (SCIRUN_LATVOL_SUPPORT > 0)
84 template <
class Basis>
85 class LatVolMesh :
public Mesh
118 os <<
"[" <<
i_ <<
"," <<
j_ <<
"," <<
k_ <<
"]";
141 return (this->
i_ + (this->
ni()-1)*this->
j_ +
142 (this->
ni()-1)*(this->
nj()-1)*this->
k_);
167 os <<
i_*
j_*
k_ <<
" (" <<
i_ <<
" x " <<
j_ <<
" x " <<
k_ <<
")";
197 return (this->
i_ == a.
i_ && this->j_ == a.
j_ &&
198 this->k_ == a.
k_ && this->mesh_ == a.
mesh_);
203 return !(*
this == a);
251 return this->
i_ + (this->
ni()-1)*this->
j_ + (this->
ni()-1)*(this->
nj()-1)*this->
k_;;
291 :
NodeIter(m, i, j, k), min_i_(i), min_j_(j), min_k_(k),
292 max_i_(max_i), max_j_(max_j), max_k_(max_k)
325 if (min_k_ != max_k_)
332 if (min_i_ != max_i_ || min_j_ != max_j_)
333 end_iter =
NodeIter(this->
mesh_, min_i_, min_j_, max_k_ + 1);
360 :
CellIter(m, i, j, k), min_i_(i), min_j_(j), min_k_(k),
361 max_i_(max_i), max_j_(max_j), max_k_(max_k)
393 if (min_k_ != max_k_)
400 if (min_i_ != max_i_ || min_j_ != max_j_)
401 end_iter =
CellIter(this->
mesh_, min_i_, min_j_, max_k_ + 1);
480 return (index_.
i_ + mesh_.get_ni()*index_.
j_ +
481 mesh_.get_ni()*mesh_.get_nj()*index_.
k_);
485 return (index_.
i_+ 1 + mesh_.get_ni()*index_.
j_ +
486 mesh_.get_ni()*mesh_.get_nj()*index_.
k_);
490 return (index_.
i_ + 1 + mesh_.get_ni()*(index_.
j_ + 1) +
491 mesh_.get_ni()*mesh_.get_nj()*index_.
k_);
496 return (index_.
i_ + mesh_.get_ni()*(index_.
j_ + 1) +
497 mesh_.get_ni()*mesh_.get_nj()*index_.
k_);
501 return (index_.
i_ + mesh_.get_ni()*index_.
j_ +
502 mesh_.get_ni()*mesh_.get_nj()*(index_.
k_ + 1));
506 return (index_.
i_ + 1 + mesh_.get_ni()*index_.
j_ +
507 mesh_.get_ni()*mesh_.get_nj()*(index_.
k_ + 1));
512 return (index_.
i_ + 1 + mesh_.get_ni()*(index_.
j_ + 1) +
513 mesh_.get_ni()*mesh_.get_nj()*(index_.
k_ + 1));
517 return (index_.
i_ + mesh_.get_ni()*(index_.
j_ + 1) +
518 mesh_.get_ni()*mesh_.get_nj()*(index_.
k_ + 1));
524 return mesh_.transform_.project(p);
529 return mesh_.transform_.project(p);
534 return mesh_.transform_.project(p);
539 return mesh_.transform_.project(p);
544 return mesh_.transform_.project(p);
549 return mesh_.transform_.project(p);
554 return mesh_.transform_.project(p);
559 return mesh_.transform_.project(p);
653 unsigned int which_edge,
654 unsigned int div_per_unit)
const
658 int emap[] = {0, 2, 8, 10, 3, 1, 11, 9, 4, 5, 7, 6};
659 basis_.approx_edge(emap[which_edge], div_per_unit, coords);
666 unsigned int which_face,
667 unsigned int div_per_unit)
const
671 int fmap[] = {0, 5, 4, 2, 1, 3};
672 basis_.approx_face(fmap[which_face], div_per_unit, coords);
685 template<
class VECTOR>
690 if (
basis_.polynomial_order() > 1)
693 return (
basis_.get_coords(coords, p, ed));
701 coords[0] =
static_cast<typename VECTOR::value_type
>(r.
x()-
static_cast<double>(idx.
i_));
702 coords[1] =
static_cast<typename VECTOR::value_type
>(r.
y()-
static_cast<double>(idx.
j_));
703 coords[2] =
static_cast<typename VECTOR::value_type
>(r.
z()-
static_cast<double>(idx.
k_));
705 const double epsilon = 1e-8;
707 if (static_cast<double>(coords[0]) < 0.0)
if (static_cast<double>(coords[0]) > -(epsilon))
708 coords[0] =
static_cast<typename VECTOR::value_type
>(0.0);
else return (
false);
709 if (static_cast<double>(coords[0]) > 1.0)
if (static_cast<double>(coords[0]) < 1.0+(epsilon))
710 coords[0] =
static_cast<typename VECTOR::value_type
>(1.0);
else return (
false);
711 if (static_cast<double>(coords[1]) < 0.0)
if (static_cast<double>(coords[1]) > -(epsilon))
712 coords[1] =
static_cast<typename VECTOR::value_type
>(0.0);
else return (
false);
713 if (static_cast<double>(coords[1]) > 1.0)
if (static_cast<double>(coords[1]) < 1.0+(epsilon))
714 coords[1] =
static_cast<typename VECTOR::value_type
>(1.0);
else return (
false);
715 if (static_cast<double>(coords[2]) < 0.0)
if (static_cast<double>(coords[2]) > -(epsilon))
716 coords[2] =
static_cast<typename VECTOR::value_type
>(0.0);
else return (
false);
717 if (static_cast<double>(coords[2]) > 1.0)
if (static_cast<double>(coords[2]) < 1.0+(epsilon))
718 coords[2] =
static_cast<typename VECTOR::value_type
>(1.0);
else return (
false);
725 template<
class VECTOR>
729 if (
basis_.polynomial_order() > 1)
732 pt =
basis_.interpolate(coords, ed);
738 static_cast<double>(idx.
j_)+static_cast<double>(coords[1]),
739 static_cast<double>(idx.
k_)+static_cast<double>(coords[2]));
747 template<
class VECTOR1,
class VECTOR2>
751 if (
basis_.polynomial_order() > 1)
754 basis_.derivate(coords, ed, J);
768 template<
class VECTOR>
777 template<
class VECTOR>
794 template<
class VECTOR>
820 bool get_min(std::vector<index_type>&)
const;
824 virtual bool get_dim(std::vector<size_type>&)
const;
835 void set_min(std::vector<index_type> mins);
857 virtual void set_dim(std::vector<size_type> dims);
950 {
ASSERTFAIL(
"LatVolMesh::get_weights for edges isn't supported"); }
952 {
ASSERTFAIL(
"LatVolMesh::get_weights for faces isn't supported"); }
959 {
ASSERTFAIL(
"This mesh type does not have node normals."); }
962 {
ASSERTFAIL(
"This mesh type does not have element normals."); }
979 template <
class ARRAY>
985 double maxdist)
const
988 if(!ret)
return (
false);
989 if (maxdist < 0.0 || pdist < maxdist)
return (
true);
996 template <
class ARRAY>
1003 if (
ni_ == 0 ||
nj_ == 0 ||
nk_ == 0)
return (
false);
1010 const double nii =
static_cast<double>(
ni_-1);
1011 const double njj =
static_cast<double>(
nj_-1);
1012 const double nkk =
static_cast<double>(
nk_-1);
1014 if (ii < 0.0) ii = 0.0;
if (ii >= nii) ii = nii;
1015 if (jj < 0.0) jj = 0.0;
if (jj >= njj) jj = njj;
1016 if (kk < 0.0) kk = 0.0;
if (kk >= nkk) kk = nkk;
1018 double fi = floor(ii);
if (fi == nii) fi--;
1019 double fj = floor(jj);
if (fj == njj) fj--;
1020 double fk = floor(kk);
if (fk == nkk) fk--;
1028 pdist = (p-result).length();
1052 std::vector<typename Elem::index_type> &elem,
1067 static const std::string
type_name(
int n = -1);
1100 return boost::make_shared<LatVolMesh>(x,y,z,min,max);
1128 template <
class Basis>
1138 std::string(__FILE__),
1146 template <
class Basis>
1147 const TypeDescription*
1154 template <
class Basis>
1164 std::string(__FILE__),
1172 template <
class Basis>
1182 std::string(__FILE__),
1190 template <
class Basis>
1200 std::string(__FILE__),
1208 template <
class Basis>
1218 std::string(__FILE__),
1225 template <
class Basis>
1229 template <
class Basis>
1232 : min_i_(0), min_j_(0), min_k_(0),
1233 ni_(i), nj_(j), nk_(k)
1248 template <
class Basis>
1258 get_point(p0,ra[0]);
1259 get_point(p1,ra[1]);
1260 get_point(p2,ra[3]);
1261 get_point(p3,ra[4]);
1267 const double t = rng();
1268 const double u = rng();
1269 const double v = rng();
1271 p = p0+(v0*t)+(v1*u)+(v2*
v);
1275 template <
class Basis>
1289 result.
extend(transform_.project(p0))
1290 .extend(transform_.project(p1))
1291 .extend(transform_.project(p2))
1292 .extend(transform_.project(p3))
1293 .extend(transform_.project(p4))
1294 .extend(transform_.project(p5))
1295 .extend(transform_.project(p6))
1296 .extend(transform_.project(p7));
1301 template <
class Basis>
1305 return get_bounding_box().diagonal();
1309 template <
class Basis>
1313 transform_.pre_trans(t);
1314 transform_.compute_imat();
1319 template <
class Basis>
1328 template <
class Basis>
1335 array.push_back(min_i_);
1336 array.push_back(min_j_);
1337 array.push_back(min_k_);
1343 template <
class Basis>
1350 array.push_back(ni_);
1351 array.push_back(nj_);
1352 array.push_back(nk_);
1358 template <
class Basis>
1368 template <
class Basis>
1384 template <
class Basis>
1394 if (xidx < (ni_ - 1) * nj_ * nk_)
1406 const index_type yidx = idx - (ni_ - 1) * nj_ * nk_;
1407 if (yidx < (ni_ * (nj_ - 1) * nk_))
1419 const index_type zidx = yidx - (ni_ * (nj_ - 1) * nk_);
1433 template <
class Basis>
1443 if (xidx < (ni_ - 1) * (nj_ - 1) * nk_)
1456 const index_type yidx = idx - (ni_ - 1) * (nj_ - 1) * nk_;
1457 if (yidx < ni_ * (nj_ - 1) * (nk_ - 1))
1470 const index_type zidx = yidx - ni_ * (nj_ - 1) * (nk_ - 1);
1485 template <
class Basis>
1491 array[0].i_ = idx.
i_; array[0].j_ = idx.
j_; array[0].k_ = idx.
k_;
1492 array[1].i_ = idx.
i_+1; array[1].j_ = idx.
j_; array[1].k_ = idx.
k_;
1493 array[2].i_ = idx.
i_+1; array[2].j_ = idx.
j_+1; array[2].k_ = idx.
k_;
1494 array[3].i_ = idx.
i_; array[3].j_ = idx.
j_+1; array[3].k_ = idx.
k_;
1495 array[4].i_ = idx.
i_; array[4].j_ = idx.
j_; array[4].k_ = idx.
k_+1;
1496 array[5].i_ = idx.
i_+1; array[5].j_ = idx.
j_; array[5].k_ = idx.
k_+1;
1497 array[6].i_ = idx.
i_+1; array[6].j_ = idx.
j_+1; array[6].k_ = idx.
k_+1;
1498 array[7].i_ = idx.
i_; array[7].j_ = idx.
j_+1; array[7].k_ = idx.
k_+1;
1500 array[0].mesh_ =
this;
1501 array[1].mesh_ =
this;
1502 array[2].mesh_ =
this;
1503 array[3].mesh_ =
this;
1504 array[4].mesh_ =
this;
1505 array[5].mesh_ =
this;
1506 array[6].mesh_ =
this;
1507 array[7].mesh_ =
this;
1511 template <
class Basis>
1517 const index_type num_i_faces = (ni_-1)*(nj_-1)*nk_;
1518 const index_type num_j_faces = ni_*(nj_-1)*(nk_-1);
1519 const index_type num_k_faces = (ni_-1)*nj_*(nk_-1);
1521 const index_type num_i_edges = (ni_-1)*nj_*nk_;
1522 const index_type num_j_edges = ni_*(nj_-1)*nk_;
1527 if (face < num_i_faces)
1529 facei = face % (ni_-1);
1530 facej = (face / (ni_-1)) % (nj_-1);
1531 facek = face / ((ni_-1)*(nj_-1));
1532 array[0] = facei+facej*(ni_-1)+facek*(ni_-1)*(nj_);
1533 array[1] = facei+(facej+1)*(ni_-1)+facek*(ni_-1)*(nj_);
1534 array[2] = num_i_edges + facei*(nj_-1)*(nk_)+facej+facek*(nj_-1);
1535 array[3] = num_i_edges + (facei+1)*(nj_-1)*(nk_)+facej+facek*(nj_-1);
1537 else if (face - num_i_faces < num_j_faces)
1539 face -= num_i_faces;
1540 facei = face / ((nj_-1) *(nk_-1));
1541 facej = face % (nj_-1);
1542 facek = (face / (nj_-1)) % (nk_-1);
1543 array[0] = num_i_edges + facei*(nj_-1)*(nk_)+facej+facek*(nj_-1);
1544 array[1] = num_i_edges + facei*(nj_-1)*(nk_)+facej+(facek+1)*(nj_-1);
1545 array[2] = (num_i_edges + num_j_edges +
1546 facei*(nk_-1)+facej*(ni_)*(nk_-1)+facek);
1547 array[3] = (num_i_edges + num_j_edges +
1548 facei*(nk_-1)+(facej+1)*(ni_)*(nk_-1)+facek);
1551 else if (face - num_i_faces - num_j_faces < num_k_faces)
1553 face -= (num_i_faces + num_j_faces);
1554 facei = (face / (nk_-1)) % (ni_-1);
1555 facej = face / ((ni_-1) * (nk_-1));
1556 facek = face % (nk_-1);
1557 array[0] = facei+facej*(ni_-1)+facek*(ni_-1)*(nj_);
1558 array[1] = facei+facej*(ni_-1)+(facek+1)*(ni_-1)*(nj_);
1559 array[2] = (num_i_edges + num_j_edges +
1560 facei*(nk_-1)+facej*(ni_)*(nk_-1)+facek);
1561 array[3] = (num_i_edges + num_j_edges +
1562 (facei+1)*(nk_-1)+facej*(ni_)*(nk_-1)+facek);
1566 "LatVolMesh<Basis>::get_edges(Edge, Face) Face idx out of bounds");
1571 template <
class Basis>
1578 const index_type k_start = ni_*(nj_-1)*nk_ + j_start;
1580 array[0] = idx.
i_ + idx.
j_*(ni_-1) + idx.
k_*(ni_-1)*(nj_);
1581 array[1] = idx.
i_ + (idx.
j_+1)*(ni_-1) + idx.
k_*(ni_-1)*(nj_);
1582 array[2] = idx.
i_ + idx.
j_*(ni_-1) + (idx.
k_+1)*(ni_-1)*(nj_);
1583 array[3] = idx.
i_ + (idx.
j_+1)*(ni_-1) + (idx.
k_+1)*(ni_-1)*(nj_);
1585 array[4] = j_start + idx.
i_*(nj_-1)*(nk_) + idx.
j_ + idx.
k_*(nj_-1);
1586 array[5] = j_start + (idx.
i_+1)*(nj_-1)*(nk_) + idx.
j_ + idx.
k_*(nj_-1);
1587 array[6] = j_start + idx.
i_*(nj_-1)*(nk_) + idx.
j_ + (idx.
k_+1)*(nj_-1);
1588 array[7] = j_start + (idx.
i_+1)*(nj_-1)*(nk_) + idx.
j_ + (idx.
k_+1)*(nj_-1);
1590 array[8] = k_start + idx.
i_*(nk_-1) + idx.
j_*(ni_)*(nk_-1) + idx.
k_;
1591 array[9] = k_start + (idx.
i_+1)*(nk_-1) + idx.
j_*(ni_)*(nk_-1) + idx.
k_;
1592 array[10] = k_start + idx.
i_*(nk_-1) + (idx.
j_+1)*(ni_)*(nk_-1) + idx.
k_;
1593 array[11] = k_start + (idx.
i_+1)*(nk_-1) + (idx.
j_+1)*(ni_)*(nk_-1) + idx.
k_;
1598 template <
class Basis>
1606 const index_type offset2 = offset1 + ni_*(nj_-1)*nk_;
1611 index_type k = idx/((nj_)*(ni_-1)); idx -= k*(nj_)*(ni_-1);
1612 index_type j = idx/(ni_-1); idx -= j*(ni_-1);
1617 if (k < (nk_-1)) result.push_back(
CellIndex(
this,i,j-1,k));
1618 if (k > 0) result.push_back(
CellIndex(
this,i,j-1,k-1));
1623 if (k < (nk_-1)) result.push_back(
CellIndex(
this,i,j,k));
1624 if (k > 0) result.push_back(
CellIndex(
this,i,j,k-1));
1627 else if (idx >= offset2)
1630 index_type j = idx/((nk_-1)*(ni_)); idx -= j*(nk_-1)*(ni_);
1631 index_type i = idx/(nk_-1); idx -= i*(nk_-1);
1636 if (j < (nj_-1)) result.push_back(
CellIndex(
this,i-1,j,k));
1637 if (j > 0) result.push_back(
CellIndex(
this,i-1,j-1,k));
1642 if (j < (nj_-1)) result.push_back(
CellIndex(
this,i,j,k));
1643 if (j > 0) result.push_back(
CellIndex(
this,i,j-1,k));
1649 index_type i = idx/((nk_)*(nj_-1)); idx -= i*(nk_)*(nj_-1);
1650 index_type k = idx/(nj_-1); idx -= k*(nj_-1);
1655 if (i < (nk_-1)) result.push_back(
CellIndex(
this,i,j,k-1));
1656 if (i > 0) result.push_back(
CellIndex(
this,i-1,j,k-1));
1661 if (i < (ni_-1)) result.push_back(
CellIndex(
this,i,j,k));
1662 if (i > 0) result.push_back(
CellIndex(
this,i-1,j,k));
1668 template <
class Basis>
1679 const index_type offset1 = (ni_ - 1) * (nj_ - 1) * nk_;
1680 const index_type offset2 = offset1 + ni_ * (nj_ - 1) * (nk_ - 1);
1682 array[0] = i + (j + k * (nj_-1)) * (ni_-1);
1683 array[1] = i + (j + (k+1) * (nj_-1)) * (ni_-1);
1685 array[2] = offset1 + j + (k + i * (nk_-1)) * (nj_-1);
1686 array[3] = offset1 + j + (k + (i+1) * (nk_-1)) * (nj_-1);
1688 array[4] = offset2 + k + (i + j * (ni_-1)) * (nk_-1);
1689 array[5] = offset2 + k + (i + (j+1) * (ni_-1)) * (nk_-1);
1693 template <
class Basis>
1700 const index_type offset1 = (ni_ - 1) * (nj_ - 1) * nk_;
1701 const index_type offset2 = offset1 + ni_ * (nj_ - 1) * (nk_ - 1);
1706 index_type k = idx/((nj_-1)*(ni_-1)); idx -= k*(nj_-1)*(ni_-1);
1707 index_type j = idx/(ni_-1); idx -= j*(ni_-1);
1710 if (k < (nk_-1)) result.push_back(
CellIndex(
this,i,j,k));
1711 if (k > 0) result.push_back(
CellIndex(
this,i,j,k-1));
1713 else if (idx >= offset2)
1716 index_type j = idx/((nk_-1)*(ni_-1)); idx -= j*(nk_-1)*(ni_-1);
1717 index_type i = idx/(nk_-1); idx -= i*(nk_-1);
1720 if (j < (nj_-1)) result.push_back(
CellIndex(
this,i,j,k));
1721 if (j > 0) result.push_back(
CellIndex(
this,i,j-1,k));
1726 index_type i = idx/((nk_-1)*(nj_-1)); idx -= i*(nk_-1)*(nj_-1);
1727 index_type k = idx/(nj_-1); idx -= k*(nj_-1);
1730 if (i < (ni_-1)) result.push_back(
CellIndex(
this,i,j,k));
1731 if (i > 0) result.push_back(
CellIndex(
this,i-1,j,k));
1735 template <
class Basis>
1751 for (k = k0; k < k1; k++)
1752 for (j = j0; j < j1; j++)
1753 for (i = i0; i < i1; i++)
1760 template <
class Basis>
1766 get_cells(min, max, bbox);
1773 for (i = min.
i_; i <= max.
i_; i++) {
1774 for (j = min.
j_; j <= max.
j_; j++) {
1775 for (k = min.
k_; k <= max.
k_; k++) {
1790 template <
class Basis>
1799 if (mini < 0) { mini = 0; }
1800 if (minj < 0) { minj = 0; }
1801 if (mink < 0) { mink = 0; }
1807 if (maxi >= (
index_type)(ni_ - 1)) { maxi = ni_ - 2; }
1808 if (maxj >= (
index_type)(nj_ - 1)) { maxj = nj_ - 2; }
1809 if (maxk >= (
index_type)(nk_ - 1)) { maxk = nk_ - 2; }
1814 if (maxi < 0 || maxj < 0 || maxk < 0) {
1816 mini = minj = mink = 1;
1817 maxi = maxj = maxk = 0;
1825 template <
class Basis>
1835 if (xidx < (ni_ - 1) * (nj_ - 1) * nk_)
1840 if (k == from.
k_ && k > 0)
1842 neighbor.
i_ = from.
i_;
1843 neighbor.
j_ = from.
j_;
1845 neighbor.
mesh_ =
this;
1848 else if (k == (from.
k_+1) && k < (nk_-1))
1850 neighbor.
i_ = from.
i_;
1851 neighbor.
j_ = from.
j_;
1853 neighbor.
mesh_ =
this;
1859 const index_type yidx = xidx - (ni_ - 1) * (nj_ - 1) * nk_;
1860 if (yidx < ni_ * (nj_ - 1) * (nk_ - 1))
1865 if (i == from.
i_ && i > 0)
1868 neighbor.
j_ = from.
j_;
1869 neighbor.
k_ = from.
k_;
1870 neighbor.
mesh_ =
this;
1873 else if (i == (from.
i_+1) && i < (ni_-1))
1876 neighbor.
j_ = from.
j_;
1877 neighbor.
k_ = from.
k_;
1878 neighbor.
mesh_ =
this;
1884 const index_type zidx = yidx - ni_ * (nj_ - 1) * (nk_ - 1);
1888 if (j == from.
j_ && j > 0)
1890 neighbor.
i_ = from.
i_;
1892 neighbor.
k_ = from.
k_;
1893 neighbor.
mesh_ =
this;
1896 else if (j == (from.
j_+1) && j < (nj_-1))
1898 neighbor.
i_ = from.
i_;
1900 neighbor.
k_ = from.
k_;
1901 neighbor.
mesh_ =
this;
1910 template <
class Basis>
1923 min =
Min(min, mesh_boundary.
max());
1924 max =
Min(max, mesh_boundary.
max());
1928 bool min_located = locate(min_index, min);
1929 bool max_located = locate(max_index, max);
1930 if (!min_located && !max_located)
1939 double rx = floor(r.
x());
1940 double ry = floor(r.
y());
1941 double rz = floor(r.
z());
1942 min_index.i_ = (
index_type)std::max(rx, 0.0);
1943 min_index.j_ = (
index_type)std::max(ry, 0.0);
1944 min_index.k_ = (
index_type)std::max(rz, 0.0);
1945 r = transform_.unproject(max);
1949 max_index.i_ = (
index_type)std::min(rx, (
double)ni_ );
1950 max_index.j_ = (
index_type)std::min(ry, (
double)nj_ );
1951 max_index.k_ = (
index_type)std::min(rz, (
double)nk_ );
1964 else if ( !min_located )
1967 const double rx = floor(r.
x());
1968 const double ry = floor(r.
y());
1969 const double rz = floor(r.
z());
1970 min_index.i_ = (
index_type)std::max(rx, 0.0);
1971 min_index.j_ = (
index_type)std::max(ry, 0.0);
1972 min_index.k_ = (
index_type)std::max(rz, 0.0);
1977 const double rx = floor(r.
x());
1978 const double ry = floor(r.
y());
1979 const double rz = floor(r.
z());
1980 max_index.i_ = (
index_type)std::min(rx, (
double) ni_ );
1981 max_index.j_ = (
index_type)std::min(ry, (
double) nj_ );
1982 max_index.k_ = (
index_type)std::min(rz, (
double) nk_ );
1990 template <
class Basis>
1996 get_nodes(arr, idx);
1998 get_center(result, arr[0]);
1999 get_center(p1, arr[1]);
2006 template <
class Basis>
2012 get_nodes(nodes, idx);
2013 ASSERT(nodes.size() == 4);
2014 typename Node::array_type::iterator nai = nodes.begin();
2015 get_point(result, *nai);
2018 while (nai != nodes.end())
2020 get_point(pp, *nai);
2024 result *= (1.0 / 4.0);
2028 template <
class Basis>
2034 result = transform_.project(p);
2038 template <
class Basis>
2044 result = transform_.project(p);
2048 template <
class Basis>
2056 template <
class Basis>
2061 get_nodes(arr, idx);
2063 get_center(p0, arr[0]);
2064 get_center(p1, arr[1]);
2066 return (p1 - p0).length();
2070 template <
class Basis>
2075 get_nodes(nodes, idx);
2078 get_point(p0, nodes[0]);
2079 get_point(p1, nodes[1]);
2080 get_point(p2, nodes[2]);
2089 template <
class Basis>
2097 return (det_jacobian_);
2101 template <
class Basis>
2105 const double epsilon = 1e-7;
2107 if (ni_ == 0 || nj_ == 0 || nk_ == 0)
return (
false);
2115 const double nii =
static_cast<double>(ni_-1);
2116 const double njj =
static_cast<double>(nj_-1);
2117 const double nkk =
static_cast<double>(nk_-1);
2119 if (ii>=nii && (ii-epsilon)<nii) ii=nii-epsilon;
2120 if (jj>=njj && (jj-epsilon)<njj) jj=njj-epsilon;
2121 if (kk>=nkk && (kk-epsilon)<nkk) kk=nkk-epsilon;
2123 if (ii<0 && ii>(-epsilon)) ii=0.0;
2124 if (jj<0 && jj>(-epsilon)) jj=0.0;
2125 if (kk<0 && kk>(-epsilon)) kk=0.0;
2131 if (i < (ni_-1) && i >= 0 &&
2132 j < (nj_-1) && j >= 0 &&
2133 k < (nk_-1) && k >= 0 &&
2134 ii >= 0.0 && jj >= 0.0 && kk >= 0.0)
2147 template <
class Basis>
2151 if (ni_ == 0 || nj_ == 0 || nk_ == 0)
return (
false);
2155 double rx = floor(r.
x() + 0.5);
2156 double ry = floor(r.
y() + 0.5);
2157 double rz = floor(r.
z() + 0.5);
2159 const double nii =
static_cast<double>(ni_-1);
2160 const double njj =
static_cast<double>(nj_-1);
2161 const double nkk =
static_cast<double>(nk_-1);
2163 if (rx < 0.0) rx = 0.0;
if (rx > nii) rx = nii;
2164 if (ry < 0.0) ry = 0.0;
if (ry > njj) ry = njj;
2165 if (rz < 0.0) rz = 0.0;
if (rz > nkk) rz = nkk;
2177 template <
class Basis>
2184 if (ni_ == 0 || nj_ == 0 || nk_ == 0)
return (
false);
2188 double rx = floor(r.
x() + 0.5);
2189 double ry = floor(r.
y() + 0.5);
2190 double rz = floor(r.
z() + 0.5);
2192 const double nii =
static_cast<double>(ni_-1);
2193 const double njj =
static_cast<double>(nj_-1);
2194 const double nkk =
static_cast<double>(nk_-1);
2196 if (rx < 0.0) rx = 0.0;
if (rx > nii) rx = nii;
2197 if (ry < 0.0) ry = 0.0;
if (ry > njj) ry = njj;
2198 if (rz < 0.0) rz = 0.0;
if (rz > nkk) rz = nkk;
2206 pdist = (p-result).length();
2212 template <
class Basis>
2219 bool ret = find_closest_node(pdist,result,node,p);
2220 if (!ret)
return (
false);
2221 if (maxdist < 0.0 || pdist < maxdist)
return (
true);
2225 template <
class Basis>
2229 std::vector<typename Elem::index_type> &elems,
2233 const double epsilon = 1e-8;
2236 if (ni_ == 0 || nj_ == 0 || nk_ == 0)
return (
false);
2243 const double nii =
static_cast<double>(ni_-2);
2244 const double njj =
static_cast<double>(nj_-2);
2247 if (ii < 0.0) ii = 0.0;
if (ii > nii) ii = nii;
2248 if (jj < 0.0) jj = 0.0;
if (jj > njj) jj = njj;
2249 if (jj < 0.0) jj = 0.0;
if (jj > njj) jj = njj;
2250 const double fii = floor(ii);
2251 const double fjj = floor(jj);
2252 const double fkk = floor(kk);
2264 elems.push_back(elem);
2266 if ((fabs(fii-ii) < epsilon) && ((i-1)>0))
2271 elems.push_back(elem);
2274 if ((fabs(fii-(ii+1.0)) < epsilon) && (i<(ni_-1)))
2279 elems.push_back(elem);
2282 if ((fabs(fjj-jj) < epsilon) && ((j-1)>0))
2287 elems.push_back(elem);
2290 if ((fabs(fjj-(jj+1.0)) < epsilon) && (j<(nj_-1)))
2295 elems.push_back(elem);
2298 if ((fabs(fkk-kk) < epsilon) && ((k-1)>0))
2303 elems.push_back(elem);
2306 if ((fabs(fkk-(kk+1.0)) < epsilon) && (k<(nk_-1)))
2311 elems.push_back(elem);
2315 pdist = (p-result).length();
2321 template <
class Basis>
2328 if (locate(idx, p)) {
2329 get_nodes(locs, idx);
2330 std::vector<double> coords(3);
2331 if (get_coords(coords, p, idx)) {
2332 basis_.get_weights(coords, w);
2333 return basis_.dofs();
2340 template <
class Basis>
2357 template <
class Basis>
2366 template <
class Basis>
2374 #define LATVOLMESH_VERSION 5
2376 template <
class Basis>
2387 unsigned int ni =
static_cast<unsigned int>(ni_);
2388 unsigned int nj =
static_cast<unsigned int>(nj_);
2389 unsigned int nk =
static_cast<unsigned int>(nk_);
2404 if (version < 2 && stream.
reading())
2410 transform_.pre_scale(max - min);
2412 transform_.compute_imat();
2414 else if (version < 3 && stream.
reading() )
2420 Pio(stream, transform_);
2438 template <
class Basis>
2442 ASSERT((n >= -1) && n <= 1);
2450 static const std::string nm(
"LatVolMesh");
2460 template <
class Basis>
2464 itr =
typename Node::iterator(
this, min_i_, min_j_, min_k_);
2468 template <
class Basis>
2472 itr =
typename Node::iterator(
this, min_i_, min_j_, min_k_ + nk_);
2476 template <
class Basis>
2484 template <
class Basis>
2497 template <
class Basis>
2501 itr =
typename Edge::iterator(0);
2505 template <
class Basis>
2509 itr = ((ni_-1) * nj_ * nk_) + (ni_ * (nj_-1) * nk_) + (ni_ * nj_ * (nk_-1));
2513 template <
class Basis>
2517 s = ((ni_-1) * nj_ * nk_) + (ni_ * (nj_-1) * nk_) + (ni_ * nj_ * (nk_-1));
2521 template <
class Basis>
2525 itr =
typename Face::iterator(0);
2529 template <
class Basis>
2533 itr = (ni_-1) * (nj_-1) * nk_ +
2534 ni_ * (nj_ - 1 ) * (nk_ - 1) +
2535 (ni_ - 1) * nj_ * (nk_ - 1);
2539 template <
class Basis>
2543 s = (ni_-1) * (nj_-1) * nk_ +
2544 ni_ * (nj_ - 1 ) * (nk_ - 1) +
2545 (ni_ - 1) * nj_ * (nk_ - 1);
2549 template <
class Basis>
2553 itr =
typename Cell::iterator(
this, min_i_, min_j_, min_k_);
2557 template <
class Basis>
2561 itr =
typename Cell::iterator(
this, min_i_, min_j_, min_k_ + nk_-1);
2565 template <
class Basis>
2573 template <
class Basis>
2586 template <
class Basis>
2594 jacobian_[0] = J1.
x();
2595 jacobian_[1] = J1.
y();
2596 jacobian_[2] = J1.
z();
2597 jacobian_[3] = J2.
x();
2598 jacobian_[4] = J2.
y();
2599 jacobian_[5] = J2.
z();
2600 jacobian_[6] = J3.
x();
2601 jacobian_[7] = J3.
y();
2602 jacobian_[8] = J3.
z();
2609 template <
class Basis>
2614 static_cast<double>(nj_-1),
2615 static_cast<double>(nk_-1));
2619 return ((q0-q1).length()*1e-8);
Definition: LatVolMesh.h:438
virtual MeshFacadeHandle getFacade() const
Definition: LatVolMesh.h:639
NodeIter iterator
Definition: LatVolMesh.h:425
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, typename Elem::index_type idx) const
Definition: LatVolMesh.h:686
bool get_min(std::vector< index_type > &) const
Definition: LatVolMesh.h:1330
Interface to statically allocated std::vector class.
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, typename Elem::index_type &elem, const Core::Geometry::Point &p) const
Definition: LatVolMesh.h:1039
Definition: LatVolMesh.h:353
virtual Core::Geometry::BBox get_bounding_box() const
Definition: LatVolMesh.h:1277
RangeNodeIter()
Definition: LatVolMesh.h:286
CellIter & operator++()
Definition: LatVolMesh.h:254
bool reading() const
Definition: Persistent.h:164
index_type i_
Definition: LatVolMesh.h:127
std::vector< index_type > array_type
Definition: LatVolMesh.h:449
RangeNodeIter range_iter
Definition: LatVolMesh.h:428
void get_elems(typename Elem::array_type &result, const typename Node::index_type &idx) const
get the parent element(s) of the given index
Definition: LatVolMesh.h:1737
void get_point(Core::Geometry::Point &p, const typename Node::index_type &i) const
Definition: LatVolMesh.h:955
Definition: FieldRNG.h:37
index_type get_min_j() const
Definition: LatVolMesh.h:818
const Core::Geometry::Point node7() const
Definition: LatVolMesh.h:557
ElemData(const LatVolMesh< Basis > &msh, const typename Cell::index_type ind)
Definition: LatVolMesh.h:471
NodeIter & operator++()
Definition: LatVolMesh.h:216
FaceIndex< under_type > size_type
Definition: LatVolMesh.h:441
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
Distinct type for face Iterator.
Definition: FieldIterator.h:121
double inverse_jacobian_[9]
Definition: LatVolMesh.h:1120
std::ostream & str_render(std::ostream &os) const
Definition: LatVolMesh.h:116
void pwl_approx_face(std::vector< std::vector< std::vector< double > > > &coords, typename Elem::index_type, unsigned int which_face, unsigned int div_per_unit) const
Definition: LatVolMesh.h:664
index_type get_min_i() const
get the mesh statistics
Definition: LatVolMesh.h:817
index_type node5_index() const
Definition: LatVolMesh.h:505
const Core::Geometry::Point node4() const
Definition: LatVolMesh.h:542
Point max() const
Definition: BBox.h:195
const CellIndex & operator*() const
Definition: LatVolMesh.h:247
static Persistent * maker()
This function returns a maker for Pio.
Definition: LatVolMesh.h:1094
void set_min_j(index_type j)
Definition: LatVolMesh.h:833
bool operator==(const LatIter &a) const
Definition: LatVolMesh.h:195
SCIRun::index_type index_type
Definition: LatVolMesh.h:94
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: LatVolMesh.h:1096
Definition: LatVolMesh.h:63
Definition: Persistent.h:89
Definition: LatVolMesh.h:431
Basis & get_basis()
Definition: LatVolMesh.h:647
LatSize(size_type i, size_type j, size_type k)
Definition: LatVolMesh.h:162
bool locate(typename Node::index_type &, const Core::Geometry::Point &) const
Definition: LatVolMesh.h:2149
index_type nj() const
Definition: LatVolMesh.h:124
virtual bool unsynchronize(mask_type)
Definition: LatVolMesh.h:679
const Core::Geometry::Point node6() const
Definition: LatVolMesh.h:552
Basis basis_type
Definition: LatVolMesh.h:99
virtual const TypeDescription * get_type_description() const
Definition: LatVolMesh.h:1148
Definition: LatVolMesh.h:180
index_type get_min_k() const
Definition: LatVolMesh.h:819
int get_weights(const Core::Geometry::Point &, typename Edge::array_type &, double *)
Definition: LatVolMesh.h:949
void derivate(const VECTOR1 &coords, typename Elem::index_type idx, VECTOR2 &J) const
Definition: LatVolMesh.h:748
void y(const double)
Definition: Point.h:135
double get_length(typename Edge::index_type idx) const
Definition: LatVolMesh.h:934
FaceIndex< under_type > index_type
Definition: LatVolMesh.h:439
index_type ni() const
Definition: LatVolMesh.h:123
Definition: Persistent.h:187
double inverse_jacobian(const VECTOR &, typename Elem::index_type, double *Ji) const
Definition: LatVolMesh.h:795
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
virtual LatVolMesh * clone() const
Definition: LatVolMesh.h:628
index_type node3_index() const
Definition: LatVolMesh.h:495
static const TypeDescription * face_type_description()
Definition: LatVolMesh.h:1192
index_type node2_index() const
Definition: LatVolMesh.h:489
Definition: TypeDescription.h:50
void end(typename Node::iterator &) const
Definition: LatVolMesh.h:174
LatIndex()
Definition: LatVolMesh.h:107
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
size_type k_
Definition: LatVolMesh.h:171
size_type nk_
Definition: LatVolMesh.h:1111
size_type j_
Definition: LatVolMesh.h:171
std::ostream & str_render(std::ostream &os) const
Definition: LatVolMesh.h:166
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
const LatIndex & operator*()
Definition: LatVolMesh.h:193
virtual std::string dynamic_type_name() const
Definition: LatVolMesh.h:1068
LatIter()
Definition: LatVolMesh.h:189
RangeNodeIter(const LatVolMesh *m, index_type i, index_type j, index_type k, index_type max_i, index_type max_j, index_type max_k)
Definition: LatVolMesh.h:289
void end(NodeIter &end_iter)
Definition: LatVolMesh.h:320
NodeIndex index_type
Definition: LatVolMesh.h:424
unsigned int mask_type
Definition: Types.h:45
Definition: LatVolMesh.h:104
virtual bool has_normals() const
Definition: LatVolMesh.h:643
virtual int topology_geometry() const
Definition: LatVolMesh.h:1081
bool find_closest_node(double &pdist, Core::Geometry::Point &result, typename Node::index_type &elem, const Core::Geometry::Point &p) const
Definition: LatVolMesh.h:2179
Definition: LatVolMesh.h:158
index_type min_j_
Definition: LatVolMesh.h:1108
#define ASSERT(condition)
Definition: Assert.h:110
LatIndex(const LatVolMesh *m, index_type i, index_type j, index_type k)
Definition: LatVolMesh.h:108
virtual bool has_face_normals() const
Definition: LatVolMesh.h:644
index_type node0_index() const
Definition: LatVolMesh.h:479
RangeNodeIter & operator++()
Definition: LatVolMesh.h:297
index_type min_k_
Definition: LatVolMesh.h:1108
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
virtual void get_canonical_transform(Core::Geometry::Transform &t)
Definition: LatVolMesh.h:1321
EdgeIndex< under_type > size_type
Definition: LatVolMesh.h:434
virtual void transform(const Core::Geometry::Transform &t)
Definition: LatVolMesh.h:1311
void begin(typename Node::iterator &) const
void set_nj(index_type j)
Definition: LatVolMesh.h:842
bool locate(typename Edge::index_type &, const Core::Geometry::Point &) const
Definition: LatVolMesh.h:942
static std::string type_name(int i=-1)
Definition: LatVolMesh.h:151
Index and Iterator types required for Mesh Concept.
Definition: LatVolMesh.h:423
double get_size(const typename Node::index_type &idx) const
Get the size of an elemnt (length, area, volume)
Definition: LatVolMesh.h:2050
double det_inverse_jacobian_
Definition: LatVolMesh.h:1123
virtual bool is_editable() const
Definition: LatVolMesh.h:645
void get_random_point(Core::Geometry::Point &, const typename Elem::index_type &, FieldRNG &rng) const
Definition: LatVolMesh.h:1250
index_type j_
Definition: LatVolMesh.h:127
const string find_type_name(float *)
Definition: TypeName.cc:63
void z(const double)
Definition: Point.h:145
const Core::Geometry::Point node3() const
Definition: LatVolMesh.h:537
size_type ni_
Definition: LatVolMesh.h:1111
LatVolMesh()
Definition: LatVolMesh.h:568
void get_normal(Core::Geometry::Vector &, const typename Node::index_type &) const
Definition: LatVolMesh.h:958
double det_jacobian_
Definition: LatVolMesh.h:1121
NodeSize(size_type i, size_type j, size_type k)
Definition: LatVolMesh.h:183
double get_volume(const typename Cell::index_type &i) const
Definition: LatVolMesh.h:938
double scaled_jacobian_metric(typename Elem::index_type) const
Definition: LatVolMesh.h:810
T DetMatrix3x3(const T *p)
Definition: Locate.h:95
const NodeIndex & operator*() const
Definition: LatVolMesh.h:295
index_type min_i_
the min_Node::index_type ( incase this is a subLattice )
Definition: LatVolMesh.h:1108
Definition: ParallelLinearAlgebraTests.cc:358
FaceIterator< under_type > iterator
Definition: LatVolMesh.h:440
double get_epsilon() const
Definition: LatVolMesh.h:2611
Definition: LatVolMesh.h:187
const char * name[]
Definition: BoostGraphExampleTests.cc:87
void x(const double)
Definition: Point.h:125
const Core::Geometry::Point node0() const
Definition: LatVolMesh.h:522
static const TypeDescription * cell_type_description()
Definition: LatVolMesh.h:1210
virtual int dimensionality() const
Definition: LatVolMesh.h:1080
long long size_type
Definition: Types.h:40
StackVector< index_type, 8 > array_type
Definition: LatVolMesh.h:427
void get_faces(typename Face::array_type &, const typename Cell::index_type &) const
Definition: LatVolMesh.h:1670
double det_jacobian(const VECTOR &coords, typename Elem::index_type idx) const
Definition: LatVolMesh.h:769
RangeCellIter range_iter
Definition: LatVolMesh.h:450
const Core::Geometry::Point node2() const
Definition: LatVolMesh.h:532
Vector Cross(const Vector &v1, const Vector &v2)
Definition: Vector.h:378
void set_min(std::vector< index_type > mins)
Definition: LatVolMesh.h:1360
NodeSize()
Definition: LatVolMesh.h:182
double scaled_jacobian_
Definition: LatVolMesh.h:1122
CellSize(size_type i, size_type j, size_type k)
Definition: LatVolMesh.h:177
void set_nk(index_type k)
Definition: LatVolMesh.h:848
static const TypeDescription * node_type_description()
Definition: LatVolMesh.h:1156
void size(typename Node::size_type &) const
LatSize()
Definition: LatVolMesh.h:161
void get_delems(typename DElem::array_type &result, const typename Elem::index_type &idx) const
Wrapper to get the derivative elements from this element.
Definition: LatVolMesh.h:903
void get_center(Core::Geometry::Point &, const typename Node::index_type &) const
get the center point (in object space) of an element
Definition: LatVolMesh.h:2040
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, typename Elem::index_type &elem, const Core::Geometry::Point &p, double maxdist) const
Definition: LatVolMesh.h:980
LatVolMesh(const LatVolMesh ©)
Definition: LatVolMesh.h:607
virtual int basis_order()
Definition: LatVolMesh.h:641
Core::Geometry::Vector diagonal() const
Definition: LatVolMesh.h:1303
NodeIndex(const LatVolMesh *m, size_type i, size_type j, size_type k)
Definition: LatVolMesh.h:149
friend struct FaceIter
Definition: LatVolMesh.h:459
Definition: LatVolMesh.h:208
void set_ni(index_type i)
Definition: LatVolMesh.h:836
double jacobian_[9]
Definition: LatVolMesh.h:1119
std::string type
Definition: Persistent.h:72
void get_cells(typename Cell::array_type &arr, const Core::Geometry::BBox &box)
return all cell_indecies that overlap the BBox in arr.
Definition: LatVolMesh.h:1762
static const TypeDescription * edge_type_description()
Definition: LatVolMesh.h:1174
void set_min_k(index_type k)
Definition: LatVolMesh.h:834
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: LatVolMesh.h:2440
Point min() const
Definition: BBox.h:192
Distinct type for face index.
Definition: FieldIndex.h:90
SCISHARE bool overlaps(const BBox &bb) const
bbox's that share a face overlap
Definition: BBox.cc:88
RangeCellIter & operator++()
Definition: LatVolMesh.h:366
size_type i_
Definition: LatVolMesh.h:171
Core::Geometry::Transform & get_transform()
Definition: LatVolMesh.h:1071
void x(double)
Definition: Vector.h:175
Basis basis_
Definition: LatVolMesh.h:1114
void to_index(typename Face::index_type &index, index_type i) const
Definition: LatVolMesh.h:877
Cell Elem
Definition: LatVolMesh.h:453
static MeshHandle latvol_maker(size_type x, size_type y, size_type z, const Core::Geometry::Point &min, const Core::Geometry::Point &max)
This function returns a handle for the virtual interface.
Definition: LatVolMesh.h:1098
virtual bool synchronize(mask_type)
Definition: LatVolMesh.h:678
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
RangeCellIter(const LatVolMesh *m, index_type i, index_type j, index_type k, index_type max_i, index_type max_j, index_type max_k)
Definition: LatVolMesh.h:358
v
Definition: readAllFields.py:42
Definition: LatVolMesh.h:146
bool find_closest_elems(double &pdist, Core::Geometry::Point &result, std::vector< typename Elem::index_type > &elem, const Core::Geometry::Point &p) const
Definition: LatVolMesh.h:2227
CellSize size_type
Definition: LatVolMesh.h:448
const Core::Geometry::Point node5() const
Definition: LatVolMesh.h:547
bool locate(typename Face::index_type &, const Core::Geometry::Point &) const
Definition: LatVolMesh.h:944
std::vector< index_type > array_type
Definition: LatVolMesh.h:442
Definition: LatVolMesh.h:241
void compute_jacobian()
Definition: LatVolMesh.h:2588
void y(double)
Definition: Vector.h:185
CellIndex(const LatVolMesh *m, index_type i, index_type j, index_type k)
Definition: LatVolMesh.h:136
LatVolMesh(LatVolMesh *, size_type mx, size_type my, size_type mz, size_type x, size_type y, size_type z)
Definition: LatVolMesh.h:588
double get_area(typename Face::index_type idx) const
Definition: LatVolMesh.h:936
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
Definition: LatVolMesh.h:284
CellSize()
Definition: LatVolMesh.h:176
#define ASSERTFAIL(string)
Definition: Assert.h:52
index_type node4_index() const
Definition: LatVolMesh.h:500
void jacobian(const VECTOR &coords, typename Elem::index_type idx, double *J) const
Definition: LatVolMesh.h:778
LatIter(const LatVolMesh *m, index_type i, index_type j, index_type k)
Definition: LatVolMesh.h:190
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
Some convenient simple iterators for fields.
friend struct EdgeIter
Definition: LatVolMesh.h:458
NodeIndex()
Definition: LatVolMesh.h:148
bool operator!=(const LatIter &a) const
Definition: LatVolMesh.h:201
index_type nk() const
Definition: LatVolMesh.h:125
CellIndex index_type
Definition: LatVolMesh.h:446
double jacobian_metric(typename Elem::index_type) const
Definition: LatVolMesh.h:813
virtual bool get_dim(std::vector< size_type > &) const
Definition: LatVolMesh.h:1345
double length() const
Definition: Vector.h:365
virtual void end_class()
Definition: Persistent.cc:178
CellIter iterator
Definition: LatVolMesh.h:447
virtual VMesh * vmesh()
Access point to virtual interface.
Definition: LatVolMesh.h:635
CellIter(const LatVolMesh *m, index_type i, index_type j, index_type k)
Definition: LatVolMesh.h:244
Core::Geometry::Transform & set_transform(const Core::Geometry::Transform &trans)
Definition: LatVolMesh.h:1072
T ScaledDetMatrix3x3(const T *p)
Definition: Locate.h:106
NodeIter(const LatVolMesh *m, index_type i, index_type j, index_type k)
Definition: LatVolMesh.h:211
index_type node1_index() const
Definition: LatVolMesh.h:484
void end(CellIter &end_iter)
Definition: LatVolMesh.h:389
LatVolMesh< Basis >::index_type index_type
Definition: LatVolMesh.h:469
long long index_type
Definition: Types.h:39
const NodeIndex & operator*() const
Definition: LatVolMesh.h:214
static const TypeDescription * elem_type_description()
Definition: LatVolMesh.h:1090
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
bool clear_synchronization()
Definition: LatVolMesh.h:680
VMesh * CreateVLatVolMesh(MESH *)
Definition: LatVolMesh.h:69
SCISHARE void Pio_old(Piostream &, Transform &)
Definition: Transform.cc:940
Face DElem
Definition: LatVolMesh.h:454
RangeCellIter()
Definition: LatVolMesh.h:355
NodeSize size_type
Definition: LatVolMesh.h:426
Definition: LatVolMesh.h:133
unsigned long long Max(unsigned long long d1, unsigned long long d2)
Definition: MiscMath.h:75
Core::Geometry::Transform transform_
Definition: LatVolMesh.h:1113
EdgeIterator< under_type > iterator
Definition: LatVolMesh.h:433
int get_weights(const Core::Geometry::Point &p, typename Node::array_type &l, double *w)
Definition: LatVolMesh.h:2323
Definition: Persistent.h:64
boost::shared_ptr< LatVolMesh< Basis > > handle_type
Definition: LatVolMesh.h:98
const Core::Geometry::Point node1() const
Definition: LatVolMesh.h:527
int get_weights(const Core::Geometry::Point &, typename Face::array_type &, double *)
Definition: LatVolMesh.h:951
Distinct type for edge index.
Definition: FieldIndex.h:81
unsigned long long Min(unsigned long long d1, unsigned long long d2)
Faster versions of several math functions.
Definition: MiscMath.h:70
int n
Definition: eab.py:9
SCIRun::mask_type mask_type
Definition: LatVolMesh.h:96
index_type get_nk() const
Definition: LatVolMesh.h:823
friend class VLatVolMesh
Definition: LatVolMesh.h:89
void to_index(typename Edge::index_type &index, index_type i) const
Definition: LatVolMesh.h:875
index_type get_nj() const
Definition: LatVolMesh.h:822
index_type get_ni() const
Definition: LatVolMesh.h:821
NodeIter()
Definition: LatVolMesh.h:210
T InverseMatrix3x3(const T *p, T *q)
Definition: Locate.h:47
index_type node7_index() const
Definition: LatVolMesh.h:516
void get_normal(Core::Geometry::Vector &, std::vector< double > &, typename Elem::index_type, unsigned int)
Definition: LatVolMesh.h:960
CellIter()
Definition: LatVolMesh.h:243
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: LatVolMesh.h:2378
CellIndex()
Definition: LatVolMesh.h:135
bool get_neighbor(typename Cell::index_type &neighbor, const typename Cell::index_type &from, typename Face::index_type face) const
Definition: LatVolMesh.h:1827
Definition: LatVolMesh.h:445
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
index_type node6_index() const
Definition: LatVolMesh.h:511
const LatVolMesh * mesh_
Definition: LatVolMesh.h:130
void io(Piostream &stream)
Persistent I/O.
Definition: Mesh.cc:387
SCIRun::size_type size_type
Definition: LatVolMesh.h:95
boost::shared_ptr< VMesh > vmesh_
Definition: LatVolMesh.h:1125
void set_min_i(index_type i)
set the mesh statistics
Definition: LatVolMesh.h:832
EdgeIndex< under_type > index_type
Definition: LatVolMesh.h:432
void Pio_size(Piostream &stream, Size &size)
Definition: Persistent.h:273
void z(double)
Definition: Vector.h:195
void pwl_approx_edge(std::vector< std::vector< double > > &coords, typename Elem::index_type, unsigned int which_edge, unsigned int div_per_unit) const
Definition: LatVolMesh.h:651
virtual ~LatVolMesh()
Definition: LatVolMesh.h:629
boost::shared_ptr< MeshFacade< VMesh > > MeshFacadeHandle
Definition: MeshTraits.h:61
index_type k_
Definition: LatVolMesh.h:127
virtual void set_dim(std::vector< size_type > dims)
Definition: LatVolMesh.h:1370
#define LATVOLMESH_VERSION
Definition: LatVolMesh.h:2374
void get_edges(typename Edge::array_type &, typename Face::index_type) const
Definition: LatVolMesh.h:1513
SCIRun::index_type under_type
Definition: LatVolMesh.h:93
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 CellIndex & operator*() const
Definition: LatVolMesh.h:364
void to_index(typename Node::index_type &index, index_type i) const
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, typename Elem::index_type idx) const
Definition: LatVolMesh.h:726
Definition: LatVolMesh.h:466
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, typename Elem::index_type &elem, const Core::Geometry::Point &p) const
Definition: LatVolMesh.h:997