CrvEdge.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  (c) 2004-2014 Scientific Computation Research Center,
4  Rensselaer Polytechnic Institute. All rights reserved.
5 
6  The LICENSE-SCOREC file included with this distribution describes the terms
7  of the SCOREC Non-Commercial License this program is distributed under.
8 
9 *******************************************************************************/
10 
15 #ifndef CURVEMESH_CRVEDGE_H
16 #define CURVEMESH_CRVEDGE_H
17 
18 #include "CrvEnt.h"
19 #include "ParametricCurve.h"
20 
21 namespace pumi {
22 typedef class mEntity * pNode;
23 }
24 
28 class CrvEdge : public CrvEnt {
29 
30 public:
34  CrvEdge(pMeshEdge pin_edge);
35 
38  CrvEdge(VtxPtrVec in_vert_vec);
39 
42  virtual ~CrvEdge();
43 
44  /* common interface */
45 
48  int display(std::ostream& file, int in_sample_pts);
49 
52  virtual int v_ent_type() const;
53 
56  void eval_deriv1_fd(const Point1d in_param, Point3d & dxyz_dxi, double step = 1.0e-3);
57 
63  double arc_length_between(double a, double b);
64 
67  double arc_length();
68 
69 
72  void get_interp_point_xyz(int index, Point3d & out, int mode = 0);
73 
76  double interp_error();
77 
80  void get_edge_ctrl_pt(int index, Point3d & out_pt);
81 
82  /* pure virtual functions */
83 
86  int get_edge_node_coords(int in_node_index, double *xyz);
87 
90  virtual int v_data_size() const = 0;
91 
94  virtual std::string v_tag_name() const = 0;
95 
98  double dxi_deta(double eta) {
99  return -0.5;
100  }
103  int get_vertex_coords(double *vxyz0, double *vxyz1);
104 
109  int get_orient() {
110  return m_orient;
111  }
112 
116  return m_geom_shape->order();
117  }
118 
121  int LinearMidPt(double * dout_coords);
122 
125  int GetNumNode();
126 
129  int DelNode(int n);
130 
133  pumi::pNode GetNode(int n);
134 
137  void get_mid_edge_ctrl_pt(double * out_xyz);
138 
141  void eval_on_mesh_geom(double in_t, Point3d & out_xyz);
142 
145  int update_or_create_node(double *xyz, double *param);
146 
149  void save_ctrl_pt_data();
150 
151  protected:
153  virtual void v_eval_by_xi (Point3d in, Point3d & out);
154 
156  virtual void v_eval_by_eta(Point3d in, Point3d & out);
157 
159  virtual void v_eval_by_coll_eta(Point3d in, Point3d & out);
160 
162  virtual void v_diff_by_xi(Point3d in, Mat3x3 & out);
163 
165  virtual void v_diff_by_xi(Point3d in, int j, Point3d & out);
166 
168  virtual void v_diff_by_eta(Point3d in, Mat3x3 & out);
169 
171  virtual void v_diff_by_eta(Point3d in, int j, Point3d & out);
172 
174  virtual int v_get_exp_dim() {
175  return 1;
176  }
177 
179  pCurveGeom get_geom_shape() {
180  return m_geom_shape;
181  }
182 
184  void set_geom_shape(pCurveGeom & in_geom) {
185  m_geom_shape = in_geom;
186  }
187 
189  pCurveGeom m_geom_shape;
190 
195  int m_orient;
196  private:
197 
200  void get_interp_point_bisect(int index, Point3d & out);
201 
204  void get_interp_point_newton_iter(int index, Point3d & out);
205 };
206 #endif//CURVEMESH_CRVEDGE_H
int GetNumNode()
get the total number of high-order nodes
Definition: CrvEdge.cc:397
double arc_length()
Evaluate total arc length.
Definition: CrvEdge.cc:138
pCurveGeom m_geom_shape
geom shape pointer
Definition: CrvEdge.h:189
void set_geom_shape(pCurveGeom &in_geom)
set the geom curve object
Definition: CrvEdge.h:184
int LinearMidPt(double *dout_coords)
get the mid-point coordinates w.r.t a straight edge
Definition: CrvEdge.cc:342
virtual int v_ent_type() const
returns entity type representing an edge
Definition: CrvEdge.cc:89
void eval_deriv1_fd(const Point1d in_param, Point3d &dxyz_dxi, double step=1.0e-3)
Evaluate first derivative numerically by finite difference.
Definition: CrvEdge.cc:96
void get_interp_point_xyz(int index, Point3d &out, int mode=0)
Evaluate interpolation point position by B-C points in the physical space.
Definition: CrvEdge.cc:142
pumi::pNode GetNode(int n)
get the n'th edge node
Definition: CrvEdge.cc:425
virtual void v_diff_by_xi(Point3d in, Mat3x3 &out)
derivatives w.r.t. barycentric coords
Definition: CrvEdge.cc:316
virtual void v_diff_by_eta(Point3d in, Mat3x3 &out)
derivatives w.r.t. standard cartesian coords
Definition: CrvEdge.cc:308
Definition: CrvEdge.h:21
double arc_length_between(double a, double b)
Evaluate arc length between parameter range [a, b].
Definition: CrvEdge.cc:109
base class for curved edge curve edge provides basic evaluation based on barycentric coordinate syste...
Definition: CrvEdge.h:28
void save_ctrl_pt_data()
save edge ctrl points data to mesh database
Definition: CrvEdge.cc:445
int get_orient()
edge orientation with respect to the input ordered vertices 0 – in the same direction 1 – opposite ...
Definition: CrvEdge.h:109
virtual int v_data_size() const =0
Get the size of the data attached to the edge entity.
virtual int v_get_exp_dim()
expansion dim for edge is set to be 1
Definition: CrvEdge.h:174
int update_or_create_node(double *xyz, double *param)
update or create an edge node based on input coords/params
Definition: CrvEdge.cc:407
CrvEdge(pMeshEdge pin_edge)
Definition: CrvEdge.cc:22
void eval_on_mesh_geom(double in_t, Point3d &out_xyz)
evaluate based on mesh geometry
Definition: CrvEdge.cc:386
virtual ~CrvEdge()
Definition: CrvEdge.cc:40
virtual void v_eval_by_coll_eta(Point3d in, Point3d &out)
common implementation for all crv edges w.r.t. standard cartesian coords
Definition: CrvEdge.cc:291
void get_mid_edge_ctrl_pt(double *out_xyz)
get the mid-edge Bezier control point
Definition: CrvEdge.cc:360
virtual void v_eval_by_xi(Point3d in, Point3d &out)
common implementation for all crv edge classes
Definition: CrvEdge.cc:272
int display(std::ostream &file, int in_sample_pts)
Function to display the curve edge by sampling edge points.
Definition: CrvEdge.cc:58
int get_geom_order()
return the polynomial order of the geometric shape functions
Definition: CrvEdge.h:115
int m_orient
Definition: CrvEdge.h:195
pCurveGeom get_geom_shape()
return the geom curve object
Definition: CrvEdge.h:179
virtual std::string v_tag_name() const =0
Get the tag name of the attached data.
int get_vertex_coords(double *vxyz0, double *vxyz1)
get coordinates of the end vertices
Definition: CrvEdge.cc:44
void get_edge_ctrl_pt(int index, Point3d &out_pt)
Get the i'th control point of the curved edge.
Definition: CrvEdge.cc:52
virtual void v_eval_by_eta(Point3d in, Point3d &out)
common implementation for all crv edges w.r.t. standard cartesian coords
Definition: CrvEdge.cc:284
int get_edge_node_coords(int in_node_index, double *xyz)
Get high order nodal coordinates associated with the curved edge.
Definition: CrvEdge.cc:430
void get_interp_point_newton_iter(int index, Point3d &out)
Evaluate interpolation point position by Babuska-Chen nodal set through Newton root finding method...
Definition: CrvEdge.cc:154
void get_interp_point_bisect(int index, Point3d &out)
Evaluate interpolation point position by Babuska-Chen nodal set through recursive bisection...
Definition: CrvEdge.cc:192
base class for curved mesh entity
Definition: CrvEnt.h:21
int DelNode(int n)
delete the n'th edge node
Definition: CrvEdge.cc:402
double dxi_deta(double eta)
derivative of with respect to
Definition: CrvEdge.h:98
double interp_error()
Evaluate geometric interpolation error.
Definition: CrvEdge.cc:221