/*
    C++ Mesh Generation Library
    Copyright (c) 2000echet <eric at bechet dot ca>

    This file is part of the C++ Mesh Generation Library.

    See the NOTICE & LICENSE files for conditions.
*/
#include "gmshNode.h"
#include "gmshElement.h"
namespace FM
{
  void gmshNode::GetNeighbors( int dim,vector<gmshElement> &tab ) const
  {
    std::map<MVertex*,std::vector<MElement*> >::iterator v=FM::FMModel::Ptr->v_to_ele.find(gmshv);
    if (v!=FM::FMModel::Ptr->v_to_ele.end())
    {
      for (int i=0;i<v->second.size();++i)
      {
        MElement *ele=v->second[i];
        if (ele->getDim()==dim)
          tab.push_back(gmshElement(ele));
      }
    }
    
/*    int szed=aomdv->size ( dim );

    for ( int ed=0; ed<szed; ed++ )
    {
      gmsh::mEntity *ped=aomdv->get ( dim,ed );
      tab.push_back ( gmshElement ( ped ) );
    }*/
  }
}
 
