Exemplo n.º 1
0
  // ## operation writeChemkinReactions(ReactionModel)
  // 10/26/07 gmagoon: changed to take temperature as parameter (it doesn't seem like this method is
  // currently used anywhere)
  public static String writeChemkinReactions(
      ReactionModel p_reactionModel, Temperature p_temperature) {
    // #[ operation writeChemkinReactions(ReactionModel)
    StringBuilder result = new StringBuilder();
    result.append("REACTIONS	KCAL/MOLE\n");
    CoreEdgeReactionModel cerm = (CoreEdgeReactionModel) p_reactionModel;

    LinkedHashSet all = cerm.getReactedReactionSet();

    HashSet hs = new HashSet();
    int numfor = 0;
    int numrev = 0;
    int numdup = 0;
    int numnorev = 0;
    for (Iterator iter = all.iterator(); iter.hasNext(); ) {
      Reaction rxn = (Reaction) iter.next();
      if (rxn.isForward()) {
        result.append(
            " "
                + rxn.toChemkinString(p_temperature)
                + "\n"); // 10/26/07 gmagoon: changed to avoid use of Global.temperature
        //	result.append(" " + rxn.toChemkinString(Global.temperature) + "\n");

      }
    }

    result.append("END\n");

    return result.toString();

    // #]
  }
Exemplo n.º 2
0
 // ## operation setReactantTree(LinkedHashSet)
 public void setReactantTree(LinkedHashSet p_treeSet) {
   // #[ operation setReactantTree(LinkedHashSet)
   if (p_treeSet == null) throw new InvalidReactantTreeException();
   int size = p_treeSet.size();
   if (size == 0) throw new InvalidReactantTreeException();
   Iterator iter = p_treeSet.iterator();
   while (iter.hasNext()) {
     HierarchyTree tree = (HierarchyTree) iter.next();
     addReactantTree(tree);
   }
   return;
   // #]
 }