-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add modal c0 machinery #777
Conversation
It is possible (at least in theory) to evaluate a single function at a single point. But this situations is not used often, and thus it is likely that there is missing implementations related with this. If you provide a minimal example that crashes with this error, I can evaluate what is still missing. |
Hi, @fverdugo, If you run the 1D snippet below checking out on the previous commit of this branch, i.e., 1bf6f6c, you should get the error I am referring to: using Gridap
using Gridap.CellData
using Gridap.FESpaces
u(x) = x[1]^3
domain = (0,4)
partition = (4,)
model = CartesianDiscreteModel(domain,partition)
order = 3
reffe = ReferenceFE(modalC0,Float64,order)
V = FESpace(model,reffe,conformity=:H1)
shfns_g = get_fe_basis(V)
phys_shfns_g = change_domain(shfns_g,PhysicalDomain())
dofs_f = get_fe_dof_basis(V)
dofs_f(phys_shfns_g) Of course, it works running on the newest commit of this branch, where the only diff is that I apply the trick of expressing the Modal C0 shapefuns as a trivial linear combination. Thanks for taking a look at this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talking with @ericneiva, the linear combination trick looks good to me.
Performance issues can be fixed in a second round.
@santiagobadia If you agree and there are no additional comments from your side, could you please accept the PR? |
Codecov Report
@@ Coverage Diff @@
## master #777 +/- ##
==========================================
- Coverage 88.28% 88.24% -0.05%
==========================================
Files 153 156 +3
Lines 16929 17312 +383
==========================================
+ Hits 14946 15277 +331
- Misses 1983 2035 +52
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Hi, @santiagobadia,
This PR adds (generalised) Modal C0 bases and reffes into Gridap.
I have refactored the code such that it is minimally invasive.
There are two things however to improve:
CellConformity
is compressed on cell types. At the moment, I compute theCellConformity
for each Modal C0 cell type. This is redundant. We have different shape functions, but theCellConformity
is usually the same everywhere. I have found out that this approach is quite inefficient inGridap.jl/src/FESpaces/ConformingFESpaces.jl
Line 78 in 1fb3dc9
Gridap.jl/src/FESpaces/ConformingFESpaces.jl
Line 40 in 1fb3dc9
CellConformity
and assign it to all Modal C0 cell types.Gridap.jl/src/ReferenceFEs/ReferenceFEInterfaces.jl
Line 491 in eadad31
Gridap
errors at attempting to evaluate a single Modal C0 shapefun at a single point. I thinkGridap
's design is planned to evaluate the whole Modal C0 basis at a single point, not a single shapefun. Maybe @fverdugo knows what is missing.We can discuss about those two points whenever you want.
In the meantime, the new functionality (up to the points above) can be reviewed and merged into the code.
Cheers!