## problem with mesh and conditions

Moderator: GiD Team

SimoneB
Posts: 3
Joined: Thu Oct 01, 2015 8:08 am

### problem with mesh and conditions

Dear GiD team,

we use your software (v12) in order to create a surface mesh and to add some conditions/materials/parameters; these info are exported via a "text data report" and a ".dat" file created by the imposed problem type, and loaded into a MATLAB script to create a single input file for our electromagnetic solver.
The proceadure created for GiD works fine but it is very tedious: after the creation/import of the geometrical structure, the material assignment and the problem data definition, we need to assign three particular conditions over the surfaces with the CONDMESHTYPE set to 'over body elements'. The tedious point is that, to each surface, we must assign an unique condition value in order to cleary identify which triangles are defined over which surfaces. This procedure is necessary because if we assigne an unique condition value to all the surfaces pertaion to each volume and we have a surface shared between two volumes, the mesh triangles over the shared surface will have only the condition value assigned to the surfaces of the second volume!! so, in this way, we are unable to discretize which triangles are shared between the two volumes because the condition value assigne to the surfaces of the second volume will destroy the one assigned to the surfaces of the first volume!! To better understand:

- tedious but right procedure:
2 volumes, 6 surfaces for each volume, 11 total surfaces (one shared)
44 triangles (4 for each surface)
11 unique condition values for the 11 total surfaces
4 triangles associated to each condition value
(Triangles <- condition value -> Surface) ==> we are able to discretize the shared triangles

- easier but wrong procedure:
2 volumes, 6 surfaces for each volume, 11 total surfaces (one shared)
44 triangles (4 for each surface)
2 unique condition values: one for each of the 6 surfaces defining each volume
24 triangles associated to each condition value
(24 Triangles <- first condition value -> 6 Surfaces)
(24 Triangles <- second condition value -> 6 Surfaces)
Total: 20 triangles with the first condition value, 24 trianlges with the second condition value: we are unable to discretize the shared
triangles

Now, this is our question: it is possible to set a condition or a group of conditions to simplify the tedious procedure to the difficulty level of the easier one????

Thank to everybody!!
escolano
Posts: 1608
Joined: Thu Sep 18, 2014 3:31 pm

### Re: problem with mesh and conditions

there are multiple possibilities.
I will inform you about some features that could be related to your requirements

1) a condition by default is defined as 'non-repeatable', then when you assign the same condition name over the same entity the last assignment replaces the previous one. In your case seems that do you want to apply to the surfaces a condition 'repeatable' to mark the boundary of some region (with a value of a question representing for example the volume).
You must modify the definition of your question and add 'CANREAPEAT: yes'

CONDITION: your_condition
CONDTYPE: over surfaces
CONDMESHTYPE: over body elements
CANREPEAT: yes
QUESTION: ...
...
END CONDITION

Then you will see that the shared surface will have twice your condition
Note: depending on how are you writing the calculation file you must also add an extra keyword *canrepeat in the .bas file to some *set cond command, to allow the repetition of some element in the *loop elems
*Set Cond Your_condition *elems *canrepeat
*loop elems

*end elems

2) There are some special 'self-calculated' #FUNC# questions
(see APPENDIX B (classic problemtype system)>PROBLEMTYPE 'CLASSIC'>CONFIGURATION FILES>Conditions file (.cnd))

in particular #FUNC#(NumEntity) will automatically store in the question the id of the geometrical entity that has create the mesh entity

e.g.
QUESTION: Surface_Id#FUNC#(NumEntity)
VALUE: 0

then you don't need to manually set a different question value when applying to each surface, when meshing it will store the unique surface id.

3) Instead of conditions you cans also use 'GiD groups' to define regions. Groups, unlike Layers, are 'repeatable' then the shared surface could belong to several groups. Groups, like conditions, materials of layers are inherit by the mesh entities when generating the mesh.
SimoneB
Posts: 3
Joined: Thu Oct 01, 2015 8:08 am

### Re: problem with mesh and conditions

Dear Escolano, thank a lot!!!!!!!!!!!!!!!!!! you have saved our sanity!!