Gridap.jl icon indicating copy to clipboard operation
Gridap.jl copied to clipboard

Implementing new elements in Gridap

Open bhaveshshrimali opened this issue 3 years ago • 2 comments

Hi @fverdugo @santiagobadia,

In the meanwhile I try on getting a MWE on #400 , I wanted to ask about implementing new elements in Gridap. Specifically I wanted to implement and test the Crouzeix-Raviart elements, both conforming and non-conforming, in 2D/3D for incompressible hyperelasticity. These can be useful for applications in heterogeneous systems, where there is a discontinuity in stress/pressure. The standard Taylor-hood elements might offer poor convergence.

How much change in the FE pipeline is required to implement/test new elements in Gridap? If you can guide, then I can also take a stab at implementing these once I have a broad idea on the pipeline, and specifically where to make changes.

Thanks

bhaveshshrimali avatar Sep 10 '20 18:09 bhaveshshrimali

@bhaveshshrimali

Yes, it is easy to add new finite elements in Gridap, the code is designed to do this (and other) extensions. It would be very nice if you can add new ones!

Take a look at the sources of the Gridap.ReferenceFEs module. The doc strings are quite decent for this part. So, I think you will figure out how to add the new elements by you own.

We have an abstract interface for reference FEs, which shows which are the methods to be implemented by new reference FEs:

https://github.com/gridap/Gridap.jl/blob/5faa6e0742d7003cbae5a7c4bbdefccf08e038c5/src/ReferenceFEs/ReferenceFEInterfaces.jl#L34

However, In many situations, you do not need to implement a new struct that inherents from ReferenceFE. You just need to fill a GenericReferenceFE with the corresponding objects. Take a look on how RT elements are implemented:

https://github.com/gridap/Gridap.jl/blob/5faa6e0742d7003cbae5a7c4bbdefccf08e038c5/src/ReferenceFEs/RaviartThomasRefFEs.jl#L9

fverdugo avatar Sep 11 '20 06:09 fverdugo

Sounds good !! Thanks a lot for the pointers. I will start taking a look at this soon.

bhaveshshrimali avatar Sep 11 '20 15:09 bhaveshshrimali