I am solving a problem where I need a custom expression
class scalarExpression(Expression):
def __init__(self, M, d, data, element):
self.M = M
self.d = d
self.data = data
self.element = element
def eval(self, value,x):
i, j, k = [int(e) for e in space2pixel(x, self.M, self.d)]
value[0] = self.data[i-1,j-1,k-1]
which requires an 3x3 matrix M, de 3dim vector d and a big data array of 512x512x600. I would like to run the code in parallel without splitting this function because every thread needs it in the entire domain. How is this possible? I haven't been able to find MPI directives to use in python with fenics. Thanks in advance.