SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StructCurveMesh.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2009 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 ///@details
30 /// A structured curve is a dataset with regular topology but with
31 /// irregular geometry. The line defined may have any shape but can not
32 /// be overlapping or self-intersecting.
33 ///
34 /// The topology of structured curve is represented using a 1D vector with
35 /// the points being stored in an index based array. The ordering of the curve
36 /// is implicity defined based based upon its indexing.
37 ///
38 /// For more information on datatypes see Schroeder, Martin, and Lorensen,
39 /// "The Visualization Toolkit", Prentice Hall, 1998.
40 
41 
42 #ifndef CORE_DATATYPES_STRUCTCURVEMESH_H
43 #define CORE_DATATYPES_STRUCTCURVEMESH_H 1
44 
45 /// Include what kind of support we want to have
46 /// Need to fix this and couple it to sci-defs
48 
50 #include <Core/Thread/Mutex.h>
54 
55 #include <Core/Containers/Array2.h>
57 
59 
60 namespace SCIRun {
61 
62 /// Declarations for virtual interface
63 
64 /// Functions for creating the virtual interface
65 /// Declare the functions that instantiate the virtual interface
66 template <class Basis>
68 
69 /// make sure any other mesh other than the preinstantiate ones
70 /// returns no virtual interface. Altering this behavior will allow
71 /// for dynamically compiling the interface if needed.
72 template<class MESH>
73 VMesh* CreateVStructCurveMesh(MESH* mesh) { return (0); }
74 
75 /// These declarations are needed for a combined dynamic compilation as
76 /// as well as virtual functions solution.
77 /// Declare that these can be found in a library that is already
78 /// precompiled. So dynamic compilation will not instantiate them again.
79 
80 #if (SCIRUN_STRUCTCURVE_SUPPORT > 0)
81 
82 SCISHARE VMesh* CreateVStructCurveMesh(StructCurveMesh<Core::Basis::CrvLinearLgn<Core::Geometry::Point> >* mesh);
83 
84 #endif
85 
86 
87 template <class Basis>
88 class StructCurveMesh : public ScanlineMesh<Basis>
89 {
90 
91 /// Make sure the virtual interface has access
92 template <class MESH> friend class VStructCurveMesh;
93 
94 public:
95  /// Types that change depending on 32 or 64bits
100 
101  StructCurveMesh();
102  explicit StructCurveMesh(size_type n);
103  StructCurveMesh(const StructCurveMesh &copy);
104  virtual StructCurveMesh *clone() const { return new StructCurveMesh(*this); }
105  virtual ~StructCurveMesh()
106  {
107  DEBUG_DESTRUCTOR("StructCurveMesh")
108  }
109 
110  /// get the mesh statistics
111  double get_cord_length() const;
112  virtual Core::Geometry::BBox get_bounding_box() const;
113  virtual void transform(const Core::Geometry::Transform &t);
114 
115  virtual bool get_dim(std::vector<size_type>&) const;
116  virtual void set_dim(std::vector<size_type> dims) {
117  ScanlineMesh<Basis>::ni_ = dims[0];
118 
119  points_.resize(dims[0]);
120 
121  /// Create a new virtual interface for this copy
122  /// all pointers have changed hence create a new
123  /// virtual interface class
125  }
126 
127  virtual int topology_geometry() const
128  {
130  }
131 
132  /// get the child elements of the given index
136  typename ScanlineMesh<Basis>::Face::index_type) const {}
138  typename ScanlineMesh<Basis>::Cell::index_type) const {}
140  typename ScanlineMesh<Basis>::Face::index_type) const {}
142  typename ScanlineMesh<Basis>::Cell::index_type) const {}
144  typename ScanlineMesh<Basis>::Edge::index_type idx) const
145  { a.push_back(idx);}
146 
147  /// Get the size of an elemnt (length, area, volume)
149  { return 0.0; }
151  {
153  get_nodes(arr, idx);
154  Core::Geometry::Point p0, p1;
155  get_center(p0, arr[0]);
156  get_center(p1, arr[1]);
157  return Core::Geometry::Vector(p1 - p0).length();
158  }
159 
161  { return 0.0; }
163  { return 0.0; }
165  { return get_size(idx); }
167  { return get_size(idx); }
169  { return get_size(idx); }
170 
172  { return (idx == 0 || idx == static_cast<index_type>((points_.size()-1)) ? 1 : 2); }
173 
175  { return 0; }
177  { return 0; }
179  { return 0; }
180 
181  /// get the center point (in object space) of an element
183  const typename ScanlineMesh<Basis>::Node::index_type&) const;
185  const typename ScanlineMesh<Basis>::Edge::index_type&) const;
187  const typename ScanlineMesh<Basis>::Face::index_type&) const
188  {}
190  const typename ScanlineMesh<Basis>::Cell::index_type&) const
191  {}
192 
194  const Core::Geometry::Point &point) const
195  { return(locate_node(idx,point)); }
197  const Core::Geometry::Point &point) const
198  { return(locate_elem(idx,point)); }
200  const Core::Geometry::Point&) const
201  { return (false); }
203  const Core::Geometry::Point&) const
204  { return (false); }
205 
207  std::vector<double>& coords,
208  const Core::Geometry::Point& point )
209  { return(locate_elem(idx,coords,point)); }
210 
212  typename ScanlineMesh<Basis>::Node::array_type &, double *w);
214  typename ScanlineMesh<Basis>::Edge::array_type &, double *w);
216  typename ScanlineMesh<Basis>::Face::array_type &, double *)
217  {ASSERTFAIL("StructCurveMesh::get_weights for faces isn't supported"); }
219  typename ScanlineMesh<Basis>::Cell::array_type &, double *)
220  {ASSERTFAIL("StructCurveMesh::get_weights for cells isn't supported"); }
221 
223  { get_center(p,i); }
225  { points_[i] = p; }
226 
228  const typename ScanlineMesh<Basis>::Elem::index_type idx,
229  FieldRNG &rng) const;
230 
233  { ASSERTFAIL("This mesh type does not have node normals."); }
234 
235  void get_normal(Core::Geometry::Vector &, std::vector<double> &,
237  unsigned int)
238  { ASSERTFAIL("This mesh type does not have element normals."); }
239 
240  class ElemData
241  {
242  public:
244 
246  const typename ScanlineMesh<Basis>::Elem::index_type ind) :
247  mesh_(msh),
248  index_(ind)
249  {}
250 
251  /// the following designed to coordinate with ::get_nodes
252  inline
254  {
255  return (index_);
256  }
257  inline
259  {
260  return (index_ + 1);
261  }
262 
263 
264  /// the following designed to coordinate with ::get_edges
265  inline
267  {
268  return index_;
269  }
270 
271  inline
272  const Core::Geometry::Point &node0() const
273  {
274  return mesh_.points_[index_];
275  }
276  inline
277  const Core::Geometry::Point &node1() const
278  {
279  return mesh_.points_[index_+1];
280  }
281 
282  private:
283  const StructCurveMesh<Basis> &mesh_;
284  const typename ScanlineMesh<Basis>::Elem::index_type index_;
285  };
286 
287  friend class ElemData;
288 
289  /// Generate the list of points that make up a sufficiently accurate
290  /// piecewise linear approximation of an edge.
291  void pwl_approx_edge(std::vector<std::vector<double> > &coords,
293  unsigned int,
294  unsigned int div_per_unit) const
295  {
296  /// Needs to match unit_edges in Basis/QuadBilinearLgn.cc
297  /// compare get_nodes order to the basis order
298  this->basis_.approx_edge(0, div_per_unit, coords);
299  }
300 
301  /// Generate the list of points that make up a sufficiently accurate
302  /// piecewise linear approximation of an face.
303  void pwl_approx_face(std::vector<std::vector<std::vector<double> > >& /*coords*/,
306  unsigned int /*div_per_unit*/) const
307  {
308  ASSERTFAIL("ScanlineMesh has no faces");
309  }
310 
311 
312  /// Get the local coordinates for a certain point within an element
313  /// This function uses a couple of newton iterations to find the
314  /// local ! coordinate of a point
315  template<class VECTOR, class INDEX>
316  bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, INDEX idx) const
317  {
318  ElemData ed(*this, typename ScanlineMesh<Basis>::Elem::index_type(idx));
319  return this->basis_.get_coords(coords, p, ed);
320  }
321 
322  /// Find the location in the global coordinate system for a local
323  /// coordinate ! This function is the opposite of get_coords.
324  template<class VECTOR, class INDEX>
325  void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, INDEX idx) const
326  {
327  ElemData ed(*this, idx);
328  pt = this->basis_.interpolate(coords, ed);
329  }
330 
331  /// Interpolate the derivate of the function, This infact will
332  /// return the ! jacobian of the local to global coordinate
333  /// transformation. This function ! is mainly intended for the non
334  /// linear elements
335  template<class VECTOR1, class VECTOR2>
336  void derivate(const VECTOR1 &coords,
338  VECTOR2 &J) const
339  {
340  ElemData ed(*this, idx);
341  this->basis_.derivate(coords, ed, J);
342  }
343 
344  /// Get the determinant of the jacobian, which is the local volume
345  /// of an element ! and is intended to help with the integration of
346  /// functions over an element.
347  template<class VECTOR>
348  double det_jacobian(const VECTOR& coords,
349  typename ScanlineMesh<Basis>::Elem::index_type idx) const
350  {
351  double J[9];
352  jacobian(coords,idx,J);
353  return (DetMatrix3x3(J));
354  }
355 
356  /// Get the jacobian of the transformation. In case one wants the
357  /// non inverted ! version of this matrix. This is currentl here for
358  /// completeness of the ! interface
359  template<class VECTOR>
360  void jacobian(const VECTOR& coords,
362  double* J) const
363  {
365  ElemData ed(*this,idx);
366  this->basis_.derivate(coords,ed,Jv);
367  Core::Geometry::Vector Jv1, Jv2;
368  Core::Geometry::Vector(Jv[0]).find_orthogonal(Jv1,Jv2);
369  J[0] = Jv[0].x();
370  J[1] = Jv[0].y();
371  J[2] = Jv[0].z();
372  J[3] = Jv1.x();
373  J[4] = Jv1.y();
374  J[5] = Jv1.z();
375  J[6] = Jv2.x();
376  J[7] = Jv2.y();
377  J[8] = Jv2.z();
378  }
379 
380  /// Get the inverse jacobian of the transformation. This one is
381  /// needed to ! translate local gradients into global gradients. Hence
382  /// it is crucial for ! calculating gradients of fields, or
383  /// constructing finite elements.
384  template<class VECTOR>
385  double inverse_jacobian(const VECTOR& coords,
387  double* Ji) const
388  {
390  ElemData ed(*this,idx);
391  this->basis_.derivate(coords,ed,Jv);
392  double J[9];
393  Core::Geometry::Vector Jv1, Jv2;
394  Core::Geometry::Vector(Jv[0]).find_orthogonal(Jv1,Jv2);
395  J[0] = Jv[0].x();
396  J[1] = Jv[0].y();
397  J[2] = Jv[0].z();
398  J[3] = Jv1.x();
399  J[4] = Jv1.y();
400  J[5] = Jv1.z();
401  J[6] = Jv2.x();
402  J[7] = Jv2.y();
403  J[8] = Jv2.z();
404 
405  return (InverseMatrix3x3(J,Ji));
406  }
407 
408  template<class INDEX>
409  double scaled_jacobian_metric(INDEX idx) const
410  {
412  ElemData ed(*this,idx);
413 
414  double temp;
415 
416  this->basis_.derivate(this->basis_.unit_center,ed,Jv);
417  Jv.resize(3);
420  Jv[1] = v.asPoint();
421  Jv[2] = w.asPoint();
422  double min_jacobian = ScaledDetMatrix3P(Jv);
423 
424  size_t num_vertices = this->basis_.number_of_vertices();
425  for (size_t j=0;j < num_vertices;j++)
426  {
427  this->basis_.derivate(this->basis_.unit_vertices[j],ed,Jv);
428  Jv.resize(3);
430  Jv[1] = v.asPoint();
431  Jv[2] = w.asPoint();
432  temp = ScaledDetMatrix3P(Jv);
433  if(temp < min_jacobian) min_jacobian = temp;
434  }
435 
436  return (min_jacobian);
437  }
438 
439 
440  template<class INDEX>
441  double jacobian_metric(INDEX idx) const
442  {
444  ElemData ed(*this,idx);
445 
446  double temp;
447 
448  this->basis_.derivate(this->basis_.unit_center,ed,Jv);
449  Jv.resize(3);
452  Jv[1] = v.asPoint();
453  Jv[2] = w.asPoint();
454  double min_jacobian = DetMatrix3P(Jv);
455 
456  size_t num_vertices = this->basis_.number_of_vertices();
457  for (size_t j=0;j < num_vertices;j++)
458  {
459  this->basis_.derivate(this->basis_.unit_vertices[j],ed,Jv);
460  Jv.resize(3);
462  Jv[1] = v.asPoint();
463  Jv[2] = w.asPoint();
464  temp = DetMatrix3P(Jv);
465  if(temp < min_jacobian) min_jacobian = temp;
466  }
467 
468  return (min_jacobian);
469  }
470 
471  template <class INDEX>
472  bool locate_node(INDEX &idx, const Core::Geometry::Point &p) const
473  {
474  /// If there are no nodes, return false, otherwise there will always be
475  /// a node that is closest
476  if (points_.size() == 0) return (false);
477 
478  typename ScanlineMesh<Basis>::Node::iterator ni, nie;
479  this->begin(ni);
480  this->end(nie);
481 
482  double mindist = DBL_MAX;
483 
484  while(ni != nie)
485  {
486  double dist = (p-points_[*ni]).length2();
487  if ( dist < mindist )
488  {
489  mindist = dist;
490  idx = static_cast<INDEX>(*ni);
491 
492  if (mindist < epsilon2_) return (true);
493  }
494  ++ni;
495  }
496 
497  return (true);
498  }
499 
500 
501  template <class INDEX>
502  bool locate_elem(INDEX &idx, const Core::Geometry::Point &p) const
503  {
504  if (this->basis_.polynomial_order() > 1) return elem_locate(idx, *this, p);
505 
507  this->size(sz);
508 
509  /// If there are no elements, one cannot find a point inside
510  if (sz == 0) return (false);
511 
512  double alpha;
513 
514  /// Check whether the estimate given in idx is the point we are looking for
515  if (idx >= 0 && idx < sz)
516  {
517  if (inside2_p(idx,p,alpha)) return (true);
518  }
519 
520  /// Loop over all nodes to find one that finds
522  this->begin(ei);
524  this->end(eie);
525 
526  while (ei != eie)
527  {
528  if (inside2_p(*ei,p,alpha))
529  {
530  idx = static_cast<INDEX>(*ei);
531  return (true);
532  }
533  ++ei;
534  }
535 
536  return (false);
537  }
538 
539  template <class INDEX, class ARRAY>
540  bool locate_elem(INDEX& idx, ARRAY& coords, const Core::Geometry::Point& p) const
541  {
542  if (this->basis_.polynomial_order() > 1) return elem_locate(idx, *this, p);
543 
545  this->size(sz);
546 
547  /// If there are no elements, one cannot find a point inside
548  if (sz == 0) return (false);
549 
550  coords.resize(1);
551  double alpha;
552 
553  /// Check whether the estimate given in idx is the point we are looking for
554  if (idx >= 0 && idx < sz)
555  {
556  if (inside2_p(idx,p,coords[0])) return (true);
557  }
558 
559  /// Loop over all nodes to find one that finds
561  this->begin(ei);
563  this->end(eie);
564 
565  while (ei != eie)
566  {
567  if (inside2_p(*ei,p,alpha))
568  {
569  coords[0] = alpha;
570  idx = static_cast<INDEX>(*ei);
571  return (true);
572  }
573  ++ei;
574  }
575 
576  return (false);
577  }
578 
579 
580  template <class INDEX>
581  bool find_closest_node(double& pdist, Core::Geometry::Point &result,
582  INDEX &idx, const Core::Geometry::Point &point) const
583  {
584  return(find_closest_node(pdist,result,idx,point,-1.0));
585  }
586 
587  /// Find the closest element to a point
588  template <class INDEX>
589  bool find_closest_node(double& pdist, Core::Geometry::Point &result,
590  INDEX &idx, const Core::Geometry::Point &point,
591  double maxdist) const
592  {
593  if (maxdist < 0.0) maxdist = DBL_MAX; else maxdist = maxdist*maxdist;
595  this->size(sz);
596 
597  /// No nodes, so none is closest
598  if (sz == 0) return (false);
599 
601  this->begin(ni);
603  this->end(nie);
604 
606  double dist;
607 
608  /// Check whether first estimate is the one we are looking for
609  if (idx >= 0 && idx < sz)
610  {
611  p2 = points_[*ni];
612  dist = (point-p2).length2();
613 
614  if ( dist < epsilon2_ )
615  {
616  result = point;
617  pdist= sqrt(dist);
618  return (true);
619  }
620  }
621 
622  /// Loop through all nodes to find the one that is closest
623  double mindist = maxdist;
624 
625  while(ni != nie)
626  {
627  p2 = points_[*ni];
628  dist = (point-p2).length2();
629 
630  if ( dist < mindist )
631  {
632  mindist = dist;
633  idx = static_cast<INDEX>(*ni);
634  result = p2;
635  if (mindist < epsilon2_)
636  {
637  pdist = sqrt(mindist);
638  return (true);
639  }
640  }
641  ++ni;
642  }
643 
644  if (maxdist == mindist) return (false);
645 
646  pdist = sqrt(mindist);
647  return (true);
648  }
649 
650 
651  /// Find the closest element to a point
652  template <class INDEX, class ARRAY>
653  bool find_closest_elem(double& pdist,
654  Core::Geometry::Point &result,
655  ARRAY &coords,
656  INDEX &idx,
657  const Core::Geometry::Point &p) const
658  {
659  return find_closest_elem(pdist,result,coords,idx,p,-1.0);
660  }
661 
662  /// Find the closest element to a point
663  template <class INDEX, class ARRAY>
664  bool find_closest_elem(double& pdist,
665  Core::Geometry::Point &result,
666  ARRAY &coords,
667  INDEX &idx,
668  const Core::Geometry::Point &p,
669  double maxdist) const
670  {
671  if (maxdist < 0.0) maxdist = DBL_MAX; else maxdist = maxdist*maxdist;
673  this->size(sz);
674 
675  /// No elements, none that can be closest
676  if (sz == 0) return (false);
677 
679  this->begin(ni);
681  this->end(nie);
682 
684  double dist;
685 
686  coords.resize(1);
687  /// Check whether first guess is OK
688  if (idx >= 0 && idx < sz)
689  {
690  double alpha;
691  dist = distance2_p(idx,p,result,alpha);
692  if ( dist < epsilon2_ )
693  {
694  coords[0] = alpha;
695  pdist = sqrt(dist);
696  return (true);
697  }
698  }
699 
700  /// Loop through all elements to find closest
701  double mindist = maxdist;
703 
704  while(ni != nie)
705  {
706  double alpha;
707  dist = distance2_p(*ni,p,res,alpha);
708  if ( dist < mindist )
709  {
710  coords[0] = alpha;
711  mindist = dist;
712  idx = static_cast<INDEX>(*ni);
713  result = res;
714  if (mindist < epsilon2_)
715  {
716  pdist = sqrt(mindist);
717  return (true);
718  }
719  }
720  ++ni;
721  }
722 
723  if (mindist == maxdist) return (false);
724 
725  pdist = sqrt(mindist);
726  return (true);
727  }
728 
729  template <class INDEX>
730  bool find_closest_elem(double& pdist,
731  Core::Geometry::Point &result,
732  INDEX &elem,
733  const Core::Geometry::Point &p) const
734  {
735  StackVector<double,1> coords;
736  return(find_closest_elem(pdist,result,coords,elem,p,-1.0));
737  }
738 
739  /// Find the closest elements to a point
740  template<class ARRAY>
741  bool find_closest_elems(double& pdist, Core::Geometry::Point &result,
742  ARRAY &elems, const Core::Geometry::Point &p) const
743  {
744  elems.clear();
745 
747  this->size(sz);
748 
749  /// No elements, none that is closest
750  if (sz == 0) return (false);
751 
753  this->begin(ni);
755  this->end(nie);
756 
758 
759  double dist;
760  double mindist = DBL_MAX;
762 
763  while(ni != nie)
764  {
765  double dummy;
766  dist = distance2_p(*ni,p,res,dummy);
767 
768  if (dist < mindist - epsilon2_)
769  {
770  elems.clear();
771  result = res;
772  elems.push_back(static_cast<typename ARRAY::value_type>(*ni));
773  mindist = dist;
774  }
775  else if (dist < mindist)
776  {
777  elems.push_back(static_cast<typename ARRAY::value_type>(*ni));
778  }
779  ++ni;
780  }
781 
782  pdist = sqrt(mindist);
783  return (true);
784  }
785 
786  /// Export this class using the old Pio system
787  virtual void io(Piostream&);
788  /// These IDs are created as soon as this class will be instantiated
789  /// The first one is for Pio and the second for the virtual
790  /// interface ! These are currently different as they serve different
791  /// needs. static PersistentTypeID type_idts;
793  /// Core functionality for getting the name of a templated mesh class
794  static const std::string type_name(int n = -1);
795 
796  /// Type description, used for finding names of the mesh class for
797  /// dynamic compilation purposes. Soem of this should be obsolete
798  virtual const TypeDescription *get_type_description() const;
799 
800  /// This function returns a maker for Pio.
801  static Persistent *maker() { return new StructCurveMesh<Basis>(); }
802  /// This function returns a handle for the virtual interface.
803  static MeshHandle mesh_maker() { return boost::make_shared<StructCurveMesh<Basis>>();}
804  /// This function returns a handle for the virtual interface.
805  static MeshHandle structcurve_maker(size_type x) { return boost::make_shared<StructCurveMesh<Basis>>(x);}
806 
807  std::vector<Core::Geometry::Point>& get_points() { return (points_); }
808 
809  virtual bool synchronize(mask_type sync);
810  virtual bool unsynchronize(mask_type sync);
811  bool clear_synchronization();
812 
813  double get_epsilon() const;
814 
815 private:
816 
817  bool inside2_p(index_type idx, const Core::Geometry::Point &p, double& alpha) const;
818  double distance2_p(index_type idx, const Core::Geometry::Point &p,
819  Core::Geometry::Point& projection, double& alpha) const;
820 
821  void compute_epsilon();
822 
823  std::vector<Core::Geometry::Point> points_;
824  mutable Core::Thread::Mutex synchronize_lock_;
825  mask_type synchronized_;
826  double epsilon_;
827  double epsilon2_;
828 };
829 
830 
831 template <class Basis>
832 PersistentTypeID
833 StructCurveMesh<Basis>::scanline_typeid(StructCurveMesh<Basis>::type_name(-1),
834  "Mesh", maker);
835 
836 
837 template <class Basis>
839  points_(0),
840  synchronize_lock_("Synchronize lock"),
841  synchronized_(Mesh::ALL_ELEMENTS_E),
842  epsilon_(0.0),
843  epsilon2_(0.0)
844 {
845  DEBUG_CONSTRUCTOR("StructCurveMesh")
846 
847  /// Create a new virtual interface for this copy
848  /// all pointers have changed hence create a new
849  /// virtual interface class
850  this->vmesh_.reset(CreateVStructCurveMesh(this));
851 }
852 
853 
854 template <class Basis>
856  : ScanlineMesh<Basis>(n, Core::Geometry::Point(0.0, 0.0, 0.0), Core::Geometry::Point(1.0, 1.0, 1.0)),
857  points_(n),
858  synchronize_lock_("StructCurveMesh lock"),
859  synchronized_(Mesh::EDGES_E | Mesh::NODES_E),
860  epsilon_(0.0),
861  epsilon2_(0.0)
862 {
863  DEBUG_CONSTRUCTOR("StructCurveMesh")
864 
865  /// Create a new virtual interface for this copy
866  /// all pointers have changed hence create a new
867  /// virtual interface class
868  this->vmesh_.reset(CreateVStructCurveMesh(this));
869 }
870 
871 
872 template <class Basis>
874  : ScanlineMesh<Basis>(copy),
875  points_(copy.points_),
876  synchronize_lock_("StructCurveMesh lock"),
877  synchronized_(copy.synchronized_)
878 {
879  DEBUG_CONSTRUCTOR("StructCurveMesh")
880 
881  copy.synchronize_lock_.lock();
882 
883  synchronized_ |= copy.synchronized_ & Mesh::EPSILON_E;
884 
885  // Make sure we got the synchronized version
886  epsilon_ = copy.epsilon_;
887  epsilon2_ = copy.epsilon2_;
888 
889  copy.synchronize_lock_.unlock();
890 
891  /// Create a new virtual interface for this copy
892  /// all pointers have changed hence create a new
893  /// virtual interface class
894  this->vmesh_.reset(CreateVStructCurveMesh(this));
895 }
896 
897 
898 template <class Basis>
899 bool
900 StructCurveMesh<Basis>::get_dim(std::vector<size_type> &array) const
901 {
902  array.resize(1);
903  array.clear();
904 
905  array.push_back(this->ni_);
906 
907  return true;
908 }
909 
910 
911 template <class Basis>
912 double
914 {
915  return(epsilon_);
916 }
917 
918 template <class Basis>
919 void
921 {
922  epsilon_ = get_bounding_box().diagonal().length()*1e-8;
923  epsilon2_ = epsilon_*epsilon_;
924 }
925 
926 template <class Basis>
927 Core::Geometry::BBox
929 {
930  Core::Geometry::BBox result;
931 
933  this->begin(i);
934  this->end(ie);
935 
936  while (i != ie)
937  {
938  result.extend(points_[*i]);
939  ++i;
940  }
941 
942  return result;
943 }
944 
945 
946 template <class Basis>
947 void
949 {
951  this->begin(i);
952  this->end(ie);
953 
954  while (i != ie)
955  {
956  points_[*i] = t.project(points_[*i]);
957 
958  ++i;
959  }
960 }
961 
962 
963 template <class Basis>
964 double
966 {
967  double result = 0.0;
968 
969  typename ScanlineMesh<Basis>::Node::iterator i, i1, ie;
970  this->begin(i);
971  this->begin(i1);
972  this->end(ie);
973 
974  while (i1 != ie)
975  {
976  ++i1;
977  result += (points_[*i] - points_[*i1]).length();
978  ++i;
979  }
980 
981  return result;
982 }
983 
984 
985 template <class Basis>
986 void
988 {
989  array.resize(2);
990  array[0] = typename ScanlineMesh<Basis>::Node::index_type(idx);
991  array[1] = typename ScanlineMesh<Basis>::Node::index_type(idx + 1);
992 }
993 
994 
995 template <class Basis>
996 void
998 {
999  result = points_[idx];
1000 }
1001 
1002 
1003 template <class Basis>
1004 void
1006 {
1007  const Core::Geometry::Point &p0 = points_[typename ScanlineMesh<Basis>::Node::index_type(idx)];
1008  const Core::Geometry::Point &p1 = points_[typename ScanlineMesh<Basis>::Node::index_type(idx+1)];
1009 
1010  result = Core::Geometry::Point(p0+p1)/2.0;
1011 }
1012 
1013 
1014 template <class Basis>
1015 bool
1016 StructCurveMesh<Basis>::inside2_p(index_type i, const Core::Geometry::Point &p, double& alpha) const
1017 {
1018  const Core::Geometry::Point &p0 = points_[i];
1019  const Core::Geometry::Point &p1 = points_[i+1];
1020 
1021  const Core::Geometry::Vector v = p1-p0;
1022  alpha = Dot(p0-p,v)/v.length2();
1023 
1024  Core::Geometry::Point point;
1025  if (alpha < 0.0) { point = p0; alpha = 0.0; }
1026  else if (alpha > 1.0) { point = p1; alpha = 1.0; }
1027  else { point = (alpha*p0 + (1.0-alpha)*p1).asPoint(); }
1028 
1029  if ((point - p).length2() < epsilon2_) return (true);
1030 
1031  return (false);
1032 }
1033 
1034 
1035 template <class Basis>
1036 double
1037 StructCurveMesh<Basis>::distance2_p(index_type i,
1038  const Core::Geometry::Point &p,
1039  Core::Geometry::Point& result,
1040  double& alpha) const
1041 {
1042  const Core::Geometry::Point &p0 = points_[i];
1043  const Core::Geometry::Point &p1 = points_[i+1];
1044 
1045  const Core::Geometry::Vector v = p1-p0;
1046  alpha = Dot(p0-p,v)/v.length2();
1047 
1048  if (alpha < 0.0) { result = p0; alpha = 0.0; }
1049  else if (alpha > 1.0) { result = p1; alpha = 1.0; }
1050  else { result = (alpha*p0 + (1.0-alpha)*p1).asPoint(); }
1051 
1052  double dist = (result - p).length2();
1053  return (sqrt(dist));
1054 }
1055 
1056 
1057 template <class Basis>
1058 int
1061  double *w)
1062 {
1064  if (locate(idx, p))
1065  {
1066  get_nodes(l,idx);
1067  std::vector<double> coords(1);
1068  if (get_coords(coords, p, idx))
1069  {
1070  this->basis_.get_weights(coords, w);
1071  return this->basis_.dofs();
1072  }
1073  }
1074  return 0;
1075 }
1076 
1077 
1078 template <class Basis>
1079 int
1082  double *w)
1083 {
1085  if (locate(idx, p))
1086  {
1087  l.resize(1);
1088  l[0] = idx;
1089  w[0] = 1.0;
1090  return 1;
1091  }
1092  return 0;
1093 }
1094 
1095 
1096 template <class Basis>
1097 void
1099  const typename ScanlineMesh<Basis>::Elem::index_type i,
1100  FieldRNG &rng) const
1101 {
1102  const Core::Geometry::Point &p0 =points_[typename ScanlineMesh<Basis>::Node::index_type(i)];
1103  const Core::Geometry::Point &p1=points_[typename ScanlineMesh<Basis>::Node::index_type(i+1)];
1104 
1105  p = p0 + (p1 - p0) * rng();
1106 }
1107 
1108 
1109 template <class Basis>
1110 bool
1112 {
1113  synchronize_lock_.lock();
1115  !(synchronized_ & Mesh::EPSILON_E))
1116  {
1117  compute_epsilon();
1118  synchronized_ |= Mesh::EPSILON_E;
1119  synchronized_ |= Mesh::LOCATE_E;
1120  }
1121  synchronize_lock_.unlock();
1122  return (true);
1123 }
1124 
1125 template <class Basis>
1126 bool
1128 {
1129  return (true);
1130 }
1131 
1132 
1133 template <class Basis>
1134 bool
1136 {
1137  synchronize_lock_.lock();
1138 
1139  // Undo marking the synchronization
1140  synchronized_ = Mesh::NODES_E | Mesh::ELEMS_E | Mesh::EDGES_E;
1141 
1142  // Free memory where possible
1143 
1144  synchronize_lock_.unlock();
1145 
1146  return (true);
1147 }
1148 
1149 #define STRUCT_CURVE_MESH_VERSION 1
1150 
1151 template <class Basis>
1152 void
1154 {
1155  stream.begin_class(type_name(-1), STRUCT_CURVE_MESH_VERSION);
1156  ScanlineMesh<Basis>::io(stream);
1157 
1158  /// IO data members, in order
1159  Pio(stream, points_);
1160 
1161  stream.end_class();
1162 
1163  if (stream.reading())
1164  this->vmesh_.reset(CreateVStructCurveMesh(this));
1165 }
1166 
1167 
1168 template <class Basis>
1169 const std::string
1171 {
1172  ASSERT((n >= -1) && n <= 1);
1173  if (n == -1)
1174  {
1175  static const std::string name = TypeNameGenerator::make_template_id(type_name(0), type_name(1));
1176  return name;
1177  }
1178  else if (n == 0)
1179  {
1180  static const std::string nm("StructCurveMesh");
1181  return nm;
1182  }
1183  else
1184  {
1185  return find_type_name((Basis *)0);
1186  }
1187 }
1188 
1189 
1190 template <class Basis>
1191 const TypeDescription*
1193 {
1194  static TypeDescription *td = 0;
1195  if (!td)
1196  {
1197  const TypeDescription *sub = get_type_description((Basis*)0);
1199  (*subs)[0] = sub;
1200  td = new TypeDescription("StructCurveMesh", subs,
1201  std::string(__FILE__),
1202  "SCIRun",
1204  }
1205  return td;
1206 }
1207 
1208 
1209 template <class Basis>
1210 const TypeDescription*
1212 {
1214 }
1215 
1216 
1217 } /// namespace SCIRun
1218 
1219 #endif /// SCI_project_StructCurveMesh_h
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: StructCurveMesh.h:1170
VMesh * CreateVStructCurveMesh(MESH *mesh)
Definition: StructCurveMesh.h:73
int get_valence(typename ScanlineMesh< Basis >::Node::index_type idx) const
Definition: StructCurveMesh.h:171
bool reading() const
Definition: Persistent.h:164
Distinct type for node FieldIterator.
Definition: FieldIterator.h:89
void get_normal(Core::Geometry::Vector &, std::vector< double > &, typename ScanlineMesh< Basis >::Elem::index_type, unsigned int)
Definition: StructCurveMesh.h:235
Definition: FieldRNG.h:37
virtual ~StructCurveMesh()
Definition: StructCurveMesh.h:105
virtual const TypeDescription * get_type_description() const
Definition: StructCurveMesh.h:1211
Definition: Mesh.h:85
Vector project(const Vector &p) const
Definition: Transform.cc:425
Definition: Mesh.h:64
void end(typename Node::iterator &) const
Definition: ScanlineMesh.h:1118
void jacobian(const VECTOR &coords, typename ScanlineMesh< Basis >::Elem::index_type idx, double *J) const
Definition: StructCurveMesh.h:360
Definition: Mesh.h:90
bool locate_node(INDEX &idx, const Core::Geometry::Point &p) const
Definition: StructCurveMesh.h:472
Definition: Persistent.h:89
Declarations for virtual interface.
Definition: StructCurveMesh.h:67
int get_valence(typename ScanlineMesh< Basis >::Face::index_type) const
Definition: StructCurveMesh.h:176
SCIRun::mask_type mask_type
Definition: StructCurveMesh.h:99
boost::shared_ptr< VMesh > vmesh_
Definition: ScanlineMesh.h:806
double get_size(typename ScanlineMesh< Basis >::Cell::index_type) const
Definition: StructCurveMesh.h:162
int get_weights(const Core::Geometry::Point &, typename ScanlineMesh< Basis >::Face::array_type &, double *)
Definition: StructCurveMesh.h:215
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: StructCurveMesh.h:1153
double get_area(typename ScanlineMesh< Basis >::Face::index_type idx) const
Definition: StructCurveMesh.h:166
Definition: Persistent.h:187
int get_weights(const Core::Geometry::Point &, typename ScanlineMesh< Basis >::Cell::array_type &, double *)
Definition: StructCurveMesh.h:218
virtual int topology_geometry() const
Definition: StructCurveMesh.h:127
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
SCIRun::size_type size_type
Definition: ScanlineMesh.h:109
Definition: TypeDescription.h:50
T Dot(const ColumnMatrixGeneric< T > &a, const ColumnMatrixGeneric< T > &b)
Definition: ColumnMatrixFunctions.h:155
FieldHandle mesh()
Definition: BuildTDCSMatrixTests.cc:56
void interpolate(Core::Geometry::Point &pt, const VECTOR &coords, INDEX idx) const
Definition: StructCurveMesh.h:325
Definition: Point.h:49
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: ScanlineMesh.h:141
Definition: ScanlineMesh.h:76
NodeIndex< under_type > index_type
Definition: ScanlineMesh.h:117
bool clear_synchronization()
Definition: StructCurveMesh.h:1135
bool locate(typename ScanlineMesh< Basis >::Edge::index_type &idx, const Core::Geometry::Point &point) const
Definition: StructCurveMesh.h:196
void get_center(Core::Geometry::Point &, const typename ScanlineMesh< Basis >::Cell::index_type &) const
Definition: StructCurveMesh.h:189
Definition: Mesh.h:45
Definition: BBox.h:46
double scaled_jacobian_metric(INDEX idx) const
Definition: StructCurveMesh.h:409
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
Definition: Mutex.h:43
Definition: Mesh.h:61
unsigned int mask_type
Definition: Types.h:45
static MeshHandle structcurve_maker(size_type x)
This function returns a handle for the virtual interface.
Definition: StructCurveMesh.h:805
Definition: StructCurveMesh.h:240
Point & asPoint() const
Definition: Vector.h:457
#define ASSERT(condition)
Definition: Assert.h:110
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: StructCurveMesh.h:589
void get_nodes(typename ScanlineMesh< Basis >::Node::array_type &, typename ScanlineMesh< Basis >::Face::index_type) const
Definition: StructCurveMesh.h:135
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: StructCurveMesh.h:664
void get_normal(Core::Geometry::Vector &, typename ScanlineMesh< Basis >::Node::index_type) const
Definition: StructCurveMesh.h:231
const Core::Geometry::Point & node1() const
Definition: StructCurveMesh.h:277
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
bool locate_elem(INDEX &idx, ARRAY &coords, const Core::Geometry::Point &p) const
Definition: StructCurveMesh.h:540
Definition: Vector.h:63
Core::Geometry::Vector diagonal() const
Definition: ScanlineMesh.h:869
index_type node0_index() const
the following designed to coordinate with ::get_nodes
Definition: StructCurveMesh.h:253
double DetMatrix3P(const VectorOfPoints &p)
Inline templated determinant of matrix.
Definition: Locate.h:120
bool locate(typename ScanlineMesh< Basis >::Node::index_type &idx, const Core::Geometry::Point &point) const
Definition: StructCurveMesh.h:193
const string find_type_name(float *)
Definition: TypeName.cc:63
Definition: Mesh.h:72
virtual Core::Geometry::BBox get_bounding_box() const
Definition: StructCurveMesh.h:928
double get_size(typename ScanlineMesh< Basis >::Node::index_type) const
Get the size of an elemnt (length, area, volume)
Definition: StructCurveMesh.h:148
std::vector< Core::Geometry::Point > & get_points()
Definition: StructCurveMesh.h:807
double length2() const
Definition: Vector.h:248
void get_center(Core::Geometry::Point &, const typename ScanlineMesh< Basis >::Face::index_type &) const
Definition: StructCurveMesh.h:186
T DetMatrix3x3(const T *p)
Definition: Locate.h:95
double get_length(typename ScanlineMesh< Basis >::Edge::index_type idx) const
Definition: StructCurveMesh.h:164
Definition: Mesh.h:86
void get_nodes(typename ScanlineMesh< Basis >::Node::array_type &, typename ScanlineMesh< Basis >::Edge::index_type) const
get the child elements of the given index
Definition: StructCurveMesh.h:987
double inverse_jacobian(const VECTOR &coords, typename ScanlineMesh< Basis >::Elem::index_type idx, double *Ji) const
Definition: StructCurveMesh.h:385
static PersistentTypeID scanline_typeid
Definition: StructCurveMesh.h:792
const char * name[]
Definition: BoostGraphExampleTests.cc:87
bool get_coords(VECTOR &coords, const Core::Geometry::Point &p, INDEX idx) const
Definition: StructCurveMesh.h:316
long long size_type
Definition: Types.h:40
void get_edges(typename ScanlineMesh< Basis >::Edge::array_type &a, typename ScanlineMesh< Basis >::Edge::index_type idx) const
Definition: StructCurveMesh.h:143
double get_size(typename ScanlineMesh< Basis >::Edge::index_type idx) const
Definition: StructCurveMesh.h:150
void pwl_approx_edge(std::vector< std::vector< double > > &coords, typename ScanlineMesh< Basis >::Elem::index_type, unsigned int, unsigned int div_per_unit) const
piecewise linear approximation of an edge.
Definition: StructCurveMesh.h:291
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
int get_valence(typename ScanlineMesh< Basis >::Edge::index_type) const
Definition: StructCurveMesh.h:174
Definition: Mesh.h:71
bool locate(typename ScanlineMesh< Basis >::Cell::index_type &, const Core::Geometry::Point &) const
Definition: StructCurveMesh.h:202
SCIRun::index_type under_type
Types that change depending on 32 or 64bits.
Definition: StructCurveMesh.h:96
Persistent i/o for STL containers.
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &idx, const Core::Geometry::Point &point) const
Definition: StructCurveMesh.h:581
double jacobian_metric(INDEX idx) const
Definition: StructCurveMesh.h:441
int get_weights(const Core::Geometry::Point &, typename ScanlineMesh< Basis >::Node::array_type &, double *w)
Definition: StructCurveMesh.h:1059
void get_point(Core::Geometry::Point &p, typename ScanlineMesh< Basis >::Node::index_type i) const
Definition: StructCurveMesh.h:222
Distinct type for face index.
Definition: FieldIndex.h:90
void get_edges(typename ScanlineMesh< Basis >::Edge::array_type &, typename ScanlineMesh< Basis >::Face::index_type) const
Definition: StructCurveMesh.h:139
Definition: Transform.h:53
void pwl_approx_face(std::vector< std::vector< std::vector< double > > > &, typename ScanlineMesh< Basis >::Elem::index_type, typename ScanlineMesh< Basis >::Face::index_type, unsigned int) const
Definition: StructCurveMesh.h:303
void x(double)
Definition: Vector.h:175
Basis basis_
the basis fn
Definition: ScanlineMesh.h:804
StructCurveMesh()
Definition: StructCurveMesh.h:838
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: StructCurveMesh.h:741
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
void derivate(const VECTOR1 &coords, typename ScanlineMesh< Basis >::Elem::index_type idx, VECTOR2 &J) const
Definition: StructCurveMesh.h:336
v
Definition: readAllFields.py:42
index_type edge0_index() const
the following designed to coordinate with ::get_edges
Definition: StructCurveMesh.h:266
double get_epsilon() const
Definition: StructCurveMesh.h:913
double get_cord_length() const
get the mesh statistics
Definition: StructCurveMesh.h:965
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: StructCurveMesh.h:653
virtual bool synchronize(mask_type sync)
Definition: StructCurveMesh.h:1111
void y(double)
Definition: Vector.h:185
void begin(typename Node::iterator &) const
Definition: ScanlineMesh.h:1110
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: ScanlineMesh.h:1044
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
Definition: Mesh.h:75
#define ASSERTFAIL(string)
Definition: Assert.h:52
std::vector< index_type > array_type
Definition: ScanlineMesh.h:134
virtual void set_dim(std::vector< size_type > dims)
Definition: StructCurveMesh.h:116
bool locate_elem(INDEX &idx, const Core::Geometry::Point &p) const
Definition: StructCurveMesh.h:502
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
virtual bool get_dim(std::vector< size_type > &) const
Definition: StructCurveMesh.h:900
#define STRUCT_CURVE_MESH_VERSION
Definition: StructCurveMesh.h:1149
void get_center(Core::Geometry::Point &, const typename ScanlineMesh< Basis >::Node::index_type &) const
get the center point (in object space) of an element
Definition: StructCurveMesh.h:997
double length() const
Definition: Vector.h:365
virtual void end_class()
Definition: Persistent.cc:178
std::vector< index_type > array_type
Definition: ScanlineMesh.h:127
friend class VStructCurveMesh
Make sure the virtual interface has access.
Definition: StructCurveMesh.h:92
int get_valence(typename ScanlineMesh< Basis >::Cell::index_type) const
Definition: StructCurveMesh.h:178
long long index_type
Definition: Types.h:39
const Core::Geometry::Point & node0() const
Definition: StructCurveMesh.h:272
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
Templated Mesh defined on a 3D Regular Grid.
static Persistent * maker()
This function returns a maker for Pio.
Definition: StructCurveMesh.h:801
bool locate(typename ScanlineMesh< Basis >::Face::index_type &, const Core::Geometry::Point &) const
Definition: StructCurveMesh.h:199
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, INDEX &elem, const Core::Geometry::Point &p) const
Definition: StructCurveMesh.h:730
StructCurveMesh< Basis >::index_type index_type
Definition: StructCurveMesh.h:243
void set_point(const Core::Geometry::Point &p, typename ScanlineMesh< Basis >::Node::index_type i)
Definition: StructCurveMesh.h:224
double det_jacobian(const VECTOR &coords, typename ScanlineMesh< Basis >::Elem::index_type idx) const
Definition: StructCurveMesh.h:348
void size(typename Node::size_type &) const
Definition: ScanlineMesh.h:1126
double get_volume(typename ScanlineMesh< Basis >::Cell::index_type idx) const
Definition: StructCurveMesh.h:168
Definition: Persistent.h:64
ElemData(const StructCurveMesh< Basis > &msh, const typename ScanlineMesh< Basis >::Elem::index_type ind)
Definition: StructCurveMesh.h:245
void get_random_point(Core::Geometry::Point &p, const typename ScanlineMesh< Basis >::Elem::index_type idx, FieldRNG &rng) const
Definition: StructCurveMesh.h:1098
virtual StructCurveMesh * clone() const
Definition: StructCurveMesh.h:104
void get_nodes(typename ScanlineMesh< Basis >::Node::array_type &, typename ScanlineMesh< Basis >::Cell::index_type) const
Definition: StructCurveMesh.h:137
Distinct type for edge index.
Definition: FieldIndex.h:81
int n
Definition: eab.py:9
bool locate(typename ScanlineMesh< Basis >::Elem::index_type &idx, std::vector< double > &coords, const Core::Geometry::Point &point)
Definition: StructCurveMesh.h:206
T InverseMatrix3x3(const T *p, T *q)
Definition: Locate.h:47
double get_size(typename ScanlineMesh< Basis >::Face::index_type) const
Definition: StructCurveMesh.h:160
SCIRun::size_type size_type
Definition: StructCurveMesh.h:98
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
virtual void transform(const Core::Geometry::Transform &t)
Definition: StructCurveMesh.h:948
SCIRun::index_type index_type
Definition: StructCurveMesh.h:97
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: StructCurveMesh.h:803
index_type node1_index() const
Definition: StructCurveMesh.h:258
void get_edges(typename ScanlineMesh< Basis >::Edge::array_type &, typename ScanlineMesh< Basis >::Cell::index_type) const
Definition: StructCurveMesh.h:141
void z(double)
Definition: Vector.h:195
Definition: VMesh.h:53
virtual bool unsynchronize(mask_type sync)
Definition: StructCurveMesh.h:1127
SCIRun::mask_type mask_type
Definition: ScanlineMesh.h:110
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209
Interface to dynamic 2D array class.
bool elem_locate(INDEX &elem, MESH &msh, const Core::Geometry::Point &p)
General case locate, search each elem.
Definition: Mesh.h:188