Equivalencing of nodes of a FEM mesh

About the development of the FEM module/workbench.

Moderator: bernd

aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Equivalencing of nodes of a FEM mesh

Post by aerospaceweeb »

@mesheb82

Right now, I have a rough idea for how equivalencing could work, in a world where there's not really any geometry associated, or any pre-existing routines available.

I think that it should be such that you select two mesh bodies, then click equivalence.
Equivalence_Workflow.PNG
Equivalence_Workflow.PNG (73.79 KiB) Viewed 1360 times
I'm still really worried that this is antithetical to how stuff in FreeCAD-FEM is intended to work though.

Hopefully we can find a way to make this fit the paradigms a bit better later.

But anyways, I think that what should be done, @mesheb82 is, once two mesh bodies are equivalenced, it results in another, brand new assembly of the two, stored into a single mesh body. That way it wouldn't be a destructive workflow, at the cost of making more elements and nodes than it might need to.

One barrier to making this right now is I'm lacking a way to get the "highest node ID and element ID in the current model." Well, "lacking" is a strong word, I've got some nested loops that count all the mesh objects, but it's not complete and I'm 100% sure there's another piece of code I'm not finding that does the same thing.

I've spend an hour or two today just browsing through the upstream source:

Code: Select all

https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/Fem
There's a lot of stuff here that I really, really, really like. My inexperience with python inheritance is slowing me down, but I can tell right now that we shouldn't attempt any kind of selection parsing ourselves. Bernd is WAY ahead of anything I could ask for, aside from maybe some propogating functions, like "select elements connected with normals within 30 degrees" or something like that.

I think I'll just keep looking around here today.
No major code to paste yet.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Equivalencing of nodes of a FEM mesh

Post by bernd »

BTW most of the you only use shell meshes. For them you could also try the boolean operations from mesh workbench. But I do not know if mesh workbench works with quads. Converting from Mesh to FemMesh should be only a few lines of code. There is even a tool in FEM for solids. Never tested if it works on shells too.

Or export the FemMesh to stl and read it back. But than you have triangles.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Equivalencing of nodes of a FEM mesh

Post by bernd »

In the regard of setting up FEM analysis (boundary conditions) on meshes instead of geometry. Is this what you would like to do?

This would just need someone who does the coding to make this work in FreeCAD FEM.
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Equivalencing of nodes of a FEM mesh

Post by aerospaceweeb »

@Bernd
In the regard of setting up FEM analysis (boundary conditions) on meshes instead of geometry. Is this what you would like to do?

This would just need someone who does the coding to make this work in FreeCAD FEM.
That does sound kind of like what we'd want to be able to do.
I personally deal with orphan meshes a lot (orphan mesh means "mesh with no parent geometry")

One thing that may be easier could be to make some scripts that creates geometry on top of mesh entities, and that way you could still have everything linked to geometry.
BTW most of the you only use shell meshes. For them you could also try the boolean operations from mesh workbench. But I do not know if mesh workbench works with quads. Converting from Mesh to FemMesh should be only a few lines of code. There is even a tool in FEM for solids. Never tested if it works on shells too.

Or export the FemMesh to stl and read it back. But than you have triangles.
This also sounds like it's worth trying. Thank you. I'll post back here if I can get it to work, but it's not the first thing I'm trying out right now.
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Equivalencing of nodes of a FEM mesh

Post by aerospaceweeb »

Bernd! Did you know that there's nastran support in the mesh workbench?!
Theres_already_nastran_support.png
Theres_already_nastran_support.png (148.5 KiB) Viewed 1275 times
It's syntax is correct too!

It doesn't look like it can do quads easily, unless I screwed up the format for it, but it looks like we may not need to rewrite export code!

- Aero
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Quad Mesh

Post by johnwang »

aerospaceweeb wrote: Fri Jul 30, 2021 5:52 am "Equivalence" is the patran term for "if two nodes are on top of eachother, delete one, and make the elements using those nodes attach together by the one node that remains."
This word remind me of the NASTRAN-95 DEMONSTRATION PROBLEM NO. D02-02-1A, WINDMILL PANEL SECTIONS FOR AUTOMATED MULTI-STAGE SUBSTRUCTURING.
There is a card 'EQUIV'.
https://github.com/nasa/NASTRAN-95/blob ... 02024a.inp

Code: Select all

