Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

vector XFESpace for xfem inclusion problem in elasticity

More
4 years 9 months ago #1698 by camilo.suarezafanador
Dear Colleagues I'm writing a ngs-py file to deal with the inclusion problem and I've a problem with the dimension space when trying:
Code:
Vh = H1(mesh, order=1, dirichlet="left|right", dim=mesh.dim) Vhx = XFESpace(Vh, ci) VhG = FESpace([Vh,Vhx]) NgException: Compound space of spaces with different dimensions is not allowed

Clearly the problem is because Vh is dim = 2 and Vhx is dim = 1.

My question then is :
Which flag I've to apply to XFESpace function to deal with the dimension of Vh
More
4 years 9 months ago #1699 by schruste
Hi,

Sorry, I think this not fixable with a flag, yet. I will have to program this into the XFESpace. However, this will take some time for me to find the time for it...

Perhaps you can find a CutFEM-characterization for the same problem? With Compress(..) you can reduce the dofs to the same amount. Alternatively you could replace the vector-valued FESpace by multiple scalar FESpaces.

Best,
Christoph
More
4 years 9 months ago #1714 by camilo.suarezafanador
Thank you so much for the answer Mr Schruste, it would be so nice if you coul say me where can I find the CutFEM application, and my question about the multiple Scalar FESpace is how I could implemented this definition for example applying the Grad or Div, have I to define each one or I can Apply the operator directly

Thank you so much for your answer,

Best Regards
Camilo
More
4 years 2 weeks ago #2539 by nepomuk
Hello,
I think I have quite a similar problem, I'd like to do XFEM for linear elasticity, I defined the FE spaces like
Code:
Vh = VectorH1(mesh, order=1) Vhx = XFESpace(Vh,ci) VhG = FESpace([Vh,Vhx])

Now it hangs up when doing the neg() or pos() function like
Code:
u_std, u_x = VhG.TrialFunction() u = [u_std + neg(u_x)]

saying
Code:
NgException: Dimensions don't match, op = + dims1 = 0: 2, dims2 = 0: 1

Is there a way to fix it, apart of using two FE spaces coordinatewise?

BR,
Nepomuk
More
4 years 2 weeks ago #2541 by schruste
Hi,

Oh, I completely forgot about this issue! Thanks for the reminder.

I fixed the XFESpace so that it is now able to deal with base FESpaces that have a higher dimension. The changes are in the master branch on github, but not yet in the release branch which is the standard branch on github (to come within a few weeks). So please checkout the latest "master" branch on github and recompile ngsxfem.

Afterwards, use H1(mesh, dim=mesh.dim) instead of VectorH1 (VectorH1 is still not supported by XFESpace). With dim=mesh.dim however elasticity should be possible now. Please give it a try! I'd be nice if you could report if things are working for you.

Best,
Christoph
The following user(s) said Thank You: camilo.suarezafanador
More
4 years 2 weeks ago #2547 by nepomuk
Hi Christoph,

The XFE Space workes fine, but I got another issue: I do need the transposed gradient, but
Code:
gradu.trans
with
Code:
gradu = [grad(u_std) + op(u_x) for op in [neg_grad,pos_grad]]
gives the error AttributeError: 'list' object has no attribute 'trans'...
How can I do this?

BR, Nepomuk
Time to create page: 0.135 seconds