cgma
ChollaSurface Class Reference

#include <ChollaSurface.hpp>

Inheritance diagram for ChollaSurface:
ChollaEntity

List of all members.

Public Member Functions

 ChollaSurface (int block_id)
 ~ChollaSurface ()
void get_facets (DLIList< FacetEntity * > &surface_facets)
void get_points (DLIList< CubitPoint * > &point_list)
void assign_geometric_surface (void *surf)
void * get_geometric_surface ()
void assign_eval_tool (FacetEvalTool *eval_tool_ptr)
FacetEvalToolget_eval_tool ()
ChollaSurfacemerge_partner ()
void set_merge_partner (ChollaSurface *merge_partner)
CubitBoolean get_flag ()
void set_flag (CubitBoolean stat)
void add_facet (FacetEntity *exterior_face)
int add_mesh_unique (FacetEntity *exterior_face)
void remove_facet (FacetEntity *facet)
bool is_contain (FacetEntity *facet)
DLIList< FacetEntity * > & get_facet_list ()
DLIList< FacetEntity * > * get_facet_list_ptr ()
void get_vertices (DLIList< ChollaPoint * > &chpt_list)
void get_curves (DLIList< ChollaCurve * > &bcm_list)
void add_curve (ChollaCurve *bcm_ptr)
void add_curve_unique (ChollaCurve *bcm_ptr)
void remove_curve (ChollaCurve *bcm_ptr)
void get_volumes (DLIList< ChollaVolume * > &cholla_vol_list)
void add_volume (ChollaVolume *cholla_vol_ptr)
void add_volume_unique (ChollaVolume *cholla_vol_ptr)
void remove_volume (ChollaVolume *cholla_vol_ptr)
int num_volumes ()
CubitBoolean is_in_volume (ChollaVolume *chvol_ptr)
int get_block_id ()
void set_block_id (int flag)
int get_id ()
CubitStatus get_adj_facets (FacetEntity *start_face_ptr, DLIList< FacetEntity * > &face_list, int mydebug=0, bool bound_check=false, bool feature_edge_check=true)
CubitStatus split_surface (DLIList< ChollaSurface * > &block_surface_list)
CubitStatus feature_angle (double min_dot, DLIList< CubitFacetEdge * > &feature_edge_list)
CubitStatus add_preexisting_feature_edges (DLIList< CubitFacetEdge * > &feature_edge_list)
CubitStatus non_manifold_edges (DLIList< CubitFacetEdge * > &feature_edge_list)
CubitStatus clean_features ()
void init_hit_flags ()
CubitStatus update_boundary_tool_data ()
void reset_facet_flags ()
CubitBoolean is_adjacent (ChollaSurface *other_surf)
DLIList< DLIList
< CubitFacetEdge * > * > * 
get_loop_edges ()
void flip_facets ()
void debug_draw ()

Private Member Functions

void check_faceting ()

Private Attributes

int id
int blockId
CubitBoolean myFlag
DLIList< FacetEntity * > surfaceElemList
DLIList< ChollaCurve * > curveList
DLIList< ChollaVolume * > volList
void * mySurface
FacetEvalToolmyEvalTool
ChollaSurfacemyMergePartner

Detailed Description

Definition at line 25 of file ChollaSurface.hpp.


Constructor & Destructor Documentation

ChollaSurface::ChollaSurface ( int  block_id)

Definition at line 28 of file ChollaSurface.cpp.

{
  static int count = 100;
  id = count++;
  myFlag = CUBIT_FALSE;
  mySurface = NULL;
  myEvalTool = NULL;
  blockId = block_id;
  myMergePartner = NULL;
}

Definition at line 41 of file ChollaSurface.cpp.

{
}

Member Function Documentation

void ChollaSurface::add_curve ( ChollaCurve bcm_ptr) [inline]

Definition at line 83 of file ChollaSurface.hpp.

    {curveList.append(bcm_ptr);}
void ChollaSurface::add_curve_unique ( ChollaCurve bcm_ptr) [inline]

