Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Gmsh transfinite mehses with curved geometries #25

Open
FRUrgorri opened this issue Mar 10, 2022 · 7 comments
Open

Using Gmsh transfinite mehses with curved geometries #25

FRUrgorri opened this issue Mar 10, 2022 · 7 comments

Comments

@FRUrgorri
Copy link
Contributor

I am trying to launch the function "main" in debug mode using transfine meshes designed with Gmsh.

I have prepared two simple examples: A square-section channel and a pipe. In the first case everything seems to work ok. However, in the second case I obtain a bound error when main is defining the test space V_p (line 83 of src/Main.jl V_p = TestFESpace(Ω,reffe_p))

Perhaps it is the way in which I define the pipe mesh but I do not see the difference between the two cases other than the curvature (which naturally introduce non orthogonal cells).

You can reproduce the error with the test.jl file (you need to add GridapGmsh to the project first). I include the .msh files. I also include the .geo files I used to generete them in case they help
Test.zip

Thanks for the help

@fverdugo
Copy link
Member

I can reproduce this error:

julia> include("test.jl")
Info    : Reading 'Channel.msh'...
Info    : 275 nodes
Info    : 432 elements
Info    : Done reading 'Channel.msh'
Info    : No current model available: creating one
Info    : Reading 'Pipe.msh'...
Info    : 2684 nodes
Info    : 3292 elements
Info    : Done reading 'Pipe.msh'
[1.949e+00 s in MAIN] fe_spaces
[1.333e+00 s in MAIN] solve
ERROR: LoadError: BoundsError: attempt to access 1-element Vector{Vector{Int64}} at index [2]

@FRUrgorri
Copy link
Contributor Author

Yes, that is the error.

The Cartesian geometry (Channel.msh) works but the cylindrical geometry (Pipe.msh) gives the error.

@fverdugo
Copy link
Member

An even smaller reproducer:

using Gridap
using GridapGmsh
model = GmshDiscreteModel("Pipe.msh")
writevtk(model,"run_model")
k = 2
reffe = ReferenceFE(lagrangian,Float64,k-1;space=:P)
V = TestFESpace(model,reffe) # Error

the error can be circumvented using

V = TestFESpace(model,reffe,conformity=:L2) # Works

I'll fix it in the main function

@fverdugo
Copy link
Member

@FRUrgorri fixed in master

@FRUrgorri
Copy link
Contributor Author

Thanks @fverdugo. I think that a similar solution needs to be applied to V_j as well since the same error is produced when Main.jl tries to define this space.

@fverdugo
Copy link
Member

fverdugo commented Mar 14, 2022

Raviart-Thomas elements seem to be implemented in Gridap for "oriented" meshes at this moment. Cartesian hex meshes and unstructured tet meshes are oriented, but unstructured hex meshes are potentially not.

It is not a minor fix, but the extension to non-oriented meshes should be feasible.

@fverdugo fverdugo reopened this Mar 14, 2022
@FRUrgorri
Copy link
Contributor Author

It seems that the problem can be avoided by not recombining the transfinite meshes in Gmsh, i.e. using prism meshes. I will do more testing but so far it has worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants