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

I have a problem with using the Grid function #904

Closed
ljhraid opened this issue May 25, 2023 · 1 comment
Closed

I have a problem with using the Grid function #904

ljhraid opened this issue May 25, 2023 · 1 comment

Comments

@ljhraid
Copy link

ljhraid commented May 25, 2023

Hi, I am very new to Gridap.

I just want to solve a 2D Poisson equation with triangle elements.
But I have a problem with using the Grid function.

Here is my code.

using Gridap
using Gridap.Geometry
using Gridap.ReferenceFEs

xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
nel  = (10, 10) # the number of elements of each sides

domain = (xmin, xmax, ymin, ymax)

model_car = CartesianDiscreteModel(domain, nel)

Grid(LagrangianRefFE(TRI), model_car)

The error message says

MethodError: no method matching Grid(::GenericLagrangianRefFE{GradConformity, 2}, ::CartesianDiscreteModel{2, Float64, typeof(identity)})

But I am quite sure it matches the method "Grid(::Type{ReferenceFE{d}}, ::CartesianDiscreteModel{d})".

supertype(supertype(typeof(LagrangianRefFE(TRI))))
# The output: ReferenceFE{2}

Do I misunderstand something?
Could anyone help me to solve this problem?

Just in case when you are curious about the reason why I use the Grid function, I used it to insert it into DiscreteModel function.

@JordiManyer
Copy link
Member

@ljhraid To convert to triangles, use the method simplexify(model_car). Creating a model from scratch is quite involved, and there is no way you can infer the connectivity for TRI elements from a CartesianDiscreteModel like you are trying to do....

Also, we have a gitter channel for this kind of inquiries. Next time, you should try to post there to avoid clutter in the repo issue list, which should be reserved for bugs and/or discussions.

@ljhraid ljhraid closed this as completed May 26, 2023
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