On 24 May 2013 11:38:59 +0200
"Niraj Jha" <[email protected]> wrote:
> Hello Fenics team,
>
> I am trying to solve a problem described here
> http://www.caesarsystems.co.uk/NAFEMS_benchmarks/le10.html..I don't
> have the exact result what i am looking for??
> I tried to check my code many times but there is still error..Any
> advance user can help me out with this problem..
>
> tol = 1e-10
> ABA'B'
> class Left(SubDomain):
> def inside(self, x, on_boundary):
> return near (x[1],2.75) and between(x[2],(0.0,0.600))
> #return between(x[1],(1.0,2.75)) or
> between(x[2],(0.0,0.600))
In addition to my previous comments I think there should be
between(x[1],(1.0,2.75)) instead of near(x[1],2.75). You don't want to
apply BC on the edge only. Alse there must definitely be 'and', not
'or'.
>
> DCD'C'
> class Right(SubDomain):
> def inside(self, x, on_boundary):
> return near (x[0],3.25) and between(x[2],(0.0,0.600))
> #return between(x[0],(2.0,3.25)) or
> between(x[2],(0.0,0.600 )) BCB'C'
Also here should be between(x[0],(2.0,3.25)) instead of near(x[0],3.25).
> class Outerall(SubDomain):
> def inside(self, x, on_boundary):
> return (((x[0]/3.25)**2 +(x[1]/2.75)**2) - 1.0 > tol) and
> between(x[2],(0.0,0.600))
Generally you must increase tol very much as these curved surfaces
are approximated by very coarse plane segments. With so tight
tolerance there is no chance that every whole facet (all its vertices
plus barycenter) will hit this surface of elliptical cylinder.
>
> Mid plane of BCB'C'
> class Outermid(SubDomain):
> def inside(self, x, on_boundary):
> return (((x[0]/3.25)**2 +(x[1]/2.75)**2 )-1.0 > tol) and
> near(x[2],0.300)
> ABCD
> class Top(SubDomain):
> def inside(self, x, on_boundary):
> return near(x[2], 0.600 )
>
>
> V = VectorFunctionSpace(mesh, "Lagrange", 1)
>
> # Initialize sub-domain instances
> left = Left()
> right = Right()
> outer1 = Outerall()
> outer2 = Outermid()
> top = Top()
>
> facet_domains = FacetFunction('size_t', mesh, 0)
> top.mark(facet_domains, 3)
>
> bc_right = DirichletBC(V.sub(1), Constant(0.0), right, "pointwise")
> bc_left = DirichletBC(V.sub(0), Constant(0.0), left, "pointwise")
> bc_outer1x = DirichletBC(V.sub(0), Constant(0.0),outer1, "pointwise")
> bc_outer1y = DirichletBC(V.sub(1), Constant(0.0),outer1, "pointwise")
> bc_outer2x = DirichletBC(V.sub(0), Constant(0.0),outer2, "pointwise")
> bc_outer2y = DirichletBC(V.sub(1), Constant(0.0),outer2, "pointwise")
> bc_outer2z = DirichletBC(V.sub(2), Constant(0.0),outer2, "pointwise")
> bc =
> [bc_right,bc_left,bc_outer1x,bc_outer1y,bc_outer2x,bc_outer2y,bc_outer2z]
>
> Thanks
> Niraj Kumar Jha
> 004917634988484
> _______________________________________________
> fenics mailing list
> [email protected]
> http://fenicsproject.org/mailman/listinfo/fenics
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics