hexagon logo

About fem_u_get_free_faces ?

I would like to determine free faces of solid elements.
I used the function fem_u_get_free_faces, but it seems to me that it returns all the face of outer elements and not the actual free faces
Would you mind giving me advice of the solution?
 
Thank you very much.
 
Tuan
 
  • A free face is based on mesh topology definition and is the face of an element that is not used by any other element. So , yes it is the outer faces or not connected to other element faces of the mesh. It does not take into account any type of other connection than mesh element face to another element face. If you describe what you mean,or want to find, for your "free faces" then maybe the logic to get this can be found.
    best regards
    Arthur
  • Thank you for your prompt rely! Please look at my function.
    What I mean is that if I choose whole elements in the wire for fem_u_get_free_faces, it will return all the faces of elements which is in the outside of the wire (include free faces and non free faces).
    Capture
    What I do now for the hex elems is to again filter out all the non free face of the returned faces by only selecting faces which have nodes that connected with 4 elems around.
    This solution makes thing complicated and only works for hex elems.
    Please look at the code and photo.
    My thanks !

    Attached Files (1)
  • Hi,
    I'm uncertain what you mean by "choose whole elements in the wire", I'm sorry but "in the wire" is the bit that is not clear to me.
    The fem_u_get_free_faces returns the list of free faces considering only those elements given in the input argument. It is not considering the free faces of the "whole model".
     
    It would help if you described what you want the PCL to do in a little more detail.
    Are you trying to get freefaces with respect to the whole model or just the element group in the input argument?
    The output arguments:
    fflist, elm_ids, face_ids, no_face
    what should fflist look like?
    do elm_ids and face_ids have the same size and maybe look like:
    elm_ids = [1,2,4,5,5,6]
    face_ids = [2,3,1,2,4,1]
    no_face=6
    i.e. this refers to faces: elm1.1, 2.3, 4.1, 5.2, 5.4, 6.1
    element 5 has 2 freefaces so it occurs twice in the elm list.
    trying to run your PCL there are a couple of missing functions.
    id_list_from_picklist is self explanatory and I have my own version.
    find_elem_as_node2(node_list(j), t_no_elem, t_elemlist) what does this do?
     
    best regards
    Arthur
     
     
     
  • Hi,
    following on my last email, I'm going to assume that the issue was that you only want elements from your list that have free faces when considering all the model.
    I have updated you code and attached it.
    Firstly it gets all the solid elements in the db and then gets their free faces.
    It then loops through this and if an element matches one in your input list it keeps the information. At the end it has the list of free faces (with respect to the whole model) for your input elements.
    I'm not claiming this is the most efficient or best method and the code needs some polishing up with status checks and error traps.
    Apologies if this is not what you wanted, just try to explain again.
    Best regards
    Arthur

    Attached Files (1)
  • Hi Arthur. This is what I mean.
    I tried what you advice and the way of looping whole elements of the model is quite expensive.
    So far, the way I do by recognizing hex free surface is fast enough but only for hex elem connectivity. For tetra, I cant find any optimal algorithm.
    Or may be, it is better not to loop through whole elements of the model but to limit to connected elements or local elements .
     
    Thank you for your code, it helps me understand how to use lp_eval().
     
    Regards,
    Tuan
  • Hi Tuan,
    I'm glad the list processor bit was illuminating.
    It's very useful if you ever want to use the select menus to define points etc on the fly and get the XYZ location etc. but it is rather cumbersome to work with.
    Regards
    Arthur