How to use Polar-Coordinates to mark a cylindrical boundary

Asked by Roman Moritz

Hey Guys
I want to mark the inner boundary of an hollow cylinder. Therefor i want to use Polar-Coordinates to make it easyer but i have no idea how to use them to mark a boundary. Is there an UFL-Class or something for that? Or maybe something compareable to x[0],x[1]...
i tried something like

class NeumannBoundary(SubDomain):
 def inside(self, x ,on_boundary):
  tol = 1E-14
  return on_boundary and x[0]< (r+tol)*cos(theta) and x[1]<(r+tol)*sin(theta)

but then i would have to define a theta which goes fom 0 to 2*pi. Furthermore in this example it defines everything that yield x[0]< (r+tol)*cos(theta) and x[1]<(r+tol)*sin(theta) and not only my inner boundary. So Maybe theres an easier solution
thanks for helping
greetings Roman

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Roman Moritz
Solved:
Last query:
Last reply:
Revision history for this message
Zilan Ciftci (zilan-ciftci) said :
#1

Why not check the radius?

x^2 + y^2 < (r+tol)^2

On Tue, Jul 24, 2012 at 4:11 PM, Roman Moritz <
<email address hidden>> wrote:

> New question #204032 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/204032
>
> Hey Guys
> I want to mark the inner boundary of an hollow cylinder. Therefor i want
> to use Polar-Coordinates to make it easyer but i have no idea how to use
> them to mark a boundary. Is there an UFL-Class or something for that? Or
> maybe something compareable to x[0],x[1]...
> i tried something like
>
> class NeumannBoundary(SubDomain):
> def inside(self, x ,on_boundary):
> tol = 1E-14
> return on_boundary and x[0]< (r+tol)*cos(theta) and
> x[1]<(r+tol)*sin(theta)
>
> but then i would have to define a theta which goes fom 0 to 2*pi.
> Furthermore in this example it defines everything that yield x[0]<
> (r+tol)*cos(theta) and x[1]<(r+tol)*sin(theta) and not only my inner
> boundary. So Maybe theres an easier solution
> thanks for helping
> greetings Roman
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Revision history for this message
Roman Moritz (r-moritz) said :
#2

Ups Oh God yeah sometimes its just that easy -.-
thx solved my question