#include "vtkDataArrayTemplate.h"
#include "vtkDoubleArray.h"
#include "vtkInformation.h"
+#include "vtkUnstructuredGrid.h"
#include "vtkQuadratureSchemeDefinition.h"
#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
#include "MEDUtilities.hxx"
return oss.str();
}
+/*!
+ * This method forces MeshMTime modification. To do so, points are declared as modified.
+ */
+void vtkGenerateVectors::ChangeMeshTimeToUpdateCache(vtkDataSet *dataset)
+{
+ vtkUnstructuredGrid *ug(vtkUnstructuredGrid::SafeDownCast(dataset));
+ if(!ug)
+ return ;
+ ug->GetPoints()->Modified();
+}
+
void vtkGenerateVectors::Operate(vtkFieldData *fd)
{
if(!fd)
class VTK_EXPORT vtkGenerateVectors
{
public:
+ static void ChangeMeshTimeToUpdateCache(vtkDataSet *dataset);
static void Operate(vtkFieldData *fd);
static vtkDoubleArray *Operate2Compo(vtkDoubleArray *oldArr);
static vtkDoubleArray *OperateMoreThan3Compo(vtkDoubleArray *oldArr);
vtkGenerateVectors::Operate(ret->GetPointData());
vtkGenerateVectors::Operate(ret->GetCellData());
vtkGenerateVectors::Operate(ret->GetFieldData());
+ // The operations above have potentially created new arrays -> This breaks the optimization of StaticMesh that expects the same field arrays over time.
+ // To enforce the cache recomputation declare modification of mesh.
+ vtkGenerateVectors::ChangeMeshTimeToUpdateCache(ret);
}
return ret;
}