Empty MESHSETS

81 views
Skip to first unread message
Assigned to lik...@wp.pl by me

Ign Athan

unread,
Sep 17, 2021, 11:05:33 AM9/17/21
to MoFEM Q&A
Hello everyone,

I have been trying to check the number of tets in cubit meshset with the  sniper below without creating if missing.

for (_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(
m_field, BLOCKSET, it)) {
// Get data from block
int id = it->getMeshsetId();
EntityHandle meshset = it->getMeshset();
Range check_tets;
CHKERR m_field.get_moab().get_entities_by_type(
meshset, MBTET, check_tets, false);
cerr << " id " << id <<"\n";
cerr << "check_tets " << check_tets.size() <<"\n";
}

This prints 0 size Ranges for all BLOCKSETS while when the flag is switched to true then the volume block sets contain tets. 
Does this mean that the BLOCKSETS are always empty when the cubit files are generated?

Thanks in advance,
Ignatios





Lukasz Kaczmraczyk

unread,
Sep 17, 2021, 12:13:41 PM9/17/21
to MoFEM Q&A
Ignatios,

Very often in Cubit blockest, have meshset in the meshset, in that submeshset entities are stored. In that case if last option is false, you get zero entities. To get entities recursively from submeshset set the last option to true, i.e.
CHKERR m_field.get_moab().get_entities_by_type(meshset, MBTET, check_tets, true);

Also, check this, which is better option in this context,
that will give you a number of entities. Look at the last option, which you set to true, to count entities also in subsets.

Lukasz




Ign Athan

unread,
Sep 17, 2021, 12:24:55 PM9/17/21
to MoFEM Q&A
Hi Lukasz,

Thank you very much for the fast reply and the information.
I will have a look into it.

All best,
Ignatios

Ign Athan

unread,
Sep 18, 2021, 2:18:23 PM9/18/21
to MoFEM Q&A
Hello again,

when needing to add entities to such mesh sets that contain other meshsets, should the entities be added to the particular sub-meshset or is it enough to add to the super meshset?

All best,
Ignatios

Message has been deleted

Lukasz Kaczmraczyk

unread,
Sep 18, 2021, 7:09:02 PM9/18/21
to MoFEM Q&A
Hi,

You can add the to main meshset.

L.

ignathanas

unread,
Sep 21, 2021, 6:28:31 AM9/21/21
to MoFEM Q&A
Hello again,

I think I have managed to understand the sources for the duplicated edges.
There are two sources:
1) The edges located along the circumference of the sideset of the cutting surface
   solution: 
      Instead of determining the sideset only based on surface like this:
           sideset 200 surface 158 
     One needs to also add the curves comprising the circumference of the surface, e.g.:
           sideset 200 surface 158 curve 389 390 391 392
2)The second source of the duplication is the block for vertices, for instance declaring:
         block 300 vertex all in Volume 1
    Even if adding vertices one by one like this:
          block 300 vertex 159 161 160 162
     It generates 4 edges with a single vertex (this was tested by a piece of code for searching edges).
     If one adds one more vertex:
          block 300 vertex 159 161 160 162 163 
     5 edges are generated. Therefore I think that for some reason the explicit addition of vertices in block sets generate zero length edges one for each vertex.

This is still ongoing work, however I think that the solution for this is to add the curves to the cutting surface sideset and to delete all root edges that are irrelevant to the volume and to the cutting surface.
According to these observations, no need for explicit check of meshsets is needed since the only duplicated edges generated are the zero length edges that play no role for initiating an analysis.

Please let me know your thoughts.

All best,
Ignatios
Message has been deleted

Lukasz Kaczmraczyk

unread,
Sep 21, 2021, 6:49:26 AM9/21/21
to MoFEM Q&A
Hello,

It looks that cubit creates elements in blockset, and we should use nodesets to store verices. It could be not a bug, but the feature of Cubit, that you can not store vertices in blocksets. So we will have to change the feature of Cubit, to expect nodeset,  not blockset. The question is then if we need fix, to something which is a feature.

L.

ignathanas

unread,
Sep 21, 2021, 7:07:28 AM9/21/21
to MoFEM Q&A
Hi,

Indeed adding vertices to nodesets does not create such problem, I just checked.
I also tried to read them in fracture module like this: 
  
     if(meshsetMngPtr->checkMeshset(vertexBlockSet, NODESET)) 
     CHKERR meshsetMngPtr->getEntitiesByDimension(vertexBlockSet, NODESET, 0,
     cornerNodes, true);

It worked.
This peace of code can be there along with the older peace of code for reading BLOCKSETs for older meshes:

     if (meshsetMngPtr->checkMeshset(vertexBlockSet, BLOCKSET))
    CHKERR meshsetMngPtr->getEntitiesByDimension(vertexBlockSet, BLOCKSET, 0,
    cornerNodes, true);

The only thing I think is needed is a proper error message for the duplicated edges case so that the user knows what are the potential sources of duplication.

All best,
Ignatios

Lukasz Kaczmraczyk

unread,
Sep 21, 2021, 11:29:56 AM9/21/21
to MoFEM Q&A
I agree, we have to improve the error message that will tell the user what is the problem. 
Reply all
Reply to author
Forward
0 new messages