[ GiDlist ] trouble creating an mesh for third-party soft

Moderator: GiD Team

Post Reply
Enrique Escolano

[ GiDlist ] trouble creating an mesh for third-party soft

Post by Enrique Escolano »

1) *nnode allwais returns the number of nodes of the element with the
highest number, máx(3,4)=4 in this case.

in the loop over elements, it is "a priori" known the type of element, and
the number of nodes of this element (e.g. for linear triangle=3 and for
quadratic triangle =6)

*set elems(Triangle)
*loop elems
*if(isquadratic)
*set var nnodeelem=6
*else
*set var nnodeelem=3
*endif
nb_nodes=*nnodeelem
*end elems

2) *ElemsConec is also correct for triangle elements (named "faces" in your
mail).
It is possible that "gmesh" requires the triangle connectivities in another
order: instead of ABC, CBA. It is possible to write the connectivities in
any order:

*set elems(Triangle)
*loop elems
*ElemsConec(3) *ElemsConec(2) *ElemsConec(1)
*end elems

3) Please, send a sample (and the problem type) where re-running gid, it
change the material number of the elements. Please, specify the GiD version
number (see Help-About)

Best Regards.
The GiD Team

----- Original Message -----
From: "trophime christophe" trophime at labs.polycnrs-gre.fr
To: "Gid" gidlist at gatxan.cimne.upc.es
Sent: Thursday, September 13, 2001 2:00 PM
Subject: [ GiDlist ] trouble creating an mesh for third-party soft


I am trying to use Gid as a pre-processor for getdp.
I import a geometry from an Iges file. I would like to
create a mesh of this sort :

$NOD
number_of_nodes
node_id coord1 coord2 coord3
...
$ENDNOD
$ELM
number_of_elements
elm_id elm_type elm_mat unused nb_nodes connectivity
...
$ENDELM

So I have defined a new problemtypes called getdp with
the following template file :

*set elems(all)
$NOD
*npoin
*loop nodes
*format "%6i%15.5e%15.5e%15.5e"
*NodesNum *operation(1.e-3*NodesCoord(1,real))
*operation(1.e-3*NodesCoord(2,real))
*operation(1.e-3*NodesCoord(3,real))
*end nodes
$ENDNOD
$ELM
*nelem
*set elems(Tetrahedra)
*set var elmtype=4
*set var elmunused=0
*loop elems
*format "%10i%5i%5i%5i%5i%10i%10i%10i%10i"
*ElemsNum *elmtype *ElemsMat *elmunused *nnode *ElemsConec
*end elems
*set elems(Triangle)
*set var elmtype=3
*set var elmunused=0
*loop elems
*format "%10i%5i%5i%5i%5i%10i%10i%10i"
*ElemsNum *elmtype *ElemsMat *elmunused *nnode *ElemsConec
*end elems
$ENDELM

Just one more remark: I NEED to have information about "surfaces"
included into
my mesh file. To do that I build a .mat file which includes my fake
materials to retrieve
"elm_mat" for both elements and faces. Then I instruct Gid to create the
mesh using the Mesh Criteria over
surfaces to have acces to the faces in "elems".

My problem is first that for triangles *nnode give me 4 instead of 3!

Second when I tried to see using gmsh my "getdp mesh" the volume is fine
but the surfaces are completly corrupted so I wonder if my *ElemsConec
is wrong for faces...

Third if I rerun the gid from a saved session I don't get the same
"elm_mat" for my faces?

Could you help me out? (May be I'm doing something wrong?)
I am using an eval version of Gid which expires after the 3rd october...
I wish a quick answer
if it's possible.

Thanks for any help

trophime christophe

[ GiDlist ] trouble creating an mesh for third-party soft

Post by trophime christophe »

Enrique Escolano wrote:

1) *nnode allwais returns the number of nodes of the element with the
highest number, máx(3,4)=4 in this case.

in the loop over elements, it is "a priori" known the type of element, and
the number of nodes of this element (e.g. for linear triangle=3 and for
quadratic triangle =6)

*set elems(Triangle)
*loop elems
*if(isquadratic)
*set var nnodeelem=6
*else
*set var nnodeelem=3
*endif
nb_nodes=*nnodeelem
*end elems


Thanks for this trick.

2) *ElemsConec is also correct for triangle elements (named "faces" in your
mail).
It is possible that "gmesh" requires the triangle connectivities in another
order: instead of ABC, CBA. It is possible to write the connectivities in
any order:

*set elems(Triangle)
*loop elems
*ElemsConec(3) *ElemsConec(2) *ElemsConec(1)
*end elems


The numerotation in Gmsh is consistant with the one used in Gid 6.1.
It's all right.
I manage to transfer the mesh.

If now I want to use Boundary conditions instead of material reference
for my "faces"
what shall I put in the template file : just change the *ElemsMat to
*cond(1) for instance?
But in this case how can now about the total number of faces which I
need because in Gmsh
I shall put the total number of elements that is to say the number of
volumic elements + face elements?


Thanks for your help
Enrique Escolano

[ GiDlist ] trouble creating an mesh for third-party soft

Post by Enrique Escolano »

Question:
If now I want to use Boundary conditions instead of material reference
for my "faces"
what shall I put in the template file : just change the *ElemsMat to
*cond(1) for instance?
But in this case how can now about the total number of faces which I
need because in Gmsh
I shall put the total number of elements that is to say the number of
volumic elements + face elements?

Re:
You can define a condition, for example BoundaryID, applied in geometry to surfaces, and transferred in the mesh to a face of 3D element.

file *.cnd
NUMBER: 1 CONDITION: BoundaryID
CONDTYPE: over surfaces
CONDMESHTYPE: over face elements
QUESTION: ID
VALUE: 1
END CONDITION

You can obtain the number of entities with a contitiont with *CondNumEntities
*globalnodes returns the face connectivities (must be inside a loop elems of this condition)
Also, you can use a variable to count some entities.

file *.bas
*Set Cond BoundaryID *elems
*Set var CountID1=0
*Set var CountIDRest=0
Nº faces with this condition=*CondNumEntities
*loop elems *OnlyInCond
ielem=*elemsnum(), nodes= *globalnodes, ID= *cond(1)
*if(cond(1,int)==1)
*Set var CountID1=operation(CountID1+1)
*else
*Set var CountIDRest=operation(CountIDRest+1)
*endif
*end elems
ID=1: Nº faces= *CountID1
ID=Rest: Nº faces= *CountIDRest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20010914/b5978f09/attachment.htm
Post Reply