2-D function definition, getting index 1 is out of bounds for axis 0


106
views
0
5 months ago by
Daniel  
class VF(Expression):

    def __init__(self, c1 = 0.0, c2 = 0.0, **kwargs):

        self.c1 = c1

        self.c2 = c2

        

    def eval(self, values, x):

        values[0] = self.c1

        values[1] = self.c2

    

    def value_shape(self):

        return (2,)




c = VF(c1 = 1.0, c2 = 1.0, element = V.ufl_element())

array = project(c, V)
Community: FEniCS Project
Your code works fine for me in version 2017.2 definig V as VectorFunctionSpace
written 5 months ago by Hernán Mella  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »