agm_use add_adj(gmi_model* m, agm_bdry b, int tag) { agm* topo = gmi_analytic_topo(m); int dim = agm_dim_from_type(agm_bounds(topo, b).type); gmi_ent* de = gmi_find(m, dim - 1, tag); return agm_add_use(topo, b, agm_from_gmi(de)); }
struct gmi_set* gmi_base_adjacent(struct gmi_model* m, struct gmi_ent* e, int dim) { int from_dim; struct agm_ent a; a = agm_from_gmi(e); from_dim = agm_dim_from_type(a.type); if (dim == from_dim - 1) return get_down(to_base(m)->topo, a); else if (dim == from_dim + 1) return get_up(to_base(m)->topo, a); gmi_fail("only one-level adjacencies supported"); return 0; }
int gmi_base_dim(struct gmi_model* m, struct gmi_ent* e) { (void)m; return agm_dim_from_type(agm_from_gmi(e).type); }