CompoundPredicate

CompoundPredicate谓词的扩展。 使用此类的扩展根据子谓词的逻辑组合进行计算。 提供了 AndOrNot 关系的扩展。

示例:

CSOCondition<Boundary> cnd = new CSOCondition<Boundary>();
cnd.setDesc("An inlet or outlet boundary.");
CSOLookupConditionTrigger<Boundary> cndTrigger =
new CSOLookupConditionTrigger<Boundary>(Boundary.class);
cnd.setTriggers(Collections.singleton(cndTrigger));
Predicate<Boundary> inletPredicate = new Predicate<Boundary>() {
@Override
public boolean evaluate(Boundary boundary) {
if (boundary.getBoundaryType() instanceof InletBoundary) {
return true;
}
return false;
}
};
Predicate<Boundary> outletPredicate = new Predicate<Boundary>() {
@Override
public boolean evaluate(Boundary boundary) {
if (boundary.getBoundaryType() instanceof OutletBoundary) {
return true;
}
return false;
}
};
List<Predicate<Boundary>> predicates = new ArrayList<Predicate<Boundary>>();
predicates.add(inletPredicate);
predicates.add(outletPredicate);
cnd.setPredicate(new OrPredicate<Boundary>(predicates));

在线 API:

有关编码细节,请参见 Simcenter STAR-CCM+帮助菜单:

帮助 > Java API > star.common.filters > CompoundPredicate

帮助 > Java API > star.common.filters > AndPredicate

帮助 > Java API > star.common.filters > NonePredicate

帮助 > Java API > star.common.filters > OrPredicate