Commit Graph

16984 Commits

Author SHA1 Message Date
Bernd Hahnebach
7103688045 FEM: calculix solver unit tests, add generic inp file writing method and make use of it 2020-07-03 15:27:08 +02:00
Bernd Hahnebach
5d5119811a FEM: objects unit tests, improve directory handling 2020-07-03 15:27:00 +02:00
Bernd Hahnebach
755ffe20c7 FEM: mesh unit tests, improve directory handling 2020-07-03 15:26:53 +02:00
Zheng, Lei
6d2bf01071 Fem: fix ViewProviderFemPostPipeline::updateData() 2020-07-03 14:37:59 +02:00
Bernd Hahnebach
9de5f54dae Arch: IFC, fix import break on a IfcAxis2Placement2D 2020-07-03 13:54:26 +02:00
Bernd Hahnebach
76b03ae90f FEM: ccxtools unit tests, simplifictions 2020-07-03 09:56:59 +02:00
Abdullah Tahiri
31b1ad874f Sketcher: Augment malformed constraint messages
===============================================

Enable a user recomputing an object/document to identify which sketch has the malformed constraints.
2020-07-02 19:54:15 +02:00
Bernd Hahnebach
98b804cd72 FEM: ccxtools unit tests, improve directory handling 2020-07-02 18:13:47 +02:00
Bernd Hahnebach
82551c2d0f FEM: elmer unit tests, add ccx canti node load test 2020-07-02 14:25:56 +02:00
Bernd Hahnebach
d8d0a513d2 FEM: unit tests, improve directory handling 2020-07-02 14:25:48 +02:00
Bernd Hahnebach
7890f1a7af FEM: solver elmer unit tests, add generic input file test method and make use of it 2020-07-02 14:25:39 +02:00
wmayer
da6b379566 fixes #0004318: Compilation fails with Qt 5.15 beta with QPainterPath errors [skip ci] 2020-07-02 13:19:43 +02:00
WandererFan
19d37ec5df [TD]tweak CosmeticEdge point getters 2020-07-01 20:22:39 -04:00
Bernd Hahnebach
bc309838dc FEM: examples, fix mat value in simple box example 2020-07-01 22:18:14 +02:00
Bernd Hahnebach
aad66311fd FEM: elmer unit tests, add ccx canti faceload 2020-07-01 22:18:07 +02:00
Bernd Hahnebach
25a4cf67d5 FEM: elmer unit test, rename case file
rebaseSmart
2020-07-01 21:44:16 +02:00
Bernd Hahnebach
ddaaa5edf9 FEM: solver elmer unit test, small improvements 2020-07-01 21:44:09 +02:00
Bernd Hahnebach
b13c2b57c1 FEM: examples, nonlinear material, add forum link 2020-07-01 21:44:03 +02:00
wmayer
ebbcdf5ff7 Sketcher: [skip ci] fixes -Wmaybe-uninitialized 2020-07-01 19:50:40 +02:00
Bernd Hahnebach
064b3fb364 FEM: unit tests, make own module for each frame work solver 2020-07-01 17:42:47 +02:00
Abdullah Tahiri
c35d8be9a3 Sketcher: Check invalid constraint indices in unmanaged operations
==================================================================

It is possible to bypass SketchObject in modifying geometry and constraints. Like in here:
https://forum.freecadweb.org/viewtopic.php?f=3&t=41326&start=20#p408409

This leads to unexpected behaviour and even crashes.

With this commit the new mechanism of constraint indices check is leveraged in cases not involving SketchObject operations (aka managed operations).

Direct assignment of properties from Python (sketcher unmanaged operations), undergo this extra indices check.

When indices in constraints are outside the geometry range, the constraints are shown as empty and the error is shown in the report window.
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
ee21985e25 Sketcher: PropertyConstraintList input data validation
======================================================

PropertyConstraintList is provided with the ability to check its constraints indices against
a minimum and a maximum, and set an invalidindex status.

In this status, the getValues returns an emptylist, as in the case with invalid geometry types.
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
7055b5ef0f GCS: Prevent that reference constraints affect the result of a redundant solving
================================================================================

Solves the part of this described bug relating to reference constraints affecting the diagnosis of redundant constraints:
https://forum.freecadweb.org/viewtopic.php?p=410195#p410195
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
ffaa92d29b GCS: Add debug code to identify the popularity contest selected redundant that is removed 2020-07-01 14:04:25 +02:00
Abdullah Tahiri
926625b678 Sketcher: Use move semantics wherever sensible
==============================================

Take advantage of PropertyGeometryList setValues() move overload in order to make code more readable and prevent
memory leaks (mostly by inadvertedly not deleting cloned geometry and constraints).

PropertyGeometryList and PropertyConstraintList are vectors of heap allocated pointers. Copying a vector
makes a shallow copy, not a deep copy (the pointers are the same in the copy).

For property management, setValues() function taking a const reference effectively make a deep copy of all
pointed objects. This means that heap allocated pointers of the client class passed to these functions must be
released by the client. While this sounds sensible, forgetting to is easy. In the cases where the developer
remembered to release these pointers, extra code is needed just for memory management.

This commit does not seek a substantial performance increase that would justify rewritting the code, although code
may be slightly faster sometimes.