Definition at line 85 of file ChollaSurface.hpp.

    {curveList.append_unique(bcm_ptr);}
void ChollaSurface::add_facet ( FacetEntity exterior_face) [inline]

Definition at line 65 of file ChollaSurface.hpp.

    {surfaceElemList.append(exterior_face);}
int ChollaSurface::add_mesh_unique ( FacetEntity exterior_face) [inline]

Definition at line 68 of file ChollaSurface.hpp.

    {return surfaceElemList.append_unique(exterior_face);} 

Definition at line 475 of file ChollaSurface.cpp.

{
    DLIList<CubitFacetEdge *> edge_list;
    DLIList<CubitFacet *> facet_list;
    CAST_LIST( surfaceElemList, facet_list, CubitFacet );
    FacetDataUtil::get_edges( facet_list, edge_list );
    int iedge;
    CubitFacetEdge *edge;
    for (iedge=0; iedge < edge_list.size(); iedge++)
    {
        edge = edge_list.get_and_step();
        if (edge->is_feature())
            feature_edge_list.append(edge);
    }
    return CUBIT_SUCCESS;
}
void ChollaSurface::add_volume ( ChollaVolume cholla_vol_ptr) [inline]

Definition at line 91 of file ChollaSurface.hpp.

    {volList.append(cholla_vol_ptr);}
void ChollaSurface::add_volume_unique ( ChollaVolume cholla_vol_ptr) [inline]

Definition at line 93 of file ChollaSurface.hpp.

    {volList.append_unique(cholla_vol_ptr);}
void ChollaSurface::assign_eval_tool ( FacetEvalTool eval_tool_ptr) [inline]

Definition at line 53 of file ChollaSurface.hpp.

    {myEvalTool = eval_tool_ptr;}
void ChollaSurface::assign_geometric_surface ( void *  surf) [inline]

Definition at line 49 of file ChollaSurface.hpp.

    {mySurface = surf;}
void ChollaSurface::check_faceting ( ) [private]

Definition at line 51 of file ChollaSurface.cpp.

{

}

Definition at line 547 of file ChollaSurface.cpp.

{
  int ii, jj;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    FacetEntity *face_ptr = surfaceElemList.get_and_step();
    DLIList<CubitFacetEdge*> edge_list;
    face_ptr->edges( edge_list );
    for (jj=0; jj<edge_list.size(); jj++)
    {
      CubitFacetEdge *edge_ptr = edge_list.get_and_step();
      TDGeomFacet *td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
      if (td_gm_edge != NULL)
      {

        // make sure this edge actually forms the boundary between two surfaces

        DLIList<FacetEntity*> adj_face_list;
        edge_ptr->get_parents( adj_face_list );

        // it has to be an internal edge - ignore boundaries

        if (adj_face_list.size() == 2)
        {
          FacetEntity *adj_face_ptr = adj_face_list.get_and_step();
          if (adj_face_ptr == face_ptr)
            adj_face_ptr = adj_face_list.get();          
          TDGeomFacet *td_gm_adjface = TDGeomFacet::get_geom_facet(adj_face_ptr);
          if (td_gm_adjface != NULL)
          {
            DLIList<ChollaSurface*> surf_list;
            td_gm_adjface->get_cholla_surfs( surf_list );
            ChollaSurface *adj_surf = surf_list.get();  // must be only 1 surf
            if (adj_surf == this)
            {

              // the same surface is on both sides of this edge - Therefore it
              // does not form a complete loop.  Delete the tool data from
              // this edge to indicate that it is not at a boundary.

              edge_ptr->delete_TD( &TDGeomFacet::is_geom_facet );
            }
          }
        }
      }
    }
  }
  return CUBIT_SUCCESS;
}

Definition at line 756 of file ChollaSurface.cpp.

CubitStatus ChollaSurface::feature_angle ( double  min_dot,
DLIList< CubitFacetEdge * > &  feature_edge_list 
)

Definition at line 329 of file ChollaSurface.cpp.

