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 » Thu Jan 24, 2019 8:52 pm

bernd wrote:
Tue Jan 22, 2019 7:41 pm
your generall constraints are improvements we should get into master. About a time line ... I do not know, we it is ready ... I will have another look before february.

I will separete the fixes commit and add it to my next PR.

We might need to change the unit tests. I will have a look at this too.
I have done "git pull bernd fembodyconstraint" in my new local branch. For the moment, I can carry on some fix work now.
I will send in some pull request to your branch about this weekend, to fix some issues like unit test.

Thank you
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 » Thu Jan 31, 2019 11:22 pm

It has been fixed by some one, it is not shown in github webpage history
https://github.com/FreeCAD/FreeCAD/blob ... undary.cpp
bernd wrote:
Thu Jan 24, 2019 6:31 am
bernd wrote:
Wed Jan 23, 2019 5:35 am
qingfeng.xia wrote:
Sun Jan 20, 2019 9:07 pm
2) yes there is a bug fix for my fluidboundary, do you suggest splitting it out for pull request directly to master by myself?
https://github.com/FreeCAD/FreeCAD/pull/1925
it compiles for me, but it fails on travis with

Code: Select all

[ 76%] [32mBuilding CXX object src/Mod/Fem/Gui/CMakeFiles/FemGui.dir/TaskFemConstraintPressure.cpp.o[0m
/home/travis/build/FreeCAD/FreeCAD/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp: In member function ‘void FemGui::TaskFemConstraintFluidBoundary::onBoundaryTypeChanged()’:
/home/travis/build/FreeCAD/FreeCAD/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp:634:108: error: cannot pass objects of non-trivially-copyable type ‘std::string {aka class std::basic_string<char>}’ through ‘...’
         Base::Console().Error("Fluid boundary recomputationg failed for boundaryType `%s` \n", boundaryType);
                                                                                                            ^
make[2]: *** [src/Mod/Fem/Gui/CMakeFiles/FemGui.dir/TaskFemConstraintFluidBoundary.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 76%] [34m[1mGenerating ui_PropertiesDialog.h[0m
see https://api.travis-ci.org/v3/job/483739833/log.txt

would you have a look at this quing feng?
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: 10067
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 » Fri Feb 01, 2019 6:35 am

qingfeng.xia wrote:
Thu Jan 31, 2019 11:22 pm
It has been fixed by some one, it is not shown in github webpage history
yeah, I realized this too, but just did not post about this here.
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 11, 2019 9:30 pm

I fixed the UnitTest failure, it is a following on work on your pep8. It is mergeable to upstream master.

it is on my new branch: fembodyconstraint
https://github.com/qingfengxia/FreeCAD/ ... constraint

Code: Select all



Merge branch 'fembodyconstraint' of https://github.com/berndhahnebach… 
Commits on Feb 11, 2019
FEM: fix FemTest failure after introduction of fembodyconstraint classes
Fem: refactor on BoyConstraintWidget as the taskpanel for taskpanel 

bernd wrote:
Fri Feb 01, 2019 6:35 am
qingfeng.xia wrote:
Thu Jan 31, 2019 11:22 pm
It has been fixed by some one, it is not shown in github webpage history
yeah, I realized this too, but just did not post about this here.
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 » Tue Sep 03, 2019 1:22 pm

the pull request to Bernd is here, it has not been rebased since March 2019.
https://github.com/berndhahnebach/FreeCAD_bhb/pull/51
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: 10067
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 Sep 03, 2019 4:07 pm

qingfeng.xia wrote:
Tue Sep 03, 2019 1:22 pm
the pull request to Bernd is here, it has not been rebased since March 2019.
https://github.com/berndhahnebach/FreeCAD_bhb/pull/51
have some more patience in this regard. ASAIHAM (as soon as I have a minute) I will integrate this. It would break backwards compatibility of the writer class with 0.17 Version and all later versions of FreeCAD. I would like not to break this writer class API compatibility. I have an idea how but did not have the time to implement it yet. Stay tuned ...
User avatar
bernd
Posts: 10067
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 Feb 20, 2020 4:50 am

User avatar
bernd
Posts: 10067
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 Feb 20, 2020 7:43 am

I did a lot of code formating to make the code fit in https://github.com/FreeCAD/FreeCAD/blob ... entions.md

Furthermore I fixed some problems. It compiles and it is possible to add the constraints to the document. So far so good, but there is still work to do.

- unit test
- I am not yet happy with the names
- the initial values for the two implemented constraints based on these general constraints is in ObjectsFem module. They might need to be somewhere else.

I really like these general constraints, but we need to improve it's implementation.
User avatar
bernd
Posts: 10067
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 Feb 20, 2020 7:55 am

a general question ...

What is the difference between a constraint "initial value" and a constraint "body source" ?

Manly the constraint "body source" I do not understand what it is for? According its implementation to could be a initial value too.
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 » Thu Feb 20, 2020 5:40 pm

From a programmer view, their implementation is similar , but from CAE user view to solve Partial diff equations(PDE), initial values and body source are distinct things.

https://fenicsproject.org/pub/tutorial/ ... t1003.html equation 1
Body source is the `f(x)` item in equation 1, it has different unit as x, so it is different quantity. Body source does not appear in linear elasticity PDE, but for dynamic problem there is, that is gravity. For heat transfer problem, that is heat source. Gravity applies to whole domain, but other source may only apply to a portion of geometry/domain. That is why, a taskpanel like FemMaterial that can select CAD solids are needed, but can be default to the whole domain.


Initial value is `x` at zero condition for unsteady sytem/temporal problem (for unsteady problem it is a kind of PDE constraint).or a better x value to start solver the `Ax=b`, for steady problem of nonlinear system, a better x initial value can converge, while a worse one will diverge. so in CFD, initial value is an essential input, in contrast to linear elasticity FEM, initial value of `x` is not necessary.

That is why two toolcon/gui/viewproviders are needed, to avoid confusing users. Under the GUI, code should be reused to avoid duplication and help maintenance.
bernd wrote:
Thu Feb 20, 2020 7:55 am
a general question ...

What is the difference between a constraint "initial value" and a constraint "body source" ?

Manly the constraint "body source" I do not understand what it is for? According its implementation to could be a initial value too.
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