Functions where setValues() is conditional are not changed to move semantics, as it makes no sense to make a deep copy to sometimes
perform a second deep copy later on. This code still uses const ref setValues().

CHECKS performed to refactored functions with this commit:

1) That the vector is NOT used after moving its content.

2) That whereever there is a clone(), there must be EITHER
    -a std::move if using rvalue setValues()
    OR
    - a delete to free the heap memory after setValues if using the const ref setValues()

3) That memory is released if an exception occurred.

N.B.: A couple of memory leaks are fixed in this commit too.
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
fe993abc35 PropertyConstraintList: refactor setValue 2020-07-01 14:04:25 +02:00
Abdullah Tahiri
9ca8568f89 PropertyGeometryList: move setValue and refactor 2020-07-01 14:04:25 +02:00
Abdullah Tahiri
ac167aa850 Sketcher: ViewProviderSketch inhibit update if internal transaction is ongoing
==============================================================================

Inhibit ViewProviderSketch updateData with invalid data (internal transaction).

Trigger update internally for internal transactions in SketchObject via touched()
so as to trigger updateData.

This leads to a reduction of updateData calls.
2020-07-01 14:04:25 +02:00
Abdullah Tahiri
3941b69170 Sketcher: Internal Transaction Support and ensure valid constraint geometry indices
===================================================================================

On changing the geometry property (for example from Python), the constraints geometry indices was not rebuild in order to avoid
redundant and unnecessary rebuilds. However, this might cause crashes, as the status of the sketch (or its properties) may be invalid.

It also refactors into OnChanged common functionality.

This commit does NOT solve that the user may be inserting invalid geometry indices to the First/Second/Third of Constraints (invalid input).
Only makes sure that geometry indices (geometry types) of PropertyConstraintList match the geometry.

Solution:

1. Force the rebuild of the constraint geometry indices upon assignment of new Geometry.
2. Force the rebuild of the constraint geometry indices upon assigment of constraints, if they result in invalid geometry indices.
3. Introduce the concept of internal transaction to avoid those rebuilds, checks and updates in case of an ongoing internal transaction,
thereby preventing them as it was done before introducing 1 and 2 (in the case of SketchObject internal transactions).
2020-07-01 14:04:25 +02:00
Bernd Hahnebach
1fe43280ca FEM: meshtools, better comment 2020-06-30 22:27:24 +02:00
Bernd Hahnebach
ec4535aeac FEM: imports, improvements 2020-06-30 22:27:16 +02:00
Bernd Hahnebach
c4b0635361 FEM: mesh tools, compact mesh, use one id for Edges, Faces and Volumes as SMESH does save it 2020-06-30 19:26:04 +02:00
wmayer
68b98f5ffe Fem: [skip ci] handle exception in Fem Constraint in case referenced shape element doesn't exist 2020-06-30 11:34:07 +02:00
Bernd Hahnebach
9bfd947886 FEM: elmer equation flux, better name without word solver 2020-06-29 22:28:26 +02:00
Bernd Hahnebach
0c1f99a30c FEM: equation head, change back wrong menue text introduced with e7b813f178 2020-06-29 21:46:43 +02:00
luz.paz
1da81df756 Fix typos [skip-ci]
Found via codespell v1.18.0.dev0  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-06-29 20:52:23 +02:00
Bernd Hahnebach
fe4107c3af FEM: elmer writer, fix unit test 2020-06-29 20:21:56 +02:00
Bernd Hahnebach
c43b3c2b2a FEM: elmer writer, better messages and code formating 2020-06-29 20:21:51 +02:00
HoWil
95a58b1ee7 FEM: elmer writer, add scaling and revert scaling only for m/kg/s unit schema 2020-06-29 20:21:51 +02:00
HoWil
6a511c142b FEM: elmer writer, export meter based units for scaled m-based simulation 2020-06-29 20:21:49 +02:00
Bernd Hahnebach
d3b43aa5bf FEM: constant vacuum permittivity, implement in elmer writer 2020-06-29 17:46:43 +02:00
Bernd Hahnebach
43ad6aa729 FEM: constant vacuum permittivity, add object to overwrite constant 2020-06-29 17:46:43 +02:00
sliptonic
a0a4fdb330 Merge pull request #3657 from Russ4262/MillFace_fix
[Path] MillFace - Fix calculation of OpFinalDepth default value
2020-06-29 09:54:04 -05:00
sliptonic
8a85d0b2bd Merge pull request #3645 from Russ4262/BaseGeomList_resize
[Path] Resize the Base Geometry list dynamically
2020-06-29 09:53:18 -05:00
sliptonic
aeb989abf7 Merge pull request #3653 from etrombly/opsegfault
[PATH] fix segfault when disabling ops
2020-06-29 09:52:36 -05:00
Bernd Hahnebach
ecc07bc050 FEM: examples manager, typo 2020-06-29 08:08:34 +02:00
Bernd Hahnebach
0ac4897cfa FEM: objects make, add TODO comment 2020-06-29 08:08:25 +02:00
Bernd Hahnebach
3ea4ceb89f FEM: object add module, small comment fix 2020-06-29 08:08:11 +02:00
Bernd Hahnebach
10119ad9a1 FEM: elmer equation objects, improve object creation 2020-06-29 08:08:04 +02:00
Eric Trombly
6fc8a3cae7 check if pcLineCoords is empty 2020-06-28 19:52:59 -05:00