Could you try to run the script again with a new mshr. This is probably
caused by a bug that was fixed very recently (
https://bitbucket.org/fenics-project/mshr/commits/26754d76405dd0c85a58b24d380ecf1f10b90d37
). Your script works fine on my laptop.

(The issue tracker is here: https://bitbucket.org/fenics-project/mshr/issues
)

Best regards

Benjamin Kehlet



On 21 September 2015 at 00:19, simone <simone.carrier...@gmail.com> wrote:

> Good evening,
>
> I write here since mshr's issue tracker at BitBucket isn't enabled, I'm
> sorry if it isn't the right place.
> I think I've found a bug in subdomain's generator.
> Here's the code:
>
>      from mshr import *
>      from dolfin import *
>
>      Base=16.0*1E-2        #m
>      Height=11.0*1E-2    #m
>      B_3=5.5*1E-2
>      H_3=1.8*1E-2
>      X_g3=5.5*1E-2    #m
>      Y_g3=1.9*1E-2    #m    THIS DOESN'T WORK
>      #Y_g3=1.8*1E-2    #m    THIS WORKS AS EXPECTED
>
>      b_3=B_3/Base
>      h_3=H_3/Base
>      x_g3=X_g3/Base
>      y_g3=Y_g3/Base
>
>      base=1
>      height=Height/Base
>
>      geom=Rectangle(dolfin.Point(0.0,0.0),dolfin.Point(base,height))
>
> geom.set_subdomain(1,Rectangle(dolfin.Point(x_g3-b_3/2.0,y_g3-h_3/2.0),dolfin.Point(x_g3+b_3/2.0,y_g3+h_3/2.0)))
>
>      mesh=generate_mesh(geom,50,"cgal")
>
>      plot(mesh)
>      mf = dolfin.MeshFunction("size_t", mesh, 2, mesh.domains())
>      dolfin.plot(mf, "Subdomains")
>
>      interactive()
>
>
> In Y_g3=1.9*1E-2 case the set_subdomain instruction does nothing.
> Is there another way to create a mesh conforming with one or more
> subdomains?
>
> Thank you for the support.
> Regards
> Simone Carriero
>
> _______________________________________________
> fenics mailing list
> fenics@fenicsproject.org
> http://fenicsproject.org/mailman/listinfo/fenics
>
_______________________________________________
fenics mailing list
fenics@fenicsproject.org
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to