SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VUnstructuredMesh.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 
30 #ifndef CORE_DATATYPES_VUNSTRUCTUREDMESH_H
31 #define CORE_DATATYPES_VUNSTRUCTUREDMESH_H
32 
34 
35 /// Include needed for Windows: declares SCISHARE
37 
38 namespace SCIRun {
39 
40 template <class MESH>
41 class SCISHARE VUnstructuredMesh : public VMeshShared<MESH> {
42 public:
43 
44  /// Constructor: This will initialize VMeshShared and VMesh
45  explicit VUnstructuredMesh(MESH* mesh) :
46  VMeshShared<MESH>(mesh)
47  {}
48 
49  virtual void size(VMesh::Node::size_type& size) const;
50  virtual void size(VMesh::ENode::size_type& size) const;
51  virtual void size(VMesh::Edge::size_type& size) const;
52  virtual void size(VMesh::Face::size_type& size) const;
53  virtual void size(VMesh::Cell::size_type& size) const;
54  virtual void size(VMesh::Elem::size_type& size) const;
55  virtual void size(VMesh::DElem::size_type& size) const;
56 
57  virtual void get_center(Core::Geometry::Point &point, VMesh::Node::index_type i) const;
58  virtual void get_center(Core::Geometry::Point &point, VMesh::ENode::index_type i) const;
59  virtual void get_center(Core::Geometry::Point &point, VMesh::Edge::index_type i) const;
60  virtual void get_center(Core::Geometry::Point &point, VMesh::Face::index_type i) const;
61  virtual void get_center(Core::Geometry::Point &point, VMesh::Cell::index_type i) const;
62  virtual void get_center(Core::Geometry::Point &point, VMesh::Elem::index_type i) const;
63  virtual void get_center(Core::Geometry::Point &point, VMesh::DElem::index_type i) const;
64 
65  virtual void get_centers(Core::Geometry::Point* points, VMesh::Node::array_type& array) const;
66  virtual void get_centers(Core::Geometry::Point* points, VMesh::Elem::array_type& array) const;
67 
68  virtual double get_size(VMesh::Edge::index_type i) const;
69  virtual double get_size(VMesh::Face::index_type i) const;
70  virtual double get_size(VMesh::Cell::index_type i) const;
71  virtual double get_size(VMesh::Elem::index_type i) const;
72  virtual double get_size(VMesh::DElem::index_type i) const;
73 
74  virtual bool locate(VMesh::Node::index_type &i, const Core::Geometry::Point &point) const;
75  virtual bool locate(VMesh::Elem::index_type &i, const Core::Geometry::Point &point) const;
76  virtual bool locate(VMesh::Elem::index_type &i,
77  VMesh::coords_type& coords,
78  const Core::Geometry::Point &point) const;
79 
80  virtual bool locate(VMesh::Elem::array_type &i, const Core::Geometry::BBox &bbox) const;
81 
82  virtual void mlocate(std::vector<VMesh::Node::index_type> &i, const std::vector<Core::Geometry::Point> &point) const;
83  virtual void mlocate(std::vector<VMesh::Elem::index_type> &i, const std::vector<Core::Geometry::Point> &point) const;
84 
85  virtual bool get_coords(VMesh::coords_type &coords,
86  const Core::Geometry::Point &point, VMesh::Elem::index_type i) const;
87 
88  virtual void interpolate(Core::Geometry::Point &p, const VMesh::coords_type &coords,
89  VMesh::Elem::index_type i) const;
90  virtual void minterpolate(std::vector<Core::Geometry::Point> &p,
91  const std::vector<VMesh::coords_type> &coords,
92  VMesh::Elem::index_type i) const;
93 
94  virtual void derivate(VMesh::dpoints_type &p, const VMesh::coords_type &coords,
95  VMesh::Elem::index_type i) const;
96 
97  virtual void get_random_point(Core::Geometry::Point &p, VMesh::Elem::index_type i,
98  FieldRNG &rng) const;
99  virtual void set_point(const Core::Geometry::Point &point, VMesh::Node::index_type i);
100  virtual void set_point(const Core::Geometry::Point &point, VMesh::ENode::index_type i);
101 
102  virtual Core::Geometry::Point* get_points_pointer() const;
103 
104  virtual void add_node(const Core::Geometry::Point &point,VMesh::Node::index_type &i);
105  virtual void add_enode(const Core::Geometry::Point &point,VMesh::ENode::index_type &i);
106 
107  virtual void add_elem(const VMesh::Node::array_type &nodes,
109 
110  virtual bool get_neighbor(VMesh::Elem::index_type &neighbor,
112  VMesh::DElem::index_type delem) const;
113  virtual bool get_neighbors(VMesh::Elem::array_type &elems,
115  VMesh::DElem::index_type delem) const;
116  virtual void get_neighbors(VMesh::Elem::array_type &elems,
117  VMesh::Elem::index_type elem) const;
118  virtual void get_neighbors(VMesh::Node::array_type &nodes,
119  VMesh::Node::index_type node) const;
120 
121  virtual void pwl_approx_edge(VMesh::coords_array_type &coords,
123  unsigned int which_edge,
124  unsigned int div_per_unit) const;
125 
126  virtual void pwl_approx_face(VMesh::coords_array2_type &coords,
128  unsigned int which_face,
129  unsigned int div_per_unit) const;
130 
131  virtual void get_dimensions(VMesh::dimension_type& dim);
132 
133  /// Get the jacobian for the global coordinates to local coordinates transformation
134  virtual double det_jacobian(const VMesh::coords_type& coords,
135  VMesh::Elem::index_type idx) const;
136 
137  virtual void jacobian(const VMesh::coords_type& coords,
139  double* J) const;
140 
141  virtual double inverse_jacobian(const VMesh::coords_type& coords,
143  double* Ji) const;
144 
145  // The element metrics
146  virtual double scaled_jacobian_metric(const VMesh::Elem::index_type elem) const;
147  virtual double jacobian_metric(const VMesh::Elem::index_type elem) const;
148 
149 
150  /// Functions for forwarding call to the basis class of the
151  /// mesh
152  virtual void node_reserve(size_t size);
153  virtual void elem_reserve(size_t size);
154  virtual void resize_nodes(size_t size);
155  virtual void resize_elems(size_t size);
156 
157  /// Get normals, for surface meshes only
158  virtual void get_normal(Core::Geometry::Vector& norm, VMesh::Node::index_type i) const;
159 
160  virtual void get_normal(Core::Geometry::Vector& norm, VMesh::coords_type& coords,
162 
163  /// Get all the information needed for interpolation:
164  /// this includes weights and node indices
165 
166  virtual void get_interpolate_weights(const Core::Geometry::Point& point,
168  int basis_order) const;
169 
170  virtual void get_interpolate_weights(const VMesh::coords_type& coords,
173  int basis_order) const;
174 
175  virtual void get_minterpolate_weights(const std::vector<Core::Geometry::Point>& point,
177  int basis_order) const;
178 
179  virtual void get_minterpolate_weights(const std::vector<VMesh::coords_type>& coords,
182  int basis_order) const;
183 
184  virtual void get_gradient_weights(const Core::Geometry::Point& point,
186  int basis_order) const;
187 
188  virtual void get_gradient_weights(const VMesh::coords_type& coords,
191  int basis_order) const;
192 
193  virtual void get_mgradient_weights(const std::vector<Core::Geometry::Point>& point,
195  int basis_order) const;
196 
197  virtual void get_mgradient_weights(const std::vector<VMesh::coords_type>& coords,
200  int basis_order) const;
201 
202  virtual bool find_closest_node(double& pdist,
203  Core::Geometry::Point& result,
205  const Core::Geometry::Point &point) const;
206 
207  virtual bool find_closest_node(double& pdist,
208  Core::Geometry::Point& result,
210  const Core::Geometry::Point &point,
211  double maxdist) const;
212 
213  virtual bool find_closest_nodes(std::vector<VMesh::Node::index_type> &nodes,
214  const Core::Geometry::Point &point,
215  double maxdist) const;
216 
217  virtual bool find_closest_nodes(std::vector<double> &distances,
218  std::vector<VMesh::Node::index_type> &nodes,
219  const Core::Geometry::Point &point,
220  double maxdist) const;
221 
222  virtual bool find_closest_elem(double& pdist,
223  Core::Geometry::Point& result,
224  VMesh::coords_type& coords,
226  const Core::Geometry::Point &point) const;
227 
228  virtual bool find_closest_elem(double& pdist,
229  Core::Geometry::Point& result,
230  VMesh::coords_type& coords,
232  const Core::Geometry::Point &point,
233  double maxdist) const;
234 
235  virtual bool find_closest_elems(double& pdist, Core::Geometry::Point& result,
237  const Core::Geometry::Point &point) const;
238 
239 };
240 
241 
242 
243 
244 template <class MESH>
245 void
248 {
249  typename MESH::Node::size_type s;
250  this->mesh_->size(s);
251  sz = VMesh::Node::index_type(s);
252 }
253 
254 template <class MESH>
255 void
258 {
259  typename MESH::Edge::size_type s;
260  this->mesh_->size(s);
261  sz = VMesh::ENode::index_type(s);
262 }
263 
264 template <class MESH>
265 void
268 {
269  typename MESH::Edge::size_type s;
270  this->mesh_->size(s);
271  sz = VMesh::Edge::index_type(s);
272 }
273 
274 template <class MESH>
275 void
278 {
279  typename MESH::Face::size_type s;
280  this->mesh_->size(s);
281  sz = VMesh::Face::index_type(s);
282 }
283 
284 template <class MESH>
285 void
288 {
289  typename MESH::Cell::size_type s;
290  this->mesh_->size(s);
291  sz = VMesh::Cell::index_type(s);
292 }
293 
294 template <class MESH>
295 void
298 {
299  typename MESH::DElem::size_type s;
300  this->mesh_->size(s);
301  sz = VMesh::DElem::index_type(s);
302 }
303 
304 template <class MESH>
305 void
308 {
309  typename MESH::Elem::size_type s;
310  this->mesh_->size(s);
311  sz = VMesh::Elem::index_type(s);
312 
313 }
314 
315 
316 
317 template <class MESH>
318 bool
321 {
322  return(this->mesh_->locate_node(idx,point));
323 }
324 
325 template <class MESH>
326 bool
329 {
330  return(this->mesh_->locate_elem(idx,point));
331 }
332 
333 
334 template <class MESH>
335 bool
338 {
339  return(this->mesh_->locate_elems(array,bbox));
340 }
341 
342 template <class MESH>
343 bool
346  VMesh::coords_type& coords,
347  const Core::Geometry::Point& point) const
348 {
349  return(this->mesh_->locate_elem(idx,coords,point));
350 }
351 
352 
353 template <class MESH>
354 void
356 mlocate(std::vector<VMesh::Node::index_type> &idx, const std::vector<Core::Geometry::Point> &point) const
357 {
358  idx.resize(point.size());
359  for (size_t i=0; i<point.size(); i++)
360  {
361  if(!(this->mesh_->locate_node(idx[i],point[i]))) idx[i] = -1;
362  }
363 }
364 
365 template <class MESH>
366 void
368 mlocate(std::vector<VMesh::Elem::index_type> &idx, const std::vector<Core::Geometry::Point> &point) const
369 {
370  idx.resize(point.size());
371  for (size_t i=0; i<point.size(); i++)
372  {
373  if(!(this->mesh_->locate_elem(idx[i],point[i]))) idx[i] = -1;
374  }
375 }
376 
377 template <class MESH>
378 bool
381  const Core::Geometry::Point &point,
382  VMesh::Elem::index_type i) const
383 {
384  return(this->mesh_->get_coords(coords,point,typename MESH::Elem::index_type(i)));
385 }
386 
387 template <class MESH>
388 void
391  const VMesh::coords_type& coords,
392  VMesh::Elem::index_type i) const
393 {
394  this->mesh_->interpolate(p,coords,typename MESH::Elem::index_type(i));
395 }
396 
397 template <class MESH>
398 void
400 minterpolate(std::vector<Core::Geometry::Point> &p,
401  const std::vector<VMesh::coords_type>& coords,
402  VMesh::Elem::index_type idx) const
403 {
404  p.resize(coords.size());
405  for (size_t i=0; i<coords.size(); i++)
406  this->mesh_->interpolate(p[i],coords[i],typename MESH::Elem::index_type(idx));
407 }
408 
409 template <class MESH>
410 void
413  const VMesh::coords_type &coords,
414  VMesh::Elem::index_type i) const
415 {
416  this->mesh_->derivate(coords,typename MESH::Elem::index_type(i),p);
417 }
418 
419 template <class MESH>
420 bool
424  VMesh::DElem::index_type delem) const
425 {
426  return(this->mesh_->get_elem_neighbor(neighbor,elem,delem));
427 }
428 
429 
430 template <class MESH>
431 bool
435  VMesh::DElem::index_type delem) const
436 {
437  return(this->mesh_->get_elem_neighbors(array,elem,delem));
438 }
439 
440 template <class MESH>
441 void
444  VMesh::Elem::index_type idx) const
445 {
446  this->mesh_->get_elem_neighbors(array,idx);
447 }
448 
449 template <class MESH>
450 void
453  VMesh::Node::index_type idx) const
454 {
455  this->mesh_->get_node_neighbors(array,idx);
456 }
457 
458 
459 template <class MESH>
460 void
462  VMesh::Elem::index_type /*ci*/,
463  unsigned int which_edge,
464  unsigned int div_per_unit) const
465 {
466  this->basis_->approx_edge(which_edge, div_per_unit, coords);
467 }
468 
469 template <class MESH>
470 void
472  VMesh::Elem::index_type /*ci*/,
473  unsigned int which_face,
474  unsigned int div_per_unit) const
475 {
476  this->basis_->approx_face(which_face, div_per_unit, coords);
477 }
478 
479 
480 template <class MESH>
481 void
484 {
485  dim.resize(1);
486  typename MESH::Node::size_type sz;
487  this->mesh_->size(sz);
488  dim[0] = sz;
489 }
490 
491 template <class MESH>
492 double
495  VMesh::Elem::index_type idx) const
496 {
497  return(this->mesh_->det_jacobian(coords,typename MESH::Elem::index_type(idx)));
498 }
499 
500 
501 template <class MESH>
502 void
506  double* J) const
507 {
508  this->mesh_->jacobian(coords,typename MESH::Elem::index_type(idx),J);
509 }
510 
511 
512 template <class MESH>
513 double
517  double* Ji) const
518 {
519  return(this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(idx),Ji));
520 }
521 
522 
523 
524 template <class MESH>
525 double
528 {
529  return(this->mesh_->scaled_jacobian_metric(typename MESH::Elem::index_type(idx)));
530 }
531 
532 template <class MESH>
533 double
536 {
537  return(this->mesh_->jacobian_metric(typename MESH::Elem::index_type(idx)));
538 }
539 
540 
541 template <class MESH>
542 void
545 {
546  this->mesh_->node_reserve(size);
547 }
548 
549 template <class MESH>
550 void
553 {
554  this->mesh_->elem_reserve(size);
555 }
556 
557 template <class MESH>
558 void
561 {
562  this->mesh_->resize_nodes(size);
563 }
564 
565 template <class MESH>
566 void
569 {
570  this->mesh_->resize_elems(size);
571 }
572 
573 template <class MESH>
574 double
577 {
578  return (this->mesh_->get_size(typename MESH::Edge::index_type(i)));
579 }
580 
581 template <class MESH>
582 double
585 {
586  return (this->mesh_->get_size(typename MESH::Face::index_type(i)));
587 }
588 
589 template <class MESH>
590 double
593 {
594  return (this->mesh_->get_size(typename MESH::Cell::index_type(i)));
595 }
596 
597 template <class MESH>
598 double
601 {
602  return (this->mesh_->get_size(typename MESH::Elem::index_type(i)));
603 }
604 
605 template <class MESH>
606 double
609 {
610  return (0.0);
611 }
612 
613 
614 template <class MESH>
615 void
618 {
619  p = this->mesh_->points_[idx];
620 }
621 
622 template <class MESH>
623 void
626 {
627  if (this->num_enodes_per_elem_)
628  {
629  this->basis_->get_node_value(p,static_cast<VMesh::index_type>(idx));
630  }
631  else
632  {
633  this->mesh_->get_center(p, typename MESH::Edge::index_type(idx));
634  }
635 }
636 
637 template <class MESH>
638 void
641 {
642  this->mesh_->get_center(p, typename MESH::Edge::index_type(idx));
643 }
644 
645 template <class MESH>
646 void
649 {
650  this->mesh_->get_center(p, typename MESH::Face::index_type(idx));
651 }
652 
653 template <class MESH>
654 void
657 {
658  this->mesh_->get_center(p, typename MESH::Cell::index_type(idx));
659 }
660 
661 template <class MESH>
662 void
665 {
666  this->mesh_->get_center(p, typename MESH::Elem::index_type(idx));
667 }
668 
669 template <class MESH>
670 void
673 {
674  this->mesh_->get_center(p, typename MESH::DElem::index_type(idx));
675 }
676 
677 template <class MESH>
678 void
681  VMesh::Node::array_type& array) const
682 {
683  for (size_t j=0; j <array.size(); j++)
684  {
685  this->mesh_->get_center(points[j],typename MESH::Node::index_type(array[j]));
686  }
687 }
688 
689 template <class MESH>
690 void
693  VMesh::Elem::array_type& array) const
694 {
695  for (size_t j=0; j <array.size(); j++)
696  {
697  this->mesh_->get_center(points[j],typename MESH::Node::index_type(array[j]));
698  }
699 }
700 
701 
702 
703 template <class MESH>
704 void
707 {
708  this->mesh_->points_[i] = point;
709 }
710 
711 template <class MESH>
712 void
715 {
716  if (this->num_enodes_per_elem_)
717  {
718  if (this->mesh_->edges_.size() != this->basis_->size_node_values())
719  {
720  this->basis_->resize_node_values(this->mesh_->edges_.size());
721  }
722  this->basis_->set_node_value(point,i);
723  }
724  else
725  {
726  ASSERTFAIL("CurveMesh does not contain Lagrangian nodes that can be edited");
727  }
728 }
729 
730 template <class MESH>
734 {
735  if (this->mesh_->points_.size() == 0) return (0);
736  return (&(this->mesh_->points_[0]));
737 }
738 
739 template <class MESH>
740 void
743 {
744  vi = static_cast<VMesh::Node::index_type>(this->mesh_->add_point(point));
745 }
746 
747 template <class MESH>
748 void
751 {
752  vi = static_cast<VMesh::ENode::index_type>(this->basis_->size_node_values());
753  this->basis_->add_node_value(point);
754 }
755 
756 template <class MESH>
757 void
761 {
762  vi = static_cast<VMesh::Elem::index_type>(this->mesh_->add_elem(nodes));
763 }
764 
765 
766 template <class MESH>
767 void
771  FieldRNG &rng) const
772 {
773  this->mesh_->get_random_point(p,typename MESH::Elem::index_type(i),rng);
774 }
775 
776 template <class MESH>
777 void
779 {
780  this->mesh_->get_normal(norm,typename MESH::Node::index_type(i));
781 }
782 
783 template <class MESH>
784 void
787 {
788  this->mesh_->get_normal(norm,coords,i,j);
789 }
790 
791 template <class MESH>
792 void
796  int basis_order) const
797 {
798  typename MESH::Elem::index_type elem = ei.elem_index;
799 
800  if(this->mesh_->locate(elem,point))
801  {
802  ei.basis_order = basis_order;
803  ei.elem_index = elem;
804  }
805  else
806  {
807  ei.elem_index = -1;
808  return;
809  }
810 
811  StackVector<double,3> coords;
812  this->mesh_->get_coords(coords,point,elem);
813 
814  switch (basis_order)
815  {
816  case 0:
817  return;
818  case 1:
819  ei.weights.resize(this->basis_->num_linear_weights());
820  this->basis_->get_linear_weights(coords,&(ei.weights[0]));
821  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
822  return;
823  case 2:
824  ei.weights.resize(this->basis_->num_quadratic_weights());
825  this->basis_->get_quadratic_weights(coords,&(ei.weights[0]));
826  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
827  this->mesh_->get_edges_from_elem(ei.edge_index,elem);
828  return;
829  case 3:
830  ei.weights.resize(this->basis_->num_cubic_weights());
831  this->basis_->get_cubic_weights(coords,&(ei.weights[0]));
832  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
833  ei.num_hderivs = this->basis_->num_hderivs();
834  return;
835  }
836  ASSERTFAIL("Interpolation of unknown order requested");
837 }
838 
839 template <class MESH>
840 void
845  int basis_order) const
846 {
847  ei.basis_order = basis_order;
848  ei.elem_index = elem;
849 
850  switch (basis_order)
851  {
852  case 0:
853  return;
854  case 1:
855  ei.weights.resize(this->basis_->num_linear_weights());
856  this->basis_->get_linear_weights(coords,&(ei.weights[0]));
857  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
858  return;
859  case 2:
860  ei.weights.resize(this->basis_->num_quadratic_weights());
861  this->basis_->get_quadratic_weights(coords,&(ei.weights[0]));
862  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
863  this->mesh_->get_edges_from_elem(ei.edge_index,elem);
864  return;
865  case 3:
866  ei.weights.resize(this->basis_->num_cubic_weights());
867  this->basis_->get_cubic_weights(coords,&(ei.weights[0]));
868  this->mesh_->get_nodes_from_elem(ei.node_index,elem);
869  ei.num_hderivs = this->basis_->num_hderivs();
870  return;
871  }
872  ASSERTFAIL("Interpolation of unknown order requested");
873 }
874 
875 
876 template <class MESH>
877 void
879 get_minterpolate_weights(const std::vector<Core::Geometry::Point>& point,
881  int basis_order) const
882 {
883  ei.resize(point.size());
884  typename MESH::Elem::index_type elem;
885 
886  switch (basis_order)
887  {
888  case 0:
889  {
890  for (size_t i=0; i<ei.size();i++)
891  {
892  if (i == 0) elem = ei[0].elem_index;
893  if(this->mesh_->locate(elem,point[i]))
894  {
895  ei[i].basis_order = basis_order;
896  ei[i].elem_index = elem;
897  }
898  else
899  {
900  ei[i].basis_order = basis_order;
901  ei[i].elem_index = -1;
902  }
903  }
904  }
905  return;
906  case 1:
907  {
908  StackVector<double,3> coords;
909  for (size_t i=0; i<ei.size();i++)
910  {
911  if (i == 0) elem = ei[0].elem_index;
912  if(this->mesh_->locate(elem,point[i]))
913  {
914  this->mesh_->get_coords(coords,point[i],elem);
915  ei[i].basis_order = basis_order;
916  ei[i].elem_index = elem;
917  ei[i].weights.resize(this->basis_->num_linear_weights());
918  this->basis_->get_linear_weights(coords,&(ei[i].weights[0]));
919  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
920  }
921  else
922  {
923  ei[i].basis_order = basis_order;
924  ei[i].elem_index = -1;
925  }
926  }
927  }
928  return;
929  case 2:
930  {
931  StackVector<double,3> coords;
932 
933  for (size_t i=0; i<ei.size();i++)
934  {
935  if (i == 0) elem = ei[0].elem_index;
936  if(this->mesh_->locate(elem,point[i]))
937  {
938  this->mesh_->get_coords(coords,point[i],elem);
939  ei[i].basis_order = basis_order;
940  ei[i].elem_index = elem;
941  ei[i].weights.resize(this->basis_->num_quadratic_weights());
942  this->basis_->get_quadratic_weights(coords,&(ei[i].weights[0]));
943  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
944  this->mesh_->get_edges_from_elem(ei[i].edge_index,elem);
945  }
946  else
947  {
948  ei[i].basis_order = basis_order;
949  ei[i].elem_index = -1;
950  }
951  }
952  }
953  return;
954  case 3:
955  {
956  StackVector<double,3> coords;
957 
958  for (size_t i=0; i<ei.size();i++)
959  {
960  if (i == 0) elem = ei[0].elem_index;
961  if(this->mesh_->locate(elem,point[i]))
962  {
963  this->mesh_->get_coords(coords,point[i],elem);
964  ei[i].basis_order = basis_order;
965  ei[i].elem_index = elem;
966  ei[i].weights.resize(this->basis_->num_cubic_weights());
967  this->basis_->get_cubic_weights(coords,&(ei[i].weights[0]));
968  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
969  ei[i].num_hderivs = this->basis_->num_hderivs();
970  }
971  else
972  {
973  ei[i].basis_order = basis_order;
974  ei[i].elem_index = -1;
975  }
976  }
977  }
978  return;
979  }
980  ASSERTFAIL("Interpolation of unknown order requested");
981 }
982 
983 template <class MESH>
984 void
986 get_minterpolate_weights(const std::vector<VMesh::coords_type>& coords,
989  int basis_order) const
990 {
991  ei.resize(coords.size());
992 
993  for (size_t i=0; i<coords.size(); i++)
994  {
995  ei[i].basis_order = basis_order;
996  ei[i].elem_index = elem;
997  }
998 
999  switch (basis_order)
1000  {
1001  case 0:
1002  return;
1003  case 1:
1004  for (size_t i=0; i<coords.size(); i++)
1005  {
1006  ei[i].weights.resize(this->basis_->num_linear_weights());
1007  this->basis_->get_linear_weights(coords[i],&(ei[i].weights[0]));
1008  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
1009  }
1010  return;
1011  case 2:
1012  for (size_t i=0; i<coords.size(); i++)
1013  {
1014  ei[i].weights.resize(this->basis_->num_quadratic_weights());
1015  this->basis_->get_quadratic_weights(coords[i],&(ei[i].weights[0]));
1016  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
1017  this->mesh_->get_edges_from_elem(ei[i].edge_index,elem);
1018  }
1019  return;
1020  case 3:
1021  for (size_t i=0; i<coords.size(); i++)
1022  {
1023  ei[i].weights.resize(this->basis_->num_cubic_weights());
1024  this->basis_->get_cubic_weights(coords[i],&(ei[i].weights[0]));
1025  this->mesh_->get_nodes_from_elem(ei[i].node_index,elem);
1026  ei[i].num_hderivs = this->basis_->num_hderivs();
1027  }
1028  return;
1029  }
1030  ASSERTFAIL("Interpolation of unknown order requested");
1031 }
1032 
1033 
1034 template <class MESH>
1035 void
1039  VMesh::ElemGradient& eg,
1040  int basis_order) const
1041 {
1042  eg.basis_order = basis_order;
1043  eg.elem_index = elem;
1044 
1045  switch (basis_order)
1046  {
1047  case 0:
1048  return;
1049  case 1:
1050  eg.weights.resize(this->basis_->num_linear_derivate_weights());
1051  this->basis_->get_linear_derivate_weights(coords,&(eg.weights[0]));
1052  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1053 
1054  eg.inverse_jacobian.resize(9);
1055  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1056  eg.num_derivs = this->basis_->num_derivs();
1057  return;
1058  case 2:
1059  eg.weights.resize(this->basis_->num_quadratic_derivate_weights());
1060  this->basis_->get_quadratic_derivate_weights(coords,&(eg.weights[0]));
1061  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1062  this->mesh_->get_edges_from_elem(eg.edge_index,elem);
1063 
1064  eg.inverse_jacobian.resize(9);
1065  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1066  eg.num_derivs = this->basis_->num_derivs();
1067  return;
1068  case 3:
1069  eg.weights.resize(this->basis_->num_cubic_derivate_weights());
1070  this->basis_->get_cubic_derivate_weights(coords,&(eg.weights[0]));
1071  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1072  eg.num_hderivs = this->basis_->num_hderivs();
1073 
1074  eg.inverse_jacobian.resize(9);
1075  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1076  eg.num_derivs = this->basis_->num_derivs();
1077  return;
1078  }
1079  ASSERTFAIL("Gradient of unknown order requested");
1080 }
1081 
1082 
1083 
1084 
1085 template <class MESH>
1086 void
1089  VMesh::ElemGradient& eg,
1090  int basis_order) const
1091 {
1092  typename MESH::Elem::index_type elem;
1093  StackVector<double,3> coords;
1094 
1095  eg.basis_order = basis_order;
1096 
1097  if(!(this->mesh_->locate(elem,point)))
1098  {
1099  eg.elem_index = -1;
1100  return;
1101  }
1102 
1103  this->mesh_->get_coords(coords,point,elem);
1104  eg.basis_order = basis_order;
1105  eg.elem_index = elem;
1106 
1107  switch (basis_order)
1108  {
1109  case 0:
1110  return;
1111  case 1:
1112  eg.weights.resize(this->basis_->num_linear_derivate_weights());
1113  this->basis_->get_linear_derivate_weights(coords,&(eg.weights[0]));
1114  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1115 
1116  eg.inverse_jacobian.resize(9);
1117  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1118  eg.num_derivs = this->basis_->num_derivs();
1119  return;
1120  case 2:
1121  eg.weights.resize(this->basis_->num_quadratic_derivate_weights());
1122  this->basis_->get_quadratic_derivate_weights(coords,&(eg.weights[0]));
1123  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1124  this->mesh_->get_edges_from_elem(eg.edge_index,elem);
1125 
1126  eg.inverse_jacobian.resize(9);
1127  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1128  eg.num_derivs = this->basis_->num_derivs();
1129  return;
1130  case 3:
1131  eg.weights.resize(this->basis_->num_cubic_derivate_weights());
1132  this->basis_->get_cubic_derivate_weights(coords,&(eg.weights[0]));
1133  this->mesh_->get_nodes_from_elem(eg.node_index,elem);
1134  eg.num_hderivs = this->basis_->num_hderivs();
1135 
1136  eg.inverse_jacobian.resize(9);
1137  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg.inverse_jacobian[0]));
1138  eg.num_derivs = this->basis_->num_derivs();
1139  return;
1140  }
1141  ASSERTFAIL("Gradient of unknown order requested");
1142 }
1143 
1144 
1145 template <class MESH>
1146 void
1148 get_mgradient_weights(const std::vector<Core::Geometry::Point>& point,
1150  int basis_order) const
1151 {
1152  eg.resize(point.size());
1153 
1154  switch (basis_order)
1155  {
1156  case 0:
1157  {
1158  typename MESH::Elem::index_type elem;
1159  for (size_t i=0; i< point.size(); i++)
1160  {
1161  if(this->mesh_->locate(elem,point[i]))
1162  {
1163  eg[i].basis_order = basis_order;
1164  eg[i].elem_index = elem;
1165  }
1166  else
1167  {
1168  eg[i].basis_order = basis_order;
1169  eg[i].elem_index = -1;
1170  }
1171  }
1172  }
1173  return;
1174  case 1:
1175  {
1176  typename MESH::Elem::index_type elem;
1177  StackVector<double,3> coords;
1178  for (size_t i=0; i< point.size(); i++)
1179  {
1180  eg[i].basis_order = basis_order;
1181  if(this->mesh_->locate(elem,point[i]))
1182  {
1183  eg[i].elem_index = elem;
1184  this->mesh_->get_coords(coords,point[i],elem);
1185  eg[i].weights.resize(this->basis_->num_linear_derivate_weights());
1186  this->basis_->get_linear_derivate_weights(coords,&(eg[i].weights[0]));
1187  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1188 
1189  eg[i].inverse_jacobian.resize(9);
1190  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1191  eg[i].num_derivs = this->basis_->num_derivs();
1192  }
1193  else
1194  {
1195  eg[i].elem_index = -1;
1196  }
1197  }
1198  }
1199  return;
1200  case 2:
1201  {
1202  typename MESH::Elem::index_type elem;
1203  StackVector<double,3> coords;
1204  for (size_t i=0; i< point.size(); i++)
1205  {
1206  eg[i].basis_order = basis_order;
1207  if(this->mesh_->locate(elem,point[i]))
1208  {
1209  eg[i].elem_index = elem;
1210  this->mesh_->get_coords(coords,point[i],elem);
1211  eg[i].weights.resize(this->basis_->num_quadratic_derivate_weights());
1212  this->basis_->get_quadratic_derivate_weights(coords,&(eg[i].weights[0]));
1213  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1214  this->mesh_->get_edges_from_elem(eg[i].edge_index,elem);
1215 
1216  eg[i].inverse_jacobian.resize(9);
1217  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1218  eg[i].num_derivs = this->basis_->num_derivs();
1219  }
1220  else
1221  {
1222  eg[i].elem_index = -1;
1223  }
1224 
1225  }
1226  }
1227  return;
1228  case 3:
1229  {
1230  typename MESH::Elem::index_type elem;
1232  for (size_t i=0; i< point.size(); i++)
1233  {
1234  eg[i].basis_order = basis_order;
1235  if(this->mesh_->locate(elem,point[i]))
1236  {
1237  eg[i].elem_index = elem;
1238  this->mesh_->get_coords(coords,point[i],elem);
1239  eg[i].weights.resize(this->basis_->num_cubic_derivate_weights());
1240  this->basis_->get_cubic_derivate_weights(coords,&(eg[i].weights[0]));
1241  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1242  eg[i].num_hderivs = this->basis_->num_hderivs();
1243 
1244  eg[i].inverse_jacobian.resize(9);
1245  this->mesh_->inverse_jacobian(coords,typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1246  eg[i].num_derivs = this->basis_->num_derivs();
1247  }
1248  else
1249  {
1250  eg[i].elem_index = -1;
1251  }
1252  }
1253  }
1254  return;
1255  }
1256  ASSERTFAIL("Gradient of unknown order requested");
1257 }
1258 
1259 
1260 
1261 template <class MESH>
1262 void
1264 get_mgradient_weights(const std::vector<VMesh::coords_type>& coords,
1267  int basis_order) const
1268 {
1269  eg.resize(coords.size());
1270  for (size_t i=0; i< coords.size(); i++)
1271  {
1272  eg[i].basis_order = basis_order;
1273  eg[i].elem_index = elem;
1274  }
1275 
1276  switch (basis_order)
1277  {
1278  case 0:
1279  return;
1280  case 1:
1281  for (size_t i=0; i< coords.size(); i++)
1282  {
1283  eg[i].weights.resize(this->basis_->num_linear_derivate_weights());
1284  this->basis_->get_linear_derivate_weights(coords[i],&(eg[i].weights[0]));
1285  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1286 
1287  eg[i].inverse_jacobian.resize(9);
1288  this->mesh_->inverse_jacobian(coords[i],typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1289  eg[i].num_derivs = this->basis_->num_derivs();
1290  }
1291  return;
1292  case 2:
1293  for (size_t i=0; i< coords.size(); i++)
1294  {
1295  eg[i].weights.resize(this->basis_->num_quadratic_derivate_weights());
1296  this->basis_->get_quadratic_derivate_weights(coords[i],&(eg[i].weights[0]));
1297  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1298  this->mesh_->get_edges_from_elem(eg[i].edge_index,elem);
1299 
1300  eg[i].inverse_jacobian.resize(9);
1301  this->mesh_->inverse_jacobian(coords[i],typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1302  eg[i].num_derivs = this->basis_->num_derivs();
1303  }
1304  return;
1305  case 3:
1306  for (size_t i=0; i< coords.size(); i++)
1307  {
1308  eg[i].weights.resize(this->basis_->num_cubic_derivate_weights());
1309  this->basis_->get_cubic_derivate_weights(coords[i],&(eg[i].weights[0]));
1310  this->mesh_->get_nodes_from_elem(eg[i].node_index,elem);
1311  eg[i].num_hderivs = this->basis_->num_hderivs();
1312 
1313  eg[i].inverse_jacobian.resize(9);
1314  this->mesh_->inverse_jacobian(coords[i],typename MESH::Elem::index_type(elem),&(eg[i].inverse_jacobian[0]));
1315  eg[i].num_derivs = this->basis_->num_derivs();
1316  }
1317  return;
1318  }
1319  ASSERTFAIL("Gradient of unknown order requested");
1320 }
1321 
1322 
1323 
1324 template <class MESH>
1325 bool
1329  const Core::Geometry::Point &point) const
1330 {
1331  return(this->mesh_->find_closest_node(pdist,result,i,point));
1332 }
1333 
1334 
1335 template <class MESH>
1336 bool
1340  const Core::Geometry::Point &point,
1341  double maxdist) const
1342 {
1343  return(this->mesh_->find_closest_node(pdist,result,i,point,maxdist));
1344 }
1345 
1346 template <class MESH>
1347 bool
1349 find_closest_nodes(std::vector<VMesh::Node::index_type> &nodes,
1350  const Core::Geometry::Point &point,
1351  double maxdist) const
1352 {
1353  return(this->mesh_->find_closest_nodes(nodes,point,maxdist));
1354 }
1355 
1356 
1357 template <class MESH>
1358 bool
1360 find_closest_nodes(std::vector<double> &distances,
1361  std::vector<VMesh::Node::index_type> &nodes,
1362  const Core::Geometry::Point &point,
1363  double maxdist) const
1364 {
1365  return(this->mesh_->find_closest_nodes(distances,nodes,point,maxdist));
1366 }
1367 
1368 template <class MESH>
1369 bool
1371 find_closest_elem(double& pdist,
1372  Core::Geometry::Point& result,
1373  VMesh::coords_type& coords,
1375  const Core::Geometry::Point& point) const
1376 {
1377  return(this->mesh_->find_closest_elem(pdist,result,coords,i,point));
1378 }
1379 
1380 template <class MESH>
1381 bool
1383 find_closest_elem(double& pdist,
1384  Core::Geometry::Point& result,
1385  VMesh::coords_type& coords,
1387  const Core::Geometry::Point& point,
1388  double maxdist) const
1389 {
1390  return(this->mesh_->find_closest_elem(pdist,result,coords,i,point,maxdist));
1391 }
1392 
1393 template <class MESH>
1394 bool
1398  const Core::Geometry::Point &point) const
1399 {
1400  return(this->mesh_->find_closest_elems(pdist,result,i,point));
1401 }
1402 
1403 
1404 }
1405 
1406 #endif
Definition: VUnstructuredMesh.h:41
virtual void add_elem(const VMesh::Node::array_type &nodes, VMesh::Elem::index_type &i)
Add an element to a mesh.
Definition: VUnstructuredMesh.h:759
virtual double get_size(VMesh::Edge::index_type i) const
Get the geometrical size of topological mesh components.
Definition: VUnstructuredMesh.h:576
virtual bool find_closest_elems(double &pdist, Core::Geometry::Point &result, VMesh::Elem::array_type &i, const Core::Geometry::Point &point) const
Definition: VUnstructuredMesh.h:1396
std::vector< ElemInterpolate > MultiElemInterpolate
Definition: VMesh.h:208
Definition: FieldRNG.h:37
VDElemIndex< VMesh::index_type > index_type
Definition: VMesh.h:183
Distinct type for elem index.
Definition: FieldVIndex.h:228
StackVector< index_type, 8 > node_index
Definition: VMesh.h:199
std::vector< StackVector< double, 3 > > coords_array_type
An array of coords.
Definition: VMesh.h:83
virtual void pwl_approx_face(VMesh::coords_array2_type &coords, VMesh::Elem::index_type ci, unsigned int which_face, unsigned int div_per_unit) const
Definition: VUnstructuredMesh.h:471
VNodeIndex< VMesh::index_type > index_type
Definition: VMesh.h:107
Definition: VMesh.h:212
StackVector< double, 9 > inverse_jacobian
Definition: VMesh.h:224
virtual void get_center(Core::Geometry::Point &point, VMesh::Node::index_type i) const
Get the center of a certain mesh element.
Definition: VUnstructuredMesh.h:617
virtual void get_dimensions(VMesh::dimension_type &dim)
Definition: VUnstructuredMesh.h:483
index_type elem_index
Definition: VMesh.h:198
virtual double inverse_jacobian(const VMesh::coords_type &coords, VMesh::Elem::index_type idx, double *Ji) const
Definition: VUnstructuredMesh.h:515
FieldHandle mesh()
Definition: BuildTDCSMatrixTests.cc:56
Definition: Point.h:49
StackBasedVector< double, 64 > weights
Definition: VMesh.h:202
#define SCISHARE
Definition: share.h:39
virtual bool find_closest_elem(double &pdist, Core::Geometry::Point &result, VMesh::coords_type &coords, VMesh::Elem::index_type &i, const Core::Geometry::Point &point) const
Definition: VUnstructuredMesh.h:1371
virtual void node_reserve(size_t size)
Definition: VUnstructuredMesh.h:544
Distinct type for face index.
Definition: FieldVIndex.h:210
Definition: BBox.h:46
Distinct type for edge index.
Definition: FieldVIndex.h:200
Distinct type for elem index.
Definition: FieldVIndex.h:237
VEdgeIndex< VMesh::index_type > index_type
Definition: VMesh.h:128
Definition: VMesh.h:193
virtual void mlocate(std::vector< VMesh::Node::index_type > &i, const std::vector< Core::Geometry::Point > &point) const
Definition: VUnstructuredMesh.h:356
VCellIndex< VMesh::index_type > index_type
Definition: VMesh.h:149
Distinct type for node index.
Definition: FieldVIndex.h:181
VUnstructuredMesh(MESH *mesh)
Constructor: This will initialize VMeshShared and VMesh.
Definition: VUnstructuredMesh.h:45
Definition: Vector.h:63
VENodeIndex< VMesh::index_type > index_type
Definition: VMesh.h:119
virtual void set_point(const Core::Geometry::Point &point, VMesh::Node::index_type i)
Definition: VUnstructuredMesh.h:706
virtual void add_enode(const Core::Geometry::Point &point, VMesh::ENode::index_type &i)
Definition: VUnstructuredMesh.h:750
size_type num_hderivs
Definition: VMesh.h:220
Definition: VMeshShared.h:40
Distinct type for additional lagrangian node.
Definition: FieldVIndex.h:190
virtual void get_gradient_weights(const Core::Geometry::Point &point, VMesh::ElemGradient &eg, int basis_order) const
Same functions but now for determining gradients.
Definition: VUnstructuredMesh.h:1088
long long size_type
Definition: Types.h:40
StackBasedVector< double, 64 > weights
Definition: VMesh.h:221
virtual void get_random_point(Core::Geometry::Point &p, VMesh::Elem::index_type i, FieldRNG &rng) const
Get the location of a random point inside the mesh.
Definition: VUnstructuredMesh.h:769
VFaceIndex< VMesh::index_type > index_type
Definition: VMesh.h:137
virtual bool get_neighbor(VMesh::Elem::index_type &neighbor, VMesh::Elem::index_type elem, VMesh::DElem::index_type delem) const
Get the neighbors of a node or an element.
Definition: VUnstructuredMesh.h:422
virtual void get_normal(Core::Geometry::Vector &norm, VMesh::Node::index_type i) const
Get normals, for surface meshes only.
Definition: VUnstructuredMesh.h:778
virtual double jacobian_metric(const VMesh::Elem::index_type elem) const
Jacobian of local to global transformation.
Definition: VUnstructuredMesh.h:535
virtual void add_node(const Core::Geometry::Point &point, VMesh::Node::index_type &i)
Add a node to a mesh.
Definition: VUnstructuredMesh.h:742
virtual bool find_closest_nodes(std::vector< VMesh::Node::index_type > &nodes, const Core::Geometry::Point &point, double maxdist) const
Definition: VUnstructuredMesh.h:1349
virtual void pwl_approx_edge(VMesh::coords_array_type &coords, VMesh::Elem::index_type ci, unsigned int which_edge, unsigned int div_per_unit) const
Draw non linear elements.
Definition: VUnstructuredMesh.h:461
virtual void interpolate(Core::Geometry::Point &p, const VMesh::coords_type &coords, VMesh::Elem::index_type i) const
Interpolate from local coordinates to global coordinates.
Definition: VUnstructuredMesh.h:390
#define ASSERTFAIL(string)
Definition: Assert.h:52
StackVector< index_type, 12 > edge_index
Definition: VMesh.h:200
virtual double det_jacobian(const VMesh::coords_type &coords, VMesh::Elem::index_type idx) const
Get the jacobian for the global coordinates to local coordinates transformation.
Definition: VUnstructuredMesh.h:494
virtual void elem_reserve(size_t size)
reserve memory by specifying the number of elements that is expected
Definition: VUnstructuredMesh.h:552
virtual void resize_elems(size_t size)
Definition: VUnstructuredMesh.h:568
Distinct type for cell index.
Definition: FieldVIndex.h:219
virtual void jacobian(const VMesh::coords_type &coords, VMesh::Elem::index_type idx, double *J) const
Definition: VUnstructuredMesh.h:504
long long index_type
Definition: Types.h:39
Definition: ParallelLinearAlgebraTests.cc:751
virtual bool get_neighbors(VMesh::Elem::array_type &elems, VMesh::Elem::index_type elem, VMesh::DElem::index_type delem) const
Definition: VUnstructuredMesh.h:433
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
virtual double scaled_jacobian_metric(const VMesh::Elem::index_type elem) const
Element Quality metrics:
Definition: VUnstructuredMesh.h:527
size_type num_derivs
Definition: VMesh.h:223
VElemIndex< VMesh::index_type > index_type
Definition: VMesh.h:168
virtual void size(VMesh::Node::size_type &size) const
Definition: VUnstructuredMesh.h:247
StackBasedVector< index_type, 8 > node_index
Definition: VMesh.h:218
virtual void get_mgradient_weights(const std::vector< Core::Geometry::Point > &point, VMesh::MultiElemGradient &eg, int basis_order) const
Definition: VUnstructuredMesh.h:1148
virtual void get_minterpolate_weights(const std::vector< Core::Geometry::Point > &point, VMesh::MultiElemInterpolate &ei, int basis_order) const
Definition: VUnstructuredMesh.h:879
size_type num_hderivs
Definition: VMesh.h:201
virtual void resize_nodes(size_t size)
Definition: VUnstructuredMesh.h:560
virtual void derivate(VMesh::dpoints_type &p, const VMesh::coords_type &coords, VMesh::Elem::index_type i) const
Interpolate from local coordinates to a derivative in local coordinates.
Definition: VUnstructuredMesh.h:412
virtual bool get_coords(VMesh::coords_type &coords, const Core::Geometry::Point &point, VMesh::Elem::index_type i) const
Find the coordinates of a point in a certain element.
Definition: VUnstructuredMesh.h:380
virtual void minterpolate(std::vector< Core::Geometry::Point > &p, const std::vector< VMesh::coords_type > &coords, VMesh::Elem::index_type i) const
Multiple interpolations from local coordinates to global coordinates.
Definition: VUnstructuredMesh.h:400
std::vector< std::vector< StackVector< double, 3 > > > coords_array2_type
2D array of coords
Definition: VMesh.h:85
std::vector< size_type > dimension_type
Definition: VMesh.h:76
int basis_order
Definition: VMesh.h:216
StackVector< index_type, 12 > edge_index
Definition: VMesh.h:219
virtual bool find_closest_node(double &pdist, Core::Geometry::Point &result, VMesh::Node::index_type &i, const Core::Geometry::Point &point) const
Find the closest point on a surface or a curve.
Definition: VUnstructuredMesh.h:1327
virtual void get_centers(Core::Geometry::Point *points, VMesh::Node::array_type &array) const
Get the centers of a series of nodes.
Definition: VUnstructuredMesh.h:680
virtual Core::Geometry::Point * get_points_pointer() const
Definition: VUnstructuredMesh.h:733
int basis_order
Definition: VMesh.h:197
virtual void get_interpolate_weights(const Core::Geometry::Point &point, VMesh::ElemInterpolate &ei, int basis_order) const
Definition: VUnstructuredMesh.h:794
index_type elem_index
Definition: VMesh.h:217
int size
Definition: eabLatVolData.py:2
virtual bool locate(VMesh::Node::index_type &i, const Core::Geometry::Point &point) const
Definition: VUnstructuredMesh.h:320
std::vector< ElemGradient > MultiElemGradient
Multiple gradient calculations in parallel.
Definition: VMesh.h:229