Elmergrid Boundarya Indexing Bug

Clearly defined bug reports and their fixes
Post Reply
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Elmergrid Boundarya Indexing Bug

Post by Franz Pichler »

Hello dear Elmer Team,

I think i found a bug in using Elmergrid for creating a 2D sqaure with a square Hole in the middle.
I use elmergrid as in

C:\Elmer6.2\tests\Mytest\GridTest>elmergrid 1 2 Hole_2d.grd

Code: Select all

Starting program Elmergrid
Elmergrid reading in-line arguments
Output will be saved to file Hole_2d.

Elmergrid loading data:
-----------------------
Loading the geometry from file 'Hole_2d.grd'.
Loading ElmerGrid file version: 210903
Defining the coordinate system (2-DIM).
Loading 4 subcell limits in X-direction
Loading 4 subcell limits in Y-direction
Loading material structure
End of field
Loading boundary conditions
Found 6 boundaries
Reached the end of command file
Found 1 divisions for grid
Loading ElmerGrid commands from file 'Hole_2d.grd'.
Reached the end of command file
Read commands from a file

Elmergrid creating and manipulating meshes:
-------------------------------------------
8 cells were created.
Numbered 1736 knots in 1612 4-node elements.
Numbering order was <x><y> and max levelwidth 47.
72 element sides between materials 2 and 1 were located to type 1.
62 element sides between materials -1 and 1 were located to type 2.
62 element sides between materials -2 and 1 were located to type 3.
62 element sides between materials -3 and 1 were located to type 4.
62 element sides between materials -4 and 1 were located to type 5.
No boundary between materials 0 and 0 exists.

Elmergrid saving data:
----------------------
Saving mesh in ElmerSolver format to directory Hole_2d.
Saving 1736 coordinates to mesh.nodes.
Saving 1612 element topologies to mesh.elements.
Saving boundary elements to mesh.boundary.
Saving header info to mesh.header.

Thank you for using Elmergrid!
Send bug reports and feature wishes to peter.raback@csc.fi

The Grid that is created that way is in the file directory "Hole_2D" (Attached zip file).
when i load this mesh into ElmerGUI everything looks perfect.
But i had some trouble wit this mesh so i cheked the mesh.boundary file.

There the BoundaryElements of the inner square(Hole) in the left lower corner should be connecting the nodes 599,600,644
InnerCornerNodeNumbers.png
(9.04 KiB) Not downloaded yet
The problem is that the nodes show up for more boundary elements in other boundaries. I just searched for the "whole word" 599 in the mesh.boundary file. And thats why in the solver there are some miscalculations for the boundaries. The funny thing is that ElmerGUI shows everytghing perfectly fine (which i don't really get).
The next funny thing is. When i save the mesh file now from elmerGUI (by saving the project) the problem is solved, and the Node 599 only shows up for the 2 boundary elements in the corner with boundary index 1.

That puzzled me quite some time.
I hope i made the problem clear if not do not hesitate to ask me for an second explanation.

Maybe i also just misused something.
Than i send my apologize in advance.

Best Regards
Franz
Attachments
GridTest.7z
(19.02 KiB) Downloaded 344 times
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Elmergrid Boundarya Indexing Bug

Post by Franz Pichler »

The problem is that the nodes show up for more boundary elements in other boundaries
maybe thius sentence is not clear.
it should mesn:
The problem is that the nodes (599 for example) show up in the mesh.boundary file more often, for other boundary elements and other boundary indexes.
The left loiwer corner is just the point where i figured it out. probably also other nodes show up in the same way.

Franz
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmergrid Boundarya Indexing Bug

Post by raback »

Hi Franz

Well, the problem is in your .grd file.

Code: Select all

Boundary Definitions
! type out int double of the boundaries
1 2 1 1
2 -1 1 1
3 -2 1 1
4 -3 1 1
5 -4 1 1
End
You first introduce BC between 1 and 2, and then to different directions of material 1. Note that this includes as a subset also the BC you assigned to be one. Remove the 1st BC so you'll see.

-Peter
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Elmergrid Boundarya Indexing Bug

Post by Franz Pichler »

Ah, i see.
Yep, my bad.
I thought that the BC might overwrite themselves in some way or only give one boundary per element.
Would that mean i could also have several boundary indexes per element and maybe use that in the Savescalars Solver to integrate over two boundarys that have given two different BC s, maybe one dirichlet and one neumann BC.
Supposing i manage to generate the mesh.boundary file in the right manner.
As in:
boundary element 1 belongs to Boundary 1 and 2
boundary element 2 belongs to Boundary 1 and 3

set dirichlet on boundary 2
set neumann on boundary 3
use savescalars on boundary 1

Thanks for having a look at it.
Franz
Post Reply