EXPORT int comps_consistent_at_node( NODE *node) { INTERFACE *intfc = node->interface; COMPONENT compi, compj; CURVE **c; int i, j; int ans; static O_NODE On; static int alloc_num_c = 0; /* Don't check for consistency on subdomain boundaries */ if (is_pp_node(node)) return YES; ans = YES; On.node = node; On.num_c = 0; On.prev = On.next = NULL; for (c = node->in_curves; c && *c; ++c) ++On.num_c; for (c = node->out_curves; c && *c; ++c) ++On.num_c; if (On.num_c == 0) return YES; if ((alloc_num_c == 0) || (alloc_num_c < On.num_c)) { if (alloc_num_c > 0) free_these(5,On.nc,On.nopp,On.pt,On.ang,On.orient); uni_array(&On.nc,On.num_c,sizeof(CURVE *)); uni_array(&On.nopp,On.num_c,sizeof(NODE *)); uni_array(&On.pt,On.num_c,sizeof(POINT *)); uni_array(&On.ang,On.num_c,FLOAT); uni_array(&On.orient,On.num_c,INT); alloc_num_c = On.num_c; } set_curves_at_onode(&On); for (i = 0; i < On.num_c; ++i) { j = (i + 1) % On.num_c; if (On.orient[i] == POSITIVE_ORIENTATION) compi = negative_component(On.nc[i]); else compi = positive_component(On.nc[i]); if (On.orient[j] == POSITIVE_ORIENTATION) compj = positive_component(On.nc[j]); else compj = negative_component(On.nc[j]); if (!equivalent_comps(compi,compj,intfc)) { ans = NO; break; } } return ans; } /*end comps_consistent_at_node*/
LOCAL boolean BothSidesActive( HYPER_SURF *hs, Front *front) { FlowSpecifiedRegion *fsr; INTERFACE *intfc = front->interf; COMPONENT pcomp = positive_component(hs); COMPONENT ncomp = negative_component(hs); if (hs == NULL) return NO; for (fsr = Fsr_list(front); fsr != NULL; fsr = fsr->next) { if (equivalent_comps(fsr->comp,pcomp,intfc)) return NO; if (equivalent_comps(fsr->comp,ncomp,intfc)) return NO; } return YES; } /*end BothSidesActive*/