EXPORT SIDE physical_side_of_bdry_curve( CURVE *c) { if (wave_type(c) >= FIRST_PHYSICS_WAVE_TYPE) { screen("ERROR in physical_side_of_bdry_curve(), non bdry curve\n"); print_curve(c); clean_up(ERROR); } if (is_bdry(c)) { return is_exterior_comp(negative_component(c),c->interface) ? POSITIVE_SIDE : NEGATIVE_SIDE; } else if (is_excluded_comp(negative_component(c),c->interface)) return POSITIVE_SIDE; else if (is_excluded_comp(positive_component(c),c->interface)) return NEGATIVE_SIDE; else { screen("ERROR in physical_side_of_bdry_curve(), " "interior boundary not bounded by an excluded component\n"); print_curve(c); clean_up(ERROR); } return UNKNOWN_SIDE; /* for lint */ } /*end physical_side_of_bdry_curve*/
EXPORT boolean ComponentIsFlowSpecified( COMPONENT comp, Front *fr) { if (is_excluded_comp(comp,fr->interf)) return YES; return (FSR_for_comp(comp,fr,fr->interf) != NULL) ? YES : NO; } /*end ComponentIsFlowSpecified*/
EXPORT COMPONENT new_component( COMPONENT comp) { COMPONENT mincomp, maxcomp; HYPER_SURF **hs; INTERFACE *intfc; struct Table *firstIT, *T; static COMPONENT last_reused_comp = NO_COMP; if (comp != NO_COMP) { firstIT = interface_table_list(); switch (comp) { case UNUSED_COMP: maxcomp = INT_MIN; mincomp = INT_MAX; for (T = firstIT; T != NULL; T = T->next) { intfc = T->interface; maxcomp = max(maxcomp,max_component(intfc)); mincomp = min(mincomp,min_component(intfc)); } ++maxcomp; for (comp = mincomp; comp <= maxcomp; ++comp) { if (comp == last_reused_comp) continue; for (T = firstIT; T != NULL; T = T->next) { intfc = T->interface; if (is_exterior_comp(comp,intfc) || is_excluded_comp(comp,intfc)) break; if (intfc->hss != NULL) { for (hs = intfc->hss; *hs; ++hs) { if ((positive_component(*hs) == comp) || (negative_component(*hs) == comp)) break; } if (*hs) break; } } if (T == NULL) break; } last_reused_comp = comp; break; case NEW_COMP: comp = INT_MIN; for (T = firstIT; T != NULL; T = T->next) { intfc = T->interface; comp = max(comp,max_component(intfc)); } ++comp; last_reused_comp = NO_COMP; break; default: last_reused_comp = NO_COMP; break; } for (T = firstIT; T != NULL; T = T->next) { intfc = T->interface; max_component(intfc) = max(comp,max_component(intfc)); min_component(intfc) = min(comp,min_component(intfc)); } } return comp; } /*end new_component*/