FEM with opencascade

karim

CAD community veteran
I have written some code to anlaze fem elements such as frames, shells and planes. I want visualize, post and pre process the strucutre using opencascade.
There are difficult software architecture issues in the design of the program. any body interested in the subject ?
 

Quaoar

Administrator
Staff member
Here's a link to the document I shared on youtube: https://docs.google.com/document/d/1QP48Wn3EnVzYIjzztI4lz4Vpig9mxyZr0t0JgZg7uMU/edit

It gives an overview of a software prototype built on top of OpenCascade/OCAF + VTK and plugging in MeshGems/CADSurf as a mesher. Personally, I think that VTK is an excellent choice for pre-/post-processing software. For UI, I used Qt (actually it was Analysis Situs). Besides visualization, it's pretty important to have a good enough data framework. Back then, we started from XDE and it was nightmare to get something useful out of it.

Do you have any specific difficulties you'd like to discuss?
 

karim

CAD community veteran
Yes. Some of them are very detailed problems. some of them big architectural issues that keep me confused.
In many feilds of the engineering and science there are open source programs that compete with commercial ones. In structural engineering, there is none that can be used for real work. I am motivated to create this such a tool. (to be used instead of etabs and sap from CSI (csiamerica.com). Many people in developing countries, including me can not afford to buy these commercial softwares. Yet open source has become mature enough that one can build sophisticated software with them. The problem is that discrete geometry is a difficult subject by itself and for people like me that are mostly self thought, learning takes time. So having someone that is willing to help with opencascade can be extremely good.
The document you have shared is extremely useful and well thought out. how ever, I think it will take some time for me to learn and actulize these ideas.
 

karim

CAD community veteran
When OCAF part 2 is coming up ? Sorry for being so restless on this. we learned a great deal from part 1 but I have a feeling joining the document and visuazliation is still missing. we can store data on the document, but how to add/remove/copy/paste/undo/redo the objects ?
 

Quaoar

Administrator
Staff member
For the simulation framework, that's an interesting topic, indeed. We've been doing (when I was working for OCC) various projects all around pre-/post-processing. At some point, we were trying to build up something similar to Ansys Workbench, and I think it worked out quite well, especially when your graph of dependencies between objects is not too complicated.

Regarding visualization, one practice I try to follow is the separation between "backend" and "frontend" layers. That means that OCAF data model does not know anything about presentations. Although you can find in OpenCascade some OCAF attributes dealing with AIS, it's generally discouraged to use them and pin your visualization tightly with the persistence. It's much better to think of OCAF as a sort of a headless database that can store some presentable data of course, but it does not drive the presentation logic whatsoever. You could do this from within OCAF only because it lives in the same process and there are no rigid boundaries between persistence, visualization, etc. But you'd better define such boundaries yourself.

The lesson, yeah, I know. Youtube is fun, and I got a lot of positive feedback from folks, but it's hard to find enough time to prepare for difficult subjects (and OCAF is difficult enough). I'll try to come up with the second part in a couple of weeks. Just do not mix up visualization with OCAF :)
 

Quaoar

Administrator
Staff member
This was a prototype I prepared for a commercial system that did not see the light of day. There are few things to keep in mind about it:

1. It integrates MeshGems from Distene (now a part of Dassault Systemes) as a commercial mesher. I do not have access to MeshGems since I left OCC, but conceptually it can be plugged with something like NetGen. Which mesher do you use to build a finite element model?

2. Some approaches identified in the document, like resolving the volumetric subdomains, rely upon MeshGems features, i.e. tags to be more specific. Not sure if other meshers have something similar, but that looks like a basic mechanism of any CAD-oriented mesher.

Don't take it as a poor advertising, but if you want to follow the same kind of approach, it might be easier to start from bare Analysis Situs. It uses the same Active Data OCAF framework, and the prototype was originally based on that platform. I think the results were quite promising but back in the time, I did not have a chance to continue on that subject since the customer sold himself to a big vendor with his own technology stack (commercial). How far are you now in developing your system? If you decide to go with AS, I shall be glad to help the best I can.
 

karim

CAD community veteran
Your document is far more mature that what I could come up with in 10 years. I can write FEM code but interface design is much important, I have decided to keep the model simple for the time being. I.E. frame and shell elements only. here is an example of type of structural systems we analyze: 1625739330971.png
I was thinkging of using OCC mesh tools to do the meshing. It does not need to be very sophisticated. The mesher should be able to detect intersections of frames with frames, and frames with shells. I will start to work with active data and see what it can do for me.
 

karim

CAD community veteran
How OCAF and OCC display system is designed ? is it similar to MVC architecture ?
 

Quaoar

Administrator
Staff member
How OCAF and OCC display system is designed ? is it similar to MVC architecture ?
I would not say there's any common architectural pattern behind the modules of OpenCascade. For the modeling API, there is a kind of rudimentary MVC but you have to want to see it there :)
I am starting to work with anlysis situs. It looks like a fantastic software.
Let me know if you face any problem compiling it. I think current master is not compilable with USE_MOBIUS=off, that is to be fixed.
 

Quaoar

Administrator
Staff member
I was thinkging of using OCC mesh tools to do the meshing.
Have you tried this already? OpenCascade mesh is very sparse and gives you only low-quality facets. You might need some refinement afterwards.
 

karim

CAD community veteran
Not yet. I guess there are some tools that can handel meshing. and in general my meshes are not expected to be very complicated.
 

Quaoar

Administrator
Staff member
NetGen or Gmsh should do the meshing job, I guess. I am experimenting with mesh refinement approaches right now, and that's quite a complex thing to develop from scratch as it appears.
 

karim

CAD community veteran
Quite right. I dont think anybody can write a reliable mesh generator within a reasonable time frame.
 
Top