[FEM] Elmer: fix pipeline update issue

- the existing result pipeline can have several children. They must all be updated.
This commit is contained in:
Uwe
2022-08-07 06:22:42 +02:00
parent f6e0d37264
commit 38aaf9bfb3
5 changed files with 25 additions and 3 deletions

View File

@@ -226,6 +226,12 @@ void FemPostPipeline::onChanged(const Property* prop)
}
void FemPostPipeline::recomputeChildren()
{
for (const auto &obj : Filter.getValues())
obj->touch();
}
FemPostObject* FemPostPipeline::getLastPostObject() {
if (Filter.getValues().empty())

View File

@@ -64,11 +64,12 @@ public:
void load(FemResultObject* res);
//Pipeline handling
FemPostObject* getLastPostObject();
bool holdsPostObject(FemPostObject* obj);
void recomputeChildren();
FemPostObject *getLastPostObject();
bool holdsPostObject(FemPostObject *obj);
protected:
virtual void onChanged(const App::Property* prop);
virtual void onChanged(const App::Property *prop);
private:
static const char* ModeEnums[];

View File

@@ -28,6 +28,11 @@
<UserDocu>Load a result object</UserDocu>
</Documentation>
</Methode>
<Methode Name="recomputeChildren">
<Documentation>
<UserDocu>Recomputes all children of the pipeline</UserDocu>
</Documentation>
</Methode>
<Methode Name="getLastPostObject">
<Documentation>
<UserDocu>Get the last post-processing object</UserDocu>

View File

@@ -77,6 +77,15 @@ PyObject* FemPostPipelinePy::load(PyObject *args)
Py_Return;
}
PyObject *FemPostPipelinePy::recomputeChildren(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return nullptr;
getFemPostPipelinePtr()->recomputeChildren();
Py_Return;
}
PyObject* FemPostPipelinePy::getLastPostObject(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))

View File

@@ -256,6 +256,7 @@ class Results(run.Results):
# this might be changed in future, therefore leave this
#self.solver.ElmerResult.scale(1000)
self.solver.ElmerResult.getLastPostObject().touch()
self.solver.ElmerResult.recomputeChildren()
self.solver.Document.recompute()
def _createResults(self):