29 #ifndef CORE_DATATYPES_IMAGEMESH_H
30 #define CORE_DATATYPES_IMAGEMESH_H 1
60 template <
class Basis>
74 #if (SCIRUN_IMAGE_SUPPORT > 0)
82 template <
class Basis>
83 class ImageMesh :
public Mesh {
115 os <<
"[" <<
i_ <<
"," <<
j_ <<
"]";
158 return !(*
this == a);
230 os <<
i_*
j_ <<
" (" <<
i_ <<
" x " <<
j_ <<
")";
303 return (index_.
i_ + mesh_.get_ni()*index_.
j_);
308 return (index_.
i_+ 1 + mesh_.get_ni()*index_.
j_);
313 return (index_.
i_ + 1 + mesh_.get_ni()*(index_.
j_ + 1));
319 return (index_.
i_ + mesh_.get_ni()*(index_.
j_ + 1));
326 return index_.
i_ + index_.
j_ * (mesh_.ni_- 1);
331 return index_.
i_ + (index_.
j_ + 1) * (mesh_.ni_ - 1);
336 return index_.
i_ *(mesh_.nj_ - 1) + index_.
j_ +
337 ((mesh_.ni_ - 1) * mesh_.nj_);
342 return (index_.
i_ + 1) * (mesh_.nj_ - 1) + index_.
j_ +
343 ((mesh_.ni_ - 1) * mesh_.nj_);
351 return mesh_.transform_.project(p);
357 return mesh_.transform_.project(p);
363 return mesh_.transform_.project(p);
369 return mesh_.transform_.project(p);
428 return boost::make_shared<Core::Datatypes::VirtualMeshFacade<VMesh>>(
vmesh_);
446 unsigned int which_edge,
447 unsigned int div_per_unit)
const
451 int basis_emap[] = {0, 2, 3, 1};
452 basis_.approx_edge(basis_emap[which_edge], div_per_unit, coords);
460 unsigned int div_per_unit)
const
462 basis_.approx_face(0, div_per_unit, coords);
469 template<
class VECTOR>
474 if (
basis_.polynomial_order() > 1)
477 return basis_.get_coords(coords, p, ed);
486 coords[0] =
static_cast<typename VECTOR::value_type
>(r.
x()-
static_cast<double>(idx.
i_));
487 coords[1] =
static_cast<typename VECTOR::value_type
>(r.
y()-
static_cast<double>(idx.
j_));
489 const double epsilon = 1e-8;
491 if (static_cast<double>(coords[0]) < 0.0)
if (static_cast<double>(coords[0]) > -(epsilon))
492 coords[0] =
static_cast<typename VECTOR::value_type
>(0.0);
else return (
false);
493 if (static_cast<double>(coords[0]) > 1.0)
if (static_cast<double>(coords[0]) < 1.0+(epsilon))
494 coords[0] =
static_cast<typename VECTOR::value_type
>(1.0);
else return (
false);
495 if (static_cast<double>(coords[1]) < 0.0)
if (static_cast<double>(coords[1]) > -(epsilon))
496 coords[1] =
static_cast<typename VECTOR::value_type
>(0.0);
else return (
false);
497 if (static_cast<double>(coords[1]) > 1.0)
if (static_cast<double>(coords[1]) < 1.0+(epsilon))
498 coords[1] =
static_cast<typename VECTOR::value_type
>(1.0);
else return (
false);
505 template<
class VECTOR>
509 if (
basis_.polynomial_order() > 1)
512 pt =
basis_.interpolate(coords, ed);
518 static_cast<double>(idx.
j_)+static_cast<double>(coords[1]),
526 template<
class VECTOR1,
class VECTOR2>
530 if (
basis_.polynomial_order() > 1)
533 basis_.derivate(coords, ed, J);
545 template<
class VECTOR>
548 if (
basis_.polynomial_order() > 1)
561 template<
class VECTOR>
564 if (
basis_.polynomial_order() > 1)
568 basis_.derivate(coords,ed,Jv);
598 template<
class VECTOR>
601 if (
basis_.polynomial_order() > 1)
605 basis_.derivate(coords,ed,Jv);
647 bool get_min(std::vector<index_type>&)
const;
650 virtual bool get_dim(std::vector<size_type>&)
const;
662 void set_min(std::vector<index_type> mins);
682 virtual void set_dim(std::vector<size_type> dims);
703 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
710 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");}
713 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
715 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
747 return (p1 - p0).length();
757 return (
Cross(p0-p1,p2-p0)).length();
760 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
765 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); };
775 {
ASSERTFAIL(
"This mesh type does not have node normals."); }
780 std::vector<Core::Geometry::Point> Jv;
781 basis_.derivate(coords, ed, Jv);
791 ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
797 ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
801 {
ASSERTFAIL(
"ImageMesh::get_weights for edges isn't supported"); }
804 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
819 static const std::string
type_name(
int n = -1);
848 {
return boost::make_shared<ImageMesh<Basis>>(x,y,min,max); }
862 template <
class ARRAY>
868 double maxdist)
const
871 if(!ret)
return (
false);
872 if (maxdist < 0.0 || pdist < maxdist)
return (
true);
887 template<
class ARRAY>
894 if (
ni_ == 0 ||
nj_ == 0)
return (
false);
900 const double nii =
static_cast<double>(
ni_-2);
901 const double njj =
static_cast<double>(
nj_-2);
903 if (ii < 0.0) ii = 0.0;
if (ii > nii) ii = nii;
904 if (jj < 0.0) jj = 0.0;
if (jj > njj) jj = njj;
906 const double fi = floor(ii);
907 const double fj = floor(jj);
914 pdist = (p-result).length();
928 std::vector<typename Elem::index_type> &elem,
966 template <
class Basis>
971 template<
class Basis>
974 min_i_(0), min_j_(0), ni_(i), nj_(j)
999 template<
class Basis>
1007 return ((q0-q1).length()*1e-8);
1010 template<
class Basis>
1020 result.
extend(transform_.project(p0));
1021 result.
extend(transform_.project(p1));
1022 result.
extend(transform_.project(p2));
1023 result.
extend(transform_.project(p3));
1028 template<
class Basis>
1032 return get_bounding_box().diagonal();
1036 template<
class Basis>
1045 template<
class Basis>
1052 transform_.project_normal(normal_);
1053 normal_.safe_normalize();
1059 template<
class Basis>
1066 template<
class Basis>
1073 template<
class Basis>
1077 transform_.pre_trans(t);
1078 transform_.compute_imat();
1083 template<
class Basis>
1090 array.push_back(min_i_);
1091 array.push_back(min_j_);
1097 template<
class Basis>
1104 array.push_back(ni_);
1105 array.push_back(nj_);
1111 template<
class Basis>
1120 template<
class Basis>
1134 template<
class Basis>
1141 array[0].i_ = idx.
i_; array[0].j_ = idx.
j_;
1142 array[1].i_ = idx.
i_+1; array[1].j_ = idx.
j_;
1143 array[2].i_ = idx.
i_+1; array[2].j_ = idx.
j_+1;
1144 array[3].i_ = idx.
i_; array[3].j_ = idx.
j_+1;
1146 array[0].mesh_ = idx.
mesh_;
1147 array[1].mesh_ = idx.
mesh_;
1148 array[2].mesh_ = idx.
mesh_;
1149 array[3].mesh_ = idx.
mesh_;
1153 template<
class Basis>
1160 const index_type j_idx = idx - (ni_-1) * nj_;
1178 template<
class Basis>
1187 array[0] = idx.
i_ + idx.
j_ *(ni_-1);
1188 array[1] = idx.
i_ + (idx.
j_+1)*(ni_-1);
1189 array[2] = idx.
i_ *(nj_-1) + idx.
j_+ j_idx;
1190 array[3] = (idx.
i_+1)*(nj_-1) + idx.
j_+ j_idx;
1193 template<
class Basis>
1207 if (j < (nj_-1)) array.push_back(
IFaceIndex(
this,i,j));
1208 if (j > 0) array.push_back(
IFaceIndex(
this,i,j-1));
1215 if (i < (ni_-1)) array.push_back(
IFaceIndex(
this,i,j));
1216 if (i > 0) array.push_back(
IFaceIndex(
this,i-1,j));
1223 template<
class Basis>
1229 neighbor.
mesh_ =
this;
1230 const index_type j_idx = edge - (ni_-1) * nj_;
1234 if (i == 0 || i == ni_-1)
1236 neighbor.
j_ = from.
j_;
1238 neighbor.
i_ = from.
i_ - 1;
1240 neighbor.
i_ = from.
i_ + 1;
1245 if (j == 0 || j == nj_-1)
1247 neighbor.
i_ = from.
i_;
1249 neighbor.
j_ = from.
j_ - 1;
1251 neighbor.
j_ = from.
j_ + 1;
1257 template<
class Basis>
1263 get_edges(edges, idx);
1265 typename Edge::array_type::iterator iter = edges.begin();
1266 while(iter != edges.end()) {
1268 if (get_neighbor(nbor, idx, *iter)) {
1269 array.push_back(nbor);
1276 template<
class Basis>
1291 for (j = j0; j < j1; j++)
1292 for (i = i0; i < i1; i++)
1298 template<
class Basis>
1304 locate(min, bbox.
min());
1306 locate(max, bbox.
max());
1308 if (max.i_ >= ni_ - 1) max.i_ = ni_ - 2;
1309 if (max.j_ >= nj_ - 1) max.j_ = nj_ - 2;
1321 template<
class Basis>
1327 result = transform_.project(p);
1331 template<
class Basis>
1337 get_nodes(arr, idx);
1339 get_center(result, arr[0]);
1340 get_center(p1, arr[1]);
1347 template<
class Basis>
1353 result = transform_.project(p);
1356 template <
class Basis>
1365 std::vector<double> coords(2);
1366 if (get_coords(coords, p, idx))
1368 basis_.get_weights(coords, w);
1369 return basis_.dofs();
1376 template <
class Basis>
1397 template<
class Basis>
1407 get_center(p00,ra[0]);
1408 get_center(p10,ra[1]);
1409 get_center(p11,ra[2]);
1410 get_center(p01,ra[3]);
1415 const double u = rng();
1416 const double v = rng();
1419 p = p00 + dx*u + dy*
v;
1423 template<
class Basis>
1430 std::string(
"::INodeIndex"),
1431 std::string(__FILE__),
1438 template<
class Basis>
1445 std::string(
"::IFaceIndex"),
1446 std::string(__FILE__),
1453 template<
class Basis>
1464 template<
class Basis>
1475 #define IMAGEMESH_VERSION 4
1477 template<
class Basis>
1488 unsigned int ni =
static_cast<unsigned int>(ni_);
1489 unsigned int nj =
static_cast<unsigned int>(nj_);
1506 Pio(stream, transform_);
1519 template<
class Basis>
1523 ASSERT((n >= -1) && n <= 1);
1531 static const std::string nm(
"ImageMesh");
1541 template<
class Basis>
1549 template<
class Basis>
1557 template<
class Basis>
1565 template<
class Basis>
1576 template<
class Basis>
1584 template<
class Basis>
1588 itr = (ni_-1) * (nj_) + (ni_) * (nj_ -1);
1592 template<
class Basis>
1596 s = (ni_-1) * (nj_) + (ni_) * (nj_ -1);
1600 template<
class Basis>
1608 template<
class Basis>
1616 template<
class Basis>
1624 template<
class Basis>
1636 template<
class Basis>
1640 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1644 template<
class Basis>
1648 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1652 template<
class Basis>
1656 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1660 template<
class Basis>
1671 std::string(__FILE__),
1679 template<
class Basis>
1680 const TypeDescription*
1687 template<
class Basis>
1697 std::string(__FILE__),
1705 template<
class Basis>
1715 std::string(__FILE__),
1723 template<
class Basis>
1733 std::string(__FILE__),
1741 template<
class Basis>
1751 std::string(__FILE__),
1759 template<
class Basis>
1763 if (basis_.polynomial_order() > 1)
return elem_locate(elem, *
this, p);
1765 if (ni_ == 0 || nj_ == 0)
return (
false);
1767 const double epsilon = 1e-7;
1774 const double nii =
static_cast<double>(ni_-1);
1775 const double njj =
static_cast<double>(nj_-1);
1777 if (ii>=nii && (ii-epsilon)<nii) ii=nii-epsilon;
1778 if (jj>=njj && (jj-epsilon)<njj) jj=njj-epsilon;
1780 if (ii<0 && ii>(-epsilon)) ii=0.0;
1781 if (jj<0 && jj>(-epsilon)) jj=0.0;
1786 if (i < (ni_-1) && i >= 0 &&
1787 j < (nj_-1) && j >= 0 &&
1788 ii >= 0.0 && jj >= 0.0)
1800 template<
class Basis>
1804 if (ni_ == 0 || nj_ == 0)
return (
false);
1808 double rx = floor(r.
x() + 0.5);
1809 double ry = floor(r.
y() + 0.5);
1810 const double nii =
static_cast<double>(ni_-1);
1811 const double njj =
static_cast<double>(nj_-1);
1813 if (rx < 0.0) rx = 0.0;
if (rx > nii) rx = nii;
1814 if (ry < 0.0) ry = 0.0;
if (ry > njj) ry = njj;
1824 template <
class Basis>
1831 if (ni_ == 0 || nj_ == 0)
return (
false);
1835 double rx = floor(r.
x() + 0.5);
1836 double ry = floor(r.
y() + 0.5);
1838 const double nii =
static_cast<double>(ni_-1);
1839 const double njj =
static_cast<double>(nj_-1);
1841 if (rx < 0.0) rx = 0.0;
if (rx > nii) rx = nii;
1842 if (ry < 0.0) ry = 0.0;
if (ry > njj) ry = njj;
1849 pdist = (p-result).length();
1854 template <
class Basis>
1861 bool ret = find_closest_node(pdist,result,node,p);
1862 if (!ret)
return (
false);
1863 if (maxdist < 0.0 || pdist < maxdist)
return (
true);
1867 template <
class Basis>
1871 std::vector<typename Elem::index_type> &elems,
1874 if (ni_ == 0 || nj_ == 0)
return (
false);
1878 const double epsilon = 1e-8;
1884 const double nii =
static_cast<double>(ni_-2);
1885 const double njj =
static_cast<double>(nj_-2);
1887 if (ii < 0.0) ii = 0.0;
if (ii > nii) ii = nii;
1888 if (jj < 0.0) jj = 0.0;
if (jj > njj) jj = njj;
1890 const double fii = floor(ii);
1891 const double fjj = floor(jj);
1901 elems.push_back(elem);
1903 if ((fabs(fii-ii) < epsilon) && ((i-1)>0))
1907 elems.push_back(elem);
1910 if ((fabs(fii-(ii+1.0)) < epsilon) && (i<(ni_-1)))
1914 elems.push_back(elem);
1917 if ((fabs(fjj-jj) < epsilon) && ((j-1)>0))
1921 elems.push_back(elem);
1924 if ((fabs(fjj-(jj+1.0)) < epsilon) && (j<(nj_-1)))
1928 elems.push_back(elem);
1933 pdist = (p-result).length();
1937 template <
class Basis>
1941 if (basis_.polynomial_order() < 2)
1949 jacobian_[0] = J1.
x();
1950 jacobian_[1] = J1.
y();
1951 jacobian_[2] = J1.
z();
1952 jacobian_[3] = J2.
x();
1953 jacobian_[4] = J2.
y();
1954 jacobian_[5] = J2.
z();
1955 jacobian_[6] = J3.
x();
1956 jacobian_[7] = J3.
y();
1957 jacobian_[8] = J3.
z();
std::vector< index_type > array_type
Definition: ImageMesh.h:278
double jacobian_[9]
Definition: ImageMesh.h:958
void begin(typename Node::iterator &) const
Definition: ImageMesh.h:1543
Interface to statically allocated std::vector class.
void set_ni(size_type i)
Definition: ImageMesh.h:663
bool operator!=(const ImageIter &a) const
Definition: ImageMesh.h:156
bool reading() const
Definition: Persistent.h:164
static PersistentTypeID imagemesh_typeid
Definition: ImageMesh.h:817
index_type i_
Definition: ImageMesh.h:235
INodeSize()
Definition: ImageMesh.h:240
Core::Geometry::Vector diagonal() const
Definition: ImageMesh.h:1030
CellIndex< under_type > size_type
Definition: ImageMesh.h:277
double get_size(typename Cell::index_type) const
Definition: ImageMesh.h:759
Definition: FieldRNG.h:37
std::string get_name(const std::string &type_sep_start="<", const std::string &type_sep_end="> ") const
Definition: TypeDescription.cc:135
index_type min_j_
Definition: ImageMesh.h:939
index_type edge3_index() const
Definition: ImageMesh.h:340
EdgeIndex< under_type > size_type
Definition: ImageMesh.h:263
void end(typename Node::iterator &) const
Definition: ImageMesh.h:1551
virtual std::string dynamic_type_name() const
Definition: ImageMesh.h:820
#define IMAGEMESH_VERSION
Definition: ImageMesh.h:1475
friend class VImageMesh
Make sure the virtual interface has access.
Definition: ImageMesh.h:86
ImageMesh()
Definition: ImageMesh.h:379
Point max() const
Definition: BBox.h:195
double inverse_jacobian(const VECTOR &coords, typename Elem::index_type idx, double *Ji) const
Definition: ImageMesh.h:599
void get_edges(typename Edge::array_type &, typename Cell::index_type) const
Definition: ImageMesh.h:712
size_type ni_
Definition: ImageMesh.h:942
double get_length(typename Edge::index_type idx) const
Definition: ImageMesh.h:762
INodeIndex(const ImageMesh *m, index_type i, index_type j)
Definition: ImageMesh.h:139
const Core::Geometry::Point node3() const
Definition: ImageMesh.h:366
void get_faces(typename Face::array_type &, typename Cell::index_type) const
Definition: ImageMesh.h:714
Definition: ImageMesh.h:61
INodeIter(const ImageMesh *m, index_type i, index_type j)
Definition: ImageMesh.h:165
void get_point(Core::Geometry::Point &p, const typename Node::index_type &i) const
Definition: ImageMesh.h:806
Definition: Persistent.h:89
void get_center(Core::Geometry::Point &, typename Cell::index_type) const
Definition: ImageMesh.h:790
const Core::Geometry::Point node0() const
Definition: ImageMesh.h:348
Definition: ImageMesh.h:220
void pwl_approx_face(std::vector< std::vector< std::vector< double > > > &coords, typename Elem::index_type, unsigned int, unsigned int div_per_unit) const
Definition: ImageMesh.h:457
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: ImageMesh.h:729
virtual ~ImageMesh()
Definition: ImageMesh.h:421
IFaceIndex index_type
Definition: ImageMesh.h:268
Definition: ImageMesh.h:191
void get_nodes(typename Node::array_type &, typename Edge::index_type) const
get the child elements of the given index
Definition: ImageMesh.h:1155
void set_min_j(index_type j)
Definition: ImageMesh.h:661
double get_size(typename Edge::index_type idx) const
Definition: ImageMesh.h:740
void y(const double)
Definition: Point.h:135
index_type edge2_index() const
Definition: ImageMesh.h:334
VMesh * CreateVImageMesh(MESH *)
Definition: ImageMesh.h:67
size_type j_
Definition: ImageMesh.h:119
Definition: Persistent.h:187
bool get_min(std::vector< index_type > &) const
Definition: ImageMesh.h:1085
std::ostream & str_render(std::ostream &os) const
Definition: ImageMesh.h:228
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
void get_nodes(typename Node::array_type &, typename Cell::index_type) const
Definition: ImageMesh.h:709
virtual int dimensionality() const
Definition: ImageMesh.h:827
bool find_closest_elems(double &pdist, Core::Geometry::Point &result, std::vector< typename Elem::index_type > &elem, const Core::Geometry::Point &p) const
Definition: ImageMesh.h:1869
void to_index(typename Edge::index_type &index, index_type i) const
Definition: ImageMesh.h:700
virtual void set_dim(std::vector< size_type > dims)
Definition: ImageMesh.h:1122
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: ImageMesh.h:1521
Definition: TypeDescription.h:50
static const TypeDescription * elem_type_description()
Definition: ImageMesh.h:837
size_type get_min_i() const
get the mesh statistics
Definition: ImageMesh.h:645
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
size_type get_nj() const
Definition: ImageMesh.h:649
void derivate(const VECTOR1 &coords, typename Elem::index_type idx, VECTOR2 &J) const
Definition: ImageMesh.h:527
Basis basis_
The basis class.
Definition: ImageMesh.h:951
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
Distinct type for cell Iterator.
Definition: FieldIterator.h:134
virtual void begin_cheap_delim()
Definition: Persistent.cc:183
unsigned int mask_type
Definition: Types.h:45
static MeshHandle image_maker(size_type x, size_type y, const Core::Geometry::Point &min, const Core::Geometry::Point &max)
This function returns a handle for the virtual interface.
Definition: ImageMesh.h:847
EdgeIndex< under_type > index_type
Definition: ImageMesh.h:261
static Persistent * maker()
This function returns a maker for Pio.
Definition: ImageMesh.h:843
#define ASSERT(condition)
Definition: Assert.h:110
size_type get_ni() const
Definition: ImageMesh.h:648
void get_faces(typename Face::array_type &a, typename Face::index_type f) const
Definition: ImageMesh.h:716
bool locate(typename Node::index_type &, const Core::Geometry::Point &) const
Definition: ImageMesh.h:1802
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
boost::shared_ptr< VMesh > vmesh_
Virtual mesh.
Definition: ImageMesh.h:954
ImageIndex(const ImageMesh *m, size_type i, size_type j)
Definition: ImageMesh.h:106
Definition: ImageMesh.h:124
virtual VMesh * vmesh()
Access point to virtual interface.
Definition: ImageMesh.h:432
INodeIndex index_type
Definition: ImageMesh.h:254
virtual void get_canonical_transform(Core::Geometry::Transform &t)
Definition: ImageMesh.h:1038
IFaceIndex(const ImageMesh *m, index_type i, index_type j)
Definition: ImageMesh.h:127
IFaceIter iterator
Definition: ImageMesh.h:269
static const TypeDescription * cell_type_description()
Definition: ImageMesh.h:1743
const string find_type_name(float *)
Definition: TypeName.cc:63
Definition: ImageMesh.h:101
CellIndex< under_type > index_type
Definition: ImageMesh.h:275
IFaceIndex()
Definition: ImageMesh.h:126
T DetMatrix3x3(const T *p)
Definition: Locate.h:95
Definition: ImageMesh.h:274
CellIterator< under_type > iterator
Definition: ImageMesh.h:276
IFaceSize size_type
Definition: ImageMesh.h:270
double inverse_jacobian_[9]
Definition: ImageMesh.h:959
Definition: ParallelLinearAlgebraTests.cc:358
void get_neighbors(typename Face::array_type &array, typename Face::index_type idx) const
Definition: ImageMesh.h:1259
virtual ImageMesh * clone() const
Definition: ImageMesh.h:420
virtual Core::Geometry::BBox get_bounding_box() const
Definition: ImageMesh.h:1012
const char * name[]
Definition: BoostGraphExampleTests.cc:87
void x(const double)
Definition: Point.h:125
double jacobian_metric(typename Elem::index_type) const
Definition: ImageMesh.h:639
long long size_type
Definition: Types.h:40
MeshFacadeHandle getFacade() const
Definition: ImageMesh.h:426
Definition: StackVector.h:50
double get_epsilon() const
Definition: ImageMesh.h:1001
void get_edges(typename Edge::array_type &, typename Face::index_type) const
Definition: ImageMesh.h:1180
static const TypeDescription * face_type_description()
Definition: ImageMesh.h:1725
INodeIter()
Definition: ImageMesh.h:164
bool operator==(const ImageIter &a) const
Definition: ImageMesh.h:151
Vector Cross(const Vector &v1, const Vector &v2)
Definition: Vector.h:378
double get_size(const typename Node::index_type &) const
Get the size of an element (length, area, volume)
Definition: ImageMesh.h:739
std::vector< index_type > array_type
Definition: ImageMesh.h:271
const ImageIndex & operator*()
Definition: ImageMesh.h:149
const Core::Geometry::Point node2() const
Definition: ImageMesh.h:360
static const TypeDescription * edge_type_description()
Definition: ImageMesh.h:1707
size_type get_min_j() const
Definition: ImageMesh.h:646
size_type nj_
Definition: ImageMesh.h:943
double scaled_jacobian_
Definition: ImageMesh.h:961
ImageMesh(const ImageMesh ©)
Definition: ImageMesh.h:405
int get_weights(const Core::Geometry::Point &p, typename Node::array_type &l, double *w)
Definition: ImageMesh.h:1358
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: ImageMesh.h:1479
std::string type
Definition: Persistent.h:72
INodeSize size_type
Definition: ImageMesh.h:256
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, typename Elem::index_type idx) const
Definition: ImageMesh.h:506
virtual void transform(const Core::Geometry::Transform &t)
Definition: ImageMesh.h:1075
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: ImageMesh.h:863
virtual void end_cheap_delim()
Definition: Persistent.cc:188
Point min() const
Definition: BBox.h:192
INodeSize(index_type i, index_type j)
Definition: ImageMesh.h:241
void set_min(std::vector< index_type > mins)
Definition: ImageMesh.h:1113
Core::Geometry::Transform transform_
the object space extents of a ImageMesh
Definition: ImageMesh.h:946
Definition: ImageMesh.h:290
index_type node3_index() const
Definition: ImageMesh.h:317
virtual bool has_face_normals() const
Definition: ImageMesh.h:437
INodeIter & operator++()
Definition: ImageMesh.h:170
void x(double)
Definition: Vector.h:175
bool locate(typename Edge::index_type &, const Core::Geometry::Point &) const
Definition: ImageMesh.h:794
Core::Geometry::Transform & get_transform()
Definition: ImageMesh.h:823
void set_nj(size_type j)
Definition: ImageMesh.h:672
bool find_closest_node(double &pdist, Core::Geometry::Point &result, typename Node::index_type &elem, const Core::Geometry::Point &p) const
Definition: ImageMesh.h:1826
static const TypeDescription * node_index_type_description()
Definition: ImageMesh.h:1425
bool get_neighbor(typename Face::index_type &neighbor, typename Face::index_type from, typename Edge::index_type idx) const
Definition: ImageMesh.h:1225
void get_random_point(Core::Geometry::Point &, const typename Elem::index_type &, FieldRNG &rng) const
Definition: ImageMesh.h:1399
Edge DElem
Definition: ImageMesh.h:282
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
std::vector< index_type > array_type
Definition: ImageMesh.h:264
ImageIndex()
Definition: ImageMesh.h:104
v
Definition: readAllFields.py:42
void get_center(Core::Geometry::Point &, const typename Node::index_type &) const
get the center point (in object space) of an element
Definition: ImageMesh.h:1323
double get_size(const typename Face::index_type &idx) const
Definition: ImageMesh.h:749
double det_jacobian_
Definition: ImageMesh.h:960
double normalize()
Definition: Vector.h:437
Definition: ImageMesh.h:136
Definition: ImageMesh.h:245
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, typename Elem::index_type idx) const
Definition: ImageMesh.h:470
virtual bool get_dim(std::vector< size_type > &) const
Definition: ImageMesh.h:1099
void y(double)
Definition: Vector.h:185
double safe_normalize()
Definition: Vector.h:236
void compute_jacobian()
Definition: ImageMesh.h:1939
ImageIter()
Definition: ImageMesh.h:145
IFaceIter(const ImageMesh *m, index_type i, index_type j)
Definition: ImageMesh.h:194
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
void to_index(typename Node::index_type &index, index_type i) const
Definition: ImageMesh.h:1567
IFaceSize()
Definition: ImageMesh.h:247
index_type min_i_
the min_typename Node::index_type ( incase this is a subLattice )
Definition: ImageMesh.h:938
StackVector< index_type, 4 > array_type
Definition: ImageMesh.h:257
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: ImageMesh.h:444
#define ASSERTFAIL(string)
Definition: Assert.h:52
Basis & get_basis()
Definition: ImageMesh.h:440
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
Some convenient simple iterators for fields.
virtual const TypeDescription * get_type_description() const
Definition: ImageMesh.h:1681
INodeIter iterator
Definition: ImageMesh.h:255
void size(typename Node::size_type &) const
Definition: ImageMesh.h:1559
double get_volume(typename Cell::index_type) const
Definition: ImageMesh.h:764
bool locate(typename Cell::index_type &, const Core::Geometry::Point &) const
Definition: ImageMesh.h:796
static const TypeDescription * node_type_description()
Definition: ImageMesh.h:1689
virtual void end_class()
Definition: Persistent.cc:178
const IFaceIndex & operator*() const
Definition: ImageMesh.h:197
bool clear_synchronization()
Definition: ImageMesh.h:1068
Basis basis_type
Definition: ImageMesh.h:97
Definition: ImageMesh.h:143
T ScaledDetMatrix3x3(const T *p)
Definition: Locate.h:106
ImageIter(const ImageMesh *m, index_type i, index_type j)
Definition: ImageMesh.h:146
Index and Iterator types required for Mesh Concept.
Definition: ImageMesh.h:253
boost::shared_ptr< ImageMesh< Basis > > handle_type
Definition: ImageMesh.h:96
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, typename Elem::index_type &elem, const Core::Geometry::Point &p) const
Definition: ImageMesh.h:888
const Core::Geometry::Point node1() const
Definition: ImageMesh.h:354
long long index_type
Definition: Types.h:39
size_type i_
Definition: ImageMesh.h:119
IFaceSize(index_type i, index_type j)
Definition: ImageMesh.h:248
static const TypeDescription * face_index_type_description()
Definition: ImageMesh.h:1440
int get_weights(const Core::Geometry::Point &, typename Edge::array_type &, double *)
Definition: ImageMesh.h:800
int get_weights(const Core::Geometry::Point &, typename Cell::array_type &, double *)
Definition: ImageMesh.h:803
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
std::ostream & str_render(std::ostream &os) const
Definition: ImageMesh.h:114
virtual bool unsynchronize(mask_type sync)
Definition: ImageMesh.h:1061
index_type node0_index() const
Definition: ImageMesh.h:301
const ImageMesh * mesh_
Definition: ImageMesh.h:121
EdgeIterator< under_type > iterator
Definition: ImageMesh.h:262
ElemData(const ImageMesh< Basis > &msh, const typename Elem::index_type ind)
Definition: ImageMesh.h:293
Core::Geometry::Transform & set_transform(const Core::Geometry::Transform &trans)
Definition: ImageMesh.h:824
index_type node2_index() const
Definition: ImageMesh.h:311
Definition: Persistent.h:64
SCIRun::size_type size_type
Definition: ImageMesh.h:93
ImageSize()
Definition: ImageMesh.h:223
IFaceIter()
Definition: ImageMesh.h:193
Definition: ImageMesh.h:238
index_type node1_index() const
Definition: ImageMesh.h:306
SCIRun::mask_type mask_type
Definition: ImageMesh.h:94
void set_min_i(index_type i)
set the mesh statistics
Definition: ImageMesh.h:660
Distinct type for edge index.
Definition: FieldIndex.h:81
index_type j_
Definition: ImageMesh.h:235
int n
Definition: eab.py:9
virtual bool has_normals() const
Definition: ImageMesh.h:436
index_type edge1_index() const
Definition: ImageMesh.h:329
virtual int basis_order()
Definition: ImageMesh.h:434
T InverseMatrix3x3(const T *p, T *q)
Definition: Locate.h:47
double get_area(typename Face::index_type idx) const
Definition: ImageMesh.h:763
SCIRun::index_type index_type
Definition: ImageMesh.h:92
Face Elem
Definition: ImageMesh.h:281
Definition: ImageMesh.h:162
Core::Geometry::Vector normal_
Definition: ImageMesh.h:948
virtual bool synchronize(mask_type sync)
Definition: ImageMesh.h:1047
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
void io(Piostream &stream)
Persistent I/O.
Definition: Mesh.cc:387
SCIRun::index_type under_type
Definition: ImageMesh.h:91
void get_normal(Core::Geometry::Vector &, const typename Node::index_type &) const
Definition: ImageMesh.h:774
Definition: ImageMesh.h:267
virtual int topology_geometry() const
Definition: ImageMesh.h:828
INodeIndex()
Definition: ImageMesh.h:138
void get_elems(typename Elem::array_type &result, typename Node::index_type idx) const
get the parent element(s) of the given index
Definition: ImageMesh.h:1278
double det_jacobian(const VECTOR &coords, typename Elem::index_type idx) const
Definition: ImageMesh.h:546
void get_elems(typename Elem::array_type &, typename Face::index_type) const
Definition: ImageMesh.h:724
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, typename Elem::index_type &elem, const Core::Geometry::Point &p) const
Definition: ImageMesh.h:878
void Pio_size(Piostream &stream, Size &size)
Definition: Persistent.h:273
void get_normal(Core::Geometry::Vector &result, std::vector< double > &coords, typename Elem::index_type eidx, index_type)
Definition: ImageMesh.h:776
void z(double)
Definition: Vector.h:195
boost::shared_ptr< MeshFacade< VMesh > > MeshFacadeHandle
Definition: MeshTraits.h:61
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: ImageMesh.h:845
Definition: ImageMesh.h:260
void to_index(typename Cell::index_type &, index_type) const
Definition: ImageMesh.h:702
index_type edge0_index() const
Definition: ImageMesh.h:324
IFaceIter & operator++()
Definition: ImageMesh.h:199
ImageMesh(ImageMesh *mh, size_type mx, size_type my, size_type x, size_type y)
Definition: ImageMesh.h:391
const INodeIndex & operator*() const
Definition: ImageMesh.h:168
virtual bool is_editable() const
Definition: ImageMesh.h:438
void jacobian(const VECTOR &coords, typename Elem::index_type idx, double *J) const
Definition: ImageMesh.h:562
double scaled_jacobian_metric(typename Elem::index_type) const
Definition: ImageMesh.h:636
double det_inverse_jacobian_
Definition: ImageMesh.h:962
ImageSize(index_type i, index_type j)
Definition: ImageMesh.h:224
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
bool elem_locate(INDEX &elem, MESH &msh, const Core::Geometry::Point &p)
General case locate, search each elem.
Definition: Mesh.h:188