I have a problem with using the Grid function
ljhraid opened this issue · 1 comments
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.
@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.