2

I would like to use MMA FEM abilities for example to apply galerkin's method to solve intergal equations or nonstandard numerical applications in a given mesh m.

Is it possible to extract the "node-functions" (one node value ==1, all others==0) from ElementMeshInterpolation[]?

To be more clear here is a very simple attempt( 1dimensional mesh, 3 nodes)

<< "NDSolve`FEM`"   
m = ToElementMesh["Coordinates" -> {{0}, {2/3}, {1}},"MeshElements" -> {LineElement[{{1, 2}, {2, 3} }]} ]
id = IdentityMatrix[ Length@m["Coordinates"]];
ff[x_] := Map[ElementMeshInterpolation[{m}, #][x] &, id];   

For further use with symbolic(!) node values {ui} I can use

ff[x].{u1,u2,u3}

My question: Is it possible to extract ff[x] more efficient?

Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55
  • 1
    Nope. Using ElementMeshInterpolation is very, very slow (has been the topic in several discussions) and there are (at least to my knowledge) currently no other alternatives to assembling by hand (which is not very hard) . I did something the like for the Laplacian of an embedded surface here. Maybe it helps. I also used the same approach for integral operators over curves. Let me know if I should provide code for it. – Henrik Schumacher Jan 02 '18 at 17:44
  • Just for clarification: I assumed that you aim at assembling the system matrix and right hand side by integrating numerically against ff[x]. – Henrik Schumacher Jan 02 '18 at 17:54
  • @ Henrik Schumacher: Yes! Thank you for your tricky approach. I have to think about because I should provide initial mesh node values – Ulrich Neumann Jan 02 '18 at 18:48
  • @HenrikSchumacher, can you show me an example where ElementMeshInterpolation is "very, very slow"? I suspect there is some miss understanding here that should be easy to remedy. – user21 Jan 03 '18 at 07:27
  • I do not understand your question. Are you looking for the shape functions? Can you explain a bit how you plan to compute the integral equations? I gave a presentation a while back on how to write PDE solvers. That can possibly serve as a basis - for example the FEM method in NIntegrate uses the approach shown there. – user21 Jan 03 '18 at 07:43
  • @HenrikSchumacher, this is not a problem of ElementMeshInterpolation that's a problem of the compiler not being able to handle ElementMeshInterpolation properly. I understand that for customers that does not matter but I need to be aware of these things and fix them if they are in my yard. Having said that even if the compiler did work properly I still have another idea for a speed up. ElementMeshInterpolation is designed for interpolation. If one needs values at coordinates then there are of course better ways to do that. If you have another one where EMI is slow let me know. Thx. – user21 Jan 03 '18 at 08:22
  • @user21 In your yard... aha. Good to know! I agree that I phrased it a bit unfair. What I tried to say is that system matrix assemblation should not be done this way (in conjunction with global integration); at least it's hard to make it as efficient as local, elementwise computations. – Henrik Schumacher Jan 03 '18 at 09:07
  • @HenrikSchumacher, yes, for system matrix assembly we have far better ways. I'll wait for OP to clarify the question a bit. – user21 Jan 03 '18 at 09:32
  • @user21: I'm looking for somthing like 'global shape function in the given mesh' – Ulrich Neumann Jan 03 '18 at 12:34
  • @HenrikSchumacher You an update, using an ElementMeshInterpolation that is build on the same mesh that is used for PDE solving in NDSolve is much faster now, then it was in previous versions. – user21 Jun 02 '22 at 05:04
  • @user21 Splendid! I have to try that when I have some more time. It's amazing how responsive you are to the needs of the community! – Henrik Schumacher Jun 02 '22 at 06:23
  • @HenrikSchumacher, thanks for the encouragement; there are so many requests it is becoming increasingly harder to stay on top of things. There is an example here – user21 Jun 02 '22 at 06:39
  • @HenrikSchumacher, you are not by any chance coming to the European Tech Conference, later this month in Frankfurt? – user21 Jun 02 '22 at 06:40
  • @user21 Very tempting, but I have already used up all my travelling funds for this semester. And the conference collides with teaching. So, no, I won't come. =( – Henrik Schumacher Jun 02 '22 at 06:54

0 Answers0