30 #ifndef CORE_DATATYPES_HEXVOLMESH
31 #define CORE_DATATYPES_HEXVOLMESH 1
63 #include <boost/thread.hpp>
90 #if (SCIRUN_HEXVOL_SUPPORT > 0)
93 #if (SCIRUN_QUADRATIC_SUPPORT > 0)
96 #if (SCIRUN_CUBIC_SUPPORT > 0)
104 HexVolEdgePerNodeTable[8][6] = {{3,0, 0,1, 0,4},
114 HexVolFacePerNodeTable[8][12] = {{0,1,2,3, 0,4,5,1, 3,7,4,0},
115 {0,1,2,3, 0,4,5,1, 1,5,6,2},
116 {0,1,2,3, 2,6,7,3, 1,5,6,2},
117 {0,1,2,3, 2,6,7,3, 3,7,4,0},
118 {0,4,5,1, 3,7,4,0, 7,6,5,4},
119 {0,4,5,1, 1,5,6,2, 7,6,5,4},
120 {2,6,7,3, 1,5,6,2, 7,6,5,4},
121 {2,6,7,3, 3,7,4,0, 7,6,5,4}};
124 HexVolFacePerEdgeTable[12][8] = {{0, 1, 2, 3, 0, 4, 5, 1},
125 {0, 1, 2, 3, 1, 5, 6, 2},
126 {0, 1, 2, 3, 2, 6, 7, 3},
127 {0, 1, 2, 3, 3, 7, 4, 0},
128 {7, 6, 5, 4, 0, 4, 5, 1},
129 {7, 6, 5, 4, 1, 5, 6, 2},
130 {7, 6, 5, 4, 2, 6, 7, 3},
131 {7, 6, 5, 4, 3, 7, 4, 0},
132 {0, 4, 5, 1, 3, 7, 4, 0},
133 {0, 4, 5, 1, 1, 5, 6, 2},
134 {2, 6, 7, 3, 1, 5, 6, 2},
135 {2, 6, 7, 3, 3, 7, 4, 0}};
138 HexVolEdgePerFaceTable[6][8] = {{0,1, 1,2, 2,3, 3,0},
139 {6,7, 5,6, 4,5, 7,4},
140 {0,4, 4,5, 5,1, 0,1},
141 {2,6, 6,7, 7,3, 2,3},
142 {7,3, 7,4, 0,4, 3,0},
143 {5,1, 5,6, 2,6, 1,2}};
146 HexVolEdgeTable[12][2] = {{0,1},{1,2},{2,3},{3,0},
147 {4,5},{5,6},{6,7},{7,4},
148 {0,4},{5,1},{2,6},{7,3}};
151 HexVolFaceTable[6][4] = { {0,1,2,3},{7,6,5,4},{0,4,5,1},
152 {2,6,7,3},{3,7,4,0},{1,5,6,2}};
157 template <
class Basis>
158 class HexVolMesh :
public Mesh
226 if (basis_type::polynomial_order() > 1)
228 mesh_.get_edges_from_cell(edges_, index_);
235 return mesh_.cells_[index_ * 8];
239 return mesh_.cells_[index_ * 8 + 1];
243 return mesh_.cells_[index_ * 8 + 2];
247 return mesh_.cells_[index_ * 8 + 3];
251 return mesh_.cells_[index_ * 8 + 4];
255 return mesh_.cells_[index_ * 8 + 5];
259 return mesh_.cells_[index_ * 8 + 6];
263 return mesh_.cells_[index_ * 8 + 7];
364 mesh_(mesh), sync_(sync) {}
369 mesh_.synchronize_lock_.lock();
371 sync_ &= ~(mesh_.synchronized_);
373 sync_ &= ~(mesh_.synchronizing_);
376 mesh_.synchronizing_ |= sync_;
378 mesh_.synchronize_lock_.unlock();
391 while(!(mesh_.synchronized_&Mesh::BOUNDING_BOX_E))
392 mesh_.synchronize_cond_.wait(lock);
398 mesh_.synchronize_lock_.lock();
400 mesh_.synchronized_ |= sync_;
402 mesh_.synchronizing_ &= ~(sync_);
404 mesh_.synchronize_cond_.conditionBroadcast();
405 mesh_.synchronize_lock_.unlock();
433 return boost::make_shared<Core::Datatypes::VirtualMeshFacade<VMesh>>(
vmesh_);
513 { array.
resize(1); array[0]= idx; }
529 { array.resize(1); array[0]= idx; }
546 { array.resize(1); array[0]= idx; }
562 { array.resize(1); array[0]= idx; }
575 { array.resize(1); array[0]= idx; }
585 { array.resize(1); array[0]= idx; }
593 template<
class VECTOR,
class INDEX>
596 unsigned int which_edge,
597 unsigned int div_per_unit)
const
599 basis_.approx_edge(which_edge, div_per_unit, coords);
604 template<
class VECTOR,
class INDEX>
607 unsigned int which_face,
608 unsigned int div_per_unit)
const
610 basis_.approx_face(which_face, div_per_unit, coords);
634 return ((p1 - p0).length());
648 return ((
Cross(p0-p1,p2-p0)).length()+(
Cross(p2-p3,p0-p2)).length())*0.5;
654 return (
basis_.get_volume(ed));
699 std::vector<double>& coords,
707 {
ASSERTFAIL(
"HexVolMesh: get_weights for edges isn't supported"); }
709 {
ASSERTFAIL(
"HexVolMesh: get_weights for faces isn't supported"); }
721 {
ASSERTFAIL(
"HexVolMesh: this mesh type does not have node normals."); }
724 template<
class VECTOR,
class INDEX1,
class INDEX2>
726 INDEX1 eidx, INDEX2 fidx)
const
730 unsigned int fmap[] = {0, 5, 1, 3, 4, 2};
731 unsigned int face = fmap[fidx];
738 const double un0 =
basis_.unit_face_normals[face][0];
739 const double un1 =
basis_.unit_face_normals[face][1];
740 const double un2 =
basis_.unit_face_normals[face][2];
743 result.
x(Ji[0]*un0+Ji[1]*un1+Ji[2]*un2);
744 result.
y(Ji[3]*un0+Ji[4]*un1+Ji[5]*un2);
745 result.
z(Ji[6]*un0+Ji[7]*un1+Ji[8]*un2);
757 template<
class ARRAY>
760 ASSERTMSG(a.size() == 8,
"Tried to add non-hex element.");
762 return add_hex( static_cast<typename Node::index_type>(a[0]),
763 static_cast<typename Node::index_type>(a[1]),
764 static_cast<typename Node::index_type>(a[2]),
765 static_cast<typename Node::index_type>(a[3]),
766 static_cast<typename Node::index_type>(a[4]),
767 static_cast<typename Node::index_type>(a[5]),
768 static_cast<typename Node::index_type>(a[6]),
769 static_cast<typename Node::index_type>(a[7]) );
782 template<
class VECTOR,
class INDEX>
786 return basis_.get_coords(coords, p, ed);
791 template<
class VECTOR,
class INDEX>
795 pt =
basis_.interpolate(coords, ed);
801 template<
class VECTOR1,
class INDEX,
class VECTOR2>
802 void derivate(
const VECTOR1 &coords, INDEX idx, VECTOR2 &J)
const
805 basis_.derivate(coords, ed, J);
810 template<
class VECTOR,
class INDEX>
815 basis_.derivate(coords,ed,Jv);
822 template<
class VECTOR,
class INDEX>
823 void jacobian(
const VECTOR& coords, INDEX idx,
double* J)
const
827 basis_.derivate(coords,ed,Jv);
842 template<
class VECTOR,
class INDEX>
847 basis_.derivate(coords,ed,Jv);
851 template<
class INDEX>
867 if(temp < min_jacobian) min_jacobian = temp;
870 return (min_jacobian);
873 template<
class INDEX>
889 if(temp < min_jacobian) min_jacobian = temp;
892 return (min_jacobian);
895 template <
class INDEX>
902 template <
class INDEX>
906 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
910 if (sz == 0)
return (
false);
912 if (node >= 0 && node < sz)
915 double dist = (point-p).length2();
926 "HexVolMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
938 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
939 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
940 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
942 ei = bi; ej = bj; ek = bk;
944 double dmin = maxdist;
945 bool found_one =
false;
955 if (i < 0 || i > ni)
continue;
958 if (j < 0 || j > nj)
continue;
961 if (k < 0 || k > nk)
continue;
962 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
964 if (
node_grid_->min_distance_squared(p, i, j, k) < dmin)
973 const double dist = (p-
point).length2();
1001 if (!found_one)
return (
false);
1007 template <
class ARRAY>
1013 "HexVolMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
1030 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1031 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1032 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1034 if (ei > ni) ei = ni;
if (ei < 0) ei = 0;
1035 if (ej > nj) ej = nj;
if (ej < 0) ej = 0;
1036 if (ek > nk) ek = nk;
if (ek < 0) ek = 0;
1038 double maxdist2 = maxdist*maxdist;
1046 if (
node_grid_->min_distance_squared(p, i, j, k) < maxdist2)
1054 const double dist = (p-
point).length2();
1056 if (dist < maxdist2)
1058 nodes.push_back(*it);
1067 return(nodes.size() > 0);
1071 template <
class ARRAY1,
class ARRAY2>
1078 "HexVolMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
1095 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1096 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1097 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1099 if (ei > ni) ei = ni;
if (ei < 0) ei = 0;
1100 if (ej > nj) ej = nj;
if (ej < 0) ej = 0;
1101 if (ek > nk) ek = nk;
if (ek < 0) ek = 0;
1103 double maxdist2 = maxdist*maxdist;
1111 if (
node_grid_->min_distance_squared(p, i, j, k) < maxdist2)
1119 const double dist = (p-
point).length2();
1121 if (dist < maxdist2)
1123 nodes.push_back(*it);
1124 distances.push_back(dist);
1133 return(nodes.size() > 0);
1139 template <
class INDEX,
class ARRAY>
1150 template <
class INDEX,
class ARRAY>
1156 double maxdist)
const
1158 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
1162 if (sz == 0)
return (
false);
1165 if ((elem > 0)&&(elem < sz))
1170 basis_.get_coords(coords, p, ed);
1178 "HexVolMesh: need to synchronize ELEM_LOCATE_E first");
1180 "HexVolMesh: need to synchronize FACES_E first");
1192 elem =
static_cast<INDEX
>(*it);
1194 basis_.get_coords(coords, p, ed);
1212 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1213 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1214 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1216 ei = bi; ej = bj; ek = bk;
1218 double dmin = maxdist;
1220 bool found_one =
false;
1229 if (i < 0 || i > ni)
continue;
1232 if (j < 0 || j > nj)
continue;
1235 if (k < 0 || k > nk)
continue;
1236 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
1238 if (
elem_grid_->min_distance_squared(p, i, j, k) < dmin)
1259 const double dtmp = (p - r).length2();
1270 basis_.get_coords(coords,result,ed);
1272 result =
basis_.interpolate(coords,ed);
1273 double dmin = (result-p).length2();
1286 const double dtmp = (p - r).length2();
1297 basis_.get_coords(coords,result,ed);
1299 result =
basis_.interpolate(coords,ed);
1300 double dmin = (result-p).length2();
1313 const double dtmp = (p - r).length2();
1324 basis_.get_coords(coords,result,ed);
1326 result =
basis_.interpolate(coords,ed);
1327 double dmin = (result-p).length2();
1340 const double dtmp = (p - r).length2();
1351 basis_.get_coords(coords,result,ed);
1353 result =
basis_.interpolate(coords,ed);
1354 double dmin = (result-p).length2();
1367 const double dtmp = (p - r).length2();
1378 basis_.get_coords(coords,result,ed);
1380 result =
basis_.interpolate(coords,ed);
1381 double dmin = (result-p).length2();
1394 const double dtmp = (p - r).length2();
1405 basis_.get_coords(coords,result,ed);
1407 result =
basis_.interpolate(coords,ed);
1408 double dmin = (result-p).length2();
1429 if (!found_one)
return (
false);
1432 basis_.get_coords(coords,result,ed);
1434 result =
basis_.interpolate(coords,ed);
1435 dmin = (result-p).length2();
1440 template <
class INDEX>
1449 template<
class ARRAY>
1453 ASSERTFAIL(
"HexVolMesh: Find closest element has not yet been implemented.");
1467 static const std::string
type_name(
int n = -1);
1498 template <
class Iter,
class Functor>
1500 template <
class Iter,
class Functor>
1502 template <
class Iter,
class Functor>
1504 template <
class Iter,
class Functor>
1510 double err = 1.0e-6);
1540 template<
class ARRAY,
class INDEX>
1544 "HexVolMesh: Must call synchronize EDGES_E first");
1547 { array.clear();
return; }
1552 index_type cell_index = (cell_edge_index>>4) << 3;
1553 index_type edge_index = (cell_edge_index)&0xF;
1555 const int *offset = HexVolEdgeTable[edge_index];
1556 array[0] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[0]]);
1557 array[1] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[1]]);
1561 template<
class ARRAY,
class INDEX>
1565 "HexVolMesh: Must call synchronize FACES_E first");
1568 { array.clear();
return; }
1571 index_type cell_index = cell_face_index&(~0x7);
1576 const int *offset = HexVolFaceTable[face_index];
1577 array[0] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[0]]);
1578 array[1] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[1]]);
1579 array[2] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[2]]);
1580 array[3] =
static_cast<typename ARRAY::value_type
>(
cells_[cell_index+offset[3]]);
1585 template<
class ARRAY,
class INDEX>
1590 array[0] =
static_cast<typename ARRAY::value_type
>(
cells_[off]);
1591 array[1] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 1]);
1592 array[2] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 2]);
1593 array[3] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 3]);
1594 array[4] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 4]);
1595 array[5] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 5]);
1596 array[6] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 6]);
1597 array[7] =
static_cast<typename ARRAY::value_type
>(
cells_[off + 7]);
1600 template<
class ARRAY,
class INDEX>
1606 template<
class ARRAY,
class INDEX>
1610 "HexVolMesh: Must call synchronize FACES_E first");
1612 "HexVolMesh: Must call synchronize EDGES_E first");
1621 int face_index = f.
cells_[0]&0x7;
1622 const int* offset = HexVolFaceTable[face_index];
1632 array.push_back(static_cast<typename ARRAY::value_type>(
1638 array.push_back(static_cast<typename ARRAY::value_type>(
1644 array.push_back(static_cast<typename ARRAY::value_type>(
1650 array.push_back(static_cast<typename ARRAY::value_type>(
1655 template<
class ARRAY,
class INDEX>
1659 "HexVolMesh: Must call synchronize EDGES_E first");
1668 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1670 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1672 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1674 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1677 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1679 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1681 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1683 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1686 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1688 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1690 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1692 if (n1 != n2) {
PEdgeNode e(n1,n2); array[i++] =
static_cast<typename ARRAY::value_type
>(
edge_table_.find(e)->second); }
1695 template<
class ARRAY,
class INDEX>
1701 template<
class ARRAY,
class INDEX>
1705 "HexVolMesh: Must call synchronize FACES_E first");
1721 array.push_back(static_cast<typename ARRAY::value_type>(
1729 array.push_back(static_cast<typename ARRAY::value_type>(
1737 array.push_back(static_cast<typename ARRAY::value_type>(
1745 array.push_back(static_cast<typename ARRAY::value_type>(
1753 array.push_back(static_cast<typename ARRAY::value_type>(
1761 array.push_back(static_cast<typename ARRAY::value_type>(
1766 template<
class ARRAY,
class INDEX>
1770 "HexVolMesh: Must call synchronize NODE_NEIGHBORS_E first.");
1774 array[i] = static_cast<typename ARRAY::value_type>(
1778 template<
class ARRAY,
class INDEX>
1782 "HexVolMesh: Must call synchronize NODE_NEIGHBORS_E first");
1784 "HexVolMesh: Must call synchronize EDGES_E first");
1787 const std::vector<typename Cell::index_type>& neighbors =
node_neighbors_[idx];
1790 array.reserve(neighbors.size());
1792 for (
size_t n = 0;
n < neighbors.size();
n++)
1797 const int *offset = HexVolEdgePerNodeTable[node_index];
1800 typename edge_nt::const_iterator iter =
edge_table_.find(e);
1801 if (((
edges_[iter->second].cells_[0])&(~0xf))==(cell_index<<1) )
1802 array.push_back(
typename ARRAY::value_type(iter->second));
1806 if (((
edges_[iter->second].cells_[0])&(~0xf))==(cell_index<<1) )
1807 array.push_back(
typename ARRAY::value_type(iter->second));
1811 if (((
edges_[iter->second].cells_[0])&(~0xf))==(cell_index<<1) )
1812 array.push_back(
typename ARRAY::value_type(iter->second));
1816 template<
class ARRAY,
class INDEX>
1820 "HexVolMesh: Must call synchronize EDGES_E first");
1822 "HexVolMesh: Must call synchronize FACES_E first");
1826 for (
size_t c=0; c<
edges_[idx].cells_.size();c++)
1831 const int* off = HexVolFacePerEdgeTable[face_index];
1834 typename face_nt::const_iterator fiter;
1836 n1 =
cells_[cell_index+off[0]]; n2 =
cells_[cell_index+off[1]];
1837 n3 =
cells_[cell_index+off[2]]; n4 =
cells_[cell_index+off[3]];
1842 if (((
faces_[fiter->second].cells_[0])&(~0x7)) == cell_index)
1843 array.push_back(
typename ARRAY::value_type(fiter->second));
1846 n1 =
cells_[cell_index+off[4]]; n2 =
cells_[cell_index+off[5]];
1847 n3 =
cells_[cell_index+off[6]]; n4 =
cells_[cell_index+off[7]];
1852 if (((
faces_[fiter->second].cells_[0])&(~0x7)) == cell_index)
1853 array.push_back(
typename ARRAY::value_type(fiter->second));
1858 template<
class ARRAY,
class INDEX>
1862 "HexVolMesh: Must call synchronize EDGES_E first");
1864 "HexVolMesh: Must call synchronize NODE_NEIGHBORS_E first");
1866 "HexVolMesh: Must call synchronize FACES_E first");
1869 const std::vector<typename Cell::index_type>& neighbors =
node_neighbors_[idx];
1872 for (
size_t n = 0;
n < neighbors.size();
n++)
1877 const int *offset = HexVolFacePerNodeTable[node_index];
1881 n1 =
cells_[cell_index+offset[0]]; n2 =
cells_[cell_index+offset[1]];
1882 n3 =
cells_[cell_index+offset[2]]; n4 =
cells_[cell_index+offset[3]];
1887 if (((
faces_[iter->second].cells_[0])&(~0x7))==cell_index)
1888 array.push_back(
typename ARRAY::value_type(iter->second));
1891 n1 =
cells_[cell_index+offset[4]]; n2 =
cells_[cell_index+offset[5]];
1892 n3 =
cells_[cell_index+offset[6]]; n4 =
cells_[cell_index+offset[7]];
1897 if (((
faces_[iter->second].cells_[0])&(~0x7))==cell_index)
1898 array.push_back(
typename ARRAY::value_type(iter->second));
1901 n1 =
cells_[cell_index+offset[8]]; n2 =
cells_[cell_index+offset[9]];
1902 n3 =
cells_[cell_index+offset[10]]; n4 =
cells_[cell_index+offset[11]];
1907 if (((
faces_[iter->second].cells_[0])&(~0x7))==cell_index)
1908 array.push_back(
typename ARRAY::value_type(iter->second));
1913 template<
class ARRAY,
class INDEX>
1917 "HexVolMesh: Must call synchronize EDGES_E first");
1920 for (
size_t i=0; i<
edges_[idx].cells_.size();i++)
1921 array[i] = static_cast<typename ARRAY::value_type>((
edges_[idx].
cells_[i])>>4);
1924 template<
class ARRAY,
class INDEX>
1928 "HexVolMesh: Must call synchronize FACES_E first");
1934 array[0] =
static_cast<typename ARRAY::value_type
>((
faces_[idx].cells_[0])>>3);
1939 array[0] =
static_cast<typename ARRAY::value_type
>((
faces_[idx].cells_[0])>>3);
1940 array[1] =
static_cast<typename ARRAY::value_type
>((
faces_[idx].cells_[1])>>3);
1944 template<
class ARRAY,
class INDEX>
1947 ASSERTFAIL(
"Get cell from nodes has not yet been implemented");
1950 template<
class ARRAY,
class INDEX>
1954 "Must call synchronize FACES_E on HexVolMesh first");
1963 typename face_nt::const_iterator fiter =
face_table_.find(f);
1967 idx = INDEX((*fiter).second);
1971 template<
class ARRAY,
class INDEX>
1975 "Must call synchronize EDGES_E on HexVolMesh first");
1981 typename edge_nt::const_iterator fiter =
edge_table_.find(f);
1985 idx = INDEX((*fiter).second);
1989 template <
class ARRAY,
class INDEX>
1993 cells_[idx * 8 +
n] = static_cast<index_type>(array[
n]);
1997 template <
class INDEX1,
class INDEX2>
2001 "Must call synchronize FACES_E on HexVolMesh first");
2005 if (static_cast<typename Cell::index_type>(elem) == (cells[0]>>3))
2007 neighbor =
static_cast<INDEX1
>((cells[1]>>3));
2011 neighbor =
static_cast<INDEX1
>((cells[0]>>3));
2017 template <
class ARRAY,
class INDEX1,
class INDEX2>
2021 "Must call synchronize FACES_E on HexVolMesh first");
2025 if (elem == static_cast<INDEX1>(cells[0]>>3))
2028 array[0] =
static_cast<typename ARRAY::value_type
>(cells[1]>>3);
2033 array[0] =
static_cast<typename ARRAY::value_type
>(cells[0]>>3);
2043 template <
class ARRAY,
class INDEX>
2050 array.reserve(faces.size());
2051 typename Face::array_type::iterator iter = faces.begin();
2052 while(iter != faces.end())
2054 typename ARRAY::value_type nbor;
2057 array.push_back(nbor);
2064 template <
class ARRAY,
class INDEX>
2068 "Must call synchronize NODE_NEIGHBORS_E on HexVolMesh first.");
2071 std::set<index_type> inserted;
2072 for (
size_t i = 0; i < sz; i++)
2082 array.reserve(inserted.size());
2083 array.insert(array.begin(), inserted.begin(), inserted.end());
2086 template <
class INDEX>
2092 if (sz == 0)
return (
false);
2095 if (node >= 0 && node < sz)
2101 "HexVolMesh::locate_node requires synchronize(NODE_LOCATE_E).")
2113 if (bi > ni) bi =ni;
if (bi < 0) bi = 0;
2114 if (bj > nj) bj =nj;
if (bj < 0) bj = 0;
2115 if (bk > nk) bk =nk;
if (bk < 0) bk = 0;
2121 double dmin = DBL_MAX;
2131 if (i < 0 || i > ni)
continue;
2134 if (j < 0 || j > nj)
continue;
2137 if (k < 0 || k > nk)
continue;
2138 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
2140 if (
node_grid_->min_distance_squared(p, i, j, k) < dmin)
2149 const double dist = (p-
point).length2();
2169 while ((!found)||(dmin == DBL_MAX)) ;
2175 template <
class INDEX>
2179 "Must call synchronize EDGES_E on HexVolMesh first");
2187 double mindist = 0.0;
2193 if (!found || dist < mindist)
2195 edge =
static_cast<INDEX
>(*bi);
2205 template <
class INDEX>
2209 "Must call synchronize FACES_E on HexVolMesh first");
2212 double mindist = DBL_MAX;
2219 const double dist = (p - c).length2();
2220 if (!found || dist < mindist)
2223 face =
static_cast<INDEX
>(*bi);
2231 template <
class INDEX>
2241 if (sz == 0)
return (
false);
2244 if ((elem > 0)&&(elem < sz))
2246 if (
inside(elem,p))
return (
true);
2250 "HexVolMesh: need to synchronize ELEM_LOCATE_E first");
2259 elem =
static_cast<INDEX
>(*it);
2268 template <
class ARRAY>
2273 "HexVolMesh::locate_elems requires synchronize(ELEM_LOCATE_E).")
2289 for (;p<array.size();p++)
if (array[p] ==
typename ARRAY::value_type(*it))
break;
2290 if (p == array.size()) array.push_back(
typename ARRAY::value_type(*it));
2295 return (array.size() > 0);
2299 template <
class INDEX,
class ARRAY>
2309 if (sz == 0)
return (
false);
2312 if ((elem > 0)&&(elem < sz))
2317 basis_.get_coords(coords, p, ed);
2323 "HexVolMesh: need to synchronize ELEM_LOCATE_E first");
2332 elem =
static_cast<INDEX
>(*it);
2334 basis_.get_coords(coords, p, ed);
2343 template <
class INDEX>
2349 template <
class INDEX>
2361 template <
class INDEX>
2368 ASSERT(nodes.size() == 4);
2369 typename Node::array_type::iterator nai = nodes.begin();
2373 while (nai != nodes.end())
2382 template <
class INDEX>
2389 ASSERT(nodes.size() == 8);
2390 typename Node::array_type::iterator nai = nodes.begin();
2394 while (nai != nodes.end())
2422 template<
class INDEX>
2452 if(
basis_.get_coords(coords, p, ed))
return (
true);
2529 if (a1>a2) { t = a1; a1 = a2; a2 = t; a3 = a2;}
2533 if (a1>a3) { t = a1; a1 = a3; a3 = t;}
2543 if (b1>b2) { t = b1; b1 = b2; b2 = t; b3 = b2;}
2547 if (b1>b3) { t = b1; b1 = b3; b3 = t;}
2550 if (a0<b0)
return (
true);
2553 if (a1<b1)
return (
true);
2556 if (a2<b2)
return (
true);
2559 if(a3<b3)
return (
true);
2657 template <
class PFACE>
2660 if (f.nodes_[2] == f.nodes_[3])
2662 if (f.nodes_[1] < f.nodes_[2])
2679 if (f.nodes_[1] < f.nodes_[3] )
2697 template <
class PFACE>
2720 template<
class PEDGE>
2728 template<
class PEDGE>
2738 #ifdef HAVE_HASH_MAP
2741 typedef stdext::hash_map<PFace, typename Face::index_type, FaceHash>
face_ht;
2742 typedef stdext::hash_map<PFaceNode, typename Face::index_type, FaceHash>
face_nt;
2743 typedef stdext::hash_map<PEdge, typename Edge::index_type, EdgeHash>
edge_ht;
2744 typedef stdext::hash_map<PEdgeNode, typename Edge::index_type, EdgeHash>
edge_nt;
2747 typedef hash_map<PFace, typename Face::index_type, FaceHash>
face_ht;
2748 typedef hash_map<PFaceNode, typename Face::index_type, FaceHash>
face_nt;
2749 typedef hash_map<PEdge, typename Edge::index_type, EdgeHash>
edge_ht;
2750 typedef hash_map<PEdgeNode, typename Edge::index_type, EdgeHash>
edge_nt;
2753 typedef std::map<PFace, typename Face::index_type, FaceHash>
face_ht;
2754 typedef std::map<PFaceNode, typename Face::index_type, FaceHash>
face_nt;
2755 typedef std::map<PEdge, typename Edge::index_type, EdgeHash>
edge_ht;
2756 typedef std::map<PEdgeNode, typename Edge::index_type, EdgeHash>
edge_nt;
2781 template <
class INDEX>
2786 if ((n1 == n3)||(n2==n4))
return (
false);
2791 if ((n1 < n2)&&(n1 < n3)&&(n1 < n4))
2794 else if ((n2 < n3)&&(n2 < n4))
2798 t = n1; n1 = n2; n2 = n3; n3 = n4; n4 = t;
2804 t = n1; n1 = n3; n3 = t; t = n2; n2 = n4; n4 = t;
2810 t = n4; n4 = n3; n3 = n2; n2 = n1; n1 = t;
2815 if (n3==n4)
return (
false);
2820 if (n1==n4)
return (
false);
2845 std::vector<std::vector<typename Node::index_type> > &
nbor_vec_;
2880 template <
class Basis>
2890 template <
class Basis>
2898 synchronize_lock_(
"HexVolMesh Lock"),
2899 synchronize_cond_(
"HexVolMesh condition variable"),
2900 synchronized_(
Mesh::NODES_E |
Mesh::CELLS_E),
2911 template <
class Basis>
2920 synchronize_lock_(
"HexVolMesh Lock"),
2921 synchronize_cond_(
"HexVolMesh condition variable"),
2922 synchronized_(
Mesh::NODES_E |
Mesh::CELLS_E),
2935 lcopy.synchronize_lock_.lock();
2947 lcopy.synchronize_lock_.unlock();
2955 template <
class Basis>
2961 template <
class Basis>
2962 template <
class Iter,
class Functor>
2966 synchronize_lock_.lock();
2968 points_.resize(end - begin);
2969 std::vector<Core::Geometry::Point>::iterator piter = points_.begin();
2972 *piter = fill_ftor(*iter);
2975 synchronize_lock_.unlock();
2978 template <
class Basis>
2979 template <
class Iter,
class Functor>
2983 synchronize_lock_.lock();
2985 cells_.resize((end - begin) * 8);
2986 std::vector<under_type>::iterator citer = cells_.begin();
3007 synchronize_lock_.unlock();
3010 template <
class Basis>
3015 template <
class Basis>
3019 ASSERT((n >= -1) && n <= 1);
3027 static const std::string nm(
"HexVolMesh");
3039 template <
class Basis>
3060 const double w = rng() * (a0 + a1 + a2 + a3 + a4);
3076 const double tmp =
v;
3080 else if (t + u + v > 1.0)
3082 const double tmp =
v;
3083 v = t + u + v - 1.0;
3088 const double a = 1.0 - t - u -
v;
3090 if (w > (a0 + a1 + a2 + a3))
3094 else if (w > (a0 + a1 + a2))
3098 else if (w > (a0 + a1))
3112 template <
class Basis>
3124 result.
extend(points_[*ni]);
3131 template <
class Basis>
3141 template <
class Basis>
3153 bbox_.extend(points_[*ni]);
3158 epsilon_ = bbox_.diagonal().length()*1e-8;
3159 epsilon2_ = epsilon_*epsilon_;
3160 epsilon3_ = epsilon_*epsilon_*epsilon_;
3162 synchronize_lock_.lock();
3164 synchronize_lock_.unlock();
3167 template <
class Basis>
3171 synchronize_lock_.lock();
3173 std::vector<Core::Geometry::Point>::iterator itr = points_.begin();
3174 std::vector<Core::Geometry::Point>::iterator eitr = points_.end();
3191 bbox_.extend(point(*ni));
3196 epsilon_ = bbox_.diagonal().length()*1e-8;
3197 epsilon2_ = epsilon_*epsilon_;
3198 epsilon3_ = epsilon_*epsilon_*epsilon_;
3203 if (node_grid_) { node_grid_->transform(t); }
3204 if (elem_grid_) { elem_grid_->transform(t); }
3205 synchronize_lock_.unlock();
3208 template <
class Basis>
3222 if (!(order_face_nodes(n1,n2,n3,n4)))
return;
3223 PFace f(n1, n2, n3, n4);
3226 typename face_ht::iterator iter = table.find(f);
3228 if (iter == table.end())
3230 f.
cells_[0] = combined_index;
3235 PFace f = (*iter).first;
3238 std::cerr <<
"HexVolMesh - This Mesh has problems: Cells #"
3239 << (f.
cells_[0]>>3) <<
", #" << (f.
cells_[1]>>3) <<
", and #" << (combined_index>>3)
3240 <<
" are illegally adjacent." << std::endl;
3242 else if ((f.
cells_[0]>>3) == (combined_index>>3))
3244 std::cerr <<
"HexVolMesh - This Mesh has problems: Cells #"
3245 << (f.
cells_[0]>>3) <<
", #" << (f.
cells_[1]>>3) <<
", and #" << (combined_index>>3)
3246 <<
" are the same." << std::endl;
3250 f.
cells_[1] = combined_index;
3257 template <
class Basis>
3261 face_table_.clear();
3264 begin(ci); end(cie);
3271 get_nodes(arr, *ci);
3274 hash_face(arr[0], arr[1], arr[2], arr[3], cell_index, table);
3275 hash_face(arr[7], arr[6], arr[5], arr[4], cell_index + 1, table);
3276 hash_face(arr[0], arr[4], arr[5], arr[1], cell_index + 2, table);
3277 hash_face(arr[2], arr[6], arr[7], arr[3], cell_index + 3, table);
3278 hash_face(arr[3], arr[7], arr[4], arr[0], cell_index + 4, table);
3279 hash_face(arr[1], arr[5], arr[6], arr[2], cell_index + 5, table);
3284 faces_.resize(table.size());
3285 boundary_faces_.resize(cells_.size()>>3);
3287 typename face_ht::iterator ht_iter = table.begin();
3288 typename face_ht::iterator ht_iter_end = table.end();
3291 while (ht_iter != ht_iter_end)
3293 const PFace& pface = (*ht_iter).first;
3295 faces_[uidx].cells_[1] = pface.
cells_[1];
3298 if (pface.
cells_[1] == -1)
3302 boundary_faces_[cell] |= 1 << face;
3308 synchronize_lock_.lock();
3310 synchronize_lock_.unlock();
3313 template <
class Basis>
3320 if (n1 == n2)
return;
3322 typename edge_ht::iterator iter = table.find(e);
3323 if (iter == table.end())
3325 e.
cells_.push_back(combined_index);
3330 PEdge e = (*iter).first;
3331 e.
cells_.push_back(combined_index);
3337 template <
class Basis>
3342 begin(ci); end(cie);
3347 get_nodes(arr, *ci);
3349 hash_edge(arr[0], arr[1], cell_index , table);
3350 hash_edge(arr[1], arr[2], cell_index+1, table);
3351 hash_edge(arr[2], arr[3], cell_index+2, table);
3352 hash_edge(arr[3], arr[0], cell_index+3, table);
3354 hash_edge(arr[4], arr[5], cell_index+4, table);
3355 hash_edge(arr[5], arr[6], cell_index+5, table);
3356 hash_edge(arr[6], arr[7], cell_index+6, table);
3357 hash_edge(arr[7], arr[4], cell_index+7, table);
3359 hash_edge(arr[0], arr[4], cell_index+8, table);
3360 hash_edge(arr[5], arr[1], cell_index+9, table);
3361 hash_edge(arr[2], arr[6], cell_index+10,table);
3362 hash_edge(arr[7], arr[3], cell_index+11,table);
3368 edges_.resize(table.size());
3370 typename edge_ht::iterator ht_iter = table.begin();
3371 typename edge_ht::iterator ht_iter_end = table.end();
3374 while (ht_iter != ht_iter_end)
3376 const PEdge& pedge = (*ht_iter).first;
3382 synchronize_lock_.lock();
3384 synchronize_lock_.unlock();
3387 template <
class Basis>
3411 sync &= (~synchronized_);
3416 synchronize_lock_.unlock();
3418 synchronize_lock_.lock();
3424 boost::thread syncthread(syncclass);
3430 synchronize_lock_.unlock();
3432 synchronize_lock_.lock();
3438 boost::thread syncthread(syncclass);
3444 synchronize_lock_.unlock();
3446 synchronize_lock_.lock();
3452 boost::thread syncthread(syncclass);
3458 synchronize_lock_.unlock();
3460 synchronize_lock_.lock();
3466 boost::thread syncthread(syncclass);
3472 synchronize_lock_.unlock();
3474 synchronize_lock_.lock();
3480 boost::thread syncthread(syncclass);
3486 synchronize_lock_.unlock();
3488 synchronize_lock_.lock();
3494 boost::thread syncthread(syncclass);
3498 while ((synchronized_ & sync) != sync)
3500 synchronize_cond_.wait(lock);
3506 template<
class Basis>
3513 template <
class Basis>
3517 synchronize_lock_.lock();
3523 node_neighbors_.clear();
3525 edge_table_.clear();
3527 face_table_.clear();
3528 boundary_faces_.clear();
3533 synchronize_lock_.unlock();
3538 template <
class Basis>
3543 "Must call synchronize NODES_E on HexVolMesh first");
3547 template <
class Basis>
3552 "Must call synchronize NODES_E on HexVolMesh first");
3556 template <
class Basis>
3561 "Must call synchronize NODES_E on HexVolMesh first");
3565 template <
class Basis>
3570 "Must call synchronize EDGES_E on HexVolMesh first");
3574 template <
class Basis>
3579 "Must call synchronize EDGES_E on HexVolMesh first");
3583 template <
class Basis>
3588 "Must call synchronize EDGES_E on HexVolMesh first");
3592 template <
class Basis>
3597 "Must call synchronize FACES_E on HexVolMesh first");
3601 template <
class Basis>
3606 "Must call synchronize FACES_E on HexVolMesh first");
3610 template <
class Basis>
3615 "Must call synchronize FACES_E on HexVolMesh first");
3619 template <
class Basis>
3624 "Must call synchronize CELLS_E on HexVolMesh first");
3628 template <
class Basis>
3633 "Must call synchronize CELLS_E on HexVolMesh first");
3637 template <
class Basis>
3642 "Must call synchronize CELLS_E on HexVolMesh first");
3646 template <
class Basis>
3655 "Must call synchronize FACES_E on HexVolMesh first");
3656 if(!(order_face_nodes(n1,n2,n3,n4)))
return (
false);
3658 typename face_nt::const_iterator fiter = face_table_.find(f);
3659 if (fiter == face_table_.end()) {
3662 face = (*fiter).second;
3666 template <
class Basis>
3670 node_neighbors_.clear();
3671 node_neighbors_.resize(points_.size());
3673 for (i = 0; i < num_cells; i++)
3675 node_neighbors_[cells_[i]].push_back(i);
3678 synchronize_lock_.lock();
3680 synchronize_lock_.unlock();
3683 template <
class Basis>
3689 if (locate_elem(idx, p))
3692 std::vector<double> coords(3);
3693 if (get_coords(coords, p, idx))
3695 basis_.get_weights(coords, w);
3696 return basis_.dofs();
3702 template <
class Basis>
3708 if (locate_elem(idx, p))
3718 template <
class Basis>
3727 box.
extend(points_[cells_[idx]]);
3728 box.
extend(points_[cells_[idx+1]]);
3729 box.
extend(points_[cells_[idx+2]]);
3730 box.
extend(points_[cells_[idx+3]]);
3731 box.
extend(points_[cells_[idx+4]]);
3732 box.
extend(points_[cells_[idx+5]]);
3733 box.
extend(points_[cells_[idx+6]]);
3734 box.
extend(points_[cells_[idx+7]]);
3737 elem_grid_->insert(ci, box);
3740 template <
class Basis>
3746 box.
extend(points_[cells_[idx]]);
3747 box.
extend(points_[cells_[idx+1]]);
3748 box.
extend(points_[cells_[idx+2]]);
3749 box.
extend(points_[cells_[idx+3]]);
3750 box.
extend(points_[cells_[idx+4]]);
3751 box.
extend(points_[cells_[idx+5]]);
3752 box.
extend(points_[cells_[idx+6]]);
3753 box.
extend(points_[cells_[idx+7]]);
3755 elem_grid_->remove(ci, box);
3758 template <
class Basis>
3764 node_grid_->insert(ni,points_[ni]);
3767 template <
class Basis>
3771 node_grid_->remove(ni,points_[ni]);
3774 template <
class Basis>
3785 3*
static_cast<size_type>((ceil(pow(static_cast<double>(esz) , (1.0/3.0))))/2.0 + 1.0);
3788 double trace = (diag.
x()+diag.
y()+diag.
z());
3797 begin(ci); end(cie);
3800 insert_elem_into_grid(*ci);
3805 synchronize_lock_.lock();
3807 synchronize_lock_.unlock();
3810 template <
class Basis>
3814 ASSERTMSG(bbox_.valid(),
"HexVolMesh BBox not valid");
3822 ((ceil(pow(static_cast<double>(esz) , (1.0/3.0))))/2.0 + 1.0);
3825 double trace = (diag.
x()+diag.
y()+diag.
z());
3834 begin(ni); end(nie);
3837 insert_node_into_grid(*ni);
3842 synchronize_lock_.lock();
3844 synchronize_lock_.unlock();
3847 template <
class Basis>
3852 if (locate_node(i, p) && ((points_[i] - p).length2() < err))
3858 points_.push_back(p);
3863 template <
class Basis>
3875 cells_.push_back(a);
3876 cells_.push_back(b);
3877 cells_.push_back(c);
3878 cells_.push_back(d);
3879 cells_.push_back(e);
3880 cells_.push_back(f);
3881 cells_.push_back(g);
3882 cells_.push_back(h);
3886 template <
class Basis>
3890 points_.push_back(p);
3894 template <
class Basis>
3901 return add_hex(add_find_point(p0), add_find_point(p1),
3902 add_find_point(p2), add_find_point(p3),
3903 add_find_point(p4), add_find_point(p5),
3904 add_find_point(p6), add_find_point(p7));
3907 #define HEXVOLMESH_VERSION 5
3909 template <
class Basis>
3921 std::vector<under_type> face_neighbors;
3934 synchronized_ = NODES_E | CELLS_E;
3940 template <
class Basis>
3950 std::string(__FILE__),
3957 template <
class Basis>
3958 const TypeDescription*
3964 template <
class Basis>
3974 std::string(__FILE__),
3981 template <
class Basis>
3991 std::string(__FILE__),
3998 template <
class Basis>
4008 std::string(__FILE__),
4015 template <
class Basis>
4025 std::string(__FILE__),
FillNodeNeighbors(std::vector< std::vector< typename Node::index_type > > &n, const HexVolMesh &m)
Definition: HexVolMesh.h:2832
void begin(typename Node::iterator &) const
begin/end iterators
Definition: HexVolMesh.h:3540
void get_delems(typename DElem::array_type &array, typename Node::index_type idx) const
Definition: HexVolMesh.h:577
Interface to statically allocated std::vector class.
Definition: VUnstructuredMesh.h:41
bool shared() const
Definition: HexVolMesh.h:2472
void get_neighbors(std::vector< typename Node::index_type > &array, typename Node::index_type node) const
These are more general neighbor functions.
Definition: HexVolMesh.h:677
boost::shared_ptr< HexVolMesh< Basis > > handle_type
Definition: HexVolMesh.h:172
index_type edge0_index() const
the following designed to coordinate with ::get_edges
Definition: HexVolMesh.h:268
Edge information.
Definition: HexVolMesh.h:2577
void get_faces_from_edge(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1817
bool reading() const
Definition: Persistent.h:164
virtual int topology_geometry() const
Definition: HexVolMesh.h:446
EdgeIndex< under_type > size_type
Definition: HexVolMesh.h:186
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: HexVolMesh.h:3911
void get_center(Core::Geometry::Point &result, typename Node::index_type idx) const
get the center point (in object space) of an element
Definition: HexVolMesh.h:614
Distinct type for node FieldIterator.
Definition: FieldIterator.h:89
void run()
Definition: HexVolMesh.h:367
PEdgeNode(typename Node::index_type n1, typename Node::index_type n2)
Definition: HexVolMesh.h:2587
bool locate(typename Cell::index_type &idx, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:695
bool locate_edge(INDEX &edge, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2176
Synchronize(HexVolMesh< Basis > &mesh, mask_type sync)
Definition: HexVolMesh.h:363
index_type edge10_index() const
Definition: HexVolMesh.h:308
Definition: FieldRNG.h:37
index_type edge5_index() const
Definition: HexVolMesh.h:288
std::string get_name(const std::string &type_sep_start="<", const std::string &type_sep_end="> ") const
Definition: TypeDescription.cc:135
void derivate(const VECTOR1 &coords, INDEX idx, VECTOR2 &J) const
Definition: HexVolMesh.h:802
Distinct type for face Iterator.
Definition: FieldIterator.h:121
static const int up4_mask
Definition: HexVolMesh.h:2652
void get_delems(typename DElem::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:580
void get_center(Core::Geometry::Point &result, typename Edge::index_type idx) const
Definition: HexVolMesh.h:616
Node::index_type nodes_[4]
Definition: HexVolMesh.h:2479
double get_size(typename Cell::index_type idx) const
Definition: HexVolMesh.h:651
void fill_neighbors(Iter begin, Iter end, Functor fill_ftor)
void get_cells_from_face(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1925
static const size_t bucket_size
These are needed by the hash_map particularly.
Definition: HexVolMesh.h:2646
std::vector< unsigned char > boundary_faces_
Definition: HexVolMesh.h:2851
int get_weights(const Core::Geometry::Point &p, typename Node::array_type &l, double *w) const
Definition: HexVolMesh.h:3685
Definition: ConditionVariable.h:45
double get_size(typename Node::index_type) const
Get the size of an element (length, area, volume)
Definition: HexVolMesh.h:624
index_type edge4_index() const
Definition: HexVolMesh.h:284
void get_cell_center(Core::Geometry::Point &p, INDEX idx) const
Definition: HexVolMesh.h:2383
bool locate_elem(INDEX &elem, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2232
Point max() const
Definition: BBox.h:195
#define ASSERTMSG(condition, message)
Definition: Exception.h:113
SCIRun::mask_type mask_type
Definition: HexVolMesh.h:170
static const int low_mask
Definition: HexVolMesh.h:2717
void end(typename Node::iterator &) const
Definition: HexVolMesh.h:3549
boost::shared_ptr< SearchGridT< index_type > > elem_grid_
Definition: HexVolMesh.h:2859
edge_nt edge_table_
Definition: HexVolMesh.h:2770
PEdge(typename Node::index_type n1, typename Node::index_type n2)
Definition: HexVolMesh.h:2633
int get_weights(const Core::Geometry::Point &, typename Face::array_type &, double *) const
Definition: HexVolMesh.h:708
NodeIterator< under_type > iterator
Definition: HexVolMesh.h:178
void get_faces_from_node(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1859
int get_weights(const Core::Geometry::Point &, typename Edge::array_type &, double *) const
Definition: HexVolMesh.h:706
void get_nodes(typename Node::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:517
Definition: Persistent.h:89
index_type node1_index() const
Definition: HexVolMesh.h:238
void resize_nodes(size_type s)
Definition: HexVolMesh.h:776
void compute_edges()
Definition: HexVolMesh.h:3339
void to_index(typename Edge::index_type &index, index_type i) const
Definition: HexVolMesh.h:503
static const int up_mask
Definition: HexVolMesh.h:2716
PFaceCell()
Definition: HexVolMesh.h:2466
index_type node4_index() const
Definition: HexVolMesh.h:250
const Core::Geometry::Point & point(typename Node::index_type i) const
Definition: HexVolMesh.h:2420
std::map< PFaceNode, typename Face::index_type, FaceHash > face_nt
Definition: HexVolMesh.h:2754
void get_face_center(Core::Geometry::Point &p, INDEX idx) const
Definition: HexVolMesh.h:2362
int compute_checksum(T *data, std::size_t length)
Definition: CheckSum.h:38
boost::shared_ptr< SearchGridT< index_type > > node_grid_
Definition: HexVolMesh.h:2858
void compute_elem_grid()
Definition: HexVolMesh.h:3776
std::vector< PEdgeCell > edge_ct
Definition: HexVolMesh.h:2760
double get_epsilon() const
Definition: HexVolMesh.h:468
index_type edge6_index() const
Definition: HexVolMesh.h:292
bool get_neighbors(std::vector< typename Elem::index_type > &array, typename Elem::index_type elem, typename DElem::index_type delem) const
Definition: HexVolMesh.h:680
double InverseMatrix3P(const PointVector &p, double *q)
Inline templated inverse matrix.
Definition: Locate.h:72
index_type edge8_index() const
Definition: HexVolMesh.h:300
bool get_neighbor(typename Elem::index_type &neighbor, typename Elem::index_type elem, typename DElem::index_type delem) const
Get neighbors of an element or a node.
Definition: HexVolMesh.h:671
Definition: Persistent.h:187
bool find_closest_nodes(ARRAY &nodes, const Core::Geometry::Point &p, double maxdist) const
Definition: HexVolMesh.h:1008
bool operator==(const PFaceNode &f) const
true if both have the same nodes (order does not matter)
Definition: HexVolMesh.h:2501
virtual std::string dynamic_type_name() const
Definition: HexVolMesh.h:1468
const Core::Geometry::Point & node5() const
Definition: HexVolMesh.h:337
void get_cells(typename Cell::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:560
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
virtual bool has_normals() const
Has this mesh normals.
Definition: HexVolMesh.h:463
void get_random_point(Core::Geometry::Point &p, typename Elem::index_type i, FieldRNG &r) const
Definition: HexVolMesh.h:3041
bool operator==(const PEdgeNode &e) const
true if both have the same nodes (order does not matter)
Definition: HexVolMesh.h:2603
std::vector< index_type > array_type
Definition: HexVolMesh.h:194
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p, double maxdist) const
Find the closest element to a point.
Definition: HexVolMesh.h:1151
void get_faces(typename Face::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:540
bool order_face_nodes(INDEX &n1, INDEX &n2, INDEX &n3, INDEX &n4) const
Definition: HexVolMesh.h:2782
bool get_elem_neighbors(ARRAY &array, INDEX1 elem, INDEX2 delem) const
Definition: HexVolMesh.h:2018
Definition: TypeDescription.h:50
Definition: HexVolMesh.h:183
Face DElem
Definition: HexVolMesh.h:208
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
Definition: HexVolMesh.h:2568
Cell Elem
Definition: HexVolMesh.h:207
EdgeIndex< under_type > index_type
Definition: HexVolMesh.h:184
double epsilon3_
Definition: HexVolMesh.h:2874
NodeIndex< under_type > size_type
Definition: HexVolMesh.h:179
double tetrahedra_volume(const Point &p0, const Point &p1, const Point &p2, const Point &p3)
Definition: CompGeom.cc:389
double get_length(typename Edge::index_type idx) const
More specific names for get_size.
Definition: HexVolMesh.h:658
Core::Thread::ConditionVariable synchronize_cond_
Definition: HexVolMesh.h:2863
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, INDEX idx) const
Definition: HexVolMesh.h:783
cells_type cells_
Definition: HexVolMesh.h:2624
double det_jacobian(const VECTOR &coords, INDEX idx) const
Definition: HexVolMesh.h:811
void get_elems(typename Elem::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:570
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
virtual int basis_order()
Definition: HexVolMesh.h:438
bool operator<(const PFaceNode &f) const
Definition: HexVolMesh.h:2519
#define MESH_NO_NEIGHBOR
Definition: MeshTraits.h:67
Distinct type for cell Iterator.
Definition: FieldIterator.h:134
virtual void transform(const Core::Geometry::Transform &t)
Transform a field (transform all nodes using this transformation matrix)
Definition: HexVolMesh.h:3169
Node::array_type nodes_
Definition: HexVolMesh.h:2847
void get_delems(typename DElem::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:586
unsigned int mask_type
Definition: Types.h:45
bool locate_face(INDEX &face, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2206
bool inside(INDEX idx, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2423
virtual bool is_editable() const
Check whether mesh can be altered by adding nodes or elements.
Definition: HexVolMesh.h:460
#define ASSERT(condition)
Definition: Assert.h:110
void get_cells(typename Cell::array_type &array, typename Node::index_type idx) const
Definition: HexVolMesh.h:551
Core::Geometry::BBox bbox_
Definition: HexVolMesh.h:2871
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
virtual bool synchronize(mask_type mask)
Definition: HexVolMesh.h:3389
void compute_bounding_box()
Definition: HexVolMesh.h:3143
virtual HexVolMesh * clone() const
Definition: HexVolMesh.h:423
void get_nodes_from_edge(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1541
std::map< PEdge, typename Edge::index_type, EdgeHash > edge_ht
Definition: HexVolMesh.h:2755
const Core::Geometry::Point & node4() const
Definition: HexVolMesh.h:333
Node::index_type add_node(const Core::Geometry::Point &p)
Definition: HexVolMesh.h:753
void get_point(Core::Geometry::Point &result, typename Node::index_type index) const
Access the nodes of the mesh.
Definition: HexVolMesh.h:713
void get_nodes(typename Node::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:514
index_type edge7_index() const
Definition: HexVolMesh.h:296
index_type edge2_index() const
Definition: HexVolMesh.h:276
void set_point(const Core::Geometry::Point &point, typename Node::index_type index)
Definition: HexVolMesh.h:715
boost::unique_lock< boost::mutex > UniqueLock
Definition: ConditionVariable.h:43
double DetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:120
const string find_type_name(float *)
Definition: TypeName.cc:63
virtual Core::Geometry::BBox get_bounding_box() const
Get the bounding box of the field.
Definition: HexVolMesh.h:3114
void get_node_center(Core::Geometry::Point &p, INDEX idx) const
Definition: HexVolMesh.h:2344
void hash_face(typename Node::index_type n1, typename Node::index_type n2, typename Node::index_type n3, typename Node::index_type n4, index_type combined_index, face_ht &table) const
Definition: HexVolMesh.h:3210
static const TypeDescription * face_type_description()
Definition: HexVolMesh.h:4000
static const int sz_int
These are for our own use (making the hash function.
Definition: HexVolMesh.h:2714
std::map< PFace, typename Face::index_type, FaceHash > face_ht
Definition: HexVolMesh.h:2753
double inverse_jacobian(const VECTOR &coords, INDEX idx, double *Ji) const
Definition: HexVolMesh.h:843
std::vector< index_type > array_type
Definition: HexVolMesh.h:201
bool find_closest_nodes(ARRAY1 &distances, ARRAY2 &nodes, const Core::Geometry::Point &p, double maxdist) const
Definition: HexVolMesh.h:1072
virtual void get_canonical_transform(Core::Geometry::Transform &t) const
Definition: HexVolMesh.h:3133
double get_volume(typename Cell::index_type idx) const
Definition: HexVolMesh.h:662
PFace(typename Node::index_type n1, typename Node::index_type n2, typename Node::index_type n3, typename Node::index_type n4)
Definition: HexVolMesh.h:2571
void get_center(Core::Geometry::Point &result, typename Face::index_type idx) const
Definition: HexVolMesh.h:618
std::map< PEdgeNode, typename Edge::index_type, EdgeHash > edge_nt
Definition: HexVolMesh.h:2756
Definition: HexVolMesh.h:2619
static const int sz_half_int
Definition: HexVolMesh.h:2715
virtual VMesh * vmesh()
Access point to virtual interface.
Definition: HexVolMesh.h:429
static const TypeDescription * edge_type_description()
Definition: HexVolMesh.h:3983
bool locate(typename Edge::index_type &idx, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:691
StackVector< index_type, 8 > array_type
Definition: HexVolMesh.h:180
Definition: HexVolMesh.h:190
bool get_face(typename Face::index_type &array, typename Node::index_type n1, typename Node::index_type n2, typename Node::index_type n3, typename Node::index_type n4) const
Trying figure out which face is made out of 4 nodes (?)
Definition: HexVolMesh.h:3648
void fill_cells(Iter begin, Iter end, Functor fill_ftor)
Definition: HexVolMesh.h:2981
double scaled_jacobian_metric(INDEX idx) const
Definition: HexVolMesh.h:852
Definition: HexVolMesh.h:360
static const size_t min_buckets
Definition: HexVolMesh.h:2711
Definition: VMeshShared.h:40
void remove_node_from_grid(typename Node::index_type ci)
Definition: HexVolMesh.h:3769
void get_node_neighbors(ARRAY &array, INDEX node) const
We should optimize this function more.
Definition: HexVolMesh.h:2065
Definition: ParallelLinearAlgebraTests.cc:358
static const int top4_mask
Definition: HexVolMesh.h:2651
void get_cells_from_node(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1767
size_t operator()(const PEDGE &e) const
This is the hash function.
Definition: HexVolMesh.h:2721
Definition: SearchGridT.h:47
const char * name[]
Definition: BoostGraphExampleTests.cc:87
Basis basis_type
Definition: HexVolMesh.h:173
virtual bool has_face_normals() const
Has this mesh face normals.
Definition: HexVolMesh.h:466
void fill_points(Iter begin, Iter end, Functor fill_ftor)
Definition: HexVolMesh.h:2964
void get_faces(typename Face::array_type &array, typename Node::index_type idx) const
Definition: HexVolMesh.h:537
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
CellIndex< under_type > size_type
Definition: HexVolMesh.h:200
void Pio_index(Piostream &stream, index_type *data, size_type size)
Definition: Persistent.cc:606
long long size_type
Definition: Types.h:40
static const int sz_int
Definition: HexVolMesh.h:2639
std::vector< index_type > cells_type
list of all the cells this edge is in.
Definition: HexVolMesh.h:2623
double jacobian_metric(INDEX idx) const
Definition: HexVolMesh.h:874
void insert_elem_into_grid(typename Elem::index_type ci)
Definition: HexVolMesh.h:3720
Vector Cross(const Vector &v1, const Vector &v2)
Definition: Vector.h:378
index_type edge9_index() const
Definition: HexVolMesh.h:304
double ScaledDetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:132
void get_cells(typename Cell::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:557
void get_normal(Core::Geometry::Vector &, typename Node::index_type) const
Normals for visualizations.
Definition: HexVolMesh.h:720
static const int mid4_mask
Definition: HexVolMesh.h:2653
Vector diagonal() const
Definition: BBox.h:198
void get_edge_center(Core::Geometry::Point &p, INDEX idx) const
Definition: HexVolMesh.h:2350
SCIRun::index_type under_type
Definition: HexVolMesh.h:167
MeshFacadeHandle getFacade() const
Definition: HexVolMesh.h:431
void get_nodes(typename Node::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:520
void get_edges(typename Edge::array_type &array, typename Node::index_type idx) const
Definition: HexVolMesh.h:524
Definition: HexVolMesh.h:2478
void resize_elems(size_type s)
Definition: HexVolMesh.h:777
Persistent i/o for STL containers.
Edge information.
Definition: HexVolMesh.h:2630
void get_edges_from_cell(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1656
std::vector< INDEX >::iterator iterator
Definition: SearchGridT.h:53
std::string type
Definition: Persistent.h:72
void compute_faces()
Definition: HexVolMesh.h:3259
Definition: HexVolMesh.h:216
void pwl_approx_face(std::vector< std::vector< VECTOR > > &coords, INDEX ci, unsigned int which_face, unsigned int div_per_unit) const
Definition: HexVolMesh.h:605
void to_index(typename Node::index_type &index, index_type i) const
Definition: HexVolMesh.h:501
SCIRun::size_type size_type
Definition: HexVolMesh.h:169
void get_edges(typename Edge::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:533
bool locate(typename Node::index_type &idx, const Core::Geometry::Point &p) const
Locate a point in a mesh, find which is the closest node.
Definition: HexVolMesh.h:689
VMesh * CreateVHexVolMesh(MESH *)
Definition: HexVolMesh.h:83
void get_faces(typename Face::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:547
index_type node2_index() const
Definition: HexVolMesh.h:242
Point min() const
Definition: BBox.h:192
Distinct type for face index.
Definition: FieldIndex.h:90
Definition: HexVolMesh.h:2705
void get_nodes_from_elem(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1601
const Core::Geometry::Point & node0() const
Definition: HexVolMesh.h:317
virtual ~HexVolMesh()
Destructor.
Definition: HexVolMesh.h:2956
face_ct faces_
Definition: HexVolMesh.h:2765
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, INDEX &elem, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:1441
static PersistentTypeID hexvolmesh_typeid
These IDs are created as soon as this class will be instantiated.
Definition: HexVolMesh.h:1464
void x(double)
Definition: Vector.h:175
void insert_node_into_grid(typename Node::index_type ci)
Definition: HexVolMesh.h:3760
edge_ct edges_
Definition: HexVolMesh.h:2769
void get_nodes_from_cell(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1586
Elem::index_type add_hex(typename Node::index_type a, typename Node::index_type b, typename Node::index_type c, typename Node::index_type d, typename Node::index_type e, typename Node::index_type f, typename Node::index_type g, typename Node::index_type h)
Definition: HexVolMesh.h:3865
HexVolMesh< Basis >::index_type index_type
Definition: HexVolMesh.h:219
static Persistent * maker()
This function returns a maker for Pio.
Definition: HexVolMesh.h:1482
const Core::Geometry::Point & node2() const
Definition: HexVolMesh.h:325
index_type node5_index() const
Definition: HexVolMesh.h:254
virtual bool unsynchronize(mask_type sync)
Definition: HexVolMesh.h:3508
void get_elems(typename Elem::array_type &array, typename Node::index_type idx) const
Definition: HexVolMesh.h:564
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
SCIRun::index_type index_type
Definition: HexVolMesh.h:168
bool inside(const Point &p) const
Definition: BBox.h:205
Core::Thread::Mutex synchronize_lock_
Definition: HexVolMesh.h:2862
v
Definition: readAllFields.py:42
void get_edges(typename Edge::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:530
void jacobian(const VECTOR &coords, INDEX idx, double *J) const
Definition: HexVolMesh.h:823
std::vector< Core::Geometry::Point > points_
all the nodes.
Definition: HexVolMesh.h:2459
virtual const TypeDescription * get_type_description() const
Definition: HexVolMesh.h:3959
double normalize()
Definition: Vector.h:437
void get_elem_neighbors(ARRAY &array, INDEX elem) const
Definition: HexVolMesh.h:2044
Face information.
Definition: HexVolMesh.h:2464
void node_reserve(size_type s)
Definition: HexVolMesh.h:774
index_type edge1_index() const
Definition: HexVolMesh.h:272
void hash_edge(typename Node::index_type n1, typename Node::index_type n2, index_type combind_index, edge_ht &table) const
Definition: HexVolMesh.h:3315
index_type node6_index() const
Definition: HexVolMesh.h:258
void get_nodes_from_face(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1562
void get_edges_from_face(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1607
Basis basis_
Definition: HexVolMesh.h:2870
CellIterator< under_type > iterator
Definition: HexVolMesh.h:199
PEdgeNode()
Definition: HexVolMesh.h:2581
void y(double)
Definition: Vector.h:185
void get_delems(typename DElem::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:583
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, INDEX idx) const
Definition: HexVolMesh.h:792
double distance_to_line2(const Point &p, const Point &a, const Point &b, const double epsilon)
Definition: CompGeom.cc:53
Definition: HexVolMesh.h:2640
bool locate_node(INDEX &node, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2087
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
mask_type synchronized_
Definition: HexVolMesh.h:2866
bool get_edge_from_nodes(INDEX &idx, ARRAY &array) const
Definition: HexVolMesh.h:1972
void get_edges(typename Edge::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:527
Definition: HexVolMesh.h:197
void clear()
Definition: StackVector.h:65
index_type edge3_index() const
Definition: HexVolMesh.h:280
#define ASSERTFAIL(string)
Definition: Assert.h:52
static const size_t min_buckets
Definition: HexVolMesh.h:2647
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: HexVolMesh.h:3017
Index and Iterator types required for Mesh Concept.
Definition: HexVolMesh.h:176
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
Some convenient simple iterators for fields.
const HexVolMesh & mesh_
Definition: HexVolMesh.h:2846
Basis & get_basis()
Get the basis class.
Definition: HexVolMesh.h:477
void get_faces(typename Face::array_type &array, typename Face::index_type idx) const
Definition: HexVolMesh.h:544
void get_elems(typename Elem::array_type &array, typename Cell::index_type idx) const
Definition: HexVolMesh.h:573
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p) const
Find the closest element to a point.
Definition: HexVolMesh.h:1140
std::vector< Core::Geometry::Point > & get_points()
must detach, if altering points!
Definition: HexVolMesh.h:1523
void compute_node_neighbors()
Definition: HexVolMesh.h:3668
double epsilon_
Definition: HexVolMesh.h:2872
bool find_closest_elems(double &, Core::Geometry::Point &, ARRAY &, const Core::Geometry::Point &) const
Find the closest elements to a point.
Definition: HexVolMesh.h:1450
virtual void end_class()
Definition: Persistent.cc:178
void elem_reserve(size_type s)
Definition: HexVolMesh.h:775
const Core::Geometry::Point & node1() const
Definition: HexVolMesh.h:321
bool get_face_from_nodes(INDEX &idx, ARRAY &array) const
Definition: HexVolMesh.h:1951
void get_edges_from_elem(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1696
long long index_type
Definition: Types.h:39
std::vector< under_type > cells_
each 8 indecies make up a Hex
Definition: HexVolMesh.h:2461
double epsilon2_
Definition: HexVolMesh.h:2873
void size(typename Node::size_type &) const
Get the iteration sizes.
Definition: HexVolMesh.h:3558
face_nt face_table_
Definition: HexVolMesh.h:2766
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
void get_normal(Core::Geometry::Vector &result, VECTOR &coords, INDEX1 eidx, INDEX2 fidx) const
Get the normals at the outside of the element.
Definition: HexVolMesh.h:725
std::vector< std::vector< typename Cell::index_type > > node_neighbors_
Definition: HexVolMesh.h:2850
static const TypeDescription * cell_type_description()
Definition: HexVolMesh.h:4017
FaceIndex< under_type > index_type
Definition: HexVolMesh.h:191
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &node, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:896
HexVolMesh()
Construct a new mesh.
Definition: HexVolMesh.h:2891
void operator()()
Definition: HexVolMesh.h:366
virtual int dimensionality() const
Topological dimension.
Definition: HexVolMesh.h:441
double get_area(typename Face::index_type idx) const
Definition: HexVolMesh.h:660
bool operator()(const PEDGE &e1, const PEDGE &e2) const
This should return less than rather than equal to.
Definition: HexVolMesh.h:2729
void reset()
Definition: BBox.h:95
bool locate(typename Elem::index_type &elem, std::vector< double > &coords, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:698
double get_size(typename Face::index_type idx) const
Definition: HexVolMesh.h:637
Definition: Persistent.h:64
Node::index_type add_point(const Core::Geometry::Point &p)
Add a new node to the mesh.
Definition: HexVolMesh.h:3888
static const size_t bucket_size
These are needed by the hash_map particularly.
Definition: HexVolMesh.h:2710
void get_nodes(typename Node::array_type &array, typename Node::index_type idx) const
Get the child topology elements of the given topology.
Definition: HexVolMesh.h:511
boost::shared_ptr< VMesh > vmesh_
Pointer to virtual interface.
Definition: HexVolMesh.h:2877
useful functors
Definition: HexVolMesh.h:2831
void get_edges_from_node(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1779
#define HEXVOLMESH_VERSION
Definition: HexVolMesh.h:3907
static const int sz_quarter_int
These are for our own use (making the hash function.
Definition: HexVolMesh.h:2650
static const TypeDescription * elem_type_description()
Definition: HexVolMesh.h:1478
bool get_elem_neighbor(INDEX1 &neighbor, INDEX1 elem, INDEX2 delem) const
Definition: HexVolMesh.h:1998
double get_size(typename Edge::index_type idx) const
Definition: HexVolMesh.h:627
CellIndex< under_type > index_type
Definition: HexVolMesh.h:198
Distinct type for edge index.
Definition: FieldIndex.h:81
void operator()(typename Edge::index_type e)
Definition: HexVolMesh.h:2838
bool locate_elem(INDEX &elem, ARRAY &coords, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:2300
void compute_node_grid()
Definition: HexVolMesh.h:3812
friend class VHexVolMesh
Make sure the virtual interface has access.
Definition: HexVolMesh.h:161
int n
Definition: eab.py:9
PFaceNode(typename Node::index_type n1, typename Node::index_type n2, typename Node::index_type n3, typename Node::index_type n4)
Definition: HexVolMesh.h:2490
bool locate_elems(ARRAY &array, const Core::Geometry::BBox &b) const
Definition: HexVolMesh.h:2269
static const TypeDescription * node_type_description()
Definition: HexVolMesh.h:3966
Elem::index_type add_elem(ARRAY a)
Add a new element to the mesh.
Definition: HexVolMesh.h:758
void to_index(typename Cell::index_type &index, index_type i) const
Definition: HexVolMesh.h:507
size_t operator()(const PFACE &f) const
This is the hash function.
Definition: HexVolMesh.h:2658
PFaceNode()
4 nodes makes a face.
Definition: HexVolMesh.h:2481
std::vector< std::vector< typename Node::index_type > > & nbor_vec_
Definition: HexVolMesh.h:2845
FaceIterator< under_type > iterator
Definition: HexVolMesh.h:192
bool locate(typename Face::index_type &idx, const Core::Geometry::Point &p) const
Definition: HexVolMesh.h:693
void get_center(Core::Geometry::Point &result, typename Cell::index_type idx) const
Definition: HexVolMesh.h:620
void get_faces_from_cell(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1702
void fill_data(Iter begin, Iter end, Functor fill_ftor)
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
void io(Piostream &stream)
Persistent I/O.
Definition: Mesh.cc:387
bool shared() const
Definition: HexVolMesh.h:2626
NodeIndex< under_type > index_type
Definition: HexVolMesh.h:177
void get_cells(typename Cell::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:554
index_type node0_index() const
Definition: HexVolMesh.h:234
int compute_checksum()
Definition: HexVolMesh.h:2882
bool operator<(const PEdgeNode &e) const
Definition: HexVolMesh.h:2610
void remove_elem_from_grid(typename Elem::index_type ci)
Definition: HexVolMesh.h:3742
index_type cells_[2]
Definition: HexVolMesh.h:2475
bool get_cell_from_nodes(INDEX &, ARRAY &) const
Definition: HexVolMesh.h:1945
void z(double)
Definition: Vector.h:195
bool clear_synchronization()
Definition: HexVolMesh.h:3515
void get_neighbors(typename Elem::array_type &array, typename Elem::index_type elem) const
Definition: HexVolMesh.h:684
boost::shared_ptr< MeshFacade< VMesh > > MeshFacadeHandle
Definition: MeshTraits.h:61
FaceIndex< under_type > size_type
Definition: HexVolMesh.h:193
std::vector< PFaceCell > face_ct
Definition: HexVolMesh.h:2759
mask_type synchronizing_
Definition: HexVolMesh.h:2868
static const int low4_mask
Definition: HexVolMesh.h:2654
void to_index(typename Face::index_type &index, index_type i) const
Definition: HexVolMesh.h:505
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &node, const Core::Geometry::Point &p, double maxdist) const
Definition: HexVolMesh.h:903
const Core::Geometry::Point & node3() const
Definition: HexVolMesh.h:329
void set_nodes_by_elem(ARRAY &array, INDEX idx)
Definition: HexVolMesh.h:1990
index_type node7_index() const
Definition: HexVolMesh.h:262
index_type node3_index() const
Definition: HexVolMesh.h:246
const Core::Geometry::Point & node6() const
Definition: HexVolMesh.h:341
Node::index_type add_find_point(const Core::Geometry::Point &p, double err=1.0e-6)
Definition: HexVolMesh.h:3849
Definition: HexVolMesh.h:77
bool operator()(const PFACE &f1, const PFACE &f2) const
This should return less than rather than equal to.
Definition: HexVolMesh.h:2698
EdgeIterator< under_type > iterator
Definition: HexVolMesh.h:185
void get_elems(typename Elem::array_type &array, typename Edge::index_type idx) const
Definition: HexVolMesh.h:567
void pwl_approx_edge(std::vector< VECTOR > &coords, INDEX ci, unsigned int which_edge, unsigned int div_per_unit) const
Definition: HexVolMesh.h:594
int size
Definition: eabLatVolData.py:2
std::vector< index_type > array_type
Definition: HexVolMesh.h:187
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: HexVolMesh.h:1484
Node::index_type nodes_[2]
Definition: HexVolMesh.h:2579
void get_cells_from_edge(ARRAY &array, INDEX idx) const
Definition: HexVolMesh.h:1914
const Core::Geometry::Point & node7() const
Definition: HexVolMesh.h:345
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
index_type edge11_index() const
Definition: HexVolMesh.h:312
ElemData(const HexVolMesh< Basis > &msh, const index_type ind)
Definition: HexVolMesh.h:221
bool elem_locate(INDEX &elem, MESH &msh, const Core::Geometry::Point &p)
General case locate, search each elem.
Definition: Mesh.h:188