From edcef95d7f79be347a0669a8cbe3b1b0dd146286 Mon Sep 17 00:00:00 2001 From: Sergei Date: Fri, 22 Jan 2021 15:50:04 +0100 Subject: [PATCH 1/4] FIX: clean haders, remove warnings, add dependences to keep up to date with v20.12 --- CMakeLists.txt | 21 ++++- .../verify.sh | 4 +- benchmarks/crontask/plugin_list.conf.default | 83 ++++++++++--------- benchmarks/crontask/runOptimusTests.sh | 47 +++++++---- .../runOptimusTests_without_compiling.sh | 6 +- .../Indices2ValuesTransformer.cpp | 1 - src/genericComponents/ShowSpheres.h | 4 +- src/genericComponents/ShowSpheres.inl | 4 +- .../SimulatedStateObservationSource.cpp | 2 +- .../SimulatedStateObservationStreamer.cpp | 2 +- .../TransformStochasticEngine.h | 2 +- .../AdaptativeUKFilterClassic.inl | 12 +-- .../StochasticStateWrapper.inl | 12 +-- src/stochasticFiltering/UKFilterClassic.inl | 12 +-- src/test/GeoEmulator.h | 1 - src/test/GeoListener.h | 1 - 16 files changed, 122 insertions(+), 92 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afb5e5eb..ff0f7c2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,15 +13,30 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(SofaFramework REQUIRED) find_package(SofaSimulation REQUIRED) find_package(SofaBase REQUIRED) -find_package(SofaGeneral REQUIRED) -find_package(SofaMisc REQUIRED) +find_package(SofaGeneralAnimationLoop REQUIRED) +find_package(SofaGeneralEngine REQUIRED) +find_package(SofaImplicitOdeSolver REQUIRED) +find_package(SofaGeneralLinearSolver REQUIRED) +find_package(SofaGeneralRigid REQUIRED) +find_package(SofaSimpleFem REQUIRED) +find_package(SofaGeneralTopology REQUIRED) +find_package(SofaTopologyMapping REQUIRED) +find_package(SofaUserInteraction REQUIRED) +find_package(SofaConstraint REQUIRED) +find_package(SofaGeneralLoader REQUIRED) +find_package(SofaMiscEngine REQUIRED) +find_package(SofaMiscForceField REQUIRED) +find_package(SofaMiscMapping REQUIRED) +find_package(SofaMiscSolver REQUIRED) +find_package(SofaMiscTopology REQUIRED) +find_package(SofaMiscFem REQUIRED) find_package(SofaExporter REQUIRED) find_package(SofaGui REQUIRED) find_package(Eigen3 3.3 REQUIRED NO_MODULE) include_directories(${EIGEN3_INCLUDE_DIR}) -set(LINKER_DEPENDENCIES SofaCore SofaBase SofaGeneral SofaBoundaryCondition SofaBaseTopology SofaExporter SofaSimulationTree SofaUserInteraction SofaConstraint SofaMisc SofaGuiCommon blas pthread Eigen3::Eigen) +set(LINKER_DEPENDENCIES SofaCore SofaBase SofaGeneralAnimationLoop SofaGeneralEngine SofaImplicitOdeSolver SofaGeneralLinearSolver SofaGeneralRigid SofaBoundaryCondition SofaBaseTopology SofaExporter SofaUserInteraction SofaConstraint SofaSimpleFem SofaGeneralTopology SofaTopologyMapping SofaUserInteraction SofaConstraint SofaGeneralLoader SofaMiscEngine SofaMiscFem SofaMiscForceField SofaMiscMapping SofaMiscSolver SofaMiscTopology SofaGuiCommon blas pthread Eigen3::Eigen) set(COMPILATION_FLAGS "-DSOFA_BUILD_OPTIMUS -Wno-unused-local-typedef -Wno-deprecated") set(STOCHASTIC_FILTERING "1" CACHE BOOL "Set to activate the compilation of the filtering module" FORCE) diff --git a/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh b/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh index f54881b1..15884fcf 100755 --- a/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh +++ b/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh @@ -1,9 +1,9 @@ #!/bin/bash if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/plugin.SofaPython3/build_release/lib/libSofaPython3.so" + SOFA_EXEC="$1 -l /home/sergei/Optimus_test/SofaPython3/build_release/lib/libSofaPython3.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/plugin.SofaPython3/build_release/lib/libSofaPython3.so" + SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/SofaPython3/build_release/lib/libSofaPython3.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/crontask/plugin_list.conf.default b/benchmarks/crontask/plugin_list.conf.default index 8a72334f..06d00ee5 100644 --- a/benchmarks/crontask/plugin_list.conf.default +++ b/benchmarks/crontask/plugin_list.conf.default @@ -1,46 +1,47 @@ -SofaSimpleFem 20.06.99 -SofaRigid 20.06.99 -SofaDeformable 20.06.99 -SofaObjectInteraction 20.06.99 -SofaMeshCollision 20.06.99 -SofaEngine 20.06.99 -SofaExplicitOdeSolver 20.06.99 -SofaImplicitOdeSolver 20.06.99 -SofaLoader 20.06.99 -SofaGeneralVisual 20.06.99 -SofaGraphComponent 20.06.99 -SofaGeneralMeshCollision 20.06.99 -SofaBoundaryCondition 20.06.99 -SofaGeneralAnimationLoop 20.06.99 -SofaGeneralDeformable 20.06.99 -SofaGeneralEngine 20.06.99 -SofaGeneralExplicitOdeSolver 20.06.99 -SofaGeneralImplicitOdeSolver 20.06.99 -SofaGeneralLinearSolver 20.06.99 -SofaGeneralRigid 20.06.99 -SofaGeneralObjectInteraction 20.06.99 -SofaGeneralSimpleFem 20.06.99 -SofaGeneralTopology 20.06.99 -SofaTopologyMapping 20.06.99 -SofaUserInteraction 20.06.99 -SofaConstraint 20.06.99 -SofaGeneralLoader 20.06.99 -SofaSparseSolver 20.06.99 -SofaPreconditioner 20.06.99 -SofaHaptics 20.06.99 -SofaValidation 20.06.99 -SofaDenseSolver 20.06.99 -SofaNonUniformFem 20.06.99 -SofaOpenglVisual 20.06.99 -SofaMiscTopology 20.06.99 -SofaMiscExtra 20.06.99 -SofaMiscForceField 20.06.99 -SofaMiscEngine 20.06.99 -SofaMiscSolver 20.06.99 -SofaMiscFem 20.06.99 -SofaMiscMapping 20.06.99 +SofaSimpleFem 20.12.00 +SofaRigid 20.12.00 +SofaDeformable 20.12.00 +SofaObjectInteraction 20.12.00 +SofaMeshCollision 20.12.00 +SofaEngine 20.12.00 +SofaExplicitOdeSolver 20.12.00 +SofaImplicitOdeSolver 20.12.00 +SofaLoader 20.12.00 +SofaGeneralVisual 20.12.00 +SofaGraphComponent 20.12.00 +SofaGeneralMeshCollision 20.12.00 +SofaBoundaryCondition 20.12.00 +SofaGeneralAnimationLoop 20.12.00 +SofaGeneralDeformable 20.12.00 +SofaGeneralEngine 20.12.00 +SofaGeneralExplicitOdeSolver 20.12.00 +SofaGeneralImplicitOdeSolver 20.12.00 +SofaGeneralLinearSolver 20.12.00 +SofaGeneralRigid 20.12.00 +SofaGeneralObjectInteraction 20.12.00 +SofaGeneralSimpleFem 20.12.00 +SofaGeneralTopology 20.12.00 +SofaTopologyMapping 20.12.00 +SofaUserInteraction 20.12.00 +SofaConstraint 20.12.00 +SofaGeneralLoader 20.12.00 +SofaSparseSolver 20.12.00 +SofaPreconditioner 20.12.00 +SofaHaptics 20.12.00 +SofaValidation 20.12.00 +SofaDenseSolver 20.12.00 +SofaNonUniformFem 20.12.00 +SofaOpenglVisual 20.12.00 +SofaMiscTopology 20.12.00 +SofaMiscExtra 20.12.00 +SofaMiscForceField 20.12.00 +SofaMiscEngine 20.12.00 +SofaMiscSolver 20.12.00 +SofaMiscFem 20.12.00 +SofaMiscMapping 20.12.00 CImgPlugin 0.1 SofaMiscCollision 1.0 DiffusionSolver 0.1 image 0.1 +CGALPlugin 0.1 diff --git a/benchmarks/crontask/runOptimusTests.sh b/benchmarks/crontask/runOptimusTests.sh index b2d7cb9b..9f23167a 100755 --- a/benchmarks/crontask/runOptimusTests.sh +++ b/benchmarks/crontask/runOptimusTests.sh @@ -14,14 +14,16 @@ SOFA_DIRECTORY=$GENERAL_DIRECTORY/sofa BUILD_DIRECTORY=$GENERAL_DIRECTORY/sofa/build_release SOFACONFIG_DIRECTORY=$GENERAL_DIRECTORY/sofaconfig OPTIMUS_DIRECTORY=$GENERAL_DIRECTORY/Optimus -PLUGIN_PYTHON3_DIRECTORY=$GENERAL_DIRECTORY/plugin.SofaPython3 -PLUGIN_PYTHON3_BUILD_DIRECTORY=$PLUGIN_PYTHON3_DIRECTORY/build_release +OPTIMUS_BUILD_DIRECTORY=$GENERAL_DIRECTORY/Optimus/build_release +SOFA_PYTHON3_DIRECTORY=$GENERAL_DIRECTORY/SofaPython3 +SOFA_PYTHON3_BUILD_DIRECTORY=$SOFA_PYTHON3_DIRECTORY/build_release ### export pardiso license export PARDISO_LIC_PATH=$HOME_DIRECTORY/External_libraries/Pardiso export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME_DIRECTORY/External_libraries/Pardiso -export PYTHONPATH=$PLUGIN_PYTHON3_BUILD_DIRECTORY/lib/site-packages +export PYTHONPATH=$SOFA_PYTHON3_BUILD_DIRECTORY/lib/site-packages +export SOFA_PLUGIN_PATH=$OPTIMUS_BUILD_DIRECTORY ### checkout source code @@ -39,6 +41,16 @@ if ! [ -d "$BUILD_DIRECTORY" ]; then mkdir $BUILD_DIRECTORY fi +### checkout Python3 +if [ -d "$SOFA_PYTHON3_DIRECTORY" ]; then + echo "Update Python3 repository" + cd $SOFA_PYTHON3_DIRECTORY + /usr/bin/git pull --progress https://github.com/sofa-framework/SofaPython3.git 2>> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt +else + /usr/bin/git clone --progress https://github.com/sofa-framework/SofaPython3.git $SOFA_PYTHON3_DIRECTORY 2>> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + echo "Clone data from Python3 repository" +fi + ### checkout Optimus if [ -d "$OPTIMUS_DIRECTORY" ]; then echo "Update Optimus repository" @@ -49,16 +61,6 @@ else echo "Clone data from Optimus repository" fi -### checkout Python3 -if [ -d "$PLUGIN_PYTHON3_DIRECTORY" ]; then - echo "Update Optimus repository" - cd $PLUGIN_PYTHON3_DIRECTORY - /usr/bin/git pull --progress https://github.com/sofa-framework/plugin.SofaPython3.git 2>> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt -else - /usr/bin/git clone --progress https://github.com/sofa-framework/plugin.SofaPython3.git $PLUGIN_PYTHON3_DIRECTORY 2>> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt - echo "Clone data from Optimus repository" -fi - ### configure and make the system echo "Recompile sofa sources" @@ -68,15 +70,26 @@ cd $BUILD_DIRECTORY /usr/bin/make -B -j 8 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt /usr/bin/make install 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt -### remove SofaPython plugin from the plugins default list (use local version of list) +### remove SofaPython plugin with python2 from the plugins default list (use local version of list) cp $OPTIMUS_DIRECTORY/benchmarks/crontask/plugin_list.conf.default $BUILD_DIRECTORY/lib/plugin_list.conf.default +cp $OPTIMUS_DIRECTORY/benchmarks/crontask/plugin_list.conf.default $BUILD_DIRECTORY/install/lib/plugin_list.conf.default echo "Recompile python3 plugin" -if ! [ -d "$PLUGIN_PYTHON3_BUILD_DIRECTORY" ]; then - mkdir $PLUGIN_PYTHON3_BUILD_DIRECTORY +if ! [ -d "$SOFA_PYTHON3_BUILD_DIRECTORY" ]; then + mkdir $SOFA_PYTHON3_BUILD_DIRECTORY +fi +cd $SOFA_PYTHON3_BUILD_DIRECTORY +/usr/bin/make clean +/usr/local/bin/cmake -DSP3_BUILD_TEST=OFF -DCMAKE_PREFIX_PATH=$BUILD_DIRECTORY/install .. 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt +/usr/bin/make -B -j 8 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt +/usr/bin/make install 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + +echo "Recompile Optimus plugin" +if ! [ -d "$OPTIMUS_BUILD_DIRECTORY" ]; then + mkdir $OPTIMUS_BUILD_DIRECTORY fi -cd $PLUGIN_PYTHON3_BUILD_DIRECTORY +cd $OPTIMUS_BUILD_DIRECTORY /usr/bin/make clean /usr/local/bin/cmake -DCMAKE_PREFIX_PATH=$BUILD_DIRECTORY/install .. 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt /usr/bin/make -B -j 8 2>&1 >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt diff --git a/benchmarks/crontask/runOptimusTests_without_compiling.sh b/benchmarks/crontask/runOptimusTests_without_compiling.sh index 9a4fe455..0b9d6bb1 100755 --- a/benchmarks/crontask/runOptimusTests_without_compiling.sh +++ b/benchmarks/crontask/runOptimusTests_without_compiling.sh @@ -15,11 +15,15 @@ BUILD_DIRECTORY=$GENERAL_DIRECTORY/sofa/build_release SOFACONFIG_DIRECTORY=$GENERAL_DIRECTORY/sofaconfig PARDISO_SOLVER_DIRECTORY=$GENERAL_DIRECTORY/SofaPardisoSolver OPTIMUS_DIRECTORY=$GENERAL_DIRECTORY/Optimus +OPTIMUS_BUILD_DIRECTORY=$GENERAL_DIRECTORY/Optimus/build_release +SOFA_PYTHON3_DIRECTORY=$GENERAL_DIRECTORY/SofaPython3 +SOFA_PYTHON3_BUILD_DIRECTORY=$SOFA_PYTHON3_DIRECTORY/build_release ### export pardiso license export PARDISO_LIC_PATH=$HOME_DIRECTORY/External_libraries/Pardiso export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME_DIRECTORY/External_libraries/Pardiso -export PYTHONPATH=$PLUGIN_PYTHON3_BUILD_DIRECTORY/lib/site-packages +export PYTHONPATH=$SOFA_PYTHON3_BUILD_DIRECTORY/lib/site-packages +export SOFA_PLUGIN_PATH=$OPTIMUS_BUILD_DIRECTORY ### verify benchmark tests diff --git a/src/genericComponents/Indices2ValuesTransformer.cpp b/src/genericComponents/Indices2ValuesTransformer.cpp index 6e7162b6..c93f7e18 100644 --- a/src/genericComponents/Indices2ValuesTransformer.cpp +++ b/src/genericComponents/Indices2ValuesTransformer.cpp @@ -21,7 +21,6 @@ ******************************************************************************/ #define SOFA_COMPONENT_ENGINE_INDICES2VALUESTRANSFORMER_CPP -#include #include "Indices2ValuesTransformer.inl" #include #include diff --git a/src/genericComponents/ShowSpheres.h b/src/genericComponents/ShowSpheres.h index e4c8a063..eb32cf78 100644 --- a/src/genericComponents/ShowSpheres.h +++ b/src/genericComponents/ShowSpheres.h @@ -63,8 +63,8 @@ ShowSpheres(); Data _draw; Data _radius; Data _showIndicesSize; - Data _color; - Data _indexColor; + Data _color; + Data _indexColor; void draw(const core::visual::VisualParams* vparams) override; diff --git a/src/genericComponents/ShowSpheres.inl b/src/genericComponents/ShowSpheres.inl index dc3f9692..a8730c9f 100644 --- a/src/genericComponents/ShowSpheres.inl +++ b/src/genericComponents/ShowSpheres.inl @@ -44,7 +44,7 @@ ShowSpheres::ShowSpheres() , _radius( initData(&_radius, "radius", "radius of the spheres") ) , _showIndicesSize( initData(&_showIndicesSize, float(0.0), "showIndicesScale", "size of indices") ) , _color( initData(&_color, "color", "color of the spheres") ) - , _indexColor( initData(&_indexColor, Vec4f(0.0,0.0,0.0,1.0), "indexColor", "color of the indices") ) + , _indexColor( initData(&_indexColor, helper::types::RGBAColor(0.0,0.0,0.0,1.0), "indexColor", "color of the indices") ) { } @@ -91,7 +91,7 @@ void ShowSpheres::draw(const core::visual::VisualParams* vparams) { vparams->drawTool()->setPolygonMode(0,false); if (_showIndicesSize.getValue() > 0) { - const Vec4f indCol = _indexColor.getValue(); + const helper::types::RGBAColor indCol = _indexColor.getValue(); float scale = (float)((vparams->sceneBBox().maxBBox() - vparams->sceneBBox().minBBox()).norm() * _showIndicesSize.getValue()); for (size_t i = 0; i < npoints; i++) { diff --git a/src/genericComponents/SimulatedStateObservationSource.cpp b/src/genericComponents/SimulatedStateObservationSource.cpp index f534d400..49c19a78 100644 --- a/src/genericComponents/SimulatedStateObservationSource.cpp +++ b/src/genericComponents/SimulatedStateObservationSource.cpp @@ -22,7 +22,7 @@ #include "SimulatedStateObservationSource.inl" #include -#include +#include #include diff --git a/src/genericComponents/SimulatedStateObservationStreamer.cpp b/src/genericComponents/SimulatedStateObservationStreamer.cpp index 6524d64a..a852256b 100644 --- a/src/genericComponents/SimulatedStateObservationStreamer.cpp +++ b/src/genericComponents/SimulatedStateObservationStreamer.cpp @@ -22,7 +22,7 @@ #include "SimulatedStateObservationStreamer.inl" #include -#include +#include #include diff --git a/src/genericComponents/TransformStochasticEngine.h b/src/genericComponents/TransformStochasticEngine.h index 149d478a..e7cb383b 100644 --- a/src/genericComponents/TransformStochasticEngine.h +++ b/src/genericComponents/TransformStochasticEngine.h @@ -31,7 +31,7 @@ #include #include -#include +#include #include diff --git a/src/stochasticFiltering/AdaptativeUKFilterClassic.inl b/src/stochasticFiltering/AdaptativeUKFilterClassic.inl index 47c02a8d..2cf452ee 100644 --- a/src/stochasticFiltering/AdaptativeUKFilterClassic.inl +++ b/src/stochasticFiltering/AdaptativeUKFilterClassic.inl @@ -575,13 +575,13 @@ void AdaptativeUKFilterClassic::draw(const core::visual::VisualParam } - Vec4f color; + helper::types::RGBAColor color; switch (i) { - case 0: color = Vec4f(1.0,0.0,0.0,1.0); break; - case 1: color = Vec4f(0.0,1.0,0.0,1.0); break; - case 2: color = Vec4f(0.0,0.0,1.0,1.0); break; - default: color = Vec4f(0.5, 0.5, 0.5, 0.5); + case 0: color = helper::types::RGBAColor(1.0,0.0,0.0,1.0); break; + case 1: color = helper::types::RGBAColor(0.0,1.0,0.0,1.0); break; + case 2: color = helper::types::RGBAColor(0.0,0.0,1.0,1.0); break; + default: color = helper::types::RGBAColor(0.5, 0.5, 0.5, 0.5); } helper::vector colorB; colorB.resize(this->stateSize); @@ -590,7 +590,7 @@ void AdaptativeUKFilterClassic::draw(const core::visual::VisualParam colorB[i]= ((double) rand() / (RAND_MAX)) ; } - vparams->drawTool()->drawSpheres(predpoints[i], d_radius_draw.getValue(), sofa::defaulttype::Vec<4, float>(m_omega,0.0f,0.0f,1.0f)); } + vparams->drawTool()->drawSpheres(predpoints[i], d_radius_draw.getValue(), helper::types::RGBAColor(m_omega,0.0f,0.0f,1.0f)); } // if (d_MOnodes_draw.getValue()>=2) // vparams->drawTool()->drawLineStrip(predpoints[i],3.0,sofa::defaulttype::Vec<4, float>(color[i],0.5f,colorB[i],1.0f)); } diff --git a/src/stochasticFiltering/StochasticStateWrapper.inl b/src/stochasticFiltering/StochasticStateWrapper.inl index b8d5fe42..57c40d0e 100644 --- a/src/stochasticFiltering/StochasticStateWrapper.inl +++ b/src/stochasticFiltering/StochasticStateWrapper.inl @@ -1265,20 +1265,20 @@ void StochasticStateWrapper::draw(const core::visual::Vis points[j][2]=pts[j][2]; } - Vec4f color; + helper::types::RGBAColor color; switch (i) { - case 0: color = Vec4f(1.0,0.0,0.0,1.0); break; - case 1: color = Vec4f(0.0,1.0,0.0,1.0); break; - case 2: color = Vec4f(0.0,0.0,1.0,1.0); break; - default: color = Vec4f(0.5, 0.5, 0.5, 0.5); + case 0: color = helper::types::RGBAColor(1.0,0.0,0.0,1.0); break; + case 1: color = helper::types::RGBAColor(0.0,1.0,0.0,1.0); break; + case 2: color = helper::types::RGBAColor(0.0,0.0,1.0,1.0); break; + default: color = helper::types::RGBAColor(0.5, 0.5, 0.5, 0.5); } vparams->drawTool()->setPolygonMode(0,vparams->displayFlags().getShowWireFrame()); vparams->drawTool()->setLightingEnabled(true); //Enable lightning vparams->drawTool()->drawSpheres(points, d_radius_draw.getValue(), color); // sofa::defaulttype::Vec<4, float>(color[i],0.8f,colorB[i],1.0f)); vparams->drawTool()->setPolygonMode(0,false); - vparams->drawTool()->drawLineStrip(points,3.0,sofa::defaulttype::Vec<4, float>(color[i],0.8f,colorB[i],1.0f)); + vparams->drawTool()->drawLineStrip(points, 3.0, helper::types::RGBAColor(color[i],0.8f,colorB[i],1.0f)); } } diff --git a/src/stochasticFiltering/UKFilterClassic.inl b/src/stochasticFiltering/UKFilterClassic.inl index c850cec7..f7f10583 100644 --- a/src/stochasticFiltering/UKFilterClassic.inl +++ b/src/stochasticFiltering/UKFilterClassic.inl @@ -500,13 +500,13 @@ void UKFilterClassic::draw(const core::visual::VisualParams* vparams } - Vec4f color; + helper::types::RGBAColor color; switch (i) { - case 0: color = Vec4f(1.0,0.0,0.0,1.0); break; - case 1: color = Vec4f(0.0,1.0,0.0,1.0); break; - case 2: color = Vec4f(0.0,0.0,1.0,1.0); break; - default: color = Vec4f(0.5, 0.5, 0.5, 0.5); + case 0: color = helper::types::RGBAColor(1.0,0.0,0.0,1.0); break; + case 1: color = helper::types::RGBAColor(0.0,1.0,0.0,1.0); break; + case 2: color = helper::types::RGBAColor(0.0,0.0,1.0,1.0); break; + default: color = helper::types::RGBAColor(0.5, 0.5, 0.5, 0.5); } helper::vector colorB; colorB.resize(this->stateSize); @@ -515,7 +515,7 @@ void UKFilterClassic::draw(const core::visual::VisualParams* vparams colorB[i]= ((double) rand() / (RAND_MAX)) ; } - vparams->drawTool()->drawSpheres(predpoints[i], d_radius_draw.getValue(), sofa::defaulttype::Vec<4, float>(m_omega,0.0f,0.0f,1.0f)); } + vparams->drawTool()->drawSpheres(predpoints[i], d_radius_draw.getValue(), helper::types::RGBAColor(m_omega,0.0f,0.0f,1.0f)); } // if (d_MOnodes_draw.getValue()>=2) // vparams->drawTool()->drawLineStrip(predpoints[i],3.0,sofa::defaulttype::Vec<4, float>(color[i],0.5f,colorB[i],1.0f)); } diff --git a/src/test/GeoEmulator.h b/src/test/GeoEmulator.h index 0bc55a1a..49a1285f 100644 --- a/src/test/GeoEmulator.h +++ b/src/test/GeoEmulator.h @@ -29,7 +29,6 @@ #include #include "../initOptimusPlugin.h" #include -#include #include #include #include diff --git a/src/test/GeoListener.h b/src/test/GeoListener.h index a17b4b9b..106736af 100644 --- a/src/test/GeoListener.h +++ b/src/test/GeoListener.h @@ -29,7 +29,6 @@ #include #include "../initOptimusPlugin.h" #include -#include #include #include #include From 49c73f221eb272ca45900d72e48652cfc18f8dec Mon Sep 17 00:00:00 2001 From: sergei Date: Sat, 23 Jan 2021 21:22:45 +0100 Subject: [PATCH 2/4] FIX: remove hardcoded paths from verification scripts --- benchmarks/assimBC_liver_geomagic_cutting_yaml/verify.sh | 8 +++++--- .../verify.sh | 8 +++++--- benchmarks/assimBC_synthBrick/verify.sh | 8 +++++--- .../assimStiffness_cylinder_UKFSimCorr_yaml/verify.sh | 8 +++++--- .../assimStiffness_cylinder_geomagic_yaml/verify.sh | 8 +++++--- benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh | 8 +++++--- benchmarks/assimStiffness_cylinder_yaml/verify.sh | 8 +++++--- benchmarks/crontask/runOptimusTests.sh | 6 +++++- 8 files changed, 40 insertions(+), 22 deletions(-) diff --git a/benchmarks/assimBC_liver_geomagic_cutting_yaml/verify.sh b/benchmarks/assimBC_liver_geomagic_cutting_yaml/verify.sh index 776de3e7..0f98bdf0 100755 --- a/benchmarks/assimBC_liver_geomagic_cutting_yaml/verify.sh +++ b/benchmarks/assimBC_liver_geomagic_cutting_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimBC_liver_polynomial_springs_point_cloud_yaml/verify.sh b/benchmarks/assimBC_liver_polynomial_springs_point_cloud_yaml/verify.sh index 56bd8a01..fbbd3011 100755 --- a/benchmarks/assimBC_liver_polynomial_springs_point_cloud_yaml/verify.sh +++ b/benchmarks/assimBC_liver_polynomial_springs_point_cloud_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimBC_synthBrick/verify.sh b/benchmarks/assimBC_synthBrick/verify.sh index ab757923..ab39b52d 100755 --- a/benchmarks/assimBC_synthBrick/verify.sh +++ b/benchmarks/assimBC_synthBrick/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimStiffness_cylinder_UKFSimCorr_yaml/verify.sh b/benchmarks/assimStiffness_cylinder_UKFSimCorr_yaml/verify.sh index 99c34d07..9561c877 100755 --- a/benchmarks/assimStiffness_cylinder_UKFSimCorr_yaml/verify.sh +++ b/benchmarks/assimStiffness_cylinder_UKFSimCorr_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimStiffness_cylinder_geomagic_yaml/verify.sh b/benchmarks/assimStiffness_cylinder_geomagic_yaml/verify.sh index 70cec5ce..b5d12c24 100755 --- a/benchmarks/assimStiffness_cylinder_geomagic_yaml/verify.sh +++ b/benchmarks/assimStiffness_cylinder_geomagic_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh b/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh index 15884fcf..6e28203d 100755 --- a/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh +++ b/benchmarks/assimStiffness_cylinder_python3_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/SofaPython3/build_release/lib/libSofaPython3.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython3.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython3.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/SofaPython3/build_release/lib/libSofaPython3.so" + SOFA_EXEC="runSofa -l libSofaPython3.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/assimStiffness_cylinder_yaml/verify.sh b/benchmarks/assimStiffness_cylinder_yaml/verify.sh index 57b948c1..91e21302 100755 --- a/benchmarks/assimStiffness_cylinder_yaml/verify.sh +++ b/benchmarks/assimStiffness_cylinder_yaml/verify.sh @@ -1,9 +1,11 @@ #!/bin/bash -if [ $# == "1" ]; then - SOFA_EXEC="$1 -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" +if [ $# == "2" ]; then + SOFA_EXEC="$1 -l $2/libSofaPython.so -l $2/libSofaExporter.so" +elif [ $# == "1" ]; then + SOFA_EXEC="$1 -l libSofaPython.so -l libSofaExporter.so" else - SOFA_EXEC="runSofa -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaPython.so -l /home/sergei/Optimus_test/sofa/build_release/lib/libSofaExporter.so" + SOFA_EXEC="runSofa -l libSofaPython.so -l libSofaExporter.so" fi echo "Using SOFA executable: " $SOFA_EXEC diff --git a/benchmarks/crontask/runOptimusTests.sh b/benchmarks/crontask/runOptimusTests.sh index 9f23167a..d2c8f81f 100755 --- a/benchmarks/crontask/runOptimusTests.sh +++ b/benchmarks/crontask/runOptimusTests.sh @@ -106,7 +106,11 @@ do cd $FOLDER if [ -f $FOLDER/verify.sh ]; then echo "Perform test: $FOLDER" - $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + if [[ *"python3"* == "$FOLDER" ]]; then + $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $SOFA_PYTHON3_BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + else + $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + fi fi done echo "All tests have been executed" From eddd9d4f29efa85ba239cb6e3a61607fae20df93 Mon Sep 17 00:00:00 2001 From: sergei Date: Sun, 24 Jan 2021 16:00:50 +0100 Subject: [PATCH 3/4] FIX: small corrections in benchmark tests --- benchmarks/crontask/runOptimusTests.sh | 2 +- benchmarks/crontask/runOptimusTests_without_compiling.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmarks/crontask/runOptimusTests.sh b/benchmarks/crontask/runOptimusTests.sh index d2c8f81f..95688f89 100755 --- a/benchmarks/crontask/runOptimusTests.sh +++ b/benchmarks/crontask/runOptimusTests.sh @@ -14,7 +14,7 @@ SOFA_DIRECTORY=$GENERAL_DIRECTORY/sofa BUILD_DIRECTORY=$GENERAL_DIRECTORY/sofa/build_release SOFACONFIG_DIRECTORY=$GENERAL_DIRECTORY/sofaconfig OPTIMUS_DIRECTORY=$GENERAL_DIRECTORY/Optimus -OPTIMUS_BUILD_DIRECTORY=$GENERAL_DIRECTORY/Optimus/build_release +OPTIMUS_BUILD_DIRECTORY=$OPTIMUS_DIRECTORY/build_release SOFA_PYTHON3_DIRECTORY=$GENERAL_DIRECTORY/SofaPython3 SOFA_PYTHON3_BUILD_DIRECTORY=$SOFA_PYTHON3_DIRECTORY/build_release diff --git a/benchmarks/crontask/runOptimusTests_without_compiling.sh b/benchmarks/crontask/runOptimusTests_without_compiling.sh index 0b9d6bb1..494dc152 100755 --- a/benchmarks/crontask/runOptimusTests_without_compiling.sh +++ b/benchmarks/crontask/runOptimusTests_without_compiling.sh @@ -35,7 +35,11 @@ do cd $FOLDER if [ -f $FOLDER/verify.sh ]; then echo "Perform test: $FOLDER" - $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + if [[ *"python3"* == "$FOLDER" ]]; then + $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $SOFA_PYTHON3_BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + else + $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt + fi fi done echo "All tests have been executed" From f1639a5561cf8e792442a68576d83a91e954e2e4 Mon Sep 17 00:00:00 2001 From: Sergei Date: Mon, 25 Jan 2021 13:42:02 +0100 Subject: [PATCH 4/4] FIX: correct plugin loading for example files --- .../liver_geomagic_cutting_scene_SDA_bench.py | 2 +- benchmarks/crontask/runOptimusTests.sh | 2 +- .../runOptimusTests_without_compiling.sh | 2 +- .../identify10YoungMods_GenObs.py | 12 +++++++++--- .../identify10YoungMods_SDA.py | 13 ++++++++++--- .../identify1YoungMod_GenObs.py | 12 +++++++++--- .../identify1YoungMod_SDA.py | 13 +++++++++++-- .../identifySpringStiffness_GenObs.py | 17 ++++++++++++++--- .../identifySpringStiffness_SDA.py | 19 +++++++++++++++---- 9 files changed, 71 insertions(+), 21 deletions(-) diff --git a/benchmarks/assimBC_liver_geomagic_cutting_yaml/liver_geomagic_cutting_scene_SDA_bench.py b/benchmarks/assimBC_liver_geomagic_cutting_yaml/liver_geomagic_cutting_scene_SDA_bench.py index dd3fc35c..a72ba82f 100644 --- a/benchmarks/assimBC_liver_geomagic_cutting_yaml/liver_geomagic_cutting_scene_SDA_bench.py +++ b/benchmarks/assimBC_liver_geomagic_cutting_yaml/liver_geomagic_cutting_scene_SDA_bench.py @@ -21,7 +21,7 @@ def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') rootNode.createObject('RequiredPlugin', name='GraphComponent', pluginName='SofaGraphComponent') rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') - rootNode.createObject('RequiredPlugin', pluginName='Optimus') + rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') try: sys.argv[0] diff --git a/benchmarks/crontask/runOptimusTests.sh b/benchmarks/crontask/runOptimusTests.sh index 95688f89..338c6ec4 100755 --- a/benchmarks/crontask/runOptimusTests.sh +++ b/benchmarks/crontask/runOptimusTests.sh @@ -106,7 +106,7 @@ do cd $FOLDER if [ -f $FOLDER/verify.sh ]; then echo "Perform test: $FOLDER" - if [[ *"python3"* == "$FOLDER" ]]; then + if [[ "$FOLDER" == *"python3"* ]]; then $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $SOFA_PYTHON3_BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt else $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt diff --git a/benchmarks/crontask/runOptimusTests_without_compiling.sh b/benchmarks/crontask/runOptimusTests_without_compiling.sh index 494dc152..6cfe1e8f 100755 --- a/benchmarks/crontask/runOptimusTests_without_compiling.sh +++ b/benchmarks/crontask/runOptimusTests_without_compiling.sh @@ -35,7 +35,7 @@ do cd $FOLDER if [ -f $FOLDER/verify.sh ]; then echo "Perform test: $FOLDER" - if [[ *"python3"* == "$FOLDER" ]]; then + if [[ "$FOLDER" == *"python3"* ]]; then $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $SOFA_PYTHON3_BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt else $FOLDER/verify.sh $BUILD_DIRECTORY/bin/runSofa $BUILD_DIRECTORY/lib >> $GENERAL_DIRECTORY/log_`/bin/date +"%Y_%m_%d"`.txt diff --git a/examples/MultipleParameterIdentification/identify10YoungMods_GenObs.py b/examples/MultipleParameterIdentification/identify10YoungMods_GenObs.py index 006c67a7..53fb1492 100644 --- a/examples/MultipleParameterIdentification/identify10YoungMods_GenObs.py +++ b/examples/MultipleParameterIdentification/identify10YoungMods_GenObs.py @@ -12,10 +12,17 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') - rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') + rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') try: sys.argv[0] @@ -131,7 +138,6 @@ def createGraph(self, rootNode): simuNode.createObject('MechanicalObject', src='@loader', name='Volume') simuNode.createObject('TetrahedronSetTopologyContainer', name="Container", src="@loader", tags=" ") simuNode.createObject('TetrahedronSetTopologyModifier', name="Modifier") - simuNode.createObject('TetrahedronSetTopologyAlgorithms', name="TopoAlgo") simuNode.createObject('TetrahedronSetGeometryAlgorithms', name="GeomAlgo") if 'total_mass' in self.opt['model'].keys(): diff --git a/examples/MultipleParameterIdentification/identify10YoungMods_SDA.py b/examples/MultipleParameterIdentification/identify10YoungMods_SDA.py index 7f8a665f..a9141f21 100644 --- a/examples/MultipleParameterIdentification/identify10YoungMods_SDA.py +++ b/examples/MultipleParameterIdentification/identify10YoungMods_SDA.py @@ -12,10 +12,18 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') - rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') + rootNode.createObject('RequiredPlugin', name='GraphComponent', pluginName='SofaGraphComponent') rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') + rootNode.createObject('RequiredPlugin', name='Optim', pluginName='Optimus') + rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') try: sys.argv[0] @@ -169,7 +177,6 @@ def createGraph(self, rootNode): simuNode.createObject('MechanicalObject', src="@loader", name="Volume") simuNode.createObject('TetrahedronSetTopologyContainer', name="Container", src="@loader", tags=" ") simuNode.createObject('TetrahedronSetTopologyModifier', name="Modifier") - simuNode.createObject('TetrahedronSetTopologyAlgorithms', name="TopoAlgo") simuNode.createObject('TetrahedronSetGeometryAlgorithms', name="GeomAlgo") if 'total_mass' in self.opt['model'].keys(): diff --git a/examples/SingleParameterIdentification/identify1YoungMod_GenObs.py b/examples/SingleParameterIdentification/identify1YoungMod_GenObs.py index 019ba085..3ac7e90d 100644 --- a/examples/SingleParameterIdentification/identify1YoungMod_GenObs.py +++ b/examples/SingleParameterIdentification/identify1YoungMod_GenObs.py @@ -13,10 +13,17 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') - rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') + rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') ### load YAML configuration given as argument via --argv name.yaml try: @@ -108,7 +115,6 @@ def createGraph(self, rootNode): simuNode.createObject('MechanicalObject', src='@loader', name='Volume') simuNode.createObject('TetrahedronSetTopologyContainer', name="Container", src="@loader", tags=" ") simuNode.createObject('TetrahedronSetTopologyModifier', name="Modifier") - simuNode.createObject('TetrahedronSetTopologyAlgorithms', name="TopoAlgo") simuNode.createObject('TetrahedronSetGeometryAlgorithms', name="GeomAlgo") simuNode.createObject('MeshMatrixMass', printMass='0', lumping='1', massDensity=self.opt['model']['density'], name='mass') diff --git a/examples/SingleParameterIdentification/identify1YoungMod_SDA.py b/examples/SingleParameterIdentification/identify1YoungMod_SDA.py index b2237299..e8d60ab9 100644 --- a/examples/SingleParameterIdentification/identify1YoungMod_SDA.py +++ b/examples/SingleParameterIdentification/identify1YoungMod_SDA.py @@ -13,7 +13,17 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') + rootNode.createObject('RequiredPlugin', name='GraphComponent', pluginName='SofaGraphComponent') + rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') + rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') + rootNode.createObject('RequiredPlugin', name='Optim', pluginName='Optimus') rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') try: @@ -164,7 +174,6 @@ def createGraph(self, rootNode): simuNode.createObject('MechanicalObject', src="@/loader", name="Volume") simuNode.createObject('TetrahedronSetTopologyContainer', name="Container", src="@/loader", tags=" ") simuNode.createObject('TetrahedronSetTopologyModifier', name="Modifier") - simuNode.createObject('TetrahedronSetTopologyAlgorithms', name="TopoAlgo") simuNode.createObject('TetrahedronSetGeometryAlgorithms', name="GeomAlgo") simuNode.createObject('MeshMatrixMass', printMass='0', lumping='1', massDensity=self.opt['model']['density'], name='mass') diff --git a/examples/SpringStiffnessIdentification/identifySpringStiffness_GenObs.py b/examples/SpringStiffnessIdentification/identifySpringStiffness_GenObs.py index 135a7cd8..ca07200d 100644 --- a/examples/SpringStiffnessIdentification/identifySpringStiffness_GenObs.py +++ b/examples/SpringStiffnessIdentification/identifySpringStiffness_GenObs.py @@ -6,9 +6,21 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', pluginName='Optimus') - rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Deformable', pluginName='SofaDeformable') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='Rigid', pluginName='SofaRigid') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') + rootNode.createObject('RequiredPlugin', name='MiscFem', pluginName='SofaMiscFem') + rootNode.createObject('RequiredPlugin', name='MeshCollision', pluginName='SofaMeshCollision') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') + rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') + rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') rootNode.createObject('PythonScriptController', name='GenerateObservations', filename=__file, classname='synth1_GenObs') @@ -78,7 +90,6 @@ def createGraph(self, rootNode): simuNode.createObject('MechanicalObject', src='@loader', showIndicesScale='0.00025', name='MO', template='Vec3d', showIndices='0') simuNode.createObject('TetrahedronSetTopologyContainer', name='Container', src="@loader") simuNode.createObject('TetrahedronSetTopologyModifier', name='Modifier') - simuNode.createObject('TetrahedronSetTopologyAlgorithms', name='TopoAlgs') simuNode.createObject('TetrahedronSetGeometryAlgorithms', name='GeomAlgs') simuNode.createObject('UniformMass', totalMass='0.01') diff --git a/examples/SpringStiffnessIdentification/identifySpringStiffness_SDA.py b/examples/SpringStiffnessIdentification/identifySpringStiffness_SDA.py index 0f769b50..43bacec9 100644 --- a/examples/SpringStiffnessIdentification/identifySpringStiffness_SDA.py +++ b/examples/SpringStiffnessIdentification/identifySpringStiffness_SDA.py @@ -9,10 +9,22 @@ def createScene(rootNode): - rootNode.createObject('RequiredPlugin', pluginName='Optimus') - rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') - rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') + rootNode.createObject('RequiredPlugin', name='Deformable', pluginName='SofaDeformable') + rootNode.createObject('RequiredPlugin', name='Engine', pluginName='SofaEngine') + rootNode.createObject('RequiredPlugin', name='GeneralEngine', pluginName='SofaGeneralEngine') + rootNode.createObject('RequiredPlugin', name='ImplicitOdeSolver', pluginName='SofaImplicitOdeSolver') + rootNode.createObject('RequiredPlugin', name='Loader', pluginName='SofaLoader') + rootNode.createObject('RequiredPlugin', name='MiscForceField', pluginName='SofaMiscForceField') + rootNode.createObject('RequiredPlugin', name='Rigid', pluginName='SofaRigid') + rootNode.createObject('RequiredPlugin', name='SimpleFem', pluginName='SofaSimpleFem') + rootNode.createObject('RequiredPlugin', name='MiscFem', pluginName='SofaMiscFem') + rootNode.createObject('RequiredPlugin', name='MeshCollision', pluginName='SofaMeshCollision') + rootNode.createObject('RequiredPlugin', name='GraphComponent', pluginName='SofaGraphComponent') + rootNode.createObject('RequiredPlugin', name='BoundaryCondition', pluginName='SofaBoundaryCondition') rootNode.createObject('RequiredPlugin', name='Visual', pluginName='SofaOpenglVisual') + rootNode.createObject('RequiredPlugin', name='Exporter', pluginName='SofaExporter') + rootNode.createObject('RequiredPlugin', name='Python', pluginName='SofaPython') + rootNode.createObject('RequiredPlugin', name='Optimus', pluginName='Optimus') rootNode.createObject('PythonScriptController', name='SynthBCDA', filename=__file, classname='synth1_BCDA') @@ -126,7 +138,6 @@ def createCommonComponents(self, node): node.createObject('MechanicalObject', src="@/objectLoader", name="Volume") node.createObject('TetrahedronSetTopologyContainer', name="Container", src="@/objectLoader", tags=" ") node.createObject('TetrahedronSetTopologyModifier', name="Modifier") - node.createObject('TetrahedronSetTopologyAlgorithms', name="TopoAlgo") node.createObject('TetrahedronSetGeometryAlgorithms', name="GeomAlgo") node.createObject('UniformMass', totalMass="0.2513")