Skip to content
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

Some AnalyticalGeometry lack the name property #82

Closed
cenmir opened this issue Apr 18, 2024 · 1 comment
Closed

Some AnalyticalGeometry lack the name property #82

cenmir opened this issue Apr 18, 2024 · 1 comment

Comments

@cenmir
Copy link
Contributor

cenmir commented Apr 18, 2024

Greetings!

Had an issue with the square function, the parameter name is not used in the last line in intersect. This causes an issue when used to compute EmbeddedBoundary.

Minimal example to reproduce error:

using Gridap
using GridapEmbedded


N = 10
partition = (N, N);
pmin = Point(-1, -1);
pmax = Point(1, 1);
bgmodel = CartesianDiscreteModel(pmin, pmax, partition);

geo1 = square(L=1.5, name="Outer");
geo2 = square(L=0.75, name="Inner");
geo = setdiff(geo1, geo2, name="csg");

cutgeo = cut(bgmodel, geo);

Γd = EmbeddedBoundary(cutgeo, "csg", "Inner");
Γn = EmbeddedBoundary(cutgeo, "csg", "Outer");

Potential fix:

function square(;L=1,x0=Point(0,0),name="square",edges=["edge$i" for i in 1:4])

    e1 = VectorValue(1,0)
    e2 = VectorValue(0,1)
  
    plane1=plane(x0=x0-0.5*L*e2,v=-e2,name=edges[1])
    plane2=plane(x0=x0+0.5*L*e2,v=+e2,name=edges[2])
    plane3=plane(x0=x0-0.5*L*e1,v=-e1,name=edges[3])
    plane4=plane(x0=x0+0.5*L*e1,v=+e1,name=edges[4])
  
    geo12 = intersect(plane1,plane2)
    geo34 = intersect(plane3,plane4)
  
    intersect(geo12,geo34, name=name)
  
end

Other AnalyticalGeometries also lack the name property, i don't know if this is by design or not.

@ericneiva
Copy link
Member

Hi, @cenmir,

Thank you so much for reporting this :)

What you describe is very clear.

I agree with the fix and it should be propagated to other geometries.

Feel free to fork, apply these changes and assign the PR to me.

Btw, have you tried:

Γd = EmbeddedBoundary(cutgeo, geo, geo2);
Γn = EmbeddedBoundary(cutgeo, geo, geo1);

instead of passing the geometry names?

cenmir added a commit to cenmir/GridapEmbedded.jl that referenced this issue May 21, 2024
ericneiva added a commit that referenced this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants