Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FaceOffset_3.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: FaceOffset_3.h,v 1.23 2008/12/06 08:45:27 mtcampbe Exp $
24 
25 /*******************************************************************
26  * This file implements the Face Offsetting Method for
27  * interface propagation. It inherits some basic primitives
28  * from the base class Propagation_3.
29  *******************************************************************/
30 
31 #ifndef _FACE_OFFSET_3_H_
32 #define _FACE_OFFSET_3_H_
33 
34 #include "Propagation_3.h"
35 #include "Element_accessors.h"
36 
38 
39 class FaceOffset_3 : public Propagation_3 {
40  typedef std::map<Edge_ID,std::pair<int, int> > ObscendSet;
41 public:
43  FaceOffset_3() : _is_strtd(0), _As(NULL), _boffset(NULL), _bmedial(NULL),
44  _eigvalues(NULL), _eigvecs(NULL), _vnormals(NULL),
45  _facenormals(NULL), _facecenters(NULL),
46  _faceareas(NULL), _vcenters(NULL), _tangranks(NULL),
47  _ctangranks(NULL), _scales(NULL), _weights(NULL)
49 
51  FaceOffset_3( Manifold *wm, COM::Window *buf);
52 
53  virtual ~FaceOffset_3() {}
54 
57  virtual double time_stepping( const COM::Attribute *spds, double dt,
58  COM::Attribute *disps, int *smoothed=NULL);
59 
61  void set_wavefrontal_expansion( bool b) { _wf_expn = b; }
62 
64  bool get_wavefrontal_expansion() const { return _wf_expn; }
65 
67  void set_normal_diffusion( char i) { _nrm_dfsn = i; }
68 
70  void set_feature_layer( bool b) { _feature_layer = b; }
71 
73  int get_normal_diffuion() const { return _nrm_dfsn; }
74 
76  void set_eigen_threshold( double eps)
77  { _eig_thres = eps; COM_assertion( eps>0 && eps<1); }
78 
80  double get_eigen_threshold() const { return _eig_thres; }
81 
83  void set_courant_constant( double c)
84  { _courant = c; _inv_sqrt_c = 1/std::sqrt(c); COM_assertion(0<=c && c<1); }
85 
87  double get_courant_constant() const { return _courant; }
88 
90  void set_weighting_scheme( int w) { _wght_scheme = w; }
91  int get_weighting_scheme() const { return _wght_scheme; }
92 
94  void set_fangle_weak( double psi) {
95  _tol_angle_weak = psi * pi/180;
97  }
98 
100  void set_fangle_strong( double psi) {
101  _tol_angle_strong = psi * pi/180;
102  }
103 
105  void set_fangle_turn( double psi) {
106  _tol_cos_osta = std::cos(psi * pi/360);
107  }
108 
110  double get_fangle_weak_radians() const
111  { return _tol_angle_weak; }
112 
115  { return _tol_angle_strong; }
116 
118  double get_fangle_turn_radians() const
119  { return std::acos(_tol_cos_osta)*2; }
120 
122  void set_smoother( int smoother) { _smoother = smoother; }
123 
125  void set_conserve( int b) { _conserv = b; }
126 
127  // Set parameters to default values
128  void reset_default_parameters( bool b=false);
129 
130 protected:
132  void numerical_dissipation( COM::Attribute *nodal_buffer);
133 
135  void compute_quadrics( double dt, const COM::Attribute *spds,
136  COM::Attribute *rhs, COM::Attribute *predicted);
137 
139  void compute_directions( COM::Attribute *b_offset, bool in_principle);
140 
142  void compute_volume_vector( const COM::Attribute *disps, COM::Attribute *bs);
143 
145  bool obtain_constrained_directions( COM::Attribute *disps,
146  COM::Attribute *vcenters);
147 
151  double rescale_displacements( COM::Attribute *disps, COM::Attribute *vcenters,
152  int depth=0);
153 
155  void filter_and_identify_ridge_edges( bool filter_curves);
156 
157  // Upgrade/downgrade vertices between ridge and smooth vertices
158  void reclassify_ridge_vertices( const bool upgrade_corners,
159  const bool upgrade_ridge,
160  COM::Attribute *neighbor_feas,
161  COM::Attribute *tr_attr,
162  bool to_filter);
163 
166  int build_ridge_neighbor_list( const COM::Attribute *maxtrnangv,
167  const COM::Attribute *mintrnangv,
168  const std::vector<std::map<Edge_ID, double> > &edge_maps,
169  const COM::Attribute *maxranglev,
170  const COM::Attribute *minranglev,
171  const std::vector<std::map<Edge_ID, double> > &rangle_maps,
172  std::vector< ObscendSet > &obscends);
173 
174  int append_obscure_ends( const COM::Attribute *maxtrnangv,
175  const COM::Attribute *mintrnangv,
176  const std::vector<std::map<Edge_ID, double> > &edge_maps,
177  const COM::Attribute *maxranglev,
178  const COM::Attribute *minranglev,
179  const std::vector<std::map<Edge_ID, double> > &rangle_maps);
180 
182  bool filter_obscended_ridge( const std::vector<std::map<Edge_ID, double> > &edge_maps,
183  const std::vector<std::map<Edge_ID, double> > &diangl_maps,
184  const std::vector< ObscendSet > &obscends);
185 
186  int remove_obscure_curves( const std::vector< ObscendSet > &obscends);
187 
189  void mark_weak_vertices();
190 
192  void nulaplacian_smooth( const COM::Attribute *vert_normals,
193  const COM::Attribute *tangranks,
194  const COM::Attribute *disps,
195  COM::Attribute *vcenters,
196  COM::Attribute *buf,
197  COM::Attribute *vert_weights_buf,
198  const COM::Attribute *edge_weights=NULL);
199 
200  // Balance mass.
201  void balance_mass();
202 
203  // Distribute volume from smooth nodes to elements
204  void distribute_volume_e2n( const COM::Attribute *fvol,
205  const COM::Attribute *tranks,
206  COM::Attribute *vvol);
207 
208  void update_face_volumes( const COM::Attribute *fnormal,
209  const COM::Attribute *vdsps,
210  COM::Attribute *fvol);
211 
212  // Adjust the normal displacements for wavefrontal motion.
213  void adjust_wavefrontal_motion( COM::Attribute *disps);
214 
215  // \param det: <0 indicates expansion and >0 indicates contraction
216  // \param delta: "exact" motion along the normal direction
217  // \param disp_nz: offset direction (unit length)
218  // \param nrm_nz: normal direction of the face (unit length).
219  std::pair<double,double>
220  comp_wavefrontal_motion( double det, double w, double delta,
221  const Vector_3 &disp_nz, const Vector_3 &nrm_nz);
222 
223 protected:
224  // Solve the minimization problem (x^T)Ax+2b^Tx with eigen-decomposition
225  // at a vertex, return the codimension of the vertex, and save mean
226  // normal in x_nz.
227  int eigen_analyze_vertex( Vector_3 A_io[3], Vector_3 &b_io,
228  double angle_defect=0);
229 
230  void obtain_directions( Vector_3 es[3], const Vector_3 &lambdas, int nrank,
231  Vector_3 &b_medial, Vector_3 *b_offset=NULL) const;
232 
233  // Obtain the normal and center of the face offset.
234  // Return the displacement of the face center along normal direction.
235  void obtain_face_offset( const Point_3 *pnts, const double *spd_ptr,
236  const COM::Attribute *spd, double dt,
237  const Vector_3 *dirs,
238  COM::Element_node_enumerator &ene,
239  Vector_3 &ns_nz, Point_3 &cnt,
240  Vector_3 *disps, Vector_3 *ns);
241 
242  void get_tangents( const Vector_3 *es, const Vector_3 &lambdas,
243  const Vector_3 &mn, int nrank,
244  Vector_3 vs[2], double scales[2],
245  int *is_strong=NULL) const;
246 
247  // Compute anisotropic vertex center.
248  void compute_anisotropic_vertex_centers( const COM::Attribute *disps_buf);
249 
250  // Compute a normal motino to denoise surface.
251  void denoise_surface( const COM::Attribute *disps_buf,
252  COM::Attribute *normal_motion);
253 
254  void get_primary_component( const Vector_3 &nrm, const Vector_3 es[],
255  int trank, Vector_3 &prim) const {
256  prim = Vector_3(0,0,0);
257 
258  for ( int i=0; i<3-trank; ++i) prim += nrm*es[i]*es[i];
259  }
260 
261  // Append boundary edges separating different constraints into ridge edges.
262  // Return the total number of inserted edges.
263  int insert_boundary_edges( COM::Attribute *tr_attr);
264 
265  // Update tangential motion of ridge vertices
266  void update_vertex_centers();
267 
268 protected: // Utilities.
269  // Helpers for linear solvers for 2x2 and 3x3 equations.
270  template <class FT>
271  static void solve (const FT &a1, const FT &a2,
272  const FT &b1, const FT &b2,
273  const FT &c1, const FT &c2,
274  FT &x, FT &y)
275  {
276  FT denom = a1*b2-b1*a2;
277 
278  x = - (b1*c2-c1*b2)/denom;
279 
280  y = (a1*c2-c1*a2)/denom;
281  }
282 
283  template <class FT>
284  static void solve (const FT &a1, const FT &a2, const FT &a3,
285  const FT &b1, const FT &b2, const FT &b3,
286  const FT &c1, const FT &c2, const FT &c3,
287  const FT &d1, const FT &d2, const FT &d3,
288  FT &x, FT &y, FT &z)
289  {
290  FT denom = b2*c1*a3-b1*c2*a3+c3*b1*a2+b3*c2*a1-c1*b3*a2-b2*c3*a1;
291 
292  x = - (b2*c3*d1-b2*c1*d3+c1*b3*d2+b1*c2*d3-c3*b1*d2-b3*c2*d1)/denom;
293 
294  z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom;
295 
296  y = (a2*c3*d1-a2*c1*d3-c2*d1*a3+c2*a1*d3+d2*c1*a3-d2*c3*a1)/denom;
297  }
298 
299  // Wrapper for solving 3x3 equations
300  static void solve ( const Vector_3 A[3],
301  const Vector_3 &q,
302  Vector_3 &x) {
303  solve( A[0][0], A[0][1], A[0][2], A[1][0], A[1][1], A[1][2],
304  A[2][0], A[2][1], A[2][2], q[0], q[1], q[2],
305  x[0], x[1], x[2]);
306  }
307 
308  // Solve for equation a*t^2+b*t+c=0 and find the roots between 0 and 1.
309  std::pair<double,double>
310  solve_quadratic_func( double a, double b, double c);
311 
312  double sign( double x) {
313  if ( x==0) return 0;
314  if ( x>0) return 1;
315  return -1;
316  }
317 
318  static Vector_2 proj( const Vector_3 &v,
319  const Vector_3 &d1, const Vector_3 &d2) {
320  return Vector_2( v*d1, v*d2);
321  }
322 
323  static double eval_angle( const Vector_3 &v1, const Vector_3 &v2) {
324  double sqrnrm = v1.squared_norm()*v2.squared_norm();
325  if ( sqrnrm==0) return 0;
326  double s=v1*v2/std::sqrt( sqrnrm);
327  if (s>1) s=1; else if (s<-1) s =-1;
328  return std::acos(s);
329  }
330 
331  static double eval_angle( const Vector_2 &v1, const Vector_2 &v2) {
332  double sqrnrm = v1.squared_norm()*v2.squared_norm();
333  if ( sqrnrm==0) return 0;
334  double s=v1*v2/std::sqrt( sqrnrm);
335  if (s>1) s=1; else if (s<-1) s =-1;
336  return std::acos(s);
337  }
338 
339  // Compute weighted one-sided normal at a vertex
341  const Vector_3 &lambdas,
342  int trank,
343  const Vector_3 &mean_nrm,
344  const Vector_3 &face_nrm);
345 
346  // Compute eigenvalues and eigenvectors of a squared matrix A of order 3.
347  // At output, the eigenvalues are saved in lambdas in decending order,
348  // and A is replaced by the orthonormal eigenvectors.
349  static void compute_eigenvectors( Vector_3 A[3],
350  Vector_3 &lambdas);
351 
352  bool is_acute_ridge( const Vector_3 *es, const Vector_3 &lambdas,
353  const Vector_3 &mn, int nrank) const {
354  return nrank!=1 && std::abs(es[0]*mn)<=std::abs(es[1]*mn);
355  }
356 
357  bool is_acute_corner( const Vector_3 *es, const Vector_3 &lambdas,
358  const Vector_3 &mn, int nrank) const {
359 
360  return nrank==3 && ( std::abs(es[0]*mn)<=std::abs(es[1]*mn) ||
361  std::abs(es[0]*mn)<=std::abs(es[2]*mn));
362  }
363 
364 
365  bool is_strong( const Vector_3 *es, const Vector_3 &lambdas,
366  const Vector_3 &mn, int nrank) const;
367 
368 
369  // Obtain nonuniform weight for surface fairing.
370  double get_nonuniform_weight( const Vector_3 &lambdas, int trank);
371 
372 protected:
373  bool _wf_expn; //< Whether expansion is wavefrontal
374  char _wght_scheme; //< Weighting scheme
375  char _nrm_dfsn; //< Number of iterations to perform diffusion
376  char _smoother; //< Choice of mesh smoother.
377 
378  double _courant; //< Constant in front of CFL condition (0<c<1)
379  double _inv_sqrt_c; //< reciprocal of squared root of c
380 
381  double _dir_thres_weak; //< Threshold for weak features
382  double _dir_thres_strong; //< Threshold for strong featuers
383 
384  double _tol_angle_weak; //< Threshold for weak dih-angles \theta_f
385  double _tol_angle_strong; //< Threshold for strong dih-angle \theta_F
386 
387  int _tol_kstrong; //< number of strong edges.
388  double _tol_kangle; //< Strong-angle threshold
389  double _tol_eangle; //< Semi-strong end-edge angle threshold
390 
391  double _tol_cos_osta; //< Threshold for turning angle
392  double _tol_turn_angle; //< Threshold for turning angle
393  double _tol_ad; //< Threshold for angle defect
394  double _eig_thres; //< Threshold for range-null psace.
395 
396  double _eig_weak_lb; //< Lower bound for weak vertices.
397  double _eig_weak_ub; //< Upper bound for weak vertices.
398 
399  bool _conserv; //< Whether or not to conserve mass
400  bool _is_strtd; //< Whether it is for structured mesh
401  bool _feature_layer; //< Whether to create a feature layer
402 
403  COM::Attribute *_As; //< Stores the covariant matrix for each vertex
404  COM::Attribute *_boffset; //< Store the right-hande side of offset quadric
405  COM::Attribute *_bmedial; //< Store the right-hande side of medial quadric
406  COM::Attribute *_eigvalues; //< Stores eigenvalues
407  COM::Attribute *_eigvecs; //< Stores orthonormal eigenvectors for each
408  //< vertex in increasing order of eigenvalues
409 
410  COM::Attribute *_vnormals; //< Stores vertex normals from eigen-decompo
411  //< used for projection
412  COM::Attribute *_facenormals; //< Stores the normals of each offset face.
413  COM::Attribute *_facecenters; //< Stores the centers of each offset face.
414  COM::Attribute *_faceareas; //< Areas of each face
415  COM::Attribute *_vcenters; //< Vector between center of mass and vertex
416 
417  COM::Attribute *_tangranks; //< Stores the ranks of tangent spaces
418  COM::Attribute *_ctangranks; //< Stores the ranks of tangent spaces with constraints
419  COM::Attribute *_weak; //< Marks whether a vertex is weak feature.
420  COM::Attribute *_strong; //< Marks whether a vertex is strong feature.
421  COM::Attribute *_ridges; //< List ridge edges.
422  COM::Attribute *_ridgeneighbors;//< List neighbor vertices.
423 
424  COM::Attribute *_scales; //< Stores rescaling factors
425  COM::Attribute *_weights; //< Buffer for storing weights
426 
427  std::vector<std::set< Edge_ID> > _edges; // ridge edges
428 
429  static const double pi;
430 };
431 
433 
434 #endif
435 
436 
437 
438 
439 
440 
COM::Attribute * _scales
Definition: FaceOffset_3.h:424
COM::Attribute * _ridgeneighbors
Definition: FaceOffset_3.h:422
void set_wavefrontal_expansion(bool b)
Set the wavefrontal switch.
Definition: FaceOffset_3.h:61
SURF::Vector_2< Real > Vector_2
Definition: rfc_basic.h:44
static void compute_eigenvectors(Vector_3 A[3], Vector_3 &lambdas)
COM::Attribute * _eigvalues
Definition: FaceOffset_3.h:406
void compute_volume_vector(const COM::Attribute *disps, COM::Attribute *bs)
Compute volumn-vector.
int insert_boundary_edges(COM::Attribute *tr_attr)
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
void set_fangle_turn(double psi)
Set the threshold for weak-feature angle.
Definition: FaceOffset_3.h:105
std::pair< double, double > comp_wavefrontal_motion(double det, double w, double delta, const Vector_3 &disp_nz, const Vector_3 &nrm_nz)
#define PROP_END_NAMESPACE
Definition: propbasic.h:29
COM::Attribute * _As
Definition: FaceOffset_3.h:403
double _tol_kangle
Definition: FaceOffset_3.h:388
virtual double time_stepping(const COM::Attribute *spds, double dt, COM::Attribute *disps, int *smoothed=NULL)
Main entry of the algorithm.
Definition: FaceOffset_3.C:160
double _eig_weak_ub
Definition: FaceOffset_3.h:397
void int int REAL REAL * y
Definition: read.cpp:74
void obtain_face_offset(const Point_3 *pnts, const double *spd_ptr, const COM::Attribute *spd, double dt, const Vector_3 *dirs, COM::Element_node_enumerator &ene, Vector_3 &ns_nz, Point_3 &cnt, Vector_3 *disps, Vector_3 *ns)
Definition: FaceOffset_3.C:332
void filter_and_identify_ridge_edges(bool filter_curves)
Filter out isolated ridge vertices and identify ridge edges.
bool obtain_constrained_directions(COM::Attribute *disps, COM::Attribute *vcenters)
Decompose propagation directions based on constraints.
Definition: FaceOffset_3.C:506
NT rhs
static double eval_angle(const Vector_2 &v1, const Vector_2 &v2)
Definition: FaceOffset_3.h:331
#define PROP_BEGIN_NAMESPACE
Definition: propbasic.h:28
double s
Definition: blastest.C:80
double _tol_cos_osta
Definition: FaceOffset_3.h:391
static void solve(const FT &a1, const FT &a2, const FT &a3, const FT &b1, const FT &b2, const FT &b3, const FT &c1, const FT &c2, const FT &c3, const FT &d1, const FT &d2, const FT &d3, FT &x, FT &y, FT &z)
Definition: FaceOffset_3.h:284
COM::Attribute * _vcenters
Definition: FaceOffset_3.h:415
double _tol_ad
Definition: FaceOffset_3.h:393
COM::Attribute * _faceareas
Definition: FaceOffset_3.h:414
COM::Attribute * _boffset
Definition: FaceOffset_3.h:404
void update_vertex_centers()
void get_primary_component(const Vector_3 &nrm, const Vector_3 es[], int trank, Vector_3 &prim) const
Definition: FaceOffset_3.h:254
void compute_directions(COM::Attribute *b_offset, bool in_principle)
Compute mean normals.
Definition: FaceOffset_3.C:447
SURF::Vector_3< Real > Vector_3
Definition: rfc_basic.h:42
COM::Attribute * _tangranks
Definition: FaceOffset_3.h:417
void set_weighting_scheme(int w)
Weighting scheme.
Definition: FaceOffset_3.h:90
double sqrt(double d)
Definition: double.h:73
void set_fangle_weak(double psi)
Set the threshold for weak-feature angle.
Definition: FaceOffset_3.h:94
CImg< _cimg_Tfloat > tan(const CImg< T > &instance)
Definition: CImg.h:6046
std::pair< double, double > solve_quadratic_func(double a, double b, double c)
Definition: FaceOffset_3.C:772
static void solve(const Vector_3 A[3], const Vector_3 &q, Vector_3 &x)
Definition: FaceOffset_3.h:300
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
double _inv_sqrt_c
Definition: FaceOffset_3.h:379
void set_fangle_strong(double psi)
Set the threshold for weak-feature angle.
Definition: FaceOffset_3.h:100
void denoise_surface(const COM::Attribute *disps_buf, COM::Attribute *normal_motion)
COM::Attribute * _eigvecs
Definition: FaceOffset_3.h:407
double _tol_angle_strong
Definition: FaceOffset_3.h:385
static double square(double x)
bool is_strong(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
COM::Attribute * _facecenters
Definition: FaceOffset_3.h:413
double _eig_weak_lb
Definition: FaceOffset_3.h:396
double _tol_eangle
Definition: FaceOffset_3.h:389
rational * A
Definition: vinci_lass.c:67
Type squared_norm() const
Definition: mapbasic.h:236
int get_weighting_scheme() const
Definition: FaceOffset_3.h:91
double _dir_thres_strong
Definition: FaceOffset_3.h:382
Vector_3 compute_weighted_normal(Vector_3 es[3], const Vector_3 &lambdas, int trank, const Vector_3 &mean_nrm, const Vector_3 &face_nrm)
void distribute_volume_e2n(const COM::Attribute *fvol, const COM::Attribute *tranks, COM::Attribute *vvol)
Definition: cons_diff.C:105
bool is_acute_ridge(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
Definition: FaceOffset_3.h:352
SURF::Window_manifold_2 Manifold
Definition: propbasic.h:46
void int int int REAL REAL REAL * z
Definition: write.cpp:76
double _tol_angle_weak
Definition: FaceOffset_3.h:384
double _dir_thres_weak
Definition: FaceOffset_3.h:381
double get_fangle_weak_radians() const
Get the threshold for weak-feature angle.
Definition: FaceOffset_3.h:110
void set_conserve(int b)
Set mass conservation.
Definition: FaceOffset_3.h:125
void compute_quadrics(double dt, const COM::Attribute *spds, COM::Attribute *rhs, COM::Attribute *predicted)
Compute quadrics for every vertex.
blockLoc i
Definition: read.cpp:79
void reset_default_parameters(bool b=false)
Definition: FaceOffset_3.C:44
void int int REAL * x
Definition: read.cpp:74
void reclassify_ridge_vertices(const bool upgrade_corners, const bool upgrade_ridge, COM::Attribute *neighbor_feas, COM::Attribute *tr_attr, bool to_filter)
COM::Attribute * _bmedial
Definition: FaceOffset_3.h:405
virtual ~FaceOffset_3()
Definition: FaceOffset_3.h:53
std::map< Edge_ID, std::pair< int, int > > ObscendSet
Definition: FaceOffset_3.h:40
COM::Attribute * _weights
Definition: FaceOffset_3.h:425
int build_ridge_neighbor_list(const COM::Attribute *maxtrnangv, const COM::Attribute *mintrnangv, const std::vector< std::map< Edge_ID, double > > &edge_maps, const COM::Attribute *maxranglev, const COM::Attribute *minranglev, const std::vector< std::map< Edge_ID, double > > &rangle_maps, std::vector< ObscendSet > &obscends)
Build the list of ridge nighbors and obtain a list of weak-ended vertices Return the number of obscen...
Type squared_norm() const
Definition: mapbasic.h:110
void update_face_volumes(const COM::Attribute *fnormal, const COM::Attribute *vdsps, COM::Attribute *fvol)
void obtain_directions(Vector_3 es[3], const Vector_3 &lambdas, int nrank, Vector_3 &b_medial, Vector_3 *b_offset=NULL) const
Definition: FaceOffset_3.C:475
void compute_anisotropic_vertex_centers(const COM::Attribute *disps_buf)
bool is_acute_corner(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank) const
Definition: FaceOffset_3.h:357
static double eval_angle(const Vector_3 &v1, const Vector_3 &v2)
Definition: FaceOffset_3.h:323
double get_fangle_strong_radians() const
Get the threshold for strong-feature angle.
Definition: FaceOffset_3.h:114
COM::Attribute * _weak
Definition: FaceOffset_3.h:419
COM::Attribute * _ridges
Definition: FaceOffset_3.h:421
int append_obscure_ends(const COM::Attribute *maxtrnangv, const COM::Attribute *mintrnangv, const std::vector< std::map< Edge_ID, double > > &edge_maps, const COM::Attribute *maxranglev, const COM::Attribute *minranglev, const std::vector< std::map< Edge_ID, double > > &rangle_maps)
double get_eigen_threshold() const
Get the threshold of eigenvalues for splitting primary and null spaces.
Definition: FaceOffset_3.h:80
double det(const Matrix3D &A)
static void solve(const FT &a1, const FT &a2, const FT &b1, const FT &b2, const FT &c1, const FT &c2, FT &x, FT &y)
Definition: FaceOffset_3.h:271
double get_courant_constant() const
Get the constant in front of CFL condition (0&lt;=c&lt;=1)
Definition: FaceOffset_3.h:87
void mark_weak_vertices()
Mark vertices that are weak.
int get_normal_diffuion() const
Get number of iterations for normal diffusion.
Definition: FaceOffset_3.h:73
double rescale_displacements(COM::Attribute *disps, COM::Attribute *vcenters, int depth=0)
Reduce time step based on stability limit, and rescale displacements by the reduced time step and dif...
Definition: FaceOffset_3.C:654
static const double pi
Definition: FaceOffset_3.h:429
double _eig_thres
Definition: FaceOffset_3.h:394
double get_fangle_turn_radians() const
Set the threshold for weak-feature angle.
Definition: FaceOffset_3.h:118
void set_feature_layer(bool b)
Set whether or not to use feature layer.
Definition: FaceOffset_3.h:70
NT q
std::vector< std::set< Edge_ID > > _edges
Definition: FaceOffset_3.h:427
bool get_wavefrontal_expansion() const
Obtain the wavefrontal switch.
Definition: FaceOffset_3.h:64
void set_courant_constant(double c)
Set the constant in front of CFL condition (0&lt;=c&lt;1)
Definition: FaceOffset_3.h:83
NT abs(const NT &x)
Definition: number_utils.h:130
COM::Attribute * _vnormals
Definition: FaceOffset_3.h:410
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Definition: CImg.h:6051
Some basic geometric data types.
Definition: mapbasic.h:54
double sign(double x)
Definition: FaceOffset_3.h:312
double get_nonuniform_weight(const Vector_3 &lambdas, int trank)
void adjust_wavefrontal_motion(COM::Attribute *disps)
int remove_obscure_curves(const std::vector< ObscendSet > &obscends)
double _courant
Definition: FaceOffset_3.h:378
static Vector_2 proj(const Vector_3 &v, const Vector_3 &d1, const Vector_3 &d2)
Definition: FaceOffset_3.h:318
void get_tangents(const Vector_3 *es, const Vector_3 &lambdas, const Vector_3 &mn, int nrank, Vector_3 vs[2], double scales[2], int *is_strong=NULL) const
COM::Attribute * _strong
Definition: FaceOffset_3.h:420
void set_normal_diffusion(char i)
Set number of iterations for normal diffusion.
Definition: FaceOffset_3.h:67
double _tol_turn_angle
Definition: FaceOffset_3.h:392
bool _feature_layer
Definition: FaceOffset_3.h:401
void balance_mass()
Definition: cons_diff.C:33
void set_eigen_threshold(double eps)
Set the threshold of eigenvalues for splitting primary and null spaces.
Definition: FaceOffset_3.h:76
bool filter_obscended_ridge(const std::vector< std::map< Edge_ID, double > > &edge_maps, const std::vector< std::map< Edge_ID, double > > &diangl_maps, const std::vector< ObscendSet > &obscends)
Filter out weak-ended curves.
void numerical_dissipation(COM::Attribute *nodal_buffer)
Introduce numerical dissipation into equation.
CGAL_BEGIN_NAMESPACE void const NT NT NT NT & denom
This class provides some common primitives used by various propagation algorithms.
Definition: Propagation_3.h:40
void nulaplacian_smooth(const COM::Attribute *vert_normals, const COM::Attribute *tangranks, const COM::Attribute *disps, COM::Attribute *vcenters, COM::Attribute *buf, COM::Attribute *vert_weights_buf, const COM::Attribute *edge_weights=NULL)
Redistribute smooth vertices by NuLaplacian smoothing.
Definition: NuLaplacian.C:36
FaceOffset_3()
Default constructor.
Definition: FaceOffset_3.h:43
NT & cos
void set_smoother(int smoother)
Set the choice of mesh smoother.
Definition: FaceOffset_3.h:122
COM::Attribute * _facenormals
Definition: FaceOffset_3.h:412
COM::Attribute * _ctangranks
Definition: FaceOffset_3.h:418
int eigen_analyze_vertex(Vector_3 A_io[3], Vector_3 &b_io, double angle_defect=0)