$                                                                               
$  STEP I.  COMBINE VANETOP                                                     
$                                                                               
   SOFPRINT TOC                                                                 
   EQUIV VANE1,VANE2                                                            
     PREFIX=X                                                                   
   COMBINE VANE1,VANE2                                                          
     NAME=VANETOP                                                               
     TOLERANCE=0.02                                                             
     OUTPUT=1,2,7,11,12,13,14,15,16,17                                          
     COMPONENT=VANE1                                                            
     TRANS=100                                                                  
     COMPONENT=VANE2                                                            
     TRANS=100                                                                  
     SYMT=X                                                                     
  PLOT VANETOP                                                                  
   SOFPRINT TOC 
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Equivalencing of nodes of a FEM mesh

Post by aerospaceweeb »

Ooooh curious, John.

I've never heard of the EQUIV card before.
Let me see what it is.

It looks like a mere diagnostic package. Nothing too special I don't think, but I could be wrong!

Let me check the source code.
Found a description of her here

Code: Select all

https://github.com/nasa/NASTRAN-95/blob/65e29e9db7b21a02bb42e723afa74fa7635ed765/um/SUBS.TXT
ON line 74 the comment block starts, it's

Code: Select all

C. Substructure Operations

    COMBINE            Combines sets of substructures
        NAME*          Names the resulting substructure
        TOLERANCE*     Limits distance between automatically connected grids
        CONNECT        Defines sets for manually connected grids and releases
        OUTPUT         Specifies optional output results
        COMPONENT      Identifies component substructure for special processing
        TRANSFORM      Defines transformations for named component
                       substructures
        SYMTRANSFORM   Specifies symmetry transformation
        SEARCH         Limits search for automatic connects
    [b]EQUIV              Creates a new equivalent substructure[/b]
        PREFIX*        Prefix to rename equivalenced lower level substructures
    REDUCE             Reduces substructure matrices
        NAME*          Names the resulting substructure
        BOUNDARY*      Defines set of retained degrees of freedom
        OUTPUT         Specifies optional output requests
        RSAVE          Save REDUCE decomposition product
    MREDUCE            Reduces substructure matrices
        NAME*          Names the resulting substructure
 
aerospaceweeb
Posts: 118
Joined: Fri Apr 09, 2021 3:26 am

Re: Equivalencing of nodes of a FEM mesh

Post by aerospaceweeb »

Okay I have a question for anyone who can answer.

What is the best way to save out two mesh bodies at the same time, such that none of their internal IDs conflict with eachother?

I need to finally make some kind of way to equivalence nodes together, but I have a few problems.
1.) I would ideally have a single list of nodes [Node ID, X coord, Y, Coord, Z Coord] but I don't. Instead I currently read user mouse selection input, check if the two things are FEM objects, and then read the properties of those objects. Naturally, both of these node lists have IDs that start at one, and increment upwards by 1. This isn't great, as it means that any node numbering I had on a model before imported into FreeCAD would be lost once I imported it. I think that any FEM pre-post tool should be able to write out a model in the same way that it was able to read it in.

2.) The only way I can think of to do this in a way that isn't destructive, is to make a new object which contains both of these bodies, in a new FreeCAD FEM object. This doesn't solve the problem though of how the two objects IDs would be completely overwritten later, possibly removing the ability to separate parts by ID range; as is very common for nastran analysis.

3.) How should I best go about making nodes permanently posess specific node IDs in a way that isn't mutable? I believe that this is neccesary, and the only way that I can think of to deal with edge cases that come from equivolencing routines. Is there a clean way that I can store some kind of global variable in the freeCAD file, that represent the basic entities such as element ID to node ID connectivity and node ID to coordinate connectivity, that can't be overwritten?
mesheb82
Posts: 9
Joined: Tue Jul 27, 2021 4:18 am

Re: Equivalencing of nodes of a FEM mesh

Post by mesheb82 »

Regarding equivalencing, there's this really, really nice property where when you equivalence, you retain the lower id. Typically when meshing, you define the mesh on your curves first, then surfaces, and finally solids. Thus, by equivalencing that way, you avoid changing your curves/surfaces along a boundary.

Also, as far as I know, the EQUIV card is only used for superelements and is dead. There's still a SECONCT card, which I think of more like contact than actual nodal equivalencing. Nastran allows some very weird things that are STILL there to help users without a gui building decks by hand (e.g., you can make an isometric plot of your model in the output file, you can make 10,000 grid cards in 3 lines using replication, which is basically a for loop). Breaking backwards compatibility is unfortunately/fortunately? frowned upon.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Equivalencing of nodes of a FEM mesh

Post by bernd »

mesheb82 wrote: Thu Aug 05, 2021 6:11 am Typically when meshing, you define the mesh on your curves first, then surfaces, and finally solids. Thus, by equivalencing that way, you avoid changing your curves/surfaces along a boundary.
this is the way gmsh works too. Thus on equivalencing of a face mesh do not foget the edges. There will be edges in the mesh too, the outer ones.
Post Reply