Marking a rectangular patch on outer boundary of prolate ellipsoid

6 weeks ago by
Hi there,
I am using a prolate ellipsoid as my mesh. I am able to detect its outer , inner and top boundaries through the following code. Now I want to mark a rectangle patch on the outer boundary. How can I do this ?. I mean how to communicate this to fenics ?
Any sort of suggestion / help is welcome, please.
mesh = Mesh('xyz.xml')

a1 = (0.02 + 0.013) 	; c1 = (0.06 + 0.01)	# m (principal axes for big)
a2 = 0.02   			; c2 = 0.06	# m (principal axes for small)

# Marking boundaries 
class Outer(SubDomain): 			
	def inside(self, x, on_boundry):
		return on_boundry

class Inner(SubDomain): 			
	def inside(self, x, on_boundry):
		return (x[0]*x[0]+x[2]*x[2] < (a2*a2)*(1.0-(x[1]*x[1])/(c2*c2)) + 1e-7) and on_boundry

class Top(SubDomain): 		
	def inside(self, x, on_boundry):
		return (x[1] > -1e-7) and on_boundry​
Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »