Duplicate elements with the same element identification number generated.

Moderator: GiD Team

Post Reply
Hemmi
Posts: 32
Joined: Fri Nov 20, 2015 6:05 am
Location: Chiba prefecture, Japan

Duplicate elements with the same element identification number generated.

Post by Hemmi »

I have made an example, archived in dupElemsSample.gid.zip, based on the cmas2d_customlib problemtype. It creates duplicate elements with the same element id.

In the following listings (in dupElemsSample.dat), eLement id 7, 8 and 9 are duplicated.

Code: Select all

Connectivities:
    Element    Node(1)   Node(2)   Node(3)     Material
         1          8          5          9          1
         2          3          4          5          1
         3          6          7          4          1
         4         10          9          7          1
         5          9          5          4          1
         6          4          7          9          1
         7          6          4          2          1
         7          6          4          2          2
         8          2          4          3          1
         8          2          4          3          2
         9          1          2          3          1
         9          1          2          3          2
What I did:

1. The whole model is shown in Figure 1.
2. The QuadAndTri group contains 2 surefaces. See figure 2A.
3. The TriOnly group contains 1 surface; See figure 2B. The triangle face is intentionally included in 2 groups.
4. Using the cmas2d_customlib problemtype assignment feature, 2 materials (iron and aluminium) are assigned to 2 groups.
Figure 1
Figure 1
modelGeo.png (9.31 KiB) Viewed 213 times
Figure 2A
Figure 2A
QuadAndTriGroup.png (10.19 KiB) Viewed 213 times
Figure 2B
Figure 2B
TriOnlyGroup.png (9.25 KiB) Viewed 213 times
As a result, duplicate elements are created as shown above.

In order to avoid such problems, I think that the assignment using "layer" solves this problem.
See the figure 3.
Figure 3
Figure 3
LayerInsteadOfGroupPrefered.png (64.51 KiB) Viewed 213 times
Attachments
dupElemsSample.gid.zip
GiD model
(9.32 KiB) Downloaded 7 times
User avatar
escolano
Posts: 1921
Joined: Sun Sep 05, 1982 10:51 pm

Re: Duplicate elements with the same element identification number generated.

Post by escolano »

The customLib component is designed to work with GiD groups, not layers
just because Layers have the strong limitation that an entity can (in fact must) only belong to a layer,
this is not the case of the groups, an entity can belong to more of one group.

Can consider that a gid group is simply a named selection of geometry and/or mesh entities

The cmas2d_customlib is only a demo of how to create a problemtype adapted to a simulation solver.

The user must assign a 'customLib material' to each surface, in order to be taken into account for the calculation (in this case is a simple calculation of the mass center, considering density, and a post result with a scalar result with the distance of each mesh node to the calculated gravity center

The problemtype is not checking if the user not assigning material to all surfaces, or assigning more that one like your example. (a real code must do more error checks of course)

The .dat file is written by the problemtype Tcl proc, in this case
proc Cmas2d::WriteCalculationFile { filename }
it can write the data that exactly want, write repeated elements, write only once, return an error, etc.
in the current implementation if is assigned multiple times is writing multiple times.
Hemmi
Posts: 32
Joined: Fri Nov 20, 2015 6:05 am
Location: Chiba prefecture, Japan

Re: Duplicate elements with the same element identification number generated.

Post by Hemmi »

Thank you for your reply. After reading your reply, I had an idea:

Please add a new feature that can automatically convert all "layers" to corresponding "groups".

Background:

My main concern is to build a complicated 3D model from many volume geometries.
When assigning material properties to each volume geometry, the "overwrite" feature is useful.
For example, consider a dam model where the model contains concrete, water and rocks.
My approach is to first assign water to whole volume geometries,
and then change some of it to concrete and rock.
If there is an "overwrite" function, this method is useful if the model geometries are complex.

GiD "layer" includes "overwrite" feature but GiD "group" does not include "overwrite" feature.

So my idea is:
(1) First, build a model by assigning "layer" to each volume geometry.
(2) Second, create "groups" by converting "layer" to "group".
Creating a "group" from a "layer" is easy within the GiD operation.
But if there are many "layers" in the model, repeating this conversion process each time is very tedious.

So if there is an automatic conversion feature from "layer" to "group", it will be very helpful.
User avatar
escolano
Posts: 1921
Joined: Sun Sep 05, 1982 10:51 pm

Re: Duplicate elements with the same element identification number generated.

Post by escolano »

This feature already exists
in the layer window select the layers you want to create groups, and in the contextual menu select "Layers to groups"
(and in the groups tab there is the opposite, create layers from groups)
layers_to_groups.png
layers_to_groups.png (22.88 KiB) Viewed 196 times
but take into account that are not the same kind of structure, the relation is not 1-1 always

Layers are generally used to facilitate the CAD edition of geometry, selection (e.g. to assign groups or other uses)
Groups are generally used to attach to the final geometry/mesh simulation data
Post Reply