← Back to team overview

dolfin team mailing list archive

[Question #153591]: local coordinates

 

New question #153591 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/153591

I need the coordinates relative to the middle of the cell in my form, so I came to the idea of

class cellcoords(Expression):
	def eval(self, out, x):
		out[0] = x[0]-self.??().midpoint()
		out[1] = x[1]-self.??().midpoint()
		out[2] = x[2]-self.??().midpoint()
	def value_shape(self):
		return (3,)

x = cellcoords()

where my lack of programming knowledge restricts me to the question marks ! I dig in the Mesh...h but could not find out..

How can I reach to a method (midpoint() )  in MeshEntity class from the Expression (I think self. directs me to the MeshData class) ?

any other method is also welcome.

Thanks a lot, 

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



Follow ups