{
  //CubitStatus stat = CUBIT_SUCCESS;
  int ii, jj;

  // compute face normals
  int mydebug = 0;
  double dot;
  CubitVector face_normal, adj_face_normal;
  FacetEntity *face_ptr, *adj_face_ptr;
  TDGeomFacet *td_gm_face;
  CubitFacet *tri_ptr;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    face_ptr = surfaceElemList.get_and_step();
    td_gm_face = TDGeomFacet::get_geom_facet(face_ptr);
    tri_ptr = CAST_TO( face_ptr, CubitFacet );
    face_normal = tri_ptr->normal( );
    face_normal.normalize();
    td_gm_face->set_normal( face_normal );
  }

  // check adjacencies and compute the dot product between them
  // where dot product is less than the min_dot, create a tool data
  // on the edge
  
  if(mydebug)
    GfxDebug::clear();
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    face_ptr = surfaceElemList.get_and_step();
    CubitFacet* curr_facet = CAST_TO(face_ptr, CubitFacet);
    CubitFacet* temp_facet = NULL;
    double curr_area=curr_facet->area();
    td_gm_face = TDGeomFacet::get_geom_facet(face_ptr);
    face_normal = td_gm_face->get_normal();
    DLIList<CubitFacetEdge*> edge_list;
    face_ptr->edges( edge_list );
    for (jj=0; jj<edge_list.size(); jj++)
    {
      CubitFacetEdge *edge_ptr = edge_list.get_and_step();
      TDGeomFacet *td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
      if (!td_gm_edge)
      {
        DLIList<FacetEntity*> adj_face_list;
        edge_ptr->get_parents( adj_face_list );

        // it has to be an internal edge - ignore boundaries
        if (adj_face_list.size() == 2)
        {
          adj_face_ptr = adj_face_list.get_and_step();
          
          if (adj_face_ptr == face_ptr)
            adj_face_ptr = adj_face_list.get();          
          td_gm_face = TDGeomFacet::get_geom_facet(adj_face_ptr);

          // make sure the adj face is on the same surface

          if (td_gm_face->get_hit_flag() == id)
          {

            // test the dot product between normals

            adj_face_normal = td_gm_face->get_normal();
            temp_facet = CAST_TO(adj_face_ptr, CubitFacet);
            double adj_area=temp_facet->area();
              //mbrewer:: ensure no NULL
            dot = adj_face_normal % face_normal;
            bool add_an_edge = true;
            if(mydebug){
              PRINT_INFO("This area %f, other %f\n",curr_area,adj_area);
            }
            if(curr_area<(1.e-10*adj_area)){
              DLIList<CubitFacetEdge*> edge_list_tmp;
              CubitFacetEdge* edge_ptr_tmp=NULL;
              curr_facet->edges(edge_list_tmp);
              double edge_length = edge_ptr->length();
              int k = 0;
              if(edge_list_tmp.size()>0)
                add_an_edge=false;
              for(k=edge_list_tmp.size();k>0;k--){
                edge_ptr_tmp=edge_list_tmp.get_and_step();
                if(edge_ptr_tmp != edge_ptr &&
                   edge_ptr_tmp->length() > edge_length){
                  add_an_edge=true;
                }
              }
            }
            if(adj_area<(1.e-10*curr_area))
            {
              DLIList<CubitFacetEdge*> edge_list_tmp;
              CubitFacetEdge* edge_ptr_tmp=NULL;
              temp_facet->edges(edge_list_tmp);
              double edge_length = edge_ptr->length();
              int k = 0;
              if(edge_list_tmp.size()>0)
                add_an_edge=false;
              for(k=edge_list_tmp.size();k>0;k--){
                edge_ptr_tmp=edge_list_tmp.get_and_step();
                if(edge_ptr_tmp != edge_ptr &&
                   edge_ptr_tmp->length() > edge_length){
                  add_an_edge=true;
                }
              }
            }
            if (dot <= min_dot && add_an_edge )
            {
              if(mydebug){
                edge_ptr->debug_draw(CUBIT_MAGENTA_INDEX);
              }
              TDGeomFacet::add_geom_facet(edge_ptr, -1); 
              td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
              edge_ptr->set_as_feature();
              feature_edge_list.append( edge_ptr );
            }
          }
        }

        // non-manifold edges (edges with more than 2 adj facets)
        // must be features

        else if (adj_face_list.size() > 2)
        {
          TDGeomFacet::add_geom_facet(edge_ptr, -1); 
          td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
          edge_ptr->set_as_feature();
          feature_edge_list.append( edge_ptr );
        }
      }
    }
  }
  if(mydebug){
    GfxDebug::mouse_xforms();
  }
  return CUBIT_SUCCESS;
}

Definition at line 770 of file ChollaSurface.cpp.

{
  FacetEntity *facet_entity;
  CubitFacet *facet_ptr;
  for (int ii=0; ii<surfaceElemList.size(); ii++)
  {
    facet_entity = surfaceElemList.get_and_step();
    facet_ptr = dynamic_cast<CubitFacet *> (facet_entity);
    assert( facet_ptr != NULL );
    facet_ptr->flip();
  }
}
CubitStatus ChollaSurface::get_adj_facets ( FacetEntity start_face_ptr,
DLIList< FacetEntity * > &  face_list,
int  mydebug = 0,
bool  bound_check = false,
bool  feature_edge_check = true 
)

Definition at line 221 of file ChollaSurface.cpp.

{
  //int found = 0;
  int ii;
  CubitStatus stat = CUBIT_SUCCESS;
  DLIList<FacetEntity*> temp_list;
  FacetEntity *face_ptr = NULL;
  FacetEntity *adj_face_ptr = NULL;
  DLIList<CubitFacetEdge *>edge_list;
  CubitFacetEdge *edge_ptr = NULL;
  DLIList<FacetEntity *>adj_face_list;

  if (mydebug)
  {
    for(ii=0; ii<surfaceElemList.size(); ii++)
    {
      face_ptr = surfaceElemList.get_and_step();
      TDGeomFacet *td_gm_face = TDGeomFacet::get_geom_facet(face_ptr);
      PRINT_INFO("%d ", td_gm_face->get_hit_flag());
      if (ii%10 == 0)
      {
        PRINT_INFO("\n");
      }
    }
  }

  // add this face to the list

  temp_list.append( start_face_ptr );
  TDGeomFacet *td_gm_face = TDGeomFacet::get_geom_facet(start_face_ptr);
  td_gm_face->set_hit_flag( 0 );

  while (temp_list.size())
  {
    face_ptr = temp_list.pop();
    td_gm_face = TDGeomFacet::get_geom_facet(face_ptr); 
    if (td_gm_face->get_hit_flag() == 0)
    {
      face_list.append( face_ptr );
      if (mydebug)
      {
        face_ptr->debug_draw( CUBIT_RED_INDEX );
        GfxDebug::flush();
      }
      edge_list.clean_out();
      face_ptr->edges( edge_list );
      for (ii=0; ii<edge_list.size(); ii++)
      {
        edge_ptr = edge_list.get_and_step();

        // edges that already have a tool data defined are the result
        // of a feature angle.  Don't traverse past a feature angle edge
    
        TDGeomFacet *td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
        if (td_gm_edge == NULL || !feature_edge_check )
        {
          adj_face_list.clean_out();
          edge_ptr->get_parents( adj_face_list );

          // keep traversing only if there are two adjacent faces to this edge,
          // otherwise, this is a boundary

          if (adj_face_list.size() != 2)
          {
            continue;
          }

          if( bound_check )
          {
            TDFacetBoundaryEdge *td_facet_bnd_edge = TDFacetBoundaryEdge::get_facet_boundary_edge( edge_ptr );
            if( td_facet_bnd_edge )
              continue;
          }
            
          adj_face_ptr = adj_face_list.get_and_step();
          if (adj_face_ptr == face_ptr)
            adj_face_ptr = adj_face_list.get();

          // go to its neighbor if it is part of the surface

          td_gm_face = TDGeomFacet::get_geom_facet(adj_face_ptr); 
          if (td_gm_face->get_hit_flag() == id)
          {
            temp_list.append( adj_face_ptr );
            td_gm_face->set_hit_flag( 0 );
          }
          
        }
      }
    }
  }
  return stat;
}
int ChollaSurface::get_block_id ( ) [inline]

