[FEM] Elmer: fix pipeline update issue
- the existing result pipeline can have several children. They must all be updated.
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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, ""))
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user