feature: general initial value and body source, to be tested

About the development of the FEM module/workbench.

Moderator: bernd

qingfeng.xia
Posts: 209
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford Uk
Contact:

Re: feature: general initial value and body source, to be tested

Postby qingfeng.xia » Mon Feb 24, 2020 11:16 pm

that is silly error, should be x- y- z-component.
I also have another way to input vector, just as C++ constraint type (direction + mag), I have not fully tested, could be added in the future
bernd wrote:
Sun Feb 23, 2020 3:36 pm
https://github.com/berndhahnebach/FreeC ... get.py#L96

Code: Select all

            self.componentLabels = ["x-component", "x-component", "x-component"]
Why three times x-component?
Last edited by qingfeng.xia on Mon Feb 24, 2020 11:22 pm, edited 1 time in total.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Currently I mainly work on OpenFOAM + Fenics for CFD, FSI
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
https://github.com/qingfengxia/Cfd
qingfeng.xia
Posts: 209
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford Uk
Contact:

Re: feature: general initial value and body source, to be tested

Postby qingfeng.xia » Mon Feb 24, 2020 11:18 pm

bernd wrote:
Mon Feb 24, 2020 8:55 pm
IMHO it shoudl be named FemConstraintGeneric instead FemGenericConstraint

It should be easy to just do find and replacement. I will do it later.
I am stuck on the json serialization error.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Currently I mainly work on OpenFOAM + Fenics for CFD, FSI
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
https://github.com/qingfengxia/Cfd
qingfeng.xia
Posts: 209
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford Uk
Contact:

Re: feature: general initial value and body source, to be tested

Postby qingfeng.xia » Sat Feb 29, 2020 9:46 pm

bernd wrote:
Mon Feb 24, 2020 8:55 pm
IMHO it shoudl be named FemConstraintGeneric instead FemGenericConstraint

A new PR has been sent to your fembodyconstraint branch. I pull your branch on Tuesday, it still show merge conflict, not sure why.

1. Class rename
2. Json serializable error fixed
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Currently I mainly work on OpenFOAM + Fenics for CFD, FSI
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
https://github.com/qingfengxia/Cfd
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Sun Mar 01, 2020 6:11 am

great, nevermind about the merge conflict ...
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Tue Mar 10, 2020 7:08 am

qingfeng.xia wrote:
Sat Feb 29, 2020 9:46 pm
2. Json serializable error fixed
which part of the code does fix this erro ? I run into the same problem https://forum.freecadweb.org/viewtopic.php?f=18&t=44021
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Tue Mar 10, 2020 9:15 am

merged your code and did myself some code formating and renaming to fit all generic constraint code in FEM code conventions. https://github.com/berndhahnebach/FreeC ... 5bb5176d65 in branch https://github.com/berndhahnebach/FreeC ... constraint

The Json serializable error still resists ... :(


https://github.com/FreeCAD/FreeCAD/comp ... 5bb5176d65 (all changes so far)
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Tue Mar 10, 2020 7:07 pm

qingfeng.xia wrote:
Sat Feb 29, 2020 9:46 pm
2. Json serializable error
see here for more information https://forum.freecadweb.org/viewtopic.php?f=18&t=44021
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Tue Mar 10, 2020 7:17 pm

qingfeng.xia
Posts: 209
Joined: Tue Sep 22, 2015 1:47 pm
Location: Oxford Uk
Contact:

Re: feature: general initial value and body source, to be tested

Postby qingfeng.xia » Wed Mar 11, 2020 10:51 pm

add those 2 dumb functions to viewprovider class, in addition to _FemConstraintGeneric.py class. It fixed json error for me.
This solution is aslo form FreeCAD forum.https://forum.freecadweb.org/viewtopic. ... 94#p373094

src/Mod/Fem/femguiobjects/_ViewProviderFemGenericConstraint.py

Code: Select all

    def __getstate__(self):
        return None

    def __setstate__(self,state):
        return None
I read your latest branch, you have deleted those 3 functions from _FemConstraintGeneric.py

Code: Select all

    def execute(self, obj):
        ''' Called on document recompute '''
        return

    def __getstate__(self):
        # Called during document saving
        return self.Type

    def __setstate__(self, state):
        if state:
            self.Type = state
Those 3 functions should be taken back. and also some comment to protect those dumb functions , not to be deleted in the future.


bernd wrote:
Tue Mar 10, 2020 9:15 am

The Json serializable error still resists ... :(

https://github.com/FreeCAD/FreeCAD/comp ... 5bb5176d65 (all changes so far)
Last edited by qingfeng.xia on Thu Mar 12, 2020 1:00 pm, edited 1 time in total.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Currently I mainly work on OpenFOAM + Fenics for CFD, FSI
https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
https://github.com/qingfengxia/Cfd
User avatar
bernd
Posts: 10184
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: feature: general initial value and body source, to be tested

Postby bernd » Thu Mar 12, 2020 6:03 am

no they need not! Everything should work fine so far! They where missing in the superclass!

Would you give it a try?