Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Manipulation of Strong Vertices

Functions

void identify_features_0 ()
 Identify the 0-features. More...
 
Feature_list_0::iterator remove_feature_0 (Feature_list_0::iterator i)
 Remove the given 0-feature from the list. More...
 

Detailed Description

Function Documentation

void identify_features_0 ( )
protected

Identify the 0-features.

Definition at line 555 of file RFC_Window_overlay_fea.C.

References NTS::abs(), acc, HDS_accessor< _MP >::get_destination(), HDS_accessor< _MP >::get_origin(), HDS_accessor< _MP >::get_pane(), i, RFC_assertion, RFC_assertion_code, RFC_Pane_overlay::set_feature_0(), RFC_Pane_overlay::unset_feature_0(), and v.

555  {
556  Feature_list_1 new_flist;
557  _f_list_1.swap( new_flist);
558 
559  Feature_list_1::iterator flit;
560  // Split feature curves at known feature vertices
561  for ( flit=new_flist.begin(); flit!=new_flist.end(); ++flit) {
562  Feature_list_1 subf;
563  Feature_1::iterator fit=flit->begin(),fprev=fit;
564  for ( ++fit; fit!=flit->end(); ++fit) {
565  if ( is_feature_0( acc.get_origin( *fit))) {
566  subf.push_back( Feature_1( fprev,fit));
567  fprev=fit;
568  }
569  }
570 
571  if ( is_feature_0( acc.get_origin( *flit->begin())) || subf.empty()) {
572  subf.push_back( Feature_1( fprev,fit));
573  }
574  else {
575  Feature_1 &newf=subf.front();
576  newf.insert( newf.begin(), fprev, flit->end());
577  }
578 
579  // Assign the ranks and mark the ones with rank 2.
580  for (Feature_list_1::iterator sit=subf.begin(); sit!=subf.end(); ++sit) {
581  _f_list_1.push_back( *sit);
582  }
583  }
584 
585  // Determine the ranks of the vertices
586  RFC_assertion( _f0_ranks.empty());
587  for ( flit=_f_list_1.begin(); flit!=_f_list_1.end(); ++flit) {
588  Vertex *src = acc.get_origin(flit->front());
589  Vertex *dst = acc.get_destination(flit->back());
590 
591  map<Vertex*,int>::iterator i=_f0_ranks.find(src);
592  if ( i==_f0_ranks.end())
593  _f0_ranks.insert(make_pair(src,-1-(src==dst)));
594  else
595  i->second = abs(i->second)+1+(src==dst);
596  if ( src!=dst) {
597  if ( (i=_f0_ranks.find(dst))==_f0_ranks.end())
598  _f0_ranks.insert(make_pair(dst,-1));
599  else
600  i->second = abs(i->second)+1;
601  }
602  }
603 
604  // Determine the connectivity at rank-2 vertices.
605  std::map<Vertex*,std::vector<Feature_1*> > turn_maps;
606  for ( flit=_f_list_1.begin(); flit!=_f_list_1.end(); ++flit) {
607  // Assign the ranks and mark the ones with rank 2.
608  Vertex *src = acc.get_origin(flit->front());
609  map<Vertex*,int>::iterator i=_f0_ranks.find(src);
610  if ( i!=_f0_ranks.end() && abs(i->second)==2)
611  turn_maps[ src].push_back( &*flit);
612 
613  Vertex *dst = acc.get_destination(flit->back());
614  i=_f0_ranks.find(dst);
615  if ( i!=_f0_ranks.end() && abs(i->second)==2)
616  turn_maps[ dst].push_back( &*flit);
617  }
618 
619  if ( !turn_maps.empty()) {
620  std::map<Vertex*,std::vector<Feature_1*> >::iterator i;
621  RFC_assertion_code(for ( i=turn_maps.begin(); i!=turn_maps.end(); ++i)
622  RFC_assertion( i->second.size()==2));
623 
624  new_flist.clear();
625  // Merge at weak rank-2 vertices
626  for ( flit=_f_list_1.begin(); flit!=_f_list_1.end(); ++flit) {
627  if ( flit->empty()) continue;
628  Feature_1 &f1 = *flit;
629 
630  bool modified=false;
631  Vertex *src = acc.get_origin(f1.front());
632  Vertex *dst = acc.get_destination(f1.back());
633 
634  if ( src==dst) {
635  if ( (i=turn_maps.find( src)) != turn_maps.end()) {
636  turn_maps.erase( i);
637  if ( !is_strong_ad( src)) {
638  acc.get_pane( src)->unset_feature_0(src);
639  _f0_ranks.erase( _f0_ranks.find(src));
640  }
641  else {
642  acc.get_pane( src)->set_feature_0(src);
643  _f0_ranks[src]=2;
644  }
645  }
646  }
647  else for ( int c=0; c<2; ++c) {
648  for (;;) {
649  Vertex *v=(c?acc.get_destination(f1.back()):
650  acc.get_origin(f1.front()));
651  if ( (i=turn_maps.find( v))==turn_maps.end()) break;
652  Feature_1 *f2;
653  if ( (f2 = i->second[0]) == &f1) f2 = i->second[1];
654  turn_maps.erase( i);
655  if ( is_feature_0(v)) {
656  acc.get_pane( v)->unset_feature_0(v);
657  _f0_ranks.erase( _f0_ranks.find(v));
658  }
659  if ( f2 == &f1) break;
660  merge_features_1( v, f1, *f2);
661 
662  Vertex *u;
663  if ( (u=acc.get_destination(f1.back())) != v &&
664  (i=turn_maps.find(u)) != turn_maps.end()) {
665  if ( i->second[0] == f2) i->second[0] = &f1;
666  if ( i->second[1] == f2) i->second[1] = &f1;
667  }
668  else if ((u=acc.get_origin(f1.front())) != v &&
669  (i=turn_maps.find(u)) != turn_maps.end()) {
670  if ( i->second[0] == f2) i->second[0] = &f1;
671  if ( i->second[1] == f2) i->second[1] = &f1;
672  }
673  modified = true;
674  }
675  }
676 
677  // Split at strong rank-2 vertices.
678  if ( modified) {
679  Feature_list_1 subf;
680  int dropped=0;
681  subdiv_feature_curve( f1, subf, dropped);
682  RFC_assertion( dropped==0);
683  f1.clear();
684  for (Feature_list_1::iterator it=subf.begin(); it!=subf.end(); ++it) {
685  new_flist.push_back( Feature_1());
686  Vertex *v=acc.get_origin(it->front());
687  if ( is_feature_0(v) && _f0_ranks.find(v)==_f0_ranks.end())
688  _f0_ranks[ v] = 2;
689  new_flist.back().swap( *it);
690  }
691  }
692  else {
693  new_flist.push_back( Feature_1());
694  new_flist.back().swap( f1);
695  }
696  }
697  _f_list_1.swap( new_flist);
698  }
699  RFC_assertion( turn_maps.empty());
700 
701  // Fill 0-feature list
702  for ( map<Vertex*,int>::iterator it=_f0_ranks.begin();
703  it!=_f0_ranks.end(); ++it) {
704  // Adjust the rank for termini
705  if ( it->second == -1 && is_strong_ad( it->first)) it->second = 1;
706 
707  RFC_assertion( is_feature_0( it->first));
708  _f_list_0.push_back( Feature_0( it->first));
709  }
710  _f_list_0.sort();
711 }
bool is_strong_ad(Vertex *v)
Determine whether a vertex is strong (either theta-strong or relatively strong) in angle defect...
Vertex * get_origin(Halfedge *h) const
Definition: HDS_accessor.h:87
void subdiv_feature_curve(const Feature_1 &f1, Feature_list_1 &new_flist, int &dropped)
Subdivide a feature curve by splitting it at 0-features.
RFC_Pane_overlay * get_pane(Vertex *v) const
Definition: HDS_accessor.h:128
void set_feature_0(Vertex *v)
*********************************************************************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
std::list< Feature_1 > Feature_list_1
Feature_list_1 _f_list_1
bool is_feature_0(const Vertex *v) const
static HDS_accessor< Tag_true > acc
blockLoc i
Definition: read.cpp:79
void unset_feature_0(Vertex *v)
void merge_features_1(Vertex *v, Feature_1 &f1, Feature_1 &f2)
Merge two feature curves into one at vertex v.
Feature_list_0 _f_list_0
#define RFC_assertion_code
Definition: rfc_basic.h:68
NT abs(const NT &x)
Definition: number_utils.h:130
Vertex * get_destination(Halfedge *h) const
Definition: HDS_accessor.h:93
std::map< Vertex *, int > _f0_ranks
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

RFC_Window_overlay::Feature_list_0::iterator remove_feature_0 ( Feature_list_0::iterator  i)

Remove the given 0-feature from the list.

Definition at line 715 of file RFC_Window_overlay_fea.C.

References acc, HDS_accessor< _MP >::get_pane(), RFC_Pane_overlay::unset_feature_0(), and v.

Referenced by Overlay::match_features_0().

715  {
716  Vertex *v = i->vertex();
718  return _f_list_0.erase(i);
719 }
RFC_Pane_overlay * get_pane(Vertex *v) const
Definition: HDS_accessor.h:128
*********************************************************************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
static HDS_accessor< Tag_true > acc
blockLoc i
Definition: read.cpp:79
void unset_feature_0(Vertex *v)
Feature_list_0 _f_list_0

Here is the call graph for this function:

Here is the caller graph for this function: