def getTetragridR(elementNode, prefix, tetragrid):
 rowKeys = 'Pr1 Pr2 Pr3 Pr4'.replace('P', prefix).split()
 evaluatedDictionary = evaluate.getEvaluatedDictionaryByEvaluationKeys(elementNode, rowKeys)
 if (len(evaluatedDictionary.keys()) < 1):
  return tetragrid
 for (rowKeyIndex, rowKey) in enumerate(rowKeys):
  if (rowKey in evaluatedDictionary):
   value = evaluatedDictionary[rowKey]
   if ((value == None) or (value == 'None')):
    print 'Warning, value in getTetragridR in matrix is None for rowKey for dictionary:'
    print rowKey
    print evaluatedDictionary
   else:
    tetragrid = getIdentityTetragrid(tetragrid)
    for (elementIndex, element) in enumerate(value):
     tetragrid[rowKeyIndex][elementIndex] = element
 euclidean.removeElementsFromDictionary(elementNode.attributes, rowKeys)
 return tetragrid

def getTetragridR ( elementNode , prefix , tetragrid ) : rowKeys = 'Pr1 Pr2 Pr3 Pr4' . replace ( 'P' , prefix ) . split ( ) evaluatedDictionary = evaluate . getEvaluatedDictionaryByEvaluationKeys ( elementNode , rowKeys ) if ( len ( evaluatedDictionary . keys ( ) ) < 1 ) : return tetragrid for ( rowKeyIndex , rowKey ) in enumerate ( rowKeys ) : if ( rowKey in evaluatedDictionary ) : value = evaluatedDictionary [ rowKey ] if ( ( value == None ) or ( value == 'None' ) ) : print 'Warning, value in getTetragridR in matrix is None for rowKey for dictionary:' print rowKey print evaluatedDictionary else : tetragrid = getIdentityTetragrid ( tetragrid ) for ( elementIndex , element ) in enumerate ( value ) : tetragrid [ rowKeyIndex ] [ elementIndex ] = element euclidean . removeElementsFromDictionary ( elementNode . attributes , rowKeys ) return tetragrid
get the tetragrid from the elementnode letter r values .