[GiDlist] GiD --> ucd format?

Moderator: GiD Team

Post Reply
Roger Young

[GiDlist] GiD --> ucd format?

Post by Roger Young »

Hello GiD folk,

I am an applied mathematician working in crystal plasticity
and fatigue modelling. For my calculations I am using the
deal.II finite element library.

This library is poorly supplied with meshing tools, and for
complicated geometries it relies on importation of a mesh
in a particular format, for example "ucd" format.

It is best to explain this in terms of a very simple example:
Here (below) there is a single hex cell with 8 vertices (nodes).
After defining the vertices there are then 3 cell-type
connectivity statements. The first just describes the connectivity
of the hex element, but the 2 following lines each associate a tag
with a particular (quad) _face_ of the element. The face is
identified by its nodal connectivity. Thus we have tag 5 being
associated with the quad face with node numbers (0 1 2 3). Later
the tag will be associated with a boundary condition.

8 3 0 0 0
0 0.0 0.0 0.0
1 1.0 0.0 0.0
2 1.0 0.0 1.0
3 0.0 0.0 1.0
4 0.0 1.0 0.0
5 1.0 1.0 0.0
6 1.0 1.0 1.0
7 0.0 1.0 1.0
0 0 hex 0 1 2 3 4 5 6 7
1 5 quad 0 1 2 3
2 8 quad 0 1 5 4

The scheme is easily extended to a multi-element mesh: there is a
list of hex declarations, followed by as many quad lines as are required
to associate the tags with the relevant boundary (quad) faces.

My question is, can I use the .bas scripting language to create a
.dat file in this particular (ucd) format? The hard part
seems to be the last 2 lines. The GiD script language
seems very powerful, so I am confident that it can be done.

Can someone point me in the right direction?

Roger Young.

Applied Maths Group,
Industrial Research Ltd.,
Box 31-310 Lower Hutt,
New Zealand.

r.young at irl.cri.nz
Enrique Escolano

[GiDlist] GiD --> ucd format?

Post by Enrique Escolano »

You must create a problemtype to define a condition to apply tags over faces, named for example FaceTag, to be applied
over suface geometric entities, and transferred to the mesh over face elems:

file ucd.cnd:

CONDITION: FaceTag
CONDTYPE: over surfaces
CONDMESHTYPE: over face elems
CANREPEAT: yes
QUESTION: Tag
VALUE: 0
END CONDITION

file ucd.bas:

*#coordinates
*npoin *ndime 0 0 0
*loop nodes
*nodesnum *nodescoord(1) *nodescoord(2) *nodescoord(3)
*end nodes
*#hexahedral elements
*set elems(hexahedra)
*loop elems
*elemsnum 0 hex *elemsconec(1) *elemsconec(2) *elemsconec(3) *elemsconec(4) *elemsconec(5)

*elemsconec(6) *elemsconec(7) *elemsconec(8)
*end elems
*set elems(all)
*#tags over faces
*Set Cond FaceTag *elems *canrepeat
*set var cont=1
*loop elems *OnlyInCond
*cont *cond(Tag) quad *globalnodes
*set var cont=operation(cont+1)
*end elems

Unzip this sample ucd.gid.zip inside the GiD /problemtypes directory,
then start GiD and load this problemtype from the menu Data-Problemtype-ucd
Assign the condition FaceTag to the desired surfaces, and generate a mesh (hexahedrals)

To write the ucd file use: Files-Export-Calculation file...

The *.bas and *.cnd syntax is explained in GiD-Help (customization)

Regards

Enrique Escolano

----- Original Message -----
From: "Roger Young" r.young at irl.cri.nz
To: gidlist at gatxan.cimne.upc.es
Cc: r.young at irl.cri.nz
Sent: Monday, June 23, 2003 11:55 AM
Subject: [GiDlist] GiD -- ucd format?


Hello GiD folk,

I am an applied mathematician working in crystal plasticity
and fatigue modelling. For my calculations I am using the
deal.II finite element library.

This library is poorly supplied with meshing tools, and for
complicated geometries it relies on importation of a mesh
in a particular format, for example "ucd" format.

It is best to explain this in terms of a very simple example:
Here (below) there is a single hex cell with 8 vertices (nodes).
After defining the vertices there are then 3 cell-type
connectivity statements. The first just describes the connectivity
of the hex element, but the 2 following lines each associate a tag
with a particular (quad) _face_ of the element. The face is
identified by its nodal connectivity. Thus we have tag 5 being
associated with the quad face with node numbers (0 1 2 3). Later
the tag will be associated with a boundary condition.

8 3 0 0 0
0 0.0 0.0 0.0
1 1.0 0.0 0.0
2 1.0 0.0 1.0
3 0.0 0.0 1.0
4 0.0 1.0 0.0
5 1.0 1.0 0.0
6 1.0 1.0 1.0
7 0.0 1.0 1.0
0 0 hex 0 1 2 3 4 5 6 7
1 5 quad 0 1 2 3
2 8 quad 0 1 5 4

