Problem with nonpositive jacobian - help appreciated

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by bernd »

HoWil wrote:Any ideas to highlight the according elements as 'problematic' in FC? I just wonder how this could be circumvented for the next user facing such a problem since I thought i have a valid solid and a valid mesh.

EDIT: @Bernd I just saw your last plot where you highlighted the elements in FC.
BTW, you are not the first one. The non positive jacobians problem is known but not proper solved yet: some stuff to read in this regard ...

https://forum.freecadweb.org/viewtopic.php?t=10514
https://forum.freecadweb.org/viewtopic.php?t=14962
https://forum.freecadweb.org/viewtopic. ... 28#p121945
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by bernd »

I made some hack which shows all elemente nodes ccx complains about if FreeCADGui is up. See https://github.com/berndhahnebach/FreeC ... diff=split

If ccx is run at the file of howil all nodes will be highlighted right after the ccx run ...
screen.jpg
screen.jpg (205.47 KiB) Viewed 6649 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by bernd »

works quite cool on a few examples I have with nonpositive jacobians ... the nodes are highlighted right after the run of ccx ...
screen.jpg
screen.jpg (304.9 KiB) Viewed 6648 times
screen1.jpg
screen1.jpg (177.26 KiB) Viewed 6648 times
screen2.jpg
screen2.jpg (233.57 KiB) Viewed 6648 times
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by makkemal »

I have also run into this on a number of geometries.
The cause is usually something in the geometry. I have had some luck with refine shape and create simple copy but not always.
What we do need is some way of modifying geometry to ignore features smaller than a certain tolerance set by user (i.e. fill them up clean them) and them mesh the clean geometry.

Any idea if this can be done ?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by bernd »

@makkemal
do you have geometries which have no error with part --> geometry check but give nonpositive error on ccx? I'm interested in such geometry. I do collect them.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Problem with nonpositive jacobian - help appreciated

Post by HoWil »

@bernd thanks looks good. O dialog with one informativ sentence for the user is maybe also needed ("please have a look at you geometry on the marked points. Ccx error....").
makkemal wrote: What we do need is some way of modifying geometry to ignore features smaller than a certain tolerance set by user (i.e. fill them up clean them) and them mesh the clean geometry.
If this is optional than it is OK. I just worry about small features inserted by the user which maybe are removed with an automatically procedure and users wonder what has happened.

BR,
Howil
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by makkemal »

Usually geometry with one dimension far smaller than other two dimension.
For instance example Pressure vessel attached.
With a radius of 1m Height of 10m but thickness of 50mm easily creates a mesh with bad Jacobian.
Add dome at the top and bottom of this with pipe connection entering and it is really hard to get a mesh.

Anther good example is a block with lots of small round holes in it going right through the block

meshstest.FCStd
(15.99 KiB) Downloaded 84 times
@Howil ,yes defeaturing should be optional not standard
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Problem with nonpositive jacobian - help appreciated

Post by UR_ »

Hello,
i have also a simple example with negative jacobian, but i can't see these fancy green dots. :(
Do i miss something?

ccx output

Code: Select all

0.0: Check dependencies...
0.1: Write completed.
0.0: CalculiX binary: C:/Program Files/FreeCAD/bin/ccx_2.11_MT.exe
0.0: Run CalculiX...
0.0: Starting CalculiX...
0.0: CalculiX is running...
0.1: CalculiX stopped.
0.1: ************************************************************ 
CalculiX Version 2.11, Copyright(C) 1998-2015 Guido Dhondt 
CalculiX comes with ABSOLUTELY NO WARRANTY. This is free 
software, and you are welcome to redistribute it under 
certain conditions, see gpl.htm 
************************************************************ 
You are using an executable made on Di, 4. Okt 2016 17:44:49 
The numbers below are estimated upper bounds 
number of: 
nodes: 158 
elements: 138 
one-dimensional elements: 0 
two-dimensional elements: 0 
integration points per element: 4 
degrees of freedom per node: 3 
layers per element: 1 
distributed facial loads: 0 
distributed volumetric loads: 0 
concentrated loads: 16 
single point constraints: 48 
multiple point constraints: 1 
terms in all multiple point constraints: 1 
tie constraints: 0 
dependent nodes tied by cyclic constraints: 0 
dependent nodes in pre-tension constraints: 0 
sets: 4 
terms in all sets: 456 
materials: 1 
constants per material and temperature: 2 
temperature points per material: 1 
plastic data points per material: 0 
orientations: 0 
amplitudes: 2 
data points in all amplitudes: 2 
print requests: 2 
transformations: 0 
property cards: 0 
STEP 1 
Static analysis was selected 
Decascading the MPC's 
Determining the structure of the matrix: 
number of equations 
426 
number of nonzero lower triangular matrix elements 
11919 
Using up to 1 cpu(s) for the stress calculation. 
Using up to 1 cpu(s) for the symmetric stiffness/mass contributions. 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 80 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 80 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 80 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 80 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 88 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 97 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 99 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 99 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 110 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 110 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 116 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 119 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 119 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 119 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 120 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 126 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 127 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 127 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 127 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 129 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 129 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 130 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 131 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 131 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 133 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 133 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 133 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 133 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 134 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 135 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 136 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 137 
*ERROR in e_c3d: nonpositive jacobian 
determinant in element 137 
Factoring the system of equations using the symmetric spooles solver 
Using up to 1 cpu(s) for spooles. 
Using up to 1 cpu(s) for the stress calculation. 
Job finished
0.1: CalculiX done!
0.1: Loading result sets...
only nodes are displayed, but no one is highlighted
nodes.png
nodes.png (32.3 KiB) Viewed 6539 times
done with

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10760 (Git)
Build type: Release
Branch: master
Hash: 4fbfd8dbfe6a5e2c51f79177bccd5793d516d973
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Attachments
bar.FCStd
(17 KiB) Downloaded 66 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Problem with nonpositive jacobian - help appreciated

Post by bernd »

I'm one the way and can not test. For sure it works if the run button is used. AFAIK it does not work if the Solver task panel is used to trigger the analysis. It is implemented here: https://github.com/FreeCAD/FreeCAD/blob ... cx.py#L228 the call of the def is here: https://github.com/FreeCAD/FreeCAD/blob ... cx.py#L225

EDIT: tested your file on linux and ccx 2.11 and I do not get negative jacobians by ccx. If I remesh I neither get negative jacobians returned by gmsh (mesh if ok ... ). I will test your file on windows when I'm on a computer with Windows and FreeCAD ... It my take some time ...
Post Reply