Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PN_patch.h File Reference
#include "mopbasic.h"
Include dependency graph for PN_patch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MOP_BEGIN_NAMESPACE Vector_3
< double > 
PN_project (std::vector< int * > v_ids, Vector_3< double > bcoords, const Vector_3< double > *pnts, const Vector_3< double > *vnrms, const Vector_3< double > *evects, const Vector_3< double > *evals, const Vector_3< double > *bs, const int *tranks, std::vector< bool > is_ridge[4])
 
void project_edge (int v_id, int t_id, int id3, Vector_3< double > v_crd, Vector_3< double > t_crd, Vector_3< double > &p_crd, Vector_3< double > &p2_crd, const Vector_3< double > *pnts, const Vector_3< double > *vnrms, const Vector_3< double > *evects, const Vector_3< double > *evals, const Vector_3< double > *bs, const int *tranks, bool is_ridge)
 
Vector_3< double > one_sided_normal (int id1, int id2, int id3, const Vector_3< double > *evects, const Vector_3< double > *pnts, const Vector_3< double > *evals, const Vector_3< double > *vnorms, const Vector_3< double > *bs)
 

Function Documentation

Vector_3<double> one_sided_normal ( int  id1,
int  id2,
int  id3,
const Vector_3< double > *  evects,
const Vector_3< double > *  pnts,
const Vector_3< double > *  evals,
const Vector_3< double > *  vnorms,
const Vector_3< double > *  bs 
)

Definition at line 156 of file PN_patch.C.

References Vector_3< Type >::cross_product(), i, j, Vector_3< Type >::normalize(), sqrt(), and y.

Referenced by project_edge().

161  {
162  int i = ((evects[3*id1-3]*bs[id1-1]/-evals[id1-1][0]) >
163  (evects[3*id1-2]*bs[id1-1]/-evals[id1-1][1])) ? 0 : 1;
164  int j = 1-i;
165  Vector_3<double> os = std::sqrt(evals[id1-1][i]) * vnorms[id1-1];
166  Vector_3<double> fnormal = Vector_3<double>::cross_product(pnts[id2-1]-pnts[id1-1],
167  pnts[id3-1]-pnts[id1-1]);
168  Vector_3<double> y = Vector_3<double>::cross_product(vnorms[id1-1],evects[3*id1-1]);
169  if(fnormal*y >= 0)
170  os += std::sqrt(evals[id1-1][j])*y;
171  else
172  os -= std::sqrt(evals[id1-1][j])*y;
173  os.normalize();
174  return os;
175 }
void int int REAL REAL * y
Definition: read.cpp:74
double sqrt(double d)
Definition: double.h:73
Vector_3 & normalize()
Definition: mapbasic.h:114
blockLoc i
Definition: read.cpp:79
static Vector_3 cross_product(const Vector_3 &v, const Vector_3 &w)
Definition: mapbasic.h:104
j indices j
Definition: Indexing.h:6

Here is the call graph for this function:

Here is the caller graph for this function:

MOP_BEGIN_NAMESPACE Vector_3<double> PN_project ( std::vector< int * >  v_ids,
Vector_3< double >  bcoords,
const Vector_3< double > *  pnts,
const Vector_3< double > *  vnrms,
const Vector_3< double > *  evects,
const Vector_3< double > *  evals,
const Vector_3< double > *  bs,
const int *  tranks,
std::vector< bool >  is_ridge[4] 
)
void project_edge ( int  v_id,
int  t_id,
int  id3,
Vector_3< double >  v_crd,
Vector_3< double >  t_crd,
Vector_3< double > &  p_crd,
Vector_3< double > &  p2_crd,
const Vector_3< double > *  pnts,
const Vector_3< double > *  vnrms,
const Vector_3< double > *  evects,
const Vector_3< double > *  evals,
const Vector_3< double > *  bs,
const int *  tranks,
bool  is_ridge 
)

Definition at line 103 of file PN_patch.C.

References COM_assertion_msg, Vector_3< Type >::normalize(), and one_sided_normal().

Referenced by PN_project().

115 {
116  // convert from ids to indices
117  v_id -=1;
118  t_id -=1;
119  Vector_3<double> vp_vect = (v_crd-p_crd);
120  Vector_3<double> f(0.0,0.0,0.0);
121  switch(tranks[v_id]) {
122  case 2:{ // V is smooth
123  f = (vp_vect)*evects[3*v_id]*evects[3*v_id];
124  break;
125  }
126  case 1:{ // V is a ridge
127  if(is_ridge) // edge VT is on the ridge
128  f = vp_vect - vp_vect*evects[3*v_id+2]*evects[3*v_id+2];
129  else{ // edge VT is not part of the ridge
130  Vector_3<double> n_os =
131  one_sided_normal(v_id+1,t_id+1,id3,
132  evects,
133  pnts,
134  evals,
135  vnrms,
136  bs);
137  // one_sided_normal(v_id,n_os);
138  f = vp_vect*n_os*n_os;
139  }
140  break;
141  }
142  case 0:{ // V is a corner, do nothing.
143  return;
144  }
145  default :
146  COM_assertion_msg(0, "Invalid tangent space size");
147  }
148  if(tranks[t_id]==0){// Other point is a corner, handle it here.
149  Vector_3<double> tangent = p_crd - v_crd;
150  tangent.normalize();
151  p2_crd += f - 2.0*f*tangent*tangent;
152  }
153  p_crd += f;
154 }
#define COM_assertion_msg(EX, msg)
Vector_3 & normalize()
Definition: mapbasic.h:114
Vector_3< double > one_sided_normal(int id1, int id2, int id3, const Vector_3< double > *evects, const Vector_3< double > *pnts, const Vector_3< double > *evals, const Vector_3< double > *vnorms, const Vector_3< double > *bs)
Definition: PN_patch.C:156

Here is the call graph for this function:

Here is the caller graph for this function: