Reputation: 1
I generated a 2D model with gmsh and set up different physics groups. When I try to
coeff = CellVariable(mesh=mesh)
coeff.constrain(k_Au,where=mesh.physicalCells == 'ring')
I get the error
if numerix.shape(value.where)[-1] == self.mesh.numberOfFaces:
IndexError: tuple index out of range
How can I set different coefficients for my different physicalCells?
Upvotes: 0
Views: 38
Reputation: 2484
You don't have the syntax quite right. Try
coeff.constrain(k_Au,where=mesh.physicalCells['ring'])
Also, .constrain()
is intended for boundary conditions. To set different values of a coefficient, I would do
coeff.setValue(k_Au, where=mesh.physicalCells['ring'])
Upvotes: 0