Definition at line 100 of file ChollaSurface.hpp.

    {return blockId;}
void ChollaSurface::get_curves ( DLIList< ChollaCurve * > &  bcm_list) [inline]

Definition at line 81 of file ChollaSurface.hpp.

    {bcm_list = curveList; }

Definition at line 55 of file ChollaSurface.hpp.

    {return myEvalTool;}

Definition at line 76 of file ChollaSurface.hpp.

    {return surfaceElemList;}

Definition at line 78 of file ChollaSurface.hpp.

    {return &surfaceElemList;}
void ChollaSurface::get_facets ( DLIList< FacetEntity * > &  surface_facets) [inline]

Definition at line 45 of file ChollaSurface.hpp.

    {surface_facets += surfaceElemList;}

Definition at line 62 of file ChollaSurface.hpp.

{ return myFlag; }

Definition at line 51 of file ChollaSurface.hpp.

    {return mySurface;}
int ChollaSurface::get_id ( ) [inline]

Definition at line 105 of file ChollaSurface.hpp.

{return id;}

Definition at line 748 of file ChollaSurface.cpp.

{
  assert(myEvalTool != NULL);
  return myEvalTool->loops();
}
void ChollaSurface::get_points ( DLIList< CubitPoint * > &  point_list)

Definition at line 621 of file ChollaSurface.cpp.

{
  int ii;
  CubitPoint *point[3];
  CubitFacet *facet;
  FacetEntity *facet_entity;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    facet_entity = surfaceElemList.get_and_step();
    facet = CAST_TO( facet_entity, CubitFacet );
    facet->points( point[0], point[1], point[2] );
    point[0]->marked(0);
    point[1]->marked(0);
    point[2]->marked(0);
  }

  int jj;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    facet_entity = surfaceElemList.get_and_step();
    facet = CAST_TO( facet_entity, CubitFacet );
    facet->points( point[0], point[1], point[2] );
    for (jj=0; jj<3; jj++)
    {
      if (point[jj]->marked() == 0)
      {
        point[jj]->marked(1);
        point_list.append(point[jj]);
      }
    }
  }
}
void ChollaSurface::get_vertices ( DLIList< ChollaPoint * > &  chpt_list)

Definition at line 807 of file ChollaSurface.cpp.

{
  chpt_list.clean_out();
  ChollaCurve *chcurv_ptr;
  for (int ii=0; ii<curveList.size(); ii++)
  {
    chcurv_ptr = curveList.get_and_step();
    DLIList<ChollaPoint *> chc_pts = chcurv_ptr->get_points(); 
    chpt_list += chc_pts;
  }
  chpt_list.uniquify_unordered();
}
void ChollaSurface::get_volumes ( DLIList< ChollaVolume * > &  cholla_vol_list) [inline]

Definition at line 89 of file ChollaSurface.hpp.

    {cholla_vol_list = volList; }

Definition at line 604 of file ChollaSurface.cpp.

{
  int ii;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    FacetEntity *face_ptr = surfaceElemList.get_and_step();
    TDGeomFacet *td_gm = TDGeomFacet::get_geom_facet(face_ptr);
    td_gm->set_hit_flag( id );
  }
}

Definition at line 720 of file ChollaSurface.cpp.

{
  DLIList<ChollaSurface *> *adjsurf_list_ptr;
  ChollaCurve *curv;
  ChollaSurface *surf;
  int icurv, ii;
  for(icurv=0; icurv< curveList.size(); icurv++)
  {
    curv = curveList.get_and_step();
    adjsurf_list_ptr = curv->get_surface_list_ptr();
    for(ii=0; ii<adjsurf_list_ptr->size(); ii++)
    {
      surf = adjsurf_list_ptr->get_and_step();
      if (surf != this && surf == other_surf)
      {
        return CUBIT_TRUE;
      }
    }
  }
  return CUBIT_FALSE; 
}

