Skip to content

Commit

Permalink
Fem: add feature of mechancial simulation result import from vtk file
Browse files Browse the repository at this point in the history
  • Loading branch information
qingfengxia authored and berndhahnebach committed Feb 1, 2017
1 parent 6c3b78e commit 0b41074
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 187 deletions.
10 changes: 5 additions & 5 deletions src/Mod/Fem/App/AppFemPy.cpp
Expand Up @@ -95,8 +95,8 @@ class Module : public Py::ExtensionModule<Module>
"Read a mesh from a file and returns a Mesh object."
);
#ifdef FC_USE_VTK
add_varargs_method("readCfdResult",&Module::readCfdResult,
"Read a CFD result from a file (file format detected from file suffix)"
add_varargs_method("readResult",&Module::readResult,
"Read a CFD or Mechanical result (auto detect) from a file (file format detected from file suffix)"
);
add_varargs_method("writeResult",&Module::writeResult,
"write a CFD or FEM result (auto detect) to a file (file format detected from file suffix)"
Expand Down Expand Up @@ -247,7 +247,7 @@ class Module : public Py::ExtensionModule<Module>
}

#ifdef FC_USE_VTK
Py::Object readCfdResult(const Py::Tuple& args)
Py::Object readResult(const Py::Tuple& args)
{
char* fileName = NULL;
char* objName = NULL;
Expand All @@ -263,10 +263,10 @@ class Module : public Py::ExtensionModule<Module>
{
App::Document* pcDoc = App::GetApplication().getActiveDocument();
App::DocumentObject* obj = pcDoc->getObject(resName.c_str());
FemVTKTools::readFluidicResult(EncodedName.c_str(), obj);
FemVTKTools::readResult(EncodedName.c_str(), obj);
}
else
FemVTKTools::readFluidicResult(EncodedName.c_str()); //assuming activeObject can hold Result
FemVTKTools::readResult(EncodedName.c_str()); //assuming activeObject can hold Result

return Py::None();
}
Expand Down

0 comments on commit 0b41074

Please sign in to comment.