I dost see any result objects available is VTK FEM post pipeline. No Stresses or displacements etcmakkemal wrote:
None of the VTK results are present ?
Would you explain a bit more?
A bit refactoring work on FemResultObject
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: A bit refactoring work on FemResultObject
Re: A bit refactoring work on FemResultObject
@quingfeng:makkemal wrote:I dost see any result objects available is VTK FEM post pipeline. No Stresses or displacements etcmakkemal wrote:
None of the VTK results are present ?
Would you explain a bit more?
That is one for you to fix. You can reproduce it quite simple by:
- Start FreeCAD --> StartWB --> load 3D FEM example
- activate analysis --> purge results --> select solver --> run analysis
- double click on results --> check results --> deform structure --> max abs displacement is 87 mm
- close result task panel --> change visibility of mesh to off
- select result object --> click on icon create post processing pipline -- double click on the new pipline
- change mode to surface with edges --> click on combobox Field --> it has no entry --> there should be all the results from result object
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: A bit refactoring work on FemResultObject
I have not looked into the code of vtk pipeline, it will take days to fix the bug. Hope next week.
@bernd, Shall I pull your fork, to make me update with your code.
Would anyone tell me, how to pull bearnd's femresult to qingfengxia' femresult fork?
Thanks
@bernd, Shall I pull your fork, to make me update with your code.
Would anyone tell me, how to pull bearnd's femresult to qingfengxia' femresult fork?
Thanks
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
- kkremitzki
- Veteran
- Posts: 2511
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: A bit refactoring work on FemResultObject
Try something like this:qingfeng.xia wrote:I have not looked into the code of vtk pipeline, it will take days to fix the bug. Hope next week.
@bernd, Shall I pull your fork, to make me update with your code.
Would anyone tell me, how to pull bearnd's femresult to qingfengxia' femresult fork?
Thanks
Code: Select all
git remote add -t femresult bernd https://github.com/berndhahnebach/FreeCAD_bhb
git fetch bernd
git merge
Re: A bit refactoring work on FemResultObject
Yes! you could just continue developing on top of my branch. I will keep it rebased with FreeCAD master from time to time.qingfeng.xia wrote:@bernd, Shall I pull your fork, to make me update with your code.
Re: A bit refactoring work on FemResultObject
The bug came in with this commit: https://github.com/berndhahnebach/FreeC ... d5eccd5560bernd wrote:@quingfeng:makkemal wrote:I dost see any result objects available is VTK FEM post pipeline. No Stresses or displacements etcmakkemal wrote:
None of the VTK results are present ?
Would you explain a bit more?
That is one for you to fix. You can reproduce it quite simple by:
- Start FreeCAD --> StartWB --> load 3D FEM example
- activate analysis --> purge results --> select solver --> run analysis
- double click on results --> check results --> deform structure --> max abs displacement is 87 mm
- close result task panel --> change visibility of mesh to off
- select result object --> click on icon create post processing pipline -- double click on the new pipline
- change mode to surface with edges --> click on combobox Field --> it has no entry --> there should be all the results from result object
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: A bit refactoring work on FemResultObject
Take a whole day to spot the bug, but it is actually in ` FemVTKTools::exportMechanicalResult(res, grid);
it not yet solved, will do it soon later`
It is too late, I will continue next week
it not yet solved, will do it soon later`
Code: Select all
void CmdFemPostPipelineFromResult::activated(int)
void FemPostPipeline::load(FemResultObject* res) {
if(!res->Mesh.getValue() || !res->Mesh.getValue()->isDerivedFrom(Fem::FemMeshObject::getClassTypeId()))
return;
//first copy the mesh over
//########################
const FemMesh& mesh = static_cast<FemMeshObject*>(res->Mesh.getValue())->FemMesh.getValue();
vtkSmartPointer<vtkUnstructuredGrid> grid = vtkSmartPointer<vtkUnstructuredGrid>::New();
FemVTKTools::exportVTKMesh(&mesh, grid);
//Now copy the point data over
//############################
if(res->getPropertyByName("Velocity")){ // consider better way to detect result type, res->Type == "CfdResult"
FemVTKTools::exportFluidicResult(res, grid);
}
else{
FemVTKTools::exportMechanicalResult(res, grid);
}
Data.setValue(grid);
}
void PropertyPostDataObject::setValue(const vtkSmartPointer<vtkDataObject>& ds)
{
aboutToSetValue();
if(ds) {
createDataObjectByExternalType(ds);
m_dataObject->DeepCopy(ds);
Base::Console().Message("Debug: has setdata in PropertyPostDataObject \n");
}
else
m_dataObject = NULL;
hasSetValue();
}
TaskPostDisplay::TaskPostDisplay(Gui::ViewProviderDocumentObject* view, QWidget *parent)
: TaskPostBox(view, Gui::BitmapFactory().pixmap("fem-femmesh-create-node-by-poly"), tr("Display options"), parent)
{
//we need a separate container widget to add all controls to
proxy = new QWidget(this);
ui = new Ui_TaskPostDisplay();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);
this->groupLayout()->addWidget(proxy);
//update all fields
updateEnumerationList(getTypedView<ViewProviderFemPostObject>()->DisplayMode, ui->Representation);
updateEnumerationList(getTypedView<ViewProviderFemPostObject>()->Field, ui->Field);
updateEnumerationList(getTypedView<ViewProviderFemPostObject>()->VectorMode, ui->VectorMode);
}
void TaskPostBox::updateEnumerationList(App::PropertyEnumeration& prop, QComboBox* box) {
box->clear();
QStringList list;
std::vector<std::string> vec = prop.getEnumVector();
for(std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); ++it ) {
list.push_back(QString::fromStdString(*it));
}
box->insertItems(0, list);
box->setCurrentIndex(prop.getValue());
}
void ViewProviderFemPostObject::updateProperties() {
...
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: A bit refactoring work on FemResultObject
Now, result can be exported, but it does not show correctly once imported back.
Generic Warning: In /build/vtk6-YpT4yb/vtk6-6.2.0+dfsg1/IO/Legacy/vtkDataReader.cxx, line 1359
Error reading ascii data. Possible mismatch of datasize with declaration.
Export data show fine in paraview, so the error is caused by my import function. I will investigate later
@quingfeng:
That is one for you to fix. You can reproduce it quite simple by:
- Start FreeCAD --> StartWB --> load 3D FEM example
- activate analysis --> purge results --> select solver --> run analysis
- double click on results --> check results --> deform structure --> max abs displacement is 87 mm
- close result task panel --> change visibility of mesh to off
- select result object --> click on icon create post processing pipline -- double click on the new pipline
- change mode to surface with edges --> click on combobox Field --> it has no entry --> there should be all the results from result object[/quote]
The bug came in with this commit: https://github.com/berndhahnebach/FreeC ... d5eccd5560[/quote]
Last edited by qingfeng.xia on Tue Feb 07, 2017 9:32 pm, edited 2 times in total.
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Re: A bit refactoring work on FemResultObject
do you have a branch to test?
-
- Posts: 227
- Joined: Tue Sep 22, 2015 1:47 pm
- Location: Oxford UK/Shenzhen China
- Contact:
Re: A bit refactoring work on FemResultObject
import result is working nowbernd wrote:do you have a branch to test?
It is on the same branch, femresult,
I pull from your, but for some reason, there is conflict, all your commit history may be lost. It show me to commit 25 files.
while, I only changed 5 files.
Code: Select all
qingfeng@qingfeng-ubuntu:/opt/FreeCAD/src/Mod/Fem$ git add Gui/Command.cpp
qingfeng@qingfeng-ubuntu:/opt/FreeCAD/src/Mod/Fem$ git add App/FemPostPipeline.cpp
qingfeng@qingfeng-ubuntu:/opt/FreeCAD/src/Mod/Fem$ git add App/AppFemPy.cpp
qingfeng@qingfeng-ubuntu:/opt/FreeCAD/src/Mod/Fem$ git add App/FemVTKTools.cpp
qingfeng@qingfeng-ubuntu:/opt/FreeCAD/src/Mod/Fem$ git add App/PropertyPostDataObject.cpp
Ubuntu 18.04 LTS 64bit, python3, always work with latest FreeCAD daily build
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd
Working on Cfd module for FreeCAD, FreeCAD_Module_Develop_Guide
https://github.com/ukaea/parallel-preprocessor/
https://github.com/qingfengxia/Cfd