cmake_minimum_required(VERSION 3.8)
project(ElectromagnetismRotation)
+IF(PARAVISADDONS_COMMON_BUILD_TESTS)
+ ADD_SUBDIRECTORY(Test)
+ENDIF(PARAVISADDONS_COMMON_BUILD_TESTS)
+
find_package(ParaView REQUIRED)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
--- /dev/null
+# Copyright (C) 2012-2020 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author : Yoann Audouin (EDF)
+
+SET(test_maxwell_rotation_0_src
+ mesh_benjamin_8_sept_2020.med
+ test_maxwell_rotation_0.py
+ )
+
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
+ADD_TEST(ElectromagnetismRotation python test_maxwell_rotation_0.py)
+SET_TESTS_PROPERTIES(ElectromagnetismRotation PROPERTIES ENVIRONMENT "${tests_env}")
+
+# Application tests
+
+SET(TEST_INSTALL_DIRECTORY ${PARAVISADDONS_COMMON_INSTALL_TESTS}/ElectromagnetismRotation)
+INSTALL(FILES ${test_maxwell_rotation_0_src} DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)
--- /dev/null
+# Copyright (C) 2015-2020 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TEST_NAMES
+ test_maxwell_rotation_0
+)
+
+FOREACH(tfile ${TEST_NAMES})
+ SET(TEST_NAME ${COMPONENT_NAME}_${tfile})
+ ADD_TEST(${TEST_NAME} python ${tfile}.py)
+ SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES
+ LABELS "${COMPONENT_NAME}"
+ TIMEOUT ${TIMEOUT}
+ )
+ENDFOREACH()
--- /dev/null
+from paraview.simple import *
+paraview.simple._DisableFirstRenderCameraReset()
+from vtk.util import numpy_support
+
+def MyAssert(clue):
+ if not clue:
+ raise RuntimeError("Assertion failed !")
+
+fileName="mesh_benjamin_8_sept_2020.med"
+testmed = MEDReader(FileName=fileName)
+testmed.AllArrays = ['TS0/Mesh_1/ComSup0/B_A@@][@@P0', 'TS0/Mesh_1/ComSup0/B_HsOmega@@][@@P0', 'TS0/Mesh_1/ComSup0/H_A@@][@@P0', 'TS0/Mesh_1/ComSup0/H_HsOmega@@][@@P0']
+testmed.UpdatePipeline()
+
+animationScene1 = GetAnimationScene()
+timeKeeper1 = GetTimeKeeper()
+animationScene1.UpdateAnimationUsingDataTimeSteps()
+
+rog = RotationOfGroup(Input=testmed)
+rog.AllGroups = ['GRP_airint_extruded', 'GRP_amortisseurs_extruded', 'GRP_arbre_extruded', 'GRP_inducteurGE_extruded', 'GRP_inducteurGS_extruded', 'GRP_inducteurPE_extruded', 'GRP_inducteurPS_extruded', 'GRP_mvt_extruded', 'GRP_rotor_extruded']
+rog.AngularStep = "180+180"
+rog.UpdatePipeline()
+ds0 = servermanager.Fetch(rog)
+MyAssert(ds0.GetBlock(0).GetNumberOfCells() == 3423)
+rog.UpdatePipeline()
+animationScene1.GoToNext()
+rog.UpdatePipeline()
+animationScene1.GoToNext()
+rog.UpdatePipeline()