Definition at line 820 of file ChollaSurface.cpp.

{
  if( surfaceElemList.is_in_list( facet ) )
    return true;
  else
    return false;
}

Definition at line 789 of file ChollaSurface.cpp.

{
  ChollaVolume *mychvol_ptr;
  for (int ii=0; ii<volList.size(); ii++)
  {
    mychvol_ptr = volList.get_and_step();
    if (mychvol_ptr == chvol_ptr)
      return CUBIT_TRUE;
  }
  return CUBIT_FALSE;
}

Definition at line 58 of file ChollaSurface.hpp.

{ return myMergePartner; }

Definition at line 501 of file ChollaSurface.cpp.

{
  //CubitStatus stat = CUBIT_SUCCESS;
  int ii, jj;
  DLIList<CubitFacetEdge*> edge_list;
  FacetEntity *face_ptr;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    face_ptr = surfaceElemList.get_and_step();
    edge_list.clean_out();
    face_ptr->edges( edge_list );
    for (jj=0; jj<edge_list.size(); jj++)
    {
      CubitFacetEdge *edge_ptr = edge_list.get_and_step();
      TDGeomFacet *td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
      if (!td_gm_edge)
      {
        DLIList<FacetEntity*> adj_face_list;
        edge_ptr->get_parents( adj_face_list );

        // non-manifold edges (edges with more than 2 adj facets)
        // must be features

        if (adj_face_list.size() > 2 || edge_ptr->is_feature())
        {
          TDGeomFacet::add_geom_facet(edge_ptr, -1); 
          td_gm_edge = TDGeomFacet::get_geom_facet(edge_ptr);
          edge_ptr->set_as_feature();
          feature_edge_list.append( edge_ptr );
        }
      }
    }
  }
  return CUBIT_SUCCESS;
}
int ChollaSurface::num_volumes ( ) [inline]

Definition at line 97 of file ChollaSurface.hpp.

{return volList.size();}
void ChollaSurface::remove_curve ( ChollaCurve bcm_ptr) [inline]

Definition at line 87 of file ChollaSurface.hpp.

    {curveList.remove(bcm_ptr);}
void ChollaSurface::remove_facet ( FacetEntity facet) [inline]

Definition at line 71 of file ChollaSurface.hpp.

  {surfaceElemList.remove( facet );}
void ChollaSurface::remove_volume ( ChollaVolume cholla_vol_ptr) [inline]

Definition at line 95 of file ChollaSurface.hpp.

    {volList.remove(cholla_vol_ptr);}

Definition at line 701 of file ChollaSurface.cpp.

{
  CubitFacet *facet_ptr;
  FacetEntity *fe_ptr;
  int ii;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    fe_ptr = surfaceElemList.get_and_step();
    facet_ptr = CAST_TO( fe_ptr, CubitFacet );
    facet_ptr->marked( 0 );
  }
}
void ChollaSurface::set_block_id ( int  flag) [inline]

Definition at line 102 of file ChollaSurface.hpp.

    { blockId = flag; }
void ChollaSurface::set_flag ( CubitBoolean  stat) [inline]

Definition at line 63 of file ChollaSurface.hpp.

{ myFlag = stat; }                       
void ChollaSurface::set_merge_partner ( ChollaSurface merge_partner) [inline]

Definition at line 59 of file ChollaSurface.hpp.

Definition at line 64 of file ChollaSurface.cpp.

