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

Issue with rotational periodic BC #78

Open
martinkosch opened this issue Mar 24, 2024 · 0 comments
Open

Issue with rotational periodic BC #78

martinkosch opened this issue Mar 24, 2024 · 0 comments

Comments

@martinkosch
Copy link

Hi and thank you for the good work!

I am trying to import a mesh that represents a slice of the full circular geometry of the simulated object. Therefore, I make use of rotational periodic boundary conditions. Reduced to a very minimal example in 2D, the mesh looks like this:

Screenshot from 2024-03-24 11-54-34

When importing this mesh with GmshDiscreteModel(), I run into the following issue:

ERROR: This line of code cannot be reached
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] macro expansion
   @ ~/.julia/packages/Gridap/dKMpW/src/Helpers/Macros.jl:47 [inlined]
 [3] _setup_nodes_and_vertices_periodic(gmsh::Module, dimTags::Vector{Tuple{Int32, Int32}}, nnodes::Int64)
   @ GridapGmsh ~/.julia/packages/GridapGmsh/AdYVp/src/GmshDiscreteModels.jl:69
 [4] _setup_nodes_and_vertices(gmsh::Module, node_to_coords::Vector{VectorValue{2, Float64}})
   @ GridapGmsh ~/.julia/packages/GridapGmsh/AdYVp/src/GmshDiscreteModels.jl:42
 [5] GmshDiscreteModel(gmsh::Module)
   @ GridapGmsh ~/.julia/packages/GridapGmsh/AdYVp/src/GmshDiscreteModels.jl:29
 [6] GmshDiscreteModel(mshfile::String; renumber::Bool)
   @ GridapGmsh ~/.julia/packages/GridapGmsh/AdYVp/src/GmshDiscreteModels.jl:19
 [7] GmshDiscreteModel(mshfile::String)
   @ GridapGmsh ~/.julia/packages/GridapGmsh/AdYVp/src/GmshDiscreteModels.jl:6

It seems as if this error occurs because the node at Point 1 is linked to itself instead of another node. Is this kind of geometry generally not supported/possible or this there something wrong in my code or the package?

The .geo file:

SetFactory("OpenCASCADE");

// Parameters
r2 = 0.2; // Radius of the outer circle
slice_angle = 2*Pi/180 * 2; 

// Define the medium points and lines
Point(1) = {0, 0, 0};
Point(2) = {r2, 0, 0};
Line(1) = {1, 2};

// Rotational extrusion of as small slice
Extrude { {0, 0, 1}, {0, 0, 0}, slice_angle} {
Line{1}; Layers{0}; Recombine;
}

// Add periodic line
Periodic Line{3} = {1} Rotate { {0, 0, 1}, {0, 0, 0}, slice_angle};

// Labeling
Physical Line("BoundaryR2") = {2};
Physical Surface("InnerVol") = {1};

The .msh file:

$MeshFormat
4.1 0 8
$EndMeshFormat
$PhysicalNames
2
1 1 "BoundaryR2"
2 2 "InnerVol"
$EndPhysicalNames
$Entities
3 3 1 0
1 0 0 0 0 
2 0.2 0 0 0 
3 0.1995128100519649 0.01395129474882506 0 0 
1 -1.000000000028756e-07 -1e-07 -1e-07 0.2000001 1e-07 1e-07 0 2 1 -2 
2 0.1995127100519649 -1.000000000002735e-07 -1e-07 0.2000001 0.01395139474882506 1e-07 1 1 2 2 -3 
3 -1.000000000028756e-07 -1.000000000002735e-07 -1e-07 0.1995129100519649 0.01395139474882506 1e-07 0 2 1 -3 
1 -1.000000000028756e-07 -1.000000000002735e-07 -1e-07 0.2000001 0.01395139474882506 1e-07 1 2 3 -2 -1 3 
$EndEntities
$Nodes
7 5 1 5
0 1 0 1
1
0 0 0
0 2 0 1
2
0.2 0 0
0 3 0 1
3
0.1995128100519649 0.01395129474882506 0
1 1 0 1
4
0.09999999999999978 0 0
1 2 0 0
1 3 0 1
5
0.09975640502598221 0.006975647374412516 0
2 1 0 0
$EndNodes
$Elements
2 4 1 4
1 2 1 1
1 2 3 
2 1 2 3
2 3 2 5 
3 5 2 4 
4 4 1 5 
$EndElements
$Periodic
2
0 3 2
16 0.9975640502598242 -0.0697564737441253 0 0 0.0697564737441253 0.9975640502598242 0 0 0 0 1 0 0 0 0 1
1
3 2
1 3 1
16 0.9975640502598242 -0.0697564737441253 0 0 0.0697564737441253 0.9975640502598242 0 0 0 0 1 0 0 0 0 1
3
1 1
3 2
5 4
$EndPeriodic
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

1 participant