Пример #1
0
  void ME_Delete(MEdge_ptr e, int keep) {
    RepType RTYPE = MEnt_RepType((MEntity_ptr) e);
    Mesh_ptr mesh;

    (*ME_Delete_jmp[RTYPE])(e,keep);

    if (MEnt_Dim((MEntity_ptr) e) != MDELETED) {
      mesh = MEnt_Mesh((MEntity_ptr) e);

      if (mesh) {
#ifdef MSTK_HAVE_MPI
      if (ME_PType(e) == PGHOST)
	MESH_Rem_GhostEdge(mesh,e);
      else
#endif
	MESH_Rem_Edge(mesh,e);
      }

      MEnt_Set_DelFlag((MEntity_ptr) e);
    }

    if (!keep) {
      MEnt_Free_CmnData((MEntity_ptr) e);
      free((MEntity_ptr) e);
    }
  }
Пример #2
0
  void MR_Delete(MRegion_ptr r, int keep) {
    RepType RTYPE = MEnt_RepType((MEntity_ptr) r);
    Mesh_ptr mesh;

    (*MR_Delete_jmp[RTYPE])(r,keep);

    if (MEnt_Dim((MEntity_ptr) r) != MDELETED) {
      mesh = MEnt_Mesh((MEntity_ptr) r);

      if (mesh) {
#ifdef MSTK_HAVE_MPI
      if (MR_PType(r) == PGHOST)
	MESH_Rem_GhostRegion(mesh,r);
      else
#endif
	MESH_Rem_Region(mesh,r);
      }

      MEnt_Set_DelFlag((MEntity_ptr) r);
    }

    if (!keep) {
      MEnt_Free_CmnData((MEntity_ptr) r);
      free(r);
    }
  }
Пример #3
0
  void MF_Delete_R1(MFace_ptr f, int keep) {
    MFace_Adj_R1 *adj;

    adj = (MFace_Adj_R1 *) f->adj;

    if (adj) {
      if (adj->fvertices) List_Delete(adj->fvertices);
      free(adj);
    }

    if (!keep) {
      MEnt_Set_DelFlag((MEntity_ptr) f);
    }
    if (keep) 
      MSTK_Report("MF_Delete_R1","Deletion of faces is permanent in this representation",MSTK_ERROR);
  }