{
  DLIList<ChollaSurface*> new_surface_list;
  CubitStatus stat = CUBIT_SUCCESS;

  // Go through the surfaceElemList and pull faces off one by one as we
  // determine which surface it belongs to.  Continue until we have depleted
  // the list

  int jj;
  int mydebug = 0;
  int num_surfs_created = 0;
  while( surfaceElemList.size() > 0)
  {

    // start with the first face and create a list of all elements 
    // attached to the face

    DLIList<FacetEntity*> face_list;
    FacetEntity *start_face_ptr = surfaceElemList.get_and_step();
    stat = get_adj_facets( start_face_ptr, face_list, mydebug );
    if (stat != CUBIT_SUCCESS)
      return stat;

    // if we have the same number of faces on the face_list as we do
    // on the surfaceElemList, then we are done.  This surface is
    // not multiply connected.  Oherwise continue...

    if (face_list.size() == surfaceElemList.size())
    {

      // if this surface had a curve already defined (its a 2D topology
      // defined in skin2D) then its no longer valid if the surface was split
      // (for 3D the curves aren't defined until later)

      if (num_surfs_created > 0 && curveList.size() > 0)
      {
        ChollaCurve *fcm_ptr = curveList.get();  // there should only be 1
        curveList.remove();
        fcm_ptr->remove_td_associativity( this );
        delete fcm_ptr;
      }
      return CUBIT_SUCCESS;
    }

    // create a new surface to hold the face info

    num_surfs_created++;
    ChollaSurface *fsm_ptr = new ChollaSurface( blockId );
    facet_surface_list.append( fsm_ptr );

    // update the geometric curve pointer

    fsm_ptr->assign_geometric_surface( NULL );

    // add the faces to this surface and update the surface 
    // pointers in the face tool data

      // surfaceElemList: nullify the items then compress the list
      // afterwards, instead of removing the items one by one, for
      // speed.
    for (jj=face_list.size(); jj > 0; jj--)
    {
      FacetEntity *face_ptr = face_list.get_and_step();
      TDGeomFacet *td_gm_face = TDGeomFacet::get_geom_facet(face_ptr); 
      td_gm_face->remove_cholla_surf( this );
      td_gm_face->add_cholla_surf( fsm_ptr );
      surfaceElemList.move_to_nearby( face_ptr );
      surfaceElemList.extract();
      fsm_ptr->add_facet( face_ptr );
    }
  }

  return CUBIT_SUCCESS;
}

Definition at line 660 of file ChollaSurface.cpp.

{
  int ii, jj;
  CubitPoint *point_ptr;
  CubitFacetEdge *edge_ptr;
  CubitFacet *facet_ptr;
  FacetEntity *facet_entity;

  TDFacetBoundaryPoint *td_fbp;
  TDFacetBoundaryEdge *td_fbe;
  for (ii=0; ii<surfaceElemList.size(); ii++)
  {
    facet_entity = surfaceElemList.get_and_step();
    facet_ptr = CAST_TO( facet_entity, CubitFacet );
    for (jj=0; jj<3; jj++)
    {
      point_ptr = facet_ptr->point(jj);
      td_fbp = TDFacetBoundaryPoint::get_facet_boundary_point( point_ptr );
      if (td_fbp != NULL)
      {
        td_fbp->set_surf_id( facet_ptr, id );
      }

      edge_ptr = facet_ptr->edge(jj);
      td_fbe = TDFacetBoundaryEdge::get_facet_boundary_edge( edge_ptr );
      if (td_fbe != NULL)
      {
        td_fbe->set_surf_id( facet_ptr, id );
      }
    }
  }

  return CUBIT_SUCCESS;
}

Member Data Documentation

int ChollaSurface::blockId [private]

Definition at line 29 of file ChollaSurface.hpp.

Definition at line 33 of file ChollaSurface.hpp.

int ChollaSurface::id [private]

Definition at line 28 of file ChollaSurface.hpp.

Definition at line 36 of file ChollaSurface.hpp.

Definition at line 30 of file ChollaSurface.hpp.

Definition at line 37 of file ChollaSurface.hpp.

void* ChollaSurface::mySurface [private]

Definition at line 35 of file ChollaSurface.hpp.

Definition at line 32 of file ChollaSurface.hpp.

Definition at line 34 of file ChollaSurface.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines