29 #ifndef CORE_DATATYPES_CURVEMESH_H
30 #define CORE_DATATYPES_CURVEMESH_H 1
72 #if (SCIRUN_CURVE_SUPPORT > 0)
76 #if (SCIRUN_QUADRATIC_SUPPORT > 0)
79 #if (SCIRUN_CUBIC_SUPPORT > 0)
89 template <
class Basis>
90 class CurveMesh :
public Mesh
172 return mesh_.edges_[2*index_];
176 return mesh_.edges_[2*index_+1];
181 return mesh_.points_[mesh_.edges_[2*index_]];
185 return mesh_.points_[mesh_.edges_[2*index_+1]];
214 return boost::make_shared<Core::Datatypes::VirtualMeshFacade<VMesh>>(
vmesh_);
289 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
291 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
297 { array.
resize(1); array[0]= idx; }
303 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
306 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
313 { array.resize(1); array[0]= idx; }
316 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
319 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
323 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
326 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
329 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
332 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
336 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
339 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
342 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
345 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
352 { array.resize(1); array[0]= idx; }
355 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
358 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
362 { array.
resize(1); array[0]= idx; }
368 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
371 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
377 template<
class VECTOR>
380 unsigned int which_edge,
381 unsigned int div_per_unit)
const
384 basis_.approx_edge(which_edge, div_per_unit, coords);
389 template<
class VECTOR>
395 ASSERTFAIL(
"CurveMesh: cannot approximate faces");
403 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
405 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
414 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
416 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
422 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
424 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
462 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
464 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
473 {
ASSERTFAIL(
"This mesh type does not have faces use \"elem\"."); }
475 {
ASSERTFAIL(
"This mesh type does not have cells use \"elem\"."); }
486 {
ASSERTFAIL(
"CurveMesh: This mesh type does not have node normals."); }
488 template<
class VECTOR,
class INDEX1,
class INDEX2>
490 {
ASSERTFAIL(
"CurveMesh: This mesh type does not have element normals."); }
510 template <
class ARRAY>
513 ASSERTMSG(a.size() == 2,
"Tried to add non-line element.");
514 edges_.push_back(static_cast<typename Node::index_type>(a[0]));
515 edges_.push_back(static_cast<typename Node::index_type>(a[1]));
529 template<
class VECTOR,
class INDEX>
533 return basis_.get_coords(coords, p, ed);
538 template<
class VECTOR,
class INDEX>
542 pt =
basis_.interpolate(coords, ed);
548 template<
class VECTOR1,
class INDEX,
class VECTOR2>
549 void derivate(
const VECTOR1 &coords, INDEX idx, VECTOR2 &J)
const
552 basis_.derivate(coords, ed, J);
557 template<
class VECTOR,
class INDEX>
568 template<
class VECTOR,
class INDEX>
569 void jacobian(
const VECTOR& coords, INDEX idx,
double* J)
const
573 basis_.derivate(coords,ed,Jv);
590 template<
class VECTOR,
class INDEX>
595 basis_.derivate(coords,ed,Jv);
612 template<
class INDEX>
637 if(temp < min_jacobian) min_jacobian = temp;
640 return (min_jacobian);
644 template<
class INDEX>
669 if(temp < min_jacobian) min_jacobian = temp;
672 return (min_jacobian);
676 template <
class INDEX>
685 if (sz == 0)
return (
false);
688 if (idx >= 0 && idx < sz)
693 double mindist = DBL_MAX;
697 double dist = (p-
points_[*ni]).length2();
698 if ( dist < mindist )
701 idx =
static_cast<INDEX
>(*ni);
713 template <
class INDEX>
721 if (sz == 0)
return (
false);
726 if (idx >= 0 && idx < sz)
728 if (
inside2_p(idx,p,alpha))
return (
true);
739 idx =
static_cast<INDEX
>(*ei);
748 template <
class ARRAY>
765 for (;p<array.size();p++)
if (array[p] ==
typename ARRAY::value_type(*ei))
break;
766 if (p == array.size()) array.push_back(
typename ARRAY::value_type(*ei));
771 return (array.size() > 0);
776 template <
class INDEX,
class ARRAY>
784 if (sz == 0)
return (
false);
790 if (idx >= 0 && idx < sz)
792 if (
inside2_p(idx,p,coords[0]))
return (
true);
804 idx =
static_cast<INDEX
>(*ei);
815 template <
class INDEX>
823 template <
class INDEX>
826 double maxdist)
const
828 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
832 if (sz == 0)
return (
false);
837 if (idx >= 0 && idx < sz)
840 dist = (point-r).length2();
853 double mindist = maxdist;
858 dist = (point-r).length2();
860 if ( dist < mindist )
863 idx =
static_cast<INDEX
>(*ni);
867 pdist = sqrt(mindist);
874 if (mindist >= maxdist)
return (
false);
876 pdist = sqrt(mindist);
880 template <
class ARRAY>
884 double maxdist2 = maxdist*maxdist;
891 double dist = (point-
points_[*ni]).length2();
893 if ( dist < maxdist2 )
895 nodes.push_back(static_cast<typename ARRAY::value_type>(*ni));
900 return (nodes.size() > 0);
904 template <
class ARRAY1,
class ARRAY2>
911 double maxdist2 = maxdist*maxdist;
918 double dist = (point-
points_[*ni]).length2();
920 if ( dist < maxdist2 )
922 nodes.push_back(static_cast<typename ARRAY2::value_type>(*ni));
923 distances.push_back(static_cast<typename ARRAY1::value_type>(dist));
928 return (nodes.size() > 0);
932 template <
class INDEX,
class ARRAY>
943 template <
class INDEX,
class ARRAY>
949 double maxdist)
const
951 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
956 if (sz == 0)
return (
false);
962 if (idx >= 0 && idx < sz)
974 double mindist = maxdist;
984 if ( dist < mindist )
988 idx =
static_cast<INDEX
>(*ni);
992 pdist = sqrt(mindist);
999 if (mindist == maxdist)
return (
false);
1001 pdist = sqrt(mindist);
1005 template <
class INDEX>
1016 template<
class ARRAY>
1025 if (sz == 0)
return (
false);
1031 double mindist = DBL_MAX;
1043 elems.push_back(static_cast<typename ARRAY::value_type>(*ni));
1046 else if (dist < mindist)
1048 elems.push_back(static_cast<typename ARRAY::value_type>(*ni));
1053 pdist = sqrt(mindist);
1072 static const std::string
type_name(
int n = -1);
1096 static_cast<index_type>(0),
1097 static_cast<index_type>(
points_.size()));
1099 std::vector<Core::Geometry::Point>::iterator niter;
1109 static_cast<index_type>(0),
1110 static_cast<index_type>(
points_.size()));
1113 static_cast<index_type>(0),
1114 static_cast<index_type>(
points_.size()+1));
1116 std::vector<Core::Geometry::Point>::iterator niter1;
1117 niter1 =
points_.begin() + i1;
1119 std::vector<Core::Geometry::Point>::iterator niter2;
1120 niter2 =
points_.begin() + i2;
1122 points_.erase(niter1, niter2);
1129 static_cast<index_type>(0),
1130 static_cast<index_type>(
edges_.size()>>1));
1132 typename std::vector<index_type>::iterator niter1;
1133 niter1 =
edges_.begin() + 2*i1;
1135 typename std::vector<index_type>::iterator niter2;
1136 niter2 =
edges_.begin() + 2*i1+2;
1138 edges_.erase(niter1, niter2);
1146 static_cast<index_type>(0),
1147 static_cast<index_type>(
edges_.size()>>1));
1150 static_cast<index_type>(0),
1151 static_cast<index_type>((
edges_.size()>>1)+1));
1153 typename std::vector<index_type>::iterator niter1;
1154 niter1 =
edges_.begin() + 2*i1;
1156 typename std::vector<index_type>::iterator niter2;
1157 niter2 =
edges_.begin() + 2*i2;
1159 edges_.erase(niter1, niter2);
1177 template<
class ARRAY,
class INDEX>
1181 array[0] =
static_cast<typename ARRAY::value_type
>(
edges_[2*idx]);
1182 array[1] =
static_cast<typename ARRAY::value_type
>(
edges_[2*idx+1]);
1185 template<
class ARRAY,
class INDEX>
1189 "CurveMesh: Must call synchronize NODE_NEIGHBORS_E on CurveMesh first");
1197 template<
class ARRAY,
class INDEX>
1203 template<
class ARRAY,
class INDEX>
1206 array.resize(1); array[0] =
typename ARRAY::value_type(idx);
1210 template <
class ARRAY,
class INDEX>
1214 edges_[idx * 2 +
n] = static_cast<index_type>(array[
n]);
1217 template <
class INDEX1,
class INDEX2>
1222 "Must call synchronize NODE_NEIGHBORS_E on CurveMesh first");
1235 template <
class ARRAY,
class INDEX>
1240 "Must call synchronize NODE_NEIGHBORS_E on CurveMesh first");
1252 template <
class ARRAY,
class INDEX1,
class INDEX2>
1257 "Must call synchronize NODE_NEIGHBORS_E on CurveMesh first");
1260 if (sz < 1)
return (
false);
1263 array.reserve(sz-1);
1266 if (
node_neighbors_[idx][i] != static_cast<typename ARRAY::value_type>(idx))
1272 template <
class ARRAY,
class INDEX>
1278 "Must call synchronize NODE_NEIGHBORS_E on CurveMesh first");
1286 array.reserve(s1+s2-2);
1337 template<
class Basis>
1339 synchronized_(ALL_ELEMENTS_E),
1340 synchronize_lock_(
"CurveMesh Lock"),
1349 template<
class Basis>
1352 points_(copy.points_),
1353 edges_(copy.edges_),
1354 basis_(copy.basis_),
1355 synchronized_(copy.synchronized_),
1356 synchronize_lock_(
"CurveMesh Lock")
1363 copy.synchronize_lock_.lock();
1371 copy.synchronize_lock_.unlock();
1379 template<
class Basis>
1387 template <
class Basis>
1397 std::string(__FILE__),
1405 template <
class Basis>
1406 const TypeDescription*
1413 template <
class Basis>
1423 std::string(__FILE__),
1431 template <
class Basis>
1441 std::string(__FILE__),
1449 template <
class Basis>
1459 std::string(__FILE__),
1467 template <
class Basis>
1477 std::string(__FILE__),
1486 template <
class Basis>
1493 template <
class Basis>
1505 result.
extend(points_[*ni]);
1512 template <
class Basis>
1522 template <
class Basis>
1534 bbox_.extend(points_[*ni]);
1539 epsilon_ = bbox_.diagonal().length()*1e-8;
1540 epsilon2_ = epsilon_*epsilon_;
1541 epsilon3_ = epsilon_*epsilon_*epsilon_;
1543 synchronize_lock_.lock();
1545 synchronize_lock_.unlock();
1548 template <
class Basis>
1552 auto itr = points_.begin();
1553 auto eitr = points_.end();
1566 basis_.get_node_value(p,i);
1568 basis_.set_node_value(p,i);
1576 template <
class Basis>
1581 std::vector<Core::Geometry::Point> pledge;
1582 std::vector<std::vector<double> > coords;
1584 pwl_approx_edge(coords, idx, 0, 5);
1586 double total = 0.0L;
1587 std::vector<std::vector<double> >::iterator iter = coords.begin();
1588 std::vector<std::vector<double> >::iterator last = coords.begin() + 1;
1589 while (last != coords.end())
1591 std::vector<double> &c0 = *iter++;
1592 std::vector<double> &c1 = *last++;
1595 total += (p1 - p0).length();
1601 template <
class Basis>
1607 std::vector<double> coord(1,0.5L);
1608 result = basis_.interpolate(coord, cmcd);
1612 template <
class Basis>
1622 if (get_coords(coords, p, idx))
1624 basis_.get_weights(coords, w);
1625 return basis_.dofs();
1632 template <
class Basis>
1649 template <
class Basis>
1658 p = p0 + (p1 - p0) * rng();
1662 template <
class Basis>
1666 synchronize_lock_.lock();
1675 compute_node_neighbors();
1680 if( points_.size() )
1681 epsilon_ = get_bounding_box().diagonal().length()*1e-8;
1683 epsilon2_ = epsilon_ * epsilon_;
1688 synchronize_lock_.unlock();
1693 template <
class Basis>
1700 template <
class Basis>
1705 synchronize_lock_.lock();
1708 node_neighbors_.clear();
1709 synchronize_lock_.unlock();
1714 template <
class Basis>
1718 node_neighbors_.clear();
1719 node_neighbors_.resize(points_.size());
1721 size_type num_elems = (edges_.size()>>1);
1722 for (i = 0; i < num_elems; i++)
1724 node_neighbors_[edges_[2*i]].push_back(i);
1725 node_neighbors_[edges_[2*i+1]].push_back(i);
1730 #define CURVE_MESH_VERSION 3
1732 template <
class Basis>
1741 Pio(stream, points_);
1746 std::vector<std::pair<unsigned int,unsigned int> > tmp;
1748 edges_.resize(tmp.size()*2);
1749 for (std::vector<std::pair<unsigned int,unsigned int> >::
size_type j=0;j<tmp.size();j++)
1751 edges_[2*j] = tmp[j].first;
1752 edges_[2*j+1] = tmp[j].second;
1770 template <
class Basis>
1774 ASSERT((n >= -1) && n <= 1);
1782 static const std::string nm(
"CurveMesh");
1792 template <
class Basis>
1800 template <
class Basis>
1804 itr =
static_cast<index_type>(points_.size());
1808 template <
class Basis>
1816 template <
class Basis>
1820 itr =
static_cast<index_type>(edges_.size()>>1);
1824 template <
class Basis>
1832 template <
class Basis>
1840 template <
class Basis>
1848 template <
class Basis>
1856 template <
class Basis>
1860 s =
static_cast<size_type>(points_.size());
1864 template <
class Basis>
1868 s =
static_cast<size_type>(edges_.size()>>1);
1872 template <
class Basis>
1880 template <
class Basis>
1888 template <
class Basis>
1900 if (alpha < 0.0) { point = p0; alpha = 0.0; }
1901 else if (alpha > 1.0) { point = p1; alpha = 1.0; }
1902 else { point = (alpha*p1 + (1.0-alpha)*p0).asPoint(); }
1904 if ((point - p).length2() < epsilon2_)
return (
true);
1910 template <
class Basis>
1922 if (alpha < 0.0) { result = p0; alpha = 0.0;}
1923 else if (alpha > 1.0) { result = p1; alpha = 1.0; }
1924 else { result = (alpha*p1 + (1.0-alpha)*p0).asPoint(); }
1926 double dist = (result - p).length2();
void get_nodes(typename Node::array_type &array, typename Node::index_type idx) const
Get the child elements of the given index.
Definition: CurveMesh.h:295
void get_delems(typename DElem::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:369
static const TypeDescription * node_type_description()
Definition: CurveMesh.h:1415
virtual const TypeDescription * get_type_description() const
Definition: CurveMesh.h:1407
Interface to statically allocated std::vector class.
Definition: VUnstructuredMesh.h:41
void get_delems(typename DElem::array_type &array, typename Node::index_type idx) const
Definition: CurveMesh.h:360
void get_nodes_from_edge(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1178
void jacobian(const VECTOR &coords, INDEX idx, double *J) const
Definition: CurveMesh.h:569
static const TypeDescription * cell_type_description()
Definition: CurveMesh.h:1469
void get_normal(Core::Geometry::Vector &, VECTOR &, INDEX1, INDEX2) const
Definition: CurveMesh.h:489
bool reading() const
Definition: Persistent.h:164
Distinct type for node FieldIterator.
Definition: FieldIterator.h:89
#define CURVE_MESH_VERSION
Definition: CurveMesh.h:1730
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, INDEX idx) const
Definition: CurveMesh.h:539
void get_edges(typename Edge::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:314
Definition: FieldRNG.h:37
bool locate(typename Face::index_type &, const Core::Geometry::Point &) const
Definition: CurveMesh.h:461
std::string get_name(const std::string &type_sep_start="<", const std::string &type_sep_end="> ") const
Definition: TypeDescription.cc:135
Distinct type for face Iterator.
Definition: FieldIterator.h:121
CellIterator< under_type > iterator
Definition: CurveMesh.h:137
void get_normal(Core::Geometry::Vector &, typename Node::index_type) const
Normals for visualizations.
Definition: CurveMesh.h:485
int intersect(const BBox &b) const
Definition: BBox.h:213
void get_elem_neighbors(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1274
Edge Elem
Definition: CurveMesh.h:145
void get_delems(typename DElem::array_type &array, typename Edge::index_type idx) const
Definition: CurveMesh.h:363
void get_nodes_from_elem(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1198
virtual bool has_normals() const
Has this mesh normals.
Definition: CurveMesh.h:251
friend class VCurveMesh
Make sure the virtual interface has access.
Definition: CurveMesh.h:94
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &idx, const Core::Geometry::Point &p) const
Find the closest element to a point.
Definition: CurveMesh.h:933
#define ASSERTMSG(condition, message)
Definition: Exception.h:113
SCIRun::mask_type mask_type
Definition: CurveMesh.h:104
void to_index(typename Node::index_type &index, index_type i) const
Definition: CurveMesh.h:284
void get_cells(typename Cell::array_type &, typename Edge::index_type) const
Definition: CurveMesh.h:337
virtual bool synchronize(mask_type sync)
Definition: CurveMesh.h:1664
double get_size(typename Cell::index_type) const
Definition: CurveMesh.h:415
std::vector< std::vector< typename Edge::index_type > > NodeNeighborMap
Definition: CurveMesh.h:1323
Index and Iterator types required for Mesh Concept.
Definition: CurveMesh.h:110
bool get_elem_neighbor(INDEX1 &neighbor, INDEX1 edge, INDEX2 node) const
Definition: CurveMesh.h:1219
Definition: Persistent.h:89
void get_nodes(typename Node::array_type &array, typename Edge::index_type idx) const
Definition: CurveMesh.h:298
void get_delems(typename DElem::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:366
FaceIterator< under_type > iterator
Definition: CurveMesh.h:128
static const TypeDescription * elem_type_description()
Definition: CurveMesh.h:1082
void get_random_point(Core::Geometry::Point &p, typename Elem::index_type i, FieldRNG &r) const
Definition: CurveMesh.h:1651
double inverse_jacobian(const VECTOR &coords, INDEX idx, double *Ji) const
Definition: CurveMesh.h:591
void to_index(typename Edge::index_type &index, index_type i) const
Definition: CurveMesh.h:286
static Persistent * maker()
This function returns a maker for Pio.
Definition: CurveMesh.h:1086
void get_faces(typename Face::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:327
Definition: CurveMesh.h:126
double epsilon2_
Definition: CurveMesh.h:1327
void get_center(Core::Geometry::Point &result, typename Node::index_type idx) const
get the center point (in object space) of an element
Definition: CurveMesh.h:399
SCIRun::index_type index_type
Definition: CurveMesh.h:102
void set_point(const Core::Geometry::Point &point, typename Node::index_type index)
Definition: CurveMesh.h:480
void get_neighbors(std::vector< typename Elem::index_type > &array, typename Elem::index_type idx) const
Definition: CurveMesh.h:450
Definition: Persistent.h:187
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
void get_faces(typename Face::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:330
static const TypeDescription * edge_type_description()
Definition: CurveMesh.h:1433
Definition: CurveMesh.h:160
Definition: TypeDescription.h:50
T Dot(const ColumnMatrixGeneric< T > &a, const ColumnMatrixGeneric< T > &b)
Definition: ColumnMatrixFunctions.h:155
bool locate(typename Cell::index_type &, const Core::Geometry::Point &) const
Definition: CurveMesh.h:463
void end(typename Node::iterator &) const
CellIndex< under_type > size_type
Definition: CurveMesh.h:138
double get_length(typename Edge::index_type idx) const
More specific names for get_size.
Definition: CurveMesh.h:419
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, INDEX idx) const
Definition: CurveMesh.h:530
Node::index_type add_point(const Core::Geometry::Point &point)
Definition: CurveMesh.h:499
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
std::vector< index_type > array_type
Definition: CurveMesh.h:139
void get_nodes(typename Node::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:301
void node_reserve(size_type s)
Definition: CurveMesh.h:521
bool locate(typename Node::index_type &i, const Core::Geometry::Point &p) const
Locate a point in a mesh, find which is the closest node.
Definition: CurveMesh.h:457
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
Distinct type for cell Iterator.
Definition: FieldIterator.h:134
const Core::Geometry::Point & node1() const
Definition: CurveMesh.h:184
double det_jacobian(const VECTOR &coords, INDEX idx) const
Definition: CurveMesh.h:558
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &idx, const Core::Geometry::Point &point, double maxdist) const
Find the closest element to a point.
Definition: CurveMesh.h:824
unsigned int mask_type
Definition: Types.h:45
double get_area(typename Face::index_type) const
Definition: CurveMesh.h:421
index_type edge0_index() const
Definition: CurveMesh.h:189
bool locate_node(INDEX &idx, const Core::Geometry::Point &p) const
Definition: CurveMesh.h:677
void set_nodes_by_elem(ARRAY &array, INDEX idx)
Definition: CurveMesh.h:1211
Edge::index_type delete_edges(typename Edge::index_type i1, typename Edge::index_type i2)
Definition: CurveMesh.h:1142
bool inside2_p(index_type idx, const Core::Geometry::Point &p, double &coord) const
Definition: CurveMesh.h:1890
Point & asPoint() const
Definition: Vector.h:457
std::vector< index_type > array_type
Definition: CurveMesh.h:121
Core::Geometry::BBox bbox_
Definition: CurveMesh.h:1325
#define ASSERT(condition)
Definition: Assert.h:110
virtual bool is_editable() const
Check whether mesh can be altered by adding nodes or elements.
Definition: CurveMesh.h:248
void get_elems(typename Elem::array_type &array, typename Edge::index_type idx) const
Definition: CurveMesh.h:350
void get_edges(typename Edge::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:317
EdgeIndex< under_type > index_type
Definition: CurveMesh.h:118
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
NodeIndex< under_type > index_type
Definition: CurveMesh.h:111
int get_weights(const Core::Geometry::Point &, typename Face::array_type &, double *)
Definition: CurveMesh.h:472
void to_index(typename Face::index_type &, index_type) const
Definition: CurveMesh.h:288
Definition: CurveMesh.h:135
void get_node_neighbors(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1237
StackVector< index_type, 2 > array_type
Definition: CurveMesh.h:114
void begin(typename Node::iterator &) const
begin/end iterators
CurveMesh()
Definition: CurveMesh.h:1338
MeshFacadeHandle getFacade() const
Definition: CurveMesh.h:212
Definition: CurveMesh.h:117
double DetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:120
const string find_type_name(float *)
Definition: TypeName.cc:63
double distance2_p(index_type idx, const Core::Geometry::Point &p, Core::Geometry::Point &projection, double &coord) const
Definition: CurveMesh.h:1912
double length2() const
Definition: Vector.h:248
void get_faces(typename Face::array_type &, typename Node::index_type) const
Definition: CurveMesh.h:321
boost::shared_ptr< VMesh > vmesh_
Definition: CurveMesh.h:1333
bool find_closest_nodes(ARRAY1 &distances, ARRAY2 &nodes, const Core::Geometry::Point &point, double maxdist) const
Definition: CurveMesh.h:905
T DetMatrix3x3(const T *p)
Definition: Locate.h:95
bool get_elem_neighbors(ARRAY &array, INDEX1, INDEX2 idx) const
Definition: CurveMesh.h:1254
virtual int dimensionality() const
Topological dimension.
Definition: CurveMesh.h:227
Edge::index_type add_edge(typename Node::index_type i1, typename Node::index_type i2)
Definition: CurveMesh.h:502
void get_nodes(typename Node::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:304
std::vector< Core::Geometry::Point > points_
Vector with the node locations.
Definition: CurveMesh.h:1309
Definition: VMeshShared.h:40
virtual void get_canonical_transform(Core::Geometry::Transform &t) const
Definition: CurveMesh.h:1514
bool find_closest_elems(double &pdist, Core::Geometry::Point &result, ARRAY &elems, const Core::Geometry::Point &p) const
Find the closest elements to a point.
Definition: CurveMesh.h:1017
double get_volume(typename Cell::index_type) const
Definition: CurveMesh.h:423
const char * name[]
Definition: BoostGraphExampleTests.cc:87
std::pair< typename Node::index_type, typename Node::index_type > index_pair_type
Definition: CurveMesh.h:151
virtual CurveMesh * clone() const
Definition: CurveMesh.h:210
void Pio_index(Piostream &stream, index_type *data, size_type size)
Definition: Persistent.cc:606
virtual void compute_bounding_box()
Definition: CurveMesh.h:1524
long long size_type
Definition: Types.h:40
Definition: StackVector.h:50
void get_elems(typename Elem::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:353
#define CHECKARRAYBOUNDS(value, lower, upper)
Definition: Assert.h:90
CellIndex< under_type > index_type
Definition: CurveMesh.h:136
double ScaledDetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:132
SCISHARE void find_orthogonal(Vector &, Vector &) const
Definition: Vector.cc:59
index_type node0_index() const
Definition: CurveMesh.h:171
void get_faces(typename Face::array_type &, typename Edge::index_type) const
Definition: CurveMesh.h:324
void get_center(Core::Geometry::Point &, typename Face::index_type) const
Definition: CurveMesh.h:402
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: CurveMesh.h:1734
Vector diagonal() const
Definition: BBox.h:198
bool locate_elem(INDEX &idx, ARRAY &coords, const Core::Geometry::Point &p) const
Definition: CurveMesh.h:777
Declarations for virtual interface.
Definition: CurveMesh.h:64
int get_weights(const Core::Geometry::Point &, typename Cell::array_type &, double *)
Definition: CurveMesh.h:474
Persistent i/o for STL containers.
virtual int basis_order()
Definition: CurveMesh.h:224
void pwl_approx_edge(VECTOR &coords, typename Elem::index_type, unsigned int which_edge, unsigned int div_per_unit) const
Definition: CurveMesh.h:378
std::string type
Definition: Persistent.h:72
VMesh * CreateVCurveMesh(MESH *)
Definition: CurveMesh.h:70
virtual Core::Geometry::BBox get_bounding_box() const
Get the bounding box of the field.
Definition: CurveMesh.h:1495
SCIRun::index_type under_type
Definition: CurveMesh.h:101
Point min() const
Definition: BBox.h:192
Distinct type for face index.
Definition: FieldIndex.h:90
void get_edges(typename Edge::array_type &array, typename Edge::index_type idx) const
Definition: CurveMesh.h:311
const Core::Geometry::Point & node0() const
Definition: CurveMesh.h:180
double jacobian_metric(INDEX idx) const
Definition: CurveMesh.h:645
void get_cells(typename Cell::array_type &, typename Face::index_type) const
Definition: CurveMesh.h:340
void resize_elems(size_type s)
Definition: CurveMesh.h:524
void x(double)
Definition: Vector.h:175
void derivate(const VECTOR1 &coords, INDEX idx, VECTOR2 &J) const
Definition: CurveMesh.h:549
Node::index_type delete_nodes(typename Node::index_type i1, typename Node::index_type i2)
Definition: CurveMesh.h:1105
void get_cells(typename Cell::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:343
bool locate_elem(INDEX &idx, const Core::Geometry::Point &p) const
Definition: CurveMesh.h:714
double scaled_jacobian_metric(INDEX idx) const
Definition: CurveMesh.h:613
index_type node1_index() const
Definition: CurveMesh.h:175
virtual ~CurveMesh()
Definition: CurveMesh.h:1380
bool locate(typename Edge::index_type &i, const Core::Geometry::Point &p) const
Definition: CurveMesh.h:459
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, INDEX &elem, const Core::Geometry::Point &p) const
Definition: CurveMesh.h:1006
v
Definition: readAllFields.py:42
NodeNeighborMap node_neighbors_
Definition: CurveMesh.h:1324
ElemData(const CurveMesh< Basis > &msh, const index_type idx)
Definition: CurveMesh.h:165
bool locate_elems(ARRAY &array, const Core::Geometry::BBox &b) const
Definition: CurveMesh.h:749
double get_epsilon() const
Definition: CurveMesh.h:1057
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &idx, const Core::Geometry::Point &p, double maxdist) const
Find the closest element to a point.
Definition: CurveMesh.h:944
Core::Thread::Mutex synchronize_lock_
Lock to synchronize between threads.
Definition: CurveMesh.h:1318
void get_elems(typename Elem::array_type &array, typename Node::index_type idx) const
Definition: CurveMesh.h:347
void elem_reserve(size_type s)
Definition: CurveMesh.h:522
virtual std::string dynamic_type_name() const
Definition: CurveMesh.h:1073
void y(double)
Definition: Vector.h:185
Basis basis_
The basis function, contains additional information on elements.
Definition: CurveMesh.h:1313
bool clear_synchronization()
Definition: CurveMesh.h:1702
void get_edges_from_node(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1186
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
#define ASSERTFAIL(string)
Definition: Assert.h:52
NodeIterator< under_type > iterator
Definition: CurveMesh.h:112
static PersistentTypeID curvemesh_typeid
Add an entry into the database for Pio.
Definition: CurveMesh.h:1069
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
Some convenient simple iterators for fields.
void compute_node_neighbors()
Compute the inverse route of connectivity: from node to edge.
Definition: CurveMesh.h:1716
double get_size(typename Face::index_type) const
Definition: CurveMesh.h:413
bool find_closest_nodes(ARRAY &nodes, const Core::Geometry::Point &point, double maxdist) const
Definition: CurveMesh.h:881
double get_size(typename Node::index_type) const
Get the size of an element (length, area, volume)
Definition: CurveMesh.h:410
Edge::index_type delete_edge(typename Edge::index_type i1)
Definition: CurveMesh.h:1126
std::vector< index_type > edges_
Vector with connectivity data.
Definition: CurveMesh.h:1311
virtual VMesh * vmesh()
Obtain the virtual interface pointer.
Definition: CurveMesh.h:220
virtual void end_class()
Definition: Persistent.cc:178
Node::index_type add_node(const Core::Geometry::Point &p)
use these to build up a new contour mesh
Definition: CurveMesh.h:493
virtual void transform(const Core::Geometry::Transform &t)
Transform a field.
Definition: CurveMesh.h:1550
void size(typename Node::size_type &) const
Get the iteration sizes.
void get_point(Core::Geometry::Point &result, typename Node::index_type idx) const
Access the nodes of the mesh.
Definition: CurveMesh.h:478
long long index_type
Definition: Types.h:39
void resize_nodes(size_type s)
Definition: CurveMesh.h:523
const Core::Geometry::Point & point(typename Node::index_type i) const
Definition: CurveMesh.h:407
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
Basis & get_basis()
Get the basis class.
Definition: CurveMesh.h:260
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: CurveMesh.h:1088
void to_index(typename Cell::index_type &, index_type) const
Definition: CurveMesh.h:290
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &idx, const Core::Geometry::Point &point) const
Find the closest element to a point.
Definition: CurveMesh.h:816
int get_weights(const Core::Geometry::Point &p, typename Node::array_type &l, double *w)
Definition: CurveMesh.h:1614
bool get_neighbor(typename Elem::index_type &neighbor, typename Elem::index_type edge, typename DElem::index_type node) const
Definition: CurveMesh.h:429
Definition: Persistent.h:64
void get_elems(typename Face::array_type &, typename Cell::index_type) const
Definition: CurveMesh.h:356
FaceIndex< under_type > index_type
Definition: CurveMesh.h:127
virtual int topology_geometry() const
Definition: CurveMesh.h:232
CurveMesh< Basis >::index_type index_type
Definition: CurveMesh.h:163
void get_center(Core::Geometry::Point &, typename Cell::index_type) const
Definition: CurveMesh.h:404
static const TypeDescription * face_type_description()
Definition: CurveMesh.h:1451
Distinct type for edge index.
Definition: FieldIndex.h:81
int n
Definition: eab.py:9
Basis basis_type
Definition: CurveMesh.h:107
virtual bool unsynchronize(mask_type sync)
Definition: CurveMesh.h:1695
double epsilon3_
Definition: CurveMesh.h:1328
T InverseMatrix3x3(const T *p, T *q)
Definition: Locate.h:47
void pwl_approx_face(VECTOR &, typename Elem::index_type, typename Face::index_type, unsigned int) const
Definition: CurveMesh.h:390
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: CurveMesh.h:1772
bool get_neighbors(std::vector< typename Elem::index_type > &array, typename Elem::index_type edge, typename DElem::index_type idx) const
Definition: CurveMesh.h:443
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
void io(Piostream &stream)
Persistent I/O.
Definition: Mesh.cc:387
Elem::index_type add_elem(ARRAY a)
Definition: CurveMesh.h:511
std::vector< index_type > array_type
Definition: CurveMesh.h:130
Node DElem
Definition: CurveMesh.h:146
double epsilon_
Definition: CurveMesh.h:1326
FaceIndex< under_type > size_type
Definition: CurveMesh.h:129
void z(double)
Definition: Vector.h:195
SCIRun::size_type size_type
Definition: CurveMesh.h:103
boost::shared_ptr< CurveMesh< Basis > > handle_type
Definition: CurveMesh.h:106
void get_neighbors(std::vector< typename Node::index_type > &array, typename Node::index_type idx) const
These are more general neighbor functions.
Definition: CurveMesh.h:437
boost::shared_ptr< MeshFacade< VMesh > > MeshFacadeHandle
Definition: MeshTraits.h:61
EdgeIndex< under_type > size_type
Definition: CurveMesh.h:120
void get_edges(typename Edge::array_type &array, typename Node::index_type idx) const
Definition: CurveMesh.h:308
mask_type synchronized_
Record which parts of the mesh are synchronized.
Definition: CurveMesh.h:1316
void get_edges_from_elem(ARRAY &array, INDEX idx) const
Definition: CurveMesh.h:1204
NodeIndex< under_type > size_type
Definition: CurveMesh.h:113
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
void get_cells(typename Cell::array_type &, typename Node::index_type) const
Definition: CurveMesh.h:334
EdgeIterator< under_type > iterator
Definition: CurveMesh.h:119
Node::index_type delete_node(typename Node::index_type i1)
Definition: CurveMesh.h:1093
bool elem_locate(INDEX &elem, MESH &msh, const Core::Geometry::Point &p)
General case locate, search each elem.
Definition: Mesh.h:188