def getTetragridMatrix(elementNode, prefix, tetragrid):
 matrixKey = (prefix + 'matrix')
 evaluatedDictionary = evaluate.getEvaluatedDictionaryByEvaluationKeys(elementNode, [matrixKey])
 if (len(evaluatedDictionary.keys()) < 1):
  return tetragrid
 value = evaluatedDictionary[matrixKey]
 if ((value == None) or (value == 'None')):
  print 'Warning, value in getTetragridMatrix in matrix is None for matrixKey for dictionary:'
  print matrixKey
  print evaluatedDictionary
 else:
  tetragrid = getIdentityTetragrid(tetragrid)
  for (rowIndex, row) in enumerate(value):
   for (elementIndex, element) in enumerate(row):
    tetragrid[rowIndex][elementIndex] = element
 euclidean.removeElementsFromDictionary(elementNode.attributes, [matrixKey])
 return tetragrid

def getTetragridMatrix ( elementNode , prefix , tetragrid ) : matrixKey = ( prefix + 'matrix' ) evaluatedDictionary = evaluate . getEvaluatedDictionaryByEvaluationKeys ( elementNode , [ matrixKey ] ) if ( len ( evaluatedDictionary . keys ( ) ) < 1 ) : return tetragrid value = evaluatedDictionary [ matrixKey ] if ( ( value == None ) or ( value == 'None' ) ) : print 'Warning, value in getTetragridMatrix in matrix is None for matrixKey for dictionary:' print matrixKey print evaluatedDictionary else : tetragrid = getIdentityTetragrid ( tetragrid ) for ( rowIndex , row ) in enumerate ( value ) : for ( elementIndex , element ) in enumerate ( row ) : tetragrid [ rowIndex ] [ elementIndex ] = element euclidean . removeElementsFromDictionary ( elementNode . attributes , [ matrixKey ] ) return tetragrid
get the tetragrid from the elementnode matrix value .