The scheme is easily extended to a multi-element mesh: there is a
list of hex declarations, followed by as many quad lines as are required
to associate the tags with the relevant boundary (quad) faces.

My question is, can I use the .bas scripting language to create a
.dat file in this particular (ucd) format? The hard part
seems to be the last 2 lines. The GiD script language
seems very powerful, so I am confident that it can be done.

Can someone point me in the right direction?

Roger Young.

Applied Maths Group,
Industrial Research Ltd.,
Box 31-310 Lower Hutt,
New Zealand.

r.young at irl.cri.nz
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030623/9ae871e9/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ucd.gid.zip
Type: application/x-zip-compressed
Size: 665 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030623/9ae871e9/attachment.bin
Roger Young

[GiDlist] GiD --> ucd format?

Post by Roger Young »

Enrique:

This is excellent, thankyou so much.
GiD is certainly a very powerful and flexible FE mesh tool...

Regards,
Roger Young

.........................................................................................................
On Mon, 23 Jun 2003 16:29:57 +0200
"Enrique Escolano" escolano at cimne.upc.es wrote:

You must create a problemtype to define a condition to apply tags over faces, named for example FaceTag, to be applied
over suface geometric entities, and transferred to the mesh over face elems:

file ucd.cnd:

CONDITION: FaceTag
CONDTYPE: over surfaces
CONDMESHTYPE: over face elems
CANREPEAT: yes
QUESTION: Tag
VALUE: 0
END CONDITION

file ucd.bas:

*#coordinates
*npoin *ndime 0 0 0
*loop nodes
*nodesnum *nodescoord(1) *nodescoord(2) *nodescoord(3)
*end nodes
*#hexahedral elements
*set elems(hexahedra)
*loop elems
*elemsnum 0 hex *elemsconec(1) *elemsconec(2) *elemsconec(3) *elemsconec(4) *elemsconec(5)

*elemsconec(6) *elemsconec(7) *elemsconec(8)
*end elems
*set elems(all)
*#tags over faces
*Set Cond FaceTag *elems *canrepeat
*set var cont=1
*loop elems *OnlyInCond
*cont *cond(Tag) quad *globalnodes
*set var cont=operation(cont+1)
*end elems

Unzip this sample ucd.gid.zip inside the GiD /problemtypes directory,
then start GiD and load this problemtype from the menu Data-Problemtype-ucd
Assign the condition FaceTag to the desired surfaces, and generate a mesh (hexahedrals)

To write the ucd file use: Files-Export-Calculation file...

The *.bas and *.cnd syntax is explained in GiD-Help (customization)

Regards

Enrique Escolano

----- Original Message -----
From: "Roger Young" r.young at irl.cri.nz
To: gidlist at gatxan.cimne.upc.es
Cc: r.young at irl.cri.nz
Sent: Monday, June 23, 2003 11:55 AM
Subject: [GiDlist] GiD -- ucd format?


Hello GiD folk,

I am an applied mathematician working in crystal plasticity
and fatigue modelling. For my calculations I am using the
deal.II finite element library.

This library is poorly supplied with meshing tools, and for
complicated geometries it relies on importation of a mesh
in a particular format, for example "ucd" format.

It is best to explain this in terms of a very simple example:
Here (below) there is a single hex cell with 8 vertices (nodes).
After defining the vertices there are then 3 cell-type
connectivity statements. The first just describes the connectivity
of the hex element, but the 2 following lines each associate a tag
with a particular (quad) _face_ of the element. The face is
identified by its nodal connectivity. Thus we have tag 5 being
associated with the quad face with node numbers (0 1 2 3). Later
the tag will be associated with a boundary condition.

8 3 0 0 0
0 0.0 0.0 0.0
1 1.0 0.0 0.0
2 1.0 0.0 1.0
3 0.0 0.0 1.0
4 0.0 1.0 0.0
5 1.0 1.0 0.0
6 1.0 1.0 1.0
7 0.0 1.0 1.0
0 0 hex 0 1 2 3 4 5 6 7
1 5 quad 0 1 2 3
2 8 quad 0 1 5 4

The scheme is easily extended to a multi-element mesh: there is a
list of hex declarations, followed by as many quad lines as are required
to associate the tags with the relevant boundary (quad) faces.

My question is, can I use the .bas scripting language to create a
.dat file in this particular (ucd) format? The hard part
seems to be the last 2 lines. The GiD script language
seems very powerful, so I am confident that it can be done.

Can someone point me in the right direction?

Roger Young.

Applied Maths Group,
Industrial Research Ltd.,
Box 31-310 Lower Hutt,
New Zealand.

r.young at irl.cri.nz
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

Post Reply