cgma
ChollaDebug.hpp File Reference
#include "CubitColor.hpp"

Go to the source code of this file.

Functions

void dcolor (int icol)
void ddraw (FacetEntity *facet_ptr)
void dfdraw (CubitFacet *facet_ptr)
void dedraw (CubitFacetEdge *facet_ptr)
void dpdraw (CubitPoint *facet_ptr)
void dsurfdraw (ChollaSurface *surf)
void dview ()
void dzoom (CubitBox &box)
void dldraw (DLIList< FacetEntity * > &facet_list)
void dfldraw (DLIList< CubitFacet * > &facet_list)
void deldraw (DLIList< CubitFacetEdge * > &edge_list)
void dpldraw (DLIList< CubitPoint * > &point_list)
int dflcheck (DLIList< CubitFacet * > &facet_list)
int dcheck (DLIList< FacetEntity * > &facet_list)
int dfcheck (CubitFacet *facet_ptr)
void dray (const CubitVector &start, const CubitVector &vec, double length=0.1)
void dpoint (const CubitVector &pt)
int get_color ()

Function Documentation

int dcheck ( DLIList< FacetEntity * > &  facet_list)

Definition at line 115 of file ChollaDebug.cpp.

{
  int ii;
  int ier = 0;
  for (ii=0; ii<facet_list.size(); ii++)
  {
    CubitFacet *facet_ptr = (CubitFacet *)facet_list.get_and_step();
    ier += dfcheck( facet_ptr );
  }
  return ier;
}
void dcolor ( int  icol)

Definition at line 13 of file ChollaDebug.cpp.

{
  fg_color = icol;
}
void ddraw ( FacetEntity facet_ptr)

Definition at line 18 of file ChollaDebug.cpp.

{
  facet_ptr->debug_draw( fg_color );
}
void dedraw ( CubitFacetEdge facet_ptr)

Definition at line 28 of file ChollaDebug.cpp.

{
  facet_ptr->debug_draw( fg_color );
}
void deldraw ( DLIList< CubitFacetEdge * > &  edge_list)

Definition at line 81 of file ChollaDebug.cpp.

{
  CubitFacetEdge *edge_ptr;
  for (int ii=0; ii<edge_list.size(); ii++)
  {
    edge_ptr = edge_list.get_and_step();
    edge_ptr->debug_draw( fg_color, 0 );
  }
  GfxDebug::flush();
}
int dfcheck ( CubitFacet facet_ptr)

Definition at line 127 of file ChollaDebug.cpp.

{
  int ier = 0;
  
  // check edges

  int ii, jj;
  for (ii=0; ii<3; ii++)
  {
    CubitFacetEdge *edge_ptr = facet_ptr->edge( ii );
    DLIList <CubitFacet *> facet_list;
    edge_ptr->facets( facet_list );
    int found = 0;
    for (jj=0; jj<facet_list.size() && !found; jj++)
    {
      CubitFacet *f = facet_list.get_and_step();
      if (f == facet_ptr)
      {
        found = 1;
      }
    }
    if (!found)
    {
      PRINT_ERROR( "Facet %d is not in Edge %d adjacency list\n",
                    facet_ptr->id(), edge_ptr->id() );
      ier++;
    }

    // check the edge's orientation on the facet

    CubitPoint *ep0, *ep1;
    int use = facet_ptr->edge_use( ii );
    if (use > 0)
    {
      ep0 = edge_ptr->point( 0 );
      ep1 = edge_ptr->point( 1 );
    }
    else
    {
      ep1 = edge_ptr->point( 0 );
      ep0 = edge_ptr->point( 1 );
    }

    CubitPoint *fp0 = facet_ptr->point( (ii+1)%3 );
    CubitPoint *fp1 = facet_ptr->point( (ii+2)%3 );
    if (fp0 != ep0 || fp1 != ep1)
    {
      PRINT_ERROR( "Edge %d on Facet %d is not oriented with points %d and %d correctly\n",
        edge_ptr->id(), facet_ptr->id(), fp0->id(), fp1->id() );
      ier++;
    }
  }

  // check nodes 

  for (ii=0; ii<3; ii++)
  {
    CubitPoint *point_ptr = facet_ptr->point( ii );
    DLIList <CubitFacet *> facet_list;
    point_ptr->facets( facet_list );
    int found = 0;
    for (jj=0; jj<facet_list.size() && !found; jj++)
    {
      CubitFacet *f = facet_list.get_and_step();
      if (f == facet_ptr)
      {
        found = 1;
      }
    }
    if (!found)
    {
      PRINT_ERROR( "Facet %d is not in Point %d adjacency list\n",
                    facet_ptr->id(), point_ptr->id() );
      ier++;
    }
  }
  return ier;
}
void dfdraw ( CubitFacet facet_ptr)

Definition at line 23 of file ChollaDebug.cpp.

{
  facet_ptr->debug_draw( fg_color );
}
int dflcheck ( DLIList< CubitFacet * > &  facet_list)

Definition at line 103 of file ChollaDebug.cpp.

{
  int ii;
  int ier = 0;
  for (ii=0; ii<facet_list.size(); ii++)
  {
    CubitFacet *facet_ptr = facet_list.get_and_step();
    ier += dfcheck( facet_ptr );
  }
  return ier;
}
void dfldraw ( DLIList< CubitFacet * > &  facet_list)

Definition at line 70 of file ChollaDebug.cpp.

{
  CubitFacet *facet_ptr;
  for (int ii=0; ii<facet_list.size(); ii++)
  {
    facet_ptr = facet_list.get_and_step();
    facet_ptr->debug_draw( fg_color, 0 );
  }
  GfxDebug::flush();
}
void dldraw ( DLIList< FacetEntity * > &  facet_list)

Definition at line 59 of file ChollaDebug.cpp.

{
  FacetEntity *facet_ptr;
  for (int ii=0; ii<facet_list.size(); ii++)
  {
    facet_ptr = facet_list.get_and_step();
    facet_ptr->debug_draw( fg_color, 0 );
  }
  GfxDebug::flush();
}
void dpdraw ( CubitPoint facet_ptr)

Definition at line 33 of file ChollaDebug.cpp.

{
  facet_ptr->debug_draw( fg_color );
}
void dpldraw ( DLIList< CubitPoint * > &  point_list)

Definition at line 92 of file ChollaDebug.cpp.

{
  CubitPoint *point_ptr;
  for (int ii=0; ii<point_list.size(); ii++)
  {
    point_ptr = point_list.get_and_step();
    point_ptr->debug_draw( fg_color, 0 );
  }
  GfxDebug::flush();
}
void dpoint ( const CubitVector pt)

Definition at line 215 of file ChollaDebug.cpp.

void dray ( const CubitVector start,
const CubitVector vec,
double  length = 0.1 
)

Definition at line 207 of file ChollaDebug.cpp.

{
  CubitVector end = start+length*vec;
  GfxDebug::draw_vector(end, start, fg_color );
  GfxDebug::flush();
}
void dsurfdraw ( ChollaSurface surf)

Definition at line 51 of file ChollaDebug.cpp.

{
  DLIList<FacetEntity*> surface_facets;
  surf->get_facets(surface_facets);
  dldraw(surface_facets);
}
void dview ( )

Definition at line 39 of file ChollaDebug.cpp.

void dzoom ( CubitBox box)

Definition at line 45 of file ChollaDebug.cpp.

{
  GfxDebug::zoom(box);
}
int get_color ( )

Definition at line 222 of file ChollaDebug.cpp.

{
  return fg_color;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines