diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h index 43c65a90504..cef90c2248d 100644 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h +++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h @@ -30,7 +30,7 @@ SOFA_HEADER_DEPRECATED_NOT_REPLACED("v26.06", "v26.12") #include #include #include -#include +#include #include #include diff --git a/Sofa/Component/CMakeLists.txt b/Sofa/Component/CMakeLists.txt index dbd5d4a4fb3..dae1ad61922 100644 --- a/Sofa/Component/CMakeLists.txt +++ b/Sofa/Component/CMakeLists.txt @@ -5,13 +5,13 @@ set(SOFACOMPONENT_SOURCE_DIR "src/sofa/component") sofa_add_subdirectory_modules(SOFACOMPONENT_TARGETS DIRECTORIES - ODESolver IO Playback SceneUtility Topology Visual LinearSystem + IntegrationScheme LinearSolver Mass Diffusion diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/CMakeLists.txt b/Sofa/Component/Constraint/Lagrangian/Correction/CMakeLists.txt index 0838e994575..6368a829f4f 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/CMakeLists.txt +++ b/Sofa/Component/Constraint/Lagrangian/Correction/CMakeLists.txt @@ -26,13 +26,13 @@ set(SOURCE_FILES sofa_find_package(Sofa.Simulation.Core REQUIRED) sofa_find_package(Sofa.Component.Mass REQUIRED) # UncoupledCC needs UniformMass sofa_find_package(Sofa.Component.LinearSolver.Iterative REQUIRED) # PrecomputedCC needs CGLinearSolver -sofa_find_package(Sofa.Component.ODESolver.Backward REQUIRED) # PrecomputedCC needs EulerSolver +sofa_find_package(Sofa.Component.IntegrationScheme.Backward REQUIRED) # PrecomputedCC needs EulerSolver add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core) target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.Mass) target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.LinearSolver.Iterative) -target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.ODESolver.Backward) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.IntegrationScheme.Backward) sofa_create_package_with_targets( PACKAGE_NAME ${PROJECT_NAME} diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/Sofa.Component.Constraint.Lagrangian.CorrectionConfig.cmake.in b/Sofa/Component/Constraint/Lagrangian/Correction/Sofa.Component.Constraint.Lagrangian.CorrectionConfig.cmake.in index 77c35aa531f..b566c471ec1 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/Sofa.Component.Constraint.Lagrangian.CorrectionConfig.cmake.in +++ b/Sofa/Component/Constraint/Lagrangian/Correction/Sofa.Component.Constraint.Lagrangian.CorrectionConfig.cmake.in @@ -7,7 +7,7 @@ find_package(Sofa.Config QUIET REQUIRED) sofa_find_package(Sofa.Simulation.Core QUIET REQUIRED) sofa_find_package(Sofa.Component.Mass QUIET REQUIRED) sofa_find_package(Sofa.Component.LinearSolver.Iterative QUIET REQUIRED) -sofa_find_package(Sofa.Component.ODESolver.Backward QUIET REQUIRED) +sofa_find_package(Sofa.Component.IntegrationScheme.Backward QUIET REQUIRED) if(NOT TARGET @PROJECT_NAME@) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp index 94b1bc1dc71..5faf999cf89 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -94,10 +94,10 @@ void GenericConstraintCorrection::init() { msg_info() << "Link \"ODESolver\" to the desired ODE solver should be set to ensure right behavior." << msgendl << "First ODESolver found in current context will be used."; - l_ODESolver.set( context->get(BaseContext::Local) ); + l_ODESolver.set( context->get< sofa::core::behavior::BaseIntegrationScheme>(BaseContext::Local) ); if (l_ODESolver.get() == nullptr) { - l_ODESolver.set( context->get(BaseContext::SearchRoot) ); + l_ODESolver.set( context->get< sofa::core::behavior::BaseIntegrationScheme>(BaseContext::SearchRoot) ); } } @@ -138,7 +138,7 @@ void GenericConstraintCorrection::addComplianceInConstraintSpace(const Constrain if (!l_ODESolver.get()) return; const SReal complianceFactor = d_complianceFactor.getValue(); - // use the OdeSolver to get the integration factor + // use the IntegrationScheme to get the integration factor SReal factor = BaseConstraintCorrection::correctionFactor(l_ODESolver.get(), cparams->constOrder()); factor *= complianceFactor; diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h index d7321a26b37..2a449b8321e 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h @@ -111,7 +111,7 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API GenericConstraintCorre void resetContactForce() override; SingleLink l_linearSolver; ///< Link towards the linear solver used to compute the compliance matrix, requiring the inverse of the linear system matrix - SingleLink l_ODESolver; ///< Link towards the ODE solver used to recover the integration factors + SingleLink l_ODESolver; ///< Link towards the ODE solver used to recover the integration factors Data< SReal > d_complianceFactor; ///< Factor applied to the position factor and velocity factor used to calculate compliance matrix Data< SReal > d_regularizationTerm; ///< add regularizationTerm*Id to W when solving for constraints diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h index 57d2ebbcb2f..87c37531fca 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h @@ -24,7 +24,7 @@ #include -#include +#include #include #include @@ -95,7 +95,7 @@ class LinearSolverConstraintCorrection : public sofa::core::behavior::Constraint Data< bool > wire_optimization; ///< constraints are reordered along a wire-like topology (from tip to base) Data< SReal > d_regularizationTerm; ///< add regularization*Id to W when solving for constraints SingleLink l_linearSolver; ///< Link towards the linear solver used to compute the compliance matrix, requiring the inverse of the linear system matrix - SingleLink l_ODESolver; ///< Link towards the ODE solver used to recover the integration factors + SingleLink l_ODESolver; ///< Link towards the ODE solver used to recover the integration factors void verify_constraints(); diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl index 54360679e4d..a701d29459f 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl @@ -104,10 +104,10 @@ void LinearSolverConstraintCorrection::init() { msg_info() << "Link \"ODESolver\" to the desired ODE solver should be set to ensure right behavior." << msgendl << "First ODESolver found in current context will be used."; - l_ODESolver.set( context->get(sofa::core::objectmodel::BaseContext::Local) ); + l_ODESolver.set( context->get< sofa::core::behavior::BaseIntegrationScheme>(sofa::core::objectmodel::BaseContext::Local) ); if (l_ODESolver.get() == nullptr) { - l_ODESolver.set( context->get(sofa::core::objectmodel::BaseContext::SearchRoot) ); + l_ODESolver.set( context->get< sofa::core::behavior::BaseIntegrationScheme>(sofa::core::objectmodel::BaseContext::SearchRoot) ); } } @@ -192,7 +192,7 @@ void LinearSolverConstraintCorrection::addComplianceInConstraintSpace if(d_componentState.getValue() != ComponentState::Valid) return ; - // use the OdeSolver to get the position integration factor + // use the IntegrationScheme to get the position integration factor const SReal factor = core::behavior::BaseConstraintCorrection::correctionFactor(l_ODESolver.get(), cparams->constOrder()); // J is read from the mechanical state and converted to m_constraintJacobian @@ -373,10 +373,10 @@ void LinearSolverConstraintCorrection::applyContactForce(const linear //TODO: tell the solver not to recompute the matrix - // use the OdeSolver to get the position integration factor + // use the IntegrationScheme to get the position integration factor const SReal positionFactor = l_ODESolver.get()->getPositionIntegrationFactor(); - // use the OdeSolver to get the position integration factor + // use the IntegrationScheme to get the position integration factor const SReal velocityFactor = l_ODESolver.get()->getVelocityIntegrationFactor(); Data& xData = *mstate->write(core::vec_id::write_access::position); @@ -689,7 +689,7 @@ void LinearSolverConstraintCorrection::getBlockDiagonalCompliance(lin if(d_componentState.getValue() != ComponentState::Valid) return ; - // use the OdeSolver to get the position integration factor + // use the IntegrationScheme to get the position integration factor const SReal factor = l_ODESolver.get()->getPositionIntegrationFactor(); //*m_ODESolver->getPositionIntegrationFactor(); // dt*dt const unsigned int numDOFs = mstate->getSize(); diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.inl b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.inl index d7345d91da1..5e4c40419e9 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.inl +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.inl @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -287,7 +287,7 @@ void PrecomputedConstraintCorrection::bwdInit() static constexpr sofa::type::Vec3 gravity_zero(0_sreal, 0_sreal, 0_sreal); this->getContext()->setGravity(gravity_zero); - sofa::component::odesolver::backward::EulerImplicitSolver* eulerSolver; + sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme* eulerSolver; sofa::component::linearsolver::iterative::CGLinearSolver< sofa::component::linearsolver::GraphScatteredMatrix, sofa::component::linearsolver::GraphScatteredVector >* cgLinearSolver; core::behavior::LinearSolver* linearSolver; @@ -297,19 +297,19 @@ void PrecomputedConstraintCorrection::bwdInit() if (eulerSolver && cgLinearSolver) { - msg_info() << "use EulerImplicitSolver & CGLinearSolver" ; + msg_info() << "use EulerImplicitIntegrationScheme & CGLinearSolver" ; } else if (eulerSolver && linearSolver) { - msg_info() << "use EulerImplicitSolver & LinearSolver"; + msg_info() << "use EulerImplicitIntegrationScheme & LinearSolver"; } else if(eulerSolver) { - msg_info() << "use EulerImplicitSolver"; + msg_info() << "use EulerImplicitIntegrationScheme"; } else { - msg_error() << "PrecomputedContactCorrection must be associated with EulerImplicitSolver+LinearSolver for the precomputation\nNo Precomputation" ; + msg_error() << "PrecomputedContactCorrection must be associated with EulerImplicitIntegrationScheme+LinearSolver for the precomputation\nNo Precomputation" ; return; } @@ -345,7 +345,7 @@ void PrecomputedConstraintCorrection::bwdInit() /// (avoid to have a line of 0 at the top of the matrix) if (eulerSolver) { - eulerSolver->solve(core::execparams::defaultInstance(), dt, core::vec_id::write_access::position, core::vec_id::write_access::velocity); + eulerSolver->integrate(core::execparams::defaultInstance(), dt, core::vec_id::write_access::position, core::vec_id::write_access::velocity); } Deriv unitary_force; @@ -380,7 +380,7 @@ void PrecomputedConstraintCorrection::bwdInit() { fact *= eulerSolver->getPositionIntegrationFactor(); // here, we compute a compliance - eulerSolver->solve(core::execparams::defaultInstance(), dt, core::vec_id::write_access::position, core::vec_id::write_access::velocity); + eulerSolver->integrate(core::execparams::defaultInstance(), dt, core::vec_id::write_access::position, core::vec_id::write_access::velocity); } for (unsigned int v = 0; v < nbNodes; v++) diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.cpp b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.cpp index e64f65eb4cb..f95b972b95b 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.cpp @@ -42,19 +42,19 @@ SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API void UncoupledConstraintCorr double odeFactor = 1.0; - this->getContext()->get(m_pOdeSolver); - if (!m_pOdeSolver) + this->getContext()->get(m_pIntegrationScheme); + if (!m_pIntegrationScheme) { - if (d_useOdeSolverIntegrationFactors.getValue() == true) + if (d_useIntegrationSchemeIntegrationFactors.getValue() == true) { msg_error() << "Can't find any odeSolver"; - d_useOdeSolverIntegrationFactors.setValue(false); + d_useIntegrationSchemeIntegrationFactors.setValue(false); } - d_useOdeSolverIntegrationFactors.setReadOnly(true); + d_useIntegrationSchemeIntegrationFactors.setReadOnly(true); } else { - if( !d_useOdeSolverIntegrationFactors.getValue() ) + if( !d_useIntegrationSchemeIntegrationFactors.getValue() ) { const double dt = this->getContext()->getDt(); odeFactor = dt*dt; // W = h^2 * JMinvJt : only correct when solving in constraint equation in position. Must be deprecated. diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.h index f155af1da97..74001c81a00 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.h @@ -23,8 +23,9 @@ #include #include -#include +#include #include +#include namespace sofa::component::constraint::lagrangian::correction { @@ -116,7 +117,8 @@ class UncoupledConstraintCorrection : public sofa::core::behavior::ConstraintCor Data d_verbose; ///< Dump the constraint matrix at each iteration Data< Real > d_correctionVelocityFactor; ///< Factor applied to the constraint forces when correcting the velocities Data< Real > d_correctionPositionFactor; ///< Factor applied to the constraint forces when correcting the positions - Data < bool > d_useOdeSolverIntegrationFactors; ///< Use odeSolver integration factors instead of correctionVelocityFactor and correctionPositionFactor + Data < bool > d_useIntegrationSchemeIntegrationFactors; ///< Use odeSolver integration factors instead of correctionVelocityFactor and correctionPositionFactor + sofa::core::objectmodel::lifecycle::RenamedData d_useOdeSolverIntegrationFactors; /// Link to be set to the topology container in the component graph. SingleLink, sofa::core::topology::BaseMeshTopology, BaseLink::FLAG_STOREPATH | BaseLink::FLAG_STRONGLINK> l_topology; @@ -128,7 +130,7 @@ class UncoupledConstraintCorrection : public sofa::core::behavior::ConstraintCor protected: - sofa::core::behavior::OdeSolver* m_pOdeSolver; + sofa::core::behavior::BaseIntegrationScheme* m_pIntegrationScheme; /** * @brief Compute dx correction from motion space force vector. diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.inl b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.inl index db9930e9158..37c87c9d135 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.inl +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/UncoupledConstraintCorrection.inl @@ -107,10 +107,12 @@ UncoupledConstraintCorrection::UncoupledConstraintCorrection(sofa::co , d_verbose(initData(&d_verbose, false, "verbose", "Dump the constraint matrix at each iteration") ) , d_correctionVelocityFactor(initData(&d_correctionVelocityFactor, (Real)1.0, "correctionVelocityFactor", "Factor applied to the constraint forces when correcting the velocities")) , d_correctionPositionFactor(initData(&d_correctionPositionFactor, (Real)1.0, "correctionPositionFactor", "Factor applied to the constraint forces when correcting the positions")) - , d_useOdeSolverIntegrationFactors(initData(&d_useOdeSolverIntegrationFactors, true, "useOdeSolverIntegrationFactors", "Use odeSolver integration factors instead of correctionVelocityFactor and correctionPositionFactor")) + , d_useIntegrationSchemeIntegrationFactors(initData(&d_useIntegrationSchemeIntegrationFactors, true, "useIntegrationSchemeIntegrationFactors", "Use odeSolver integration factors instead of correctionVelocityFactor and correctionPositionFactor")) , l_topology(initLink("topology", "link to the topology container")) - , m_pOdeSolver(nullptr) + , m_pIntegrationScheme(nullptr) { + d_useOdeSolverIntegrationFactors.setOriginalData(&d_useIntegrationSchemeIntegrationFactors); + this->addAlias(&d_useIntegrationSchemeIntegrationFactors, "useOdeSolverIntegrationFactors"); // Check defaultCompliance and entries of the compliance vector are not zero core::objectmodel::Base::addUpdateCallback("checkNonZeroComplianceInput", {&d_defaultCompliance, &d_compliance}, [this](const core::DataTracker& t) { @@ -258,15 +260,15 @@ void UncoupledConstraintCorrection::init() msg_info() << "\'defaultCompliance\' data is used: " << d_defaultCompliance.getValue(); } - this->getContext()->get(m_pOdeSolver); - if (!m_pOdeSolver) + this->getContext()->get(m_pIntegrationScheme); + if (!m_pIntegrationScheme) { - if (d_useOdeSolverIntegrationFactors.getValue() == true) + if (d_useIntegrationSchemeIntegrationFactors.getValue() == true) { msg_error() << "Can't find any odeSolver"; - d_useOdeSolverIntegrationFactors.setValue(false); + d_useIntegrationSchemeIntegrationFactors.setValue(false); } - d_useOdeSolverIntegrationFactors.setReadOnly(true); + d_useIntegrationSchemeIntegrationFactors.setReadOnly(true); } this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); @@ -361,10 +363,10 @@ void UncoupledConstraintCorrection::addComplianceInConstraintSpace(co VecReal comp = d_compliance.getValue(); Real comp0 = d_defaultCompliance.getValue(); const bool verbose = d_verbose.getValue(); - const bool useOdeIntegrationFactors = d_useOdeSolverIntegrationFactors.getValue(); - // use the OdeSolver to get the position integration factor + const bool useOdeIntegrationFactors = d_useIntegrationSchemeIntegrationFactors.getValue(); + // use the IntegrationScheme to get the position integration factor const SReal factor = useOdeIntegrationFactors ? - core::behavior::BaseConstraintCorrection::correctionFactor(m_pOdeSolver, cparams->constOrder()) + core::behavior::BaseConstraintCorrection::correctionFactor(m_pIntegrationScheme, cparams->constOrder()) : 1.0; comp0 *= Real(factor); @@ -523,10 +525,10 @@ void UncoupledConstraintCorrection::applyMotionCorrection(const core: const VecCoord& x_free = cparams->readX(this->mstate.get())->getValue(); const VecDeriv& v_free = cparams->readV(this->mstate.get())->getValue(); - const bool useOdeIntegrationFactors = d_useOdeSolverIntegrationFactors.getValue(); + const bool useOdeIntegrationFactors = d_useIntegrationSchemeIntegrationFactors.getValue(); - const Real xFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); - const Real vFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getVelocityIntegrationFactor()) : (Real)(this->d_correctionVelocityFactor.getValue() / this->getContext()->getDt()); + const Real xFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); + const Real vFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getVelocityIntegrationFactor()) : (Real)(this->d_correctionVelocityFactor.getValue() / this->getContext()->getDt()); for (unsigned int i = 0; i < dx.size(); i++) { @@ -555,9 +557,9 @@ void UncoupledConstraintCorrection::applyPositionCorrection(const cor const VecCoord& x_free = cparams->readX(this->mstate.get())->getValue(); - const bool useOdeIntegrationFactors = d_useOdeSolverIntegrationFactors.getValue(); + const bool useOdeIntegrationFactors = d_useIntegrationSchemeIntegrationFactors.getValue(); - const Real xFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); + const Real xFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); for (unsigned int i = 0; i < dx.size(); i++) { @@ -583,9 +585,9 @@ void UncoupledConstraintCorrection::applyVelocityCorrection(const cor const VecDeriv& v_free = cparams->readV(this->mstate.get())->getValue(); - const bool useOdeIntegrationFactors = d_useOdeSolverIntegrationFactors.getValue(); + const bool useOdeIntegrationFactors = d_useIntegrationSchemeIntegrationFactors.getValue(); - const Real vFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getVelocityIntegrationFactor()) : this->d_correctionVelocityFactor.getValue(); + const Real vFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getVelocityIntegrationFactor()) : this->d_correctionVelocityFactor.getValue(); for (unsigned int i = 0; i < dx.size(); i++) { @@ -639,10 +641,10 @@ void UncoupledConstraintCorrection::applyContactForce(const linearalg const VecDeriv& v_free = this->mstate->read(core::vec_id::read_access::freeVelocity)->getValue(); const VecCoord& x_free = this->mstate->read(core::vec_id::read_access::freePosition)->getValue(); - const bool useOdeIntegrationFactors = d_useOdeSolverIntegrationFactors.getValue(); + const bool useOdeIntegrationFactors = d_useIntegrationSchemeIntegrationFactors.getValue(); - const Real xFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); - const Real vFactor = useOdeIntegrationFactors ? Real(m_pOdeSolver->getVelocityIntegrationFactor()) : (Real)(this->d_correctionVelocityFactor.getValue() / this->getContext()->getDt()); + const Real xFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getPositionIntegrationFactor()) : this->d_correctionPositionFactor.getValue(); + const Real vFactor = useOdeIntegrationFactors ? Real(m_pIntegrationScheme->getVelocityIntegrationFactor()) : (Real)(this->d_correctionVelocityFactor.getValue() / this->getContext()->getDt()); // Euler integration... will be done in the "integrator" as soon as it exists ! dx.resize(v.size()); diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/tests/UncoupledConstraintCorrection_test.cpp b/Sofa/Component/Constraint/Lagrangian/Correction/tests/UncoupledConstraintCorrection_test.cpp index 22a0d8d1f22..9b53d100c47 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/tests/UncoupledConstraintCorrection_test.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Correction/tests/UncoupledConstraintCorrection_test.cpp @@ -47,7 +47,7 @@ struct UncoupledConstraintCorrection_test: public BaseSimulationTest " \n" " \n" " \n" - " \n" + " \n" " \n" "\n" ); diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.h index 22f083180c3..430701c0164 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.h +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include namespace sofa::component::constraint::lagrangian::model diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.h index 1f506e3319f..b4d4d8cc6c3 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.h +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace sofa::component::constraint::lagrangian::model { diff --git a/Sofa/Component/Constraint/Lagrangian/Model/tests/scenes_test/BilateralInteractionConstraint.scn b/Sofa/Component/Constraint/Lagrangian/Model/tests/scenes_test/BilateralInteractionConstraint.scn index dada2fe376d..057b3290686 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/tests/scenes_test/BilateralInteractionConstraint.scn +++ b/Sofa/Component/Constraint/Lagrangian/Model/tests/scenes_test/BilateralInteractionConstraint.scn @@ -19,7 +19,7 @@ - + diff --git a/Sofa/Component/Constraint/Projective/tests/CMakeLists.txt b/Sofa/Component/Constraint/Projective/tests/CMakeLists.txt index 9abb696938b..8b943f1ab72 100644 --- a/Sofa/Component/Constraint/Projective/tests/CMakeLists.txt +++ b/Sofa/Component/Constraint/Projective/tests/CMakeLists.txt @@ -15,7 +15,7 @@ set(SOURCE_FILES add_executable(${PROJECT_NAME} ${SOURCE_FILES}) target_link_libraries(${PROJECT_NAME} Sofa.Testing Sofa.Component.Topology.Testing SceneCreator) -target_link_libraries(${PROJECT_NAME} Sofa.Component.Constraint.Projective Sofa.Component.StateContainer Sofa.Component.Topology.Container.Dynamic Sofa.Component.Mass Sofa.Component.SolidMechanics.Spring Sofa.Component.MechanicalLoad Sofa.Component.LinearSolver.Iterative Sofa.Component.ODESolver.Backward Sofa.Component.Engine.Select) +target_link_libraries(${PROJECT_NAME} Sofa.Component.Constraint.Projective Sofa.Component.StateContainer Sofa.Component.Topology.Container.Dynamic Sofa.Component.Mass Sofa.Component.SolidMechanics.Spring Sofa.Component.MechanicalLoad Sofa.Component.LinearSolver.Iterative Sofa.Component.IntegrationScheme.Backward Sofa.Component.Engine.Select) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/Sofa/Component/Constraint/Projective/tests/FixedProjectiveConstraint_test.cpp b/Sofa/Component/Constraint/Projective/tests/FixedProjectiveConstraint_test.cpp index 9ba4d234576..d3f05636f3f 100644 --- a/Sofa/Component/Constraint/Projective/tests/FixedProjectiveConstraint_test.cpp +++ b/Sofa/Component/Constraint/Projective/tests/FixedProjectiveConstraint_test.cpp @@ -82,8 +82,8 @@ struct FixedProjectiveConstraint_test : public BaseTest root->setGravity( type::Vec3(0,0,0) ); simpleapi::createObject(root , "RequiredPlugin", {{"pluginName", Sofa.Component.LinearSolver.Direct}}) ; - simpleapi::createObject(root , "RequiredPlugin", {{"pluginName", Sofa.Component.ODESolver.Forward}}) ; - simpleapi::createObject(root , "RequiredPlugin", {{"pluginName", Sofa.Component.ODESolver.Backward}}) ; + simpleapi::createObject(root , "RequiredPlugin", {{"pluginName", Sofa.Component.IntegrationScheme.Forward}}) ; + simpleapi::createObject(root , "RequiredPlugin", {{"pluginName", Sofa.Component.IntegrationScheme.Backward}}) ; simulation::Node::SPtr node = createEulerSolverNode(root,"test", integrationScheme); diff --git a/Sofa/Component/Constraint/Projective/tests/PartialFixedProjectiveConstraint_test.cpp b/Sofa/Component/Constraint/Projective/tests/PartialFixedProjectiveConstraint_test.cpp index 10f6897e0c2..e89bd9bd7e2 100644 --- a/Sofa/Component/Constraint/Projective/tests/PartialFixedProjectiveConstraint_test.cpp +++ b/Sofa/Component/Constraint/Projective/tests/PartialFixedProjectiveConstraint_test.cpp @@ -72,7 +72,7 @@ struct PartialFixedProjectiveConstraint_test : public BaseSimulationTest const simulation::Node::SPtr root = simulation->createNewGraph("root"); root->setGravity( type::Vec3(0,0,0) ); - simulation::Node::SPtr node = createEulerSolverNode(root,"EulerExplicitSolver", integrationScheme); + simulation::Node::SPtr node = createEulerSolverNode(root,"EulerExplicitIntegrationScheme", integrationScheme); mstate = New >(); mstate->resize(1); diff --git a/Sofa/Component/Diffusion/tests/scenes/TetrahedronDiffusionFEMForceField.scn b/Sofa/Component/Diffusion/tests/scenes/TetrahedronDiffusionFEMForceField.scn index 304accb6bf5..49363435470 100644 --- a/Sofa/Component/Diffusion/tests/scenes/TetrahedronDiffusionFEMForceField.scn +++ b/Sofa/Component/Diffusion/tests/scenes/TetrahedronDiffusionFEMForceField.scn @@ -6,7 +6,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/Sofa/Component/Haptics/tests/scenes/ToolvsFloorCollision_test.scn b/Sofa/Component/Haptics/tests/scenes/ToolvsFloorCollision_test.scn index 797bdc5b433..35b17600f5c 100644 --- a/Sofa/Component/Haptics/tests/scenes/ToolvsFloorCollision_test.scn +++ b/Sofa/Component/Haptics/tests/scenes/ToolvsFloorCollision_test.scn @@ -13,7 +13,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/Sofa/Component/IntegrationScheme/Backward/CMakeLists.txt b/Sofa/Component/IntegrationScheme/Backward/CMakeLists.txt new file mode 100644 index 00000000000..0db81573bf2 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 3.22) +project(Sofa.Component.IntegrationScheme.Backward LANGUAGES CXX) + +set(SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR "src/sofa/component/integrationscheme/backward") + +set(HEADER_FILES + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/config.h.in + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/init.h + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/EulerImplicitIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/NewmarkIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/LinearMultistepIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/BDFIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/StaticEquilibriumIntegrationScheme.h +) + +set(DEPRECATED_HEADER_FILES + compat/sofa/component/odesolver/backward/EulerImplicitSolver.h + compat/sofa/component/odesolver/backward/NewmarkImplicitSolver.h + compat/sofa/component/odesolver/backward/StaticSolver.h + compat/sofa/component/odesolver/backward/BDFOdeSolver.h + compat/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h +) + +set(SOURCE_FILES + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/init.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/EulerImplicitIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/NewmarkIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/LinearMultistepIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/BDFIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEBACKWARD_SOURCE_DIR}/StaticEquilibriumIntegrationScheme.cpp +) + +sofa_find_package(Sofa.Simulation.Core REQUIRED) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${DEPRECATED_HEADER_FILES}) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ +) + +sofa_create_package_with_targets( + PACKAGE_NAME ${PROJECT_NAME} + PACKAGE_VERSION ${Sofa_VERSION} + TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES + INCLUDE_SOURCE_DIR "src" + INCLUDE_INSTALL_DIR "${PROJECT_NAME}" +) + +install(DIRECTORY compat/ DESTINATION include/${PROJECT_NAME}_compat COMPONENT headers) + +# CMake-level compat: redirect find_package(Sofa.Component.ODESolver.Backward) with an error +configure_package_config_file( + compat/Sofa.Component.ODESolver.BackwardConfig.cmake.in + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolver.BackwardConfig.cmake" + INSTALL_DESTINATION "lib/cmake/Sofa.Component.ODESolver.Backward" +) +install(FILES + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolver.BackwardConfig.cmake" + DESTINATION "lib/cmake/Sofa.Component.ODESolver.Backward" + COMPONENT headers +) + + diff --git a/Sofa/Component/ODESolver/Backward/Sofa.Component.ODESolver.BackwardConfig.cmake.in b/Sofa/Component/IntegrationScheme/Backward/Sofa.Component.IntegrationScheme.BackwardConfig.cmake.in similarity index 100% rename from Sofa/Component/ODESolver/Backward/Sofa.Component.ODESolver.BackwardConfig.cmake.in rename to Sofa/Component/IntegrationScheme/Backward/Sofa.Component.IntegrationScheme.BackwardConfig.cmake.in diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/Sofa.Component.ODESolver.BackwardConfig.cmake.in b/Sofa/Component/IntegrationScheme/Backward/compat/Sofa.Component.ODESolver.BackwardConfig.cmake.in new file mode 100644 index 00000000000..193618d4acc --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/Sofa.Component.ODESolver.BackwardConfig.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +message(FATAL_ERROR + "[SOFA v26.06] Sofa.Component.ODESolver.Backward has been renamed to " + "Sofa.Component.IntegrationScheme.Backward.\n" + "Please replace:\n" + " find_package(Sofa.Component.ODESolver.Backward)\n" + "with:\n" + " find_package(Sofa.Component.IntegrationScheme.Backward)\n" + "in your CMakeLists.txt. " + "This package will be fully removed in v27.06." +) diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BDFOdeSolver.h b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BDFOdeSolver.h new file mode 100644 index 00000000000..df1f4279a7a --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BDFOdeSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/backward/BDFIntegrationScheme.h") + +namespace sofa::component::odesolver::backward +{ +using BDFOdeSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::backward::BDFOdeSolver has been renamed to " + "sofa::component::integrationscheme::backward::BDFIntegrationScheme") + = sofa::component::integrationscheme::backward::BDFIntegrationScheme; +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h new file mode 100644 index 00000000000..ed6e132b09b --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.h") + +namespace sofa::component::odesolver::backward +{ +using BaseLinearMultiStepMethod SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::backward::BaseLinearMultiStepMethod has been renamed to " + "sofa::component::integrationscheme::backward::LinearMultistepIntegrationScheme") + = sofa::component::integrationscheme::backward::LinearMultistepIntegrationScheme; +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/EulerImplicitSolver.h b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/EulerImplicitSolver.h new file mode 100644 index 00000000000..b11732fee06 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/EulerImplicitSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.h") + +namespace sofa::component::odesolver::backward +{ +using EulerImplicitSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::backward::EulerImplicitSolver has been renamed to " + "sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme") + = sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme; +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/NewmarkImplicitSolver.h b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/NewmarkImplicitSolver.h new file mode 100644 index 00000000000..9ed0f6e4f22 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/NewmarkImplicitSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.h") + +namespace sofa::component::odesolver::backward +{ +using NewmarkImplicitSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::backward::NewmarkImplicitSolver has been renamed to " + "sofa::component::integrationscheme::backward::NewmarkIntegrationScheme") + = sofa::component::integrationscheme::backward::NewmarkIntegrationScheme; +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/StaticSolver.h b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/StaticSolver.h new file mode 100644 index 00000000000..ae5ebee47c0 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/compat/sofa/component/odesolver/backward/StaticSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.h") + +namespace sofa::component::odesolver::backward +{ +using StaticSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::backward::StaticSolver has been renamed to " + "sofa::component::integrationscheme::backward::StaticEquilibriumIntegrationScheme") + = sofa::component::integrationscheme::backward::StaticEquilibriumIntegrationScheme; +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.cpp new file mode 100644 index 00000000000..eca97caea23 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.cpp @@ -0,0 +1,87 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include + +#include + + +namespace sofa::component::integrationscheme::backward +{ + +using core::VecId; +using namespace sofa::defaulttype; +using namespace core::behavior; + +void BDFIntegrationScheme::computeFactors() + +{ + assert(m_samples.size() > 1); + const auto order =m_samples.size() - 1; + assert(order >= 1); + + m_aFactors.resize(order+1); + m_bFactors.resize(order+1); + + /** + * Computation of the derivative of the Lagrange inteperpolation polynomials + */ + for (std::size_t j = 0; j < order+1; ++j) + { + auto& a_j = m_aFactors[j]; + + m_bFactors[j] = (j == order) ? 1.0 : 0.0; + + a_j = 0; + for (std::size_t i = 0; i < order+1; ++i) + { + if (i != j) + { + SReal product = 1_sreal; + for (std::size_t m = 0; m < order + 1; ++m) + { + if (m != i && m != j) + { + product *= (m_samples[order] - m_samples[m]) / (m_samples[j] - m_samples[m]); + } + } + a_j += product / (m_samples[j] - m_samples[i]); + } + } + } + for (SReal& j : m_aFactors) + { + j *= m_dt; + } +} + + +void registerBDFIntegrationScheme(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Time integrator using implicit backward Euler scheme.") + .add< BDFIntegrationScheme >()); +} + +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.h similarity index 68% rename from Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.h rename to Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.h index fc80f9d16de..ad6b6bb4841 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.h +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/BDFIntegrationScheme.h @@ -20,29 +20,34 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once +#include +#include +#include +#include +#include +#include -#include -#include - -namespace sofa::component::odesolver::backward +namespace sofa::simulation::common +{ +class VectorOperations; +} +namespace sofa::component::integrationscheme::backward { -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API BDFOdeSolver : - public BaseLinearMultiStepMethod + +class SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API BDFIntegrationScheme : + public LinearMultistepIntegrationScheme { public: - SOFA_CLASS(BDFOdeSolver, BaseLinearMultiStepMethod); + SOFA_CLASS(BDFIntegrationScheme, LinearMultistepIntegrationScheme); - static void computeLinearMultiStepCoefficients(const std::deque& samples, - sofa::type::vector& a_coef, sofa::type::vector& b_coef); + BDFIntegrationScheme() = default; protected: - void recomputeCoefficients(std::size_t order, SReal dt) override; - - BDFOdeSolver(); + virtual void computeFactors() override; }; -} +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.cpp new file mode 100644 index 00000000000..71421d6a47e --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.cpp @@ -0,0 +1,88 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include + +#include + + +namespace sofa::component::integrationscheme::backward +{ + +using core::VecId; +using namespace sofa::defaulttype; +using namespace core::behavior; + +EulerImplicitIntegrationScheme::EulerImplicitIntegrationScheme() + : d_trapezoidalScheme( initData(&d_trapezoidalScheme,false,"trapezoidalScheme","Boolean to use the trapezoidal scheme instead of the implicit Euler scheme and get second order accuracy in time (false by default)") ) +{ + +} + + + +SReal EulerImplicitIntegrationScheme::getPositionUpdateDerivedFromVelocity() const +{ + return d_trapezoidalScheme.getValue() ? m_dt/2.0 : m_dt ; +} + +SReal EulerImplicitIntegrationScheme::getInverseVelocityUpdateDerivedFromVelocity() const +{ + return 1.0/m_dt; +} + +//Compute the error made on the position integration equation : x_{t+h} - g_x(v), with v the current estimate of velocity +void EulerImplicitIntegrationScheme::computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecCoordId& position, const sofa::core::MultiVecDerivId& velocity) +{ + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq(position,m_x0[0], -1); + + if ( d_trapezoidalScheme.getValue()) + { + res.peq(m_v0[0], -m_dt/2.0); + res.peq(velocity, -m_dt/2.0); + } + else + { + res.peq(velocity, -m_dt); + } +} + +//Compute the acceleration from current value of velocity. This is the implementation of the inverse integration scheme for the velocity +void EulerImplicitIntegrationScheme::computeAccelerationFromVelocity(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity) +{ + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq(velocity,m_v0[0], -1); + res.teq( 1/m_dt); +} + + +void registerEulerImplicitIntegrationScheme(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Time integrator using implicit backward Euler scheme.") + .add< EulerImplicitIntegrationScheme >()); +} + +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.h new file mode 100644 index 00000000000..bb00f0f3215 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/EulerImplicitIntegrationScheme.h @@ -0,0 +1,130 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include +#include +#include + +#include +#include +#include + +namespace sofa::simulation::common +{ +class VectorOperations; +} +namespace sofa::component::integrationscheme::backward +{ + +/** Semi-implicit time integrator using backward Euler scheme for first and second degree ODEs. (default: second) + * + *** 2nd Order *** + * + * This is based on [Baraff and Witkin, Large Steps in Cloth Simulation, SIGGRAPH 1998] + * The integration scheme is based on the following equations: + * + * \f$x_{t+h} = x_t + h v_{t+h}\f$ + * \f$v_{t+h} = v_t + h a_{t+h}\f$ + * + * The unknown is + * \f$v_{t+h} - v_t = dv\f$ + * + * Newton's law is + * \f$ M dv = h f(t+h) \f$ + * \f$ M dv = h ( f(t) + K dx + (B - r_M M + r_K K) (v+dv) )\f$ + * \f$ M dv = h ( f(t) + K h (v+dv) + (B - r_M M + r_K K) (v+dv) )\f$ + * + * \f$ M \f$ is the mass matrix. + * \f$ K = df/dx \f$ is the stiffness implemented (or not) by the force fields. + * \f$ B = df/dv \f$ is the damping implemented (or not) by the force fields. + * An additional, uniform Rayleigh damping \f$- r_M M + r_K K\f$ is imposed by the solver. + * + * This corresponds to the following equation system: + * + * \f$ ( (1+h r_M) M - h B - h(h + r_K) K ) dv = h ( f(t) + (h+r_K) K v + B v - r_M M v )\f$ + * + * Moreover, the projective constraints filter out the forbidden motions. + * This is equivalent with multiplying vectors with a projection matrix \f$P\f$. + * Finally, the equation system set by this ode solver is: + * + * \f$ P ( (1+h r_M) M - h B - h(h + r_K) K ) P dv = P h ( f(t) + (h + r_K) K v + B v - r_M M v )\f$ + * + *** 1st Order *** + * + * This integration scheme is based on the following equation: + * + * \f$x_{t+h} = x_t + h v_{t+h}\f$ + * + * Applied to this mechanical system: + * + * \f$ M v_t = f_{ext} \f$ + * + * \f$ M v_{t+h} = f_{ext_{t+h}} \f$ + * \f$ = f_{ext_{t}} + h (df_{ext}/dt)_{t+h} \f$ + * \f$ = f_{ext_{t}} + h (df_{ext}/dx)_{t+h} v_{t+h} \f$ + * \f$ = f_{ext_{t}} - h K v_{t+h} \f$ + * + * \f$ ( M + h K ) v_{t+h} = f_{ext} \f$ + * + * + *** Trapezoidal Rule *** + * + * The trapezoidal scheme is based on + * + * \f$v_{t+h} = h/2 ( f(t+h) + f(t) )\f$ + * + * With this and the same techniques as for the implicit Euler scheme we receive for *** 2nd Order *** equations + * + * \f$ P ( (1+h/2 r_M) M - h/2 B - h/2 (h + r_K) K ) P dv = P h/2 ( 2 f(t) + (h + r_K) K v + B v - r_M M v )\f$ + * + * and for *** 1st Order *** + * + * \f$ ( M + h/2 K ) v_{t+h} = f_{ext} \f$ + * + */ +class SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API EulerImplicitIntegrationScheme : + public sofa::simulation::integrationscheme::VelocityBasedImplicitIntegrationScheme +{ +public: + SOFA_CLASS(EulerImplicitIntegrationScheme, sofa::simulation::integrationscheme::VelocityBasedImplicitIntegrationScheme); + + Data d_trapezoidalScheme; ///< Boolean to use the trapezoidal scheme instead of the implicit Euler scheme and get second order accuracy in time (false by default) + +protected: + EulerImplicitIntegrationScheme(); + + virtual SReal getPositionUpdateDerivedFromVelocity() const; + virtual SReal getInverseVelocityUpdateDerivedFromVelocity() const; + + //Compute the error made on the position integration equation : x_{t+h} - g_x(v), with v the current estimates of velocity + virtual void computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecCoordId& position, const sofa::core::MultiVecDerivId& velocity); + //Compute the acceleration from current value of velocity. This is the implementation of the inverse integration scheme for the velocity + virtual void computeAccelerationFromVelocity(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity); + + virtual Size getIntegrationSchemeTimeOrder() const override + { + return 1; + } + +}; + +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.cpp new file mode 100644 index 00000000000..198f17efd55 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.cpp @@ -0,0 +1,111 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include + +#include + + +namespace sofa::component::integrationscheme::backward +{ + +using core::VecId; +using namespace sofa::defaulttype; +using namespace core::behavior; + +LinearMultistepIntegrationScheme::LinearMultistepIntegrationScheme() +: d_order(initData(&d_order,Size(2),"order","Order of the Backward Differential Formula.") ) +{ } + +void LinearMultistepIntegrationScheme::init() +{ + Inherit1::init(); + if (d_order.getValue() == 0) + { + msg_error()<<"Order cannot be null"; + d_componentState.setValue(core::objectmodel::ComponentState::Invalid); + } +} + +void LinearMultistepIntegrationScheme::doSetupIntegrationStep(const core::ExecParams* params, SReal dt, + sofa::core::MultiVecCoordId xResult, + sofa::core::MultiVecDerivId vResult) +{ + Inherit1::doSetupIntegrationStep(params, dt, xResult, vResult); + + if (m_samples.empty()) + { + for (unsigned i = 0; i < d_order.getValue() + 1; i++) + m_samples.push_front(- i * m_dt); + } + + m_samples.pop_front(); + m_samples.push_back(m_samples.back() + m_dt); + + computeFactors (); +} + +SReal LinearMultistepIntegrationScheme::getPositionUpdateDerivedFromVelocity() const +{ + return m_dt * m_bFactors[d_order.getValue()] / m_aFactors[d_order.getValue()]; +} + +SReal LinearMultistepIntegrationScheme::getInverseVelocityUpdateDerivedFromVelocity() const +{ + return 1.0 / m_dt ; +} + +//Compute the error made on the position integration equation : x_{t+h} - g_x(v), with v the current estimate of velocity +void LinearMultistepIntegrationScheme::computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecCoordId& position, const sofa::core::MultiVecDerivId& velocity) +{ + + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq(velocity, - m_dt * m_bFactors[d_order.getValue()]/ m_aFactors[d_order.getValue()]); + for (unsigned i = 0; i < d_order.getValue(); i++) + { + if ( fabs(m_bFactors[i]) > std::numeric_limits::epsilon()) + res.peq(m_v0[i], - m_dt * m_bFactors[i]/m_aFactors[d_order.getValue()]); + } + for (unsigned i = 0; i < d_order.getValue(); i++) + { + //TODO How does that work in practice ? Deriv += f * Coord + res.peq(m_x0[i], m_aFactors[i]/m_aFactors[d_order.getValue()]); + } + res.peq(position); + +} +//Compute the acceleration from current value of velocity. This is the implementation of the inverse integration scheme for the velocity +void LinearMultistepIntegrationScheme::computeAccelerationFromVelocity(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity) +{ + + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq(velocity, 1/m_dt); + res.peq(m_v0[d_order.getValue() - 1], -1/m_dt); + +} + + + +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.h new file mode 100644 index 00000000000..cefbdeb1fc6 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/LinearMultistepIntegrationScheme.h @@ -0,0 +1,73 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include +#include +#include +#include +#include +#include + + +namespace sofa::simulation::common +{ +class VectorOperations; +} +namespace sofa::component::integrationscheme::backward +{ + + +class SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API LinearMultistepIntegrationScheme : + public sofa::simulation::integrationscheme::VelocityBasedImplicitIntegrationScheme +{ +public: + SOFA_CLASS(LinearMultistepIntegrationScheme, sofa::simulation::integrationscheme::VelocityBasedImplicitIntegrationScheme); + core::objectmodel::Data d_order; + + LinearMultistepIntegrationScheme(); + + virtual void init() override; + virtual void doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + virtual SReal getPositionUpdateDerivedFromVelocity() const override; + virtual SReal getInverseVelocityUpdateDerivedFromVelocity() const override; + + //Compute the position update from current value of velocity : dX = g_x(v_i) - x_t + virtual void computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecCoordId& position,const sofa::core::MultiVecDerivId& velocity) override; + //Compute the acceleration from current value of velocity. This is the implementation of the inverse integration scheme for the velocity + virtual void computeAccelerationFromVelocity(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity) override; + +protected: + virtual sofa::Size getIntegrationSchemeTimeOrder() const override + { + return d_order.getValue(); + } + + virtual void computeFactors() = 0; + + std::vector m_aFactors; + std::vector m_bFactors; + std::deque m_samples; + +}; + +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.cpp new file mode 100644 index 00000000000..1517e7aaeb7 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.cpp @@ -0,0 +1,83 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include + +#include + + +namespace sofa::component::integrationscheme::backward +{ + +using core::VecId; +using namespace sofa::defaulttype; +using namespace core::behavior; + +NewmarkIntegrationScheme::NewmarkIntegrationScheme() +: d_beta(initData(&d_beta,0.25,"beta","Factor controlling the 'implicitness' of the position computation with respect to the acceleration. 0.0 means explicit central difference, 1.0/0.6 means linear accelerations scheme") ) +, d_gamma(initData(&d_gamma,0.5,"gamma","Factor controlling the 'implicitness' of the velocity computation with respect to the acceleration. To insure unconditional stability, gamma must belong to [2*beta, 1/2]. ") ) +{ } + +SReal NewmarkIntegrationScheme::getPositionUpdateDerivedFromAcceleration() const +{ + return m_dt * m_dt * d_beta.getValue(); +} + +SReal NewmarkIntegrationScheme::getPositionUpdateDerivedFromVelocity() const +{ + return 0.0; +} + +SReal NewmarkIntegrationScheme::getVelocityUpdateDerivedFromAcceleration() const +{ + return m_dt * d_gamma.getValue(); +} + + +void NewmarkIntegrationScheme::computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity, const sofa::core::MultiVecDerivId& acceleration) +{ + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq(m_xResult,m_x0[0], -1); + res.peq(m_v0[0], -m_dt); + res.peq(acceleration, -m_dt * m_dt * d_beta.getValue() ); + res.peq(m_a0[0], -m_dt * m_dt * (0.5 - d_beta.getValue()) ); +} + +void NewmarkIntegrationScheme::computeCurrentVelocityIntegrationError(sofa::simulation::common::VectorOperations & vop, const sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& acceleration) +{ + sofa::core::behavior::MultiVecDeriv res(&vop, result ); + res.eq( m_vResult, m_v0[0], -1); + res.peq(acceleration, -m_dt * d_gamma.getValue() ); + res.peq(m_a0[0], -m_dt * (1.0 - d_gamma.getValue()) ); +} + + +void registerNewmarkIntegrationScheme(sofa::core::ObjectFactory* factory) +{ + factory->registerObjects(core::ObjectRegistrationData("Time integrator using implicit backward Euler scheme.") + .add< NewmarkIntegrationScheme >()); +} + +} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.h new file mode 100644 index 00000000000..6938a232e9c --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/NewmarkIntegrationScheme.h @@ -0,0 +1,65 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include +#include +#include +#include +#include +#include "sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.h" + +namespace sofa::simulation::common +{ +class VectorOperations; +} +namespace sofa::component::integrationscheme::backward +{ + + +class SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API NewmarkIntegrationScheme : + public sofa::simulation::integrationscheme::AccelerationBasedImplicitIntegrationScheme +{ +public: + SOFA_CLASS(NewmarkIntegrationScheme, sofa::simulation::integrationscheme::AccelerationBasedImplicitIntegrationScheme); + + core::objectmodel::Data d_beta; + core::objectmodel::Data d_gamma; + +protected: + NewmarkIntegrationScheme(); + + SReal getPositionUpdateDerivedFromAcceleration() const override; + SReal getPositionUpdateDerivedFromVelocity() const override; + SReal getVelocityUpdateDerivedFromAcceleration() const override; + + //Compute the error made on the position integration equation : x_{t+h} - g_x(v,a), with v and a the current estimates of velocity and acceleration + virtual void computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity, const sofa::core::MultiVecDerivId& acceleration); + //Compute the error made on the position integration equation : v_{t+h} - g_v(a), with a the current estimate of acceleration + virtual void computeCurrentVelocityIntegrationError(sofa::simulation::common::VectorOperations & vop, const sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& acceleration) ; + + virtual Size getIntegrationSchemeTimeOrder() const override + { + return 1; + } +}; + +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.cpp new file mode 100644 index 00000000000..4f45d477888 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.cpp @@ -0,0 +1,277 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor; + + +namespace sofa::component::integrationscheme::backward +{ + +StaticEquilibriumIntegrationScheme::StaticEquilibriumIntegrationScheme() +: d_maxNbIterationsNewton(initData(&d_maxNbIterationsNewton, static_cast(10) , "maxNbIterationsNewton", "Maximum number of iteration for the Newton algorithm")) +, d_maxNbIterationsLineSearch(initData(&d_maxNbIterationsLineSearch, static_cast(1), "maxNbIterationsLineSearch", "Maximum number of iteration for the backtracking linesearch algorithm")) +, d_newtonStepSize(initData(&d_newtonStepSize, 1.0_sreal , "newtonStepSize", "Size of the first newton step before the linesearch")) +, d_lineSearchReductionRate(initData(&d_lineSearchReductionRate, 0.5_sreal , "lineSearchReductionRate", "Taken in [0,1[ representing the fraction of diminution of the step done in the backtracking line search (if set to 0.3, the first line search will reduce the step from 1.0 to 0.7)")) +, d_lineSearchArmijoFactor(initData(&d_lineSearchArmijoFactor, 1e-3_sreal , "lineSearchArmijoFactor", "Taken in [0,1[ it represents a tolerance on the residue in term of the linear approximation. e.g., for a value of 0.01, it means we want the solution to decrease the residue as much as 0.01 times the linear approximation in the same direction.")) +, d_residueThreshold(initData(&d_residueThreshold, 1e-9_sreal , "residueThreshold", "Threshold under which, the residue is considered to be sufficiently low. Newton algorithm will stop after reaching a lower value")) +, d_currentResidue(initData(&d_currentResidue , "currentResidue", "Current value of the residue")) +, d_alwaysAdvanceNewton(initData(&d_alwaysAdvanceNewton , false, "alwaysAdvanceNewton", "Even if the linesearch didn't find a better solution than the current one, take the best one along the path that is not the current guess.")) +{ } + +void StaticEquilibriumIntegrationScheme::doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + simulation::common::VectorOperations::realloc(*m_vop, m_unknown, "dx", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_r0, "r0", this, true); +} + +/** + * Compute the system matrix. + */ +void StaticEquilibriumIntegrationScheme::computeLHS(bool firstIteration) +{ + SOFA_UNUSED(firstIteration); + + { + + SCOPED_TIMER("setSystemMBKMatrix"); + const core::MatricesFactors::M mFact( 0 ); + const core::MatricesFactors::B bFact( 0 ); + const core::MatricesFactors::K kFact( -1.0 ); + + m_mop->setSystemMBKMatrix(mFact, bFact, kFact, l_linearSolver.get()); + } + +} + +/** +* compute the current RHS. +*/ +void StaticEquilibriumIntegrationScheme::computeRHS(bool firstIteration) +{ + sofa::core::behavior::MultiVecDeriv f(m_vop.get(), core::vec_id::write_access::force ); + f.clear(); + + { + //TODO deal with that. + SCOPED_TIMER("ComputeForce"); + m_mop->mparams.setImplicit(true); // this solver is implicit + // compute the net forces at the beginning of the time step + m_mop->computeForce(m_mappingGraph, f, true, true, nullptr); //f = Kx + Bv + + m_mop->projectResponse(m_mappingGraph,f); // b is projected to the constrained space + + m_vop->v_eq(m_r0,core::vec_id::write_access::force ); + } + +} + + +/** + * Returns the evaluation of the residue + */ +SReal StaticEquilibriumIntegrationScheme::evaluateResidue() +{ + core::behavior::MultiVecDeriv r0(m_vop.get(), m_r0); + + return r0.dot(r0); +} + + +/** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ +void StaticEquilibriumIntegrationScheme::solveLinearEquation() +{ + SCOPED_TIMER("MBKSolve"); + + l_linearSolver->getLinearSystem()->setSystemSolution(m_unknown); + l_linearSolver->getLinearSystem()->setRHS(m_r0); + l_linearSolver->solveSystem(); + l_linearSolver->getLinearSystem()->dispatchSystemSolution(m_unknown); +} + +/** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ +void StaticEquilibriumIntegrationScheme::updateStatesFromLinearSolution(SReal alpha, bool firstIteration) +{ + sofa::core::behavior::MultiVecCoord pos(m_vop.get(), m_xResult); + + pos.peq(m_unknown, alpha ); +} + + + +SReal StaticEquilibriumIntegrationScheme::getVelocityIntegrationFactor() const +{ + return 0.0; +} + + +SReal StaticEquilibriumIntegrationScheme::getPositionIntegrationFactor() const +{ + return 1.0; +} + +sofa::Size StaticEquilibriumIntegrationScheme::getIntegrationSchemeTimeOrder() const +{ + return 1; +} + +void StaticEquilibriumIntegrationScheme::integrate(const core::ExecParams* params, SReal dt, + sofa::core::MultiVecCoordId xResult, + sofa::core::MultiVecDerivId vResult) +{ + //Constify the data values + const unsigned maxNewtonIt = d_maxNbIterationsNewton.getValue(); + const unsigned maxLineSearchIt = d_maxNbIterationsLineSearch.getValue(); + const SReal newtonStepSize = d_newtonStepSize.getValue(); + const SReal residueThreshold = d_residueThreshold.getValue(); + const SReal lineSearchReductionRate = d_lineSearchReductionRate.getValue(); + const SReal lineSearchArmijoFactor = d_lineSearchArmijoFactor.getValue(); + + const bool printLog = f_printLog.getValue(); + + //Setup tue integration step + setupIntegrationStep(params, dt, xResult, vResult); + + //Compute current residual, usefull for static solver to return fast + computeRHS(true); + SReal oldResidue = evaluateResidue(); + SReal newResidue = evaluateResidue(); + + + unsigned it = 0; + while ( itresidueThreshold ) + { + const bool firstIt = it==0; + + if ( ! firstIt ) + { + computeRHS(firstIt); + oldResidue = evaluateResidue(); + } + + double bestresidual = oldResidue; + double bestalpha = 0.0; + + computeLHS(firstIt); + //Find decrease direction + solveLinearEquation(); + + //Setup variables for linesearch + SReal alpha = newtonStepSize; + SReal delta = 0.0; + + //Already make a full step + updateStatesFromLinearSolution(alpha, firstIt); + computeRHS(false); + newResidue = evaluateResidue(); + + //Compute the Armijo term + m_vop->v_dot(m_unknown, m_r0); + const SReal armijoTerm = lineSearchArmijoFactor * m_vop->finish(); + + if (newResidue(oldResidue + alpha*armijoTerm)) && lineSearchIt std::numeric_limits::epsilon() ) + { + updateStatesFromLinearSolution( bestalpha - alpha, false); + computeRHS(false); + newResidue = evaluateResidue(); + } + + if (newResidue>oldResidue) + { + msg_warning()<<"Newton step increased the residual"; + } + + if (printLog) + { + msg_info()<<"Newton step = "<registerObjects(core::ObjectRegistrationData("Time integrator using implicit backward Euler scheme.") + .add< StaticEquilibriumIntegrationScheme >()); +} + +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.h new file mode 100644 index 00000000000..2f7a6cf092e --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/StaticEquilibriumIntegrationScheme.h @@ -0,0 +1,96 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include + +namespace sofa::simulation::common +{ +class MechanicalOperations; +class VectorOperations; +} + +namespace sofa::component::integrationscheme::backward +{ + +class SOFA_SIMULATION_CORE_API StaticEquilibriumIntegrationScheme : + public sofa::simulation::integrationscheme::ImplicitIntegrationScheme +{ +public: + SOFA_ABSTRACT_CLASS(StaticEquilibriumIntegrationScheme, ImplicitIntegrationScheme); + + StaticEquilibriumIntegrationScheme(); + + void doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + /** + * Compute the system matrix. + */ + void computeLHS(bool firstIteration = true) override; + + /** + * compute the current RHS. + */ + void computeRHS(bool firstIteration = true) override; + + /** + * Returns the evaluation of the residue + */ + SReal evaluateResidue() override; + + /** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ + void solveLinearEquation() override; + + /** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ + void updateStatesFromLinearSolution(SReal alpha, bool firstIteration = true) override; + + virtual SReal getVelocityIntegrationFactor() const final; + virtual SReal getPositionIntegrationFactor() const final; + + virtual void integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + Data d_maxNbIterationsNewton; + Data d_maxNbIterationsLineSearch; + Data d_newtonStepSize; + Data d_lineSearchReductionRate; + Data d_lineSearchArmijoFactor; + Data d_residueThreshold; + Data d_currentResidue; + Data d_alwaysAdvanceNewton; + +protected: + + virtual sofa::Size getIntegrationSchemeTimeOrder() const; + +}; + +} // namespace sofa::component::integrationscheme diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/config.h.in similarity index 76% rename from Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in rename to Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/config.h.in index 28eee686445..23dee068346 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/config.h.in @@ -24,23 +24,17 @@ #include #include -#ifdef SOFA_BUILD_SOFA_COMPONENT_ODESOLVER_BACKWARD +#ifdef SOFA_BUILD_SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD # define SOFA_TARGET @PROJECT_NAME@ -# define SOFA_COMPONENT_ODESOLVER_BACKWARD_API SOFA_EXPORT_DYNAMIC_LIBRARY +# define SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API SOFA_EXPORT_DYNAMIC_LIBRARY #else -# define SOFA_COMPONENT_ODESOLVER_BACKWARD_API SOFA_IMPORT_DYNAMIC_LIBRARY +# define SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -namespace sofa::component::odesolver::backward +namespace sofa::component::integrationscheme::backward { constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; -} // namespace sofa::component::odesolver::backward +} // namespace sofa::component::integrationscheme::backward -#ifdef SOFA_BUILD_SOFA_COMPONENT_ODESOLVER_BACKWARD -#define SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() -#else -#define SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() \ - SOFA_ATTRIBUTE_DISABLED("v25.06", "v25.12", "The Data are defined in the NewtonRaphsonSolver component.") -#endif diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.cpp b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.cpp similarity index 77% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.cpp rename to Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.cpp index 6b3331bfe2d..a53281eca5e 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.cpp +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.cpp @@ -19,18 +19,17 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::backward { -extern void registerCentralDifferenceSolver(sofa::core::ObjectFactory* factory); -extern void registerDampVelocitySolver(sofa::core::ObjectFactory* factory); -extern void registerEulerExplicitSolver(sofa::core::ObjectFactory* factory); -extern void registerRungeKutta2Solver(sofa::core::ObjectFactory* factory); -extern void registerRungeKutta4Solver(sofa::core::ObjectFactory* factory); +extern void registerEulerImplicitIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerNewmarkIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerBDFIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerStaticEquilibriumIntegrationScheme(sofa::core::ObjectFactory* factory); extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); @@ -56,11 +55,11 @@ const char* getModuleVersion() void registerObjects(sofa::core::ObjectFactory* factory) { - registerCentralDifferenceSolver(factory); - registerDampVelocitySolver(factory); - registerEulerExplicitSolver(factory); - registerRungeKutta2Solver(factory); - registerRungeKutta4Solver(factory); + registerEulerImplicitIntegrationScheme(factory); + registerNewmarkIntegrationScheme(factory); + registerBDFIntegrationScheme(factory); + registerStaticEquilibriumIntegrationScheme(factory); + } void init() @@ -75,4 +74,4 @@ void init() } } -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.h b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.h similarity index 87% rename from Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.h rename to Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.h index a360d610b7e..20d4bc7654a 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.h +++ b/Sofa/Component/IntegrationScheme/Backward/src/sofa/component/integrationscheme/backward/init.h @@ -21,9 +21,9 @@ ******************************************************************************/ #pragma once -#include +#include -namespace sofa::component::odesolver::backward +namespace sofa::component::integrationscheme::backward { - SOFA_COMPONENT_ODESOLVER_BACKWARD_API void init(); -} // namespace sofa::component::odesolver::backward + SOFA_COMPONENT_INTEGRATIONSCHEME_BACKWARD_API void init(); +} // namespace sofa::component::integrationscheme::backward diff --git a/Sofa/Component/IntegrationScheme/CMakeLists.txt b/Sofa/Component/IntegrationScheme/CMakeLists.txt new file mode 100644 index 00000000000..9f53f462b35 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.22) +project(Sofa.Component.IntegrationScheme LANGUAGES CXX) + +set(SOFACOMPONENTINTEGRATIONSCHEME_SOURCE_DIR "src/sofa/component/integrationscheme") + +sofa_add_subdirectory_modules(SOFACOMPONENTINTEGRATIONSCHEME_TARGETS + DIRECTORIES Forward Backward +) + +set(HEADER_FILES + ${SOFACOMPONENTINTEGRATIONSCHEME_SOURCE_DIR}/config.h.in + ${SOFACOMPONENTINTEGRATIONSCHEME_SOURCE_DIR}/init.h +) + +set(SOURCE_FILES + ${SOFACOMPONENTINTEGRATIONSCHEME_SOURCE_DIR}/init.cpp +) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${SOFACOMPONENTINTEGRATIONSCHEME_TARGETS}) + +sofa_create_package_with_targets( + PACKAGE_NAME ${PROJECT_NAME} + PACKAGE_VERSION ${Sofa_VERSION} + TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES + INCLUDE_SOURCE_DIR "src" + INCLUDE_INSTALL_DIR "${PROJECT_NAME}" +) + +# CMake-level compat: redirect find_package(Sofa.Component.ODESolver) with an error +configure_package_config_file( + compat/Sofa.Component.ODESolverConfig.cmake.in + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolverConfig.cmake" + INSTALL_DESTINATION "lib/cmake/Sofa.Component.ODESolver" +) +install(FILES + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolverConfig.cmake" + DESTINATION "lib/cmake/Sofa.Component.ODESolver" + COMPONENT headers +) + diff --git a/Sofa/Component/IntegrationScheme/Forward/CMakeLists.txt b/Sofa/Component/IntegrationScheme/Forward/CMakeLists.txt new file mode 100644 index 00000000000..ceee410b272 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 3.22) +project(Sofa.Component.IntegrationScheme.Forward LANGUAGES CXX) + +set(SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR "src/sofa/component/integrationscheme/forward") + +set(HEADER_FILES + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/config.h.in + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/init.h + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/RungeKutta2IntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/RungeKutta4IntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/EulerExplicitIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/DampVelocityIntegrationScheme.h + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/CentralDifferenceIntegrationScheme.h +) + +set(DEPRECATED_HEADER_FILES + compat/sofa/component/odesolver/forward/EulerExplicitSolver.h + compat/sofa/component/odesolver/forward/CentralDifferenceSolver.h + compat/sofa/component/odesolver/forward/DampVelocitySolver.h + compat/sofa/component/odesolver/forward/RungeKutta2Solver.h + compat/sofa/component/odesolver/forward/RungeKutta4Solver.h +) + +set(SOURCE_FILES + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/init.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/RungeKutta2IntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/RungeKutta4IntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/EulerExplicitIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/DampVelocityIntegrationScheme.cpp + ${SOFACOMPONENTINTEGRATIONSCHEMEFORWARD_SOURCE_DIR}/CentralDifferenceIntegrationScheme.cpp +) + +sofa_find_package(Sofa.Simulation.Core REQUIRED) + +add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${DEPRECATED_HEADER_FILES}) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core) +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ +) + +sofa_create_package_with_targets( + PACKAGE_NAME ${PROJECT_NAME} + PACKAGE_VERSION ${Sofa_VERSION} + TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES + INCLUDE_SOURCE_DIR "src" + INCLUDE_INSTALL_DIR "${PROJECT_NAME}" +) + +install(DIRECTORY compat/ DESTINATION include/${PROJECT_NAME}_compat COMPONENT headers) + +# CMake-level compat: redirect find_package(Sofa.Component.ODESolver.Forward) with an error +configure_package_config_file( + compat/Sofa.Component.ODESolver.ForwardConfig.cmake.in + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolver.ForwardConfig.cmake" + INSTALL_DESTINATION "lib/cmake/Sofa.Component.ODESolver.Forward" +) +install(FILES + "${CMAKE_BINARY_DIR}/lib/cmake/Sofa.Component.ODESolver.ForwardConfig.cmake" + DESTINATION "lib/cmake/Sofa.Component.ODESolver.Forward" + COMPONENT headers +) + diff --git a/Sofa/Component/ODESolver/Forward/Sofa.Component.ODESolver.ForwardConfig.cmake.in b/Sofa/Component/IntegrationScheme/Forward/Sofa.Component.IntegrationScheme.ForwardConfig.cmake.in similarity index 100% rename from Sofa/Component/ODESolver/Forward/Sofa.Component.ODESolver.ForwardConfig.cmake.in rename to Sofa/Component/IntegrationScheme/Forward/Sofa.Component.IntegrationScheme.ForwardConfig.cmake.in diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/Sofa.Component.ODESolver.ForwardConfig.cmake.in b/Sofa/Component/IntegrationScheme/Forward/compat/Sofa.Component.ODESolver.ForwardConfig.cmake.in new file mode 100644 index 00000000000..8b02ae3cbbe --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/Sofa.Component.ODESolver.ForwardConfig.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +message(FATAL_ERROR + "[SOFA v26.06] Sofa.Component.ODESolver.Forward has been renamed to " + "Sofa.Component.IntegrationScheme.Forward.\n" + "Please replace:\n" + " find_package(Sofa.Component.ODESolver.Forward)\n" + "with:\n" + " find_package(Sofa.Component.IntegrationScheme.Forward)\n" + "in your CMakeLists.txt. " + "This package will be fully removed in v27.06." +) diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/CentralDifferenceSolver.h b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/CentralDifferenceSolver.h new file mode 100644 index 00000000000..e16e4816fd6 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/CentralDifferenceSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.h") + +namespace sofa::component::odesolver::forward +{ +using CentralDifferenceSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::forward::CentralDifferenceSolver has been renamed to " + "sofa::component::integrationscheme::forward::CentralDifferenceIntegrationScheme") + = sofa::component::integrationscheme::forward::CentralDifferenceIntegrationScheme; +} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/DampVelocitySolver.h b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/DampVelocitySolver.h new file mode 100644 index 00000000000..7485c5529e8 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/DampVelocitySolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.h") + +namespace sofa::component::odesolver::forward +{ +using DampVelocitySolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::forward::DampVelocitySolver has been renamed to " + "sofa::component::integrationscheme::forward::DampVelocityIntegrationScheme") + = sofa::component::integrationscheme::forward::DampVelocityIntegrationScheme; +} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/EulerExplicitSolver.h b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/EulerExplicitSolver.h new file mode 100644 index 00000000000..6ca19e5b49a --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/EulerExplicitSolver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.h") + +namespace sofa::component::odesolver::forward +{ +using EulerExplicitSolver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::forward::EulerExplicitSolver has been renamed to " + "sofa::component::integrationscheme::forward::EulerExplicitIntegrationScheme") + = sofa::component::integrationscheme::forward::EulerExplicitIntegrationScheme; +} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta2Solver.h b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta2Solver.h new file mode 100644 index 00000000000..caf6ca791cd --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta2Solver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.h") + +namespace sofa::component::odesolver::forward +{ +using RungeKutta2Solver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::forward::RungeKutta2Solver has been renamed to " + "sofa::component::integrationscheme::forward::RungeKutta2IntegrationScheme") + = sofa::component::integrationscheme::forward::RungeKutta2IntegrationScheme; +} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta4Solver.h b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta4Solver.h new file mode 100644 index 00000000000..46044f45d3f --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/compat/sofa/component/odesolver/forward/RungeKutta4Solver.h @@ -0,0 +1,11 @@ +#pragma once +#include +SOFA_HEADER_DEPRECATED("v26.06", "v27.06", "sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.h") + +namespace sofa::component::odesolver::forward +{ +using RungeKutta4Solver SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v27.06", + "sofa::component::odesolver::forward::RungeKutta4Solver has been renamed to " + "sofa::component::integrationscheme::forward::RungeKutta4IntegrationScheme") + = sofa::component::integrationscheme::forward::RungeKutta4IntegrationScheme; +} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.cpp similarity index 86% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.cpp index ba0fd8e00af..e8b36b7cbdd 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.cpp @@ -19,20 +19,20 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include #include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { using core::VecId; using namespace sofa::defaulttype; using namespace core::behavior; -CentralDifferenceSolver::CentralDifferenceSolver() +CentralDifferenceIntegrationScheme::CentralDifferenceIntegrationScheme() : d_rayleighMass(initData(&d_rayleighMass, (SReal)0.0, "rayleighMass", "Rayleigh damping coefficient related to mass")) , d_threadSafeVisitor(initData(&d_threadSafeVisitor, false, "threadSafeVisitor", "If true, do not use realloc and free visitors in fwdInteractionForceField.")) { @@ -73,11 +73,11 @@ CentralDifferenceSolver::CentralDifferenceSolver() * */ -void CentralDifferenceSolver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +void CentralDifferenceIntegrationScheme::doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) { sofa::simulation::common::VectorOperations vop( params, this->getContext() ); sofa::simulation::common::MechanicalOperations mop( params, this->getContext() ); - mop->setImplicit(false); // this solver is explicit only + mop->setImplicit(false); // this IntegrationScheme is explicit only MultiVecCoord pos(&vop, core::vec_id::write_access::position ); MultiVecDeriv vel(&vop, core::vec_id::write_access::velocity ); MultiVecCoord pos2(&vop, xResult /*core::vec_id::write_access::position*/ ); @@ -87,7 +87,7 @@ void CentralDifferenceSolver::solve(const core::ExecParams* params, SReal dt, so const SReal r = d_rayleighMass.getValue(); - mop.addSeparateGravity(dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. + mop.addSeparateGravity(m_dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. //projectVelocity(vel); // initial velocities are projected to the constrained space @@ -115,11 +115,11 @@ void CentralDifferenceSolver::solve(const core::ExecParams* params, SReal dt, so // vel += dx * dt ops[0].first = vel2; ops[0].second.push_back(std::make_pair(vel.id(),1.0)); - ops[0].second.push_back(std::make_pair(dx.id(),dt)); + ops[0].second.push_back(std::make_pair(dx.id(),m_dt)); // pos += vel * dt ops[1].first = pos2; ops[1].second.push_back(std::make_pair(pos.id(),1.0)); - ops[1].second.push_back(std::make_pair(vel2.id(),dt)); + ops[1].second.push_back(std::make_pair(vel2.id(),m_dt)); vop.v_multiop(ops); @@ -140,12 +140,12 @@ void CentralDifferenceSolver::solve(const core::ExecParams* params, SReal dt, so // vel += dx * dt ops[0].first = vel2; ops[0].second.push_back(std::make_pair(vel.id(),1.0)); - ops[0].second.push_back(std::make_pair(vel.id(),-1.0 + (1/dt - r/2)/(1/dt + r/2))); - ops[0].second.push_back(std::make_pair(dx.id(),1/(1/dt + r/2))); + ops[0].second.push_back(std::make_pair(vel.id(),-1.0 + (1/m_dt - r/2)/(1/m_dt + r/2))); + ops[0].second.push_back(std::make_pair(dx.id(),1/(1/m_dt + r/2))); // pos += vel * dt ops[1].first = pos2; ops[1].second.push_back(std::make_pair(pos.id(),1.0)); - ops[1].second.push_back(std::make_pair(vel2.id(),dt)); + ops[1].second.push_back(std::make_pair(vel2.id(),m_dt)); vop.v_multiop(ops); @@ -156,10 +156,10 @@ void CentralDifferenceSolver::solve(const core::ExecParams* params, SReal dt, so } -void registerCentralDifferenceSolver(sofa::core::ObjectFactory* factory) +void registerCentralDifferenceIntegrationScheme(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("Explicit time integrator using central difference (also known as Verlet of Leap-frog).") - .add< CentralDifferenceSolver >()); + .add< CentralDifferenceIntegrationScheme >()); } -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.h similarity index 58% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.h rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.h index 2c281c1c6d6..d49c1baffab 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/CentralDifferenceSolver.h +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/CentralDifferenceIntegrationScheme.h @@ -20,11 +20,11 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include +#include -#include +#include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { /** Explicit time integrator using central difference (also known as Verlet of Leap-frop). @@ -33,47 +33,30 @@ namespace sofa::component::odesolver::forward * @see http://en.wikipedia.org/wiki/Leapfrog_method * */ -class SOFA_COMPONENT_ODESOLVER_FORWARD_API CentralDifferenceSolver : public sofa::core::behavior::OdeSolver +class SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API CentralDifferenceIntegrationScheme : public simulation::integrationscheme::ExplicitIntegrationScheme { public: - SOFA_CLASS(CentralDifferenceSolver, sofa::core::behavior::OdeSolver); + SOFA_CLASS(CentralDifferenceIntegrationScheme, simulation::integrationscheme::ExplicitIntegrationScheme); protected: - CentralDifferenceSolver(); + CentralDifferenceIntegrationScheme(); public: - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; Data d_rayleighMass; ///< Rayleigh damping coefficient related to mass Data d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField. - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + virtual SReal getVelocityIntegrationFactor() const override { - const SReal dt = getContext()->getDt(); - const SReal matrix[3][3] = - { - { 1, dt, dt*dt}, - { 0, 1, dt}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; + return m_dt; } - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// - SReal getSolutionIntegrationFactor(int outputDerivative) const override + virtual SReal getPositionIntegrationFactor() const override { - const SReal dt = getContext()->getDt(); - const SReal vect[3] = { dt*dt, dt, 1}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; + return m_dt * m_dt; } + + }; -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.cpp similarity index 75% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.cpp index c6cfae40acc..8f1d4c3ab70 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.cpp @@ -19,43 +19,43 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { using namespace sofa::defaulttype; using namespace core::behavior; -void registerDampVelocitySolver(sofa::core::ObjectFactory* factory) +void registerDampVelocityIntegrationScheme(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("Reduce the velocities.") - .add< DampVelocitySolver >()); + .add< DampVelocityIntegrationScheme >()); } -DampVelocitySolver::DampVelocitySolver() +DampVelocityIntegrationScheme::DampVelocityIntegrationScheme() : d_rate(initData(&d_rate, 0.99_sreal, "rate", "Factor used to reduce the velocities. Typically between 0 and 1.") ) , d_threshold(initData(&d_threshold, 0.0_sreal, "threshold", "Threshold under which the velocities are canceled.") ) { } -void DampVelocitySolver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId /*xResult*/, sofa::core::MultiVecDerivId vResult) +void DampVelocityIntegrationScheme::doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) { sofa::simulation::common::VectorOperations vop( params, this->getContext() ); MultiVecDeriv vel(&vop, vResult /*core::vec_id::write_access::velocity*/ ); - msg_info() <<"DampVelocitySolver, dt = "<< dt - <<"DampVelocitySolver, initial v = "<< vel ; + msg_info() <<"DampVelocityIntegrationScheme, dt = "<< m_dt + <<"DampVelocityIntegrationScheme, initial v = "<< vel ; - vel.teq( exp(-d_rate.getValue() * dt) ); + vel.teq( exp(-d_rate.getValue() * m_dt) ); if(d_threshold.getValue() != 0.0 ) vel.threshold(d_threshold.getValue() ); - msg_info() <<"DampVelocitySolver, final v = "<< vel ; + msg_info() <<"DampVelocityIntegrationScheme, final v = "<< vel ; } -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.h similarity index 61% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.h rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.h index 40d14aab348..3d5c44450fe 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/DampVelocitySolver.h +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/DampVelocityIntegrationScheme.h @@ -21,52 +21,39 @@ ******************************************************************************/ #pragma once -#include +#include -#include +#include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { /** Velocity damping and thresholding. -This is not an ODE solver, but it can be used as a post-process after a real ODE solver. +This is not an ODE IntegrationScheme, but it can be used as a post-process after a real ODE IntegrationScheme. */ -class SOFA_COMPONENT_ODESOLVER_FORWARD_API DampVelocitySolver : public sofa::core::behavior::OdeSolver +class SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API DampVelocityIntegrationScheme : public simulation::integrationscheme::ExplicitIntegrationScheme { public: - SOFA_CLASS(DampVelocitySolver, sofa::core::behavior::OdeSolver); + SOFA_CLASS(DampVelocityIntegrationScheme, simulation::integrationscheme::ExplicitIntegrationScheme); - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; Data d_rate; ///< Factor used to reduce the velocities. Typically between 0 and 1. Data d_threshold; ///< Threshold under which the velocities are canceled. /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), /// how much will it affect the output derivative of the given order. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + virtual SReal getVelocityIntegrationFactor() const override { - const SReal dt = getContext()->getDt(); - const SReal matrix[3][3] = - { - { 1, 0, }, - { 0, std::exp(-d_rate.getValue() * dt), 0}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; + return 1.0; } - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// - SReal getSolutionIntegrationFactor(int /*outputDerivative*/) const override + virtual SReal getPositionIntegrationFactor() const override { - return 0; + return m_dt; } - protected: - DampVelocitySolver(); + DampVelocityIntegrationScheme(); }; -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.cpp similarity index 74% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.cpp index 3e2b4179048..d9c19384abc 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include @@ -27,35 +27,36 @@ #include #include #include -#include +#include #include +#include + +#include "sofa/simulation/integrationscheme/ImplicitIntegrationScheme.h" +using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor; //#define SOFA_NO_VMULTIOP -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { using namespace sofa::defaulttype; using namespace sofa::helper; using namespace core::behavior; -void registerEulerExplicitSolver(sofa::core::ObjectFactory* factory) +void registerEulerExplicitIntegrationScheme(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("A simple explicit time integrator.") - .add< EulerExplicitSolver >()); + .add< EulerExplicitIntegrationScheme >()); } -EulerExplicitSolver::EulerExplicitSolver() +EulerExplicitIntegrationScheme::EulerExplicitIntegrationScheme() : d_symplectic( initData( &d_symplectic, true, "symplectic", "If true (default), the velocities are updated before the positions and the method is symplectic, more robust. If false, the positions are updated before the velocities (standard Euler, less robust).") ) , d_threadSafeVisitor(initData(&d_threadSafeVisitor, false, "threadSafeVisitor", "If true, do not use realloc and free visitors in fwdInteractionForceField.")) - , l_linearSolver(initLink("linearSolver", "Linear solver used by this component")) + , l_linearSolver(initLink("linearIntegrationScheme", "Linear IntegrationScheme used by this component")) { } -void EulerExplicitSolver::solve(const core::ExecParams* params, - SReal dt, - sofa::core::MultiVecCoordId xResult, - sofa::core::MultiVecDerivId vResult) +void EulerExplicitIntegrationScheme::doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) { if (!isComponentStateValid()) { @@ -64,29 +65,28 @@ void EulerExplicitSolver::solve(const core::ExecParams* params, SCOPED_TIMER("EulerExplicitSolve"); - m_mappingGraph.build(this->getContext()); - // Create the vector and mechanical operations tools. These are used to execute special operations (multiplication, // additions, etc.) on multi-vectors (a vector that is stored in different buffers inside the mechanical objects) sofa::simulation::common::VectorOperations vop( params, this->getContext() ); sofa::simulation::common::MappingGraphMechanicalOperations mop( params, this->getContext() ); - // Let the mechanical operations know that the current solver is explicit. This will be propagated back to the + + // Let the mechanical operations know that the current IntegrationScheme is explicit. This will be propagated back to the // force fields during the addForce and addKToMatrix phase. Force fields use this information to avoid - // recomputing constant data in case of explicit solvers. + // recomputing constant data in case of explicit IntegrationScheme. mop->setImplicit(false); - // Initialize the set of multi-vectors computed by this solver + // Initialize the set of multi-vectors computed by this IntegrationScheme MultiVecDeriv acc (&vop, core::vec_id::write_access::dx); // acceleration to be computed MultiVecDeriv f (&vop, core::vec_id::write_access::force ); // force to be computed acc.realloc(&vop, !d_threadSafeVisitor.getValue(), true); - addSeparateGravity(&mop, dt, vResult); + addSeparateGravity(&mop, m_dt, vResult); computeForce(&mop, f); // The inverse of the mass matrix is trivial to compute. Otherwise, it requires the - // assembly of a linear system and a linear solver to compute its solution. + // assembly of a linear system and a linear IntegrationScheme to compute its solution. if(isMassMatrixTriviallyInvertible(params)) { // acc = M^-1 * f @@ -100,7 +100,7 @@ void EulerExplicitSolver::solve(const core::ExecParams* params, if (l_linearSolver.get()) { - // Build the global matrix. In this solver, it is the global mass matrix + // Build the global matrix. In this IntegrationScheme, it is the global mass matrix // Projective constraints are also projected in this step assembleSystemMatrix(&mop); @@ -110,28 +110,27 @@ void EulerExplicitSolver::solve(const core::ExecParams* params, } else { - msg_error() << "Due to the presence of non-diagonal masses, the solver requires a linear solver"; + msg_error() << "Due to the presence of non-diagonal masses, the IntegrationScheme requires a linear IntegrationScheme"; d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } } // Compute the new position and new velocity from the acceleration - updateState(&vop, &mop, xResult, vResult, acc, dt); + updateState(&vop, &mop, xResult, vResult, acc); } -void EulerExplicitSolver::updateState(sofa::simulation::common::VectorOperations* vop, +void EulerExplicitIntegrationScheme::updateState(sofa::simulation::common::VectorOperations* vop, sofa::simulation::common::MappingGraphMechanicalOperations* mop, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult, - const sofa::core::behavior::MultiVecDeriv& acc, - SReal dt) const + const sofa::core::behavior::MultiVecDeriv& acc) const { SCOPED_TIMER("updateState"); - // Initialize the set of multi-vectors computed by this solver + // Initialize the set of multi-vectors computed by this IntegrationScheme // "xResult" could be "position()" or "freePosition()" depending on the - // animation loop calling this ODE solver. + // animation loop calling this ODE IntegrationScheme. // Similarly, "vResult" could be "velocity()" or "freeVelocity()". // In case "xResult" refers to "position()", "newPos" refers the // same multi-vector than "pos". Similarly, for "newVel" and "vel". @@ -172,7 +171,7 @@ void EulerExplicitSolver::updateState(sofa::simulation::common::VectorOperations // Create a set of linear operations that will be executed on two vectors // In our case, the operations will be executed to compute the new velocity vector, // and the new position vector. The order of execution is defined by - // the symplectic property of the solver. + // the symplectic property of the IntegrationScheme. VMultiOp ops(2); // Change order of operations depending on the symplectic flag @@ -180,7 +179,7 @@ void EulerExplicitSolver::updateState(sofa::simulation::common::VectorOperations const VMultiOp::size_type velId = 1 - posId; // 0 if symplectic, 1 otherwise // Access the set of operations corresponding to the velocity vector - // In case of symplectic solver, these operations are executed first. + // In case of symplectic IntegrationScheme, these operations are executed first. auto& ops_vel = ops[velId]; // Associate the new velocity vector as the result to this set of operations @@ -190,23 +189,23 @@ void EulerExplicitSolver::updateState(sofa::simulation::common::VectorOperations // The value 1.0 indicates that the first operation is based on the values // in the second pair and, therefore, the second operation is discarded. ops_vel.second.emplace_back(vel.id(), 1.0); - ops_vel.second.emplace_back(acc.id(), dt); + ops_vel.second.emplace_back(acc.id(), m_dt); // Access the set of operations corresponding to the position vector - // In case of symplectic solver, these operations are executed second. + // In case of symplectic IntegrationScheme, these operations are executed second. auto& ops_pos = ops[posId]; // Associate the new position vector as the result to this set of operations ops_pos.first = newPos; // The two following operations are actually a unique operation: newPos = pos + dt * v - // where v is "newVel" in case of a symplectic solver, and "vel" otherwise. + // where v is "newVel" in case of a symplectic IntegrationScheme, and "vel" otherwise. // If symplectic: newPos = pos + dt * newVel, executed after newVel has been computed // If not symplectic: newPos = pos + dt * vel // The value 1.0 indicates that the first operation is based on the values // in the second pair and, therefore, the second operation is discarded. ops_pos.second.emplace_back(pos.id(), 1.0); - ops_pos.second.emplace_back(d_symplectic.getValue() ? newVel.id() : vel.id(), dt); + ops_pos.second.emplace_back(d_symplectic.getValue() ? newVel.id() : vel.id(), m_dt); // Execute the defined operations to compute the new velocity vector and // the new position vector. @@ -217,46 +216,16 @@ void EulerExplicitSolver::updateState(sofa::simulation::common::VectorOperations // current context tree. vop->v_multiop(ops); - // Calls "solveConstraint" on every ConstraintSolver objects found in the current context tree. + // Calls "solveConstraint" on every ConstraintIntegrationScheme objects found in the current context tree. mop->solveConstraint(newVel,core::ConstraintOrder::VEL); mop->solveConstraint(newPos,core::ConstraintOrder::POS); } #endif } -SReal EulerExplicitSolver::getIntegrationFactor(int inputDerivative, int outputDerivative) const -{ - if (inputDerivative >= 3 || outputDerivative >= 3) - { - return 0; - } - - const SReal dt = getContext()->getDt(); - const SReal k_a = d_symplectic.getValue() * dt * dt; - const SReal matrix[3][3] = - { - { 1, dt, k_a}, //x = 1 * x + dt * v + k_a * a - { 0, 1, dt}, //v = 0 * x + 1 * v + dt * a - { 0, 0, 0} - }; - - return matrix[outputDerivative][inputDerivative]; -} - -SReal EulerExplicitSolver::getSolutionIntegrationFactor(int outputDerivative) const -{ - if (outputDerivative >= 3) - return 0; - - const SReal dt = getContext()->getDt(); - const SReal k_a = d_symplectic.getValue() * dt * dt; - const SReal vect[3] = {k_a, dt, 1}; - return vect[outputDerivative]; -} - -void EulerExplicitSolver::init() +void EulerExplicitIntegrationScheme::init() { - OdeSolver::init(); + Inherit1::init(); if (!l_linearSolver.get()) { @@ -267,7 +236,7 @@ void EulerExplicitSolver::init() d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid); } -void EulerExplicitSolver::addSeparateGravity(sofa::simulation::common::MappingGraphMechanicalOperations* mop, SReal dt, core::MultiVecDerivId v) +void EulerExplicitIntegrationScheme::addSeparateGravity(sofa::simulation::common::MappingGraphMechanicalOperations* mop, SReal dt, core::MultiVecDerivId v) { SCOPED_TIMER("addSeparateGravity"); @@ -277,7 +246,7 @@ void EulerExplicitSolver::addSeparateGravity(sofa::simulation::common::MappingGr mop->addSeparateGravity(dt, v); } -void EulerExplicitSolver::computeForce(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId f) const +void EulerExplicitIntegrationScheme::computeForce(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId f) const { SCOPED_TIMER("ComputeForce"); @@ -287,7 +256,7 @@ void EulerExplicitSolver::computeForce(sofa::simulation::common::MappingGraphMec mop->computeForce(m_mappingGraph, f, true, true, nullptr); } -void EulerExplicitSolver::computeAcceleration(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId acc, core::ConstMultiVecDerivId f) +void EulerExplicitIntegrationScheme::computeAcceleration(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId acc, core::ConstMultiVecDerivId f) { SCOPED_TIMER("AccFromF"); @@ -299,7 +268,7 @@ void EulerExplicitSolver::computeAcceleration(sofa::simulation::common::MappingG mop->accFromF(acc, f); } -void EulerExplicitSolver::projectResponse(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId vecId) const +void EulerExplicitIntegrationScheme::projectResponse(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId vecId) const { SCOPED_TIMER("projectResponse"); @@ -309,20 +278,20 @@ void EulerExplicitSolver::projectResponse(sofa::simulation::common::MappingGraph mop->projectResponse(m_mappingGraph, vecId); } -void EulerExplicitSolver::solveConstraints(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId acc) +void EulerExplicitIntegrationScheme::solveConstraints(sofa::simulation::common::MappingGraphMechanicalOperations* mop, core::MultiVecDerivId acc) { SCOPED_TIMER("solveConstraint"); - // Calls "solveConstraint" method of every ConstraintSolver objects found in the current context tree. + // Calls "solveConstraint" method of every ConstraintIntegrationScheme objects found in the current context tree. mop->solveConstraint(acc, core::ConstraintOrder::ACC); } -void EulerExplicitSolver::assembleSystemMatrix(sofa::simulation::common::MappingGraphMechanicalOperations* mop) const +void EulerExplicitIntegrationScheme::assembleSystemMatrix(sofa::simulation::common::MappingGraphMechanicalOperations* mop) const { SCOPED_TIMER("MBKBuild"); - // A. For LinearSolver using a GraphScatteredMatrix (ie, non-assembled matrices), nothing appends. - // B. For LinearSolver using other type of matrices (FullMatrix, SparseMatrix, CompressedRowSparseMatrix), + // A. For LinearIntegrationScheme using a GraphScatteredMatrix (ie, non-assembled matrices), nothing appends. + // B. For LinearIntegrationScheme using other type of matrices (FullMatrix, SparseMatrix, CompressedRowSparseMatrix), // the "addMBKToMatrix" method is called on each BaseForceField objects and the "applyConstraint" method // is called on every BaseProjectiveConstraintSet objects. An example of such constraint set is the // FixedProjectiveConstraint. In this case, it will set to 0 every column (_, i) and row (i, _) of the assembled @@ -333,7 +302,7 @@ void EulerExplicitSolver::assembleSystemMatrix(sofa::simulation::common::Mapping core::MatricesFactors::K(0), l_linearSolver.get()); } -void EulerExplicitSolver::solveSystem(core::MultiVecDerivId solution, core::MultiVecDerivId rhs) const +void EulerExplicitIntegrationScheme::solveSystem(core::MultiVecDerivId solution, core::MultiVecDerivId rhs) const { SCOPED_TIMER("MBKSolve"); l_linearSolver->getLinearSystem()->setSystemSolution(solution); @@ -342,7 +311,8 @@ void EulerExplicitSolver::solveSystem(core::MultiVecDerivId solution, core::Mult l_linearSolver->getLinearSystem()->dispatchSystemSolution(solution); } -bool EulerExplicitSolver::isMassMatrixTriviallyInvertible(const core::ExecParams* params) const + +bool EulerExplicitIntegrationScheme::isMassMatrixTriviallyInvertible(const core::ExecParams* params) const { SOFA_UNUSED(params); @@ -373,4 +343,4 @@ bool EulerExplicitSolver::isMassMatrixTriviallyInvertible(const core::ExecParams return areAllMassesDiagonal; } -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.h similarity index 79% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.h rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.h index 66cd610d1e7..34dddc4e3fa 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/EulerExplicitSolver.h +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/EulerExplicitIntegrationScheme.h @@ -20,32 +20,33 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include +#include -#include #include #include -#include +#include namespace sofa::simulation::common { -class MappingGraphMechanicalOperations; +class MechanicalOperations; class VectorOperations; } -namespace sofa::component::odesolver::forward +#include + +namespace sofa::component::integrationscheme::forward { /** * The simplest time integration. - * Two variants of the Euler solver are available in this component: + * Two variants of the Euler IntegrationScheme are available in this component: * - forward Euler method, also called explicit Euler method * - semi-implicit Euler method, also called semi-explicit Euler method or symplectic Euler * * In both variants, acceleration is first computed. The system to compute the acceleration * is M * a = f, where M is the mass matrix and f can be a force. * In case of a diagonal mass matrix, M is trivially invertible and the acceleration - * can be computed without a linear solver. + * can be computed without a linear IntegrationScheme. * * f is accumulated by force fields through the addForce function. Mappings can * also contribute by projecting forces of mapped objects. @@ -65,33 +66,37 @@ namespace sofa::component::odesolver::forward * * The semi-implicit Euler method is more robust than the standard Euler method. */ -class SOFA_COMPONENT_ODESOLVER_FORWARD_API EulerExplicitSolver : public sofa::core::behavior::OdeSolver +class SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API EulerExplicitIntegrationScheme : public simulation::integrationscheme::ExplicitIntegrationScheme { public: - SOFA_CLASS(EulerExplicitSolver, sofa::core::behavior::OdeSolver); + SOFA_CLASS(EulerExplicitIntegrationScheme, simulation::integrationscheme::ExplicitIntegrationScheme); protected: - EulerExplicitSolver(); + EulerExplicitIntegrationScheme(); public: - void solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; Data d_symplectic; ///< If true (default), the velocities are updated before the positions and the method is symplectic, more robust. If false, the positions are updated before the velocities (standard Euler, less robust). Data d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField. - SingleLink l_linearSolver; + SingleLink l_linearSolver; + + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override ; + virtual SReal getVelocityIntegrationFactor() const override + { + return m_dt; + } - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// - SReal getSolutionIntegrationFactor(int outputDerivative) const override ; + virtual SReal getPositionIntegrationFactor() const override + { + return m_dt*m_dt; + } void init() override ; +protected: + protected: /// Update state variable (new position and velocity) based on the computed acceleration @@ -100,8 +105,7 @@ class SOFA_COMPONENT_ODESOLVER_FORWARD_API EulerExplicitSolver : public sofa::co sofa::simulation::common::MappingGraphMechanicalOperations* mop, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult, - const sofa::core::behavior::MultiVecDeriv& acc, - SReal dt) const; + const sofa::core::behavior::MultiVecDeriv& acc) const; /// Gravity times time step size is added to the velocity for some masses /// v += g * dt @@ -131,4 +135,4 @@ class SOFA_COMPONENT_ODESOLVER_FORWARD_API EulerExplicitSolver : public sofa::co simulation::MappingGraph m_mappingGraph; }; -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.cpp similarity index 81% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.cpp index 7eefc5dc953..aa9bca041bc 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include @@ -28,23 +28,23 @@ -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { using core::VecId; using namespace core::behavior; using namespace sofa::defaulttype; -void registerRungeKutta2Solver(sofa::core::ObjectFactory* factory) +void registerRungeKutta2IntegrationScheme(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("A popular explicit time integrator.") - .add< RungeKutta2Solver >()); + .add< RungeKutta2IntegrationScheme >()); } -void RungeKutta2Solver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +void RungeKutta2IntegrationScheme::doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) { sofa::simulation::common::VectorOperations vop( params, this->getContext() ); sofa::simulation::common::MechanicalOperations mop( params, this->getContext() ); - mop->setImplicit(false); // this solver is explicit only + mop->setImplicit(false); // this IntegrationScheme is explicit only // Get the Ids of the state vectors MultiVecCoord pos(&vop, core::vec_id::write_access::position ); MultiVecDeriv vel(&vop, core::vec_id::write_access::velocity ); @@ -58,7 +58,7 @@ void RungeKutta2Solver::solve(const core::ExecParams* params, SReal dt, sofa::co SReal startTime = this->getTime(); - mop.addSeparateGravity(dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. + mop.addSeparateGravity(m_dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. // Compute state derivative. vel is the derivative of pos mop.computeAcc (startTime, acc, pos, vel); // acc is the derivative of vel @@ -77,17 +77,17 @@ void RungeKutta2Solver::solve(const core::ExecParams* params, SReal dt, sofa::co ops.resize(2); ops[0].first = newX; ops[0].second.push_back(std::make_pair(pos.id(),1.0)); - ops[0].second.push_back(std::make_pair(vel.id(),dt/2)); + ops[0].second.push_back(std::make_pair(vel.id(),m_dt/2)); ops[1].first = newV; ops[1].second.push_back(std::make_pair(vel.id(),1.0)); - ops[1].second.push_back(std::make_pair(acc.id(),dt/2)); + ops[1].second.push_back(std::make_pair(acc.id(),m_dt/2)); vop.v_multiop(ops); } #endif // Compute the derivative at newX, newV - mop.computeAcc ( startTime+dt/2., acc, newX, newV); + mop.computeAcc ( startTime+m_dt/2., acc, newX, newV); // Use the derivative at newX, newV to update the state #ifdef SOFA_NO_VMULTIOP // unoptimized version @@ -102,10 +102,10 @@ void RungeKutta2Solver::solve(const core::ExecParams* params, SReal dt, sofa::co ops.resize(2); ops[0].first = pos2; ops[0].second.push_back(std::make_pair(pos.id(),1.0)); - ops[0].second.push_back(std::make_pair(newV.id(),dt)); + ops[0].second.push_back(std::make_pair(newV.id(),m_dt)); ops[1].first = vel2; ops[1].second.push_back(std::make_pair(vel.id(),1.0)); - ops[1].second.push_back(std::make_pair(acc.id(),dt)); + ops[1].second.push_back(std::make_pair(acc.id(),m_dt)); vop.v_multiop(ops); mop.solveConstraint(vel2,core::ConstraintOrder::VEL); @@ -118,4 +118,4 @@ void RungeKutta2Solver::solve(const core::ExecParams* params, SReal dt, sofa::co -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.h new file mode 100644 index 00000000000..64cd89d8ea3 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta2IntegrationScheme.h @@ -0,0 +1,49 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include + +namespace sofa::component::integrationscheme::forward +{ + +/** A popular time integration method, much more precise than the EulerIntegrationScheme */ +class SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API RungeKutta2IntegrationScheme : public simulation::integrationscheme::ExplicitIntegrationScheme +{ +public: + SOFA_CLASS(RungeKutta2IntegrationScheme, simulation::integrationscheme::ExplicitIntegrationScheme); + + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + virtual SReal getVelocityIntegrationFactor() const override + { + return m_dt/2.0; + } + + virtual SReal getPositionIntegrationFactor() const override + { + return m_dt*m_dt/4.0; + } +}; + +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.cpp similarity index 87% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.cpp index 2d643eda0d4..3c322166a6f 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include @@ -28,24 +28,24 @@ #include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { using core::VecId; using namespace core::behavior; using namespace sofa::defaulttype; -void registerRungeKutta4Solver(sofa::core::ObjectFactory* factory) +void registerRungeKutta4IntegrationScheme(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("A popular explicit time integrator.") - .add< RungeKutta4Solver >()); + .add< RungeKutta4IntegrationScheme >()); } -void RungeKutta4Solver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +void RungeKutta4IntegrationScheme::doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) { sofa::simulation::common::VectorOperations vop( params, this->getContext() ); sofa::simulation::common::MechanicalOperations mop( params, this->getContext() ); - mop->setImplicit(false); // this solver is explicit only + mop->setImplicit(false); // this IntegrationScheme is explicit only // Get the Ids of the state vectors MultiVecCoord pos(&vop, core::vec_id::write_access::position ); MultiVecDeriv vel(&vop, core::vec_id::write_access::velocity ); @@ -64,13 +64,13 @@ void RungeKutta4Solver::solve(const core::ExecParams* params, SReal dt, sofa::co MultiVecCoord newX(&vop); - SReal stepBy2 = SReal(dt / 2.0); - SReal stepBy3 = SReal(dt / 3.0); - SReal stepBy6 = SReal(dt / 6.0); + SReal stepBy2 = SReal(m_dt / 2.0); + SReal stepBy3 = SReal(m_dt / 3.0); + SReal stepBy6 = SReal(m_dt / 6.0); SReal startTime = this->getTime(); - mop.addSeparateGravity(dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. + mop.addSeparateGravity(m_dt); // v += dt*g . Used if mass wants to added G separately from the other forces to v. //First step dmsg_info() << "RK4 Step 1"; @@ -141,15 +141,15 @@ void RungeKutta4Solver::solve(const core::ExecParams* params, SReal dt, sofa::co ops.resize(2); ops[0].first = newX; ops[0].second.push_back(std::make_pair(pos.id(),1.0)); - ops[0].second.push_back(std::make_pair(k3v.id(),dt)); + ops[0].second.push_back(std::make_pair(k3v.id(),m_dt)); ops[1].first = k4v; ops[1].second.push_back(std::make_pair(vel.id(),1.0)); - ops[1].second.push_back(std::make_pair(k3a.id(),dt)); + ops[1].second.push_back(std::make_pair(k3a.id(),m_dt)); vop.v_multiop(ops); } #endif - mop.computeAcc( startTime+dt, k4a, newX, k4v); + mop.computeAcc( startTime+m_dt, k4a, newX, k4v); dmsg_info() << "RK4 Final"; @@ -190,4 +190,4 @@ void RungeKutta4Solver::solve(const core::ExecParams* params, SReal dt, sofa::co } -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/NewtonRaphsonConvergenceMeasure.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.h similarity index 64% rename from Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/NewtonRaphsonConvergenceMeasure.h rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.h index d9a205d4303..025d3b2e413 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/NewtonRaphsonConvergenceMeasure.h +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/RungeKutta4IntegrationScheme.h @@ -20,44 +20,31 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include +#include -namespace sofa::component::odesolver::backward -{ -struct NewtonRaphsonConvergenceMeasure +#include + +namespace sofa::component::integrationscheme::forward { - virtual ~NewtonRaphsonConvergenceMeasure() = default; - virtual bool isMeasured() const = 0; - virtual bool hasConverged() const = 0; - virtual NewtonStatus status() const = 0; - virtual std::string writeWhenConverged() const = 0; - virtual std::string writeWhenNotConverged() const { return {}; }; - virtual std::string_view measureName() const = 0; - - unsigned int newtonIterationCount = 0; -}; -struct NewtonRaphsonConvergenceMeasureWithSquaredParameter : NewtonRaphsonConvergenceMeasure +/** A popular time integration method, much more precise than the EulerIntegrationScheme */ +class SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API RungeKutta4IntegrationScheme : public simulation::integrationscheme::ExplicitIntegrationScheme { - SReal param; - SReal squaredParam; +public: + SOFA_CLASS(RungeKutta4IntegrationScheme, simulation::integrationscheme::ExplicitIntegrationScheme); - explicit NewtonRaphsonConvergenceMeasureWithSquaredParameter(SReal p) - { - setParam(p); - } + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - void setParam(const SReal p) + virtual SReal getVelocityIntegrationFactor() const override { - param = p; - squaredParam = param * param; + return m_dt/2.0; } - [[nodiscard]] bool isMeasured() const override + virtual SReal getPositionIntegrationFactor() const override { - return param > 0; + return m_dt*m_dt/4.0; } }; -} +} // namespace sofa::component::odeIntegrationScheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/config.h.in b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/config.h.in similarity index 85% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/config.h.in rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/config.h.in index dcb8386cf32..fc1d20c9562 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/config.h.in +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/config.h.in @@ -24,16 +24,16 @@ #include #include -#ifdef SOFA_BUILD_SOFA_COMPONENT_ODESOLVER_FORWARD +#ifdef SOFA_BUILD_SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD # define SOFA_TARGET @PROJECT_NAME@ -# define SOFA_COMPONENT_ODESOLVER_FORWARD_API SOFA_EXPORT_DYNAMIC_LIBRARY +# define SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API SOFA_EXPORT_DYNAMIC_LIBRARY #else -# define SOFA_COMPONENT_ODESOLVER_FORWARD_API SOFA_IMPORT_DYNAMIC_LIBRARY +# define SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; -} // namespace sofa::component::odesolver::forward +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.cpp b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.cpp similarity index 74% rename from Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.cpp rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.cpp index e5cd7f45995..efdf92b47f2 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/init.cpp +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.cpp @@ -19,19 +19,18 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include -namespace sofa::component::odesolver::backward +namespace sofa::component::integrationscheme::forward { -extern void registerEulerImplicitSolver(sofa::core::ObjectFactory* factory); -extern void registerNewmarkImplicitSolver(sofa::core::ObjectFactory* factory); -extern void registerStaticSolver(sofa::core::ObjectFactory* factory); -extern void registerVariationalSymplecticSolver(sofa::core::ObjectFactory* factory); -extern void registerNewtonRaphsonSolver(sofa::core::ObjectFactory* factory); -extern void registerBDFOdeSolver(sofa::core::ObjectFactory* factory); +extern void registerCentralDifferenceIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerDampVelocityIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerEulerExplicitIntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerRungeKutta2IntegrationScheme(sofa::core::ObjectFactory* factory); +extern void registerRungeKutta4IntegrationScheme(sofa::core::ObjectFactory* factory); extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); @@ -57,14 +56,14 @@ const char* getModuleVersion() void registerObjects(sofa::core::ObjectFactory* factory) { - registerEulerImplicitSolver(factory); - registerNewmarkImplicitSolver(factory); - registerStaticSolver(factory); - registerVariationalSymplecticSolver(factory); - registerNewtonRaphsonSolver(factory); - registerBDFOdeSolver(factory); + registerCentralDifferenceIntegrationScheme(factory); + registerDampVelocityIntegrationScheme(factory); + registerEulerExplicitIntegrationScheme(factory); + registerRungeKutta2IntegrationScheme(factory); + registerRungeKutta4IntegrationScheme(factory); } + void init() { static bool first = true; @@ -77,4 +76,4 @@ void init() } } -} // namespace sofa::component::odesolver::backward +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.h b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.h similarity index 87% rename from Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.h rename to Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.h index b7393bb6eba..3a49d3a9b1e 100644 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/init.h +++ b/Sofa/Component/IntegrationScheme/Forward/src/sofa/component/integrationscheme/forward/init.h @@ -20,9 +20,9 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include +#include -namespace sofa::component::odesolver::forward +namespace sofa::component::integrationscheme::forward { - SOFA_COMPONENT_ODESOLVER_FORWARD_API void init(); -} // namespace sofa::component::odesolver::forward + SOFA_COMPONENT_INTEGRATIONSCHEME_FORWARD_API void init(); +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/Component/ODESolver/Sofa.Component.ODESolverConfig.cmake.in b/Sofa/Component/IntegrationScheme/Sofa.Component.IntegrationSchemeConfig.cmake.in similarity index 100% rename from Sofa/Component/ODESolver/Sofa.Component.ODESolverConfig.cmake.in rename to Sofa/Component/IntegrationScheme/Sofa.Component.IntegrationSchemeConfig.cmake.in diff --git a/Sofa/Component/IntegrationScheme/compat/Sofa.Component.ODESolverConfig.cmake.in b/Sofa/Component/IntegrationScheme/compat/Sofa.Component.ODESolverConfig.cmake.in new file mode 100644 index 00000000000..790c54ad7a3 --- /dev/null +++ b/Sofa/Component/IntegrationScheme/compat/Sofa.Component.ODESolverConfig.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +message(FATAL_ERROR + "[SOFA v26.06] Sofa.Component.ODESolver has been renamed to " + "Sofa.Component.IntegrationScheme.\n" + "Please replace:\n" + " find_package(Sofa.Component.ODESolver)\n" + "with:\n" + " find_package(Sofa.Component.IntegrationScheme)\n" + "in your CMakeLists.txt. " + "This package will be fully removed in v27.06." +) diff --git a/Sofa/Component/ODESolver/src/sofa/component/odesolver/config.h.in b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/config.h.in similarity index 86% rename from Sofa/Component/ODESolver/src/sofa/component/odesolver/config.h.in rename to Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/config.h.in index 7dc9bfdba19..68ac4ce27f6 100644 --- a/Sofa/Component/ODESolver/src/sofa/component/odesolver/config.h.in +++ b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/config.h.in @@ -24,14 +24,14 @@ #include #include -#ifdef SOFA_BUILD_SOFA_COMPONENT_ODESOLVER -# define SOFA_COMPONENT_ODESOLVER_API SOFA_EXPORT_DYNAMIC_LIBRARY +#ifdef SOFA_BUILD_SOFA_COMPONENT_INTEGRATIONSCHEME +# define SOFA_COMPONENT_INTEGRATIONSCHEME_API SOFA_EXPORT_DYNAMIC_LIBRARY #else -# define SOFA_COMPONENT_ODESOLVER_API SOFA_IMPORT_DYNAMIC_LIBRARY +# define SOFA_COMPONENT_INTEGRATIONSCHEME_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif -namespace sofa::component::odesolver +namespace sofa::component::integrationscheme { constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; -} // namespace sofa::component::odesolver +} // namespace sofa::component::integrationscheme diff --git a/Sofa/Component/ODESolver/src/sofa/component/odesolver/init.cpp b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.cpp similarity index 82% rename from Sofa/Component/ODESolver/src/sofa/component/odesolver/init.cpp rename to Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.cpp index 4c86bf81b18..c0d0c47be88 100644 --- a/Sofa/Component/ODESolver/src/sofa/component/odesolver/init.cpp +++ b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.cpp @@ -19,16 +19,16 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include -#include -#include +#include +#include #include #include #include -namespace sofa::component::odesolver +namespace sofa::component::integrationscheme { extern "C" { @@ -55,8 +55,8 @@ const char* getModuleVersion() void registerObjects(sofa::core::ObjectFactory* factory) { - factory->registerObjectsFromPlugin(Sofa.Component.ODESolver.Backward); - factory->registerObjectsFromPlugin(Sofa.Component.ODESolver.Forward); + factory->registerObjectsFromPlugin(Sofa.Component.IntegrationScheme.Backward); + factory->registerObjectsFromPlugin(Sofa.Component.IntegrationScheme.Forward); } void init() @@ -65,8 +65,8 @@ void init() if (first) { // force dependencies at compile-time - sofa::component::odesolver::backward::init(); - sofa::component::odesolver::forward::init(); + sofa::component::integrationscheme::backward::init(); + sofa::component::integrationscheme::forward::init(); // make sure that this plugin is registered into the PluginManager sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); @@ -75,4 +75,4 @@ void init() } } -} // namespace sofa::component::odesolver +} // namespace sofa::component::integrationscheme diff --git a/Sofa/Component/ODESolver/src/sofa/component/odesolver/init.h b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.h similarity index 89% rename from Sofa/Component/ODESolver/src/sofa/component/odesolver/init.h rename to Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.h index bb17d457403..e048b287bde 100644 --- a/Sofa/Component/ODESolver/src/sofa/component/odesolver/init.h +++ b/Sofa/Component/IntegrationScheme/src/sofa/component/integrationscheme/init.h @@ -21,9 +21,9 @@ ******************************************************************************/ #pragma once -#include +#include -namespace sofa::component::odesolver +namespace sofa::component::integrationscheme { - SOFA_COMPONENT_ODESOLVER_API void init(); -} // namespace sofa::component::odesolver + SOFA_COMPONENT_INTEGRATIONSCHEME_API void init(); +} // namespace sofa::component::integrationscheme diff --git a/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/PrecomputedLinearSolver.inl b/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/PrecomputedLinearSolver.inl index bf5100e7363..60b8b18dc6d 100644 --- a/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/PrecomputedLinearSolver.inl +++ b/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/PrecomputedLinearSolver.inl @@ -37,7 +37,7 @@ #include #include -#include +#include #include @@ -66,7 +66,7 @@ void PrecomputedLinearSolver::loadMatrix(TMatrix& M) internalData.Minv.resize(systemSize,systemSize); dt = this->getContext()->getDt(); - sofa::core::behavior::OdeSolver::SPtr odeSolver; + sofa::core::behavior::BaseIntegrationScheme::SPtr odeSolver; this->getContext()->get(odeSolver); factInt = 1.0; // christian : it is not a compliance... but an admittance that is computed ! if (odeSolver) factInt = odeSolver->getPositionIntegrationFactor(); // here, we compute a compliance diff --git a/Sofa/Component/LinearSolver/Direct/tests/SparseLDLSolver_test.cpp b/Sofa/Component/LinearSolver/Direct/tests/SparseLDLSolver_test.cpp index d00efa006f4..ac1c051a6db 100644 --- a/Sofa/Component/LinearSolver/Direct/tests/SparseLDLSolver_test.cpp +++ b/Sofa/Component/LinearSolver/Direct/tests/SparseLDLSolver_test.cpp @@ -62,11 +62,11 @@ TEST(SparseLDLSolver, EmptyMState) const auto plugins = sofa::testing::makeScopedPlugin({ Sofa.Component.LinearSolver.Direct, - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.StateContainer}); sofa::simpleapi::createObject(root, "DefaultAnimationLoop"); - sofa::simpleapi::createObject(root, "EulerImplicitSolver"); + sofa::simpleapi::createObject(root, "EulerImplicitIntegrationScheme"); sofa::simpleapi::createObject(root, "SparseLDLSolver", {{"template", "CompressedRowSparseMatrixd"}}); sofa::simpleapi::createObject(root, "MechanicalObject", {{"template", "Vec3"}, {"position", ""}}); @@ -92,13 +92,13 @@ TEST(SparseLDLSolver, TopologyChangeEmptyMState) const auto plugins = sofa::testing::makeScopedPlugin({ Sofa.Component.LinearSolver.Direct, Sofa.Component.Mass, - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.StateContainer, Sofa.Component.Topology.Container.Dynamic, Sofa.Component.Topology.Utility}); sofa::simpleapi::createObject(root, "DefaultAnimationLoop"); - sofa::simpleapi::createObject(root, "EulerImplicitSolver"); + sofa::simpleapi::createObject(root, "EulerImplicitIntegrationScheme"); sofa::simpleapi::createObject(root, "SparseLDLSolver", {{"template", "CompressedRowSparseMatrixd"}}); sofa::simpleapi::createObject(root, "PointSetTopologyContainer", {{"position", "0 0 0"}}); sofa::simpleapi::createObject(root, "PointSetTopologyModifier"); diff --git a/Sofa/Component/LinearSolver/Preconditioner/CMakeLists.txt b/Sofa/Component/LinearSolver/Preconditioner/CMakeLists.txt index 1a8cf860609..026bc039ce9 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/CMakeLists.txt +++ b/Sofa/Component/LinearSolver/Preconditioner/CMakeLists.txt @@ -33,12 +33,12 @@ set(SOURCE_FILES ) sofa_find_package(Sofa.Simulation.Core REQUIRED) -sofa_find_package(Sofa.Component.ODESolver.Backward REQUIRED) +sofa_find_package(Sofa.Component.IntegrationScheme.Backward REQUIRED) sofa_find_package(Sofa.Component.LinearSolver.Iterative REQUIRED) sofa_find_package(Sofa.Component.LinearSolver.Direct REQUIRED) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${WRAPPER_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core Sofa.Component.ODESolver.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.LinearSolver.Direct) +target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core Sofa.Component.IntegrationScheme.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.LinearSolver.Direct) sofa_create_package_with_targets( PACKAGE_NAME ${PROJECT_NAME} diff --git a/Sofa/Component/LinearSolver/Preconditioner/Sofa.Component.LinearSolver.PreconditionerConfig.cmake.in b/Sofa/Component/LinearSolver/Preconditioner/Sofa.Component.LinearSolver.PreconditionerConfig.cmake.in index 1a6e6af8bea..408d650cbe8 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/Sofa.Component.LinearSolver.PreconditionerConfig.cmake.in +++ b/Sofa/Component/LinearSolver/Preconditioner/Sofa.Component.LinearSolver.PreconditionerConfig.cmake.in @@ -5,7 +5,7 @@ find_package(Sofa.Config QUIET REQUIRED) sofa_find_package(Sofa.Simulation.Core QUIET REQUIRED) -sofa_find_package(Sofa.Component.ODESolver.Backward QUIET REQUIRED) +sofa_find_package(Sofa.Component.IntegrationScheme.Backward QUIET REQUIRED) sofa_find_package(Sofa.Component.LinearSolver.Iterative QUIET REQUIRED) sofa_find_package(Sofa.Component.LinearSolver.Direct QUIET REQUIRED) diff --git a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.inl b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.inl index e4938c1a6f0..ce872fc92d2 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.inl +++ b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/PrecomputedWarpPreconditioner.inl @@ -37,7 +37,7 @@ #include -#include +#include #include #include #include @@ -125,7 +125,7 @@ void PrecomputedWarpPreconditioner::loadMatrix(TMatrix& M) dt = this->getContext()->getDt(); - sofa::component::odesolver::backward::EulerImplicitSolver* EulerSolver; + sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme* EulerSolver; this->getContext()->get(EulerSolver); factInt = 1.0; // christian : it is not a compliance... but an admittance that is computed ! if (EulerSolver) factInt = EulerSolver->getPositionIntegrationFactor(); // here, we compute a compliance @@ -262,7 +262,7 @@ void PrecomputedWarpPreconditioner::loadMatrixWithSolver() ss << this->getContext()->getName() << "-" << systemSize << "-" << dt << ((sizeof(Real)==sizeof(float)) ? ".compf" : ".comp"); std::ifstream compFileIn(ss.str().c_str(), std::ifstream::binary); - sofa::component::odesolver::backward::EulerImplicitSolver* EulerSolver; + sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme* EulerSolver; this->getContext()->get(EulerSolver); // for the initial computation, the gravity has to be put at 0 @@ -288,13 +288,13 @@ void PrecomputedWarpPreconditioner::loadMatrixWithSolver() if(EulerSolver && CGlinearSolver) { - msg_info() << "use EulerImplicitSolver & CGLinearSolver"; + msg_info() << "use EulerImplicitIntegrationScheme & CGLinearSolver"; } else if(EulerSolver && linearSolver) { - msg_info() << "use EulerImplicitSolver & LinearSolver"; + msg_info() << "use EulerImplicitIntegrationScheme & LinearSolver"; } else if(EulerSolver) { - msg_info() << "use EulerImplicitSolver"; + msg_info() << "use EulerImplicitIntegrationScheme"; } else { - msg_error() << "PrecomputedContactCorrection must be associated with EulerImplicitSolver+LinearSolver for the precomputation\nNo Precomputation"; + msg_error() << "PrecomputedContactCorrection must be associated with EulerImplicitIntegrationScheme+LinearSolver for the precomputation\nNo Precomputation"; return; } sofa::core::VecDerivId lhId = core::vec_id::write_access::velocity; diff --git a/Sofa/Component/Mapping/NonLinear/tests/SquareDistanceMapping_test.cpp b/Sofa/Component/Mapping/NonLinear/tests/SquareDistanceMapping_test.cpp index f62537fceb7..784dd96306e 100644 --- a/Sofa/Component/Mapping/NonLinear/tests/SquareDistanceMapping_test.cpp +++ b/Sofa/Component/Mapping/NonLinear/tests/SquareDistanceMapping_test.cpp @@ -163,7 +163,7 @@ struct SquareDistanceMappingCompare_test : NumericTest for (const auto& node : {oneMapping, twoMappings}) { - simpleapi::createObject(node, "EulerImplicitSolver", {{"rayleighStiffness", "0.1"}, {"rayleighMass","0.1"}}); + simpleapi::createObject(node, "EulerImplicitIntegrationScheme", {{"rayleighStiffness", "0.1"}, {"rayleighMass","0.1"}}); simpleapi::createObject(node, "EdgeSetTopologyContainer", {{"position", "@../loader.position"}, {"edges", "@../loader.edges"}, {"name", "topology"}}); simpleapi::createObject(node, "MechanicalObject", {{"name", "defoDOF"}, {"template", "Vec3"}}); diff --git a/Sofa/Component/MechanicalLoad/tests/CMakeLists.txt b/Sofa/Component/MechanicalLoad/tests/CMakeLists.txt index 7142932158d..7a61bb79ca6 100644 --- a/Sofa/Component/MechanicalLoad/tests/CMakeLists.txt +++ b/Sofa/Component/MechanicalLoad/tests/CMakeLists.txt @@ -14,7 +14,7 @@ set(SOURCE_FILES add_executable(${PROJECT_NAME} ${SOURCE_FILES}) add_definitions("-DSOFA_COMPONENT_MECHANICALLOAD_TEST_SCENES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/scenes\"") target_link_libraries(${PROJECT_NAME} Sofa.Testing Sofa.Component.SolidMechanics.Testing SceneCreator) -target_link_libraries(${PROJECT_NAME} Sofa.Component.MechanicalLoad Sofa.Component.StateContainer Sofa.Component.LinearSolver.Iterative Sofa.Component.ODESolver.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass Sofa.Component.Topology.Container.Dynamic Sofa.Component.Constraint.Projective) +target_link_libraries(${PROJECT_NAME} Sofa.Component.MechanicalLoad Sofa.Component.StateContainer Sofa.Component.LinearSolver.Iterative Sofa.Component.IntegrationScheme.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass Sofa.Component.Topology.Container.Dynamic Sofa.Component.Constraint.Projective) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/Sofa/Component/MechanicalLoad/tests/ConstantForceField_test.cpp b/Sofa/Component/MechanicalLoad/tests/ConstantForceField_test.cpp index 601f3426ac4..496ee7460f5 100644 --- a/Sofa/Component/MechanicalLoad/tests/ConstantForceField_test.cpp +++ b/Sofa/Component/MechanicalLoad/tests/ConstantForceField_test.cpp @@ -75,7 +75,7 @@ struct ConstantForceField_test : public BaseSimulationTest, NumericTestloadPlugins({ - Sofa.Component.ODESolver, + Sofa.Component.IntegrationScheme, Sofa.Component.StateContainer, Sofa.Component.MechanicalLoad, Sofa.Component.LinearSolver.Iterative, @@ -97,7 +97,7 @@ struct ConstantForceField_test : public BaseSimulationTest, NumericTest \n" " \n" " \n" - " \n" + " \n" " \n" " \n" " \n" diff --git a/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp b/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp index 20eced1a952..03c28510e93 100644 --- a/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp +++ b/Sofa/Component/MechanicalLoad/tests/PlaneForceField_test.cpp @@ -39,7 +39,7 @@ using sofa::simulation::SceneLoaderXML ; #include #include -#include +#include #include #include @@ -76,7 +76,7 @@ using sofa::component::mechanicalload::PlaneForceField ; using sofa::component::statecontainer::MechanicalObject ; -using sofa::component::odesolver::backward::EulerImplicitSolver ; +using sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme ; template struct TypeTuple @@ -102,7 +102,7 @@ struct PlaneForceField_test : public BaseSimulationTest typedef CGLinearSolver CGLinearSolverType; typedef PlaneForceField PlaneForceFieldType; typedef MechanicalObject MechanicalObjectType; - typedef EulerImplicitSolver EulerImplicitSolverType; + typedef EulerImplicitIntegrationScheme EulerImplicitIntegrationSchemeType; typedef UniformMass TypedUniformMass; /// Root of the scene graph, created by the constructor and re-used in the tests @@ -136,8 +136,8 @@ struct PlaneForceField_test : public BaseSimulationTest m_root = m_simulation->createNewGraph("root"); m_root->setGravity(Vec3d(-9.8, 0.0,0.0)); - const typename EulerImplicitSolverType::SPtr eulerImplicitSolver = New(); - m_root->addObject(eulerImplicitSolver); + const typename EulerImplicitIntegrationSchemeType::SPtr EulerImplicitIntegrationScheme = New(); + m_root->addObject(EulerImplicitIntegrationScheme); const typename CGLinearSolverType::SPtr cgLinearSolver = New(); m_root->addObject(cgLinearSolver); diff --git a/Sofa/Component/ODESolver/Backward/CMakeLists.txt b/Sofa/Component/ODESolver/Backward/CMakeLists.txt deleted file mode 100644 index b72d2fc093c..00000000000 --- a/Sofa/Component/ODESolver/Backward/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -cmake_minimum_required(VERSION 3.22) -project(Sofa.Component.ODESolver.Backward LANGUAGES CXX) - -set(SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR "src/sofa/component/odesolver/backward") - -set(HEADER_FILES - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/config.h.in - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/init.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/BaseLinearMultiStepMethod.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/BDFOdeSolver.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/EulerImplicitSolver.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/NewmarkImplicitSolver.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/NewtonRaphsonSolver.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/NewtonStatus.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/StaticSolver.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/VariationalSymplecticSolver.h - - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/AbsoluteConvergenceMeasure.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/AbsoluteEstimateDifferenceMeasure.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/NewtonRaphsonConvergenceMeasure.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/RelativeEstimateDifferenceMeasure.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/RelativeInitialConvergenceMeasure.h - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/convergence/RelativeSuccessiveConvergenceMeasure.h -) - -set(SOURCE_FILES - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/init.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/BaseLinearMultiStepMethod.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/BDFOdeSolver.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/EulerImplicitSolver.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/NewmarkImplicitSolver.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/NewtonRaphsonSolver.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/StaticSolver.cpp - ${SOFACOMPONENTODESOLVERBACKWARD_SOURCE_DIR}/VariationalSymplecticSolver.cpp -) - -sofa_find_package(Sofa.Simulation.Core REQUIRED) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core) - -sofa_create_package_with_targets( - PACKAGE_NAME ${PROJECT_NAME} - PACKAGE_VERSION ${Sofa_VERSION} - TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES - INCLUDE_SOURCE_DIR "src" - INCLUDE_INSTALL_DIR "${PROJECT_NAME}" -) - -cmake_dependent_option(SOFA_COMPONENT_ODESOLVER_BACKWARD_BUILD_TESTS "Compile the automatic tests" ON "SOFA_BUILD_TESTS OR NOT DEFINED SOFA_BUILD_TESTS" OFF) -if(SOFA_COMPONENT_ODESOLVER_BACKWARD_BUILD_TESTS) - add_subdirectory(tests) -endif() diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.cpp deleted file mode 100644 index 635a16bb571..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BDFOdeSolver.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -#include - -namespace sofa::component::odesolver::backward -{ - -void registerBDFOdeSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData( - "Velocity-based ODE solver using Backward Differentiation Formula (BDF), at any order, supporting variable time step size.") - .add()); -} - -BDFOdeSolver::BDFOdeSolver() -{ - this->addUpdateCallback("checkOrder", {&d_order}, [this](const core::DataTracker& ) - { - auto order = sofa::helper::getWriteAccessor(d_order); - if (order > 6) - { - msg_warning() << "The method with order " << order << " is not zero-stable"; - } - else if (order == 0) - { - msg_warning() << "The method cannot have order 0. Setting it to 1."; - order.wref() = 1; - } - return this->getComponentState(); - }, {}); -} - -void BDFOdeSolver::computeLinearMultiStepCoefficients(const std::deque& samples, - sofa::type::vector& a_coef, - sofa::type::vector& b_coef) -{ - assert(samples.size() > 1); - const auto order = samples.size() - 1; - assert(order >= 1); - - a_coef.resize(order+1); - b_coef.resize(order+1); - - /** - * Computation of the derivative of the Lagrange inteperpolation polynomials - */ - for (std::size_t j = 0; j < order+1; ++j) - { - auto& a_j = a_coef[j]; - - a_j = 0; - for (std::size_t i = 0; i < order+1; ++i) - { - if (i != j) - { - SReal product = 1_sreal; - for (std::size_t m = 0; m < order + 1; ++m) - { - if (m != i && m != j) - { - product *= (samples[order] - samples[m]) / (samples[j] - samples[m]); - } - } - a_j += product / (samples[j] - samples[i]); - } - } - } - - const auto dt = samples.at(samples.size() - 1) - samples.at(samples.size() - 2); - - for (SReal& j : a_coef) - { - j *= dt; - } - - assert(a_coef[order] != 0); - for (std::size_t j = 0; j < a_coef.size() - 1; ++j) - { - a_coef[j] /= a_coef[order]; - } - b_coef[order] = 1 / a_coef[order]; - a_coef[order] = 1; - - for (std::size_t j = 0; j < b_coef.size() - 1; ++j) - { - b_coef[j] = 0; - } -} - -void BDFOdeSolver::recomputeCoefficients(std::size_t order, SReal dt) -{ - assert(m_timeList.size() == order + 1); - - SOFA_UNUSED(order); - SOFA_UNUSED(dt); - - computeLinearMultiStepCoefficients(m_timeList, m_a_coef, m_b_coef); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.cpp deleted file mode 100644 index 5b1d7acf378..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -namespace sofa::component::odesolver::backward -{ - -BaseLinearMultiStepMethod::BaseLinearMultiStepMethod() - : d_order(initData(&d_order, static_cast(1), "order", "Order of the numerical method")) - , d_rayleighStiffness(initData(&d_rayleighStiffness, 0_sreal, "rayleighStiffness", - "Rayleigh damping coefficient related to stiffness, > 0")) - , d_rayleighMass(initData(&d_rayleighMass, 0_sreal, "rayleighMass", - "Rayleigh damping coefficient related to mass, > 0")) - , l_newtonSolver(initLink("newtonSolver", "Link to a Newton-Raphson solver to solve the nonlinear equation produced by this numerical method")) -{ -} - -void BaseLinearMultiStepMethod::init() -{ - OdeSolver::init(); - LinearSolverAccessor::init(); - - if (!l_newtonSolver.get()) - { - l_newtonSolver.set(getContext()->get( - getContext()->getTags(), core::objectmodel::BaseContext::SearchDown)); - - if (!l_newtonSolver) - { - msg_error() - << "A Newton-Raphson solver is required by this component but has not been found."; - this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); - } - } - - if (auto* context = this->getContext()) - { - m_timeList.push_back(context->getTime()); - } - - if (this->d_componentState.getValue() != core::objectmodel::ComponentState::Invalid) - { - d_componentState.setValue(core::objectmodel::ComponentState::Valid); - } -} - -void BaseLinearMultiStepMethod::reset() -{ - while (!m_timeList.empty()) - { - m_timeList.pop_front(); - } - if (auto* context = this->getContext()) - { - m_timeList.push_back(context->getTime()); - } - - m_currentSolve = 0; -} - -/** - * Represent the mathematical function to be solved by a Newton-Raphson solver. See documentation of - * @BaseNonLinearFunction - * - * The function is r(x) = [r1(x), r2(x)] with - * x = [position, velocity] - * r_1(x) = \sum_{j=0}^s a_j \text{position}_j - h \sum_{j=0}^s b_j \text{velocity}_j - * r_2(x) = \sum_{j=0}^s a_j M \text{velocity}_j - h \sum_{j=0}^s b_j \text{force}_j - */ -struct ResidualFunction : newton_raphson::BaseNonLinearFunction -{ - void evaluateCurrentGuess() override - { - { - SCOPED_TIMER("ComputeForce"); - static constexpr bool clearForcesBeforeComputingThem = true; - static constexpr bool applyBottomUpMappings = true; - - mop.mparams.setX(position[order]); - mop.mparams.setV(velocity[order]); - mop.computeForce(force[order], clearForcesBeforeComputingThem, applyBottomUpMappings); - - //Rayleigh damping - mop.addMBKv(force[order], - core::MatricesFactors::M(-rayleighMass), - core::MatricesFactors::B(0), - core::MatricesFactors::K(rayleighStiffness)); - - mop.projectResponse(force[order]); - } - - core::behavior::MultiVecDeriv r1Vec(&vop, r1); - core::behavior::MultiVecDeriv r2Vec(&vop, r2); - - r1Vec.clear(); - r2Vec.clear(); - - for (unsigned int i = 0; i < order + 1; ++i) - { - if (a_coef[i] != 0) - { - r1Vec.peq(position[i], a_coef[i]); - } - } - for (unsigned int i = 0; i < order + 1; ++i) - { - if (b_coef[i] != 0) - { - r1Vec.peq(velocity[i], -dt * b_coef[i]); - } - } - - core::behavior::MultiVecDeriv velocitySum(&vop); - for (unsigned int i = 0; i < order + 1; ++i) - { - if (a_coef[i] != 0) - { - velocitySum.peq(velocity[i], a_coef[i]); - } - } - mop.addMdx(r2, velocitySum, core::MatricesFactors::M(1).get()); - - for (unsigned int i = 0; i < order + 1; ++i) - { - if (b_coef[i] != 0) - { - r2Vec.peq(force[i], -dt * b_coef[i]); - } - } - - mop.projectResponse(r1); - mop.projectResponse(r2); - } - - SReal squaredNormLastEvaluation() override - { - core::behavior::MultiVecDeriv r2Vec(&vop, r2); - return r2Vec.dot(r2Vec); - } - - void computeGradientFromCurrentGuess() override - { - const core::MatricesFactors::M m(a_coef[order] + dt * b_coef[order] * rayleighMass); - const core::MatricesFactors::B b(-dt * b_coef[order]); - const core::MatricesFactors::K k(-dt * b_coef[order] * (rayleighStiffness + dt * b_coef[order] / a_coef[order])); - - mop.setSystemMBKMatrix(m, b, k, linearSolver); - - core::behavior::MultiVecDeriv rhsVec(&vop, rhs); - rhsVec.eq(r2, -1); - - // rhs += -dt * (bs /as) * K * r1 - { - const auto vBackup = mop.mparams.v(); - mop.mparams.setV(r1); - mop.addMBKv(rhs, core::MatricesFactors::M(0), core::MatricesFactors::B(0), - core::MatricesFactors::K(-dt * b_coef[order] / a_coef[order])); - mop.mparams.setV(vBackup); - } - - mop.projectResponse(rhs); - } - - void updateGuessFromLinearSolution(SReal alpha) override - { - vop.v_peq(velocity[order], dv, alpha); - computeDxFromDv(); - vop.v_peq(position[order], dx); - - mop.projectPositionAndVelocity(position[order], velocity[order]); - mop.propagateXAndV(position[order], velocity[order]); - } - - void solveLinearEquation() override - { - vop.v_clear(dv); - - linearSolver->getLinearSystem()->setSystemSolution(dv); - linearSolver->getLinearSystem()->setRHS(rhs); - linearSolver->solveSystem(); - linearSolver->getLinearSystem()->dispatchSystemSolution(dv); - } - - void computeDxFromDv() - { - core::behavior::MultiVecDeriv dxVec(&vop, dx); - dxVec.eq(dv, dt * b_coef[order] / a_coef[order]); - dxVec.peq(r1, - 1 / a_coef[order]); - } - - SReal squaredNormDx() override - { - core::behavior::MultiVecDeriv dvVec(&vop, dv); - return dvVec.dot(dvVec); - } - - SReal squaredLastEvaluation() override - { - core::behavior::MultiVecDeriv v(&vop, velocity[order]); - return v.dot(v); - } - - std::size_t order = 1; - sofa::type::vector a_coef; - sofa::type::vector b_coef; - SReal dt = 0; - SReal rayleighStiffness = 0; - SReal rayleighMass = 0; - sofa::simulation::common::MechanicalOperations& mop; - simulation::common::VectorOperations& vop; - sofa::type::vector position; - sofa::type::vector velocity; - sofa::type::vector force; - core::MultiVecDerivId r1; - core::MultiVecDerivId r2; - core::MultiVecDerivId dx; - core::MultiVecDerivId dv; - core::MultiVecDerivId rhs; - core::behavior::LinearSolver* linearSolver { nullptr }; - - ResidualFunction(sofa::simulation::common::MechanicalOperations& mop, - simulation::common::VectorOperations& vop) - : mop(mop), vop(vop) - { - } -}; - -void BaseLinearMultiStepMethod::solve( - const core::ExecParams* params, SReal dt, - core::MultiVecCoordId xResult, - core::MultiVecDerivId vResult) -{ - if (!isComponentStateValid()) - { - return; - } - - /** - * High-order methods requires an amount of previous time steps. At the begining of the simulation, - * those time steps are not yet computed. Therefore, the order is reduced to the appropriate order. - */ - const auto order = std::max(std::min(d_order.getValue(), m_currentSolve + 1), static_cast(1)); - - /** - * Save the time into a list of size order - */ - if (auto* context = this->getContext()) - { - m_timeList.push_back(context->getTime() + dt); - while (m_timeList.size() > order + 1) - { - m_timeList.pop_front(); - } - } - - recomputeCoefficients(order, dt); - - - // Create the vector and mechanical operations tools. These are used to execute special - // operations (multiplication, additions, etc.) on multi-vectors (a vector that is stored - // in different buffers inside the mechanical objects) - sofa::simulation::common::VectorOperations vop(params, this->getContext()); - sofa::simulation::common::MechanicalOperations mop(params, this->getContext()); - mop->setImplicit(true); - - { - core::behavior::MultiVecDeriv dx(&vop, sofa::core::vec_id::write_access::dx); - dx.realloc(&vop, false, true); - } - - m_position.resize(order + 1); - m_velocity.resize(order + 1); - m_force.resize(order + 1); - - m_position[order-1] = xResult; - m_velocity[order-1] = vResult; - m_force[order-1] = sofa::core::vec_id::write_access::force; - - for (unsigned int i = 0; i < order + 1; ++i) - { - if (i != order - 1) - { - realloc(vop, m_position[i], "x+" + std::to_string(i)); - realloc(vop, m_velocity[i], "v+" + std::to_string(i)); - realloc(vop, m_force[i], "f+" + std::to_string(i)); - } - } - - realloc(vop, m_r1, "r1"); - realloc(vop, m_r2, "r2"); - realloc(vop, m_rhs, "rhs"); - realloc(vop, m_dv, "dv"); - - //initial guess - vop.v_eq(m_position[order], m_position[order - 1]); - vop.v_eq(m_velocity[order], m_velocity[order - 1]); - - //prediction using the previous velocity - vop.v_peq(m_position[order], m_velocity[order], dt); - - mop.propagateX(m_position[order]); - mop.propagateV(m_velocity[order]); - - ResidualFunction residualFunction(mop, vop); - residualFunction.order = order; - residualFunction.a_coef = m_a_coef; - residualFunction.b_coef = m_b_coef; - residualFunction.dt = dt; - residualFunction.rayleighMass = d_rayleighMass.getValue(); - residualFunction.rayleighStiffness = d_rayleighStiffness.getValue(); - residualFunction.position = m_position; - residualFunction.velocity = m_velocity; - residualFunction.force = m_force; - residualFunction.r1 = m_r1; - residualFunction.r2 = m_r2; - residualFunction.dx = sofa::core::vec_id::write_access::dx; - residualFunction.dv = m_dv; - residualFunction.rhs = m_rhs; - residualFunction.linearSolver = l_linearSolver.get(); - - l_newtonSolver->solve(residualFunction); - - //update state - for (unsigned int i = 0; i < order; ++i) - { - vop.v_eq(m_velocity[i], m_velocity[i+1]); - vop.v_eq(m_position[i], m_position[i+1]); - vop.v_eq(m_force[i], m_force[i+1]); - } - - ++m_currentSolve; -} - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h deleted file mode 100644 index 8028f8b3ec8..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/BaseLinearMultiStepMethod.h +++ /dev/null @@ -1,120 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -namespace sofa::component::odesolver::backward -{ - -/** - * Base class for a linear multistep method - * - * Generic class computing a residual based on any coefficients given by a linear multistep method. - * Derived class just have to define the coefficients. - * - * A linear multistep method is defined by: - * $$ - * \sum_{j=0}^s a_j y_{n+j} = h\sum_{j=0}^s b_j f(t_{n+j},y_{n+j}) - * $$ - * - * The coefficients a and b are class members and must be computed by derived classes. - * - * The linear system from the Newton-Raphson solver is solved in 2 steps: - * 1) A first linear system leads to solve for a velocity difference - * 2) Based on the velocity, the position is computed - */ -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API BaseLinearMultiStepMethod : - public core::behavior::OdeSolver, - public core::behavior::LinearSolverAccessor -{ -public: - SOFA_CLASS2(BaseLinearMultiStepMethod, core::behavior::OdeSolver, - core::behavior::LinearSolverAccessor); - - BaseLinearMultiStepMethod(); - - void init() override; - void reset() override; - void solve(const core::ExecParams* params, SReal dt, - core::MultiVecCoordId xResult, - core::MultiVecDerivId vResult) final; - - Data d_order; - - Data d_rayleighStiffness; - Data d_rayleighMass; - - SingleLink l_newtonSolver; - -protected: - - template - void realloc(sofa::simulation::common::VectorOperations& vop, - core::TMultiVecId& id, - const std::string& vecIdName) - { - sofa::core::behavior::TMultiVec vec(&vop, id); - vec.realloc(&vop, false, true, core::VecIdProperties{vecIdName, this->getClassName()}); - id = vec.id(); - } - - std::deque m_timeList; - - std::size_t m_currentSolve { 0 }; - - // list of coefficients of the linear multistep method corresponding to a in the formula - sofa::type::vector m_a_coef; - // list of coefficients of the linear multistep method corresponding to b in the formula - sofa::type::vector m_b_coef; - - // recompute coefficients a and b - virtual void recomputeCoefficients(std::size_t order, SReal dt) = 0; - -private: - - /** - * Multiple vectors must be defined: - * - The residual is divided into two terms r1 and r2 - * - The right-hand side of the linear system - * - The solution of the linear system (dv) - */ - sofa::core::MultiVecDerivId m_r1, m_r2, m_rhs, m_dv; - - // depending on the order of the method, position must be stored from previous time steps - sofa::type::vector m_position; - // depending on the order of the method, velocity must be stored from previous time steps - sofa::type::vector m_velocity; - // depending on the order of the method, force must be stored from previous time steps - sofa::type::vector m_force; - -}; - - - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.cpp deleted file mode 100644 index d58a5a71f72..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include - -#include - -namespace sofa::component::odesolver::backward -{ - -using core::VecId; -using namespace sofa::defaulttype; -using namespace core::behavior; - -EulerImplicitSolver::EulerImplicitSolver() - : d_rayleighStiffness(initData(&d_rayleighStiffness, (SReal)0.0, "rayleighStiffness", "Rayleigh damping coefficient related to stiffness, > 0") ) - , d_rayleighMass(initData(&d_rayleighMass, (SReal)0.0, "rayleighMass", "Rayleigh damping coefficient related to mass, > 0")) - , d_velocityDamping(initData(&d_velocityDamping, (SReal)0.0, "vdamping", "Velocity decay coefficient (no decay if null)") ) - , d_firstOrder (initData(&d_firstOrder, false, "firstOrder", "Use backward Euler scheme for first order ODE system, which means that only the first derivative of the DOFs (state) appears in the equation. Higher derivatives are absent")) - , d_trapezoidalScheme( initData(&d_trapezoidalScheme,false,"trapezoidalScheme","Boolean to use the trapezoidal scheme instead of the implicit Euler scheme and get second order accuracy in time (false by default)") ) - , d_solveConstraint(initData(&d_solveConstraint, false, "solveConstraint", "Apply ConstraintSolver (requires a ConstraintSolver in the same node as this solver, disabled by by default for now)") ) - , d_threadSafeVisitor(initData(&d_threadSafeVisitor, false, "threadSafeVisitor", "If true, do not use realloc and free visitors in fwdInteractionForceField.")) - , d_computeResidual(initData(&d_computeResidual, false, "computeResidual", "If true, the residual is computed at the end of the solving")) - , d_residual(initData(&d_residual, std::numeric_limits::max(), "residual", "Residual norm at the end of the free-motion solving")) -{ -} - -void EulerImplicitSolver::init() -{ - sofa::core::behavior::OdeSolver::init(); - sofa::core::behavior::LinearSolverAccessor::init(); - - if (!this->getTags().empty()) - { - msg_info() << "Responsible for the following objects with tags " << this->getTags() << " :"; - type::vector objs; - this->getContext()->get(&objs,this->getTags(),sofa::core::objectmodel::BaseContext::SearchDown); - for (const auto* obj : objs) - { - msg_info() << " " << obj->getClassName() << ' ' << obj->getName(); - } - } - - simulation::common::VectorOperations vop(sofa::core::execparams::defaultInstance(), this->getContext()); - reallocSolutionVector(&vop); - reallocRightHandSideVector(&vop); -} - -void EulerImplicitSolver::cleanup() -{ - // free the locally created vectors (including eventual external mechanical states linked by an InteractionForceField) - sofa::simulation::common::VectorOperations vop( core::execparams::defaultInstance(), this->getContext() ); - vop.v_free(x.id(), !d_threadSafeVisitor.getValue(), true); - vop.v_free(b.id(), !d_threadSafeVisitor.getValue(), true); - vop.v_free(m_residual.id(), !d_threadSafeVisitor.getValue(), true); -} - -void EulerImplicitSolver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) -{ - m_mappingGraph.build(this->getContext()); - -#ifdef SOFA_DUMP_VISITOR_INFO - sofa::simulation::Visitor::printNode("SolverVectorAllocation"); -#endif - sofa::simulation::common::VectorOperations vop( params, this->getContext() ); - sofa::simulation::common::MappingGraphMechanicalOperations mop( params, this->getContext() ); - MultiVecCoord pos(&vop, core::vec_id::write_access::position ); - MultiVecDeriv vel(&vop, core::vec_id::write_access::velocity ); - MultiVecDeriv f(&vop, core::vec_id::write_access::force ); - MultiVecCoord newPos(&vop, xResult ); - MultiVecDeriv newVel(&vop, vResult ); - - /// inform the constraint parameters about the position and velocity id - mop.cparams.setX(xResult); - mop.cparams.setV(vResult); - - // dx is no longer allocated by default (but it will be deleted automatically by the mechanical objects) - MultiVecDeriv dx(&vop, core::vec_id::write_access::dx); - dx.realloc(&vop, !d_threadSafeVisitor.getValue(), true); - - reallocSolutionVector(&vop); - reallocRightHandSideVector(&vop); - -#ifdef SOFA_DUMP_VISITOR_INFO - sofa::simulation::Visitor::printCloseNode("SolverVectorAllocation"); -#endif - - - const SReal& h = dt; - const bool firstOrder = d_firstOrder.getValue(); - - // the only difference for the trapezoidal rule is the factor tr = 0.5 for some usages of h - const bool optTrapezoidal = d_trapezoidalScheme.getValue(); - SReal tr; - if (optTrapezoidal) - tr = 0.5; - else - tr = 1.0; - - msg_info() << "trapezoidal factor = " << tr; - - { - SCOPED_TIMER("ComputeForce"); - mop->setImplicit(true); // this solver is implicit - // compute the net forces at the beginning of the time step - mop.computeForce(m_mappingGraph, f, true, true, nullptr); - - msg_info() << "initial f = " << f; - } - - { - SCOPED_TIMER("ComputeRHTerm"); - if (firstOrder) - { - b.eq(f); // b = f - } - else - { - // new more powerful visitors - - // force in the current configuration - b.eq(f); // b = f - - msg_info() << "f = " << f; - - // add the change of force due to stiffness + Rayleigh damping - mop.addMBKv(m_mappingGraph, b, core::MatricesFactors::M(-d_rayleighMass.getValue()), - core::MatricesFactors::B(0), - core::MatricesFactors::K(h * tr + d_rayleighStiffness.getValue())); // b = f + ( rm M + (h+rs) K ) v - - // integration over a time step - b.teq(h); // b = h(f + ( rm M + (h+rs) K ) v ) - } - - msg_info() << "b = " << b; - - mop.projectResponse(m_mappingGraph, b); // b is projected to the constrained space - - msg_info() << "projected b = " << b; - } - - { - SCOPED_TIMER("setSystemMBKMatrix"); - const core::MatricesFactors::M mFact (firstOrder ? 1 : 1 + tr * h * d_rayleighMass.getValue()); - const core::MatricesFactors::B bFact (firstOrder ? 0 : -tr * h); - const core::MatricesFactors::K kFact (firstOrder ? -h * tr : -tr * h * (tr * h + d_rayleighStiffness.getValue())); - - mop.setSystemMBKMatrix(mFact, bFact, kFact, l_linearSolver.get()); - -#ifdef SOFA_DUMP_VISITOR_INFO - simulation::Visitor::printNode("SystemSolution"); -#endif - } - - { - SCOPED_TIMER("MBKSolve"); - - l_linearSolver->getLinearSystem()->setSystemSolution(x); - l_linearSolver->getLinearSystem()->setRHS(b); - l_linearSolver->solveSystem(); - l_linearSolver->getLinearSystem()->dispatchSystemSolution(x); - } -#ifdef SOFA_DUMP_VISITOR_INFO - simulation::Visitor::printCloseNode("SystemSolution"); -#endif - - // mop.projectResponse(x); - // x is the solution of the system - // apply the solution - - const bool solveConstraint = d_solveConstraint.getValue(); - -#ifndef SOFA_NO_VMULTIOP // unoptimized version - if (solveConstraint) -#endif - { - if (firstOrder) - { - const char* prevStep = "UpdateV"; - sofa::helper::AdvancedTimer::stepBegin(prevStep); -#define SOFATIMER_NEXTSTEP(s) { sofa::helper::AdvancedTimer::stepNext(prevStep,s); prevStep=s; } - - newVel.eq(x); // vel = x - - if (solveConstraint) - { - SOFATIMER_NEXTSTEP("CorrectV"); - mop.solveConstraint(newVel,core::ConstraintOrder::VEL); - } - SOFATIMER_NEXTSTEP("UpdateX"); - - newPos.eq(pos, newVel, h); // pos = pos + h vel - - if (solveConstraint) - { - SOFATIMER_NEXTSTEP("CorrectX"); - mop.solveConstraint(newPos,core::ConstraintOrder::POS); - } -#undef SOFATIMER_NEXTSTEP - sofa::helper::AdvancedTimer::stepEnd (prevStep); - } - else - { - const char* prevStep = "UpdateV"; - sofa::helper::AdvancedTimer::stepBegin(prevStep); -#define SOFATIMER_NEXTSTEP(s) { sofa::helper::AdvancedTimer::stepNext(prevStep,s); prevStep=s; } - - // v(t+dt) = Δv + v(t) - newVel.eq(vel, x); - - if (solveConstraint) - { - SOFATIMER_NEXTSTEP("CorrectV"); - mop.solveConstraint(newVel,core::ConstraintOrder::VEL); - } - SOFATIMER_NEXTSTEP("UpdateX"); - - // x(t+dt) = x(t) + dt * v(t+dt) - newPos.eq(pos, newVel, h); - - if (solveConstraint) - { - SOFATIMER_NEXTSTEP("CorrectX"); - mop.solveConstraint(newPos,core::ConstraintOrder::POS); - } -#undef SOFATIMER_NEXTSTEP - sofa::helper::AdvancedTimer::stepEnd (prevStep); - } - - } -#ifndef SOFA_NO_VMULTIOP - else - { - typedef core::behavior::BaseMechanicalState::VMultiOp VMultiOp; - VMultiOp ops; - if (firstOrder) - { - ops.resize(2); - ops[0].first = newVel; - ops[0].second.push_back(std::make_pair(x.id(),1.0)); - ops[1].first = newPos; - ops[1].second.push_back(std::make_pair(pos.id(),1.0)); - ops[1].second.push_back(std::make_pair(newVel.id(),h)); - } - else - { - ops.resize(2); - ops[0].first = newVel; - ops[0].second.push_back(std::make_pair(vel.id(),1.0)); - ops[0].second.push_back(std::make_pair(x.id(),1.0)); - ops[1].first = newPos; - ops[1].second.push_back(std::make_pair(pos.id(),1.0)); - ops[1].second.push_back(std::make_pair(newVel.id(),h)); - } - - SCOPED_TIMER_VARNAME(updateVAndXTimer, "UpdateVAndX"); - vop.v_multiop(ops); - if (solveConstraint) - { - { - SCOPED_TIMER_VARNAME(correctVTimer, "CorrectV"); - mop.solveConstraint(newVel,core::ConstraintOrder::VEL); - } - { - SCOPED_TIMER_VARNAME(correctXTimer, "CorrectX"); - mop.solveConstraint(newPos,core::ConstraintOrder::POS); - } - } - } -#endif - - mop.addSeparateGravity(dt, newVel); // v += dt*g . Used if mass wants to add G separately from the other forces to v - - if (d_velocityDamping.getValue() != 0.0) - newVel *= exp(-h * d_velocityDamping.getValue()); - - if( f_printLog.getValue() ) - { - mop.projectPosition(newPos); - mop.projectVelocity(newVel); - mop.propagateX(newPos); - mop.propagateV(newVel); - msg_info() << "final x = " << newPos; - msg_info() << "final v = " << newVel; - mop.computeForce(f); - msg_info() << "final f = " << f; - } - - if (d_computeResidual.getValue()) - { - reallocResidualVector(&vop); - - // r = 0 - vop.v_clear(m_residual); - - // r += M (v - v_n) - { - core::behavior::MultiVecDeriv tmp(&vop); - - vop.v_eq(tmp, newVel); - vop.v_peq(tmp, vel, -1); - mop.addMdx(m_residual, tmp); - } - - // r += - dt * F - mop.computeForce(f); - vop.v_peq(m_residual, f, -dt); - - mop.projectResponse(m_residual); - - vop.v_dot(m_residual, m_residual); - d_residual.setValue(vop.finish()); - - msg_info() << "Residual norm: " << std::setw(6) << vop.finish(); - } -} - - -SReal EulerImplicitSolver::getPositionIntegrationFactor() const -{ - return getPositionIntegrationFactor(getContext()->getDt()); -} - -SReal EulerImplicitSolver::getIntegrationFactor(int inputDerivative, int outputDerivative) const -{ - return getIntegrationFactor(inputDerivative, outputDerivative, getContext()->getDt()); -} - -SReal EulerImplicitSolver::getIntegrationFactor(int inputDerivative, int outputDerivative, SReal dt) const -{ - const SReal matrix[3][3] = - { - { 1, dt, 0}, - { 0, 1, 0}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; -} - -SReal EulerImplicitSolver::getSolutionIntegrationFactor(int outputDerivative) const -{ - return getSolutionIntegrationFactor(outputDerivative, getContext()->getDt()); -} - -SReal EulerImplicitSolver::getSolutionIntegrationFactor(int outputDerivative, SReal dt) const -{ - const SReal vect[3] = {dt, 1, 1 / dt}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; -} - -void EulerImplicitSolver::reallocSolutionVector(sofa::simulation::common::VectorOperations* vop) -{ - x.realloc(vop, !d_threadSafeVisitor.getValue(), true, - core::VecIdProperties{.label = "solution", .group = GetClass()->className}); -} -void EulerImplicitSolver::reallocRightHandSideVector(sofa::simulation::common::VectorOperations* vop) -{ - b.realloc(vop, !d_threadSafeVisitor.getValue(), true, - core::VecIdProperties{.label = "RHS", .group = GetClass()->className}); -} -void EulerImplicitSolver::reallocResidualVector(sofa::simulation::common::VectorOperations* vop) -{ - m_residual.realloc(vop, !d_threadSafeVisitor.getValue(), true, - core::VecIdProperties{.label = "residual", .group = GetClass()->className}); -} - -void registerEulerImplicitSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData("Time integrator using implicit backward Euler scheme.") - .add< EulerImplicitSolver >()); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.h deleted file mode 100644 index a42f7685b79..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/EulerImplicitSolver.h +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include -#include -#include -#include - -namespace sofa::simulation::common -{ -class VectorOperations; -} -namespace sofa::component::odesolver::backward -{ - -/** Semi-implicit time integrator using backward Euler scheme for first and second degree ODEs. (default: second) - * - *** 2nd Order *** - * - * This is based on [Baraff and Witkin, Large Steps in Cloth Simulation, SIGGRAPH 1998] - * The integration scheme is based on the following equations: - * - * \f$x_{t+h} = x_t + h v_{t+h}\f$ - * \f$v_{t+h} = v_t + h a_{t+h}\f$ - * - * The unknown is - * \f$v_{t+h} - v_t = dv\f$ - * - * Newton's law is - * \f$ M dv = h f(t+h) \f$ - * \f$ M dv = h ( f(t) + K dx + (B - r_M M + r_K K) (v+dv) )\f$ - * \f$ M dv = h ( f(t) + K h (v+dv) + (B - r_M M + r_K K) (v+dv) )\f$ - * - * \f$ M \f$ is the mass matrix. - * \f$ K = df/dx \f$ is the stiffness implemented (or not) by the force fields. - * \f$ B = df/dv \f$ is the damping implemented (or not) by the force fields. - * An additional, uniform Rayleigh damping \f$- r_M M + r_K K\f$ is imposed by the solver. - * - * This corresponds to the following equation system: - * - * \f$ ( (1+h r_M) M - h B - h(h + r_K) K ) dv = h ( f(t) + (h+r_K) K v + B v - r_M M v )\f$ - * - * Moreover, the projective constraints filter out the forbidden motions. - * This is equivalent with multiplying vectors with a projection matrix \f$P\f$. - * Finally, the equation system set by this ode solver is: - * - * \f$ P ( (1+h r_M) M - h B - h(h + r_K) K ) P dv = P h ( f(t) + (h + r_K) K v + B v - r_M M v )\f$ - * - *** 1st Order *** - * - * This integration scheme is based on the following equation: - * - * \f$x_{t+h} = x_t + h v_{t+h}\f$ - * - * Applied to this mechanical system: - * - * \f$ M v_t = f_{ext} \f$ - * - * \f$ M v_{t+h} = f_{ext_{t+h}} \f$ - * \f$ = f_{ext_{t}} + h (df_{ext}/dt)_{t+h} \f$ - * \f$ = f_{ext_{t}} + h (df_{ext}/dx)_{t+h} v_{t+h} \f$ - * \f$ = f_{ext_{t}} - h K v_{t+h} \f$ - * - * \f$ ( M + h K ) v_{t+h} = f_{ext} \f$ - * - * - *** Trapezoidal Rule *** - * - * The trapezoidal scheme is based on - * - * \f$v_{t+h} = h/2 ( f(t+h) + f(t) )\f$ - * - * With this and the same techniques as for the implicit Euler scheme we receive for *** 2nd Order *** equations - * - * \f$ P ( (1+h/2 r_M) M - h/2 B - h/2 (h + r_K) K ) P dv = P h/2 ( 2 f(t) + (h + r_K) K v + B v - r_M M v )\f$ - * - * and for *** 1st Order *** - * - * \f$ ( M + h/2 K ) v_{t+h} = f_{ext} \f$ - * - */ -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API EulerImplicitSolver : - public sofa::core::behavior::OdeSolver, - public sofa::core::behavior::LinearSolverAccessor -{ -public: - SOFA_CLASS2(EulerImplicitSolver, sofa::core::behavior::OdeSolver, sofa::core::behavior::LinearSolverAccessor); - - Data d_rayleighStiffness; ///< Rayleigh damping coefficient related to stiffness, > 0 - Data d_rayleighMass; ///< Rayleigh damping coefficient related to mass, > 0 - Data d_velocityDamping; ///< Velocity decay coefficient (no decay if null) - Data d_firstOrder; ///< Use backward Euler scheme for first order ODE system, which means that only the first derivative of the DOFs (state) appears in the equation. Higher derivatives are absent - Data d_trapezoidalScheme; ///< Boolean to use the trapezoidal scheme instead of the implicit Euler scheme and get second order accuracy in time (false by default) - Data d_solveConstraint; ///< Apply ConstraintSolver (requires a ConstraintSolver in the same node as this solver, disabled by by default for now) - Data d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField. - - Data d_computeResidual; ///< If true, the residual is computed at the end of the solving - Data d_residual; ///< Residual norm at the end of the free-motion solving - -protected: - EulerImplicitSolver(); -public: - void init() override; - - void cleanup() override; - - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - - /// Given a displacement as computed by the linear system inversion, how much will it affect the velocity - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt. - SReal getVelocityIntegrationFactor() const override { return 1.0; } - - /// Given a displacement as computed by the linear system inversion, how much will it affect the position - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt². - SReal getPositionIntegrationFactor() const override ; - - virtual SReal getPositionIntegrationFactor(SReal dt ) const { return dt; } - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - /// - /// This method is used to compute the compliance for contact corrections. - /// For example, a backward-Euler dynamic implicit integrator would use: - /// Input: x_t v_t a_{t+dt} - /// x_{t+dt} 1 dt dt^2 - /// v_{t+dt} 0 1 dt - /// - /// If the linear system is expressed on s = a_{t+dt} dt, then the final factors are: - /// Input: x_t v_t a_t s - /// x_{t+dt} 1 dt 0 dt - /// v_{t+dt} 0 1 0 1 - /// a_{t+dt} 0 0 0 1/dt - /// The last column is returned by the getSolutionIntegrationFactor method. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override ; - - SReal getIntegrationFactor(int inputDerivative, int outputDerivative, SReal dt) const ; - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - SReal getSolutionIntegrationFactor(int outputDerivative) const override ; - - SReal getSolutionIntegrationFactor(int outputDerivative, SReal dt) const ; - -protected: - - /// the solution vector is stored for warm-start - core::behavior::MultiVecDeriv x; - - /// Right-hand side vector - core::behavior::MultiVecDeriv b; - - /// Residual vector (optionally computed) - core::behavior::MultiVecDeriv m_residual; - - void reallocSolutionVector(sofa::simulation::common::VectorOperations* vop); - void reallocRightHandSideVector(sofa::simulation::common::VectorOperations* vop); - void reallocResidualVector(sofa::simulation::common::VectorOperations* vop); - - sofa::simulation::MappingGraph m_mappingGraph; -}; - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.cpp deleted file mode 100644 index 01b572682b2..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - - - -namespace sofa::component::odesolver::backward -{ - -using core::VecId; -using namespace sofa::defaulttype; -using namespace core::behavior; - -NewmarkImplicitSolver::NewmarkImplicitSolver() - : d_rayleighStiffness(initData(&d_rayleighStiffness, 0_sreal, - "rayleighStiffness", - "Rayleigh damping coefficient related to stiffness")) - , d_rayleighMass(initData(&d_rayleighMass, 0_sreal, "rayleighMass", - "Rayleigh damping coefficient related to mass")) - , d_velocityDamping(initData(&d_velocityDamping, 0_sreal, "vdamping", - "Velocity decay coefficient (no decay if null)")) - , d_gamma(initData(&d_gamma, 0.5_sreal, "gamma", - "Newmark scheme gamma coefficient")) - , d_beta(initData(&d_beta, 0.25_sreal, "beta", "Newmark scheme beta coefficient")) - , d_threadSafeVisitor(initData(&d_threadSafeVisitor, false, "threadSafeVisitor", "If true, do not use realloc and free visitors in fwdInteractionForceField.")) -{ - cpt=0; -} - - -void NewmarkImplicitSolver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) -{ - sofa::simulation::common::VectorOperations vop( params, this->getContext() ); - sofa::simulation::common::MechanicalOperations mop( params, this->getContext() ); - MultiVecCoord pos(&vop, core::vec_id::write_access::position ); - MultiVecDeriv vel(&vop, core::vec_id::write_access::velocity ); - MultiVecDeriv b(&vop); - MultiVecDeriv aResult(&vop); - MultiVecCoord newPos(&vop, xResult ); - MultiVecDeriv newVel(&vop, vResult ); - - - // dx is no longer allocated by default (but it will be deleted automatically by the mechanical objects) - MultiVecDeriv dx(&vop, core::vec_id::write_access::dx); dx.realloc(&vop, !d_threadSafeVisitor.getValue(), true); - - - const SReal h = dt; - const SReal gamma = d_gamma.getValue(); - const SReal beta = d_beta.getValue(); - const SReal rM = d_rayleighMass.getValue(); - const SReal rK = d_rayleighStiffness.getValue(); - - // 1. Initialize a_t and to store it as a vecId to be used in the resolution of this solver (using as well old xand v) - // Once we have a_{t+dt} we can update the new x and v. - - if (cpt == 0 || this->getContext()->getTime()==0.0) - { - vop.v_alloc(pID); - } - - // Define a - MultiVecDeriv a(&vop, pID); - a.realloc(&vop, !d_threadSafeVisitor.getValue(), true); - - if(cpt == 0) - { - a.clear(); - mop.computeAcc(0,a,pos,vel); - } - cpt++; - - msg_info() << "aPrevious = " << a; - msg_info() << "xPrevious = " << pos; - msg_info() << "vPrevious = " << vel; - - - // 2. Compute right hand term of equation on a_{t+h} - - mop.computeForce(b); - //b = f; - // b = M a - if (rM != 0.0 || rK != 0.0 || beta != 0.5) - { - mop.propagateDx(a); - - // b += (-h (1-\gamma)(r_M M + r_K K) - h^2/2 (1-2\beta) K ) a - mop.addMBKdx(b, - core::MatricesFactors::M(-h*(1-gamma)*rM), - core::MatricesFactors::B(h*(1-gamma)), - core::MatricesFactors::K(h*(1-gamma)*rK + h*h*(1-2*beta)/2.0), - true,true); - } - - // b += -h K v - mop.addMBKv(b, core::MatricesFactors::M(-rM), core::MatricesFactors::B(1), core::MatricesFactors::K(rK+h)); - - msg_info() << "b = " << b; - mop.projectResponse(b); // b is projected to the constrained space - msg_info() << "projected b = " << b; - - - // 3. Solve system of equations on a_{t+h} - - const core::MatricesFactors::M mFact ( 1 + h * gamma * rM); - const core::MatricesFactors::B bFact ( (-h) * gamma); - const core::MatricesFactors::K kFact ( -h * h * beta - h * rK * gamma); - - mop.setSystemMBKMatrix(mFact, bFact, kFact, l_linearSolver.get()); - l_linearSolver->getLinearSystem()->setSystemSolution(aResult); - l_linearSolver->getLinearSystem()->setRHS(b); - l_linearSolver->solveSystem(); - l_linearSolver->getLinearSystem()->dispatchSystemSolution(aResult); - msg_info() << "a1 = " << aResult; - - - // 4. Compute the new position and velocity - -#ifdef SOFA_NO_VMULTIOP // unoptimized version - // x_{t+h} = x_t + h v_t + h^2/2 ( (1-2\beta) a_t + 2\beta a_{t+h} ) - b.eq(vel, a, h*(0.5-beta)); - b.peq(aResult, h*beta); - newPos.eq(pos, b, h); - solveConstraint(dt,xResult,core::ConstraintParams::ConstOrder::POS); - // v_{t+h} = v_t + h ( (1-\gamma) a_t + \gamma a_{t+h} ) - newVel.eq(vel, a, h*(1-gamma)); - newVel.peq(aResult, h*gamma); - solveConstraint(dt,vResult,core::ConstraintParams::ConstOrder::VEL); - -#else // single-operation optimization - typedef core::behavior::BaseMechanicalState::VMultiOp VMultiOp; - - VMultiOp ops; - ops.resize(2); - ops[0].first = newPos; - ops[0].second.push_back(std::make_pair(pos.id(),1.0)); - ops[0].second.push_back(std::make_pair(vel.id(), h)); - ops[0].second.push_back(std::make_pair(a.id(), h*h*(0.5-beta))); - ops[0].second.push_back(std::make_pair(aResult.id(),h*h*beta));//b=vt+at*h/2(1-2*beta)+a(t+h)*h*beta - ops[1].first = newVel; - ops[1].second.push_back(std::make_pair(vel.id(),1.0)); - ops[1].second.push_back(std::make_pair(a.id(), h*(1-gamma))); - ops[1].second.push_back(std::make_pair(aResult.id(),h*gamma));//v(t+h)=vt+at*h*(1-gamma)+a(t+h)*h*gamma - vop.v_multiop(ops); - - mop.solveConstraint(vResult,core::ConstraintOrder::VEL); - mop.solveConstraint(xResult,core::ConstraintOrder::POS); - -#endif - - mop.addSeparateGravity(dt, newVel); // v += dt*g . Used if mass wants to add G separately from the other forces to v. - if (d_velocityDamping.getValue()!=0.0) - newVel *= exp(-h*d_velocityDamping.getValue()); - - - msg_info() << "final x = " << newPos; - msg_info() << "final v = " << newVel; - - // Increment - a.eq(aResult); -} - -void registerNewmarkImplicitSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData("Implicit time integrator using Newmark scheme.") - .add< NewmarkImplicitSolver >()); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.h deleted file mode 100644 index badcc4995d7..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewmarkImplicitSolver.h +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include -#include - -#include - -namespace sofa::component::odesolver::backward -{ - -/** Implicit time integrator using Newmark scheme. - * - * This integration scheme is based on the following equations: - * - * $x_{t+h} = x_t + h v_t + h^2/2 ( (1-2\beta) a_t + 2\beta a_{t+h} )$ - * $v_{t+h} = v_t + h ( (1-\gamma) a_t + \gamma a_{t+h} )$ - * - * Applied to a mechanical system where $ M a_t + (r_M M + r_K K) v_t + K x_t = f_ext$, we need to solve the following system: - * - * $ M a_{t+h} + (r_M M + r_K K) v_{t+h} + K x_{t+h} = f_ext $ - * $ M a_{t+h} + (r_M M + r_K K) ( v_t + h ( (1-\gamma) a_t + \gamma a_{t+h} ) ) + K ( x_t + h v_t + h^2/2 ( (1-2\beta) a_t + 2\beta a_{t+h} ) ) = f_ext $ - * $ ( M + h \gamma (r_M M + r_K K) + h^2 \beta K ) a_{t+h} = f_ext - (r_M M + r_K K) ( v_t + h (1-\gamma) a_t ) - K ( x_t + h v_t + h^2/2 (1-2\beta) a_t ) $ - * $ ( (1 + h \gamma r_M) M + (h^2 \beta + h \gamma r_K) K ) a_{t+h} = f_ext - (r_M M + r_K K) v_t - K x_t - (r_M M + r_K K) ( h (1-\gamma) a_t ) - K ( h v_t + h^2/2 (1-2\beta) a_t ) $ - * $ ( (1 + h \gamma r_M) M + (h^2 \beta + h \gamma r_K) K ) a_{t+h} = a_t - (r_M M + r_K K) ( h (1-\gamma) a_t ) - K ( h v_t + h^2/2 (1-2\beta) a_t ) $ - * - * The current implementation first computes $a_t$ directly (as in the explicit solvers), then solves the previous system to compute $a_{t+dt}$, and finally computes the new position and velocity. - * -*/ -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API NewmarkImplicitSolver - : public sofa::core::behavior::OdeSolver - , public sofa::core::behavior::LinearSolverAccessor -{ -protected: - unsigned int cpt; - sofa::core::MultiVecDerivId pID; - - NewmarkImplicitSolver(); - -public: - SOFA_CLASS2(NewmarkImplicitSolver, sofa::core::behavior::OdeSolver, sofa::core::behavior::LinearSolverAccessor); - Data d_rayleighStiffness; ///< Rayleigh damping coefficient related to stiffness - Data d_rayleighMass; ///< Rayleigh damping coefficient related to mass - Data d_velocityDamping; ///< Velocity decay coefficient (no decay if null) - - Data d_gamma; ///< Newmark scheme gamma coefficient - Data d_beta; ///< Newmark scheme beta coefficient - - Data d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField. - - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - - /// Given a displacement as computed by the linear system inversion, how much will it affect the velocity - SReal getVelocityIntegrationFactor() const override - { - return 1.0; // getContext()->getDt(); - } - - /// Given a displacement as computed by the linear system inversion, how much will it affect the position - SReal getPositionIntegrationFactor() const override - { - return getContext()->getDt(); //*getContext()->getDt()); - } - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - /// - /// This method is used to compute the compliance for contact corrections. - /// For example, a backward-Euler dynamic implicit integrator would use: - /// Input: x_t v_t a_{t+dt} - /// x_{t+dt} 1 dt dt^2 - /// v_{t+dt} 0 1 dt - /// - /// If the linear system is expressed on s = a_{t+dt} dt, then the final factors are: - /// Input: x_t v_t a_t s - /// x_{t+dt} 1 dt 0 dt - /// v_{t+dt} 0 1 0 1 - /// a_{t+dt} 0 0 0 1/dt - /// The last column is returned by the getSolutionIntegrationFactor method. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override - { - const auto dt = getContext()->getDt(); - const SReal matrix[3][3] = - { - { 1, dt, 0}, - { 0, 1, 0}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; - } - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - SReal getSolutionIntegrationFactor(int outputDerivative) const override - { - const auto dt = getContext()->getDt(); - const SReal vect[3] = { dt, 1, 1/dt}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; - } - -}; - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.cpp deleted file mode 100644 index 0a94e9e3643..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace sofa::component::odesolver::backward -{ - -void registerNewtonRaphsonSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData("Generic Newton-Raphson algorithm solving nonlinear equations.") - .add< NewtonRaphsonSolver >()); -} - -static constexpr NewtonStatus defaultStatus("Undefined"); - -NewtonRaphsonSolver::NewtonRaphsonSolver() - : d_maxNbIterationsNewton( - initData(&d_maxNbIterationsNewton, 1u, "maxNbIterationsNewton", - "Maximum number of iterations of the Newton's method if it has not converged.")) - , d_relativeSuccessiveStoppingThreshold(initData( - &d_relativeSuccessiveStoppingThreshold, 1e-5_sreal, "relativeSuccessiveStoppingThreshold", - "Threshold for the relative successive progress criterion. The Newton " - "iterations will stop when the ratio between the norm of the residual " - "at iteration k over the norm of the residual at iteration k-1 is lower" - " than this threshold.")) - , d_relativeInitialStoppingThreshold(initData( - &d_relativeInitialStoppingThreshold, 1e-5_sreal, "relativeInitialStoppingThreshold", - "Threshold for the relative initial progress criterion. The Newton" - " iterations will stop when the ratio between the norm of the residual " - "at iteration k over the norm of the residual at iteration 0 is" - " lower than this threshold. This criterion tracks the overall progress " - "made since the beginning of the iteration process. If the ratio is " - "significantly smaller than 1, it indicates that the iterative process " - "is making substantial progress, and the method is converging toward the" - " root.")) - , d_absoluteResidualStoppingThreshold(initData( - &d_absoluteResidualStoppingThreshold, 1e-5_sreal, "absoluteResidualStoppingThreshold", - "Threshold for the absolute function value stopping criterion. The " - "Newton iterations will stop when the norm of the residual at iteration " - "k is lower than this threshold. This criterion indicates the current " - "iteration found an estimate close to the root.")) - , d_relativeEstimateDifferenceThreshold(initData( - &d_relativeEstimateDifferenceThreshold, 0_sreal, "relativeEstimateDifferenceThreshold", - "Threshold for the relative change in root estimate criterion. The " - "Newton iterations will stop when the difference between two successive " - "estimates divided by the previous estimate is smaller than this threshold")) - , d_absoluteEstimateDifferenceThreshold(initData( - &d_absoluteEstimateDifferenceThreshold, 0_sreal, "absoluteEstimateDifferenceThreshold", - "Threshold for the absolute change in root estimate criterion. The " - "Newton iterations will stop when the difference between two successive " - "estimates is smaller than this threshold.")) - , d_maxNbIterationsLineSearch(initData( - &d_maxNbIterationsLineSearch, 1u, "maxNbIterationsLineSearch", - "Maximum number of iterations of the line search method if it has not converged.")) - , d_lineSearchCoefficient(initData(&d_lineSearchCoefficient, 0.5_sreal, "lineSearchCoefficient", - "Line search coefficient")) - , d_updateStateWhenDiverged(initData(&d_updateStateWhenDiverged, true, - "updateStateWhenDiverged", - "Update the states within the last iteration even if the " - "iterative process is considered diverged.")) - , d_status(initData(&d_status, defaultStatus, "status", - ("status\n" + NewtonStatus::dataDescription()).c_str())) - , d_residualGraph( - initData(&d_residualGraph, "residualGraph", "Graph of the residual over the iterations")) - , d_warnWhenLineSearchFails(initData(&d_warnWhenLineSearchFails, true, "warnWhenLineSearchFails", "Trigger a warning if line search fails")) - , d_warnWhenDiverge(initData(&d_warnWhenDiverge, true, "warnWhenDiverge", "Trigger a warning if Newton-Raphson diverges")) -{ - d_status.setReadOnly(true); - - static std::string groupAnalysis{"Analysis"}; - d_status.setGroup(groupAnalysis); - d_residualGraph.setGroup(groupAnalysis); - - static std::string groupLineSearch{"Line Search"}; - d_maxNbIterationsLineSearch.setGroup(groupLineSearch); - d_lineSearchCoefficient.setGroup(groupLineSearch); - - static std::string groupStoppingCriteria{"Stopping criteria"}; - d_maxNbIterationsNewton.setGroup(groupStoppingCriteria); - d_relativeSuccessiveStoppingThreshold.setGroup(groupStoppingCriteria); - d_relativeInitialStoppingThreshold.setGroup(groupStoppingCriteria); - d_absoluteResidualStoppingThreshold.setGroup(groupStoppingCriteria); - d_relativeEstimateDifferenceThreshold.setGroup(groupStoppingCriteria); - d_absoluteEstimateDifferenceThreshold.setGroup(groupStoppingCriteria); - - d_residualGraph.setWidget("graph"); -} - -void NewtonRaphsonSolver::init() -{ - Inherit1::init(); - - if (this->d_componentState.getValue() != core::objectmodel::ComponentState::Invalid) - { - d_componentState.setValue(core::objectmodel::ComponentState::Valid); - } -} -void NewtonRaphsonSolver::reset() -{ - d_status.setValue(defaultStatus); - - auto graph = sofa::helper::getWriteAccessor(d_residualGraph); - graph->clear(); -} - -void NewtonRaphsonSolver::initialConvergence(SReal squaredResidualNorm, - const SReal squaredAbsoluteStoppingThreshold) -{ - msg_info() << "The equation to solve is satisfied with the initial guess. " - << "The residual squared norm is " << squaredResidualNorm << ". " - << "The threshold for convergence is " << squaredAbsoluteStoppingThreshold; - static constexpr auto convergedEquilibrium = NewtonStatus("ConvergedEquilibrium"); - d_status.setValue(convergedEquilibrium); -} - -bool NewtonRaphsonSolver::measureConvergence(const NewtonRaphsonConvergenceMeasure& measure, - std::stringstream& os) -{ - if (measure.isMeasured()) - { - if (measure.hasConverged()) - { - d_status.setValue(measure.status()); - - msg_info() << os.str(); - msg_info() << "[CONVERGED] " << measure.writeWhenConverged(); - - return true; - } - else - { - const auto print = measure.writeWhenNotConverged(); - if (!print.empty()) - { - os << "\n* " << print; - } - } - } - else if (notMuted()) - { - os << "\n* " << measure.measureName() << ": NOT TESTED"; - } - return false; -} - -void NewtonRaphsonSolver::lineSearchIteration( - newton_raphson::BaseNonLinearFunction& function, SReal& squaredResidualNorm, - SReal lineSearchAlpha) -{ - // compute x^{i+1} += alpha * dx - function.updateGuessFromLinearSolution(lineSearchAlpha); - - // compute r(x^{i+1}) - function.evaluateCurrentGuess(); - - // compute ||r(x^{i+1}|| - squaredResidualNorm = function.squaredNormLastEvaluation(); -} - -struct NewtonIterationRAII -{ - explicit NewtonIterationRAII(newton_raphson::BaseNonLinearFunction& function) : function(function) - { - function.startNewtonIteration(); - } - - ~NewtonIterationRAII() - { - function.endNewtonIteration(); - } - - newton_raphson::BaseNonLinearFunction& function; -}; - -void NewtonRaphsonSolver::solve(newton_raphson::BaseNonLinearFunction& function) -{ - if (!this->isComponentStateValid()) - { - return; - } - - start(); - - const bool printLog = f_printLog.getValue(); - auto graphAccessor = sofa::helper::getWriteAccessor(d_residualGraph); - auto& graph = graphAccessor.wref(); - - auto& residualList = graph["residual"]; - residualList.clear(); - - SReal squaredResidualNorm{}; - { - SCOPED_TIMER("ComputeError"); - - // compute r(x^i) - function.evaluateCurrentGuess(); - - // compute ||r(x^i)|| - squaredResidualNorm = function.squaredNormLastEvaluation(); - - residualList.push_back(squaredResidualNorm); - } - - const auto absoluteStoppingThreshold = d_absoluteResidualStoppingThreshold.getValue(); - const auto squaredAbsoluteStoppingThreshold = std::pow(absoluteStoppingThreshold, 2); - - unsigned int newtonIterationCount = 0; - - if (absoluteStoppingThreshold > 0 && squaredResidualNorm <= squaredAbsoluteStoppingThreshold) - { - initialConvergence(squaredResidualNorm, squaredAbsoluteStoppingThreshold); - } - else - { - msg_info() << "Initial squared residual norm: " << squaredResidualNorm; - - const auto relativeSuccessiveStoppingThreshold = d_relativeSuccessiveStoppingThreshold.getValue(); - - RelativeSuccessiveConvergenceMeasure relativeSuccessiveConvergenceMeasure(relativeSuccessiveStoppingThreshold); - RelativeInitialConvergenceMeasure relativeInitialConvergenceMeasure(d_relativeInitialStoppingThreshold.getValue()); - relativeInitialConvergenceMeasure.firstSquaredResidualNorm = squaredResidualNorm; - AbsoluteConvergenceMeasure absoluteConvergenceMeasure(absoluteStoppingThreshold); - AbsoluteEstimateDifferenceMeasure absoluteEstimateDifferenceMeasure(d_absoluteEstimateDifferenceThreshold.getValue()); - RelativeEstimateDifferenceMeasure relativeEstimateDifferenceMeasure(d_relativeEstimateDifferenceThreshold.getValue()); - - const auto maxNbIterationsNewton = d_maxNbIterationsNewton.getValue(); - const auto maxNbIterationsLineSearch = std::max(d_maxNbIterationsLineSearch.getValue(), 1u); - bool hasConverged = false; - const auto lineSearchCoefficient = d_lineSearchCoefficient.getValue(); - - for (; newtonIterationCount < maxNbIterationsNewton; ++newtonIterationCount) - { - SCOPED_TIMER_VARNAME(step_timer, "NewtonStep"); - NewtonIterationRAII newtonIteration(function); - - msg_info() << "Newton iteration #" << newtonIterationCount; - - const auto previousSquaredResidualNorm = squaredResidualNorm; - - relativeSuccessiveConvergenceMeasure.newtonIterationCount = newtonIterationCount; - relativeInitialConvergenceMeasure.newtonIterationCount = newtonIterationCount; - absoluteConvergenceMeasure.newtonIterationCount = newtonIterationCount; - absoluteEstimateDifferenceMeasure.newtonIterationCount = newtonIterationCount; - relativeEstimateDifferenceMeasure.newtonIterationCount = newtonIterationCount; - - if (relativeEstimateDifferenceMeasure.isMeasured()) - { - relativeEstimateDifferenceMeasure.squaredPreviousEvaluation = function.squaredLastEvaluation(); - } - - // compute J_r(x^i) - function.computeGradientFromCurrentGuess(); - - // solve J_r(x^i) * dx == -r(x^i) - function.solveLinearEquation(); - - SReal lineSearchAlpha = 1_sreal; - SReal previousAlpha = 0; - - bool lineSearchSuccess = false; - unsigned int lineSearchIterationCount = 0; - for (; lineSearchIterationCount < maxNbIterationsLineSearch; ++lineSearchIterationCount) - { - lineSearchIteration(function, squaredResidualNorm, lineSearchAlpha - previousAlpha); - - if (squaredResidualNorm < previousSquaredResidualNorm) - { - lineSearchSuccess = true; - break; - } - - previousAlpha = lineSearchAlpha; - lineSearchAlpha *= lineSearchCoefficient; - } - - if (!lineSearchSuccess) - { - msg_warning_when(d_warnWhenLineSearchFails.getValue()) - << "Line search failed at Newton iteration " - << newtonIterationCount << "."; - - static constexpr auto divergedMaxIterations = NewtonStatus("DivergedLineSearch"); - d_status.setValue(divergedMaxIterations); - - if (maxNbIterationsLineSearch > 1) - { - lineSearchAlpha = 1_sreal; - lineSearchIteration(function, squaredResidualNorm, lineSearchAlpha - previousAlpha); - } - } - else - { - msg_info() << "Line search succeeded after " << (lineSearchIterationCount+1) << " iterations"; - } - - residualList.push_back(squaredResidualNorm); - - std::stringstream iterationResults; - if (printLog) - { - iterationResults << "Newton iteration results:"; - iterationResults << "\n* Current iteration = " << newtonIterationCount; - iterationResults << "\n* Squared residual norm = " << squaredResidualNorm; - iterationResults << "\n* Line search status: " << (lineSearchSuccess ? "SUCCESSFUL" : "FAILED"); - iterationResults << "\n* Residual norm = " << std::sqrt(squaredResidualNorm) << " (absolute threshold = " << absoluteStoppingThreshold << ")"; - iterationResults << "\n* Successive relative ratio = " << std::sqrt(squaredResidualNorm / previousSquaredResidualNorm) << " (threshold = " << relativeSuccessiveStoppingThreshold << ", previous residual norm = " << std::sqrt(previousSquaredResidualNorm) << ")"; - } - - relativeSuccessiveConvergenceMeasure.squaredResidualNorm = squaredResidualNorm; - relativeSuccessiveConvergenceMeasure.previousSquaredResidualNorm = previousSquaredResidualNorm; - relativeSuccessiveConvergenceMeasure.newtonIterationCount = newtonIterationCount; - - if (measureConvergence(relativeSuccessiveConvergenceMeasure, iterationResults)) - { - hasConverged = true; - break; - } - - relativeInitialConvergenceMeasure.squaredResidualNorm = squaredResidualNorm; - if (measureConvergence(relativeInitialConvergenceMeasure, iterationResults)) - { - hasConverged = true; - break; - } - - absoluteConvergenceMeasure.squaredResidualNorm = squaredResidualNorm; - if (measureConvergence(absoluteConvergenceMeasure, iterationResults)) - { - hasConverged = true; - break; - } - - if (absoluteEstimateDifferenceMeasure.isMeasured() - || relativeEstimateDifferenceMeasure.isMeasured()) - { - const auto squaredAbsoluteDifference = function.squaredNormDx(); - if (printLog) - { - iterationResults << "\n* Successive estimate difference = " << std::sqrt(squaredAbsoluteDifference); - } - - relativeEstimateDifferenceMeasure.squaredAbsoluteDifference = squaredAbsoluteDifference; - if (measureConvergence(relativeEstimateDifferenceMeasure, iterationResults)) - { - hasConverged = true; - break; - } - - absoluteEstimateDifferenceMeasure.squaredAbsoluteDifference = squaredAbsoluteDifference; - if (measureConvergence(absoluteEstimateDifferenceMeasure, iterationResults)) - { - hasConverged = true; - break; - } - } - - msg_info() << iterationResults.str(); - } - - if (!hasConverged) - { - msg_warning_when(d_warnWhenDiverge.getValue()) - << "Newton-Raphson method failed to converge after " << newtonIterationCount - << " iteration(s) with residual squared norm = " << squaredResidualNorm << ". "; - - static constexpr auto divergedMaxIterations = NewtonStatus("DivergedMaxIterations"); - d_status.setValue(divergedMaxIterations); - } - } - - sofa::helper::AdvancedTimer::valSet("nb_iterations", newtonIterationCount); - sofa::helper::AdvancedTimer::valSet("residual", std::sqrt(squaredResidualNorm)); -} - -void NewtonRaphsonSolver::start() -{ - // The status of the algorithm is set to "Running", and will be changed later - // depending on the convergence of the algorithm. - static constexpr auto running = NewtonStatus("Running"); - d_status.setValue(running); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.h deleted file mode 100644 index b084a2c6514..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonRaphsonSolver.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include -#include -#include -#include -#include -#include - -namespace sofa::component::odesolver::backward -{ - -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API NewtonRaphsonSolver : public core::objectmodel::BaseComponent -{ -public: - SOFA_CLASS(NewtonRaphsonSolver, core::objectmodel::BaseComponent); - - Data d_maxNbIterationsNewton; - Data d_relativeSuccessiveStoppingThreshold; - Data d_relativeInitialStoppingThreshold; - Data d_absoluteResidualStoppingThreshold; - Data d_relativeEstimateDifferenceThreshold; - Data d_absoluteEstimateDifferenceThreshold; - Data d_maxNbIterationsLineSearch; - Data d_lineSearchCoefficient; - Data d_updateStateWhenDiverged; - Data d_status; - Data > > d_residualGraph; - Data d_warnWhenLineSearchFails; - Data d_warnWhenDiverge; - - void init() override; - void reset() override; - - /** - * Main function to call to solve a nonlinear function - * @param function The nonlinear function to solve - */ - void solve(newton_raphson::BaseNonLinearFunction& function); - -protected: - NewtonRaphsonSolver(); - - void start(); - - void initialConvergence(SReal squaredResidualNorm, SReal squaredAbsoluteStoppingThreshold); - bool measureConvergence(const NewtonRaphsonConvergenceMeasure& measure, std::stringstream& os); - - static void lineSearchIteration(newton_raphson::BaseNonLinearFunction& function, - SReal& squaredResidualNorm, const SReal lineSearchCoefficient); -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonStatus.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonStatus.h deleted file mode 100644 index a21d813186b..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NewtonStatus.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include -#include - -namespace sofa::component::odesolver::backward -{ -MAKE_SELECTABLE_ITEMS(NewtonStatus, - sofa::helper::Item{"Undefined", "The solver has not been called yet"}, - sofa::helper::Item{"Running", "The solver is still running and/or did not finish"}, - sofa::helper::Item{"ConvergedEquilibrium", "Converged: the iterations did not start because the system is already at equilibrium"}, - sofa::helper::Item{"DivergedLineSearch", "Diverged: line search failed"}, - sofa::helper::Item{"DivergedMaxIterations", "Diverged: Reached the maximum number of iterations"}, - sofa::helper::Item{"ConvergedResidualSuccessiveRatio", "Converged: Residual successive ratio is smaller than the threshold"}, - sofa::helper::Item{"ConvergedResidualInitialRatio", "Converged: Residual initial ratio is smaller than the threshold"}, - sofa::helper::Item{"ConvergedAbsoluteResidual", "Converged: Absolute residual is smaller than the threshold"}, - sofa::helper::Item{"ConvergedRelativeEstimateDifference", "Converged: Relative estimate difference is smaller than the threshold"}, - sofa::helper::Item{"ConvergedAbsoluteEstimateDifference", "Converged: Absolute estimate difference is smaller than the threshold"}); -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NonLinearFunction.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NonLinearFunction.h deleted file mode 100644 index 4b27cc03084..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/NonLinearFunction.h +++ /dev/null @@ -1,95 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -#include -#include - -namespace sofa::component::odesolver::backward::newton_raphson -{ - -/** - * Base class of a representation of a nonlinear function in the context of the resolution of a - * nonlinear (system of) equation(s) with the Newton-Raphson method. - * - * In the objective to be very generic, the computations required by the Newton-Raphson are defined - * inside @BaseNonLinearFunction. For example, a Newton iteration requires to solve a linear - * equation that can be solved using a linear solver in the case of a system of equations, or by a - * scalar inversion in the case of a scalar equation. The only required interaction with the outside - * is the squared norm of the last evaluation. - * - * If r is the nonlinear function, a Newton iteration leads to the following linear equation: - * J_r (x^{i+1} - x^i) = -r(x^i) - * where J_r is the Jacobian of r and x^i is the current guess of r at iteration i. - */ -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API BaseNonLinearFunction -{ -public: - virtual ~BaseNonLinearFunction() = default; - - virtual void startNewtonIteration() {} - virtual void endNewtonIteration() {} - - /** - * Evaluation of the function where the input is the current guess. If the function is called - * for the first time, then it is called on the initial guess. - * The evaluation is computed internally. It is not necessary to share this evaluation with the - * outside. - */ - virtual void evaluateCurrentGuess() = 0; - - /** - * Returns the squared norm of the last evaluation of the function - */ - virtual SReal squaredNormLastEvaluation() = 0; - - /** - * Compute the gradient internally. It is not necessary to share this gradient with the outside - */ - virtual void computeGradientFromCurrentGuess() = 0; - - /** - * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). - * It is solved internally. It is not necessary to share the result with the outside - */ - virtual void solveLinearEquation() = 0; - - /** - * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current - * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is - * not necessary to share the result with the Newton-Raphson method. - */ - virtual void updateGuessFromLinearSolution(SReal alpha) = 0; - - /** - * Compute ||x^{i+1}-x^i||^2 - */ - virtual SReal squaredNormDx() = 0; - - /** - * Compute ||x^{i+1}||^2 - */ - virtual SReal squaredLastEvaluation() = 0; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp deleted file mode 100644 index 5b57a4f6af2..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -#include - -#include -#include -#include -#include - -namespace sofa::component::odesolver::backward -{ - -void registerStaticSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects( - core::ObjectRegistrationData("Static ODE Solver") - .add()); -} - -StaticSolver::StaticSolver() - : l_newtonSolver(initLink("newtonSolver", "Link to a NewtonRaphsonSolver")) - , d_newton_iterations(this, "newton_iterations") - , d_absolute_correction_tolerance_threshold(this, "absolute_correction_tolerance_threshold") - , d_relative_correction_tolerance_threshold(this, "relative_correction_tolerance_threshold") - , d_absolute_residual_tolerance_threshold(this, "absolute_residual_tolerance_threshold") - , d_relative_residual_tolerance_threshold(this, "relative_residual_tolerance_threshold") - , d_should_diverge_when_residual_is_growing(this, "should_diverge_when_residual_is_growing") -{} - -void StaticSolver::parse(core::objectmodel::BaseObjectDescription* arg) -{ - Inherit1::parse(arg); - - const auto warnNewAttribute = [&, arg](auto& data, const std::string& newAttributeName) - { - if (const char* attribute = arg->getAttribute(data.m_name)) - { - try - { - data.value.emplace(std::stod(attribute)); - msg_warning() << "The attribute '" << data.m_name - << "' is no longer defined in this component. Instead, define the attribute '" - << newAttributeName << "' in the NewtonRaphsonSolver component associated with this StaticSolver."; - } - catch (const std::exception&) - { - msg_warning() << "Invalid value '" << attribute << "' for deprecated attribute '" << data.m_name << "'"; - } - } - }; - - warnNewAttribute(d_newton_iterations, "maxNbIterationsNewton"); - warnNewAttribute(d_absolute_correction_tolerance_threshold, "absoluteEstimateDifferenceThreshold"); - warnNewAttribute(d_relative_correction_tolerance_threshold, "relativeEstimateDifferenceThreshold"); - warnNewAttribute(d_absolute_residual_tolerance_threshold, "absoluteResidualStoppingThreshold"); - warnNewAttribute(d_relative_residual_tolerance_threshold, "relativeEstimateDifferenceThreshold"); -} - -void StaticSolver::init() -{ - OdeSolver::init(); - LinearSolverAccessor::init(); - - if (!l_newtonSolver.get()) - { - l_newtonSolver.set(getContext()->get(getContext()->getTags(), core::objectmodel::BaseContext::SearchDown)); - - if (!l_newtonSolver) - { - msg_warning() << "A Newton-Raphson solver is required by this component but has not been found. It will be created automatically"; - auto newtonRaphsonSolver = core::objectmodel::New(); - newtonRaphsonSolver->setName(this->getContext()->getNameHelper().resolveName(newtonRaphsonSolver->getClassName(), core::ComponentNameHelper::Convention::xml)); - this->getContext()->addObject(newtonRaphsonSolver); - l_newtonSolver.set(newtonRaphsonSolver); - - const auto setDeprecatedAttribute = [&](const NewtonRaphsonDeprecatedData& oldData, Data& newData) - { - if (oldData.value.has_value()) - { - newData.setValue(*oldData.value); - msg_warning() << "The attribute '" << newData.getName() << "' in " << newData.getOwner()->getPathName() - << " is set from the deprecated attribute '" << oldData.m_name << "'. This will be removed in the future."; - } - }; - - setDeprecatedAttribute(d_newton_iterations, l_newtonSolver->d_maxNbIterationsNewton); - setDeprecatedAttribute(d_absolute_correction_tolerance_threshold, l_newtonSolver->d_absoluteEstimateDifferenceThreshold); - setDeprecatedAttribute(d_relative_correction_tolerance_threshold, l_newtonSolver->d_relativeEstimateDifferenceThreshold); - setDeprecatedAttribute(d_absolute_residual_tolerance_threshold, l_newtonSolver->d_absoluteResidualStoppingThreshold); - setDeprecatedAttribute(d_relative_residual_tolerance_threshold, l_newtonSolver->d_relativeEstimateDifferenceThreshold); - - } - } - - if (this->d_componentState.getValue() != core::objectmodel::ComponentState::Invalid) - { - d_componentState.setValue(core::objectmodel::ComponentState::Valid); - } -} - -struct StaticResidualFunction : newton_raphson::BaseNonLinearFunction -{ - void evaluateCurrentGuess() override - { - SCOPED_TIMER("ComputeForce"); - static constexpr bool clearForcesBeforeComputingThem = true; - static constexpr bool applyBottomUpMappings = true; - - mop.computeForce(force, clearForcesBeforeComputingThem, applyBottomUpMappings); - mop.projectResponse(force); - } - - SReal squaredNormLastEvaluation() override - { - return force.dot(force); - } - - void computeGradientFromCurrentGuess() override - { - SCOPED_TIMER("MBKBuild"); - - static constexpr core::MatricesFactors::M m(0); - static constexpr core::MatricesFactors::B b(0); - static constexpr core::MatricesFactors::K k(-1); - - mop.setSystemMBKMatrix(m, b, k, linearSolver); - } - - void updateGuessFromLinearSolution(SReal alpha) override - { - x.peq(dx, alpha); - mop.solveConstraint(x, sofa::core::ConstraintOrder::POS); - mop.propagateX(x); - } - - void solveLinearEquation() override - { - SCOPED_TIMER("MBKSolve"); - - linearSolver->getLinearSystem()->setSystemSolution(dx); - linearSolver->getLinearSystem()->setRHS(force); - linearSolver->solveSystem(); - linearSolver->getLinearSystem()->dispatchSystemSolution(dx); - } - - SReal squaredNormDx() override - { - return dx.dot(dx); - } - - SReal squaredLastEvaluation() override - { - return x.dot(x); - } - - sofa::simulation::common::MechanicalOperations& mop; - core::behavior::MultiVecCoord& x; - core::behavior::MultiVecDeriv& force; - core::behavior::MultiVecDeriv& dx; - core::behavior::LinearSolver* linearSolver { nullptr }; - - StaticResidualFunction(sofa::simulation::common::MechanicalOperations& mop, - core::behavior::MultiVecCoord& x, core::behavior::MultiVecDeriv& force, - core::behavior::MultiVecDeriv& dx, - core::behavior::LinearSolver* linearSolver) - : mop(mop), x(x), force(force), dx(dx), linearSolver(linearSolver) - { - } -}; - -void StaticSolver::solve(const core::ExecParams* params, SReal dt, core::MultiVecCoordId xResult, - core::MultiVecDerivId vResult) -{ - if (!isComponentStateValid()) - { - return; - } - - SOFA_UNUSED(dt); - SOFA_UNUSED(vResult); - - // Create the vector and mechanical operations tools. These are used to execute special - // operations (multiplication, additions, etc.) on multi-vectors (a vector that is stored - // in different buffers inside the mechanical objects) - sofa::simulation::common::VectorOperations vop(params, this->getContext()); - sofa::simulation::common::MechanicalOperations mop(params, this->getContext()); - mop->setImplicit(true); - - core::behavior::MultiVecCoord x(&vop, xResult); - - core::behavior::MultiVecDeriv force(&vop, sofa::core::vec_id::write_access::force); - - core::behavior::MultiVecDeriv dx(&vop, core::vec_id::write_access::dx); - dx.realloc(&vop, true, true); - - SCOPED_TIMER("StaticSolver::Solve"); - - StaticResidualFunction staticResidualFunction(mop, x, force, dx, l_linearSolver.get()); - l_newtonSolver->solve(staticResidualFunction); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h deleted file mode 100644 index d353c90dec6..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h +++ /dev/null @@ -1,152 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include -#include -#include -#include -#include - -namespace sofa::component::odesolver::backward -{ - -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API StaticSolver : - public core::behavior::OdeSolver, - public core::behavior::LinearSolverAccessor -{ -public: - SOFA_CLASS2(StaticSolver, core::behavior::OdeSolver, core::behavior::LinearSolverAccessor); - StaticSolver(); - - void solve( - const core::ExecParams* params, - SReal dt, - core::MultiVecCoordId xResult, - core::MultiVecDerivId vResult) override; - - void parse(core::objectmodel::BaseObjectDescription* arg) override; - void init() override; - - SingleLink - l_newtonSolver; - - auto squared_residual_norms() const -> const std::vector & = delete; - auto squared_increment_norms() const -> const std::vector & = delete; - - - /// Given a displacement as computed by the linear system inversion, how much will it affect the velocity - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt. - SReal getVelocityIntegrationFactor() const override - { - return 1.0; // getContext()->getDt(); - } - - /// Given a displacement as computed by the linear system inversion, how much will it affect the position - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt². - SReal getPositionIntegrationFactor() const override - { - return getPositionIntegrationFactor(getContext()->getDt()); - } - - virtual SReal getPositionIntegrationFactor(SReal dt ) const - { - return dt; - } - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - /// - /// This method is used to compute the compliance for contact corrections. - /// For example, a backward-Euler dynamic implicit integrator would use: - /// Input: x_t v_t a_{t+dt} - /// x_{t+dt} 1 dt dt^2 - /// v_{t+dt} 0 1 dt - /// - /// If the linear system is expressed on s = a_{t+dt} dt, then the final factors are: - /// Input: x_t v_t a_t s - /// x_{t+dt} 1 dt 0 dt - /// v_{t+dt} 0 1 0 1 - /// a_{t+dt} 0 0 0 1/dt - /// The last column is returned by the getSolutionIntegrationFactor method. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override - { - return getIntegrationFactor(inputDerivative, outputDerivative, getContext()->getDt()); - } - - SReal getIntegrationFactor(int inputDerivative, int outputDerivative, SReal dt) const - { - const SReal matrix[3][3] = - { - { 1, dt, 0}, - { 0, 1, 0}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; - } - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - SReal getSolutionIntegrationFactor(int outputDerivative) const override - { - return getSolutionIntegrationFactor(outputDerivative, getContext()->getDt()); - } - - SReal getSolutionIntegrationFactor(int outputDerivative, SReal dt) const - { - const SReal vect[3] = { dt, 1, 1/dt}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; - } - - -protected: - - template - struct NewtonRaphsonDeprecatedData : core::objectmodel::lifecycle::RemovedData - { - NewtonRaphsonDeprecatedData(Base* b, const std::string name) - : RemovedData(b, "v25.06", "v25.12", name, "The Data related to the Newton-Raphson parameters must be defined in the NewtonRaphsonSolver component.") - {} - - std::optional value; - }; - - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_newton_iterations; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_absolute_correction_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_relative_correction_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_absolute_residual_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_relative_residual_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_should_diverge_when_residual_is_growing; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.cpp deleted file mode 100644 index 4fde6508fe9..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -#include -#include -#include -#include -#include - - -namespace sofa::component::odesolver::backward -{ - -using core::VecId; -using namespace sofa::defaulttype; -using namespace core::behavior; - -VariationalSymplecticSolver::VariationalSymplecticSolver() - : d_newtonError(initData(&d_newtonError, 0.01_sreal, "newtonError", "Error tolerance for Newton iterations") ) - , d_newtonSteps(initData(&d_newtonSteps, (unsigned int)5, "steps", "Maximum number of Newton steps") ) - , d_rayleighStiffness(initData(&d_rayleighStiffness, (SReal)0.0, "rayleighStiffness", "Rayleigh damping coefficient related to stiffness, > 0") ) - , d_rayleighMass(initData(&d_rayleighMass, (SReal)0.0, "rayleighMass", "Rayleigh damping coefficient related to mass, > 0")) - , d_saveEnergyInFile(initData(&d_saveEnergyInFile, false, "saveEnergyInFile", "If kinetic and potential energies should be dumped in a CSV file at each iteration") ) - , d_explicit(initData(&d_explicit, false, "explicitIntegration", "Use explicit integration scheme") ) - , d_fileName(initData(&d_fileName, "file", "File name where kinetic and potential energies are saved in a CSV file")) - , d_computeHamiltonian(initData(&d_computeHamiltonian, true, "computeHamiltonian", "Compute hamiltonian") ) - , d_hamiltonianEnergy(initData(&d_hamiltonianEnergy, 0.0_sreal, "hamiltonianEnergy", "hamiltonian energy") ) - , d_useIncrementalPotentialEnergy(initData(&d_useIncrementalPotentialEnergy, true, "useIncrementalPotentialEnergy", "use real potential energy, if false use approximate potential energy")) - , d_threadSafeVisitor(initData(&d_threadSafeVisitor, false, "threadSafeVisitor", "If true, do not use realloc and free visitors in fwdInteractionForceField.")) -{ - cpt=0; -} - -void VariationalSymplecticSolver::init() -{ - if (!this->getTags().empty()) - { - type::vector objs; - this->getContext()->get(&objs,this->getTags(),sofa::core::objectmodel::BaseContext::SearchDown); - std::stringstream tmp; - for (const auto* obj : objs) - tmp << " " << obj->getClassName() << ' ' << obj->getName() << msgendl; - - msg_info() << "Responsible for the following objects with tags " << this->getTags() << " :" << tmp.str(); - } - sofa::core::behavior::OdeSolver::init(); - sofa::core::behavior::LinearSolverAccessor::init(); - energies.open((d_fileName.getValue()).c_str(), std::ios::out); -} - -void VariationalSymplecticSolver::solve(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) -{ - - sofa::simulation::common::VectorOperations vop( params, this->getContext() ); - sofa::simulation::common::MechanicalOperations mop( params, this->getContext() ); - MultiVecCoord pos(&vop, core::vec_id::write_access::position ); - MultiVecDeriv f(&vop, core::vec_id::write_access::force ); - MultiVecCoord oldpos(&vop); - - MultiVecCoord x_1(&vop, xResult); // vector of final position - - MultiVecDeriv newp(&vop); - MultiVecDeriv vel_1(&vop, vResult); // vector of final velocity - MultiVecDeriv p(&vop); // vector of momentum - // dx is no longer allocated by default (but it will be deleted automatically by the mechanical objects) - MultiVecDeriv dx(&vop, core::vec_id::write_access::dx); dx.realloc(&vop, !d_threadSafeVisitor.getValue(), true); - - const SReal& h = dt; - const SReal rM = d_rayleighMass.getValue(); - const SReal rK = d_rayleighStiffness.getValue(); - - if (cpt == 0 || this->getContext()->getTime()==0.0) - { - vop.v_alloc(pID); // allocate a new vector in Mechanical Object to store the momentum - MultiVecDeriv pInit(&vop, pID); // initialize the first value of the momentum to M*v - pInit.clear(); - mop.addMdx(pInit,vel_1,1.0); // momentum is initialized to M*vinit (assume 0 acceleration) - - // Compute potential energy at time t=0 - SReal KineticEnergy; - SReal potentialEnergy; - mop.computeEnergy(KineticEnergy,potentialEnergy); - - // Compute incremental potential energy - if (d_computeHamiltonian.getValue() && d_useIncrementalPotentialEnergy.getValue()) - m_incrementalPotentialEnergy = potentialEnergy; - - if (d_saveEnergyInFile.getValue()) { - // header of csv file - energies << "time,kinetic energy,potential energy, hamiltonian energy"<setImplicit(false); // this solver is explicit only - - MultiVecDeriv acc(&vop, core::vec_id::write_access::dx); acc.realloc(&vop, !d_threadSafeVisitor.getValue(), true); // dx is no longer allocated by default (but it will be deleted automatically by the mechanical objects) - - { - SCOPED_TIMER("ComputeForce"); - mop.computeForce(f); - } - - { - SCOPED_TIMER("AccFromF"); - - f.peq(p,1.0/h); - - mop.accFromF(acc, f); // acc= 1/m (f(q(k)+p(k)/h)) - if (rM>0) { - MultiVecDeriv oldVel(&vop, core::vec_id::write_access::velocity ); - // add rayleigh Mass damping if necessary - acc.peq(oldVel,-rM); // equivalent to adding damping force -rM* M*v(k) - } - } - - mop.projectResponse(acc); - - mop.solveConstraint(acc, core::ConstraintOrder::ACC); - - VMultiOp ops; - ops.resize(2); - // change order of operations depending on the symplectic flag - ops[0].first = vel_1; - ops[0].second.push_back(std::make_pair(acc.id(),h)); // v(k+1) = 1/m (h*f(q(k)+p(k)) - ops[1].first = x_1; // q(k+1)=q(k)+h*v(k+1) - ops[1].second.push_back(std::make_pair(pos.id(),1.0)); - ops[1].second.push_back(std::make_pair(vel_1.id(),h)); - vop.v_multiop(ops); - - // p(k+1)=M v(k+1) - newp.clear(); - mop.addMdx(newp,vel_1,1.0); - - mop.solveConstraint(vel_1,core::ConstraintOrder::VEL); - - } else { - - // implicit time integration with alpha = 0.5 - mop->setImplicit(true); // this solver is explicit only - - MultiVecCoord resi(&vop); - MultiVecDeriv b(&vop); - MultiVecDeriv res(&vop); - MultiVecCoord x_0(&vop); - unsigned int nbMaxIterNewton = d_newtonSteps.getValue(); - unsigned int i_newton=0; - double err_newton =0; // initialisation - - oldpos.eq(pos); // save initial position - double positionNorm=oldpos.norm(); // the norm of the position to compute the stopping criterion - x_0.eq(pos); // this is the previous estimate of the mid-point state - res.clear(); - resi.clear(); - while(((i_newton < nbMaxIterNewton)&&(err_newton > d_newtonError.getValue())) || (i_newton == 0)){ - - b.clear(); - f.clear(); - - /// Solving minimization of Lilyan energy (grad=0): /// - // q(k,i) is the estimate of the mid point position at iteration k and newton step i - // q(k,0)= qk i.e. the position at iteration k - // the position increment res is searched such that q(k,i+1)=q(k,i)+res - // res must minimize the Lilyan, and is solution of a linearized system around previous estimate - // Equation is : matrix * res = b - // where b = f(q(k,i-1)) -K(q(k,i-1)) res(i-1) +(2/h)p^(k) - // and matrix=-K+4/h^(2)M - - { - SCOPED_TIMER("ComputeForce"); - mop.computeForce(f); - } - - sofa::helper::AdvancedTimer::stepBegin("ComputeRHTerm"); - - // we have b=f(q(k,i-1)+(2/h)p(k) - b.peq(f,1.0); - b.peq(p,2.0/h); - - // corresponds to do b+=-K*res, where res=res(i-1)=q(k,i-1)-q(k,0) - mop.propagateDx(res); - mop.addMBKdx(b,core::MatricesFactors::M(0), - core::MatricesFactors::B(0), - core::MatricesFactors::K(-1.0)); - - - mop.projectResponse(b); - sofa::helper::AdvancedTimer::stepEnd("ComputeRHTerm"); - - // add left term : matrix=-K+4/h^(2)M, but with dampings rK and rM - { - SCOPED_TIMER("MBKBuild"); - const core::MatricesFactors::M mFact ( 4.0 / (h * h) + 4 * rM / h ); - const core::MatricesFactors::K kFact ( -1.0 - 4 * rK / h ); - mop.setSystemMBKMatrix(mFact, core::MatricesFactors::B(0), kFact, l_linearSolver.get()); - } - - { - SCOPED_TIMER("MBKSolve"); - // resolution of matrix*res=b - l_linearSolver->getLinearSystem()->setSystemSolution(res); - l_linearSolver->getLinearSystem()->setRHS(b); - l_linearSolver->solveSystem(); - l_linearSolver->getLinearSystem()->dispatchSystemSolution(res); - } - - /// Updates of q(k,i) /// - VMultiOp ops; - ops.resize(3); - - //x_1=q(k,i)=res(i)+q(k,0)=res(i)+oldpos - ops[0].first = x_1; - ops[0].second.push_back(std::make_pair(oldpos.id(),1.0)); - ops[0].second.push_back(std::make_pair(res.id(),1.0)); - // resi=q(k,i)-q(k,i-1) save the residual as a stopping criterion - ops[1].first = resi; - ops[1].second.push_back(std::make_pair(x_1.id(),1.0)); - ops[1].second.push_back(std::make_pair(x_0.id(),-1.0)); - // q(k,i)=q(k,i-1) - ops[2].first = x_0; - ops[2].second.push_back(std::make_pair(x_1.id(),1.0)); - vop.v_multiop(ops); - - mop.propagateX(x_1); - - err_newton = resi.norm()/positionNorm; /// this should decrease - i_newton++; - - }//end of i iterations - - // Compute incremental potential energy - if (d_computeHamiltonian.getValue() && d_useIncrementalPotentialEnergy.getValue()) - { - // Compute delta potential Energy - double deltaPotentialEnergy = -(2.0)*(f.dot(res)); - - // potentialEnergy is computed by adding deltaPotentialEnergy to the initial potential energy - m_incrementalPotentialEnergy = m_incrementalPotentialEnergy + deltaPotentialEnergy; - } - - msg_info() <<" i_newton "<getLinearSystem()->setSystemSolution(b); - l_linearSolver->getLinearSystem()->setRHS(newp); - l_linearSolver->solveSystem(); // b = inv(matrix)*newp = Minv*newp - l_linearSolver->getLinearSystem()->dispatchSystemSolution(b); - - const auto hamiltonianKineticEnergy = 0.5*(newp.dot(b)); - - // Hamiltonian energy with incremental potential energy - if (d_useIncrementalPotentialEnergy.getValue()) - { - // Hamiltonian energy - d_hamiltonianEnergy.setValue(hamiltonianKineticEnergy + m_incrementalPotentialEnergy); - - // Write energy in file - if (d_saveEnergyInFile.getValue()) - energies << this->getContext()->getTime()<<","<getContext()->getTime()<<","<getAttribute("verbose")) - { - msg_warning() << "Attribute 'verbose' has no use in this component. " - "To disable this warning, remove the attribute from the scene."; - } - - OdeSolver::parse(arg); -} - -void registerVariationalSymplecticSolver(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData("Implicit time integrator which conserves linear momentum and mechanical energy.") - .add< VariationalSymplecticSolver >()); -} - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.h deleted file mode 100644 index d4eacb17e9b..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/VariationalSymplecticSolver.h +++ /dev/null @@ -1,103 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -#include -#include -#include - -namespace sofa::component::odesolver::backward -{ - -/** Implicit and Explicit time integrator using the Variational Symplectic Integrator as defined in : - * Kharevych, L et al. “Geometric, Variational Integrators for Computer Animation.” ACM SIGGRAPH Symposium on Computer Animation 4 (2006): 43–51. - * - * The current implementation for implicit integration assume alpha =0.5 (quadratic accuracy) and uses - * several Newton steps to estimate the velocity - * -*/ -class SOFA_COMPONENT_ODESOLVER_BACKWARD_API VariationalSymplecticSolver - : public sofa::core::behavior::OdeSolver - , public sofa::core::behavior::LinearSolverAccessor -{ -public: - SOFA_CLASS2(VariationalSymplecticSolver, sofa::core::behavior::OdeSolver, sofa::core::behavior::LinearSolverAccessor); - - Data d_newtonError; ///< Error tolerance for Newton iterations - Data d_newtonSteps; ///< Maximum number of Newton steps - Data d_rayleighStiffness; ///< Rayleigh damping coefficient related to stiffness, > 0 - Data d_rayleighMass; ///< Rayleigh damping coefficient related to mass, > 0 - Data d_saveEnergyInFile; ///< If kinetic and potential energies should be dumped in a CSV file at each iteration - Data d_explicit; ///< Use explicit integration scheme - Data d_fileName; ///< File name where kinetic and potential energies are saved in a CSV file - Data d_computeHamiltonian; ///< Compute hamiltonian - Data d_hamiltonianEnergy; ///< hamiltonian energy - Data d_useIncrementalPotentialEnergy; ///< use real potential energy, if false use approximate potential energy - Data d_threadSafeVisitor; ///< If true, do not use realloc and free visitors in fwdInteractionForceField. - - VariationalSymplecticSolver(); - - std::ofstream energies; - - void init() override; - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - - int cpt; - - /// Given a displacement as computed by the linear system inversion, how much will it affect the velocity - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt. - SReal getVelocityIntegrationFactor() const override - { - return 0; - } - - /// Given a displacement as computed by the linear system inversion, how much will it affect the position - /// - /// This method is used to compute the compliance for contact corrections - /// For Euler methods, it is typically dt². - SReal getPositionIntegrationFactor() const override - { - return 0; - } - - SReal getIntegrationFactor(int /*inputDerivative*/, int /*outputDerivative*/) const override - { - return 0; - } - - SReal getSolutionIntegrationFactor(int /*outputDerivative*/) const override - { - - return 0; - } - - void parse(core::objectmodel::BaseObjectDescription *arg) override; - -protected: - sofa::core::MultiVecDerivId pID; - SReal m_incrementalPotentialEnergy; -}; - -} // namespace sofa::component::odesolver::backward diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteConvergenceMeasure.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteConvergenceMeasure.h deleted file mode 100644 index 096fe773ec2..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteConvergenceMeasure.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -namespace sofa::component::odesolver::backward -{ - -class AbsoluteConvergenceMeasure : public NewtonRaphsonConvergenceMeasureWithSquaredParameter -{ -public: - explicit AbsoluteConvergenceMeasure(SReal absoluteStoppingThreshold) - : NewtonRaphsonConvergenceMeasureWithSquaredParameter(absoluteStoppingThreshold) - {} - - [[nodiscard]] bool hasConverged() const override - { - return squaredResidualNorm < squaredParam; - } - - [[nodiscard]] NewtonStatus status() const override - { - static constexpr auto convergedAbsoluteResidual = NewtonStatus("ConvergedAbsoluteResidual"); - return convergedAbsoluteResidual; - } - - [[nodiscard]] std::string writeWhenConverged() const override - { - std::stringstream ss; - ss << "residual squared norm (" << squaredResidualNorm - << ") is smaller than the threshold (" - << squaredParam << ") after " - << (newtonIterationCount + 1) << " Newton iterations."; - return ss.str(); - } - - [[nodiscard]] std::string_view measureName() const override - { - return "Absolute convergence"; - } - - SReal squaredResidualNorm = 0; -}; - -} \ No newline at end of file diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteEstimateDifferenceMeasure.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteEstimateDifferenceMeasure.h deleted file mode 100644 index e496575fd00..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/AbsoluteEstimateDifferenceMeasure.h +++ /dev/null @@ -1,63 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -namespace sofa::component::odesolver::backward -{ - -class AbsoluteEstimateDifferenceMeasure : public NewtonRaphsonConvergenceMeasureWithSquaredParameter -{ -public: - explicit AbsoluteEstimateDifferenceMeasure(SReal absoluteEstimateDifferenceThreshold) - : NewtonRaphsonConvergenceMeasureWithSquaredParameter(absoluteEstimateDifferenceThreshold) - {} - - bool hasConverged() const override - { - return squaredAbsoluteDifference < squaredParam; - } - - NewtonStatus status() const override - { - static constexpr auto convergedAbsoluteEstimateDifference = NewtonStatus("ConvergedAbsoluteEstimateDifference"); - return convergedAbsoluteEstimateDifference; - } - std::string writeWhenConverged() const override - { - std::stringstream ss; - ss << "absolute successive estimate difference (" << - std::sqrt(squaredAbsoluteDifference) << ") is smaller than the threshold (" - << param << ") after " - << (newtonIterationCount+1) << " Newton iterations."; - return ss.str(); - } - std::string_view measureName() const override - { - return "Absolute successive estimate difference"; - } - - SReal squaredAbsoluteDifference = 0; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeEstimateDifferenceMeasure.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeEstimateDifferenceMeasure.h deleted file mode 100644 index 075b20e11af..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeEstimateDifferenceMeasure.h +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -namespace sofa::component::odesolver::backward -{ - - -class RelativeEstimateDifferenceMeasure : public NewtonRaphsonConvergenceMeasureWithSquaredParameter -{ -public: - explicit RelativeEstimateDifferenceMeasure(SReal relativeEstimateDifferenceThreshold) - : NewtonRaphsonConvergenceMeasureWithSquaredParameter(relativeEstimateDifferenceThreshold) - {} - - bool hasConverged() const override - { - return squaredPreviousEvaluation > 0 - && squaredAbsoluteDifference < squaredPreviousEvaluation * squaredParam; - } - - NewtonStatus status() const override - { - static constexpr auto convergedRelativeEstimateDifference = NewtonStatus("ConvergedRelativeEstimateDifference"); - return convergedRelativeEstimateDifference; - } - - std::string writeWhenConverged() const override - { - std::stringstream ss; - ss << "relative successive estimate difference (" << - std::sqrt(squaredAbsoluteDifference / squaredPreviousEvaluation) - << ") is smaller than the threshold (" - << param << ") after " - << (newtonIterationCount+1) << " Newton iterations."; - return ss.str(); - } - - std::string_view measureName() const override - { - return "Relative estimate difference"; - } - - SReal squaredAbsoluteDifference = 0; - SReal squaredPreviousEvaluation = 0; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeInitialConvergenceMeasure.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeInitialConvergenceMeasure.h deleted file mode 100644 index 89d57aa2597..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeInitialConvergenceMeasure.h +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -namespace sofa::component::odesolver::backward -{ - -class RelativeInitialConvergenceMeasure : public NewtonRaphsonConvergenceMeasureWithSquaredParameter -{ -public: - explicit RelativeInitialConvergenceMeasure(SReal relativeInitialStoppingThreshold) - : NewtonRaphsonConvergenceMeasureWithSquaredParameter(relativeInitialStoppingThreshold) - {} - - [[nodiscard]] bool hasConverged() const override - { - return squaredResidualNorm < squaredParam * firstSquaredResidualNorm; - } - - [[nodiscard]] NewtonStatus status() const override - { - static constexpr auto convergedResidualInitialRatio = NewtonStatus("ConvergedResidualInitialRatio"); - return convergedResidualInitialRatio; - } - - [[nodiscard]] std::string writeWhenConverged() const override - { - std::stringstream ss; - ss << "residual initial ratio is smaller than " - "the threshold (" << param - << ") after " << (newtonIterationCount+1) << " Newton iterations."; - return ss.str(); - } - - std::string writeWhenNotConverged() const override - { - std::stringstream ss; - ss << "residual initial ratio = " << std::sqrt(squaredResidualNorm / firstSquaredResidualNorm) << " (threshold = " << param << ")"; - return ss.str(); - } - - [[nodiscard]] std::string_view measureName() const override - { - return "Relative initial convergence"; - } - - SReal squaredResidualNorm = 0; - SReal firstSquaredResidualNorm = 0; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeSuccessiveConvergenceMeasure.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeSuccessiveConvergenceMeasure.h deleted file mode 100644 index b6731dfe332..00000000000 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/convergence/RelativeSuccessiveConvergenceMeasure.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -namespace sofa::component::odesolver::backward -{ - -class RelativeSuccessiveConvergenceMeasure : public NewtonRaphsonConvergenceMeasureWithSquaredParameter -{ -public: - explicit RelativeSuccessiveConvergenceMeasure(SReal relativeSuccessiveStoppingThreshold) - : NewtonRaphsonConvergenceMeasureWithSquaredParameter(relativeSuccessiveStoppingThreshold) - {} - - [[nodiscard]] bool hasConverged() const override - { - return squaredResidualNorm < squaredParam * previousSquaredResidualNorm; - } - - [[nodiscard]] NewtonStatus status() const override - { - static constexpr auto convergedResidualSuccessiveRatio = NewtonStatus("ConvergedResidualSuccessiveRatio"); - return convergedResidualSuccessiveRatio; - } - - [[nodiscard]] std::string writeWhenConverged() const override - { - std::stringstream ss; - ss << "residual successive ratio is smaller than " - "the threshold (" << param - << ") after " << (newtonIterationCount+1) << " Newton iterations."; - return ss.str(); - } - - [[nodiscard]] std::string_view measureName() const override - { - return "Relative successive convergence"; - } - - SReal squaredResidualNorm = 0; - SReal previousSquaredResidualNorm = 0; -}; - -} diff --git a/Sofa/Component/ODESolver/Backward/tests/BDFOdeSolver_test.cpp b/Sofa/Component/ODESolver/Backward/tests/BDFOdeSolver_test.cpp deleted file mode 100644 index 5c4cfc5e5cb..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/BDFOdeSolver_test.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ - -#include -#include -#include - -namespace sofa -{ - -void testOrder1(SReal start, SReal end) -{ - sofa::type::vector a_coef; - sofa::type::vector b_coef; - std::deque samples { start, end}; - component::odesolver::backward::BDFOdeSolver::computeLinearMultiStepCoefficients(samples, a_coef, b_coef); - - ASSERT_EQ(a_coef.size(), b_coef.size()); - ASSERT_EQ(a_coef.size(), 2); - - EXPECT_FLOATINGPOINT_EQ(a_coef[0], -1_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[1], 1_sreal); - - EXPECT_FLOATINGPOINT_EQ(b_coef[0], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[1], 1_sreal); -} - -TEST(BDFOdeSolverTest, Order1) -{ - for (const auto [start, end] : sofa::type::vector>{ {0,1}, {0, 12}, {12, 13}, {100, 900}, {900, 100}}) - { - testOrder1(start, end); - } -} - -void testOrder2(SReal start, SReal dt) -{ - sofa::type::vector a_coef; - sofa::type::vector b_coef; - std::deque samples { start, start + dt, start + 2 * dt}; - component::odesolver::backward::BDFOdeSolver::computeLinearMultiStepCoefficients(samples, a_coef, b_coef); - - ASSERT_EQ(a_coef.size(), b_coef.size()); - ASSERT_EQ(a_coef.size(), 3); - - EXPECT_FLOATINGPOINT_EQ(a_coef[0], 1_sreal / 3_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[1], -4_sreal / 3_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[2], 1_sreal); - - EXPECT_FLOATINGPOINT_EQ(b_coef[0], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[1], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[2], 2_sreal / 3_sreal); -} - -TEST(BDFOdeSolverTest, Order2) -{ - for (const auto [start, end] : sofa::type::vector>{ {0,1}, {0, 12}, {12, 1}, {100, 1}, {900, -1}}) - { - testOrder2(start, end); - } -} - -void testOrder3(SReal start, SReal dt) -{ - sofa::type::vector a_coef; - sofa::type::vector b_coef; - std::deque samples { start, start + dt, start + 2 * dt, start + 3 * dt}; - component::odesolver::backward::BDFOdeSolver::computeLinearMultiStepCoefficients(samples, a_coef, b_coef); - - ASSERT_EQ(a_coef.size(), b_coef.size()); - ASSERT_EQ(a_coef.size(), 4); - - EXPECT_FLOATINGPOINT_EQ(a_coef[0], -2_sreal / 11_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[1], 9_sreal / 11_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[2], -18_sreal / 11_sreal); - EXPECT_FLOATINGPOINT_EQ(a_coef[3], 1_sreal); - - EXPECT_FLOATINGPOINT_EQ(b_coef[0], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[1], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[2], 0_sreal); - EXPECT_FLOATINGPOINT_EQ(b_coef[3], 6_sreal / 11_sreal); -} - -TEST(BDFOdeSolverTest, Order3) -{ - for (const auto [start, end] : sofa::type::vector>{ {0,1}, {0, 12}, {12, 1}, {100, 1}, {900, -1}}) - { - testOrder3(start, end); - } -} - -} diff --git a/Sofa/Component/ODESolver/Backward/tests/CMakeLists.txt b/Sofa/Component/ODESolver/Backward/tests/CMakeLists.txt deleted file mode 100644 index 0df14da2d03..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.22) - -project(Sofa.Component.ODESolver.Backward_test) - -set(SOURCE_FILES - BDFOdeSolver_test.cpp - EulerImplicitSolverDynamic_test.cpp - EulerImplicitSolverStatic_test.cpp - EulerImplicitSolver_withDamping_test.cpp - NewmarkImplicitSolverDynamic_test.cpp - NewtonRaphsonSolver_test.cpp - StaticSolver_test.cpp - SpringSolverDynamic_test.cpp - VariationalSymplecticExplicitSolverDynamic_test.cpp - VariationalSymplecticImplicitSolverDynamic_test.cpp -) - -add_definitions("-DSOFACOMPONENTODESOLVERBACKWARD_TEST_SCENES_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/scenes\"") - -add_executable(${PROJECT_NAME} ${SOURCE_FILES}) -# dependencies are managed directly in the target_link_libraries pass -target_link_libraries(${PROJECT_NAME} Sofa.Testing - Sofa.Component.ODESolver.Testing - Sofa.Component.ODESolver.Backward - Sofa.Component.LinearSolver.Direct - Sofa.Component.StateContainer) diff --git a/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverDynamic_test.cpp deleted file mode 100644 index d0a0fe377ee..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; - -#include - -#include -#include -#include - -#include -typedef sofa::component::statecontainer::MechanicalObject MechanicalObject3; - -#include - - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with euler implicit solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct EulerImplicitDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - /// Position and velocity array - vector positionsArray; - vector velocitiesArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0, double rm = 0, double rk=0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "EulerImplicitSolver", { - { "rayleighStiffness", simpleapi::str(rk)}, - { "rayleighMass", simpleapi::str(rm)} - }); - - } - - /// Generate discrete mass position values with euler implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double rm, double rk) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - } - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // Compute velocities - const double denominator = h*(h+rk)*K+(1+h*rm)*m; - const double constant = (-(rk+h)*K-rm*m); - - for(int i=1;i< size+1; i++) - { - velocitiesArray.push_back(velocitiesArray[i-1]+h*(-K*(positionsArray[i-1]-z0)-m*g+velocitiesArray[i-1]*constant)/(denominator)); - positionsArray.push_back(positionsArray[i-1]+h*velocitiesArray[i]); - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename statecontainer::MechanicalObject<_DataTypes>::SPtr dofs = massNode->get>(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(EulerImplicitDynamic_test, DataTypes); - -// Test case: h=0.1 k=100 m =10 rm=0 rk=0 -TYPED_TEST( EulerImplicitDynamic_test , eulerImplicitSolverDynamicTest_high_dt_without_damping) -{ - this->createScene(100,10,1,0,0); // k,m,l0,rm,rk - this->generateDiscreteMassPositions (0.1, 100, 10, 1, 0, 10, 2, 0, 0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.1 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( EulerImplicitDynamic_test , eulerImplicitSolverDynamicTest_high_dt_with_damping) -{ - this->createScene(100,10,1,0.1,0.1); // k,m,l0,rm,rk - this->generateDiscreteMassPositions (0.1, 100, 10,1, 0, 10, 2, 0.1, 0.1); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.01 K=10 m=10 rm=0 rk=0.1 -TYPED_TEST( EulerImplicitDynamic_test , eulerImplicitSolverDynamicTest_medium_dt_with_rayleigh_stiffness) -{ - this->createScene(10,10,1,0,0.1); // k,m,l0,rm,rk - this->generateDiscreteMassPositions (0.01, 10, 10, 1, 0, 10, 2, 0, 0.1); - this-> compareSimulatedToTheoreticalPositions(6e-15,0.01); -} - -// Test case: h=0.001 K=10 m = 100 rm=0.1 rk=0 -TYPED_TEST( EulerImplicitDynamic_test , eulerImplicitSolverDynamicTest_small_dt_with_rayleigh_mass) -{ - this->createScene(10,100,1,0.1,0); // k,m,l0,rm,rk - this->generateDiscreteMassPositions (0.001, 10, 100, 1, 0, 10, 2, 0.1, 0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.001); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverStatic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverStatic_test.cpp deleted file mode 100644 index 5097b566ea8..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/EulerImplicitSolverStatic_test.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ - -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include - -#include -#include - - -namespace sofa { - -using namespace type; -using namespace testing; -using namespace defaulttype; -using core::objectmodel::New; - - -/// Create a stiff string -Node::SPtr massSpringString(Node::SPtr parent, - double x0, double y0, double z0, // start point, - double x1, double y1, double z1, // end point - unsigned numParticles, - double totalMass, - double stiffnessValue, - double dampingRatio) -{ - static unsigned numObject = 1; - std::ostringstream oss; - oss << "string_" << numObject++; - - Vec3d startPoint(x0, y0, z0), endPoint(x1, y1, z1); - SReal totalLength = (endPoint - startPoint).norm(); - - std::stringstream positions; - std::stringstream springs; - for (unsigned i = 0; i < numParticles; i++) - { - double alpha = (double)i / (numParticles - 1); - Vec3d currpos = startPoint * (1 - alpha) + endPoint * alpha; - positions << simpleapi::str(currpos) << " "; - - if (i > 0) - { - springs << simpleapi::str(i - 1) << " " << simpleapi::str(i) << " " << simpleapi::str(stiffnessValue) - << " " << simpleapi::str(dampingRatio) << " " << simpleapi::str(totalLength / (numParticles - 1)); - } - } - - Node::SPtr node = simpleapi::createChild(parent, oss.str()); - simpleapi::createObject(node, "MechanicalObject", { - {"name", oss.str() + "_DOF"}, - {"size", simpleapi::str(numParticles)}, - {"position", positions.str()} - }); - - simpleapi::createObject(node, "UniformMass", { - {"name",oss.str() + "_mass"}, - {"vertexMass", simpleapi::str(totalMass / numParticles)} }); - - simpleapi::createObject(node, "SpringForceField", { - {"name", oss.str() + "_spring"}, - {"spring", springs.str()} - }); - - return node; -} - -/** Test convergence to a static solution. - * Mass-spring string composed of two particles in gravity, one is fixed. - * Francois Faure, 2013. - */ -struct EulerImplicit_test_2_particles_to_equilibrium : public BaseSimulationTest, NumericTest -{ - EulerImplicit_test_2_particles_to_equilibrium() - { - EXPECT_MSG_NOEMIT(Error) ; - //******* - const auto simu = simpleapi::createSimulation(); - const simulation::Node::SPtr root = simpleapi::createRootNode(simu, "root"); - //******* - // begin create scene under the root node - this->loadPlugins({ - Sofa.Component.ODESolver.Backward, - Sofa.Component.LinearSolver.Iterative, - Sofa.Component.StateContainer, - Sofa.Component.Mass, - Sofa.Component.Constraint.Projective, - Sofa.Component.SolidMechanics.Spring - }); - - // remove warnings - simpleapi::createObject(root, "DefaultAnimationLoop", {}); - simpleapi::createObject(root, "DefaultVisualManagerLoop", {}); - - simpleapi::createObject(root, "EulerImplicitSolver", {}); - simpleapi::createObject(root, "CGLinearSolver", { - { "iterations", simpleapi::str(25)}, - { "tolerance", simpleapi::str(1e-5)}, - { "threshold", simpleapi::str(1e-5)}, - }); - - const simulation::Node::SPtr string = massSpringString ( - root, // attached to root node - 0,1,0, // first particle position - 0,0,0, // last particle position - 2, // number of particles - 2.0, // total mass - 1000.0, // stiffness - 0.1 // damping ratio - ); - - simpleapi::createObject(string, "FixedProjectiveConstraint", { - { "indices", "0"} - }); - - Vec3d expected(0,-0.00981,0); // expected position of second particle after relaxation - - // end create scene - //********* - sofa::simulation::node::initRoot(root.get()); - //********* - // run simulation - - Eigen::VectorXd x0, x1, v0, v1; - x0 = component::odesolver::testing::getVector( root, core::vec_id::write_access::position ); //cerr<<"EulerImplicit_test, initial positions : " << x0.transpose() << endl; - v0 = component::odesolver::testing::getVector( root, core::vec_id::write_access::velocity ); - - Eigen::VectorXd::RealScalar dx, dv; - unsigned n=0; - const unsigned nMax=100; - const double precision = 1.e-4; - do { - sofa::simulation::node::animate(root.get(), 1_sreal); - - x1 = component::odesolver::testing::getVector( root, core::vec_id::read_access::position ); //cerr<<"EulerImplicit_test, new positions : " << x1.transpose() << endl; - v1 = component::odesolver::testing::getVector( root, core::vec_id::read_access::velocity ); - - dx = (x0-x1).lpNorm(); - dv = (v0-v1).lpNorm(); - x0 = x1; - v0 = v1; - n++; - - } while( - (dx>1.e-4 || dv>1.e-4) // not converged - && n -{ - - EulerImplicit_test_2_particles_in_different_nodes_to_equilibrium() - { - //******* - const auto simu = simpleapi::createSimulation(); - const simulation::Node::SPtr root = simpleapi::createRootNode(simu, "root"); - //******* - // create scene - root->setGravity(Vec3(0,0,0)); - - loadPlugins({ - Sofa.Component.ODESolver.Backward, - Sofa.Component.LinearSolver.Iterative, - Sofa.Component.StateContainer, - Sofa.Component.Mass, - Sofa.Component.Constraint.Projective, - Sofa.Component.SolidMechanics.Spring - }); - - // remove warnings - simpleapi::createObject(root, "DefaultAnimationLoop", {}); - simpleapi::createObject(root, "DefaultVisualManagerLoop", {}); - - simpleapi::createObject(root, "EulerImplicitSolver", {}); - simpleapi::createObject(root, "CGLinearSolver", { - { "iterations", simpleapi::str(25)}, - { "tolerance", simpleapi::str(1e-5)}, - { "threshold", simpleapi::str(1e-5)}, - }); - - simpleapi::createObject(root, "MechanicalObject", { - {"name", "DOF"}, - {"position", simpleapi::str("0.0 2.0 0.0")}, - {"velocity", simpleapi::str("0.0 0.0 0.0")} - }); - - simpleapi::createObject(root, "UniformMass", { - { "name","mass"}, - { "vertexMass", "1.0"} - }); - - // create a child node with its own DOF - const simulation::Node::SPtr child = root->createChild("childNode"); - simpleapi::createObject(child, "MechanicalObject", { - {"name", "childDof"}, - {"position", simpleapi::str("0.0 -1.0 0.0")}, - {"velocity", simpleapi::str("0.0 0.0 0.0")} - }); - - simpleapi::createObject(child, "UniformMass", { - { "name","childMass"}, - { "vertexMass", simpleapi::str("1.0")} - }); - - // attach a spring - std::ostringstream oss; - oss << 0 << " " << 0 << " " << 1000.0 << " " << 0.1 << " " << 1.0f; - simpleapi::createObject(root, "SpringForceField", { - {"spring", oss.str()}, - { "object1", "@/DOF"}, - { "object2", "@childNode/childDof"}, - }); - - Vec3d expected(0,0,0); // expected position of second particle after relaxation - - // end create scene - //********* - sofa::simulation::node::initRoot(root.get()); - //********* - // run simulation - - Eigen::VectorXd x0, x1, v0, v1; - x0 = component::odesolver::testing::getVector(root, core::vec_id::write_access::position ); //cerr<<"EulerImplicit_test, initial positions : " << x0.transpose() << endl; - v0 = component::odesolver::testing::getVector(root, core::vec_id::write_access::velocity ); - - SReal dx, dv; - unsigned n=0; - const unsigned nMax=100; - const double precision = 1.e-4; - do { - sofa::simulation::node::animate(root.get(), 1_sreal); - - x1 = component::odesolver::testing::getVector(root, core::vec_id::read_access::position ); //cerr<<"EulerImplicit_test, new positions : " << x1.transpose() << endl; - v1 = component::odesolver::testing::getVector(root, core::vec_id::read_access::velocity ); - - dx = (x0-x1).lpNorm(); - dv = (v0-v1).lpNorm(); - x0 = x1; - v0 = v1; - n++; - - } while( - (dx>1.e-4 || dv>1.e-4) // not converged - && n. * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ - -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include -#include -#include -#include -#include - -namespace sofa { - -using namespace type; -using namespace testing; -using namespace defaulttype; -using core::objectmodel::New; -using namespace sofa::component::statecontainer; - - -/// Test for the gravity context data -struct EulerImplicit_with_damping_forcefield : public BaseSimulationTest, NumericTest -{ - EulerImplicit_with_damping_forcefield() - { - //******* - const auto simu = simpleapi::createSimulation(); - const simulation::Node::SPtr root = simpleapi::createRootNode(simu, "root"); - - Vec3d zeroVec3(0., 0., 0.); - Vec3d oneVec3(1., 1., 1.); - Vec3d expectedPosition(10., 10., 10.); - Vec3d threshold(0.1, 0.1, 0.1); - root->setGravity(zeroVec3); - - //******* - // load appropriate modules - loadPlugins({ - Sofa.Component.ODESolver.Backward, - Sofa.Component.LinearSolver.Iterative, - Sofa.Component.StateContainer, - Sofa.Component.Mass, - Sofa.Component.MechanicalLoad - }); - - // avoid warnings - simpleapi::createObject(root, "DefaultAnimationLoop", {}); - simpleapi::createObject(root, "DefaultVisualManagerLoop", {}); - - //********* - // create scene - Node::SPtr dampedParticule = simpleapi::createChild(root, "dampedParticule"); - - simpleapi::createObject(dampedParticule, "EulerImplicitSolver", {{ "rayleighStiffness", simpleapi::str(0.)}, - { "rayleighMass", simpleapi::str(0.)}, }); - simpleapi::createObject(dampedParticule, "CGLinearSolver", { - { "iterations", simpleapi::str(25)}, - { "tolerance", simpleapi::str(1e-15)}, - { "threshold", simpleapi::str(1e-15)}, - }); - simpleapi::createObject(dampedParticule, "MechanicalObject", { - { "template", simpleapi::str("Vec3")}, - { "position", simpleapi::str(zeroVec3)}, - { "velocity", simpleapi::str(oneVec3)}, - { "force", simpleapi::str(zeroVec3)}, - { "externalForce", simpleapi::str(zeroVec3)}, - { "derivX", simpleapi::str(zeroVec3)}, - }); - simpleapi::createObject(dampedParticule, "UniformMass", { - { "totalMass", simpleapi::str(1.0)}, - }); - simpleapi::createObject(dampedParticule, "UniformVelocityDampingForceField", { - { "template", simpleapi::str("Vec3")}, - }); - - // end create scene - //********* - sofa::simulation::node::initRoot(root.get()); - //********* - // run simulation - - // compute 2500 time steps - for(int i=0; i<2500; i++) - sofa::simulation::node::animate(root.get(), 0.02); - - // access the MechanicalObect (access position of the dampedParticule) - typename MechanicalObject::SPtr dofs = dampedParticule->get>(root->SearchDown); - sofa::defaulttype::Vec3dTypes::Coord position = dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - // save it as Vec3d for comparison with expected result - Vec3d finalPosition(position[0], position[1], position[2]); - - // Position at t∞ is (10,10,10), see https://github.com/sofa-framework/sofa/pull/4848#issuecomment-2263947900 - EXPECT_LT(expectedPosition-finalPosition,threshold); - } -}; - - - -TEST_F( EulerImplicit_with_damping_forcefield, check ){} - -}// namespace sofa - - - - - - - diff --git a/Sofa/Component/ODESolver/Backward/tests/NewmarkImplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/NewmarkImplicitSolverDynamic_test.cpp deleted file mode 100644 index 82922f25323..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/NewmarkImplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject ; - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with newmark implicit solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct NewmarkImplicitDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position and velocity array - vector positionsArray; - vector velocitiesArray; - vector accelerationsArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0, double rm=0, double rk=0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "NewmarkImplicitSolver", { - { "rayleighStiffness", simpleapi::str(rk)}, - { "rayleighMass", simpleapi::str(rm)} - }); - } - - - /// Generate discrete mass position values with euler implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double cd, double beta, double gamma,double rm,double rk) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - accelerationsArray.reserve(size); - } - - // First acceleration - accelerationsArray.push_back((-K*(z0-z0)-m*g-v0*(cd))/m); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // Constants - const double denominator = (h*h*beta+h*gamma*rk)*K+m*(1+h*gamma*rm); - const double constantAcc = h*(-rm*m*(1-gamma)-K*h*(0.5-beta)-rk*K*(1-gamma)); - const double constantVel = (-rm*m-K*(h+rk)); - const double constant2 = h*h*0.5*(1-2*beta); - - // Compute next velocities and accelerations - for(int i=1;i< size+1; i++) - { - accelerationsArray.push_back((-K*(positionsArray[i-1]-z0)-m*g+constantAcc*accelerationsArray[i-1]+constantVel*velocitiesArray[i-1])/denominator); - velocitiesArray.push_back(velocitiesArray[i-1]+h*(1-gamma)*accelerationsArray[i-1]+h*gamma*accelerationsArray[i]); - positionsArray.push_back(positionsArray[i-1]+h*velocitiesArray[i-1]+constant2*accelerationsArray[i-1]+h*h*beta*accelerationsArray[i]); - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(NewmarkImplicitDynamic_test, DataTypes); - -// Test case: h=0.001 -TYPED_TEST( NewmarkImplicitDynamic_test , newmarkImplicitSolverDynamicTest_high_dt_without_damping) -{ - this->createScene(100,10,1,0,0); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 100, 10,1, 0,10, 2, 0,0.25,0.5,0,0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.1 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( NewmarkImplicitDynamic_test , newmarkImplicitSolverDynamicTest_high_dt_with_damping) -{ - this->createScene(100,10,1,0.1,0.1); // k,m,l0 - //this->loadScene("EulerImplicitSpringDynamicTest.xml"); - // rm = 0.1 and rk=0 - this->generateDiscreteMassPositions (0.1, 100, 10,1, 0,10, 2, 0,0.25,0.5,0.1,0.1); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.01 K=10 m=10 rm=0 rk=0.1 -TYPED_TEST( NewmarkImplicitDynamic_test , newmarkImplicitSolverDynamicTest_medium_dt_with_rayleigh_stiffness) -{ - this->createScene(10,10,1,0,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 10, 10, 1, 0, 10, 2, 0, 0.25, 0.5, 0, 0.1); - this-> compareSimulatedToTheoreticalPositions(6e-15,0.01); -} - -// Test case: h=0.001 K=10 m = 100 rm=0.1 rk=0 -TYPED_TEST( NewmarkImplicitDynamic_test , newmarkImplicitSolverDynamicTest_small_dt_with_rayleigh_mass) -{ - this->createScene(10,100,1,0.1,0); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 10, 100, 1, 0, 10, 2, 0, 0.25, 0.5, 0.1, 0); - this-> compareSimulatedToTheoreticalPositions(9e-16,0.001); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/NewtonRaphsonSolver_test.cpp b/Sofa/Component/ODESolver/Backward/tests/NewtonRaphsonSolver_test.cpp deleted file mode 100644 index 50f258f044d..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/NewtonRaphsonSolver_test.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -#include -#include -#include -#include - -namespace sofa -{ - -struct NewtonRaphsonSquareRootTest : public testing::NumericTest -{ - void doSetUp() override - { - root = simulation::getSimulation()->createNewNode("root"); - - solver = core::objectmodel::New (); - root->addObject(solver); - - solver->d_relativeInitialStoppingThreshold.setValue(-1); - solver->d_absoluteResidualStoppingThreshold.setValue(-1); - solver->d_relativeSuccessiveStoppingThreshold.setValue(-1); - solver->d_maxNbIterationsLineSearch.setValue(1); - solver->d_maxNbIterationsLineSearch.setValue(false); - solver->f_printLog.setValue(false); - - simulation::node::initRoot(root.get()); - } - - sofa::type::vector computeSquareRoot(const SReal x, const SReal initialGuess) const - { - struct SquareRootFunction : public component::odesolver::backward::newton_raphson::BaseNonLinearFunction - { - void setInitialGuess(SReal initialGuess) - { - m_currentGuess = initialGuess; - m_guesses.push_back(initialGuess); - } - - void evaluateCurrentGuess() override - { - const SReal x2 = m_currentGuess * m_currentGuess; - m_currentEvaluation = x2 - m_positiveNumber; - } - - SReal squaredNormLastEvaluation() override - { - return m_currentEvaluation * m_currentEvaluation; - } - - void computeGradientFromCurrentGuess() override - { - m_gradient = 2 * m_currentGuess; - } - - void updateGuessFromLinearSolution(SReal alpha) override - { - m_currentGuess += alpha * m_linearSolverSolution; - } - - void solveLinearEquation() override - { - m_linearSolverSolution = -m_currentEvaluation / m_gradient; - } - - SReal squaredNormDx() override - { - return m_linearSolverSolution * m_linearSolverSolution; - } - - SReal squaredLastEvaluation() override - { - return m_currentGuess * m_currentGuess; - } - - void endNewtonIteration() override - { - m_guesses.push_back(m_currentGuess); - } - - sofa::type::vector m_guesses; - SReal m_currentGuess = 0; - SReal m_currentEvaluation = 0; - SReal m_gradient = 0; - SReal m_linearSolverSolution = 0; - SReal m_positiveNumber; - - } squareRootFunction; - - squareRootFunction.m_positiveNumber = x; - squareRootFunction.setInitialGuess(initialGuess); - - solver->solve(squareRootFunction); - - return squareRootFunction.m_guesses; - } - - simulation::Node::SPtr root ; - component::odesolver::backward::NewtonRaphsonSolver::SPtr solver; -}; - -TEST_F(NewtonRaphsonSquareRootTest, squareRoot612_1) -{ - solver->d_maxNbIterationsNewton.setValue(9); - - const auto sqrt = this->computeSquareRoot(612, 1); - - static const sofa::type::vector sequenceGuesses { - 1, - 306.5, - 154.2483686786, - 79.1079978644, - 43.4221286822, - 28.7581624288, - 25.0195385369, - 24.7402106712, - 24.7386338040, - 24.7386337537 - }; - - ASSERT_EQ(sequenceGuesses.size(), sqrt.size()); - - for (unsigned int i = 0; i < sequenceGuesses.size(); ++i) - { - EXPECT_NEAR(sequenceGuesses[i], sqrt[i], 1e-10); - } -} - -TEST_F(NewtonRaphsonSquareRootTest, squareRoot612_10) -{ - solver->d_maxNbIterationsNewton.setValue(5); - - const auto sqrt = this->computeSquareRoot(612, 10); - - static const sofa::type::vector sequenceGuesses { - 10, - 35.6, - 26.3955056180, - 24.7906354925, - 24.7386882941, - 24.7386337538 - }; - - ASSERT_EQ(sequenceGuesses.size(), sqrt.size()); - - for (unsigned int i = 0; i < sequenceGuesses.size(); ++i) - { - EXPECT_NEAR(sequenceGuesses[i], sqrt[i], 1e-10); - } -} - -TEST_F(NewtonRaphsonSquareRootTest, squareRoot612_minus20) -{ - solver->d_maxNbIterationsNewton.setValue(4); - - const auto sqrt = this->computeSquareRoot(612, -20); - - static const sofa::type::vector sequenceGuesses { - -20, - -25.3, - -24.7448616601, - -24.7386345374, - -24.7386337537 - }; - - ASSERT_EQ(sequenceGuesses.size(), sqrt.size()); - - for (unsigned int i = 0; i < sequenceGuesses.size(); ++i) - { - EXPECT_NEAR(sequenceGuesses[i], sqrt[i], 1e-10); - } -} - - - - - -struct NewtonRaphsonParameters -{ - SReal relativeSuccessiveStoppingThreshold {}; - SReal relativeInitialStoppingThreshold {}; - SReal absoluteResidualStoppingThreshold {}; - SReal relativeEstimateDifferenceThreshold {}; - SReal absoluteEstimateDifferenceThreshold {}; - unsigned int maxNbIterationsLineSearch = 1; - unsigned int maxNbIterationsNewton = 1; - - void apply(component::odesolver::backward::NewtonRaphsonSolver* solver) const - { - solver->d_relativeSuccessiveStoppingThreshold.setValue(relativeSuccessiveStoppingThreshold); - solver->d_relativeInitialStoppingThreshold.setValue(relativeInitialStoppingThreshold); - solver->d_absoluteResidualStoppingThreshold.setValue(absoluteResidualStoppingThreshold); - solver->d_relativeEstimateDifferenceThreshold.setValue(relativeEstimateDifferenceThreshold); - solver->d_absoluteEstimateDifferenceThreshold.setValue(absoluteEstimateDifferenceThreshold); - solver->d_maxNbIterationsLineSearch.setValue(maxNbIterationsLineSearch); - solver->d_maxNbIterationsNewton.setValue(maxNbIterationsNewton); - } -}; - -struct NewtonRaphsonTest : public testing::BaseSimulationTest -{ - SceneInstance m_scene{}; - - component::odesolver::backward::NewtonRaphsonSolver* m_solver { nullptr }; - component::statecontainer::MechanicalObject* m_state { nullptr }; - - void doSetUp() override - { - sofa::simpleapi::importPlugin("Sofa.Component.LinearSolver.Direct"); - sofa::simpleapi::importPlugin("Sofa.Component.ODESolver.Backward"); - sofa::simpleapi::importPlugin("Sofa.Component.StateContainer"); - sofa::simpleapi::importPlugin("Sofa.Component.Topology.Container.Dynamic"); - - sofa::simpleapi::createObject(m_scene.root, "DefaultAnimationLoop"); - sofa::simpleapi::createObject(m_scene.root, "BDFOdeSolver", {{"order", "1"}}); - auto solverObject = sofa::simpleapi::createObject(m_scene.root, "NewtonRaphsonSolver", {{"printLog", "true"}}); - m_solver = dynamic_cast(solverObject.get()); - sofa::simpleapi::createObject(m_scene.root, "EigenSimplicialLDLT", {{"template", "CompressedRowSparseMatrix"}}); - auto stateObject = sofa::simpleapi::createObject(m_scene.root, "MechanicalObject", {{"template", "Vec1"}, {"position", "1"}, {"rest_position", "0"}}); - m_state = dynamic_cast*>(stateObject.get()); - sofa::simpleapi::createObject(m_scene.root, "PointSetTopologyContainer", {{"name", "topology"}, {"position", "1"}}); - - ASSERT_NE(nullptr, m_solver); - ASSERT_NE(nullptr, m_state); - } - - void noForce() - { - m_scene.initScene(); - EXPECT_EQ(m_solver->d_status.getValue(), component::odesolver::backward::NewtonStatus("Undefined")); - - m_scene.simulate(0.01_sreal); - EXPECT_EQ(m_solver->d_status.getValue(), component::odesolver::backward::NewtonStatus("ConvergedEquilibrium")); - } - - void gravity(const NewtonRaphsonParameters& params, const component::odesolver::backward::NewtonStatus& expectedStatus) - { - static constexpr SReal gravity = -1; - m_scene.root->setGravity({gravity, 0, 0}); - - sofa::simpleapi::importPlugin("Sofa.Component.Mass"); - sofa::simpleapi::createObject(m_scene.root, "UniformMass", {{"totalMass", "1"}, {"topology", "@topology"}, {"printLog", "true"}}); - params.apply(m_solver); - - m_scene.initScene(); - EXPECT_EQ(m_solver->d_status.getValue(), component::odesolver::backward::NewtonStatus("Undefined")); - - auto previousVelocity = m_state->read(sofa::core::vec_id::read_access::velocity)->getValue(); - auto previousPosition = m_state->read(sofa::core::vec_id::read_access::position)->getValue(); - - static constexpr SReal dt = 0.1_sreal; - m_scene.simulate(dt); - EXPECT_EQ(m_solver->d_status.getValue(), expectedStatus); - - const auto& velocity = m_state->read(sofa::core::vec_id::read_access::velocity)->getValue(); - const auto& position = m_state->read(sofa::core::vec_id::read_access::position)->getValue(); - - EXPECT_FLOATINGPOINT_EQ(velocity[0].x(), gravity * dt) - EXPECT_FLOATINGPOINT_EQ(position[0].x(), previousPosition[0].x() + velocity[0].x() * dt); - - for (unsigned int i = 1; i < 10; ++i) - { - previousVelocity = m_state->read(sofa::core::vec_id::read_access::velocity)->getValue(); - previousPosition = m_state->read(sofa::core::vec_id::read_access::position)->getValue(); - - m_scene.simulate(dt); - EXPECT_FLOATINGPOINT_EQ(velocity[0].x(), previousVelocity[0].x() + gravity * dt); - - EXPECT_FLOATINGPOINT_EQ(position[0].x(), previousPosition[0].x() + velocity[0].x() * dt); - } - } - - void spring(const SReal k, const SReal L_0, const SReal dt) - { - SOFA_UNUSED(L_0); - sofa::simpleapi::importPlugin("Sofa.Component.SolidMechanics.Spring"); - - sofa::simpleapi::createObject(m_scene.root, "RestShapeSpringsForceField", {{"points", "0"}, {"stiffness", std::to_string(k)}}); - - m_scene.initScene(); - EXPECT_EQ(m_solver->d_status.getValue(), component::odesolver::backward::NewtonStatus("Undefined")); - - NewtonRaphsonParameters params; - params.maxNbIterationsNewton = 2; - params.apply(m_solver); - - m_scene.simulate(dt); - - EXPECT_EQ(m_solver->d_status.getValue(), component::odesolver::backward::NewtonStatus("DivergedMaxIterations")); - - } - -}; - -TEST_F(NewtonRaphsonTest, noForce) -{ - this->noForce(); -} - -TEST_F(NewtonRaphsonTest, gravity_noStopping) -{ - // no stopping criteria is defined so it cannot converge - this->gravity( - NewtonRaphsonParameters{}, - component::odesolver::backward::NewtonStatus("DivergedMaxIterations")); -} - -TEST_F(NewtonRaphsonTest, gravity_relativeSuccessiveStopping) -{ - NewtonRaphsonParameters params; - params.relativeSuccessiveStoppingThreshold = 1e-15_sreal; - - this->gravity( - params, - component::odesolver::backward::NewtonStatus("ConvergedResidualSuccessiveRatio")); -} - -TEST_F(NewtonRaphsonTest, gravity_relativeInitialStopping) -{ - NewtonRaphsonParameters params; - params.relativeInitialStoppingThreshold = 1e-15_sreal; - - this->gravity( - params, - component::odesolver::backward::NewtonStatus("ConvergedResidualInitialRatio")); -} - -TEST_F(NewtonRaphsonTest, gravity_absoluteResidualStopping) -{ - NewtonRaphsonParameters params; - params.absoluteResidualStoppingThreshold = 1e-15_sreal; - - this->gravity( - params, - component::odesolver::backward::NewtonStatus("ConvergedAbsoluteResidual")); -} - -TEST_F(NewtonRaphsonTest, gravity_relativeEstimateDifferenceStopping) -{ - NewtonRaphsonParameters params; - params.relativeEstimateDifferenceThreshold = 1e-15_sreal; - - // considered as diverged because this threshold requires more than one iteration - this->gravity( - params, - component::odesolver::backward::NewtonStatus("DivergedMaxIterations")); -} - -TEST_F(NewtonRaphsonTest, gravity_absoluteEstimateDifferenceStopping) -{ - NewtonRaphsonParameters params; - params.absoluteEstimateDifferenceThreshold = 1e-15_sreal; - - // considered as diverged because this threshold requires more than one iteration - this->gravity( - params, - component::odesolver::backward::NewtonStatus("DivergedMaxIterations")); -} - -TEST_F(NewtonRaphsonTest, spring) -{ - this->spring(1000, 1, 0.1); -} - - -} diff --git a/Sofa/Component/ODESolver/Backward/tests/SpringSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/SpringSolverDynamic_test.cpp deleted file mode 100644 index 4a7ae8a587b..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/SpringSolverDynamic_test.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::NumericTest; - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -#include - -#include - -namespace sofa { - -using namespace component; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This test compares siumlated mass position to analytic mass position during 2s every time step (here dt=0.001). -*/ - -template -struct SpringSolverDynamic_test : public NumericTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Root of the scene graph - simulation::Node::SPtr root; - /// Tested simulation - simulation::Simulation* simulation; - - - /// Create the context for the scene - void doSetUp() override - { - // Init simulation - simulation = sofa::simulation::getSimulation(); - root = simulation::getSimulation()->createNewGraph("root"); - } - - void loadScene(std::string sceneName) - { - // Load the scene from the xml file - const std::string fileName = std::string(SOFACOMPONENTODESOLVERBACKWARD_TEST_SCENES_DIR) + "/" + sceneName; - root = sofa::simulation::node::load(fileName.c_str()); - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance) - { - // Init simulation - sofa::simulation::node::initRoot(root.get()); - double time = root->getTime(); - const double stiffnessSpring = 100; - const double mass = 10; - const double w = sqrt(stiffnessSpring/mass); - - // Get mechanical object - const simulation::Node::SPtr massNode = root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - // Absolute error - double absoluteError = fabs(p0[1]-(cos(w*time))); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << cos(sqrt(stiffnessSpring/mass)*time) << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - sofa::simulation::node::animate(root.get(), 0.001_sreal); - time = root->getTime(); - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - defaulttype::Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(SpringSolverDynamic_test, DataTypes); - -// Test case EulerImplicit Solver -TYPED_TEST( SpringSolverDynamic_test , EulerImplicitSolverDynamicTest ) -{ - EXPECT_MSG_NOEMIT(Error) ; - this->loadScene("EulerImplicitSpringDynamicTest.xml"); - ASSERT_TRUE( this->compareSimulatedToTheoreticalPositions(0.01)); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/StaticSolver_test.cpp b/Sofa/Component/ODESolver/Backward/tests/StaticSolver_test.cpp deleted file mode 100644 index 8a78b4dc8fd..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/StaticSolver_test.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -#include -#include -#include -#include - -#include -#include - -using namespace sofa::simulation; -using namespace sofa::simpleapi; -using namespace sofa::helper::logging; - -using sofa::simulation::graph::DAGSimulation; -using sofa::component::odesolver::backward::StaticSolver; - -static constexpr SReal poissonRatio = 0; -static constexpr SReal youngModulus = 3000; -static constexpr SReal mu = youngModulus / (2.0 * (1.0 + poissonRatio)); -static constexpr SReal l = youngModulus * poissonRatio / ((1.0 + poissonRatio) * (1.0 - 2.0 * poissonRatio)); - -/** - * Create a bending rectangular beam simulation using the StaticSolver. - * - * Domain: 15x15x80 - * Discretization: 3x3x9 nodes, linear tetrahedral mesh - * Material: StVenantKirchhoff (Young modulus = 3000, Poisson ratio = 0.4) - * - */ -class StaticSolverTest : public sofa::testing::BaseTest -{ -public: - void doSetUp() override { - - root = getSimulation()->createNewNode("root"); - - this->loadPlugins({ - Sofa.Component.Topology.Container.Grid, - Sofa.Component.ODESolver.Backward, - Sofa.Component.LinearSolver.Direct, - Sofa.Component.StateContainer, - Sofa.Component.Topology.Container.Dynamic, - Sofa.Component.Topology.Mapping, - Sofa.Component.SolidMechanics.FEM.HyperElastic, - Sofa.Component.Engine.Select, - Sofa.Component.Constraint.Projective, - Sofa.Component.MechanicalLoad - }); - - createObject(root, "DefaultAnimationLoop"); - createObject(root, "RegularGridTopology", {{"name", "grid"}, {"min", "-7.5 -7.5 0"}, {"max", "7.5 7.5 80"}, {"n", "3 3 9"}}); - const auto s = createObject(root, "StaticSolver"); - const auto n = createObject(root, "NewtonRaphsonSolver", {{"maxNbIterationsNewton", "10"}}); - createObject(root, "SparseLDLSolver", {{"template", "CompressedRowSparseMatrixd"}}); - createObject(root, "MechanicalObject", {{"name", "mo"}, {"src", "@grid"}}); - createObject(root, "TetrahedronSetTopologyContainer", {{"name", "mechanical_topology"}}); - createObject(root, "TetrahedronSetTopologyModifier"); - createObject(root, "Hexa2TetraTopologicalMapping", {{"input", "@grid"}, {"output", "@mechanical_topology"}}); - createObject(root, "TetrahedronHyperelasticityFEMForceField", { - {"name", "FEM"}, - {"materialName", "StVenantKirchhoff"}, - {"ParameterSet", std::to_string(mu) + " " + std::to_string(l)}, - {"topology", "@mechanical_topology"} - }); - ASSERT_NE(root->getObject("FEM"), nullptr); - ASSERT_NE(root->getObject("FEM")->findData("materialName"), nullptr); - ASSERT_EQ(root->getObject("FEM")->findData("materialName")->getValueString(), "StVenantKirchhoff"); - - createObject(root, "BoxROI", {{"name", "top_roi"}, {"box", "-7.5 -7.5 -0.9 7.5 7.5 0.1"}, {"triangles", "@mechanical_topology.triangles"}}); - createObject(root, "FixedProjectiveConstraint", {{"indices", "@top_roi.indices"}}); - - createObject(root, "BoxROI", {{"name", "base_roi"}, {"box", "-7.5 -7.5 79.9 7.5 7.5 80.1"}, {"triangles", "@mechanical_topology.triangles"}}); - createObject(root, "SurfacePressureForceField", {{"pressure", "100"}, {"mainDirection", "0 -1 0"}, {"triangleIndices", "@base_roi.trianglesInROI"}}); - - staticSolver = dynamic_cast (s.get()); - newtonSolver = dynamic_cast (n.get()); - } - - void doTearDown() override { - sofa::simulation::node::unload(root); - } - - auto execute() -> std::vector { - using namespace std; - sofa::simulation::node::initRoot(root.get()); - sofa::simulation::node::animate(root.get(), 1_sreal); - const auto& residualGraph = newtonSolver->d_residualGraph.getValue(); - auto residuals = residualGraph.at("residual"); - transform(begin(residuals), end(residuals), begin(residuals), [](SReal r) {return sqrt(r);}); - return residuals; - } - - - NodeSPtr root; - StaticSolver::SPtr staticSolver; - sofa::component::odesolver::backward::NewtonRaphsonSolver::SPtr newtonSolver; -}; - -TEST_F(StaticSolverTest, Residuals) { - // These are the expected force residual if we do not activate any convergence threshold - // and force the solve to do 10 Newton iterations - const std::vector expected_force_residual_norms = { - 6286.9334449829712, - 2535.2291278587031, - 196.33640050006048, - 35.551907341224727, - 2.4346076657342617, - 0.25822327664821382, - 0.028069066914505583, - 0.0041872264223336737, - 0.00058185560326781769, - 8.5402692438165759e-05, - 1.2283305451908398e-05 - }; - - // Disable all convergence criteria - newtonSolver->d_maxNbIterationsNewton.setValue(10); - newtonSolver->d_relativeSuccessiveStoppingThreshold.setValue(-1); - newtonSolver->d_relativeInitialStoppingThreshold.setValue(-1); - newtonSolver->d_absoluteResidualStoppingThreshold.setValue(-1); - newtonSolver->d_relativeEstimateDifferenceThreshold.setValue(-1); - newtonSolver->d_absoluteEstimateDifferenceThreshold.setValue(-1); - newtonSolver->d_warnWhenDiverge.setValue(false); - - const std::vector actual_force_residual_norms = this->execute(); - - EXPECT_EQ(actual_force_residual_norms.size(), expected_force_residual_norms.size()) - << "The static ODE solver is supposed to execute 10 Newton steps since the convergence criteria were deactivated."; - - for (std::size_t newton_it = 0; newton_it < actual_force_residual_norms.size(); ++newton_it) { - EXPECT_NEAR(actual_force_residual_norms[newton_it], expected_force_residual_norms[newton_it], 1e-3) - << "The actual force residual norm doesn't match the expected one."; - } -} - -TEST_F(StaticSolverTest, RelativeResiduals) -{ - // Disable all convergence criteria BUT the relative residual - - newtonSolver->d_maxNbIterationsNewton.setValue(10); - newtonSolver->d_relativeSuccessiveStoppingThreshold.setValue(-1); - newtonSolver->d_relativeInitialStoppingThreshold.setValue(1e-5_sreal); - newtonSolver->d_absoluteResidualStoppingThreshold.setValue(-1); - newtonSolver->d_relativeEstimateDifferenceThreshold.setValue(1e-5_sreal); - newtonSolver->d_absoluteEstimateDifferenceThreshold.setValue(-1); - newtonSolver->d_warnWhenDiverge.setValue(false); - - const sofa::type::vector actual_force_residual_norms = this->execute(); - EXPECT_EQ(actual_force_residual_norms.size(), 7) - << "The static ODE solver is supposed to converge after 7 Newton steps when using a relative residual threshold of 1e-5.\n" - << actual_force_residual_norms; -} - -TEST_F(StaticSolverTest, AbsoluteResiduals) { - // Disable all convergence criteria BUT the absolute residual - newtonSolver->d_maxNbIterationsNewton.setValue(10); - newtonSolver->d_relativeSuccessiveStoppingThreshold.setValue(-1); - newtonSolver->d_relativeInitialStoppingThreshold.setValue(-1); - newtonSolver->d_absoluteResidualStoppingThreshold.setValue(-1); - newtonSolver->d_relativeEstimateDifferenceThreshold.setValue(-1); - newtonSolver->d_absoluteEstimateDifferenceThreshold.setValue(1e-5_sreal); - newtonSolver->d_warnWhenDiverge.setValue(true); - - const sofa::type::vector actual_force_residual_norms = this->execute(); - EXPECT_EQ(actual_force_residual_norms.size(), 9) - << "The static ODE solver is supposed to converge after 9 Newton steps when using an absolute residual threshold of 1e-5.\n" - << actual_force_residual_norms; -} diff --git a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticExplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticExplicitSolverDynamic_test.cpp deleted file mode 100644 index d002cc9af83..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticExplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject ; - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with variational symplectic explicit solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct VariationalSymplecticExplicitSolverDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - typedef typename DataTypes::Real Real; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position and velocity array - type::vector positionsArray; - type::vector velocitiesArray; - type::vector energiesArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0, double rm=0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "VariationalSymplecticSolver", { - { "explicitIntegration", simpleapi::str(true)}, - { "rayleighMass", simpleapi::str(rm)} - }); - - } - - /// Generate discrete mass position values with variational sympletic implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double rm) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - energiesArray.reserve(size); - } - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // First acceleration - energiesArray.push_back(m*v0); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // Compute velocities, energies and positions - for(int i=1;i< size+1; i++) - { - velocitiesArray.push_back((energiesArray[i-1]+h*(-K*(positionsArray[i-1]-z0)-m*g-rm*m*velocitiesArray[i-1]))/m); - energiesArray.push_back(m*velocitiesArray[i]); - positionsArray.push_back(positionsArray[i-1]+h*velocitiesArray[i]); - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename statecontainer::MechanicalObject<_DataTypes>::SPtr dofs = massNode->get>(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(VariationalSymplecticExplicitSolverDynamic_test, DataTypes); - -// Test case: h=0.001 -TYPED_TEST( VariationalSymplecticExplicitSolverDynamic_test , variationalSymplecticExplicitSolverDynamicTest_small_dt_without_damping) -{ - this->createScene(100,10,1,0); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 100, 10, 1, 0, 10, 2, 0); - this-> compareSimulatedToTheoreticalPositions(1.9e-14,0.001); -} - -// Test case: h=0.01 k=1000 m =10 rm=0.1 -TYPED_TEST( VariationalSymplecticExplicitSolverDynamic_test , variationalSymplecticExplicitSolverDynamicTest_medium_dt_with_damping) -{ - this->createScene(1000,10,1,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 1000, 10, 1, 0, 10, 2, 0.1); - this-> compareSimulatedToTheoreticalPositions(2.3e-16,0.01); -} - -// Test case: h=0.1 K=10 m=10 rm=0.1 -TYPED_TEST( VariationalSymplecticExplicitSolverDynamic_test , variationalSymplecticExplicitSolverDynamicTest_high_dt_with_damping) -{ - this->createScene(10,10,1,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 10, 10, 1, 0, 10, 2, 0.1); - this-> compareSimulatedToTheoreticalPositions(1.8e-15,0.1); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverDynamic_test.cpp deleted file mode 100644 index e0c21b0c99b..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ - -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject ; - -// Solvers -#include - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with variational symplectic solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct VariationalSymplecticImplicitSolverDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - typedef component::odesolver::backward::VariationalSymplecticSolver VariationalSymplecticSolver; - - /// Position and velocity array - type::vector positionsArray; - type::vector velocitiesArray; - type::vector energiesArray; - - // totalEnergy - double totalEnergy; - - /// Create the context for the scene - void createScene(double K, double m, double l0, double rm=0, double rk=0) - { - this->prepareScene(K, m, l0); - - // add ODE Solver to test - simpleapi::createObject(m_si.root, "VariationalSymplecticSolver", { - { "rayleighStiffness", simpleapi::str(rk)}, - { "rayleighMass", simpleapi::str(rm)}, - { "computeHamiltonian", "1"}, - { "newtonError", simpleapi::str(1e-12)}, - { "newtonSteps", simpleapi::str(4)} - }); - } - - - /// Generate discrete mass position values with variational sympletic implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double rm,double rk) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - energiesArray.reserve(size); - } - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // First acceleration - energiesArray.push_back(m*v0); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // Compute totalEnergy - totalEnergy = m*g*z0; // energy at initial time - - // Set constants - const double denominator = 4*m+h*h*K+4*h*(rm*m + rk*K);//4*h*(-rk*K+rm*m); - const double constant = -h*K; - - // Compute velocities, energies and positions - for(int i=1;i< size+1; i++) - { - velocitiesArray.push_back(2*(-m*g*h+constant*(positionsArray[i-1]-z0)+2*energiesArray[i-1])/denominator); - energiesArray.push_back(m*velocitiesArray[i]+h*(-K*(positionsArray[i-1]- z0+velocitiesArray[i]*h/2) -m*g)/2); - positionsArray.push_back(positionsArray[i-1]+h*velocitiesArray[i]); - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions( double h, double tolerancePosition, double toleranceEnergy = 1e-13, bool checkEnergyConservation=false) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename statecontainer::MechanicalObject<_DataTypes>::SPtr dofs = massNode->get>(m_si.root->SearchDown); - const typename VariationalSymplecticSolver::SPtr variationalSolver = m_si.root->get(m_si.root->SearchDown); - - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerancePosition ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - - - // Check if hamiltonian energy is constant when there is no damping - if(checkEnergyConservation && fabs(variationalSolver->d_hamiltonianEnergy.getValue() - totalEnergy) > toleranceEnergy ) - { - ADD_FAILURE() << "Hamiltonian energy at time " << time << " is wrong: " << std::endl - << " expected Energy is " << totalEnergy << std::endl - << " actual Energy is " << variationalSolver->d_hamiltonianEnergy.getValue() << std::endl - << "absolute error = " << fabs(variationalSolver->d_hamiltonianEnergy.getValue() - totalEnergy) << std::endl; - return false; - } - - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(VariationalSymplecticImplicitSolverDynamic_test, DataTypes); - -// Test case: h=0.1 k=100 m =1 rm=0.1 rk=0.1 -TYPED_TEST( VariationalSymplecticImplicitSolverDynamic_test , variationalSymplecticImplicitSolverDynamicTest_high_dt_without_damping) -{ - this->createScene(100,1,1,0,0); // k,m,l0 - // rm = 0.1 and rk=0 - this->generateDiscreteMassPositions (0.01, 100, 1, 1, 0,10, 2, 0 ,0); - // With incremental potential energy - this-> compareSimulatedToTheoreticalPositions(0.01,9e-15,8e-15,true); -} - -// Test case: h=0.01 K=100 m = 10 rm=0.1 rk=0 -TYPED_TEST( VariationalSymplecticImplicitSolverDynamic_test , variationalSymplecticImplicitSolverDynamicTest_medium_dt_with_rayleigh_mass) -{ - this->createScene(100,10,1,0.1,0); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 100, 10, 1, 0,10, 2, 0.1,0); - this-> compareSimulatedToTheoreticalPositions(0.01, 7e-15); -} - -// Test case: h=0.01 k=100 m=10 rm=0 rk=0.1 -TYPED_TEST( VariationalSymplecticImplicitSolverDynamic_test , variationalSymplecticImplicitSolverDynamicTest_medium_dt_with_rayleigh_stiffness) -{ - this->createScene(100,10,1,0,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 100, 10, 1, 0,10, 2, 0, 0.1); - this-> compareSimulatedToTheoreticalPositions(0.01, 3.3e-15); -} - -// Test case: h=0.001 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( VariationalSymplecticImplicitSolverDynamic_test , variationalSymplecticImplicitSolverDynamicTest_small_dt_with_damping) -{ - this->createScene(100,10,1,0.1,0.1); // k,m,l0 - // rm = 0.1 and rk=0 - this->generateDiscreteMassPositions (0.001, 100, 10, 1, 0,10, 2, 0.1 ,0.1); - this-> compareSimulatedToTheoreticalPositions(0.001, 6.3e-15); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverNonLinearForceDynamic_test.cpp b/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverNonLinearForceDynamic_test.cpp deleted file mode 100644 index aa1234010e5..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/VariationalSymplecticImplicitSolverNonLinearForceDynamic_test.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include - -// Solvers -#include -#include - -#include - -#include - -// For atan2 ?? -//#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using namespace modeling; - -/** Dynamic solver test. -Test the dynamic behavior of solver with non linear force : study a sun-planet system with gravitational force. -Create a simulation with 2 mechanical objects: one MO fixed (the sun) and one MO (the planet) with a -initial velocity perpendicular to the initial sun-planet axis. -The time step h is computed with the period T of the sun-planet system: -h = T/nbIter. -From simulated positions (simu_x;simu_y) compute the angle of the ellipse -angle = atan(simu_y/simu_x) -then compute the radius -radius = (1-e)*r0/(1-e*cos(angle)) with r0= initialRadius and e = eccentricity = ABS(r0*v0*v0/(g*M)-1) (v0 initial velocity) -and finally the expected trajectory -expected_x = radius*cos(angle) -expected-y = radius*sin(angle) -Check if simulated positions are on the right trajectory, that is to say compare simulated and expected positions. -Check if positions are correct by comparing the expected planet position to the simulated position at period T. -Check if Hamiltonian energy is constant during simulation: variational solver is used with incremental potential energy. -*/ - -template -struct VariationalSymplecticImplicitSolverNonLinearForceDynamic_test : public BaseSimulationTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - typedef typename DataTypes::Deriv Deriv; - typedef typename DataTypes::Real Real; - - typedef container::MechanicalObject MechanicalObject; - typedef component::odesolver::VariationalSymplecticSolver VariationalSymplecticSolver; - typedef component::linearsolver::CGLinearSolver CGLinearSolver; - - - /// Root of the scene graph - simulation::Node::SPtr root; - /// Tested simulation - simulation::Simulation* simulation; - /// Position and velocity array - type::vector positionsArray; - type::vector velocitiesArray; - type::vector energiesArray; - - // Variational solver - VariationalSymplecticSolver::SPtr variationalSolver; - - // totalEnergy - double totalEnergy; - - /// Create the context for the scene - void createScene(double g, double M, double m, double x0_x, double v0_y) - { - // Init simulation - assert(sofa::simulation::getSimulation()); - root = simulation::getSimulation()->createNewGraph("root"); - - // Create the scene - root->setGravity(Coord(0,0,0)); - - // Solver Variational - variationalSolver = addNew (root); - variationalSolver->f_rayleighStiffness.setValue(0); - variationalSolver->f_rayleighMass.setValue(0); - variationalSolver->f_newtonError.setValue(1e-12);//1e-18 - variationalSolver->f_newtonSteps.setValue(4);//7 - variationalSolver->f_computeHamiltonian.setValue(1); - variationalSolver->f_saveEnergyInFile.setValue(0); - - CGLinearSolver::SPtr cgLinearSolver = addNew (root); - cgLinearSolver->d_maxIter.setValue(3000); - cgLinearSolver->d_tolerance.setValue(1e-12); - cgLinearSolver->d_smallDenominatorThreshold.setValue(1e-12); - - // Set initial positions and velocities of fixed point and mass - Coord xSun = Coord(0,0,0); - //MechanicalObject3::DataTypes::set( xSun[0], 0., 0.,0.); - Deriv vSun = Deriv(0,0,0); - //MechanicalObject3::DataTypes::set( vSun[0], 0.,0.,0.); - Coord xPlanet = Coord(x0_x,0,0); - //MechanicalObject3::DataTypes::set( xPlanet[0], 1., 0.,0.); - Deriv vPlanet = Deriv(0,v0_y,0); - //MechanicalObject3::DataTypes::set( vPlanet[0], 0., 0.18, 0.); - - // Sun planet system - root = sofa::createSunPlanetSystem( - root, // add sun planet system to the node containing solver - M, // sun mass - m, // planet mass - g, // gravity constant - xSun, // Initial position of sun - vSun, // Final velocity of sun - xPlanet, // Initial position of planet - vPlanet); // Initial velocity of planet - - } - - /// Check if planet positions are on the right trajectory - bool comparePlanetPositionsAndTrajectory (double g, double v0, double r0,double m,double M, double nbIter, double toleranceTrajectory, double tolerancePosition, double toleranceEnergy) - { - // Set parameters - double e = fabs(r0*v0*v0/(g*M) - 1); // eccentricity - double a = r0*g*M/(2*g*M-r0*v0*v0); - double period = 2*M_PI*a*a*sqrt(1-e*e)/(r0*v0); - double h = period*1.0/nbIter; - - // totalEnergy - totalEnergy = 0.5*m*v0*v0 - m*M*g/sqrt(r0*r0); - - int i = 0; - - // Init simulation - sofa::simulation::getSimulation()->init(root.get()); - double time = root->getTime(); - - // Get mechanical object - typename MechanicalObject::SPtr dofs = root->get(root->SearchDown); - - // Variables - double angle, radius, truePosX, truePosY; - - // Animate - do - { - // Record the planet position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[1]; - - // Compute angle - angle = atan2(p0[1],p0[0]); - - // Compute radius - radius = (1-e)*r0/(1-e*cos(angle)); - - // Expected positions - truePosX = radius*cos(angle); - truePosY = radius*sin(angle); - - double absoluteError = sqrt((p0[0]-truePosX)*(p0[0]-truePosX)+(p0[1]-truePosY)*(p0[1]-truePosY)); - - // Compare mass position to the theoretical position - if( absoluteError > toleranceTrajectory ) - { - ADD_FAILURE() << "Position of planet at time " << time << " is wrong: " << std::endl - <<" expected Position is " << truePosX << " , " << truePosY << std::endl - <<" actual Position is " << p0[0] << " , " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - sofa::simulation::getSimulation()->animate(root.get(),h); - time = root->getTime(); - - // Check energy is constant when there is no damping - if(fabs(variationalSolver->f_hamiltonianEnergy.getValue() -totalEnergy) > toleranceEnergy ) - { - ADD_FAILURE() << "Hamiltonian energy at time " << time << " is wrong: " << std::endl - <<" expected Energy is " << totalEnergy << std::endl - <<" actual Energy is " << variationalSolver->f_hamiltonianEnergy.getValue() << std::endl - << "absolute error = " << fabs(variationalSolver->f_hamiltonianEnergy.getValue() -totalEnergy) << std::endl; - return false; - } - - // Iterate - i++; - - } - while (i < nbIter); - - // Check period T - if(i == nbIter) // normally true - { - double absoluteError = sqrt((r0-truePosX)*(r0-truePosX)+(0-truePosY)*(0-truePosY)); - - // Compare mass position to the theoretical position - if( absoluteError > tolerancePosition ) - { - ADD_FAILURE() << "Position of planet at period " << time << " is wrong: " << std::endl - <<" expected Position is " << truePosX << " , " << truePosY << std::endl - <<" actual Position is " << r0 << " , " << 0 << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - } - - return true; - } - - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(VariationalSymplecticImplicitSolverNonLinearForceDynamic_test, DataTypes); - -// Test case: h=0.001 -TYPED_TEST( VariationalSymplecticImplicitSolverNonLinearForceDynamic_test , variationalSymplecticImplicitSolverGravitationForceTest) -{ - this->createScene(0.075, 1, 1, 1, 0.18); // g, M, m, x0, v0 - - // Compute potential energy from force in variational solver - this->comparePlanetPositionsAndTrajectory (0.075, 0.18, 1, 1, 1, 1700, 8e-5, 1.1e-3, 1e-14); - //g, v0, r0, M, m, nbIter, toleranceTrajectory, tolerancePosition, toleranceEnergy - -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Backward/tests/scenes/EulerImplicitSpringDynamicTest.xml b/Sofa/Component/ODESolver/Backward/tests/scenes/EulerImplicitSpringDynamicTest.xml deleted file mode 100644 index 7b476309b64..00000000000 --- a/Sofa/Component/ODESolver/Backward/tests/scenes/EulerImplicitSpringDynamicTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Sofa/Component/ODESolver/CMakeLists.txt b/Sofa/Component/ODESolver/CMakeLists.txt deleted file mode 100644 index de2fd4732a2..00000000000 --- a/Sofa/Component/ODESolver/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.22) -project(Sofa.Component.ODESolver LANGUAGES CXX) - -set(SOFACOMPONENTODESOLVER_SOURCE_DIR "src/sofa/component/odesolver") - -sofa_add_subdirectory_modules(SOFACOMPONENTODESOLVER_TARGETS - DIRECTORIES Forward Backward -) - -set(HEADER_FILES - ${SOFACOMPONENTODESOLVER_SOURCE_DIR}/config.h.in - ${SOFACOMPONENTODESOLVER_SOURCE_DIR}/init.h -) - -set(SOURCE_FILES - ${SOFACOMPONENTODESOLVER_SOURCE_DIR}/init.cpp -) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC ${SOFACOMPONENTODESOLVER_TARGETS}) - -sofa_create_package_with_targets( - PACKAGE_NAME ${PROJECT_NAME} - PACKAGE_VERSION ${Sofa_VERSION} - TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES - INCLUDE_SOURCE_DIR "src" - INCLUDE_INSTALL_DIR "${PROJECT_NAME}" -) - -if(SOFA_BUILD_TESTS) - add_subdirectory(Testing) -endif() diff --git a/Sofa/Component/ODESolver/Forward/CMakeLists.txt b/Sofa/Component/ODESolver/Forward/CMakeLists.txt deleted file mode 100644 index 885ddd11abf..00000000000 --- a/Sofa/Component/ODESolver/Forward/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -cmake_minimum_required(VERSION 3.22) -project(Sofa.Component.ODESolver.Forward LANGUAGES CXX) - -set(SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR "src/sofa/component/odesolver/forward") - -set(HEADER_FILES - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/config.h.in - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/init.h - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/EulerExplicitSolver.h - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/CentralDifferenceSolver.h - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/RungeKutta2Solver.h - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/RungeKutta4Solver.h - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/DampVelocitySolver.h -) - -set(SOURCE_FILES - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/init.cpp - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/EulerExplicitSolver.cpp - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/CentralDifferenceSolver.cpp - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/RungeKutta2Solver.cpp - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/RungeKutta4Solver.cpp - ${SOFACOMPONENTODESOLVERFORWARD_SOURCE_DIR}/DampVelocitySolver.cpp -) - -sofa_find_package(Sofa.Simulation.Core REQUIRED) - -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Core) - -sofa_create_package_with_targets( - PACKAGE_NAME ${PROJECT_NAME} - PACKAGE_VERSION ${Sofa_VERSION} - TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES - INCLUDE_SOURCE_DIR "src" - INCLUDE_INSTALL_DIR "${PROJECT_NAME}" -) - -cmake_dependent_option(SOFA_COMPONENT_ODESOLVER_FORWARD_BUILD_TESTS "Compile the automatic tests" ON "SOFA_BUILD_TESTS OR NOT DEFINED SOFA_BUILD_TESTS" OFF) -if(SOFA_COMPONENT_ODESOLVER_FORWARD_BUILD_TESTS) - add_subdirectory(tests) -endif() diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.h b/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.h deleted file mode 100644 index a0a967f1504..00000000000 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta2Solver.h +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -#include - -namespace sofa::component::odesolver::forward -{ - -/** A popular time integration method, much more precise than the EulerSolver */ -class SOFA_COMPONENT_ODESOLVER_FORWARD_API RungeKutta2Solver : public sofa::core::behavior::OdeSolver -{ -public: - SOFA_CLASS(RungeKutta2Solver, sofa::core::behavior::OdeSolver); - - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override - { - const SReal dt = getContext()->getDt(); - const SReal matrix[3][3] = - { - { 1, dt/2, 0}, - { 0, 1, dt/2}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; - } - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// - SReal getSolutionIntegrationFactor(int outputDerivative) const override - { - const SReal dt = getContext()->getDt(); - const SReal vect[3] = { 0.0, dt/2, 1}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; - } -}; - -} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.h b/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.h deleted file mode 100644 index 76d964794e5..00000000000 --- a/Sofa/Component/ODESolver/Forward/src/sofa/component/odesolver/forward/RungeKutta4Solver.h +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -#include - -namespace sofa::component::odesolver::forward -{ - -/** A popular time integration method, much more precise than the EulerSolver */ -class SOFA_COMPONENT_ODESOLVER_FORWARD_API RungeKutta4Solver : public sofa::core::behavior::OdeSolver -{ -public: - SOFA_CLASS(RungeKutta4Solver, sofa::core::behavior::OdeSolver); - - void solve (const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - /// @todo use real factors depending on the current RK4 step - SReal getIntegrationFactor(int inputDerivative, int outputDerivative) const override - { - const SReal dt = getContext()->getDt(); - const SReal matrix[3][3] = - { - { 1, dt/2, 0}, - { 0, 1, dt/2}, - { 0, 0, 0} - }; - if (inputDerivative >= 3 || outputDerivative >= 3) - return 0; - else - return matrix[outputDerivative][inputDerivative]; - } - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// @todo use real factors depending on the current RK4 step - SReal getSolutionIntegrationFactor(int outputDerivative) const override - { - const SReal dt = getContext()->getDt(); - const SReal vect[3] = { 0.0, dt/2, 1}; - if (outputDerivative >= 3) - return 0; - else - return vect[outputDerivative]; - } - -}; - -} // namespace sofa::component::odesolver::forward diff --git a/Sofa/Component/ODESolver/Forward/tests/CMakeLists.txt b/Sofa/Component/ODESolver/Forward/tests/CMakeLists.txt deleted file mode 100644 index b12c81b7db2..00000000000 --- a/Sofa/Component/ODESolver/Forward/tests/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.22) - -project(Sofa.Component.ODESolver.Forward_test) - -set(SOURCE_FILES - CentralDifferenceExplicitSolverDynamic_test.cpp - EulerExplicitSolverDynamic_test.cpp - RungeKutta2ExplicitSolverDynamic_test.cpp - RungeKutta4ExplicitSolverDynamic_test.cpp -) - -add_executable(${PROJECT_NAME} ${SOURCE_FILES}) -# dependencies are managed directly in the target_link_libraries pass -target_link_libraries(${PROJECT_NAME} Sofa.Testing Sofa.Component.ODESolver.Testing Sofa.Component.ODESolver.Forward Sofa.Component.StateContainer) diff --git a/Sofa/Component/ODESolver/Forward/tests/CentralDifferenceExplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Forward/tests/CentralDifferenceExplicitSolverDynamic_test.cpp deleted file mode 100644 index d285140199c..00000000000 --- a/Sofa/Component/ODESolver/Forward/tests/CentralDifferenceExplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; - -#include - -//Including Simulation -#include -#include -#include - -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject; - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with central difference solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ -template -struct CentralDifferenceExplicitSolverDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position, velocity and acceleration array - vector positionsArray; - vector velocitiesArray; - vector accelerationsArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0,double rm) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "CentralDifferenceSolver", { - { "rayleighMass", simpleapi::str(rm)} - }); - } - - - /// Generate discrete mass position values with euler implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double rm) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - accelerationsArray.reserve(size); - } - - // First acceleration - accelerationsArray.push_back((-K*(z0-z0)-m*g)/m); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - double pos,acc,vel; - - if(rm == 0) - { - for(int i=1;i< size+1; i++) - { - acc = (-K*(positionsArray[i-1]-z0) - m*g)/m; - vel = velocitiesArray[i-1]+acc*h; - pos = positionsArray[i-1]+vel*h; - - // Fill array - positionsArray.push_back(pos); - accelerationsArray.push_back(acc); - velocitiesArray.push_back(vel); - - } - - } - - else - { - const double constantVel = ((1.0/h) - (rm/2.0))/((1.0/h) + (rm/2.0)); - const double constantAcc = 1.0/((1.0/h) + (rm/2.0)); - - for(int i=1;i< size+1; i++) - { - acc = (-K*(positionsArray[i-1]-z0) - m*g)/m; - vel = velocitiesArray[i-1] * constantVel + acc*constantAcc; - pos = positionsArray[i-1]+vel*h; - - // Fill array - positionsArray.push_back(pos); - accelerationsArray.push_back(acc); - velocitiesArray.push_back(vel); - - } - - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(CentralDifferenceExplicitSolverDynamic_test, DataTypes); - -// Test case: h=0.01 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( CentralDifferenceExplicitSolverDynamic_test , centralDifferenceExplicitSolverDynamicTest_medium_dt_without_damping) -{ - this->createScene(100,10,1,0); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 100, 10, 1, 0, 10, 2, 0); - this-> compareSimulatedToTheoreticalPositions(4e-16,0.01); -} - -// Test case: h=0.1 K=1000 m = 10 -TYPED_TEST( CentralDifferenceExplicitSolverDynamic_test , rungeKutta2ExplicitSolverDynamicTest_high_dt_with_damping) -{ - this->createScene(1000,10,1,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 1000, 10, 1, 0, 10, 2, 0.1); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.001 k=100 m=100 -TYPED_TEST( CentralDifferenceExplicitSolverDynamic_test , rungeKutta2ExplicitSolverDynamicTest_small_dt_with_damping) -{ - this->createScene(100,100,1,0.1); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 100, 100, 1, 0, 10, 2, 0.1); - this-> compareSimulatedToTheoreticalPositions(2e-16,0.001); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Forward/tests/EulerExplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Forward/tests/EulerExplicitSolverDynamic_test.cpp deleted file mode 100644 index f6a13eb435f..00000000000 --- a/Sofa/Component/ODESolver/Forward/tests/EulerExplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -typedef sofa::component::statecontainer::MechanicalObject MechanicalObject3; - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with euler explicit solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct EulerExplicitDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position and velocity array - vector positionsArray; - vector velocitiesArray; - - - /// Create the context for the scene - void createScene(double K, double m, double l0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "EulerExplicitSolver", { - { } - }); - } - - /// Generate discrete mass position values with euler explicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime, double cd) - { - int size = 0 ; - - // During t=5s - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - } - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // Compute recursively velocity and position - for(int i=1;i< size+1; i++) - { - velocitiesArray.push_back(velocitiesArray[i-1]+h*(-K*(positionsArray[i-1]-z0)-m*g-velocitiesArray[i-1]*cd)/m); - positionsArray.push_back(positionsArray[i-1]+h*velocitiesArray[i]); - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(EulerExplicitDynamic_test, DataTypes); - -// Test case: h=0.001 k=100 m=10 -TYPED_TEST( EulerExplicitDynamic_test , eulerExplicitSolverDynamicTest_small_dt) -{ - this->createScene(100,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 100, 10,1, 0,10, 2, 0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.001); -} - -// Test case: h=0.01 k=1000 m=10 -TYPED_TEST( EulerExplicitDynamic_test , eulerExplicitSolverDynamicTest_medium_dt) -{ - this->createScene(1000,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 1000, 10,1, 0,10, 2, 0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.01); -} - -// Test case: h=0.01 k=1000 m=100 -TYPED_TEST( EulerExplicitDynamic_test , eulerExplicitSolverDynamicTest_high_dt) -{ - this->createScene(1000,100,1); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 1000, 100,1, 0,10, 2, 0); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Forward/tests/RungeKutta2ExplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Forward/tests/RungeKutta2ExplicitSolverDynamic_test.cpp deleted file mode 100644 index 683e546b8fa..00000000000 --- a/Sofa/Component/ODESolver/Forward/tests/RungeKutta2ExplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; -#include -using sofa::testing::NumericTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject ; - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with rungeKutta2 solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct RungeKutta2ExplicitSolverDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - typedef _DataTypes DataTypes; - typedef typename DataTypes::Coord Coord; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position, velocity and acceleration array - vector positionsArray; - vector velocitiesArray; - vector accelerationsArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "RungeKutta2Solver", { - { } - }); - - } - - - /// Generate discrete mass position values with euler implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - accelerationsArray.reserve(size); - } - - // First acceleration - accelerationsArray.push_back((-K*(z0-z0)-m*g)/m); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - for(int i=1;i< size+1; i++) - { - // At time t + h/2 - const double newPos = positionsArray[i-1]+0.5*h*velocitiesArray[i-1]; - const double newVel = velocitiesArray[i-1]+0.5*h*accelerationsArray[i-1]; - const double acc = (-K*(newPos-z0)-m*g)/m; - - // At time t + h - positionsArray.push_back(positionsArray[i-1]+h*newVel); - velocitiesArray.push_back(velocitiesArray[i-1]+h*acc); - accelerationsArray.push_back((-K*(positionsArray[i]-z0)-m*g)/m); - - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(RungeKutta2ExplicitSolverDynamic_test, DataTypes); - -// Test case: h=0.1 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( RungeKutta2ExplicitSolverDynamic_test , rungeKutta2ExplicitSolverDynamicTest_medium_dt) -{ - this->createScene(100,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 100, 10, 1, 0,10, 2); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.01); -} - -// Test case: h=0.1 K=1000 m = 10 -TYPED_TEST( RungeKutta2ExplicitSolverDynamic_test , rungeKutta2ExplicitSolverDynamicTest_high_dt) -{ - this->createScene(1000,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 1000, 10, 1, 0, 10, 2); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.001 k=100 m=100 -TYPED_TEST( RungeKutta2ExplicitSolverDynamic_test , rungeKutta2ExplicitSolverDynamicTest_small_dt) -{ - this->createScene(100,100,1); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 100, 100, 1, 0, 10, 2); - this-> compareSimulatedToTheoreticalPositions(9e-16,0.001); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Forward/tests/RungeKutta4ExplicitSolverDynamic_test.cpp b/Sofa/Component/ODESolver/Forward/tests/RungeKutta4ExplicitSolverDynamic_test.cpp deleted file mode 100644 index eddbfaa0338..00000000000 --- a/Sofa/Component/ODESolver/Forward/tests/RungeKutta4ExplicitSolverDynamic_test.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include -using sofa::testing::BaseSimulationTest; - -#include - -//Including Simulation -#include -#include -#include - -// Including mechanical object -#include -using MechanicalObject3 = sofa::component::statecontainer::MechanicalObject ; - -#include - -namespace sofa { - -using namespace component; -using namespace defaulttype; -using namespace simulation; -using type::vector; - -/** Dynamic solver test. -Test the dynamic behavior of solver: study a mass-spring system under gravity initialize with spring rest length it will oscillate around its equilibrium position if there is no damping. -The movement follows the equation: -x(t)= A cos(wt + phi) with w the pulsation w=sqrt(K/M), K the stiffness, M the mass and phi the phase. -In this test: x(t=0)= 1 and v(t=0)=0 and K = spring stiffness and phi = 0 of material thus x(t)= cos(wt) -This tests generates the discrete mass position obtained with rungeKutta4 solver with different parameter values (K,M,h). -Then it compares the effective mass position to the computed mass position every time step. -*/ - -template -struct RungeKutta4ExplicitSolverDynamic_test : public component::odesolver::testing::ODESolverSpringTest -{ - - - typedef _DataTypes DataTypes; - typedef typename DataTypes::CPos CPos; - typedef typename DataTypes::Coord Coord; - typedef typename DataTypes::VecCoord VecCoord; - typedef typename DataTypes::VecDeriv VecDeriv; - typedef typename DataTypes::Deriv Deriv; - typedef typename DataTypes::Real Real; - - typedef statecontainer::MechanicalObject MechanicalObject; - - /// Position, velocity and acceleration array - vector positionsArray; - vector velocitiesArray; - vector accelerationsArray; - - /// Create the context for the scene - void createScene(double K, double m, double l0) - { - this->prepareScene(K, m, l0); - // add ODE Solver to test - simpleapi::createObject(m_si.root, "RungeKutta4Solver", { - { } - }); - } - - - /// Generate discrete mass position values with euler implicit solver - void generateDiscreteMassPositions (double h, double K, double m, double z0, double v0,double g, double finalTime) - { - int size = 0 ; - - // During t=finalTime - if((finalTime/h) > 0) - { - size = int(finalTime/h); - positionsArray.reserve(size); - velocitiesArray.reserve(size); - accelerationsArray.reserve(size); - } - - // First acceleration - accelerationsArray.push_back((-K*(z0-z0)-m*g)/m); - - // First position is z0 - positionsArray.push_back(double(z0)); - - // First velocity is v0 - velocitiesArray.push_back(v0); - - // Constants - const double stepBy2 = h/2.0; - const double stepBy3 = h/3.0; - const double stepBy6 = h/6.0; - double pos,vel,newX,k1v,k2v,k3v,k4v,k1a,k2a,k3a,k4a,pos2,vel2,acc2; - - for(int i=1;i< size+1; i++) - { - - // Step 1 - pos = positionsArray[i-1]; - vel = velocitiesArray[i-1]; - k1v = vel; - k1a = accelerationsArray[i-1]; - - // Step 2 - newX = pos + k1v*stepBy2; - k2v = vel + k1a*stepBy2; - k2a = (-K*(newX-z0)-m*g)/m; - - // Step 3 - newX = pos + k2v * stepBy2; - k3v = vel + k2a * stepBy2; - k3a = (-K*(newX-z0)-m*g)/m; - - // Step 4 - newX = pos + k3v * h; - k4v = vel + k3a * h; - k4a = (-K*(newX-z0)-m*g)/m; - - // Position pos2 at time t+h - pos2 = pos + k1v * stepBy6 + k2v * stepBy3 + k3v * stepBy3 + k4v * stepBy6; - - // Velocity vel2 at time t+h - vel2 = vel + k1a * stepBy6 + k2a * stepBy3 + k3a * stepBy3 + k4a * stepBy6; - - // Acceleration at time t+h - acc2 = (-K*(pos2-z0)-m*g)/m; - - // Fill array - positionsArray.push_back(pos2); - velocitiesArray.push_back(vel2); - accelerationsArray.push_back(acc2); - - } - - } - - /// After simulation compare the positions of points to the theoretical positions. - bool compareSimulatedToTheoreticalPositions(double tolerance,double h) - { - int i = 0; - // Init simulation - m_si.initScene(); - double time = m_si.root->getTime(); - - // Get mechanical object - const simulation::Node::SPtr massNode = m_si.root->getChild("MassNode"); - typename MechanicalObject::SPtr dofs = massNode->get(m_si.root->SearchDown); - - // Animate - do - { - // Record the mass position - Coord p0=dofs.get()->read(sofa::core::vec_id::read_access::position)->getValue()[0]; - - double absoluteError = fabs(p0[1]-positionsArray[i]); - - // Compare mass position to the theoretical position - if( absoluteError > tolerance ) - { - ADD_FAILURE() << "Position of mass at time " << time << " is wrong: " << std::endl - <<" expected Position is " << positionsArray[i] << std::endl - <<" actual Position is " << p0[1] << std::endl - << "absolute error = " << absoluteError << std::endl; - return false; - } - - //Animate - m_si.simulate(h); - time = m_si.root->getTime(); - // Iterate - i++; - } - while (time < 2); - return true; - } - -}; - -// Define the list of DataTypes to instantiate -using ::testing::Types; -typedef Types< - Vec3Types -> DataTypes; // the types to instantiate. - -// Test suite for all the instantiations -TYPED_TEST_SUITE(RungeKutta4ExplicitSolverDynamic_test, DataTypes); - -// Test case: h=0.1 k=100 m =10 rm=0.1 rk=0.1 -TYPED_TEST( RungeKutta4ExplicitSolverDynamic_test , rungeKutta4ExplicitSolverDynamicTest_medium_dt) -{ - this->createScene(100,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.01, 100, 10, 1, 0, 10, 2); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.01); -} - -// Test case: h=0.1 K=1000 m = 10 -TYPED_TEST( RungeKutta4ExplicitSolverDynamic_test , rungeKutta4ExplicitSolverDynamicTest_high_dt) -{ - this->createScene(1000,10,1); // k,m,l0 - this->generateDiscreteMassPositions (0.1, 1000, 10, 1, 0, 10, 2); - this-> compareSimulatedToTheoreticalPositions(5e-16,0.1); -} - -// Test case: h=0.001 k=100 m=100 -TYPED_TEST( RungeKutta4ExplicitSolverDynamic_test , rungeKutta4ExplicitSolverDynamicTest_small_dt) -{ - this->createScene(100,100,1); // k,m,l0 - this->generateDiscreteMassPositions (0.001, 100, 100, 1, 0, 10, 2); - this-> compareSimulatedToTheoreticalPositions(9e-16,0.001); -} - -} // namespace sofa diff --git a/Sofa/Component/ODESolver/Testing/CMakeLists.txt b/Sofa/Component/ODESolver/Testing/CMakeLists.txt deleted file mode 100644 index 9a3512fff46..00000000000 --- a/Sofa/Component/ODESolver/Testing/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.22) - -project(Sofa.Component.ODESolver.Testing) - -set(SOFACOMPONENTODESOLVERTESTING_SRC "src/sofa/component/odesolver/testing") - -set(HEADER_FILES - ${SOFACOMPONENTODESOLVERTESTING_SRC}/EigenTestUtilities.h - ${SOFACOMPONENTODESOLVERTESTING_SRC}/MassSpringSystemCreation.h - ${SOFACOMPONENTODESOLVERTESTING_SRC}/ODESolverSpringTest.h -) - -set(SOURCE_FILES - ${SOFACOMPONENTODESOLVERTESTING_SRC}/empty.cpp -) -add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -target_include_directories(${PROJECT_NAME} PUBLIC src/) -target_link_libraries(${PROJECT_NAME} Sofa.Config Sofa.Simulation.Core) diff --git a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/EigenTestUtilities.h b/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/EigenTestUtilities.h deleted file mode 100644 index 14740b4456b..00000000000 --- a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/EigenTestUtilities.h +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ - -#include -#include -#include -#include -#include -#include - -namespace sofa::component::odesolver::testing -{ - -class GetVectorVisitor : public sofa::simulation::Visitor -{ -public: - GetVectorVisitor(const sofa::core::ExecParams* params, linearalgebra::BaseVector* vec, core::ConstVecId src) - : sofa::simulation::Visitor(params), vec(vec), src(src) {} - - ~GetVectorVisitor() override = default; - - Result processNodeTopDown(simulation::Node* gnode) override - { - if (gnode->mechanicalState != nullptr && (gnode->mechanicalMapping == nullptr || independentOnly == false)) - { - gnode->mechanicalState->copyToBaseVector(vec, src, offset); - } - return Visitor::RESULT_CONTINUE; - } - const char* getClassName() const override { return "GetVectorVisitor"; } - - /// If true, process the independent nodes only - void setIndependentOnly(bool b) { independentOnly = b; } - -protected: - linearalgebra::BaseVector* vec; - core::ConstVecId src; - unsigned offset{0}; - bool independentOnly{false}; - -}; - -class GetAssembledSizeVisitor : public sofa::simulation::Visitor -{ -public: - GetAssembledSizeVisitor(const sofa::core::ExecParams* params = sofa::core::mechanicalparams::castToExecParams(core::mechanicalparams::defaultInstance())) - : sofa::simulation::Visitor(params) - {}; - ~GetAssembledSizeVisitor() override {} - - Result processNodeTopDown(simulation::Node* gnode) override - { - if (gnode->mechanicalState != nullptr && (gnode->mechanicalMapping == nullptr || independentOnly == false)) - { - xsize += gnode->mechanicalState->getSize() * gnode->mechanicalState->getCoordDimension(); - vsize += gnode->mechanicalState->getMatrixSize(); - } - return Visitor::RESULT_CONTINUE; - } - const char* getClassName() const override { return "GetAssembledSizeVisitor"; } - - unsigned positionSize() const { return xsize; } - unsigned velocitySize() const { return vsize; } - void setIndependentOnly(bool b) { independentOnly = b; } - -protected: - std::size_t xsize{ 0 }; - std::size_t vsize{ 0 }; - bool independentOnly{ false }; -}; - -inline Eigen::VectorXd getVector(simulation::Node::SPtr root, core::ConstVecId id, bool indep = true ) -{ - GetAssembledSizeVisitor getSizeVisitor; - getSizeVisitor.setIndependentOnly(indep); - root->execute(getSizeVisitor); - unsigned size; - if (id.type == sofa::core::V_COORD) - size = getSizeVisitor.positionSize(); - else - size = getSizeVisitor.velocitySize(); - linearalgebra::FullVector v(size); - GetVectorVisitor getVec( sofa::core::mechanicalparams::castToExecParams(core::mechanicalparams::defaultInstance()), &v, id); - getVec.setIndependentOnly(indep); - root->execute(getVec); - - Eigen::VectorXd ve(size); - for(size_t i=0; i. * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -#include -#include - -namespace sofa::component::odesolver::testing -{ - -/// Create a mass spring system -inline simulation::Node::SPtr createMassSpringSystem( - simulation::Node::SPtr root, - const std::string& stiffness, - const std::string& mass, - const std::string& restLength, - const std::string& xFixedPoint, - const std::string& vFixedPoint, - const std::string& xMass, - const std::string& vMass) -{ - // Fixed point - const auto fixedPointNode = simpleapi::createChild(root, "FixedPointNode" ); - - simpleapi::createObject(fixedPointNode, "MechanicalObject", { - { "name","fixedPoint"}, - { "template","Vec3"}, - { "position", xFixedPoint}, - { "velocity", vFixedPoint}, - }); - - simpleapi::createObject(fixedPointNode, "FixedProjectiveConstraint", { - { "name","fixed"}, - { "indices", "0"}, - }); - - // Mass - const auto massNode = simpleapi::createChild(root, "MassNode"); - - simpleapi::createObject(massNode, "MechanicalObject", { - { "name","massDof"}, - { "template","Vec3"}, - { "position", xMass}, - { "velocity", vMass} - }); - - simpleapi::createObject(massNode, "UniformMass", { - { "name","mass"}, - { "totalMass", mass} - }); - - std::ostringstream oss; - oss << 0 << " " << 0 << " " << stiffness << " " << 0 << " " << restLength; - - // attach a spring - simpleapi::createObject(root, "SpringForceField", { - { "name","ff"}, - { "spring", oss.str()}, - { "object1", "@FixedPointNode/fixedPoint"}, - { "object2", "@MassNode/massDof"}, - }); - - return root; -} - -template -inline simulation::Node::SPtr createMassSpringSystem( - simulation::Node::SPtr root, - double stiffness, - double mass, - double restLength, - typename DataTypes::VecCoord xFixedPoint, - typename DataTypes::VecDeriv vFixedPoint, - typename DataTypes::VecCoord xMass, - typename DataTypes::VecDeriv vMass) -{ - return createMassSpringSystem(root, - simpleapi::str(stiffness), simpleapi::str(mass), simpleapi::str(restLength), - simpleapi::str(xFixedPoint), simpleapi::str(vFixedPoint), - simpleapi::str(xMass), simpleapi::str(vMass) - ); -} - -} // namespace sofa::component::odesolver::testing diff --git a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/ODESolverSpringTest.h b/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/ODESolverSpringTest.h deleted file mode 100644 index f4302550f84..00000000000 --- a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/ODESolverSpringTest.h +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include -#include -using sofa::testing::BaseSimulationTest; - -#include - -#include -#include - -#include - -namespace sofa::component::odesolver::testing -{ - -struct ODESolverSpringTest : public BaseSimulationTest -{ - SceneInstance m_si{}; - - void doSetUp() override - { - this->loadPlugins({ - Sofa.Component.ODESolver, - Sofa.Component.LinearSolver.Iterative, - Sofa.Component.StateContainer, - Sofa.Component.Mass, - Sofa.Component.Constraint.Projective, - Sofa.Component.SolidMechanics.Spring - }); - } - - inline void prepareScene(double K, double m, double l0) - { - // Create the scene - m_si.root->setGravity({ 0, -10, 0 }); - - // remove warnings - simpleapi::createObject(m_si.root, "DefaultAnimationLoop", {}); - simpleapi::createObject(m_si.root, "DefaultVisualManagerLoop", {}); - - simpleapi::createObject(m_si.root, "CGLinearSolver", { - { "iterations", simpleapi::str(3000)}, - { "tolerance", simpleapi::str(1e-12)}, - { "threshold", simpleapi::str(1e-12)}, - }); - - // Add mass spring system - createMassSpringSystem( - m_si.root, // add mass spring system to the node containing solver - simpleapi::str(K), // stiffness - simpleapi::str(m), // mass - simpleapi::str(l0), // spring rest length - std::string("0.0 2.0 0.0"), // Initial position of fixed point - std::string("0.0 0.0 0.0"), // Initial velocity of fixed point - std::string("0.0 1.0 0.0"), // Initial position of mass - std::string("0.0 0.0 0.0")); // Initial velocity of mass - } -}; - -} // namespace sofa::component::odesolver::testing diff --git a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/empty.cpp b/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/empty.cpp deleted file mode 100644 index 109c1bda6e8..00000000000 --- a/Sofa/Component/ODESolver/Testing/src/sofa/component/odesolver/testing/empty.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program 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 program 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 program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -SOFA_EXPORT_DYNAMIC_LIBRARY void init(){} diff --git a/Sofa/Component/Playback/src/sofa/component/playback/CompareState.cpp b/Sofa/Component/Playback/src/sofa/component/playback/CompareState.cpp index 989ea02d5bb..e282e4b7226 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/CompareState.cpp +++ b/Sofa/Component/Playback/src/sofa/component/playback/CompareState.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -294,7 +294,7 @@ simulation::Visitor::Result CompareStateCreator::processNodeTopDown( simulation: using namespace sofa::defaulttype; sofa::core::behavior::BaseMechanicalState * mstate = gnode->mechanicalState; if (!mstate) return simulation::Visitor::RESULT_CONTINUE; - core::behavior::OdeSolver *isSimulated; + core::behavior::BaseIntegrationScheme *isSimulated; mstate->getContext()->get(isSimulated); if (!isSimulated) return simulation::Visitor::RESULT_CONTINUE; diff --git a/Sofa/Component/Playback/src/sofa/component/playback/ReadState.cpp b/Sofa/Component/Playback/src/sofa/component/playback/ReadState.cpp index 506d62175f1..8e41dd1a3e8 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/ReadState.cpp +++ b/Sofa/Component/Playback/src/sofa/component/playback/ReadState.cpp @@ -21,7 +21,7 @@ ******************************************************************************/ #include #include -#include +#include #include namespace sofa::component::playback @@ -68,7 +68,7 @@ simulation::Visitor::Result ReadStateCreator::processNodeTopDown( simulation::No { sofa::core::behavior::BaseMechanicalState * mstate=gnode->mechanicalState; if (!mstate) return Visitor::RESULT_CONTINUE; - core::behavior::OdeSolver *isSimulated; + core::behavior::BaseIntegrationScheme *isSimulated; mstate->getContext()->get(isSimulated); if (!isSimulated) return simulation::Visitor::RESULT_CONTINUE; diff --git a/Sofa/Component/Playback/src/sofa/component/playback/WriteState.cpp b/Sofa/Component/Playback/src/sofa/component/playback/WriteState.cpp index f4b1951f44f..c6c1f1a5ecb 100644 --- a/Sofa/Component/Playback/src/sofa/component/playback/WriteState.cpp +++ b/Sofa/Component/Playback/src/sofa/component/playback/WriteState.cpp @@ -21,7 +21,7 @@ ******************************************************************************/ #include #include -#include +#include #include namespace sofa::component::playback @@ -73,7 +73,7 @@ simulation::Visitor::Result WriteStateCreator::processNodeTopDown( simulation::N { sofa::core::behavior::BaseMechanicalState * mstate=gnode->mechanicalState; if (!mstate) return simulation::Visitor::RESULT_CONTINUE; - core::behavior::OdeSolver *isSimulated; + core::behavior::BaseIntegrationScheme *isSimulated; mstate->getContext()->get(isSimulated); if (!isSimulated) return simulation::Visitor::RESULT_CONTINUE; diff --git a/Sofa/Component/Playback/tests/CMakeLists.txt b/Sofa/Component/Playback/tests/CMakeLists.txt index 39944822685..d3e04bcfa9b 100644 --- a/Sofa/Component/Playback/tests/CMakeLists.txt +++ b/Sofa/Component/Playback/tests/CMakeLists.txt @@ -12,6 +12,6 @@ add_definitions("-DSOFA_COMPONENT_PLAYBACK_TEST_FILES_DIR=\"${CMAKE_CURRENT_SOUR add_definitions("-DSOFA_COMPONENT_PLAYBACK_TEST_BUILD_DIR=\"${CMAKE_BINARY_DIR}/\"") target_link_libraries(${PROJECT_NAME} Sofa.Testing) -target_link_libraries(${PROJECT_NAME} Sofa.Component.Playback Sofa.Component.StateContainer Sofa.Component.ODESolver.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass) +target_link_libraries(${PROJECT_NAME} Sofa.Component.Playback Sofa.Component.StateContainer Sofa.Component.IntegrationScheme.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mass) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/Sofa/Component/Playback/tests/WriteState_test.cpp b/Sofa/Component/Playback/tests/WriteState_test.cpp index d0b92f7f4e8..0ded56825b3 100644 --- a/Sofa/Component/Playback/tests/WriteState_test.cpp +++ b/Sofa/Component/Playback/tests/WriteState_test.cpp @@ -29,8 +29,7 @@ using sofa::testing::BaseSimulationTest; #include -#include -#include +#include #include #include #include @@ -78,22 +77,17 @@ namespace sofa { } // Create the scene and the components - void createScene(bool symplectic) + void createScene() { timeStep = 0.01; root->setGravity(Coord(0.0,0.0,gravity)); root->setDt(timeStep); - if(symplectic) - { - const sofa::component::odesolver::backward::VariationalSymplecticSolver::SPtr variationalSolver = New(); - root->addObject(variationalSolver); - } - else - { - const sofa::component::odesolver::backward::EulerImplicitSolver::SPtr eulerSolver = New(); - root->addObject(eulerSolver); - } + + + const sofa::component::integrationscheme::backward::EulerImplicitIntegrationScheme::SPtr eulerSolver = New(); + root->addObject(eulerSolver); + const CGLinearSolver::SPtr cgLinearSolver = New (); cgLinearSolver->d_maxIter.setValue(25u); cgLinearSolver->d_tolerance.setValue(1e-5); @@ -117,18 +111,11 @@ namespace sofa { std::cout<<"SOFA_COMPONENT_PLAYBACK_TEST_BUILD_DIR = "<d_filename.setValue(std::string(SOFA_COMPONENT_PLAYBACK_TEST_BUILD_DIR)+"particleGravityX.data"); - writeState->d_writeX.setValue(true); - writeState->d_writeV.setValue(false); - } - else - { - writeState->d_filename.setValue(std::string(SOFA_COMPONENT_PLAYBACK_TEST_BUILD_DIR)+"particleGravityV.data"); - writeState->d_writeX.setValue(false); - writeState->d_writeV.setValue(true); - } + + writeState->d_filename.setValue(std::string(SOFA_COMPONENT_PLAYBACK_TEST_BUILD_DIR)+"particleGravityV.data"); + writeState->d_writeX.setValue(false); + writeState->d_writeV.setValue(true); + writeState->d_writeF.setValue(false); writeState->d_time.setValue(time); childNode->addObject(writeState); @@ -237,7 +224,7 @@ namespace sofa { // Test 1 : write position of a particle falling under gravity (required to use SymplecticSolver TYPED_TEST( WriteState_test , test_write_position) { - this->createScene(true); + this->createScene(); this->initScene(); this->runScene(); @@ -248,7 +235,7 @@ namespace sofa { // Test 2 : write velocity of a particle falling under gravity TYPED_TEST( WriteState_test , test_write_velocity) { - this->createScene(false); + this->createScene(); this->initScene(); this->runScene(); diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BaseTetrahedronFEMForceField_test.h b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BaseTetrahedronFEMForceField_test.h index f19c9d27127..2635406dd03 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BaseTetrahedronFEMForceField_test.h +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BaseTetrahedronFEMForceField_test.h @@ -130,7 +130,7 @@ class BaseTetrahedronFEMForceField_test : public sofa::testing::BaseTest Sofa.Component.SolidMechanics.FEM.Elastic, Sofa.Component.Mass, Sofa.Component.LinearSolver.Iterative, - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.Constraint.Lagrangian, Sofa.Component.Topology.Mapping, Sofa.Component.Engine.Select, @@ -144,7 +144,7 @@ class BaseTetrahedronFEMForceField_test : public sofa::testing::BaseTest simulation::Node::SPtr FEMNode = sofa::simpleapi::createChild(m_root, "Beam"); - simpleapi::createObject(FEMNode, "EulerImplicitSolver"); + simpleapi::createObject(FEMNode, "EulerImplicitIntegrationScheme"); //createObject(FEMNode, "SparseLDLSolver", { {"name","solver"}, { "template", "CompressedRowSparseMatrixd" } }); simpleapi::createObject(FEMNode, "CGLinearSolver", { { "iterations", "20" }, { "tolerance", "1e-5" }, {"threshold", "1e-6"} }); diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BeamFEMForceField_test.cpp b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BeamFEMForceField_test.cpp index 6b3fbb27ab3..068a03a06b1 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BeamFEMForceField_test.cpp +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/BeamFEMForceField_test.cpp @@ -87,7 +87,7 @@ class BeamFEMForceField_test : public BaseTest createObject(m_root, "DefaultVisualManagerLoop"); this->loadPlugins({ - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.LinearSolver.Iterative, Sofa.Component.StateContainer, Sofa.Component.Topology.Container.Dynamic, @@ -96,7 +96,7 @@ class BeamFEMForceField_test : public BaseTest Sofa.Component.Constraint.Projective }); - createObject(m_root, "EulerImplicitSolver"); + createObject(m_root, "EulerImplicitIntegrationScheme"); createObject(m_root, "CGLinearSolver", { { "iterations", "20" }, { "threshold", "1e-8" }, {"tolerance", "1e-5"} }); createObject(m_root, "MechanicalObject", {{"template", rigidTypeName}, {"position", "0 0 1 0 0 0 1 1 0 1 0 0 0 1 2 0 1 0 0 0 1 3 0 1 0 0 0 1"} }); createObject(m_root, "EdgeSetTopologyContainer", { {"edges","0 1 1 2 2 3"} }); @@ -147,14 +147,14 @@ class BeamFEMForceField_test : public BaseTest m_root = sofa::simpleapi::createRootNode(m_simulation, "root"); this->loadPlugins({ - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.LinearSolver.Iterative, Sofa.Component.StateContainer, Sofa.Component.SolidMechanics.FEM.Elastic }); createObject(m_root, "DefaultAnimationLoop"); - createObject(m_root, "EulerImplicitSolver"); + createObject(m_root, "EulerImplicitIntegrationScheme"); createObject(m_root, "CGLinearSolver", { { "iterations", "20" }, { "threshold", "1e-8" }, {"tolerance", "1e-5"} }); createObject(m_root, "MechanicalObject", { {"template", rigidTypeName}, {"position", "0 0 1 0 0 0 1 1 0 1 0 0 0 1 2 0 1 0 0 0 1 3 0 1 0 0 0 1"} }); createObject(m_root, "BeamFEMForceField", { {"Name","Beam"}, {"template", rigidTypeName} }); diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/TriangleFEMForceField_test.cpp b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/TriangleFEMForceField_test.cpp index b50b8bfc479..c64a23fef68 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/tests/TriangleFEMForceField_test.cpp +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/tests/TriangleFEMForceField_test.cpp @@ -178,7 +178,7 @@ class TriangleFEMForceField_test : public BaseTest const Node::SPtr FEMNode = sofa::simpleapi::createChild(m_root, nodeName); this->loadPlugins({ - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.LinearSolver.Iterative, Sofa.Component.StateContainer, Sofa.Component.Topology.Container.Dynamic, @@ -186,7 +186,7 @@ class TriangleFEMForceField_test : public BaseTest Sofa.Component.Constraint.Projective }); - createObject(FEMNode, "EulerImplicitSolver"); + createObject(FEMNode, "EulerImplicitIntegrationScheme"); createObject(FEMNode, "CGLinearSolver", {{ "iterations", "20" }, { "tolerance", "1e-5" }, {"threshold", "1e-6"}}); createObject(FEMNode, "MechanicalObject", { diff --git a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/CMakeLists.txt b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/CMakeLists.txt index 2e9678f7af5..4a79dfeafe6 100644 --- a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/CMakeLists.txt +++ b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/CMakeLists.txt @@ -15,6 +15,6 @@ target_link_libraries(${PROJECT_NAME} Sofa.Component.SolidMechanics.FEM.HyperElastic Sofa.Component.SolidMechanics.Testing Sofa.Component.StateContainer - Sofa.Component.ODESolver.Backward) + Sofa.Component.IntegrationScheme.Backward) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_base.scn b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_base.scn index 44192bf6a1e..1820d026236 100644 --- a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_base.scn +++ b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_base.scn @@ -7,7 +7,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_test.scn b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_test.scn index 2180a5a7d3f..c7a8a34c8a7 100644 --- a/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_test.scn +++ b/Sofa/Component/SolidMechanics/FEM/HyperElastic/tests/scenes/TetrahedronHyperelasticityFEMForceField_test.scn @@ -6,13 +6,13 @@ - + - + diff --git a/Sofa/Component/SolidMechanics/Spring/tests/CMakeLists.txt b/Sofa/Component/SolidMechanics/Spring/tests/CMakeLists.txt index 80a5f3143f8..3ae09d6142f 100644 --- a/Sofa/Component/SolidMechanics/Spring/tests/CMakeLists.txt +++ b/Sofa/Component/SolidMechanics/Spring/tests/CMakeLists.txt @@ -11,6 +11,6 @@ set(SOURCE_FILES add_executable(${PROJECT_NAME} ${SOURCE_FILES}) target_link_libraries(${PROJECT_NAME} Sofa.Testing Sofa.Component.SolidMechanics.Testing) -target_link_libraries(${PROJECT_NAME} Sofa.Component.SolidMechanics.Spring Sofa.Component.StateContainer Sofa.Component.ODESolver.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Topology.Container.Dynamic) +target_link_libraries(${PROJECT_NAME} Sofa.Component.SolidMechanics.Spring Sofa.Component.StateContainer Sofa.Component.IntegrationScheme.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Topology.Container.Dynamic) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) diff --git a/Sofa/Component/SolidMechanics/Spring/tests/PolynomialRestShapeSpringsForceField_test.cpp b/Sofa/Component/SolidMechanics/Spring/tests/PolynomialRestShapeSpringsForceField_test.cpp index 9acf6e84b65..86454db3b82 100644 --- a/Sofa/Component/SolidMechanics/Spring/tests/PolynomialRestShapeSpringsForceField_test.cpp +++ b/Sofa/Component/SolidMechanics/Spring/tests/PolynomialRestShapeSpringsForceField_test.cpp @@ -43,15 +43,15 @@ class PolynomialRestShapeSpringsForceField_test : public BaseSimulationTest root->setDt(dt); this->loadPlugins({ - Sofa.Component.ODESolver.Forward, + Sofa.Component.IntegrationScheme.Forward, Sofa.Component.StateContainer, Sofa.Component.SolidMechanics.Spring }); const Node::SPtr childNode = sofa::simpleapi::createChild(root, "Particle"); - sofa::simpleapi::createObject(childNode, "EulerExplicitSolver"); + sofa::simpleapi::createObject(childNode, "EulerExplicitIntegrationScheme"); const auto meca = sofa::simpleapi::createObject(childNode, "MechanicalObject", {{"rest_position", "0 0 0"},{"position", "1.1 0 0"}}); - sofa::simpleapi::createObject(childNode, "EulerExplicitSolver", {{"totalMass", "1.0"}}); + sofa::simpleapi::createObject(childNode, "EulerExplicitIntegrationScheme", {{"totalMass", "1.0"}}); // Add the spring to test sofa::simpleapi::createObject(childNode, "PolynomialRestShapeSpringsForceField", {{"polynomialStiffness", "10 10"},{"polynomialDegree", "2"},{"points", "0"},{"smoothShift", "1e-4"},{"smoothScale", "1e7"}}); diff --git a/Sofa/Component/SolidMechanics/Spring/tests/RestShapeSpringsForceField_test.cpp b/Sofa/Component/SolidMechanics/Spring/tests/RestShapeSpringsForceField_test.cpp index dc3665e38ad..fb6f78b93e5 100644 --- a/Sofa/Component/SolidMechanics/Spring/tests/RestShapeSpringsForceField_test.cpp +++ b/Sofa/Component/SolidMechanics/Spring/tests/RestShapeSpringsForceField_test.cpp @@ -60,7 +60,7 @@ sofa::simulation::Node::SPtr RestSpringsForceField_test::createScene(const std:: auto theRoot = createRootNode(theSimulation, "root"); this->loadPlugins({ - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.LinearSolver.Iterative, Sofa.Component.StateContainer, Sofa.Component.Mass, @@ -68,7 +68,7 @@ sofa::simulation::Node::SPtr RestSpringsForceField_test::createScene(const std:: }); createObject(theRoot, "DefaultAnimationLoop"); - createObject(theRoot, "EulerImplicitSolver"); + createObject(theRoot, "EulerImplicitIntegrationScheme"); createObject(theRoot, "CGLinearSolver", {{ "iterations", "25" }, { "tolerance", "1e-5" }, {"threshold", "1e-5"}}); /// Create an object with a mass and use a rest shape spring ff so it stays diff --git a/Sofa/Component/SolidMechanics/Spring/tests/SpringForceField_test.cpp b/Sofa/Component/SolidMechanics/Spring/tests/SpringForceField_test.cpp index 797bafce838..dd404dfb121 100644 --- a/Sofa/Component/SolidMechanics/Spring/tests/SpringForceField_test.cpp +++ b/Sofa/Component/SolidMechanics/Spring/tests/SpringForceField_test.cpp @@ -21,7 +21,7 @@ ******************************************************************************/ #include #include -#include +#include #include #include @@ -29,7 +29,7 @@ namespace sofa { using namespace modeling; -typedef component::odesolver::backward::EulerImplicitSolver EulerImplicitSolver; +typedef component::integrationscheme::backward::EulerImplicitIntegrationScheme EulerImplicitIntegrationScheme; typedef component::linearsolver::iterative::CGLinearSolver CGLinearSolver; /** Used to rotate points and vectors in space for tests diff --git a/Sofa/Component/SolidMechanics/Spring/tests/TriangularBendingSprings_test.cpp b/Sofa/Component/SolidMechanics/Spring/tests/TriangularBendingSprings_test.cpp index fef5f82a243..1b43f1fecb3 100644 --- a/Sofa/Component/SolidMechanics/Spring/tests/TriangularBendingSprings_test.cpp +++ b/Sofa/Component/SolidMechanics/Spring/tests/TriangularBendingSprings_test.cpp @@ -116,7 +116,7 @@ class TriangularBendingSprings_test : public BaseTest Sofa.Component.StateContainer, Sofa.Component.Topology.Container.Grid, Sofa.Component.SolidMechanics.Spring, - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.LinearSolver.Iterative, Sofa.Component.Mass }); @@ -127,7 +127,7 @@ class TriangularBendingSprings_test : public BaseTest {"n", str(type::Vec3(nbrGrid, nbrGrid, 1))}, {"min", "0 0 0"}, {"max", "10 10 0"} }); const Node::SPtr FNode = sofa::simpleapi::createChild(m_root, "SpringNode"); - createObject(FNode, "EulerImplicitSolver"); + createObject(FNode, "EulerImplicitIntegrationScheme"); createObject(FNode, "CGLinearSolver", {{ "iterations", "20" }, { "tolerance", "1e-5" }, {"threshold", "1e-8"}}); createObject(FNode, "MechanicalObject", { {"name","dof"}, {"template","Vec3d"}, {"position", "@../grid.position"} }); diff --git a/Sofa/Component/SolidMechanics/simutests/LinearElasticity_test.cpp b/Sofa/Component/SolidMechanics/simutests/LinearElasticity_test.cpp index 7ea797b36b2..f6dd2515508 100644 --- a/Sofa/Component/SolidMechanics/simutests/LinearElasticity_test.cpp +++ b/Sofa/Component/SolidMechanics/simutests/LinearElasticity_test.cpp @@ -38,8 +38,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -111,13 +110,10 @@ CylinderTractionStruct createCylinderTractionScene( cgLinearSolver->d_tolerance.setValue(1e-9); cgLinearSolver->d_smallDenominatorThreshold.setValue(1e-9); // StaticSolver - auto staticSolver = modeling::addNew(root,"StaticSolver"); + auto staticSolver = modeling::addNew(root,"StaticSolver"); staticSolver->f_printLog.setValue(true); - auto newtonSolver = modeling::addNew(root,"NewtonRaphsonSolver"); - newtonSolver->d_maxNbIterationsNewton.setValue(1); - newtonSolver->d_maxNbIterationsLineSearch.setValue(1); - newtonSolver->d_warnWhenDiverge.setValue(false); - newtonSolver->d_warnWhenLineSearchFails.setValue(false); + staticSolver->d_maxNbIterationsNewton.setValue(1); + staticSolver->d_maxNbIterationsLineSearch.setValue(1); // mechanicalObject object typename MechanicalObject::SPtr meca1= sofa::modeling::addNew(root); sofa::modeling::setDataLink(&eng->f_outputTetrahedraPositions,&meca1->x); @@ -226,7 +222,7 @@ struct LinearElasticity_test : public sofa::testing::BaseSimulationTest, sofa::t typename sofa::component::solidmechanics::fem::elastic::TetrahedralCorotationalFEMForceField::SPtr ff=addNew >(root); ff->setYoungModulus(youngModulus); ff->setPoissonRatio(poissonRatio); - ff->setMethod(0); // small method + ff->d_method.setValue("small"); // small method return (ForceFieldSPtr )ff; } @@ -307,7 +303,7 @@ TYPED_TEST( LinearElasticity_test , testTractionTensorMass ) TYPED_TEST( LinearElasticity_test , testTractionCorotational ) { -// this->loadScene( "tests/SofaTest/LinearElasticity.scn"); + // this->loadScene( "tests/SofaTest/LinearElasticity.scn"); ASSERT_TRUE( this->testLinearElasticityInTraction(&sofa::LinearElasticity_test::addTetrahedralCorotationalFEMLinearElastic)); } diff --git a/Sofa/Component/Topology/Testing/src/sofa/component/topology/testing/RegularGridNodeCreation.h b/Sofa/Component/Topology/Testing/src/sofa/component/topology/testing/RegularGridNodeCreation.h index deb9b6aa8df..26d6fc55df5 100644 --- a/Sofa/Component/Topology/Testing/src/sofa/component/topology/testing/RegularGridNodeCreation.h +++ b/Sofa/Component/Topology/Testing/src/sofa/component/topology/testing/RegularGridNodeCreation.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -80,7 +80,7 @@ PatchTestStruct createRegularGridScene( simulation::Node::SPtr SquareNode = root->createChild("Square"); // Euler implicit solver and cglinear solver - const component::odesolver::backward::EulerImplicitSolver::SPtr solver = modeling::addNew(SquareNode,"EulerImplicitSolver"); + const component::integrationscheme::backward::EulerImplicitIntegrationScheme::SPtr solver = modeling::addNew(SquareNode,"EulerImplicitIntegrationScheme"); solver->d_rayleighStiffness.setValue(0.5); solver->d_rayleighMass.setValue(0.5); const CGLinearSolver::SPtr cgLinearSolver = modeling::addNew< CGLinearSolver >(SquareNode,"linearSolver"); diff --git a/Sofa/Component/src/sofa/component/init.cpp b/Sofa/Component/src/sofa/component/init.cpp index 6e1494deb84..4fc2f2b0ad8 100644 --- a/Sofa/Component/src/sofa/component/init.cpp +++ b/Sofa/Component/src/sofa/component/init.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -87,7 +87,7 @@ void registerObjects(sofa::core::ObjectFactory* factory) factory->registerObjectsFromPlugin(Sofa.Component.Mapping); factory->registerObjectsFromPlugin(Sofa.Component.Mass); factory->registerObjectsFromPlugin(Sofa.Component.MechanicalLoad); - factory->registerObjectsFromPlugin(Sofa.Component.ODESolver); + factory->registerObjectsFromPlugin(Sofa.Component.IntegrationScheme); factory->registerObjectsFromPlugin(Sofa.Component.Playback); factory->registerObjectsFromPlugin(Sofa.Component.SceneUtility); factory->registerObjectsFromPlugin(Sofa.Component.Setting); @@ -115,7 +115,7 @@ void init() sofa::component::mapping::init(); sofa::component::mass::init(); sofa::component::mechanicalload::init(); - sofa::component::odesolver::init(); + sofa::component::integrationscheme::init(); sofa::component::playback::init(); sofa::component::sceneutility::init(); sofa::component::setting::init(); diff --git a/Sofa/framework/Config/cmake/Modules/FindSOFA.cmake b/Sofa/framework/Config/cmake/Modules/FindSOFA.cmake index 4b8b3f76e52..f338e494d2d 100644 --- a/Sofa/framework/Config/cmake/Modules/FindSOFA.cmake +++ b/Sofa/framework/Config/cmake/Modules/FindSOFA.cmake @@ -248,8 +248,8 @@ math(EXPR passToCommon "${sofaLibBaseList}/2+${passToBase}") ## Put the name of the library SOFA COMMON to search and put it associate CMakeName list(APPEND SOFA_LIB_COMMON_NAME SofaDeformable SOFA_LIB_DEFORMABLE - SofaExplicitOdeSolver SOFA_LIB_ODE_SOLVER - SofaImplicitOdeSolver SOFA_LIB_IMPLICIT_ODE_SOLVER + SofaExplicitIntegrationScheme SOFA_LIB_ODE_SOLVER + SofaImplicitIntegrationScheme SOFA_LIB_IMPLICIT_ODE_SOLVER SofaLoader SOFA_LIB_LOADER SofaMeshCollision SOFA_LIB_MESH_COLLISION SofaRigid SOFA_LIB_RIGID diff --git a/Sofa/framework/Config/cmake/SofaMacrosInstall.cmake b/Sofa/framework/Config/cmake/SofaMacrosInstall.cmake index 20573bb58b5..ece40b1c4bd 100644 --- a/Sofa/framework/Config/cmake/SofaMacrosInstall.cmake +++ b/Sofa/framework/Config/cmake/SofaMacrosInstall.cmake @@ -244,11 +244,7 @@ macro(sofa_create_package) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${filename}" DESTINATION "lib/cmake/${package_install_dir}" COMPONENT headers) # Config.cmake - configure_package_config_file( - ${ARG_PACKAGE_NAME}Config.cmake.in - "${CMAKE_BINARY_DIR}/lib/cmake/${ARG_PACKAGE_NAME}Config.cmake" - INSTALL_DESTINATION "lib/cmake/${package_install_dir}" - ) + configure_package_config_file(${ARG_PACKAGE_NAME}Config.cmake.in "${CMAKE_BINARY_DIR}/lib/cmake/${ARG_PACKAGE_NAME}Config.cmake" INSTALL_DESTINATION "lib/cmake/${package_install_dir}") install(FILES "${CMAKE_BINARY_DIR}/lib/cmake/${ARG_PACKAGE_NAME}Config.cmake" DESTINATION "lib/cmake/${package_install_dir}" COMPONENT headers) if(ARG_RELOCATABLE_PATH) diff --git a/Sofa/framework/Config/src/sofa/Modules.h b/Sofa/framework/Config/src/sofa/Modules.h index a02c7962c1e..cb6243e509d 100644 --- a/Sofa/framework/Config/src/sofa/Modules.h +++ b/Sofa/framework/Config/src/sofa/Modules.h @@ -115,10 +115,10 @@ inline struct ModuleSofa MODULE(Mass, "Sofa.Component.Mass") MODULE(MechanicalLoad, "Sofa.Component.MechanicalLoad") - START_MODULE(ODESolver, "Sofa.Component.ODESolver") - MODULE(Backward, "Sofa.Component.ODESolver.Backward") - MODULE(Forward, "Sofa.Component.ODESolver.Forward") - END_MODULE(ODESolver) + START_MODULE(IntegrationScheme, "Sofa.Component.IntegrationScheme") + MODULE(Backward, "Sofa.Component.IntegrationScheme.Backward") + MODULE(Forward, "Sofa.Component.IntegrationScheme.Forward") + END_MODULE(IntegrationScheme) MODULE(Playback, "Sofa.Component.Playback") MODULE(SceneUtility, "Sofa.Component.SceneUtility") diff --git a/Sofa/framework/Core/CMakeLists.txt b/Sofa/framework/Core/CMakeLists.txt index 5d049ec19bf..c707b373bef 100644 --- a/Sofa/framework/Core/CMakeLists.txt +++ b/Sofa/framework/Core/CMakeLists.txt @@ -71,6 +71,7 @@ set(HEADER_FILES ${SRC_ROOT}/behavior/BaseConstraintSet.h ${SRC_ROOT}/behavior/BaseController.h ${SRC_ROOT}/behavior/BaseForceField.h + ${SRC_ROOT}/behavior/BaseIntegrationScheme.h ${SRC_ROOT}/behavior/BaseInteractionConstraint.h ${SRC_ROOT}/behavior/BaseInteractionForceField.h ${SRC_ROOT}/behavior/BaseInteractionProjectiveConstraintSet.h @@ -113,7 +114,6 @@ set(HEADER_FILES ${SRC_ROOT}/behavior/MultiMatrix.h ${SRC_ROOT}/behavior/MultiMatrixAccessor.h ${SRC_ROOT}/behavior/MultiVec.h - ${SRC_ROOT}/behavior/OdeSolver.h ${SRC_ROOT}/behavior/PairInteractionConstraint.h ${SRC_ROOT}/behavior/PairInteractionConstraint.inl ${SRC_ROOT}/behavior/PairInteractionForceField.h @@ -258,6 +258,7 @@ set(SOURCE_FILES ${SRC_ROOT}/behavior/BaseConstraintCorrection.cpp ${SRC_ROOT}/behavior/BaseConstraintSet.cpp ${SRC_ROOT}/behavior/BaseForceField.cpp + ${SRC_ROOT}/behavior/BaseIntegrationScheme.cpp ${SRC_ROOT}/behavior/BaseInteractionForceField.cpp ${SRC_ROOT}/behavior/BaseLagrangianConstraint.cpp ${SRC_ROOT}/behavior/BaseLinearSolver.cpp @@ -280,7 +281,6 @@ set(SOURCE_FILES ${SRC_ROOT}/behavior/MixedInteractionConstraint.cpp ${SRC_ROOT}/behavior/MixedInteractionForceField.cpp ${SRC_ROOT}/behavior/MultiMatrixAccessor.cpp - ${SRC_ROOT}/behavior/OdeSolver.cpp ${SRC_ROOT}/behavior/PairInteractionConstraint.cpp ${SRC_ROOT}/behavior/PairInteractionForceField.cpp ${SRC_ROOT}/behavior/PairInteractionProjectiveConstraintSet.cpp diff --git a/Sofa/framework/Core/src/sofa/core/CategoryLibrary.cpp b/Sofa/framework/Core/src/sofa/core/CategoryLibrary.cpp index 63ca8745277..edb8819073c 100644 --- a/Sofa/framework/Core/src/sofa/core/CategoryLibrary.cpp +++ b/Sofa/framework/Core/src/sofa/core/CategoryLibrary.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -152,7 +152,7 @@ std::vector CategoryLibrary::getCategories() "Mapping", "Mass", "MechanicalState", - "OdeSolver", + "IntegrationScheme", "OrderingMethod", "ProjectiveConstraintSet", "TopologicalMapping", @@ -195,8 +195,8 @@ void CategoryLibrary::getCategories(const objectmodel::BaseClass* mclass, v.push_back("TopologicalMapping"); if (mclass->hasParent(behavior::BaseMass::GetClass())) v.push_back("Mass"); - if (mclass->hasParent(behavior::OdeSolver::GetClass())) - v.push_back("OdeSolver"); + if (mclass->hasParent(behavior::BaseIntegrationScheme::GetClass())) + v.push_back("IntegrationScheme"); if (mclass->hasParent(behavior::ConstraintSolver::GetClass())) v.push_back("ConstraintSolver"); if (mclass->hasParent(behavior::BaseConstraintCorrection::GetClass())) diff --git a/Sofa/framework/Core/src/sofa/core/CategoryLibrary.h b/Sofa/framework/Core/src/sofa/core/CategoryLibrary.h index a7a71ebfccd..61b800abf57 100644 --- a/Sofa/framework/Core/src/sofa/core/CategoryLibrary.h +++ b/Sofa/framework/Core/src/sofa/core/CategoryLibrary.h @@ -65,7 +65,7 @@ class SOFA_CORE_API CategoryLibrary * CollisionModel, ConfigurationSetting, ConstraintSet, * ConstraintSolver, ConstraintSolver, ContextObject, Controller, * Engine, Exporter, ForceField, InteractionForceField, LinearSolver, LinearSystem, - * Loader, Mapping, Mass, MechanicalState, OdeSolver, OrderingMethod, + * Loader, Mapping, Mass, MechanicalState, IntegrationScheme, OrderingMethod, * ProjectiveConstraintSet, TopologicalMapping, Topology, * TopologyObject, and VisualModel */ diff --git a/Sofa/framework/Core/src/sofa/core/ConstraintParams.h b/Sofa/framework/Core/src/sofa/core/ConstraintParams.h index 845334d6e4c..d6924be0939 100644 --- a/Sofa/framework/Core/src/sofa/core/ConstraintParams.h +++ b/Sofa/framework/Core/src/sofa/core/ConstraintParams.h @@ -87,7 +87,7 @@ class SOFA_CORE_API ConstraintParams : public sofa::core::ExecParams /// @name Setup methods - /// Called by the OdeSolver from which the mechanical computations originate. + /// Called by the IntegrationScheme from which the mechanical computations originate. /// They all return a reference to this MechanicalParam instance, to ease chaining multiple setup calls. /// @{ diff --git a/Sofa/framework/Core/src/sofa/core/MechanicalParams.h b/Sofa/framework/Core/src/sofa/core/MechanicalParams.h index 708dd23cecf..2962184e51f 100644 --- a/Sofa/framework/Core/src/sofa/core/MechanicalParams.h +++ b/Sofa/framework/Core/src/sofa/core/MechanicalParams.h @@ -105,7 +105,7 @@ class SOFA_CORE_API MechanicalParams : public sofa::core::ExecParams /// @name Setup methods - /// Called by the OdeSolver from which the mechanical computations originate. + /// Called by the IntegrationScheme from which the mechanical computations originate. /// They all return a reference to this MechanicalParam instance, to ease chaining multiple setup calls. /// @{ diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp index 1dda9995993..2ec936bd09e 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp @@ -21,7 +21,7 @@ ******************************************************************************/ #include -#include +#include namespace sofa::core::behavior { @@ -44,7 +44,7 @@ void BaseConstraintCorrection::resetForUnbuiltResolution(SReal* /*f*/, std::list void BaseConstraintCorrection::addConstraintDisplacement(SReal* /*d*/, int /*begin*/, int /*end*/) {} void BaseConstraintCorrection::setConstraintDForce(SReal* /*df*/, int /*begin*/, int /*end*/, bool /*update*/) {} // f += df -SReal BaseConstraintCorrection::correctionFactor(const sofa::core::behavior::OdeSolver* solver, const ConstraintOrder& constraintOrder) +SReal BaseConstraintCorrection::correctionFactor(const sofa::core::behavior::BaseIntegrationScheme* solver, const ConstraintOrder& constraintOrder) { if (solver) { diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h index 6c98c1c2c81..faa82088bfc 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h @@ -137,7 +137,7 @@ class SOFA_CORE_API BaseConstraintCorrection : public virtual objectmodel::BaseC BaseConstraintCorrection(); ~BaseConstraintCorrection() override; - static SReal correctionFactor(const sofa::core::behavior::OdeSolver* solver, const ConstraintOrder& constraintOrder); + static SReal correctionFactor(const sofa::core::behavior::BaseIntegrationScheme* solver, const ConstraintOrder& constraintOrder); private: BaseConstraintCorrection(const BaseConstraintCorrection& n) = delete ; diff --git a/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.cpp b/Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.cpp similarity index 81% rename from Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.cpp rename to Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.cpp index 088e953119c..a2c5dc4c770 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.cpp +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #include #include #include @@ -28,29 +28,22 @@ namespace sofa::core::behavior { -OdeSolver::OdeSolver() +BaseIntegrationScheme::BaseIntegrationScheme() {} -OdeSolver::~OdeSolver() +BaseIntegrationScheme::~BaseIntegrationScheme() {} - -//const OdeSolver::MechanicalMatrix OdeSolver::M(1,0,0); -//const OdeSolver::MechanicalMatrix OdeSolver::B(0,1,0); -//const OdeSolver::MechanicalMatrix OdeSolver::K(0,0,1); - - - -bool OdeSolver::insertInNode( objectmodel::BaseNode* node ) +bool BaseIntegrationScheme::insertInNode( objectmodel::BaseNode* node ) { - node->addOdeSolver(this); + node->addIntegrationScheme(this); Inherit1::insertInNode(node); return true; } -bool OdeSolver::removeInNode( objectmodel::BaseNode* node ) +bool BaseIntegrationScheme::removeInNode( objectmodel::BaseNode* node ) { - node->removeOdeSolver(this); + node->removeIntegrationScheme(this); Inherit1::removeInNode(node); return true; } diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.h new file mode 100644 index 00000000000..df2a302057a --- /dev/null +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseIntegrationScheme.h @@ -0,0 +1,77 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once + +#include + +namespace sofa::core::behavior +{ + +/** + * \brief Component responsible for timestep integration, i.e. advancing the state from time t to t+dt. + * + * This class currently control both the integration scheme (explicit, + * implicit, static, etc). + * + * While all computations required to do the integration step are handled by + * this object, they should not be implemented directly in it, but instead + * the solver propagates orders (or Visitor) to the other components in the + * scenegraph that will locally execute them. This allows for greater + * flexibility (the solver can just ask for the forces to be computed without + * knowing what type of forces are present), as well as performances + * (some computations can be executed in parallel). + * + */ +class SOFA_CORE_API BaseIntegrationScheme : public virtual objectmodel::BaseComponent +{ +public: + SOFA_ABSTRACT_CLASS(BaseIntegrationScheme, objectmodel::BaseComponent); + SOFA_BASE_CAST_IMPLEMENTATION(BaseIntegrationScheme) + +protected: + BaseIntegrationScheme(); + ~BaseIntegrationScheme() override; + +public: + + virtual void integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) = 0; + + /// Given the solution dx of the linear system inversion, how much will it affect the velocity + /// + /// This method is used to compute the compliance for contact corrections + virtual SReal getVelocityIntegrationFactor() const = 0; + + /// Given the solution dx of the linear system inversion, how much will it affect the position + /// + /// This method is used to compute the compliance for contact corrections + virtual SReal getPositionIntegrationFactor() const = 0; + + + bool insertInNode( objectmodel::BaseNode* node ) override; + bool removeInNode( objectmodel::BaseNode* node ) override; + +protected: + + SReal m_dt; +}; + +} // namespace sofa::core::behavior diff --git a/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.h b/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.h index 4f080a00a15..f3d689af127 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/OdeSolver.h @@ -21,107 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -namespace sofa::core::behavior -{ - -/** - * \brief Component responsible for timestep integration, i.e. advancing the state from time t to t+dt. - * - * This class currently control both the integration scheme (explicit, - * implicit, static, etc). - * - * While all computations required to do the integration step are handled by - * this object, they should not be implemented directly in it, but instead - * the solver propagates orders (or Visitor) to the other components in the - * scenegraph that will locally execute them. This allows for greater - * flexibility (the solver can just ask for the forces to be computed without - * knowing what type of forces are present), as well as performances - * (some computations can be executed in parallel). - * - */ -class SOFA_CORE_API OdeSolver : public virtual objectmodel::BaseComponent -{ -public: - SOFA_ABSTRACT_CLASS(OdeSolver, objectmodel::BaseComponent); - SOFA_BASE_CAST_IMPLEMENTATION(OdeSolver) -protected: - OdeSolver(); - - ~OdeSolver() override; - -private: - OdeSolver(const OdeSolver& n) = delete; - OdeSolver& operator=(const OdeSolver& n) = delete; - -public: - /// Main computation method. - /// - /// Specify and execute all computation for timestep integration, i.e. - /// advancing the state from time t to t+dt, putting the resulting position and velocity in the provided vectors. - virtual void solve(const core::ExecParams* /*params*/, SReal /*dt*/, MultiVecCoordId /*xResult*/, MultiVecDerivId /*vResult*/) = 0; - - /// Main computation method. - /// - /// Specify and execute all computation for timestep integration, i.e. - /// advancing the state from time t to t+dt. - virtual void solve (const core::ExecParams* params, SReal dt) { solve(params, dt, vec_id::write_access::position, vec_id::write_access::velocity); } - - - /// Compute the residual of the newton iteration - /// - /// pos_t and vel_t are the position and velocities at the beginning of the time step - /// the result is accumulated in Vecid::force() - virtual void computeResidual(const core::ExecParams* /*params*/, SReal /*dt*/, sofa::core::MultiVecCoordId /*pos_t*/, sofa::core::MultiVecDerivId /*vel_t*/) { msg_error() << "ComputeResidual is not implemented in " << this->getName(); } - - - /// Given an input derivative order (0 for position, 1 for velocity, 2 for acceleration), - /// how much will it affect the output derivative of the given order. - /// - /// This method is used to compute the constraint corrections and adapt the resolution if using Baumgarte type scheme - /// For example, a backward-Euler dynamic implicit integrator would use: - /// Input: x_t v_t a_{t+dt} - /// x_{t+dt} 1 dt dt^2 - /// v_{t+dt} 0 1 dt - /// - /// If the linear system is expressed on s = a_{t+dt} dt, then the final factors are: - /// Input: x_t v_t a_t s - /// x_{t+dt} 1 dt 0 dt - /// v_{t+dt} 0 1 0 1 - /// a_{t+dt} 0 0 0 1/dt - /// The last column is returned by the getSolutionIntegrationFactor method. - /// - /// FF: What is the meaning of the parameters ? - virtual SReal getIntegrationFactor(int /*inputDerivative*/, int /*outputDerivative*/) const { msg_error() << "getIntegrationFactor not implemented !"; return 0; } - - /// Given a solution of the linear system, - /// how much will it affect the output derivative of the given order. - /// - /// FF: What is the meaning of the parameters ? - virtual SReal getSolutionIntegrationFactor(int /*outputDerivative*/) const { msg_error() << "getSolutionIntegrationFactor not implemented !"; return 0; } - - - /// Given the solution dx of the linear system inversion, how much will it affect the velocity - /// - /// This method is used to compute the compliance for contact corrections - virtual SReal getVelocityIntegrationFactor() const - { - return getSolutionIntegrationFactor(1); - } - - /// Given the solution dx of the linear system inversion, how much will it affect the position - /// - /// This method is used to compute the compliance for contact corrections - virtual SReal getPositionIntegrationFactor() const - { - return getSolutionIntegrationFactor(0); - } - - - bool insertInNode( objectmodel::BaseNode* node ) override; - bool removeInNode( objectmodel::BaseNode* node ) override; - -}; - -} // namespace sofa::core::behavior +SOFA_HEADER_DISABLED("v26.12", "v27.06", "sofa/core/behavior/IntegrationScheme.h") diff --git a/Sofa/framework/Core/src/sofa/core/fwd.cpp b/Sofa/framework/Core/src/sofa/core/fwd.cpp index 9bd0c8e5c9a..5bf2e05a046 100644 --- a/Sofa/framework/Core/src/sofa/core/fwd.cpp +++ b/Sofa/framework/Core/src/sofa/core/fwd.cpp @@ -34,7 +34,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -171,7 +172,7 @@ SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::objectmodel::Configura SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::BaseAnimationLoop); SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::BaseMass); -SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::OdeSolver); +SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::BaseIntegrationScheme); SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::ConstraintSolver); SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::BaseLinearSolver); SOFA_DEFINE_OPAQUE_FUNCTIONS_BETWEEN_BASE_AND(sofa::core::behavior::BaseMechanicalState); diff --git a/Sofa/framework/Core/src/sofa/core/fwd.h b/Sofa/framework/Core/src/sofa/core/fwd.h index 42ba5ac6916..5d9a42b9759 100644 --- a/Sofa/framework/Core/src/sofa/core/fwd.h +++ b/Sofa/framework/Core/src/sofa/core/fwd.h @@ -105,7 +105,7 @@ class BaseLagrangianConstraint; class BaseConstraintSet; class ConstraintSolver; class ConstraintResolution; -class OdeSolver; +class BaseIntegrationScheme; class BaseLinearSolver; class BaseInteractionForceField; class BaseProjectiveConstraintSet; @@ -273,7 +273,7 @@ SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::objectmodel::Configura SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::BaseAnimationLoop); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::BaseMass); -SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::OdeSolver); +SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::BaseIntegrationScheme); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::ConstraintSolver); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::BaseLinearSolver); SOFA_DECLARE_OPAQUE_FUNCTION_BETWEEN_BASE_AND(sofa::core::behavior::BaseMechanicalState); diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h index ce62107d239..4f23039cce4 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h @@ -411,7 +411,7 @@ class SOFA_CORE_API Base : public IntrusiveObject SOFA_BASE_CAST_DEFINITION( objectmodel, ContextObject ) SOFA_BASE_CAST_DEFINITION( objectmodel, ConfigurationSetting ) SOFA_BASE_CAST_DEFINITION( behavior, BaseAnimationLoop ) - SOFA_BASE_CAST_DEFINITION( behavior, OdeSolver ) + SOFA_BASE_CAST_DEFINITION( behavior, BaseIntegrationScheme ) SOFA_BASE_CAST_DEFINITION( behavior, BaseLinearSolver ) SOFA_BASE_CAST_DEFINITION( behavior, LinearSolver ) SOFA_BASE_CAST_DEFINITION( behavior, ConstraintSolver ) diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.cpp b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.cpp index 5b6b0af4954..d596432f0f8 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.cpp +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -48,14 +48,15 @@ core::behavior::BaseAnimationLoop* BaseNode::getAnimationLoop() const return this->getContext()->get(); } -core::behavior::OdeSolver* BaseNode::getOdeSolver() const +core::collision::Pipeline* BaseNode::getCollisionPipeline() const { - return this->getContext()->get(); + return this->getContext()->get(); } -core::collision::Pipeline* BaseNode::getCollisionPipeline() const + +core::behavior::BaseIntegrationScheme* BaseNode::getIntegrationScheme() const { - return this->getContext()->get(); + return this->getContext()->get(); } core::visual::VisualLoop* BaseNode::getVisualLoop() const diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.h b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.h index 2913373a309..88d72d5415e 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/BaseNode.h @@ -124,8 +124,8 @@ class SOFA_CORE_API BaseNode : public virtual Base /// @{ virtual core::behavior::BaseAnimationLoop* getAnimationLoop() const; - virtual core::behavior::OdeSolver* getOdeSolver() const; virtual core::collision::Pipeline* getCollisionPipeline() const; + virtual core::behavior::BaseIntegrationScheme* getIntegrationScheme() const; virtual core::visual::VisualLoop* getVisualLoop() const; private: @@ -155,7 +155,7 @@ class SOFA_CORE_API BaseNode : public virtual Base BASENODE_ADD_SPECIAL_COMPONENT( core::visual::VisualLoop, VisualLoop, visualLoop ) BASENODE_ADD_SPECIAL_COMPONENT( core::BehaviorModel, BehaviorModel, behaviorModel ) BASENODE_ADD_SPECIAL_COMPONENT( core::BaseMapping, Mapping, mapping ) - BASENODE_ADD_SPECIAL_COMPONENT( core::behavior::OdeSolver, OdeSolver, solver ) + BASENODE_ADD_SPECIAL_COMPONENT( core::behavior::BaseIntegrationScheme, IntegrationScheme, integrationScheme ) BASENODE_ADD_SPECIAL_COMPONENT( core::behavior::ConstraintSolver, ConstraintSolver, constraintSolver ) BASENODE_ADD_SPECIAL_COMPONENT( core::behavior::BaseLinearSolver, LinearSolver, linearSolver ) BASENODE_ADD_SPECIAL_COMPONENT( core::topology::Topology, Topology, topology ) diff --git a/Sofa/framework/Core/src/sofa/core/visual/VisualParams.h b/Sofa/framework/Core/src/sofa/core/visual/VisualParams.h index 00941b96776..308cd070536 100644 --- a/Sofa/framework/Core/src/sofa/core/visual/VisualParams.h +++ b/Sofa/framework/Core/src/sofa/core/visual/VisualParams.h @@ -76,7 +76,7 @@ class SOFA_CORE_API VisualParams : public ExecParams /// @} /// @name Setup methods - /// Called by the OdeSolver from which the mechanical computations originate. + /// Called by the IntegrationScheme from which the mechanical computations originate. /// They all return a reference to this MechanicalParam instance, to ease chaining multiple setup calls. /// @{ const ConstMultiVecCoordId& x() const { return m_x; } diff --git a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp index 41835aa4239..5e84ba73aad 100644 --- a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp @@ -78,25 +78,6 @@ std::map > movedComponents = { // MOVED SINCE v22.06 { "GlobalSystemMatrixExporter", Moved("v22.06", "SofaBaseLinearSolver", "SofaMatrix") }, - // SofaMiscSolver was deprecated in #2571 - { "DampVelocitySolver", Moved("v22.06", "SofaMiscSolver", Sofa.Component.ODESolver.Forward) }, - { "NewmarkImplicitSolver", Moved("v22.06", "SofaMiscSolver", Sofa.Component.ODESolver.Backward) }, - - // SofaExplicitOdeSolver was deprecated in #2571 - { "EulerExplicitSolver", Moved("v22.06", "SofaExplicitOdeSolver", Sofa.Component.ODESolver.Forward) }, - - // SofaImplicitOdeSolver was deprecated in #2571 - { "EulerImplicitSolver", Moved("v22.06", "SofaImplicitOdeSolver", Sofa.Component.ODESolver.Backward) }, - { "StaticSolver", Moved("v22.06", "SofaImplicitOdeSolver", Sofa.Component.ODESolver.Backward) }, - - // SofaGeneralExplicitOdeSolver was deprecated in #2571 - { "CentralDifferenceSolver", Moved("v22.06", "SofaGeneralExplicitOdeSolver", Sofa.Component.ODESolver.Forward) }, - { "RungeKutta2Solver", Moved("v22.06", "SofaGeneralExplicitOdeSolver", Sofa.Component.ODESolver.Forward) }, - { "RungeKutta4Solver", Moved("v22.06", "SofaGeneralExplicitOdeSolver", Sofa.Component.ODESolver.Forward) }, - - // SofaGeneralImplicitOdeSolver was deprecated in #2571 - { "VariationalSymplecticSolver", Moved("v22.06", "SofaGeneralImplicitOdeSolver", Sofa.Component.ODESolver.Backward) }, - // SofaLoader was deprecated in #2582 { "MeshOBJLoader", Moved("v22.06", "SofaLoader", Sofa.Component.IO.Mesh) }, { "MeshVTKLoader", Moved("v22.06", "SofaLoader", Sofa.Component.IO.Mesh) }, @@ -622,6 +603,12 @@ std::map > movedComponents = { std::map > uncreatableComponents = { + /***********************/ + // REMOVED SINCE v26.06 + + { "NewtonRaphsonSolver", RemovedIn("v27.06").withoutAnyDeprecation() }, + { "VariationalSymplecticSolver", RemovedIn("v27.06").withoutAnyDeprecation() }, + /***********************/ // REMOVED SINCE v25.12 @@ -767,7 +754,19 @@ std::map< std::string, Renamed, std::less<> > renamedComponents = { {"ParallelStiffSpringForceField", Renamed("v24.06","v25.06","ParallelSpringForceField")}, {"ShewchukPCGLinearSolver", Renamed("v24.12","v25.12","PCGLinearSolver")}, {"OglCylinderModel", Renamed("v24.12", "v25.06", "CylinderVisualModel")}, - {"TriangleOctreeModel", Renamed("v25.12", "v26.06", "TriangleOctreeCollisionModel") } + {"TriangleOctreeModel", Renamed("v25.12", "v26.06", "TriangleOctreeCollisionModel") }, + + // ODESolver → IntegrationScheme rename ##### + {"EulerExplicitSolver", Renamed("v26.06", "v27.06", "EulerExplicitIntegrationScheme")}, + {"CentralDifferenceSolver", Renamed("v26.06", "v27.06", "CentralDifferenceIntegrationScheme")}, + {"DampVelocitySolver", Renamed("v26.06", "v27.06", "DampVelocityIntegrationScheme")}, + {"RungeKutta2Solver", Renamed("v26.06", "v27.06", "RungeKutta2IntegrationScheme")}, + {"RungeKutta4Solver", Renamed("v26.06", "v27.06", "RungeKutta4IntegrationScheme")}, + {"EulerImplicitSolver", Renamed("v26.06", "v27.06", "EulerImplicitIntegrationScheme")}, + {"NewmarkImplicitSolver", Renamed("v26.06", "v27.06", "NewmarkIntegrationScheme")}, + {"StaticSolver", Renamed("v26.06", "v27.06", "StaticEquilibriumIntegrationScheme")}, + {"BDFOdeSolver", Renamed("v26.06", "v27.06", "BDFIntegrationScheme")}, + {"BaseLinearMultiStepMethod", Renamed("v26.06", "v27.06", "LinearMultistepIntegrationScheme")}, }; diff --git a/Sofa/framework/Simulation/Core/CMakeLists.txt b/Sofa/framework/Simulation/Core/CMakeLists.txt index 756046a81b3..e0ec331e108 100644 --- a/Sofa/framework/Simulation/Core/CMakeLists.txt +++ b/Sofa/framework/Simulation/Core/CMakeLists.txt @@ -155,6 +155,11 @@ set(HEADER_FILES ${SRC_ROOT}/task/TaskSchedulerUser.h ${SRC_ROOT}/task/WorkerThread.h ${SRC_ROOT}/task/TaskSchedulerSettings.h + + ${SRC_ROOT}/integrationscheme/AccelerationBasedImplicitIntegrationScheme.h + ${SRC_ROOT}/integrationscheme/VelocityBasedImplicitIntegrationScheme.h + ${SRC_ROOT}/integrationscheme/ExplicitIntegrationScheme.h + ${SRC_ROOT}/integrationscheme/ImplicitIntegrationScheme.h ) set(SOURCE_FILES @@ -297,6 +302,12 @@ set(SOURCE_FILES ${SRC_ROOT}/task/TaskSchedulerUser.cpp ${SRC_ROOT}/task/WorkerThread.cpp ${SRC_ROOT}/task/TaskSchedulerSettings.cpp + + ${SRC_ROOT}/integrationscheme/AccelerationBasedImplicitIntegrationScheme.cpp + ${SRC_ROOT}/integrationscheme/VelocityBasedImplicitIntegrationScheme.cpp + ${SRC_ROOT}/integrationscheme/ImplicitIntegrationScheme.cpp + ${SRC_ROOT}/integrationscheme/ExplicitIntegrationScheme.cpp + ) set(DEPRECATED_DIR "compat/sofa/simulation") diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h index b533f1658ce..462c7bb5e81 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h @@ -22,4 +22,5 @@ #pragma once #include + SOFA_HEADER_DISABLED_NOT_REPLACED("v25.12", "v26.06") diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.cpp index 24d45721fb4..e28239fc0c0 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include @@ -71,9 +71,9 @@ bool BaseMechanicalVisitor::isMechanicalStateMapped(simulation::Node* node) cons Visitor::Result BaseMechanicalVisitor::processNodeTopDown(simulation::Node *node, VisitorContext *ctx) { - for (auto *solver : node->solver) + for (auto *solver : node->integrationScheme) { - if (runVisitorTask(this, ctx, &BaseMechanicalVisitor::fwdOdeSolver, solver, fwdVisitorType) == RESULT_PRUNE) + if (runVisitorTask(this, ctx, &BaseMechanicalVisitor::fwdIntegrationScheme, solver, fwdVisitorType) == RESULT_PRUNE) { return RESULT_PRUNE; } @@ -169,7 +169,7 @@ void BaseMechanicalVisitor::processNodeBottomUp(simulation::Node *node, VisitorC } } - for_each(this, ctx, node->solver, &BaseMechanicalVisitor::bwdOdeSolver, bwdVisitorType); + for_each(this, ctx, node->integrationScheme, &BaseMechanicalVisitor::bwdIntegrationScheme, bwdVisitorType); if (node == root) { @@ -369,16 +369,16 @@ void BaseMechanicalVisitor::end(simulation::Node* node, core::objectmodel::BaseC /// Only used for debugging / profiling purposes const char* BaseMechanicalVisitor::getClassName() const { return "MechanicalVisitor"; } -/// Process the OdeSolver -auto BaseMechanicalVisitor::fwdOdeSolver(simulation::Node* /*node*/, sofa::core::behavior::OdeSolver* /*solver*/) -> Result +/// Process the IntegrationScheme +auto BaseMechanicalVisitor::fwdIntegrationScheme(simulation::Node* /*node*/, sofa::core::behavior::BaseIntegrationScheme* /*solver*/) -> Result { return RESULT_CONTINUE; } -/// Process the OdeSolver -auto BaseMechanicalVisitor::fwdOdeSolver(VisitorContext* ctx, sofa::core::behavior::OdeSolver* solver) -> Result +/// Process the IntegrationScheme +auto BaseMechanicalVisitor::fwdIntegrationScheme(VisitorContext* ctx, sofa::core::behavior::BaseIntegrationScheme* solver) -> Result { - return fwdOdeSolver(ctx->node, solver); + return fwdIntegrationScheme(ctx->node, solver); } /// Process the ConstraintSolver @@ -526,13 +526,13 @@ void BaseMechanicalVisitor::bwdMechanicalMapping(simulation::Node* /*node*/, sof void BaseMechanicalVisitor::bwdMechanicalMapping(VisitorContext* ctx, sofa::core::BaseMapping* map) { bwdMechanicalMapping(ctx->node, map); } -/// Process the OdeSolver -void BaseMechanicalVisitor::bwdOdeSolver(simulation::Node* /*node*/,sofa::core::behavior::OdeSolver* /*solver*/) +/// Process the IntegrationScheme +void BaseMechanicalVisitor::bwdIntegrationScheme(simulation::Node* /*node*/, sofa::core::behavior::BaseIntegrationScheme* /*solver*/) {} -/// Process the OdeSolver -void BaseMechanicalVisitor::bwdOdeSolver(VisitorContext* ctx,sofa::core::behavior::OdeSolver* solver) -{ bwdOdeSolver(ctx->node, solver); } +/// Process the IntegrationScheme +void BaseMechanicalVisitor::bwdIntegrationScheme(VisitorContext* ctx, sofa::core::behavior::BaseIntegrationScheme* solver) +{ bwdIntegrationScheme(ctx->node, solver); } /// Process the ConstraintSolver void BaseMechanicalVisitor::bwdConstraintSolver(simulation::Node* /*node*/,sofa::core::behavior::ConstraintSolver* /*solver*/) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.h index 50000909e3d..de0768da4dc 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/BaseMechanicalVisitor.h @@ -73,11 +73,11 @@ class SOFA_SIMULATION_CORE_API BaseMechanicalVisitor : public Visitor /// This method calls the fwd* methods during the forward traversal. You typically do not overload it. Result processNodeTopDown(simulation::Node* node) override; - /// Process the OdeSolver - virtual Result fwdOdeSolver(simulation::Node* /*node*/, sofa::core::behavior::OdeSolver* /*solver*/); + /// Process the IntegrationScheme + virtual Result fwdIntegrationScheme(simulation::Node* /*node*/, sofa::core::behavior::BaseIntegrationScheme* /*solver*/); - /// Process the OdeSolver - virtual Result fwdOdeSolver(VisitorContext* ctx, sofa::core::behavior::OdeSolver* solver); + /// Process the IntegrationScheme + virtual Result fwdIntegrationScheme(VisitorContext* ctx, sofa::core::behavior::BaseIntegrationScheme* solver); /// Process the ConstraintSolver virtual Result fwdConstraintSolver(simulation::Node* /*node*/, sofa::core::behavior::ConstraintSolver* /*solver*/); @@ -177,11 +177,11 @@ class SOFA_SIMULATION_CORE_API BaseMechanicalVisitor : public Visitor /// Process the BaseMechanicalMapping virtual void bwdMechanicalMapping(VisitorContext* ctx, sofa::core::BaseMapping* map); - /// Process the OdeSolver - virtual void bwdOdeSolver(simulation::Node* /*node*/,sofa::core::behavior::OdeSolver* /*solver*/); + /// Process the IntegrationScheme + virtual void bwdIntegrationScheme(simulation::Node* /*node*/, sofa::core::behavior::BaseIntegrationScheme* /*solver*/); - /// Process the OdeSolver - virtual void bwdOdeSolver(VisitorContext* ctx,sofa::core::behavior::OdeSolver* solver); + /// Process the IntegrationScheme + virtual void bwdIntegrationScheme(VisitorContext* ctx, sofa::core::behavior::BaseIntegrationScheme* solver); /// Process the ConstraintSolver virtual void bwdConstraintSolver(simulation::Node* /*node*/,sofa::core::behavior::ConstraintSolver* /*solver*/); diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.cpp index 14ff4001580..4001b907c37 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.cpp @@ -109,7 +109,7 @@ const CollisionAnimationLoop::Solvers& CollisionAnimationLoop::getSolverSequence { simulation::Node* gnode = dynamic_cast( getContext() ); assert( gnode ); - return gnode->solver; + return gnode->integrationScheme; } } // namespace simulation diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.h index ea56345c67e..aff682f077b 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/CollisionAnimationLoop.h @@ -75,11 +75,11 @@ class SOFA_SIMULATION_CORE_API CollisionAnimationLoop : public sofa::core::behav /// Activate collision pipeline virtual void computeCollision(const core::ExecParams* params = core::execparams::defaultInstance()); - /// Activate OdeSolvers + /// Activate IntegrationScheme virtual void integrate(const core::ExecParams* params, SReal dt); - typedef simulation::Node::Sequence Solvers; + typedef simulation::Node::Sequence Solvers; typedef core::collision::Pipeline Pipeline; const Solvers& getSolverSequence(); }; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Colors.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Colors.cpp index 79013fe09d5..2275425802c 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Colors.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Colors.cpp @@ -64,7 +64,7 @@ std::map colors = { {"InteractionForceField", IFFIELD}, {"ForceField", FFIELD}, {"BaseAnimationLoop", SOLVER}, - {"OdeSolver", SOLVER}, // même valeur que ci-dessus + {"IntegrationScheme", SOLVER}, // même valeur que ci-dessus {"CollisionPipeline", COLLISION}, {"MechanicalMapping", MMAPPING}, {"Mapping", MAPPING}, diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/ExportDotVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/ExportDotVisitor.cpp index 138156326a4..e796f3c0959 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/ExportDotVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/ExportDotVisitor.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -132,7 +132,7 @@ bool ExportDotVisitor::display(core::objectmodel::BaseComponent* obj, const char if (showCollisionPipeline) { show = true; *color = COLOR[COLLISION]; } else hide = true; } - if (obj->toOdeSolver()) + if (obj->toBaseIntegrationScheme()) { if (showSolver) { show = true; *color = COLOR[SOLVER]; } else hide = true; @@ -192,17 +192,17 @@ std::string ExportDotVisitor::getParentName(core::objectmodel::BaseComponent* ob obj->toCollisionGroupManager())) return getName(node->collisionPipeline); /// \todo consider all solvers instead of the first one (FF) - if (!node->mechanicalState.empty() && node->mechanicalState!=obj && node->linearSolver[0]!=obj && node->solver[0]!=obj && node->animationManager!=obj && display(node->mechanicalState)) + if (!node->mechanicalState.empty() && node->mechanicalState!=obj && node->linearSolver[0]!=obj && node->integrationScheme[0]!=obj && node->animationManager!=obj && display(node->mechanicalState)) return getName(node->mechanicalState); - if (!node->linearSolver.empty() && node->linearSolver[0]!=obj && node->solver[0]!=obj && node->animationManager!=obj && display(node->linearSolver[0])) + if (!node->linearSolver.empty() && node->linearSolver[0]!=obj && node->integrationScheme[0]!=obj && node->animationManager!=obj && display(node->linearSolver[0])) return getName(node->linearSolver[0]); - if (!node->solver.empty() && node->solver[0]!=obj && node->animationManager!=obj && display(node->solver[0])) - return getName(node->solver[0]); - if (!node->animationManager.empty() && node->animationManager!=obj && display(node->solver[0])) + if (!node->integrationScheme.empty() && node->integrationScheme[0]!=obj && node->animationManager!=obj && display(node->integrationScheme[0])) + return getName(node->integrationScheme[0]); + if (!node->animationManager.empty() && node->animationManager!=obj && display(node->integrationScheme[0])) return getName(node->animationManager); - if ((node->mechanicalState==obj || node->solver[0]==obj) && !node->mechanicalMapping && node->getFirstParent() && display(static_cast(node->getFirstParent())->solver[0])) - return getName(static_cast(node->getFirstParent())->solver[0]); - if ((node->mechanicalState==obj || node->solver[0]==obj || node->animationManager==obj) && !node->mechanicalMapping && node->getFirstParent() && display(static_cast(node->getFirstParent())->animationManager)) + if ((node->mechanicalState==obj || node->integrationScheme[0]==obj) && !node->mechanicalMapping && node->getFirstParent() && display(static_cast(node->getFirstParent())->integrationScheme[0])) + return getName(static_cast(node->getFirstParent())->integrationScheme[0]); + if ((node->mechanicalState==obj || node->integrationScheme[0]==obj || node->animationManager==obj) && !node->mechanicalMapping && node->getFirstParent() && display(static_cast(node->getFirstParent())->animationManager)) return getName(static_cast(node->getFirstParent())->animationManager); return ""; } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h index 55378676263..84eac8752ad 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/InitVisitor.h @@ -32,9 +32,9 @@ namespace sofa::simulation /** Initialize a newly created (or modified) scene graph. - Forward: simulation::Node::initialize() This method puts the OdeSolver, if any, first in the list of components. Then BaseObject::init() for all components. + Forward: simulation::Node::initialize() This method puts the IntegrationScheme, if any, first in the list of components. Then BaseObject::init() for all components. - Backward: OdeSolver::bwdInit() + Backward: IntegrationScheme::bwdInit() */ class SOFA_SIMULATION_CORE_API InitVisitor : public Visitor diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp index bcc0dd329fa..e39216fbc59 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp @@ -30,7 +30,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -84,7 +85,7 @@ Node::Node(const std::string& nodename, Node* parent) , behaviorModel(initLink("behaviorModel", "The BehaviorModel attached to this node (only valid for root node)")) , mapping(initLink("mapping", "The (non-mechanical) Mapping(s) attached to this node (only valid for root node)")) - , solver(initLink("odeSolver", "The OdeSolver(s) attached to this node (controlling the mechanical time integration of this branch)")) + , integrationScheme(initLink("integrationScheme", "The IntegrationScheme(s) attached to this node (controlling the mechanical time integration of this branch)")) , constraintSolver(initLink("constraintSolver", "The ConstraintSolver(s) attached to this node")) , linearSolver(initLink("linearSolver", "The LinearSolver(s) attached to this node")) , topologyObject(initLink("topologyObject", "The topology-related objects attached to this node")) @@ -612,8 +613,8 @@ sofa::core::objectmodel::Base* Node::findLinkDestClass(const core::objectmodel:: return destType->dynamicCast(node->getShader()); else if (destType->hasParent(core::behavior::BaseAnimationLoop::GetClass())) return destType->dynamicCast(node->getAnimationLoop()); - else if (destType->hasParent(core::behavior::OdeSolver::GetClass())) - return destType->dynamicCast(node->getOdeSolver()); + else if (destType->hasParent(core::behavior::BaseIntegrationScheme::GetClass())) + return destType->dynamicCast(node->getIntegrationScheme()); else if (destType->hasParent(core::collision::Pipeline::GetClass())) return destType->dynamicCast(node->getCollisionPipeline()); else if (destType->hasParent(core::visual::VisualLoop::GetClass())) @@ -722,12 +723,12 @@ core::behavior::BaseAnimationLoop* Node::getAnimationLoop() const return get(SearchParents); } -core::behavior::OdeSolver* Node::getOdeSolver() const +core::behavior::BaseIntegrationScheme* Node::getIntegrationScheme() const { - if (!solver.empty()) - return solver[0]; + if (!integrationScheme.empty()) + return integrationScheme[0]; else - return get(SearchParents); + return get(SearchParents); } core::collision::Pipeline* Node::getCollisionPipeline() const @@ -819,9 +820,9 @@ bool Node::getDebug() const void Node::removeControllers() { removeObject(*animationManager.begin()); - typedef NodeSequence Solvers; - const Solvers solverRemove = solver; - for ( Solvers::iterator i=solverRemove.begin(), iend=solverRemove.end(); i!=iend; ++i ) + typedef NodeSequence integrationSchemes; + const integrationSchemes solverRemove = integrationScheme; + for ( integrationSchemes::iterator i=solverRemove.begin(), iend=solverRemove.end(); i!=iend; ++i ) removeObject( *i ); } @@ -933,8 +934,8 @@ void Node::printComponents() sstream << "BaseAnimationLoop: "; for (NodeSingle::iterator i = animationManager.begin(), iend = animationManager.end(); i != iend; ++i) sstream << (*i)->getName() << " "; - sstream << "\n" << "OdeSolver: "; - for (NodeSequence::iterator i = solver.begin(), iend = solver.end(); i != iend; ++i) + sstream << "\n" << "BaseIntegrationScheme: "; + for (NodeSequence::iterator i = integrationScheme.begin(), iend = integrationScheme.end(); i != iend; ++i) sstream << (*i)->getName() << " "; sstream << "\n" << "LinearSolver: "; for (NodeSequence::iterator i = linearSolver.begin(), iend = linearSolver.end(); i != iend; i++) @@ -1880,7 +1881,7 @@ NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::behavior::BaseAnimationLoop, Animatio NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::visual::VisualLoop, VisualLoop, visualLoop ) NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::BehaviorModel, BehaviorModel, behaviorModel ) NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::BaseMapping, Mapping, mapping ) -NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::behavior::OdeSolver, OdeSolver, solver ) +NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::behavior::BaseIntegrationScheme, IntegrationScheme, integrationScheme ) NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::behavior::ConstraintSolver, ConstraintSolver, constraintSolver ) NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::behavior::BaseLinearSolver, LinearSolver, linearSolver ) NODE_DEFINE_SEQUENCE_ACCESSOR( sofa::core::topology::Topology, Topology, topology ) @@ -1907,7 +1908,7 @@ template class NodeSequence; template class NodeSequence; template class NodeSequence; template class NodeSequence; -template class NodeSequence; +template class NodeSequence< sofa::core::behavior::BaseIntegrationScheme>; template class NodeSequence; template class NodeSequence; template class NodeSequence; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.h index 11085a64378..824b660a457 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.h @@ -110,7 +110,7 @@ extern template class NodeSequence; extern template class NodeSequence; extern template class NodeSequence; extern template class NodeSequence; -extern template class NodeSequence; +extern template class NodeSequence; extern template class NodeSequence; extern template class NodeSequence; extern template class NodeSequence; @@ -231,7 +231,7 @@ class SOFA_SIMULATION_CORE_API Node : public sofa::core::objectmodel::BaseNode, NodeSequence behaviorModel; NodeSequence mapping; - NodeSequence solver; + NodeSequence integrationScheme; NodeSequence constraintSolver; NodeSequence linearSolver; NodeSequence topologyObject; @@ -425,7 +425,7 @@ class SOFA_SIMULATION_CORE_API Node : public sofa::core::objectmodel::BaseNode, /// @{ sofa::core::behavior::BaseAnimationLoop* getAnimationLoop() const override; - sofa::core::behavior::OdeSolver* getOdeSolver() const override; + sofa::core::behavior::BaseIntegrationScheme* getIntegrationScheme() const override; sofa::core::collision::Pipeline* getCollisionPipeline() const override; sofa::core::visual::VisualLoop* getVisualLoop() const override; @@ -610,7 +610,7 @@ class SOFA_SIMULATION_CORE_API Node : public sofa::core::objectmodel::BaseNode, NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::visual::VisualLoop, VisualLoop, visualLoop ) NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::BehaviorModel, BehaviorModel, behaviorModel ) NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::BaseMapping, Mapping, mapping ) - NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::behavior::OdeSolver, OdeSolver, solver ) + NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::behavior::BaseIntegrationScheme, IntegrationScheme, integrationScheme ) NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::behavior::ConstraintSolver, ConstraintSolver, constraintSolver ) NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::behavior::BaseLinearSolver, LinearSolver, linearSolver ) NODE_DECLARE_SEQUENCE_ACCESSOR( sofa::core::topology::Topology, Topology, topology ) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/PrintVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/PrintVisitor.cpp index fd6d85b89f2..30ac233160d 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/PrintVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/PrintVisitor.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ Visitor::Result PrintVisitor::processNodeTopDown(simulation::Node* node) ++level; processObjects(node->mechanicalState,"MechanicalState"); processObjects(node->mechanicalMapping,"MechanicalMapping"); - processObjects(node->solver,"Solver"); + processObjects(node->integrationScheme,"IntegrationScheme"); processObjects(node->linearSolver,"LinearSolver"); processObjects(node->mass,"Mass"); processObjects(node->topology,"Topology"); diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.cpp index 9b1dd106a38..aafb946230c 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -32,10 +32,10 @@ namespace sofa::simulation { -void SolveVisitor::processSolver(simulation::Node* node, sofa::core::behavior::OdeSolver* s) +void SolveVisitor::processSolver(simulation::Node* node, sofa::core::behavior::BaseIntegrationScheme* s) { helper::ScopedAdvancedTimer timer("Mechanical",node); - s->solve(params, dt, x, v); + s->integrate(params, dt, x, v); } void SolveVisitor::fwdInteractionForceField(Node* node, core::behavior::BaseInteractionForceField* forceField) @@ -50,7 +50,7 @@ void SolveVisitor::fwdInteractionForceField(Node* node, core::behavior::BaseInte Visitor::Result SolveVisitor::processNodeTopDown(simulation::Node* node) { - if (! node->solver.empty()) + if (! node->integrationScheme.empty()) { if (m_parallelSolve) { @@ -135,7 +135,7 @@ SolveVisitor::SolveVisitor(const sofa::core::ExecParams* params, SReal _dt, bool void SolveVisitor::sequentialSolve(simulation::Node* node) { - for_each(this, node, node->solver, &SolveVisitor::processSolver); + for_each(this, node, node->integrationScheme, &SolveVisitor::processSolver); } void SolveVisitor::parallelSolve(simulation::Node* node) @@ -143,7 +143,7 @@ void SolveVisitor::parallelSolve(simulation::Node* node) auto* taskScheduler = sofa::simulation::MainTaskSchedulerFactory::createInRegistry(); assert(taskScheduler != nullptr); - for (auto* solver : node->solver) + for (auto* solver : node->integrationScheme) { m_tasks.emplace_back(&m_status, solver, params, dt, x, v); taskScheduler->addTask(&m_tasks.back()); @@ -162,7 +162,7 @@ void SolveVisitor::initializeTaskScheduler() sofa::simulation::Task::MemoryAlloc SolveVisitorTask::run() { - m_solver->solve(m_execParams, m_dt, m_x, m_v); + m_solver->integrate(m_execParams, m_dt, m_x, m_v); return Task::Stack; } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.h index 68f7a08b1b8..b6efaa81cbd 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/SolveVisitor.h @@ -22,6 +22,7 @@ #pragma once #include +#include #include #include @@ -48,7 +49,7 @@ class SOFA_SIMULATION_CORE_API SolveVisitor : public Visitor SolveVisitor(const sofa::core::ExecParams* params, SReal _dt, bool free, bool _parallelSolve = false, bool computeForceIsolatedInteractionForceFields = false); - virtual void processSolver(simulation::Node* node, sofa::core::behavior::OdeSolver* b); + virtual void processSolver(simulation::Node* node, sofa::core::behavior::BaseIntegrationScheme* b); void fwdInteractionForceField(Node* node, core::behavior::BaseInteractionForceField* forceField); Result processNodeTopDown(simulation::Node* node) override; void processNodeBottomUp(simulation::Node* /*node*/) override; @@ -95,13 +96,13 @@ class SolveVisitorTask : public sofa::simulation::CpuTask { public: SolveVisitorTask(sofa::simulation::CpuTask::Status* status, - sofa::core::behavior::OdeSolver* odeSolver, + sofa::core::behavior::BaseIntegrationScheme* IntegrationScheme, const sofa::core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId x, sofa::core::MultiVecDerivId v) : sofa::simulation::CpuTask(status) - , m_solver(odeSolver) + , m_solver(IntegrationScheme) , m_execParams(params) , m_dt(dt) , m_x(x) @@ -112,7 +113,7 @@ class SolveVisitorTask : public sofa::simulation::CpuTask sofa::simulation::Task::MemoryAlloc run() final; private: - sofa::core::behavior::OdeSolver* m_solver {nullptr}; + sofa::core::behavior::BaseIntegrationScheme* m_solver {nullptr}; const sofa::core::ExecParams* m_execParams {nullptr}; SReal m_dt; sofa::core::MultiVecCoordId m_x; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/VectorOperations.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/VectorOperations.h index 0ffe819931c..50b63e3eb51 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/VectorOperations.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/VectorOperations.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace sofa { @@ -41,6 +42,19 @@ class SOFA_SIMULATION_CORE_API VectorOperations : public sofa::core::behavior::B { public: + + template + static void realloc(sofa::simulation::common::VectorOperations& vop, + core::TMultiVecId& id, + const std::string& vecIdName, + const sofa::core::objectmodel::Base* holder, + bool interactionForcefield = false ) + { + sofa::core::behavior::TMultiVec vec(&vop, id); + vec.realloc(&vop, interactionForcefield, true, core::VecIdProperties{vecIdName, holder->getClassName()}); + id = vec.id(); + } + VectorOperations(const sofa::core::ExecParams* params, sofa::core::objectmodel::BaseContext* ctx, bool precomputedTraversalOrder=false); /// Allocate a temporary vector diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.cpp new file mode 100644 index 00000000000..60970940c78 --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.cpp @@ -0,0 +1,273 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor; + + +namespace sofa::simulation::integrationscheme +{ + +void AccelerationBasedImplicitIntegrationScheme::doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + + // Make sure the states are following the sizes + simulation::common::VectorOperations::realloc(*m_vop, m_r0, "r0", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_r1, "r1", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_r2, "r2", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_acceleration, "acceleration", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_unknown, "da", this, true); + + // Deal with higher order integration scheme + const Size order = getIntegrationSchemeTimeOrder(); + + m_x0.resize(order); + m_v0.resize(order); + m_a0.resize(order); + + for (unsigned i = 0; i < order; ++i) + { + // If first order, don't add the subscript + simulation::common::VectorOperations::realloc(*m_vop, m_x0[i], "x0" + (order != 1 ? "_" + std::to_string(i) : ""), this); + simulation::common::VectorOperations::realloc(*m_vop, m_v0[i], "v0" + (order != 1 ? "_" + std::to_string(i) : ""), this); + simulation::common::VectorOperations::realloc(*m_vop, m_a0[i], "a0" + (order != 1 ? "_" + std::to_string(i) : ""), this, true); + + // Only at the start of the simulation, copy the position/velocity values inside the stored + // states to recreate the past + if (this->getTime() < std::numeric_limits::epsilon()) + { + sofa::core::behavior::MultiVecDeriv v0(m_vop.get(), m_v0[i]); + v0.eq(core::vec_id::write_access::velocity); + sofa::core::behavior::MultiVecCoord x0(m_vop.get(), m_x0[i]); + x0.eq(core::vec_id::write_access::position); + sofa::core::behavior::MultiVecDeriv a0(m_vop.get(), m_a0[i]); + a0.clear(); + } + } + + // Now shift all states to advance in time (could be skipped at the start of the simulation) + // I decided not to do it to avoid having the check + for (unsigned i = 0; i < order - 1; ++i) + { + sofa::core::behavior::MultiVecCoord x(m_vop.get(), m_x0[i]); + x.eq(m_x0[i+1]); + sofa::core::behavior::MultiVecDeriv v(m_vop.get(), m_v0[i]); + v.eq(m_v0[i+1]); + sofa::core::behavior::MultiVecDeriv a(m_vop.get(), m_a0[i]); + a.eq(m_a0[i+1]); + } + + // Store the previous state in its right position in the state vector + sofa::core::behavior::MultiVecDeriv v0(m_vop.get(), m_v0[order - 1]); + v0.eq(core::vec_id::write_access::velocity); + sofa::core::behavior::MultiVecCoord x0(m_vop.get(), m_x0[order - 1]); + x0.eq(core::vec_id::write_access::position); + sofa::core::behavior::MultiVecDeriv a0(m_vop.get(), m_a0[order - 1]); + a0.eq(m_acceleration); + + // This is only there for lagrangian based simulation, to make sure we start using the real pose + // instead of the free pos (same for velocity) + m_vop->v_eq(m_vResult, core::vec_id::write_access::velocity); + m_vop->v_eq(m_xResult, core::vec_id::write_access::position); + +} + +/** + * Compute the system matrix. + */ +void AccelerationBasedImplicitIntegrationScheme::computeLHS(bool firstIteration) +{ + SOFA_UNUSED(firstIteration); + + // Those two factors relate the position (DGx) and the velocity (DGv) to the acceleration + // We can think of them as the first order approximation of the IS in term of acceleration + const SReal DGx = getPositionUpdateDerivedFromVelocity()*getVelocityUpdateDerivedFromAcceleration() + getPositionUpdateDerivedFromAcceleration(); + const SReal DGv = getVelocityUpdateDerivedFromAcceleration(); + + // Set the factor of the left hand side taking into account the rayleigh damping + SCOPED_TIMER("setSystemMBKMatrix"); + const core::MatricesFactors::M mFact( 1 + DGv * d_rayleighMass.getValue() ); + const core::MatricesFactors::B bFact( -DGv ); + const core::MatricesFactors::K kFact( - DGx - DGv * d_rayleighStiffness.getValue() ); + + m_mop->setSystemMBKMatrix(mFact, bFact, kFact, l_linearSolver.get()); +} + +/** +* compute the current RHS. +*/ +void AccelerationBasedImplicitIntegrationScheme::computeRHS(bool firstIteration) +{ + + // Make sure no one modified this + m_mop->cparams.setX(m_xResult); + m_mop->cparams.setV(m_vResult); + + + sofa::core::behavior::MultiVecDeriv f(m_vop.get(), core::vec_id::write_access::force ); + // Let's make sure f is cleared between each Newton steps + f.clear(); + // The other one don't need to be clear as they are recomputed and not updated by the real IS impl + + { + SCOPED_TIMER("ComputeForce"); + m_mop->mparams.setImplicit(true); // this solver is implicit + // compute the net forces at the beginning of the time step + m_mop->computeForce(m_mappingGraph, f, true, true, nullptr); + } + + { + SCOPED_TIMER("ComputeRHTerm"); + + m_vop->v_eq(m_r0, f, 1.0); + + // This computes the explicit part of the Rayleigh damping + if ( fabs(d_rayleighMass.getValue()) > std::numeric_limits::epsilon() + || fabs(d_rayleighStiffness.getValue()) > std::numeric_limits::epsilon()) + { + m_mop->addMBKv(m_mappingGraph, m_r0, core::MatricesFactors::M(-d_rayleighMass.getValue()), + core::MatricesFactors::B(0), + core::MatricesFactors::K(d_rayleighStiffness.getValue())); + } + + + + auto backV = m_mop->mparams.v(); + + // R1 and R2 should be equal to 0 in theory when integration scheme is linear. But let's + // recompute them anyway to compute the residue + computeCurrentPositionIntegrationError (*m_vop, m_r1, core::vec_id::write_access::velocity, m_acceleration); + computeCurrentVelocityIntegrationError (*m_vop, m_r2, m_acceleration); + + if (firstIteration) + { + m_mop->mparams.setV(m_r1); + m_mop->addMBKv(m_mappingGraph, m_r0, core::MatricesFactors::M(0.0), + core::MatricesFactors::B(0), + core::MatricesFactors::K(-1.0)); + + m_mop->mparams.setV(m_r2); + m_mop->addMBKv(m_mappingGraph, m_r0, core::MatricesFactors::M(d_rayleighMass.getValue()), + core::MatricesFactors::B(-1.0), + core::MatricesFactors::K(-getPositionUpdateDerivedFromVelocity() - d_rayleighStiffness.getValue())); + } + + m_mop->mparams.setV(m_acceleration); + m_mop->addMBKv(m_mappingGraph, m_r0, core::MatricesFactors::M(-1.0), + core::MatricesFactors::B(0), + core::MatricesFactors::K(0)); + m_mop->mparams.setV(backV); + + // Apply projective constraints to the full residue + m_mop->projectResponse(m_mappingGraph, m_r0); + m_mop->projectResponse(m_mappingGraph, m_r1); + m_mop->projectResponse(m_mappingGraph, m_r2); + } + +} + + +/** + * Returns the evaluation of the residue + */ +SReal AccelerationBasedImplicitIntegrationScheme::evaluateResidue() +{ + core::behavior::MultiVecDeriv r0(m_vop.get(), m_r0); + core::behavior::MultiVecDeriv r1(m_vop.get(), m_r1); + core::behavior::MultiVecDeriv r2(m_vop.get(), m_r2); + + return r0.dot(r0) + r1.dot(r1) + r2.dot(r2); +} + + +/** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ +void AccelerationBasedImplicitIntegrationScheme::solveLinearEquation() +{ + SCOPED_TIMER("MBKSolve"); + + l_linearSolver->getLinearSystem()->setSystemSolution(m_unknown); + l_linearSolver->getLinearSystem()->setRHS(m_r0); + l_linearSolver->solveSystem(); + l_linearSolver->getLinearSystem()->dispatchSystemSolution(m_unknown); +} + +/** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ +void AccelerationBasedImplicitIntegrationScheme::updateStatesFromLinearSolution(SReal alpha, bool firstIteration) +{ + sofa::core::behavior::MultiVecCoord pos(m_vop.get(), m_xResult); + sofa::core::behavior::MultiVecDeriv vel(m_vop.get(), m_vResult ); + sofa::core::behavior::MultiVecDeriv acc(m_vop.get(), m_acceleration ); + + + // Those two factors relate the position (DGx) and the velocity (DGv) to the acceleration + // We can think of them as the first order approximation of the IS in term of acceleration + const SReal DGx = getPositionUpdateDerivedFromVelocity()*getVelocityUpdateDerivedFromAcceleration() + getPositionUpdateDerivedFromAcceleration(); + const SReal DGv = getVelocityUpdateDerivedFromAcceleration(); + + //Update position, velocity and acceleration w/r to unknown + acc.peq(m_unknown, alpha); + vel.peq(m_unknown, alpha * DGv); + pos.peq(m_unknown, alpha * DGx); + + //TODO make this work with alpha, iteration might be still 0 but we are in the linesearch algo and we don't want to remove this each time... + if (firstIteration) + { + vel.peq(m_r2, -1.0); + pos.peq(m_r1, -1.0); + + const SReal pudfv = getPositionUpdateDerivedFromVelocity(); + if ( fabs(pudfv) > std::numeric_limits::epsilon() ) + pos.peq(m_r2, -pudfv); + } +} + + + +SReal AccelerationBasedImplicitIntegrationScheme::getVelocityIntegrationFactor() const +{ + return getVelocityUpdateDerivedFromAcceleration(); +} + +SReal AccelerationBasedImplicitIntegrationScheme::getPositionIntegrationFactor() const +{ + //TODO not 100% sure this is what's expected. + //TODO But given what's in LinearSolverConstraintCorrection< DataTypes >::applyMotionCorrection it seems like it + return getPositionUpdateDerivedFromVelocity()*getVelocityUpdateDerivedFromAcceleration() + getPositionUpdateDerivedFromAcceleration(); +} + + + + +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.h new file mode 100644 index 00000000000..8f419ebafc8 --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/AccelerationBasedImplicitIntegrationScheme.h @@ -0,0 +1,93 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include + +#include +#include + +namespace sofa::simulation::integrationscheme +{ + +class SOFA_SIMULATION_CORE_API AccelerationBasedImplicitIntegrationScheme : + public ImplicitIntegrationScheme +{ +public: + SOFA_ABSTRACT_CLASS(AccelerationBasedImplicitIntegrationScheme, ImplicitIntegrationScheme); + + AccelerationBasedImplicitIntegrationScheme() = default; + + void doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override; + + /** + * Compute the system matrix. + */ + void computeLHS(bool firstIteration = false) override; + + /** + * compute the current RHS. + */ + void computeRHS(bool firstIteration = false) override; + + + /** + * Returns the evaluation of the residue + */ + virtual SReal evaluateResidue() override; + + + /** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ + void solveLinearEquation() override; + + /** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ + void updateStatesFromLinearSolution(SReal alpha, bool firstIteration = false) override; + + virtual SReal getVelocityIntegrationFactor() const final; + virtual SReal getPositionIntegrationFactor() const final; + +protected: + + virtual sofa::Size getIntegrationSchemeTimeOrder() const = 0; + + + virtual SReal getPositionUpdateDerivedFromAcceleration() const = 0; + virtual SReal getPositionUpdateDerivedFromVelocity() const = 0; + virtual SReal getVelocityUpdateDerivedFromAcceleration() const = 0; + + //Compute the error made on the position integration equation : x_{t+h} - g_x(v,a), with v and a the current estimates of velocity and acceleration + virtual void computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity, const sofa::core::MultiVecDerivId& acceleration) = 0; + //Compute the error made on the position integration equation : v_{t+h} - g_v(a), with a the current estimate of acceleration + virtual void computeCurrentVelocityIntegrationError(sofa::simulation::common::VectorOperations & vop, const sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& acceleration) = 0; +}; + +} // namespace sofa::component::integrationscheme diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.cpp new file mode 100644 index 00000000000..20c09cdc726 --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.cpp @@ -0,0 +1,42 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include + +#include + +namespace sofa::simulation::integrationscheme +{ + +void ExplicitIntegrationScheme::integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + m_dt = dt; + doIntegrate(params, xResult, vResult); +} + +} // namespace sofa::component::integrationscheme + + diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.h new file mode 100644 index 00000000000..c9ae99999ef --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ExplicitIntegrationScheme.h @@ -0,0 +1,58 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include + +#include + +namespace sofa::simulation::common +{ +class MechanicalOperations; +class VectorOperations; +} + +namespace sofa::simulation::integrationscheme +{ + +class SOFA_SIMULATION_CORE_API ExplicitIntegrationScheme : + public sofa::core::behavior::BaseIntegrationScheme, + public sofa::core::behavior::LinearSolverAccessor +{ +public: + SOFA_ABSTRACT_CLASS(ExplicitIntegrationScheme, sofa::core::behavior::BaseIntegrationScheme); + + ExplicitIntegrationScheme() = default; + virtual ~ExplicitIntegrationScheme() override = default ; + + virtual void integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) override final; + virtual void doIntegrate(const core::ExecParams* params, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) = 0 ; + + + +}; +} // namespace sofa::component::integrationscheme + + diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.cpp new file mode 100644 index 00000000000..e9ee04514b4 --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.cpp @@ -0,0 +1,71 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include + +#include +#include + +namespace sofa::simulation::integrationscheme +{ + + +ImplicitIntegrationScheme::ImplicitIntegrationScheme() +: d_rayleighStiffness(initData(&d_rayleighStiffness, 0.0_sreal, "rayleighStiffness", "Rayleigh damping coefficient related to stiffness, > 0") ) +, d_rayleighMass(initData(&d_rayleighMass, 0.0_sreal, "rayleighMass", "Rayleigh damping coefficient related to mass, > 0")) +, m_vop(nullptr) +, m_mop(nullptr) +{ + +} + +void ImplicitIntegrationScheme::setupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + + m_vop = std::make_shared( params, this->getContext() ); + m_mop = std::make_unique( params, this->getContext() ); + + m_params = params; + m_dt = dt; + m_xResult = xResult; + m_vResult = vResult; + + m_mappingGraph.build(this->getContext()); + + doSetupIntegrationStep(params, dt, xResult, vResult); + + +} + +void ImplicitIntegrationScheme::integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + setupIntegrationStep(params, dt, xResult, vResult); + computeRHS(true); + computeLHS(true); + solveLinearEquation(); + updateStatesFromLinearSolution(1.0, true); +} + +} \ No newline at end of file diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.h new file mode 100644 index 00000000000..920ac554ef3 --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/ImplicitIntegrationScheme.h @@ -0,0 +1,131 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include + +#include +#include +#include + +namespace sofa::simulation::common +{ +class MechanicalOperations; +class VectorOperations; +} + +namespace sofa::simulation::integrationscheme +{ + +class SOFA_SIMULATION_CORE_API ImplicitIntegrationScheme : + public sofa::core::behavior::BaseIntegrationScheme, + public sofa::core::behavior::LinearSolverAccessor +{ +public: + SOFA_ABSTRACT_CLASS(ImplicitIntegrationScheme, sofa::core::behavior::BaseIntegrationScheme); + + // WARNING we expect the linear integrator to initialize the working vecs. Meaning that if we + // work in FreeMotion, the xResult should already be equal to the actual position. + // Same for the velocity. This is expected when updating the position, only a += will be done. + virtual void setupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult); + virtual void doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) + { } + + ImplicitIntegrationScheme(); + + /** + * Compute the system matrix. + */ + virtual void computeLHS(bool firstIteration = false) = 0; + + /** + * compute the current RHS. + */ + virtual void computeRHS(bool firstIteration = false) = 0; + + + /** + * Returns the evaluation of the residue + */ + virtual SReal evaluateResidue() = 0; + + + /** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ + virtual void solveLinearEquation() = 0; + + /** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ + virtual void updateStatesFromLinearSolution(SReal alpha, bool firstIteration = false) = 0; + + virtual void integrate(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) ; + + + /// Given the solution dx of the linear system inversion, how much will it affect the velocity + /// + /// This method is used to compute the compliance for contact corrections + virtual SReal getVelocityIntegrationFactor() const = 0; + + /// Given the solution dx of the linear system inversion, how much will it affect the position + /// + /// This method is used to compute the compliance for contact corrections + virtual SReal getPositionIntegrationFactor() const = 0; + + Data d_rayleighStiffness; ///< Rayleigh damping coefficient related to stiffness, > 0 + Data d_rayleighMass; ///< Rayleigh damping coefficient related to mass, > 0 + + +protected: + + virtual sofa::Size getIntegrationSchemeTimeOrder() const = 0; + + + + const core::ExecParams* m_params; + sofa::core::MultiVecCoordId m_xResult; + sofa::core::MultiVecDerivId m_vResult; + sofa::core::MultiVecDerivId m_unknown; + + sofa::core::MultiVecDerivId m_r0, m_r1, m_r2; + + std::vector m_x0; + std::vector m_a0, m_v0; + + sofa::core::MultiVecDerivId m_acceleration; + + + std::shared_ptr m_vop; + std::unique_ptr m_mop; + + + sofa::simulation::MappingGraph m_mappingGraph; +}; +} // namespace sofa::component::integrationscheme + + diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.cpp new file mode 100644 index 00000000000..5dea194259a --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.cpp @@ -0,0 +1,278 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +using sofa::simulation::mechanicalvisitor::MechanicalGetNonDiagonalMassesCountVisitor; + +namespace sofa::simulation::integrationscheme +{ + +VelocityBasedImplicitIntegrationScheme::VelocityBasedImplicitIntegrationScheme() +: d_firstOrder(initData(&d_firstOrder, false, "firstOrder", "If true the coordinates derivative will not be integrated and considered null at the beginning of the solving.")) +{} + +void VelocityBasedImplicitIntegrationScheme::doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult) +{ + + // Make sure the states are following the sizes + simulation::common::VectorOperations::realloc(*m_vop, m_r0, "r0", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_r1, "r1", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_acceleration, "acceleration", this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_unknown, "dv", this, true); + + // Deal with higher order integration scheme + const Size order = getIntegrationSchemeTimeOrder(); + + m_x0.resize(order); + m_v0.resize(order); + + for (unsigned i = 0; i < order; ++i) + { + // If first order, don't add the subscript + simulation::common::VectorOperations::realloc(*m_vop, m_x0[i], "x0" + (order != 1 ? "_" + std::to_string(i) : ""), this, true); + simulation::common::VectorOperations::realloc(*m_vop, m_v0[i], "v0" + (order != 1 ? "_" + std::to_string(i) : ""), this,true); + + // Only at the start of the simulation, copy the position/velocity values inside the stored + // states to recreate the past + if (this->getTime() < std::numeric_limits::epsilon()) + { + sofa::core::behavior::MultiVecDeriv v0(m_vop.get(), m_v0[i]); + if (d_firstOrder.getValue()) + { + v0.clear(); + } + else + { + v0.eq(core::vec_id::write_access::velocity); + } + sofa::core::behavior::MultiVecCoord x0(m_vop.get(), m_x0[i]); + x0.eq(core::vec_id::write_access::position); + } + } + + // Now shift all states to advance in time (could be skipped at the start of the simulation) + // I decided not to do it to avoid having the check + for (unsigned i = 0; i < order - 1; ++i) + { + sofa::core::behavior::MultiVecCoord x(m_vop.get(), m_x0[i]); + x.eq(m_x0[i+1]); + if (!d_firstOrder.getValue()) + { + sofa::core::behavior::MultiVecDeriv v(m_vop.get(), m_v0[i]); + v.eq(m_v0[i+1]); + } + } + + // Store the previous state in its right position in the state vector + if (!d_firstOrder.getValue()) + { + sofa::core::behavior::MultiVecDeriv v0(m_vop.get(), m_v0[order - 1]); + v0.eq(core::vec_id::write_access::velocity); + } + sofa::core::behavior::MultiVecCoord x0(m_vop.get(), m_x0[order - 1]); + x0.eq(core::vec_id::write_access::position); + + + // This is only there for lagrangian based simulation, to make sure we start using the real pose + // instead of the free pos (same for velocity) + if (d_firstOrder.getValue()) + { + m_vop->v_clear(m_vResult); + m_vop->v_clear(core::vec_id::write_access::velocity); + } + else + { + m_vop->v_eq(m_vResult, core::vec_id::write_access::velocity); + } + m_vop->v_eq(m_xResult, core::vec_id::write_access::position); + +} + +/** + * Compute the system matrix. + */ +void VelocityBasedImplicitIntegrationScheme::computeLHS(bool firstIteration) +{ + SOFA_UNUSED(firstIteration); + + // Set the factor of the left hand side taking into account the rayleigh damping + SCOPED_TIMER("setSystemMBKMatrix"); + const core::MatricesFactors::M mFact( this->getInverseVelocityUpdateDerivedFromVelocity() + d_rayleighMass.getValue() ); + const core::MatricesFactors::B bFact( -1.0 ); + const core::MatricesFactors::K kFact( - this->getPositionUpdateDerivedFromVelocity() - d_rayleighStiffness.getValue() ); + + m_mop->setSystemMBKMatrix(mFact, bFact, kFact, l_linearSolver.get()); + + +} + +/** +* compute the current RHS. +*/ +void VelocityBasedImplicitIntegrationScheme::computeRHS(bool firstIteration) +{ + // Make sure no one modified this + m_mop->cparams.setX(m_xResult); + m_mop->cparams.setV(m_vResult); + + sofa::core::behavior::MultiVecDeriv f(m_vop.get(), core::vec_id::write_access::force ); + // Let's make sure f is cleared between each Newton steps + f.clear(); + // The other one don't need to be clear as they are recomputed and not updated by the real IS impl + + { + SCOPED_TIMER("ComputeForce"); + m_mop->mparams.setImplicit(true); // this solver is implicit + // compute the net forces at the beginning of the time step + m_mop->computeForce(m_mappingGraph, f, true, true, nullptr); + } + + { + SCOPED_TIMER("ComputeRHTerm"); + m_vop->v_eq(m_r0, f, 1.0); + + auto backV = m_mop->mparams.v(); + + // This computes the explicit part of the Rayleigh damping + // If we are in first order, in the first iteration there is no need to add this damping + if ( (! d_firstOrder.getValue() || !firstIteration) && (fabs(d_rayleighMass.getValue()) > std::numeric_limits::epsilon() + || fabs(d_rayleighStiffness.getValue()) > std::numeric_limits::epsilon())) + { + m_mop->mparams.setV(m_vResult); + + m_mop->addMBKv(m_mappingGraph,m_r0, core::MatricesFactors::M(-d_rayleighMass.getValue()), + core::MatricesFactors::B(0), + core::MatricesFactors::K(d_rayleighStiffness.getValue())); + } + + // R1 should be equal to 0 in theory when integration scheme is linear. But let's recompute + // it anyway to compute the residue + computeCurrentPositionIntegrationError(*m_vop, m_r1, m_xResult, m_vResult); + if (firstIteration) + { + m_mop->mparams.setV(m_r1); + m_mop->addMBKv(m_mappingGraph,m_r0, core::MatricesFactors::M(0.0), + core::MatricesFactors::B(0), + core::MatricesFactors::K(-1.0)); + } + + // If we are in first order, in the first iteration acceleration is null + if (! d_firstOrder.getValue() || !firstIteration) + { + // In velocity-based IS the acceleration is not integrated but estimated using first order + // backward finite difference on the velocity + computeAccelerationFromVelocity(*m_vop, m_acceleration, m_vResult); + m_mop->mparams.setV(m_acceleration); + m_mop->addMBKv(m_mappingGraph,m_r0, core::MatricesFactors::M(-1.0), + core::MatricesFactors::B(0), + core::MatricesFactors::K(0)); + } + + m_mop->mparams.setV(backV); + + // Set the factor of the left hand side taking into account the rayleigh damping + // Apply projective constraints to the full residue + m_mop->projectResponse(m_mappingGraph,m_r0); + m_mop->projectResponse(m_mappingGraph,m_r1); + } + +} + + +/** + * Returns the evaluation of the residue + */ +SReal VelocityBasedImplicitIntegrationScheme::evaluateResidue() +{ + sofa::simulation::common::VectorOperations vop( m_params, this->getContext() ); + + core::behavior::MultiVecDeriv r0(m_vop.get(), m_r0); + core::behavior::MultiVecDeriv r1(m_vop.get(), m_r1); + + return r0.dot(r0) + r1.dot(r1); +} + + +/** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ +void VelocityBasedImplicitIntegrationScheme::solveLinearEquation() +{ + SCOPED_TIMER("MBKSolve"); + l_linearSolver->getLinearSystem()->setSystemSolution(m_unknown); + l_linearSolver->getLinearSystem()->setRHS(m_r0); + l_linearSolver->solveSystem(); + l_linearSolver->getLinearSystem()->dispatchSystemSolution(m_unknown); +} + +/** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ +void VelocityBasedImplicitIntegrationScheme::updateStatesFromLinearSolution(SReal alpha, bool firstIteration) +{ + sofa::core::behavior::MultiVecCoord pos(m_vop.get(), m_xResult); + sofa::core::behavior::MultiVecDeriv vel(m_vop.get(), m_vResult ); + + //Update position w/r to unknown + pos.peq(m_unknown, alpha * getPositionUpdateDerivedFromVelocity()); + + //TODO make this work with alpha, iteration might be still 0 but we are in the linesearch algo and we don't want to remove this each time... + // R1 should be equal to 0, avoids computation + // If in first order this is 0 at first iteration too + if (!d_firstOrder.getValue() && firstIteration) + { + //Update position w/r R1 + pos.peq(m_r1, -1.0); + } + + if (d_firstOrder.getValue() && firstIteration) + { + // If we are at first iteration in first order case, we need to enforce the velocity to be 0 + vel.eq(m_unknown, alpha); + } + else + { + // Accumulate the velocity + vel.peq(m_unknown, alpha); + } +} + + +SReal VelocityBasedImplicitIntegrationScheme::getVelocityIntegrationFactor() const +{ + return 1.0_sreal; +} + +SReal VelocityBasedImplicitIntegrationScheme::getPositionIntegrationFactor() const +{ + return getPositionUpdateDerivedFromVelocity(); +} + +} // namespace sofa::component::integrationscheme::forward diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.h new file mode 100644 index 00000000000..5cdbdea7b1c --- /dev/null +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/integrationscheme/VelocityBasedImplicitIntegrationScheme.h @@ -0,0 +1,98 @@ +/****************************************************************************** +* SOFA, Simulation Open-Framework Architecture * +* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * +* * +* This program 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 program 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 program. If not, see . * +******************************************************************************* +* Authors: The SOFA Team and external contributors (see Authors.txt) * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#pragma once +#include + +#include +#include +#include + +#include + +#include +#include + +namespace sofa::simulation::integrationscheme +{ + +class SOFA_SIMULATION_CORE_API VelocityBasedImplicitIntegrationScheme : + public ImplicitIntegrationScheme +{ +public: + SOFA_ABSTRACT_CLASS(VelocityBasedImplicitIntegrationScheme, ImplicitIntegrationScheme); + + Data d_firstOrder; + + + VelocityBasedImplicitIntegrationScheme(); + + virtual void doSetupIntegrationStep(const core::ExecParams* params, SReal dt, sofa::core::MultiVecCoordId xResult, sofa::core::MultiVecDerivId vResult); + + /** + * Compute the system matrix. + */ + virtual void computeLHS(bool firstIteration = false); + + /** + * compute the current RHS. + */ + virtual void computeRHS(bool firstIteration = false); + + + /** + * Returns the evaluation of the residue + */ + virtual SReal evaluateResidue() override; + + + /** + * Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). + */ + virtual void solveLinearEquation(); + + /** + * Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current + * guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is + * not necessary to share the result with the Newton-Raphson method. + */ + virtual void updateStatesFromLinearSolution(SReal alpha, bool firstIteration = false); + + virtual SReal getVelocityIntegrationFactor() const final; + virtual SReal getPositionIntegrationFactor() const final; + +protected: + + + virtual sofa::Size getIntegrationSchemeTimeOrder() const = 0; + + virtual SReal getPositionUpdateDerivedFromVelocity() const = 0; + virtual SReal getInverseVelocityUpdateDerivedFromVelocity() const = 0; + + //Compute the error made on the position integration equation : x_{t+h} - g_x(v), with v the current estimate of velocity + virtual void computeCurrentPositionIntegrationError(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecCoordId& position, const sofa::core::MultiVecDerivId& velocity) = 0; + //Compute the acceleration from current value of velocity. This is the implementation of the inverse integration scheme for the velocity + virtual void computeAccelerationFromVelocity(sofa::simulation::common::VectorOperations & vop, sofa::core::MultiVecDerivId& result, const sofa::core::MultiVecDerivId& velocity) = 0; + + +}; + +} // namespace sofa::component::integrationscheme diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrateConstraintVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrateConstraintVisitor.h index 9aa9504435c..772262e41f8 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrateConstraintVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrateConstraintVisitor.h @@ -30,8 +30,8 @@ class SOFA_SIMULATION_CORE_API MechanicalIntegrateConstraintsVisitor : public Ba { public: const sofa::core::ConstraintParams* cparams; - const double positionFactor;///< use the OdeSolver to get the position integration factor - const double velocityFactor;///< use the OdeSolver to get the position integration factor + const double positionFactor;///< use the IntegrationScheme to get the position integration factor + const double velocityFactor;///< use the IntegrationScheme to get the position integration factor sofa::core::ConstMultiVecDerivId correctionId; sofa::core::MultiVecDerivId dxId; sofa::core::MultiVecCoordId xId; diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.cpp index f5ed9c38786..1a0448a7c1b 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.cpp @@ -22,7 +22,7 @@ #include -#include +#include #include #include #include @@ -37,7 +37,7 @@ namespace sofa::simulation::mechanicalvisitor { -Visitor::Result MechanicalIntegrationVisitor::fwdOdeSolver(simulation::Node* node, core::behavior::OdeSolver* obj) +Visitor::Result MechanicalIntegrationVisitor::fwdIntegrationScheme(simulation::Node* node, core::behavior::BaseIntegrationScheme* obj) { SReal nextTime = node->getTime() + dt; MechanicalBeginIntegrationVisitor beginVisitor( this->params, dt ); @@ -58,7 +58,7 @@ Visitor::Result MechanicalIntegrationVisitor::fwdOdeSolver(simulation::Node* nod accumulateMatrixDeriv.execute(node); } - obj->solve(params, dt); + obj->integrate(params, dt, sofa::core::vec_id::write_access::position, sofa::core::vec_id::write_access::velocity); MechanicalProjectPositionAndVelocityVisitor(&mparams, nextTime,core::vec_id::write_access::position,core::vec_id::write_access::velocity ).execute( node ); diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.h index 9ef0fa5a343..def0891f2b4 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalIntegrationVisitor.h @@ -26,7 +26,7 @@ namespace sofa::simulation::mechanicalvisitor { -/** Visitor used to do a time integration step using OdeSolvers +/** Visitor used to do a time integration step using IntegrationScheme */ class SOFA_SIMULATION_CORE_API MechanicalIntegrationVisitor : public BaseMechanicalVisitor { @@ -36,7 +36,7 @@ class SOFA_SIMULATION_CORE_API MechanicalIntegrationVisitor : public BaseMechani : BaseMechanicalVisitor(m_params) , dt(_dt) {} - Result fwdOdeSolver(simulation::Node* node,sofa::core::behavior::OdeSolver* obj) override; + Result fwdIntegrationScheme(simulation::Node* node, sofa::core::behavior::BaseIntegrationScheme* obj) override; Result fwdInteractionForceField(simulation::Node*,sofa::core::behavior::BaseInteractionForceField* obj) override; /// Return a class name for this visitor diff --git a/Sofa/framework/Simulation/Core/tests/ProjectedGaussSeidelConstraintSolver_test.cpp b/Sofa/framework/Simulation/Core/tests/ProjectedGaussSeidelConstraintSolver_test.cpp index 38046e06768..0c845c28ddd 100644 --- a/Sofa/framework/Simulation/Core/tests/ProjectedGaussSeidelConstraintSolver_test.cpp +++ b/Sofa/framework/Simulation/Core/tests/ProjectedGaussSeidelConstraintSolver_test.cpp @@ -52,7 +52,7 @@ struct BlockGaussSeidelConstraintSolver_test : BaseSimulationTest " \n" " \n" " \n" - " \n" + " \n" " \n" "\n" ); diff --git a/Sofa/framework/Simulation/simutest/parallel_scenes_test.cpp b/Sofa/framework/Simulation/simutest/parallel_scenes_test.cpp index ce7dd52a81d..7d13bb0e8ed 100644 --- a/Sofa/framework/Simulation/simutest/parallel_scenes_test.cpp +++ b/Sofa/framework/Simulation/simutest/parallel_scenes_test.cpp @@ -61,7 +61,7 @@ class ParallelScenesTest : public virtual sofa::testing::BaseTest Sofa.Component.LinearSolver.Iterative, Sofa.Component.Mapping.Linear, Sofa.Component.Mass, - Sofa.Component.ODESolver.Backward, + Sofa.Component.IntegrationScheme.Backward, Sofa.Component.SolidMechanics.FEM.Elastic, Sofa.Component.StateContainer, Sofa.Component.Topology.Container.Constant, @@ -139,7 +139,7 @@ class ParallelScenesTest : public virtual sofa::testing::BaseTest - + @@ -191,13 +191,13 @@ class ParallelScenesTest : public virtual sofa::testing::BaseTest - + - + diff --git a/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedArm/robot.py b/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedArm/robot.py index a8e7179a80f..a9d4544e3f9 100644 --- a/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedArm/robot.py +++ b/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedArm/robot.py @@ -79,7 +79,7 @@ def addRobot(self, name='Robot', translation=[0,0,0]): # Robot node robot = self.node.addChild(name) robot.addData('angles', initAngles, None, 'angle of articulations in radian', '', 'vector') - robot.addObject('EulerImplicitSolver') + robot.addObject('EulerImplicitIntegrationScheme') robot.addObject('SparseLDLSolver', template="CompressedRowSparseMatrixMat3x3d") robot.addObject('GenericConstraintCorrection') diff --git a/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedSystemMapping.scn b/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedSystemMapping.scn index 95813cb4e0f..7ae587f1816 100644 --- a/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedSystemMapping.scn +++ b/applications/plugins/ArticulatedSystemPlugin/examples/ArticulatedSystemMapping.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/applications/plugins/BulletCollisionDetection/examples/BulletConvexHullDemo.scn b/applications/plugins/BulletCollisionDetection/examples/BulletConvexHullDemo.scn index b4aa29536c4..0304efd0199 100644 --- a/applications/plugins/BulletCollisionDetection/examples/BulletConvexHullDemo.scn +++ b/applications/plugins/BulletCollisionDetection/examples/BulletConvexHullDemo.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/applications/plugins/BulletCollisionDetection/examples/BulletLMDragon.scn b/applications/plugins/BulletCollisionDetection/examples/BulletLMDragon.scn index 5d74880c4a5..e4978a94b0f 100644 --- a/applications/plugins/BulletCollisionDetection/examples/BulletLMDragon.scn +++ b/applications/plugins/BulletCollisionDetection/examples/BulletLMDragon.scn @@ -6,7 +6,7 @@ - + diff --git a/applications/plugins/BulletCollisionDetection/examples/BulletSphere.scn b/applications/plugins/BulletCollisionDetection/examples/BulletSphere.scn index 50459309010..0299b9a781f 100644 --- a/applications/plugins/BulletCollisionDetection/examples/BulletSphere.scn +++ b/applications/plugins/BulletCollisionDetection/examples/BulletSphere.scn @@ -9,7 +9,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.scn b/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.scn index 6517bcf3a33..4fcee2311b7 100644 --- a/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.scn +++ b/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.scn @@ -6,7 +6,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/CollisionGroups.scn b/applications/plugins/CollisionOBBCapsule/examples/CollisionGroups.scn index 6efed79fbe5..a9b379b88ff 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/CollisionGroups.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/CollisionGroups.scn @@ -15,7 +15,7 @@ in the group 1, therefore cubes collide with it. - + @@ -34,7 +34,7 @@ in the group 1, therefore cubes collide with it. - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCap.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCap.scn index b3df5b21334..74820369fb9 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCap.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCap.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCap1.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCap1.scn index a344b7bd864..4e901873112 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCap1.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCap1.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeEdge.scn index f7c20deeb75..9bfbe472d28 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeEdge.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeVertex.scn index 7eec73894c2..9451afe0c06 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCapEdgeVertex.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexEdge.scn index acbb7ea3f2d..d90d92d955f 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexEdge.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexVertex.scn index f6c4d9ba2fc..7a447cd63b4 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBCapVertexVertex.scn @@ -8,7 +8,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBB.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBB.scn index 70d07f8e9d4..dc3bbb9a3ef 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBB.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBB.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBB2.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBB2.scn index 72355a1b3e2..1b38bb31c8c 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBB2.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBB2.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBAlea.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBAlea.scn index 19af2ab6e8f..e44a6d6e712 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBAlea.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBAlea.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBCollision.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBCollision.scn index 8945d1fa158..22855729ed2 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBCollision.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBCollision.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeEdge.scn index 053b8ef12e8..efb217496dc 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeEdge.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeVertex.scn index a4e7484580a..d169da4b19f 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBEdgeVertex.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBFaceEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBFaceEdge.scn index 2b2e8c74296..f9a76bd2ece 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBFaceEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBFaceEdge.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBVertexVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBVertexVertex.scn index 39c97293562..3a62ce1a333 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBOBBVertexVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBOBBVertexVertex.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBSphere.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBSphere.scn index 3911a0edbaf..95826de8e42 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBSphere.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBSphere.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBSphere2.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBSphere2.scn index 085444d8a52..0298a7ece4d 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBSphere2.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBSphere2.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBSphereEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBSphereEdge.scn index 0fe78752ae9..1687fece2c0 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBSphereEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBSphereEdge.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBSphereVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBSphereVertex.scn index c577d421726..fbbb1f9c445 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBSphereVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBSphereVertex.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTri.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTri.scn index 4dbdac30375..20ee71d7174 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTri.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTri.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge.scn index 67c497d061b..e68cbb8428c 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge2.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge2.scn index 90034a1e73f..078c052e748 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge2.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeEdge2.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeVerex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeVerex.scn index 4f7f0256cd1..fda14254500 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeVerex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriEdgeVerex.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriFaceVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriFaceVertex.scn index 66cf87d8891..48bcc128015 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriFaceVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriFaceVertex.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexEdge.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexEdge.scn index bdeaed46d39..e9ba48061fd 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexEdge.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexEdge.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexFace.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexFace.scn index 58a6f8e63c5..4823a488012 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexFace.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexFace.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexVertex.scn b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexVertex.scn index a43d0967bbb..7da1786a20a 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexVertex.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/OBBTriVertexVertex.scn @@ -9,7 +9,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.pscn b/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.pscn index 34ea59eae46..50fc46829b3 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.pscn +++ b/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.pscn @@ -22,7 +22,7 @@ - + @@ -63,13 +63,13 @@ ';?> - + ';?> - + diff --git a/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.scn b/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.scn index 4841fc7af6c..ae4658af6e7 100644 --- a/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.scn +++ b/applications/plugins/CollisionOBBCapsule/examples/benchmark_cubes.scn @@ -12,7 +12,7 @@ - + @@ -36,14 +36,14 @@ - + - + @@ -51,7 +51,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -107,7 +107,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -155,7 +155,7 @@ - + @@ -163,7 +163,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -187,7 +187,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -227,7 +227,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -251,7 +251,7 @@ - + @@ -259,7 +259,7 @@ - + @@ -267,7 +267,7 @@ - + @@ -275,7 +275,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -291,7 +291,7 @@ - + @@ -299,7 +299,7 @@ - + @@ -307,7 +307,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -323,7 +323,7 @@ - + @@ -331,7 +331,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -347,7 +347,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -371,7 +371,7 @@ - + @@ -379,7 +379,7 @@ - + @@ -387,7 +387,7 @@ - + @@ -395,7 +395,7 @@ - + @@ -403,7 +403,7 @@ - + @@ -411,7 +411,7 @@ - + @@ -419,7 +419,7 @@ - + @@ -427,7 +427,7 @@ - + @@ -435,7 +435,7 @@ - + @@ -443,7 +443,7 @@ - + @@ -451,7 +451,7 @@ - + @@ -459,7 +459,7 @@ - + @@ -467,7 +467,7 @@ - + @@ -475,7 +475,7 @@ - + @@ -483,7 +483,7 @@ - + @@ -491,7 +491,7 @@ - + @@ -499,7 +499,7 @@ - + @@ -507,7 +507,7 @@ - + @@ -515,7 +515,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -531,7 +531,7 @@ - + @@ -539,7 +539,7 @@ - + @@ -547,7 +547,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -563,7 +563,7 @@ - + @@ -571,7 +571,7 @@ - + @@ -579,7 +579,7 @@ - + @@ -587,7 +587,7 @@ - + @@ -595,7 +595,7 @@ - + @@ -603,7 +603,7 @@ - + @@ -611,7 +611,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-DeformableCubes.scn b/applications/plugins/Geomagic/scenes/Geomagic-DeformableCubes.scn index 0a5730c71b1..673a430fb83 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-DeformableCubes.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-DeformableCubes.scn @@ -16,7 +16,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -120,7 +120,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-DeformableSphere.scn b/applications/plugins/Geomagic/scenes/Geomagic-DeformableSphere.scn index 7c0e8736631..3ffa38e7ecd 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-DeformableSphere.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-DeformableSphere.scn @@ -16,7 +16,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -99,7 +99,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn b/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn index 6103b3cf538..da3b9bfaa7b 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn @@ -16,7 +16,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-RigidCubes.scn b/applications/plugins/Geomagic/scenes/Geomagic-RigidCubes.scn index a7d604966f9..2745fa587cc 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-RigidCubes.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-RigidCubes.scn @@ -15,7 +15,7 @@ - + @@ -82,7 +82,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull-restShapeSpringForceField.scn b/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull-restShapeSpringForceField.scn index dc385af9c26..7aa7daa3455 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull-restShapeSpringForceField.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull-restShapeSpringForceField.scn @@ -13,7 +13,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull.scn b/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull.scn index 6178e9c3938..f8a8dde84f6 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull.scn @@ -14,7 +14,7 @@ - + @@ -79,7 +79,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/Geomagic-RigidSphere.scn b/applications/plugins/Geomagic/scenes/Geomagic-RigidSphere.scn index b1408de766e..6a6f4f16f08 100644 --- a/applications/plugins/Geomagic/scenes/Geomagic-RigidSphere.scn +++ b/applications/plugins/Geomagic/scenes/Geomagic-RigidSphere.scn @@ -14,7 +14,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/applications/plugins/Geomagic/scenes/GeomagicEmulator-RigidCubes.scn b/applications/plugins/Geomagic/scenes/GeomagicEmulator-RigidCubes.scn index 54414fdea88..19b93a98039 100644 --- a/applications/plugins/Geomagic/scenes/GeomagicEmulator-RigidCubes.scn +++ b/applications/plugins/Geomagic/scenes/GeomagicEmulator-RigidCubes.scn @@ -15,7 +15,7 @@ - + @@ -82,7 +82,7 @@ - + diff --git a/applications/plugins/Haption/examples/haption1.scn b/applications/plugins/Haption/examples/haption1.scn index 7bfb9cb29c0..5b96f3539cf 100644 --- a/applications/plugins/Haption/examples/haption1.scn +++ b/applications/plugins/Haption/examples/haption1.scn @@ -11,7 +11,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/applications/plugins/Haption/examples/temp1.scn b/applications/plugins/Haption/examples/temp1.scn index 2fb19d34380..3790345e581 100644 --- a/applications/plugins/Haption/examples/temp1.scn +++ b/applications/plugins/Haption/examples/temp1.scn @@ -11,7 +11,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/applications/plugins/LeapMotion/examples/buffoon.scn b/applications/plugins/LeapMotion/examples/buffoon.scn index 5a4a5749dba..aaa84549f09 100644 --- a/applications/plugins/LeapMotion/examples/buffoon.scn +++ b/applications/plugins/LeapMotion/examples/buffoon.scn @@ -17,7 +17,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/5DeformableCubesConstraints.scn b/applications/plugins/MultiThreading/examples/5DeformableCubesConstraints.scn index 7a61b24264e..930502113d6 100644 --- a/applications/plugins/MultiThreading/examples/5DeformableCubesConstraints.scn +++ b/applications/plugins/MultiThreading/examples/5DeformableCubesConstraints.scn @@ -17,7 +17,7 @@ In this scene, collision is detected in parallel. - + @@ -40,7 +40,7 @@ In this scene, collision is detected in parallel. - + @@ -48,7 +48,7 @@ In this scene, collision is detected in parallel. - + @@ -74,7 +74,7 @@ In this scene, collision is detected in parallel. - + @@ -82,7 +82,7 @@ In this scene, collision is detected in parallel. - + @@ -108,7 +108,7 @@ In this scene, collision is detected in parallel. - + @@ -116,7 +116,7 @@ In this scene, collision is detected in parallel. - + @@ -142,7 +142,7 @@ In this scene, collision is detected in parallel. - + @@ -150,7 +150,7 @@ In this scene, collision is detected in parallel. - + @@ -177,7 +177,7 @@ In this scene, collision is detected in parallel. - + @@ -185,7 +185,7 @@ In this scene, collision is detected in parallel. - + diff --git a/applications/plugins/MultiThreading/examples/BeamLinearMapping_mt.scn b/applications/plugins/MultiThreading/examples/BeamLinearMapping_mt.scn index fd1a19866b7..766aeda92ee 100644 --- a/applications/plugins/MultiThreading/examples/BeamLinearMapping_mt.scn +++ b/applications/plugins/MultiThreading/examples/BeamLinearMapping_mt.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + - + @@ -48,7 +48,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -58,7 +58,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -68,7 +68,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -78,7 +78,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -88,7 +88,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -98,7 +98,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -108,7 +108,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -118,7 +118,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -128,7 +128,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -138,7 +138,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -148,7 +148,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -158,7 +158,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -168,7 +168,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -178,7 +178,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -188,7 +188,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -198,7 +198,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -208,7 +208,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -218,7 +218,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -228,7 +228,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -238,7 +238,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -248,7 +248,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -258,7 +258,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -268,7 +268,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -278,7 +278,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -288,7 +288,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -298,7 +298,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -308,7 +308,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -318,7 +318,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -328,7 +328,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -338,7 +338,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -348,7 +348,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -358,7 +358,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -368,7 +368,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -378,7 +378,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -388,7 +388,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -398,7 +398,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -408,7 +408,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -418,7 +418,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -428,7 +428,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -438,7 +438,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -448,7 +448,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -458,7 +458,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -468,7 +468,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -478,7 +478,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -488,7 +488,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -498,7 +498,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -508,7 +508,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -518,7 +518,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -528,7 +528,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -538,7 +538,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -548,7 +548,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -558,7 +558,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -568,7 +568,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -578,7 +578,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -588,7 +588,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -598,7 +598,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -608,7 +608,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -618,7 +618,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -628,7 +628,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -638,7 +638,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -648,7 +648,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -658,7 +658,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -668,7 +668,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -678,7 +678,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -688,7 +688,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -698,7 +698,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -708,7 +708,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -718,7 +718,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -728,7 +728,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -738,7 +738,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + @@ -748,7 +748,7 @@ On a CPU with 6 cores, each core tests 3906 pairs of collision models. - + diff --git a/applications/plugins/MultiThreading/examples/ParallelCGLinearSolver.scn b/applications/plugins/MultiThreading/examples/ParallelCGLinearSolver.scn index 3bc2f70be84..7905b3331a4 100644 --- a/applications/plugins/MultiThreading/examples/ParallelCGLinearSolver.scn +++ b/applications/plugins/MultiThreading/examples/ParallelCGLinearSolver.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/ParallelCollisionDetection.scn b/applications/plugins/MultiThreading/examples/ParallelCollisionDetection.scn index ed95b2ee1ed..76ad02059a6 100644 --- a/applications/plugins/MultiThreading/examples/ParallelCollisionDetection.scn +++ b/applications/plugins/MultiThreading/examples/ParallelCollisionDetection.scn @@ -8,7 +8,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/ParallelHexahedronFEMForceField.scn b/applications/plugins/MultiThreading/examples/ParallelHexahedronFEMForceField.scn index ee9c166715e..056c315eb49 100644 --- a/applications/plugins/MultiThreading/examples/ParallelHexahedronFEMForceField.scn +++ b/applications/plugins/MultiThreading/examples/ParallelHexahedronFEMForceField.scn @@ -5,7 +5,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/ParallelMeshSpringForceField.scn b/applications/plugins/MultiThreading/examples/ParallelMeshSpringForceField.scn index 42cd9d090b9..42670cd69b3 100644 --- a/applications/plugins/MultiThreading/examples/ParallelMeshSpringForceField.scn +++ b/applications/plugins/MultiThreading/examples/ParallelMeshSpringForceField.scn @@ -15,7 +15,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/ParallelTetrahedronFEMForceField.scn b/applications/plugins/MultiThreading/examples/ParallelTetrahedronFEMForceField.scn index c348d69bcb8..b053c6a84f4 100644 --- a/applications/plugins/MultiThreading/examples/ParallelTetrahedronFEMForceField.scn +++ b/applications/plugins/MultiThreading/examples/ParallelTetrahedronFEMForceField.scn @@ -4,7 +4,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/TriangularForceFieldComparison.scn b/applications/plugins/MultiThreading/examples/TriangularForceFieldComparison.scn index da0e2660c9c..e316c357dc2 100644 --- a/applications/plugins/MultiThreading/examples/TriangularForceFieldComparison.scn +++ b/applications/plugins/MultiThreading/examples/TriangularForceFieldComparison.scn @@ -10,7 +10,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -121,7 +121,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/livers.scn b/applications/plugins/MultiThreading/examples/livers.scn index 09a06773b5c..0787b0fcfb0 100644 --- a/applications/plugins/MultiThreading/examples/livers.scn +++ b/applications/plugins/MultiThreading/examples/livers.scn @@ -12,7 +12,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -130,7 +130,7 @@ - + diff --git a/applications/plugins/MultiThreading/examples/liversMeanPositions.scn b/applications/plugins/MultiThreading/examples/liversMeanPositions.scn index ed1feeee82b..9f976fb044d 100644 --- a/applications/plugins/MultiThreading/examples/liversMeanPositions.scn +++ b/applications/plugins/MultiThreading/examples/liversMeanPositions.scn @@ -12,7 +12,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/applications/plugins/MultiThreading/src/MultiThreading/CollisionAnimationLoop_mt.h b/applications/plugins/MultiThreading/src/MultiThreading/CollisionAnimationLoop_mt.h index 55e28483168..fd6deb0b372 100644 --- a/applications/plugins/MultiThreading/src/MultiThreading/CollisionAnimationLoop_mt.h +++ b/applications/plugins/MultiThreading/src/MultiThreading/CollisionAnimationLoop_mt.h @@ -106,11 +106,11 @@ class CollisionAnimationLoop_mt : public sofa::core::behavior::BaseAnimationLoop virtual void collisionResponse(const core::ExecParams* params = core::execparams::defaultInstance()); - /// Activate OdeSolvers + /// Activate IntegrationScheme virtual void integrate(const core::ExecParams* params /* PARAMS FIRST = core::execparams::defaultInstance()*/, double dt); - typedef simulation::Node::Sequence Solvers; + typedef simulation::Node::Sequence Solvers; typedef core::collision::Pipeline Pipeline; const Solvers& getSolverSequence(); diff --git a/applications/plugins/PersistentContact/examples/grasping.scn b/applications/plugins/PersistentContact/examples/grasping.scn index 7d735b6f864..7fcd1ae6b93 100644 --- a/applications/plugins/PersistentContact/examples/grasping.scn +++ b/applications/plugins/PersistentContact/examples/grasping.scn @@ -16,7 +16,7 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp index 0d02ce1b34a..a22d4d2e1e7 100644 --- a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp +++ b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp @@ -88,16 +88,16 @@ Node::SPtr createEulerSolverNode(Node::SPtr parent, const std::string& name, co if (scheme == "Explicit") { - simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.ODESolver.Forward}}); - simpleapi::createObject(node, "EulerExplicitSolver", {{"name","Euler Explicit"}}); + simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.IntegrationScheme.Forward}}); + simpleapi::createObject(node, "EulerExplicitIntegrationScheme", {{"name","Euler Explicit"}}); return node ; } if (scheme == "Implicit") { - simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.ODESolver.Backward}}); + simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.IntegrationScheme.Backward}}); simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.LinearSolver.Iterative}}); - simpleapi::createObject(node, "EulerImplicitSolver", {{"name","Euler Implicit"}, + simpleapi::createObject(node, "EulerImplicitIntegrationScheme", {{"name","Euler Implicit"}, {"rayleighStiffness","0.01"}, {"rayleighMass", "1.0"}}) ; simpleapi::createObject(node, "CGLinearSolver", {{"name","Conjugate Gradient"}, @@ -110,9 +110,9 @@ Node::SPtr createEulerSolverNode(Node::SPtr parent, const std::string& name, co if (scheme == "Implicit_SparseLDL") { - simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.ODESolver.Backward}}); + simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.IntegrationScheme.Backward}}); simpleapi::createObject(parent, "RequiredPlugin", {{"pluginName", Sofa.Component.LinearSolver.Direct}}); - simpleapi::createObject(node, "EulerImplicitSolver", {{"name","Euler Implicit"}, + simpleapi::createObject(node, "EulerImplicitIntegrationScheme", {{"name","Euler Implicit"}, {"rayleighStiffness","0.01"}, {"rayleighMass", "1.0"}}) ; diff --git a/applications/plugins/Sensable/examples/Carving.scn b/applications/plugins/Sensable/examples/Carving.scn index 75749c74e73..c954a78f49c 100644 --- a/applications/plugins/Sensable/examples/Carving.scn +++ b/applications/plugins/Sensable/examples/Carving.scn @@ -15,7 +15,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Deformable-Method1.scn b/applications/plugins/Sensable/examples/Deformable-Method1.scn index fb926e8b327..d82bc26577d 100644 --- a/applications/plugins/Sensable/examples/Deformable-Method1.scn +++ b/applications/plugins/Sensable/examples/Deformable-Method1.scn @@ -11,7 +11,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid.scn index a008f037962..602867a39f0 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid.scn @@ -56,7 +56,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid_teeth.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid_teeth.scn index 1e9c25b482b..c92e2efd0b4 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid_teeth.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryDistanceGrid_teeth.scn @@ -79,7 +79,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCP.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCP.scn index 4ef888cfec1..5a8e81558be 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCP.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCP.scn @@ -63,7 +63,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCPNewOmni.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCPNewOmni.scn index eafaf3e8fba..60a464d2610 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCPNewOmni.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgeryLCPNewOmni.scn @@ -24,7 +24,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_06.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_06.scn index 32387e88e28..1ada41ea550 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_06.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_06.scn @@ -53,7 +53,7 @@ Using LCP contact detection and resolution: - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_07.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_07.scn index c3c21e1fc18..3cb045d401a 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_07.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_07.scn @@ -24,7 +24,7 @@ Using LCP contact detection and resolution: - + @@ -65,7 +65,7 @@ Using LCP contact detection and resolution: - + diff --git a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_08.scn b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_08.scn index 3c4fa974182..a9a21d58f22 100644 --- a/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_08.scn +++ b/applications/plugins/Sensable/examples/Dentistry/dentalSurgery_08.scn @@ -30,7 +30,7 @@ Using LCP contact detection and resolution: - + @@ -79,7 +79,7 @@ Using LCP contact detection and resolution: - + diff --git a/applications/plugins/Sensable/examples/Old Examples/flexibleRaptor.scn b/applications/plugins/Sensable/examples/Old Examples/flexibleRaptor.scn index 6f4f1402805..dc0f5159ae7 100644 --- a/applications/plugins/Sensable/examples/Old Examples/flexibleRaptor.scn +++ b/applications/plugins/Sensable/examples/Old Examples/flexibleRaptor.scn @@ -18,7 +18,7 @@ - + @@ -62,7 +62,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Old Examples/omni-probing-liver.scn b/applications/plugins/Sensable/examples/Old Examples/omni-probing-liver.scn index 44ecc5f6c03..b9fb3590919 100644 --- a/applications/plugins/Sensable/examples/Old Examples/omni-probing-liver.scn +++ b/applications/plugins/Sensable/examples/Old Examples/omni-probing-liver.scn @@ -16,7 +16,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Old Examples/omni1.scn b/applications/plugins/Sensable/examples/Old Examples/omni1.scn index e1d455b8cc0..2b3d4b7ab15 100644 --- a/applications/plugins/Sensable/examples/Old Examples/omni1.scn +++ b/applications/plugins/Sensable/examples/Old Examples/omni1.scn @@ -16,7 +16,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Old Examples/omni2.scn b/applications/plugins/Sensable/examples/Old Examples/omni2.scn index 185f4cff90b..22cf72c2146 100644 --- a/applications/plugins/Sensable/examples/Old Examples/omni2.scn +++ b/applications/plugins/Sensable/examples/Old Examples/omni2.scn @@ -11,7 +11,7 @@ - + diff --git a/applications/plugins/Sensable/examples/Old Examples/raptor.scn b/applications/plugins/Sensable/examples/Old Examples/raptor.scn index 7d62b3451b4..576a87d3532 100644 --- a/applications/plugins/Sensable/examples/Old Examples/raptor.scn +++ b/applications/plugins/Sensable/examples/Old Examples/raptor.scn @@ -49,7 +49,7 @@ - + diff --git a/applications/plugins/Sensable/examples/SimpleBox-Method2.scn b/applications/plugins/Sensable/examples/SimpleBox-Method2.scn index f8502eebda2..6b32f923671 100644 --- a/applications/plugins/Sensable/examples/SimpleBox-Method2.scn +++ b/applications/plugins/Sensable/examples/SimpleBox-Method2.scn @@ -31,7 +31,7 @@ - + diff --git a/applications/plugins/SixenseHydra/Scenes/Hydra_buffon.scn b/applications/plugins/SixenseHydra/Scenes/Hydra_buffon.scn index a53f81b4e5b..2719d0888b6 100644 --- a/applications/plugins/SixenseHydra/Scenes/Hydra_buffon.scn +++ b/applications/plugins/SixenseHydra/Scenes/Hydra_buffon.scn @@ -18,7 +18,7 @@ - + diff --git a/applications/plugins/SixenseHydra/Scenes/Hydra_test.scn b/applications/plugins/SixenseHydra/Scenes/Hydra_test.scn index 37327bc6cc7..c0e4dd199cc 100644 --- a/applications/plugins/SixenseHydra/Scenes/Hydra_test.scn +++ b/applications/plugins/SixenseHydra/Scenes/Hydra_test.scn @@ -1,7 +1,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/Bar16-fem-implicit-CudaVec3f.pscn b/applications/plugins/SofaCUDA/examples/Bar16-fem-implicit-CudaVec3f.pscn index 3202617642f..cc0a6787f6f 100644 --- a/applications/plugins/SofaCUDA/examples/Bar16-fem-implicit-CudaVec3f.pscn +++ b/applications/plugins/SofaCUDA/examples/Bar16-fem-implicit-CudaVec3f.pscn @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/Bar16-spring-rk4-CudaVec3f.pscn b/applications/plugins/SofaCUDA/examples/Bar16-spring-rk4-CudaVec3f.pscn index facfba568e6..20b0cad3f32 100644 --- a/applications/plugins/SofaCUDA/examples/Bar16-spring-rk4-CudaVec3f.pscn +++ b/applications/plugins/SofaCUDA/examples/Bar16-spring-rk4-CudaVec3f.pscn @@ -4,7 +4,7 @@ - + @@ -15,7 +15,7 @@ - + '."\n"; ?> diff --git a/applications/plugins/SofaCUDA/examples/CudaDiagonalMass3f.scn b/applications/plugins/SofaCUDA/examples/CudaDiagonalMass3f.scn index 242f44fd9e4..19f3fab22ea 100644 --- a/applications/plugins/SofaCUDA/examples/CudaDiagonalMass3f.scn +++ b/applications/plugins/SofaCUDA/examples/CudaDiagonalMass3f.scn @@ -2,13 +2,13 @@ - + - + diff --git a/applications/plugins/SofaCUDA/examples/CudaMeshMatrixMass3f.scn b/applications/plugins/SofaCUDA/examples/CudaMeshMatrixMass3f.scn index f1de1c0cea8..112b5614111 100644 --- a/applications/plugins/SofaCUDA/examples/CudaMeshMatrixMass3f.scn +++ b/applications/plugins/SofaCUDA/examples/CudaMeshMatrixMass3f.scn @@ -2,13 +2,13 @@ - + - + diff --git a/applications/plugins/SofaCUDA/examples/SPHFluid2CUDA.scn b/applications/plugins/SofaCUDA/examples/SPHFluid2CUDA.scn index 07f5cd09145..4904a6161dd 100644 --- a/applications/plugins/SofaCUDA/examples/SPHFluid2CUDA.scn +++ b/applications/plugins/SofaCUDA/examples/SPHFluid2CUDA.scn @@ -3,10 +3,10 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/SPHFluidForceFieldCUDA.scn b/applications/plugins/SofaCUDA/examples/SPHFluidForceFieldCUDA.scn index 7d74464917e..2c2d96e5d98 100644 --- a/applications/plugins/SofaCUDA/examples/SPHFluidForceFieldCUDA.scn +++ b/applications/plugins/SofaCUDA/examples/SPHFluidForceFieldCUDA.scn @@ -2,9 +2,9 @@ - - - + diff --git a/applications/plugins/SofaCUDA/examples/SquareTissue-cpu.scn b/applications/plugins/SofaCUDA/examples/SquareTissue-cpu.scn index 0695cd7a62f..b1cc28840dc 100644 --- a/applications/plugins/SofaCUDA/examples/SquareTissue-cpu.scn +++ b/applications/plugins/SofaCUDA/examples/SquareTissue-cpu.scn @@ -8,7 +8,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/SquareTissue-cuda.scn b/applications/plugins/SofaCUDA/examples/SquareTissue-cuda.scn index 3181d6d0183..a0b67fa5491 100644 --- a/applications/plugins/SofaCUDA/examples/SquareTissue-cuda.scn +++ b/applications/plugins/SofaCUDA/examples/SquareTissue-cuda.scn @@ -4,7 +4,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCPU.scn b/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCPU.scn index 984ec283e88..b63e0f56118 100644 --- a/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCPU.scn +++ b/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCPU.scn @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCUDA.scn b/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCUDA.scn index a4cc6c83367..ac16c527919 100644 --- a/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCUDA.scn +++ b/applications/plugins/SofaCUDA/examples/StandardTetrahedralFEMForceFieldCUDA.scn @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCPU.scn b/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCPU.scn index 922c6febeac..e760d4c819a 100644 --- a/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCPU.scn +++ b/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCPU.scn @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCUDA.scn b/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCUDA.scn index f1a80616121..1542949848f 100644 --- a/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCUDA.scn +++ b/applications/plugins/SofaCUDA/examples/TetrahedralTensorMassForceFieldCUDA.scn @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/TetrahedronFEM_with_SpringForceField.scn b/applications/plugins/SofaCUDA/examples/TetrahedronFEM_with_SpringForceField.scn index 0809cbabe9b..d85dae200df 100644 --- a/applications/plugins/SofaCUDA/examples/TetrahedronFEM_with_SpringForceField.scn +++ b/applications/plugins/SofaCUDA/examples/TetrahedronFEM_with_SpringForceField.scn @@ -5,7 +5,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/beam10x10x46-warp-preconditioner-CUDA.scn b/applications/plugins/SofaCUDA/examples/beam10x10x46-warp-preconditioner-CUDA.scn index e608f93ed32..d1310210941 100644 --- a/applications/plugins/SofaCUDA/examples/beam10x10x46-warp-preconditioner-CUDA.scn +++ b/applications/plugins/SofaCUDA/examples/beam10x10x46-warp-preconditioner-CUDA.scn @@ -21,7 +21,7 @@ - + - + @@ -19,7 +19,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/quadSelfCollisCUDA.scn b/applications/plugins/SofaCUDA/examples/quadSelfCollisCUDA.scn index 51cf1d400c1..0cbd8621e4c 100644 --- a/applications/plugins/SofaCUDA/examples/quadSelfCollisCUDA.scn +++ b/applications/plugins/SofaCUDA/examples/quadSelfCollisCUDA.scn @@ -25,7 +25,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/quadSpringSphere.scn b/applications/plugins/SofaCUDA/examples/quadSpringSphere.scn index 55d69e5f4a4..3fe9f929721 100644 --- a/applications/plugins/SofaCUDA/examples/quadSpringSphere.scn +++ b/applications/plugins/SofaCUDA/examples/quadSpringSphere.scn @@ -10,7 +10,7 @@ - + @@ -38,7 +38,7 @@ - + - + @@ -31,7 +31,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/raptor-cpu.scn b/applications/plugins/SofaCUDA/examples/raptor-cpu.scn index a29d72c86d4..c6020ad4b1b 100644 --- a/applications/plugins/SofaCUDA/examples/raptor-cpu.scn +++ b/applications/plugins/SofaCUDA/examples/raptor-cpu.scn @@ -4,7 +4,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/raptor-cuda.scn b/applications/plugins/SofaCUDA/examples/raptor-cuda.scn index 8e9e6c433b1..7203a1b6693 100644 --- a/applications/plugins/SofaCUDA/examples/raptor-cuda.scn +++ b/applications/plugins/SofaCUDA/examples/raptor-cuda.scn @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/raptor-surface-cpu.scn b/applications/plugins/SofaCUDA/examples/raptor-surface-cpu.scn index cd0382ac580..754b1668772 100644 --- a/applications/plugins/SofaCUDA/examples/raptor-surface-cpu.scn +++ b/applications/plugins/SofaCUDA/examples/raptor-surface-cpu.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/raptor-surface-cuda.scn b/applications/plugins/SofaCUDA/examples/raptor-surface-cuda.scn index 53f9dc494cb..973fda1f145 100644 --- a/applications/plugins/SofaCUDA/examples/raptor-surface-cuda.scn +++ b/applications/plugins/SofaCUDA/examples/raptor-surface-cuda.scn @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + diff --git a/applications/plugins/SofaCUDA/examples/raptor.scn b/applications/plugins/SofaCUDA/examples/raptor.scn index 11567fd762c..76300272789 100644 --- a/applications/plugins/SofaCUDA/examples/raptor.scn +++ b/applications/plugins/SofaCUDA/examples/raptor.scn @@ -4,7 +4,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaHexahedronTLEDForceField_beam10x10x40_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaHexahedronTLEDForceField_beam10x10x40_gpu.scn index d65d3092243..01e6bba615a 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaHexahedronTLEDForceField_beam10x10x40_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaHexahedronTLEDForceField_beam10x10x40_gpu.scn @@ -3,7 +3,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam10x10x40_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam10x10x40_gpu.scn index 2a73c044737..ee7b46cc24b 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam10x10x40_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam10x10x40_gpu.scn @@ -3,7 +3,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam16x16x76_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam16x16x76_gpu.scn index 64d538cd73b..779cb59977e 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam16x16x76_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/CudaTetrahedronTLEDForceField_beam16x16x76_gpu.scn @@ -4,7 +4,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_cpu.scn index 581383a52e1..6620ffe182b 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_cpu.scn @@ -8,7 +8,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_gpu.scn index 807d0a878bf..2ba0fe1c5c3 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam10x10x40_gpu.scn @@ -4,7 +4,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_cpu.scn index 9290a171f09..8eafed08354 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_cpu.scn @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_gpu.scn index a0f17f5cf35..6e35a6c2f32 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/HexahedronFEMForceField_beam16x16x76_gpu.scn @@ -5,7 +5,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_cpu.scn index 0aa264ffe3e..20e484ebba1 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_cpu.scn @@ -8,7 +8,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_gpu.scn index 69ceabcffd9..6bbc7d0d09f 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/MeshSpringForceField_beam10x10x40_gpu.scn @@ -4,7 +4,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_cpu.scn index d37bc40f662..2707e5bc9ac 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_cpu.scn @@ -7,7 +7,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_gpu.scn index 5e500be2667..280e959a911 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/QuadSpringsSphere_gpu.scn @@ -3,7 +3,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_cpu.scn index 5c3443c4c4c..f80d37780c2 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_cpu.scn @@ -8,7 +8,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_gpu.scn index 1be46646653..7fbad7374a2 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam10x10x40_gpu.scn @@ -4,7 +4,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_cpu.scn index 792da4836ce..3af46112207 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_cpu.scn @@ -9,7 +9,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_gpu.scn index 1da3b556009..19e709e094c 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TetrahedronFEMForceField_beam16x16x76_gpu.scn @@ -5,7 +5,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_cpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_cpu.scn index f678cc5e741..c428e5b26e8 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_cpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_cpu.scn @@ -7,7 +7,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_gpu.scn b/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_gpu.scn index 3b92fb6df14..d6621f478b6 100644 --- a/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_gpu.scn +++ b/applications/plugins/SofaCUDA/scenes/benchmarks/TriangularFEMForceFieldOptim_tissue100x100_gpu.scn @@ -4,7 +4,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_implicit.scn index 2e4671ef1f9..32e6f7fdf45 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_implicit.scn @@ -8,7 +8,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_rk4.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_rk4.scn index cae81f88f79..62471a393d9 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_rk4.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaHexahedronFEMForceField_beam10x10x40_rk4.scn @@ -7,7 +7,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_implicit.scn index 7be228795fa..613177efc31 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_implicit.scn @@ -8,7 +8,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_rk4.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_rk4.scn index 7f08fb0f854..60055b9472b 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_rk4.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaMeshSpringForceField_beam10x10x40_rk4.scn @@ -7,7 +7,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_implicit.scn index 062da1e988f..2eebbe07953 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_implicit.scn @@ -8,7 +8,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_rk4.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_rk4.scn index 4bbb9df43b4..a3bb757860b 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_rk4.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_beam10x10x40_rk4.scn @@ -7,7 +7,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_cudavec3d_beam10x10x40_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_cudavec3d_beam10x10x40_implicit.scn index fd29f688a66..b7db513b19f 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_cudavec3d_beam10x10x40_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTetrahedronFEMForceField_cudavec3d_beam10x10x40_implicit.scn @@ -8,7 +8,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue100x100_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue100x100_implicit.scn index 526569b3be8..36ab129c977 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue100x100_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue100x100_implicit.scn @@ -7,7 +7,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue20x20_implicit.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue20x20_implicit.scn index 6dfd7f642d5..e38b453fc57 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue20x20_implicit.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/CudaTriangularFEMForceFieldOptim_tissue20x20_implicit.scn @@ -7,7 +7,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/QuadSpringsSphere.scn b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/QuadSpringsSphere.scn index 83ca77306b4..e6e6a1870bf 100644 --- a/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/QuadSpringsSphere.scn +++ b/applications/plugins/SofaCUDA/scenes/cpu-gpu_validation/QuadSpringsSphere.scn @@ -7,7 +7,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp b/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp index 5c6fd1b6f5e..0bfe6e57a83 100644 --- a/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp +++ b/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp @@ -109,7 +109,7 @@ bool SofaCarving_test::createScene(const std::string& carvingDistance) // create solver - createObject(m_root, "EulerImplicitSolver", { { "name","Euler Implicit" }, + createObject(m_root, "EulerImplicitIntegrationScheme", { { "name","Euler Implicit" }, { "rayleighStiffness","0.1" }, { "rayleighMass", "0.1" } }); diff --git a/applications/plugins/SofaCarving/examples/CarvingTool.scn b/applications/plugins/SofaCarving/examples/CarvingTool.scn index da655e682bb..bab178a2b15 100644 --- a/applications/plugins/SofaCarving/examples/CarvingTool.scn +++ b/applications/plugins/SofaCarving/examples/CarvingTool.scn @@ -12,7 +12,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/applications/plugins/SofaCarving/examples/SimpleCarving.py b/applications/plugins/SofaCarving/examples/SimpleCarving.py index 9c453577571..8e19cf116b0 100644 --- a/applications/plugins/SofaCarving/examples/SimpleCarving.py +++ b/applications/plugins/SofaCarving/examples/SimpleCarving.py @@ -22,7 +22,7 @@ def createScene(root): # Load required plugins plugins = root.addChild('Plugins') - plugins.addObject('RequiredPlugin', name="MechanicalLoop", pluginName="Sofa.Component.AnimationLoop Sofa.Component.ODESolver.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mapping.NonLinear Sofa.Component.Mapping.Linear") + plugins.addObject('RequiredPlugin', name="MechanicalLoop", pluginName="Sofa.Component.AnimationLoop Sofa.Component.IntegrationScheme.Backward Sofa.Component.LinearSolver.Iterative Sofa.Component.Mapping.NonLinear Sofa.Component.Mapping.Linear") plugins.addObject('RequiredPlugin', name="MechanicalModel", pluginName="Sofa.Component.StateContainer Sofa.Component.Mass Sofa.Component.SolidMechanics.FEM.Elastic") plugins.addObject('RequiredPlugin', name="Collision", pluginName="Sofa.Component.Collision.Detection.Algorithm Sofa.Component.Collision.Detection.Intersection Sofa.Component.Collision.Geometry Sofa.Component.Collision.Response.Contact") plugins.addObject('RequiredPlugin', name="Constraint", pluginName="Sofa.Component.Constraint.Lagrangian.Correction Sofa.Component.Constraint.Lagrangian.Solver Sofa.Component.Constraint.Projective") @@ -48,7 +48,7 @@ def createScene(root): # Add Volume mechanical object to be carved TT = root.addChild('TetraVolume') - TT.addObject('EulerImplicitSolver',name="cg_odesolver", printLog=False, rayleighStiffness=0.1, rayleighMass=0.1) + TT.addObject('EulerImplicitIntegrationScheme',name="cg_odesolver", printLog=False, rayleighStiffness=0.1, rayleighMass=0.1) TT.addObject('CGLinearSolver', name="linear solver", iterations=25, tolerance=1.0e-9, threshold=1.0e-9) TT.addObject('MeshGmshLoader', name="loader", filename="mesh/liver.msh") @@ -78,7 +78,7 @@ def createScene(root): # Add instrument object Instrument = root.addChild('Instrument') - Instrument.addObject('EulerImplicitSolver', name="cg_odesolver") + Instrument.addObject('EulerImplicitIntegrationScheme', name="cg_odesolver") Instrument.addObject('CGLinearSolver', name="linear solver", iterations=25, tolerance=1.0e-9, threshold=1.0e-9) Instrument.addObject('MechanicalObject', template="Rigid3d", name="instrumentState", rotation=[90, 45, 0], translation=[0, 0, 1]) Instrument.addObject('UniformMass', template="Rigid3d", name="mass", totalMass=5.0) diff --git a/applications/plugins/SofaCarving/examples/SimpleCarving.scn b/applications/plugins/SofaCarving/examples/SimpleCarving.scn index 508614706a8..4d666762f14 100644 --- a/applications/plugins/SofaCarving/examples/SimpleCarving.scn +++ b/applications/plugins/SofaCarving/examples/SimpleCarving.scn @@ -11,7 +11,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/applications/plugins/SofaCarving/examples/SimpleCarving_withPenetration.scn b/applications/plugins/SofaCarving/examples/SimpleCarving_withPenetration.scn index e0d6d69dc9f..70eb69e9a55 100644 --- a/applications/plugins/SofaCarving/examples/SimpleCarving_withPenetration.scn +++ b/applications/plugins/SofaCarving/examples/SimpleCarving_withPenetration.scn @@ -11,7 +11,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/applications/plugins/SofaDistanceGrid/examples/DistanceGridForceField_liver.scn b/applications/plugins/SofaDistanceGrid/examples/DistanceGridForceField_liver.scn index 3794f1921f5..e008bf4c1ed 100644 --- a/applications/plugins/SofaDistanceGrid/examples/DistanceGridForceField_liver.scn +++ b/applications/plugins/SofaDistanceGrid/examples/DistanceGridForceField_liver.scn @@ -8,7 +8,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn b/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn index 7fa3491bd6c..1da1ab2fc8b 100644 --- a/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn +++ b/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn @@ -10,7 +10,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_FreeMotionAnimationLoop.scn b/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_FreeMotionAnimationLoop.scn index 55564bf78c7..5079baaa72c 100644 --- a/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_FreeMotionAnimationLoop.scn +++ b/applications/plugins/SofaDistanceGrid/examples/FFDDistanceGridCollisionModel_liver_FreeMotionAnimationLoop.scn @@ -10,7 +10,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/applications/plugins/SofaDistanceGrid/examples/RigidDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn b/applications/plugins/SofaDistanceGrid/examples/RigidDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn index 345637a7303..764e304c038 100644 --- a/applications/plugins/SofaDistanceGrid/examples/RigidDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn +++ b/applications/plugins/SofaDistanceGrid/examples/RigidDistanceGridCollisionModel_liver_DefaultAnimationLoop.scn @@ -8,7 +8,7 @@ - + @@ -45,7 +45,7 @@ - + - + @@ -47,7 +47,7 @@ - + - + @@ -62,7 +62,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/applications/plugins/SofaImplicitField/examples/ImplicitSurfaceMapping.scn b/applications/plugins/SofaImplicitField/examples/ImplicitSurfaceMapping.scn index 174e8d159fc..db12283574b 100644 --- a/applications/plugins/SofaImplicitField/examples/ImplicitSurfaceMapping.scn +++ b/applications/plugins/SofaImplicitField/examples/ImplicitSurfaceMapping.scn @@ -2,14 +2,14 @@ - + - + diff --git a/applications/plugins/SofaMatrix/examples/ComplianceMatrixExporter.scn b/applications/plugins/SofaMatrix/examples/ComplianceMatrixExporter.scn index 4a4e5e1a42e..d588304a7e2 100644 --- a/applications/plugins/SofaMatrix/examples/ComplianceMatrixExporter.scn +++ b/applications/plugins/SofaMatrix/examples/ComplianceMatrixExporter.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/applications/plugins/SofaMatrix/examples/ComplianceMatrixImage.scn b/applications/plugins/SofaMatrix/examples/ComplianceMatrixImage.scn index 348be8e7a37..7655209eec2 100644 --- a/applications/plugins/SofaMatrix/examples/ComplianceMatrixImage.scn +++ b/applications/plugins/SofaMatrix/examples/ComplianceMatrixImage.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/applications/plugins/SofaMatrix/examples/FillReducingOrdering.scn b/applications/plugins/SofaMatrix/examples/FillReducingOrdering.scn index 6ef0c8baaa0..f54193bff93 100644 --- a/applications/plugins/SofaMatrix/examples/FillReducingOrdering.scn +++ b/applications/plugins/SofaMatrix/examples/FillReducingOrdering.scn @@ -12,7 +12,7 @@ The scene compares two simulations in which only the vertices order differs: - + @@ -32,7 +32,7 @@ The scene compares two simulations in which only the vertices order differs: - + @@ -48,7 +48,7 @@ The scene compares two simulations in which only the vertices order differs: - + diff --git a/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixExporter.scn b/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixExporter.scn index 0fdd8645970..f8b50d08662 100644 --- a/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixExporter.scn +++ b/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixExporter.scn @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixImage.scn b/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixImage.scn index 5e5ab73bb8b..f67bbb5fc14 100644 --- a/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixImage.scn +++ b/applications/plugins/SofaMatrix/examples/GlobalSystemMatrixImage.scn @@ -2,7 +2,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/applications/plugins/SofaNewmat/examples/MatrixContributions121.scn b/applications/plugins/SofaNewmat/examples/MatrixContributions121.scn index e8b1f3f963e..cf355fbae72 100644 --- a/applications/plugins/SofaNewmat/examples/MatrixContributions121.scn +++ b/applications/plugins/SofaNewmat/examples/MatrixContributions121.scn @@ -11,7 +11,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -75,7 +75,7 @@ - - + + + <-- --> diff --git a/applications/plugins/SofaOpenCL/examples/SPHFluidForceFieldOPENCL.scn b/applications/plugins/SofaOpenCL/examples/SPHFluidForceFieldOPENCL.scn index ba8817b3518..2e15a5bf508 100644 --- a/applications/plugins/SofaOpenCL/examples/SPHFluidForceFieldOPENCL.scn +++ b/applications/plugins/SofaOpenCL/examples/SPHFluidForceFieldOPENCL.scn @@ -5,7 +5,7 @@ - + - + diff --git a/applications/plugins/SofaPardisoSolver/examples/FEMBAR-SparsePARDISOSolver.scn b/applications/plugins/SofaPardisoSolver/examples/FEMBAR-SparsePARDISOSolver.scn index 72047b6b2c9..a021381d57a 100644 --- a/applications/plugins/SofaPardisoSolver/examples/FEMBAR-SparsePARDISOSolver.scn +++ b/applications/plugins/SofaPardisoSolver/examples/FEMBAR-SparsePARDISOSolver.scn @@ -1,7 +1,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/applications/plugins/SofaTest/Elasticity_test.inl b/applications/plugins/SofaTest/Elasticity_test.inl index 949ca6851cb..732bbd8debb 100644 --- a/applications/plugins/SofaTest/Elasticity_test.inl +++ b/applications/plugins/SofaTest/Elasticity_test.inl @@ -25,7 +25,7 @@ #include "Elasticity_test.h" // Solvers -#include +#include #include #include @@ -110,7 +110,7 @@ Elasticity_test::createRegularGridScene( simulation::Node::SPtr SquareNode = root->createChild("Square"); // Euler implicit solver and cglinear solver - component::odesolver::backward::EulerImplicitSolver::SPtr solver = modeling::addNew(SquareNode,"EulerImplicitSolver"); + component::odesolver::backward::EulerImplicitIntegrationScheme::SPtr solver = modeling::addNew(SquareNode,"EulerImplicitIntegrationScheme"); solver->f_rayleighStiffness.setValue(0.5); solver->f_rayleighMass.setValue(0.5); CGLinearSolver::SPtr cgLinearSolver = modeling::addNew< CGLinearSolver >(SquareNode,"linearSolver"); @@ -278,8 +278,8 @@ simulation::Node::SPtr Elasticity_test
::createGridScene( simulation::Node::SPtr simulatedScene = root->createChild("simulatedScene"); - component::odesolver::backward::EulerImplicitSolver::SPtr eulerImplicitSolver = New(); - simulatedScene->addObject( eulerImplicitSolver ); + component::odesolver::backward::EulerImplicitIntegrationScheme::SPtr EulerImplicitIntegrationScheme = New(); + simulatedScene->addObject( EulerImplicitIntegrationScheme ); CGLinearSolver::SPtr cgLinearSolver = New(); simulatedScene->addObject(cgLinearSolver); diff --git a/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py b/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py index b5c763922e7..88237f4b72f 100644 --- a/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py +++ b/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py @@ -108,7 +108,7 @@ def createScene(node): rigidFile.write( 'cntr 0 0 0\n' ) rigidFile.close() - #node.createObject('EulerExplicitSolver',name='odesolver') + #node.createObject('EulerExplicitIntegrationScheme',name='odesolver') #node.createObject('RequiredPlugin', pluginName = 'Compliant') #node.createObject('CompliantImplicitSolver',name='odesolver',stabilization='0') #node.createObject('LDLTSolver',name = 'numsolver') diff --git a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_hexa_physics.scn b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_hexa_physics.scn index d1a5885e6be..eb21f2e675f 100644 --- a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_hexa_physics.scn +++ b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_hexa_physics.scn @@ -3,7 +3,7 @@ - + diff --git a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_physics.scn b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_physics.scn index d1a5885e6be..eb21f2e675f 100644 --- a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_physics.scn +++ b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_physics.scn @@ -3,7 +3,7 @@ - + diff --git a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_clipped_physics.scn b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_clipped_physics.scn index c9653b56152..a903393ea84 100644 --- a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_clipped_physics.scn +++ b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_clipped_physics.scn @@ -3,7 +3,7 @@ - + diff --git a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_physics.scn b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_physics.scn index 112b099fd0a..f747515da11 100644 --- a/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_physics.scn +++ b/applications/plugins/VolumetricRendering/examples/OglVolumetricModel_tetra_physics.scn @@ -3,7 +3,7 @@ - + diff --git a/applications/plugins/Xitact/examples/1xitact.scn b/applications/plugins/Xitact/examples/1xitact.scn index 79824a9b109..4d6af4e26d7 100644 --- a/applications/plugins/Xitact/examples/1xitact.scn +++ b/applications/plugins/Xitact/examples/1xitact.scn @@ -10,7 +10,7 @@ - + diff --git a/applications/plugins/Xitact/examples/2xitact2.scn b/applications/plugins/Xitact/examples/2xitact2.scn index 4924f8722b2..ed1e76470f6 100644 --- a/applications/plugins/Xitact/examples/2xitact2.scn +++ b/applications/plugins/Xitact/examples/2xitact2.scn @@ -11,7 +11,7 @@ - + diff --git a/applications/plugins/Xitact/examples/XitactGrasping.scn b/applications/plugins/Xitact/examples/XitactGrasping.scn index 71a189d2d2c..ede1b09c8b3 100644 --- a/applications/plugins/Xitact/examples/XitactGrasping.scn +++ b/applications/plugins/Xitact/examples/XitactGrasping.scn @@ -22,7 +22,7 @@ - + @@ -47,7 +47,7 @@ - + > @@ -78,7 +78,7 @@ - + diff --git a/applications/plugins/Xitact/examples/XitactGraspingWithForceFeedBack.scn b/applications/plugins/Xitact/examples/XitactGraspingWithForceFeedBack.scn index 7d355f19077..93741b03032 100644 --- a/applications/plugins/Xitact/examples/XitactGraspingWithForceFeedBack.scn +++ b/applications/plugins/Xitact/examples/XitactGraspingWithForceFeedBack.scn @@ -22,7 +22,7 @@ - + @@ -47,7 +47,7 @@ - + > @@ -78,7 +78,7 @@ - + diff --git a/applications/plugins/Xitact/examples/XitactGrasping_coupledModel.scn b/applications/plugins/Xitact/examples/XitactGrasping_coupledModel.scn index 6eda4a6ef22..abb9dadac14 100644 --- a/applications/plugins/Xitact/examples/XitactGrasping_coupledModel.scn +++ b/applications/plugins/Xitact/examples/XitactGrasping_coupledModel.scn @@ -22,7 +22,7 @@ - + @@ -47,7 +47,7 @@ - + > @@ -78,7 +78,7 @@ - + @@ -195,7 +195,7 @@ - + diff --git a/applications/plugins/Xitact/examples/XitactGrasping_coupledModel_withITP.scn b/applications/plugins/Xitact/examples/XitactGrasping_coupledModel_withITP.scn index c94b98f26fb..978f60ad6c8 100644 --- a/applications/plugins/Xitact/examples/XitactGrasping_coupledModel_withITP.scn +++ b/applications/plugins/Xitact/examples/XitactGrasping_coupledModel_withITP.scn @@ -22,7 +22,7 @@ - + @@ -47,7 +47,7 @@ - + > @@ -78,7 +78,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -312,7 +312,7 @@ - + diff --git a/applications/plugins/Xitact/examples/xitactTest.scn b/applications/plugins/Xitact/examples/xitactTest.scn index f4ec5e12576..9aef2ac0860 100644 --- a/applications/plugins/Xitact/examples/xitactTest.scn +++ b/applications/plugins/Xitact/examples/xitactTest.scn @@ -13,7 +13,7 @@ - + diff --git a/applications/plugins/image/examples/ImageToRigidMass.scn b/applications/plugins/image/examples/ImageToRigidMass.scn index 8b505518d4d..4168aa77a95 100644 --- a/applications/plugins/image/examples/ImageToRigidMass.scn +++ b/applications/plugins/image/examples/ImageToRigidMass.scn @@ -6,7 +6,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/applications/plugins/image/examples/ImageTransform.scn b/applications/plugins/image/examples/ImageTransform.scn index 7957b34be10..f41e3fab899 100644 --- a/applications/plugins/image/examples/ImageTransform.scn +++ b/applications/plugins/image/examples/ImageTransform.scn @@ -5,13 +5,13 @@ - + - + diff --git a/applications/plugins/image/examples/loadVolume.scn b/applications/plugins/image/examples/loadVolume.scn index d1391e0148e..ef7bf158140 100644 --- a/applications/plugins/image/examples/loadVolume.scn +++ b/applications/plugins/image/examples/loadVolume.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/applications/plugins/image/examples/sampler_HexaFEM.scn b/applications/plugins/image/examples/sampler_HexaFEM.scn index bcc2177582a..51ac781fd12 100644 --- a/applications/plugins/image/examples/sampler_HexaFEM.scn +++ b/applications/plugins/image/examples/sampler_HexaFEM.scn @@ -5,7 +5,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/applications/plugins/image/examples/sampler_meshSpring.scn b/applications/plugins/image/examples/sampler_meshSpring.scn index 2532a954074..ac150899c96 100644 --- a/applications/plugins/image/examples/sampler_meshSpring.scn +++ b/applications/plugins/image/examples/sampler_meshSpring.scn @@ -5,7 +5,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp index 0adb3ab32a9..f7ae68c7156 100644 --- a/applications/projects/SceneChecking/tests/SceneChecker_test.cpp +++ b/applications/projects/SceneChecking/tests/SceneChecker_test.cpp @@ -80,13 +80,13 @@ struct SceneChecker_test : public BaseSimulationTest { void checkRequiredPlugin(bool missing) { - this->loadPlugins({Sofa.Component.ODESolver.Forward}); - const std::string missStr = missing ? "" : " \n"; + this->loadPlugins({Sofa.Component.IntegrationScheme.Forward}); + const std::string missStr = missing ? "" : " \n"; std::stringstream scene; scene << " \n" << " \n" << missStr - << " \n" + << " \n" << " \n"; SceneLoaderXML sceneLoader; diff --git a/applications/projects/sofaProjectExample/Main.cpp b/applications/projects/sofaProjectExample/Main.cpp index 8c84b8c2b71..85d7c80639d 100644 --- a/applications/projects/sofaProjectExample/Main.cpp +++ b/applications/projects/sofaProjectExample/Main.cpp @@ -31,7 +31,7 @@ // solvers #include -#include +#include // collision pipeline #include @@ -75,7 +75,7 @@ using sofa::component::collision::DefaultContactManager; using sofa::component::collision::TriangleCollisionModel; // solvers -using sofa::component::odesolver::EulerImplicitSolver; +using sofa::component::odesolver::EulerImplicitIntegrationScheme; using sofa::component::linearsolver::CGLinearSolver; using sofa::component::linearsolver::GraphScatteredMatrix; using sofa::component::linearsolver::GraphScatteredVector; @@ -170,10 +170,10 @@ int main(int argc, char** argv) // solvers typedef CGLinearSolver CGLinearSolverGraph; - EulerImplicitSolver::SPtr implicitSolver = New(); + EulerImplicitIntegrationScheme::SPtr implicitSolver = New(); CGLinearSolverGraph::SPtr cgLinearSolver = New(); - implicitSolver->setName("eulerImplicitSolver"); + implicitSolver->setName("EulerImplicitIntegrationScheme"); implicitSolver->f_rayleighStiffness.setValue(0.01); //implicitSolver->f_rayleighMass.setValue(0.1); implicitSolver->f_printLog = false; diff --git a/examples/.scene-tests b/examples/.scene-tests index 09de2378bfd..7578544b692 100644 --- a/examples/.scene-tests +++ b/examples/.scene-tests @@ -1,6 +1,6 @@ # [Slow] This runs very slowly, so compute only a few iterations -iterations "Component/ODESolver/Backward/NewmarkImplicitSolver.scn" "5" -timeout "Component/ODESolver/Backward/NewmarkImplicitSolver.scn" "60" +iterations "Component/ODESolver/Backward/NewmarkIntegrationScheme.scn" "5" +timeout "Component/ODESolver/Backward/NewmarkIntegrationScheme.scn" "60" # [Slow] Idem iterations "Component/SolidMechanics/FEM/FastTetrahedronCorotationalForceField_validation.scn" "10" diff --git a/examples/Benchmark/Accuracy/TriangleFEMForceField_compare.scn b/examples/Benchmark/Accuracy/TriangleFEMForceField_compare.scn index 9e7d9356477..6a7a1a0474e 100644 --- a/examples/Benchmark/Accuracy/TriangleFEMForceField_compare.scn +++ b/examples/Benchmark/Accuracy/TriangleFEMForceField_compare.scn @@ -4,7 +4,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -78,7 +78,7 @@ - + diff --git a/examples/Benchmark/Analysis/Pendulum.scn b/examples/Benchmark/Analysis/Pendulum.scn index a0a8643c8b1..6544a653d61 100644 --- a/examples/Benchmark/Analysis/Pendulum.scn +++ b/examples/Benchmark/Analysis/Pendulum.scn @@ -4,7 +4,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Benchmark/Analysis/constantMomentum.scn b/examples/Benchmark/Analysis/constantMomentum.scn index e22fd0b7212..a2266c223c1 100644 --- a/examples/Benchmark/Analysis/constantMomentum.scn +++ b/examples/Benchmark/Analysis/constantMomentum.scn @@ -3,8 +3,8 @@ - - + + @@ -12,7 +12,7 @@ - + - + - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Benchmark/Performance/BarycentricMapping_sparsegrid.scn b/examples/Benchmark/Performance/BarycentricMapping_sparsegrid.scn index 94fcb4bf031..7505926448b 100644 --- a/examples/Benchmark/Performance/BarycentricMapping_sparsegrid.scn +++ b/examples/Benchmark/Performance/BarycentricMapping_sparsegrid.scn @@ -10,7 +10,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Benchmark/Performance/BarycentricMapping_topologycontainer.scn b/examples/Benchmark/Performance/BarycentricMapping_topologycontainer.scn index 37c08b309ad..9eb7ef09938 100644 --- a/examples/Benchmark/Performance/BarycentricMapping_topologycontainer.scn +++ b/examples/Benchmark/Performance/BarycentricMapping_topologycontainer.scn @@ -10,7 +10,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Benchmark/Performance/BuildLCP/BuiltConstraintCorrection.scn b/examples/Benchmark/Performance/BuildLCP/BuiltConstraintCorrection.scn index 02f59a3a492..f2424bf2b03 100644 --- a/examples/Benchmark/Performance/BuildLCP/BuiltConstraintCorrection.scn +++ b/examples/Benchmark/Performance/BuildLCP/BuiltConstraintCorrection.scn @@ -10,8 +10,8 @@ - - + + @@ -26,7 +26,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -87,7 +87,7 @@ - + diff --git a/examples/Benchmark/Performance/BuildLCP/NonBuiltConstraintCorrection.scn b/examples/Benchmark/Performance/BuildLCP/NonBuiltConstraintCorrection.scn index 8cbfd64a6b3..ab85c4b5d4e 100644 --- a/examples/Benchmark/Performance/BuildLCP/NonBuiltConstraintCorrection.scn +++ b/examples/Benchmark/Performance/BuildLCP/NonBuiltConstraintCorrection.scn @@ -10,8 +10,8 @@ - - + + @@ -26,12 +26,12 @@ - + - + @@ -48,10 +48,10 @@ - + - + @@ -70,7 +70,7 @@ - + @@ -87,10 +87,10 @@ - + - + diff --git a/examples/Benchmark/Performance/MatrixAssembly/MatrixAssembly_assembledCG.scn b/examples/Benchmark/Performance/MatrixAssembly/MatrixAssembly_assembledCG.scn index 8282a5442a4..663681cf192 100644 --- a/examples/Benchmark/Performance/MatrixAssembly/MatrixAssembly_assembledCG.scn +++ b/examples/Benchmark/Performance/MatrixAssembly/MatrixAssembly_assembledCG.scn @@ -15,7 +15,7 @@ The differences are in the way the global system matrix is built and solved: - + @@ -25,7 +25,7 @@ The differences are in the way the global system matrix is built and solved: - + - + @@ -24,7 +24,7 @@ The differences are in the way the global system matrix is built and solved: - + - + @@ -24,7 +24,7 @@ The differences are in the way the global system matrix is built and solved: - + - + @@ -24,7 +24,7 @@ The differences are in the way the global system matrix is built and solved: - + - + @@ -24,7 +24,7 @@ The differences are in the way the global system matrix is built and solved: - + - + @@ -48,7 +48,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -180,7 +180,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -224,7 +224,7 @@ - + @@ -246,7 +246,7 @@ - + diff --git a/examples/Benchmark/Performance/benchmark_cubes.pscn b/examples/Benchmark/Performance/benchmark_cubes.pscn index 3d9d814705d..ec1027950d6 100644 --- a/examples/Benchmark/Performance/benchmark_cubes.pscn +++ b/examples/Benchmark/Performance/benchmark_cubes.pscn @@ -8,10 +8,10 @@ - + - + @@ -52,13 +52,13 @@ ';?> - + ';?> - + diff --git a/examples/Benchmark/Performance/benchmark_cubes.scn b/examples/Benchmark/Performance/benchmark_cubes.scn index 711b53f93aa..7d3c224fa7f 100644 --- a/examples/Benchmark/Performance/benchmark_cubes.scn +++ b/examples/Benchmark/Performance/benchmark_cubes.scn @@ -12,7 +12,7 @@ - + @@ -35,14 +35,14 @@ - + - + @@ -50,7 +50,7 @@ - + @@ -58,7 +58,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -170,7 +170,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -218,7 +218,7 @@ - + @@ -226,7 +226,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -266,7 +266,7 @@ - + @@ -274,7 +274,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -290,7 +290,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -314,7 +314,7 @@ - + @@ -322,7 +322,7 @@ - + @@ -330,7 +330,7 @@ - + @@ -338,7 +338,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -354,7 +354,7 @@ - + @@ -362,7 +362,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -378,7 +378,7 @@ - + @@ -386,7 +386,7 @@ - + @@ -394,7 +394,7 @@ - + @@ -402,7 +402,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -426,7 +426,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -442,7 +442,7 @@ - + @@ -450,7 +450,7 @@ - + @@ -458,7 +458,7 @@ - + @@ -466,7 +466,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -482,7 +482,7 @@ - + @@ -490,7 +490,7 @@ - + @@ -498,7 +498,7 @@ - + @@ -506,7 +506,7 @@ - + @@ -514,7 +514,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -530,7 +530,7 @@ - + @@ -538,7 +538,7 @@ - + @@ -546,7 +546,7 @@ - + @@ -554,7 +554,7 @@ - + @@ -562,7 +562,7 @@ - + @@ -570,7 +570,7 @@ - + @@ -578,7 +578,7 @@ - + @@ -586,7 +586,7 @@ - + @@ -594,7 +594,7 @@ - + @@ -602,7 +602,7 @@ - + @@ -610,7 +610,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/AffineMovementConstraint__RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/AffineMovementConstraint__RemovingMeshTest.scn index da9896d1dad..ef05c8eac95 100644 --- a/examples/Benchmark/TopologicalChanges/AffineMovementConstraint__RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/AffineMovementConstraint__RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/FixedConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/FixedConstraint_RemovingMeshTest.scn index 49f7e6b9e4e..cb91b140813 100644 --- a/examples/Benchmark/TopologicalChanges/FixedConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/FixedConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/FixedPlaneConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/FixedPlaneConstraint_RemovingMeshTest.scn index f53c0db8501..13482151cbb 100644 --- a/examples/Benchmark/TopologicalChanges/FixedPlaneConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/FixedPlaneConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/LinearMovementConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/LinearMovementConstraint_RemovingMeshTest.scn index 53e946badf6..5d732bbadc4 100644 --- a/examples/Benchmark/TopologicalChanges/LinearMovementConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/LinearMovementConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/ProjectDirectionConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/ProjectDirectionConstraint_RemovingMeshTest.scn index 4d8c58ac691..81a24817c8e 100644 --- a/examples/Benchmark/TopologicalChanges/ProjectDirectionConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/ProjectDirectionConstraint_RemovingMeshTest.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/ProjectToLineConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/ProjectToLineConstraint_RemovingMeshTest.scn index 564b899189a..ee68179cc2a 100644 --- a/examples/Benchmark/TopologicalChanges/ProjectToLineConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/ProjectToLineConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/ProjectToPlaneConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/ProjectToPlaneConstraint_RemovingMeshTest.scn index 17d5c5139d7..5141460599c 100644 --- a/examples/Benchmark/TopologicalChanges/ProjectToPlaneConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/ProjectToPlaneConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/ProjectToPointConstraint_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/ProjectToPointConstraint_RemovingMeshTest.scn index 21aae9293c1..bac4ab73dbb 100644 --- a/examples/Benchmark/TopologicalChanges/ProjectToPointConstraint_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/ProjectToPointConstraint_RemovingMeshTest.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/TriangularBendingSprings_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/TriangularBendingSprings_RemovingMeshTest.scn index 7b9fe3c62fb..4cd071c0201 100644 --- a/examples/Benchmark/TopologicalChanges/TriangularBendingSprings_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/TriangularBendingSprings_RemovingMeshTest.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Benchmark/TopologicalChanges/TriangularFEMForceField_RemovingMeshTest.scn b/examples/Benchmark/TopologicalChanges/TriangularFEMForceField_RemovingMeshTest.scn index d57efc2d42e..bd5facef22e 100644 --- a/examples/Benchmark/TopologicalChanges/TriangularFEMForceField_RemovingMeshTest.scn +++ b/examples/Benchmark/TopologicalChanges/TriangularFEMForceField_RemovingMeshTest.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/AnimationLoop/FreeMotionAnimationLoop.scn b/examples/Component/AnimationLoop/FreeMotionAnimationLoop.scn index dc5678715a8..17d36d1e50a 100644 --- a/examples/Component/AnimationLoop/FreeMotionAnimationLoop.scn +++ b/examples/Component/AnimationLoop/FreeMotionAnimationLoop.scn @@ -17,7 +17,7 @@ To speed up the collision detection, replace BVHNarrowPhase by ParallelBVHNarrow - + @@ -45,7 +45,7 @@ To speed up the collision detection, replace BVHNarrowPhase by ParallelBVHNarrow - + @@ -69,7 +69,7 @@ To speed up the collision detection, replace BVHNarrowPhase by ParallelBVHNarrow - + diff --git a/examples/Component/AnimationLoop/MultiStepAnimationLoop.scn b/examples/Component/AnimationLoop/MultiStepAnimationLoop.scn index e5d04e937b1..de66c9fbd25 100644 --- a/examples/Component/AnimationLoop/MultiStepAnimationLoop.scn +++ b/examples/Component/AnimationLoop/MultiStepAnimationLoop.scn @@ -9,7 +9,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -66,7 +66,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/examples/Component/Collision/Detection/CompositeCollisionPipeline.scn b/examples/Component/Collision/Detection/CompositeCollisionPipeline.scn index 24bd70c3848..98c79bba17d 100644 --- a/examples/Component/Collision/Detection/CompositeCollisionPipeline.scn +++ b/examples/Component/Collision/Detection/CompositeCollisionPipeline.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/examples/Component/Collision/Detection/CompositeCollisionPipeline_none.scn b/examples/Component/Collision/Detection/CompositeCollisionPipeline_none.scn index 6b6f99dad40..4b2e493b6f5 100644 --- a/examples/Component/Collision/Detection/CompositeCollisionPipeline_none.scn +++ b/examples/Component/Collision/Detection/CompositeCollisionPipeline_none.scn @@ -8,7 +8,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/examples/Component/Collision/Detection/RayTraceCollision.scn b/examples/Component/Collision/Detection/RayTraceCollision.scn index 578b03fd15f..44b8f2817a7 100644 --- a/examples/Component/Collision/Detection/RayTraceCollision.scn +++ b/examples/Component/Collision/Detection/RayTraceCollision.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -142,7 +142,7 @@ - + @@ -162,7 +162,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -202,7 +202,7 @@ - + diff --git a/examples/Component/Collision/Geometry/SphereModel.scn b/examples/Component/Collision/Geometry/SphereModel.scn index 45fbb63edd2..2b489b9bacc 100644 --- a/examples/Component/Collision/Geometry/SphereModel.scn +++ b/examples/Component/Collision/Geometry/SphereModel.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Collision/Geometry/TriangleModel.scn b/examples/Component/Collision/Geometry/TriangleModel.scn index 638a64914dc..b29f2857d9d 100644 --- a/examples/Component/Collision/Geometry/TriangleModel.scn +++ b/examples/Component/Collision/Geometry/TriangleModel.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Collision/Response/FrictionContact.scn b/examples/Component/Collision/Response/FrictionContact.scn index d80854f93c3..38481ee2356 100644 --- a/examples/Component/Collision/Response/FrictionContact.scn +++ b/examples/Component/Collision/Response/FrictionContact.scn @@ -11,7 +11,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/examples/Component/Collision/Response/StickContactForceField.scn b/examples/Component/Collision/Response/StickContactForceField.scn index 63697c499e3..ba68b21f947 100644 --- a/examples/Component/Collision/Response/StickContactForceField.scn +++ b/examples/Component/Collision/Response/StickContactForceField.scn @@ -7,7 +7,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_NNCG.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_NNCG.scn index 8143a0b8b77..201c76de4b5 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_NNCG.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_NNCG.scn @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_PGS.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_PGS.scn index 581493c9a7d..5fc230e98e7 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_PGS.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_PGS.scn @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Rigid.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Rigid.scn index 146afa64ecf..09c5dc050c8 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Rigid.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Rigid.scn @@ -10,7 +10,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -35,7 +35,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Soft_Rigid_Bodies.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Soft_Rigid_Bodies.scn index c2d0a378527..9ebbf30d9b1 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Soft_Rigid_Bodies.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_Soft_Rigid_Bodies.scn @@ -16,7 +16,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_UGS.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_UGS.scn index 8fe59e02085..efa5035de90 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_UGS.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_UGS.scn @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -74,7 +74,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -126,7 +126,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_solvable.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_solvable.scn index 50a18bccc44..b1dc64d0d86 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_solvable.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_solvable.scn @@ -8,7 +8,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -92,7 +92,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_unsolvable.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_unsolvable.scn index 7fd22bb172c..e072154dea5 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_unsolvable.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_regularization_unsolvable.scn @@ -8,7 +8,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_svd_regularization_solvable.scn b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_svd_regularization_solvable.scn index 00ad020b2d4..a0bbcb9bd28 100644 --- a/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_svd_regularization_solvable.scn +++ b/examples/Component/Constraint/Lagrangian/BilateralLagrangianConstraint_with_svd_regularization_solvable.scn @@ -8,7 +8,7 @@ - + @@ -43,7 +43,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/Contact_ImprovedJacobi.scn b/examples/Component/Constraint/Lagrangian/Contact_ImprovedJacobi.scn index 9840c00c195..a9f4d913012 100644 --- a/examples/Component/Constraint/Lagrangian/Contact_ImprovedJacobi.scn +++ b/examples/Component/Constraint/Lagrangian/Contact_ImprovedJacobi.scn @@ -13,7 +13,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Rigid3.scn b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Rigid3.scn index cd75bca3912..1ff16e2267a 100644 --- a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Rigid3.scn +++ b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Rigid3.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn index 239afbdd290..dba1f6bcdea 100644 --- a/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn +++ b/examples/Component/Constraint/Lagrangian/FixedLagrangianConstaint_Vec3.scn @@ -10,7 +10,7 @@ - + @@ -35,7 +35,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_with_friction.scn b/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_with_friction.scn index 479cbf29afd..6ca7f3cf780 100644 --- a/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_with_friction.scn +++ b/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_with_friction.scn @@ -12,7 +12,7 @@ - + @@ -28,12 +28,12 @@ - + - + diff --git a/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_without_friction.scn b/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_without_friction.scn index 808f55e0f8a..033d50dedbf 100644 --- a/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_without_friction.scn +++ b/examples/Component/Constraint/Lagrangian/FrictionContact_LCP_without_friction.scn @@ -12,7 +12,7 @@ - + @@ -28,12 +28,12 @@ - + - + diff --git a/examples/Component/Constraint/Lagrangian/FrictionContact_VelocityConstraints.scn b/examples/Component/Constraint/Lagrangian/FrictionContact_VelocityConstraints.scn index a7ccbabe7d4..c9d95c4b3cf 100644 --- a/examples/Component/Constraint/Lagrangian/FrictionContact_VelocityConstraints.scn +++ b/examples/Component/Constraint/Lagrangian/FrictionContact_VelocityConstraints.scn @@ -10,7 +10,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/InextensiblePendulum.scn b/examples/Component/Constraint/Lagrangian/InextensiblePendulum.scn index 153b51cd62d..412f1b7ae14 100644 --- a/examples/Component/Constraint/Lagrangian/InextensiblePendulum.scn +++ b/examples/Component/Constraint/Lagrangian/InextensiblePendulum.scn @@ -15,7 +15,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/NonBuiltConstraintCorrection.scn b/examples/Component/Constraint/Lagrangian/NonBuiltConstraintCorrection.scn index b7b55eb3b9d..09dac77c4a1 100644 --- a/examples/Component/Constraint/Lagrangian/NonBuiltConstraintCorrection.scn +++ b/examples/Component/Constraint/Lagrangian/NonBuiltConstraintCorrection.scn @@ -10,8 +10,8 @@ - - + + @@ -26,12 +26,12 @@ - + - + @@ -48,10 +48,10 @@ - + - + @@ -70,7 +70,7 @@ - + @@ -87,10 +87,10 @@ - + - + diff --git a/examples/Component/Constraint/Lagrangian/PreconditionedConjugateResidual.scn b/examples/Component/Constraint/Lagrangian/PreconditionedConjugateResidual.scn index 447e325ed94..fe120f70225 100644 --- a/examples/Component/Constraint/Lagrangian/PreconditionedConjugateResidual.scn +++ b/examples/Component/Constraint/Lagrangian/PreconditionedConjugateResidual.scn @@ -10,7 +10,7 @@ - + @@ -35,7 +35,7 @@ - + diff --git a/examples/Component/Constraint/Lagrangian/SlidingLagrangianConstraint.scn b/examples/Component/Constraint/Lagrangian/SlidingLagrangianConstraint.scn index a6cbd24625c..1c4f69bd877 100644 --- a/examples/Component/Constraint/Lagrangian/SlidingLagrangianConstraint.scn +++ b/examples/Component/Constraint/Lagrangian/SlidingLagrangianConstraint.scn @@ -12,7 +12,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -58,7 +58,7 @@ - + diff --git a/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint.scn b/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint.scn index d0cb06511ef..e31e837b506 100644 --- a/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint3D.scn b/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint3D.scn index e5a50a84ffb..8efcd1e5997 100644 --- a/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint3D.scn +++ b/examples/Component/Constraint/Projective/AffineMovementProjectiveConstraint3D.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Constraint/Projective/AttachProjectiveConstraint.scn b/examples/Component/Constraint/Projective/AttachProjectiveConstraint.scn index 795c1ce1c0f..36594488c77 100644 --- a/examples/Component/Constraint/Projective/AttachProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/AttachProjectiveConstraint.scn @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -72,7 +72,7 @@ - + diff --git a/examples/Component/Constraint/Projective/AttachProjectiveConstraintMatrix.scn b/examples/Component/Constraint/Projective/AttachProjectiveConstraintMatrix.scn index ae12ace9201..2443d886ef0 100644 --- a/examples/Component/Constraint/Projective/AttachProjectiveConstraintMatrix.scn +++ b/examples/Component/Constraint/Projective/AttachProjectiveConstraintMatrix.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Constraint/Projective/BilinearConstraint3D.scn b/examples/Component/Constraint/Projective/BilinearConstraint3D.scn index a3e3f1946fb..0de900d1f77 100644 --- a/examples/Component/Constraint/Projective/BilinearConstraint3D.scn +++ b/examples/Component/Constraint/Projective/BilinearConstraint3D.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Constraint/Projective/BoxConstraint.scn b/examples/Component/Constraint/Projective/BoxConstraint.scn index d6878f8ba53..64c316b3acb 100644 --- a/examples/Component/Constraint/Projective/BoxConstraint.scn +++ b/examples/Component/Constraint/Projective/BoxConstraint.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Projective/DirectionProjectiveConstraint.scn b/examples/Component/Constraint/Projective/DirectionProjectiveConstraint.scn index b14afd54927..bad046eb64b 100644 --- a/examples/Component/Constraint/Projective/DirectionProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/DirectionProjectiveConstraint.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/examples/Component/Constraint/Projective/FixedPlaneProjectiveConstraint.scn b/examples/Component/Constraint/Projective/FixedPlaneProjectiveConstraint.scn index 049bb305e3c..efabff87ecd 100644 --- a/examples/Component/Constraint/Projective/FixedPlaneProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/FixedPlaneProjectiveConstraint.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Projective/FixedProjectiveConstraint.scn b/examples/Component/Constraint/Projective/FixedProjectiveConstraint.scn index 4c35e32512f..68f631ce3e8 100644 --- a/examples/Component/Constraint/Projective/FixedProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/FixedProjectiveConstraint.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Constraint/Projective/FixedRotationProjectiveConstraint.scn b/examples/Component/Constraint/Projective/FixedRotationProjectiveConstraint.scn index a75c22e6c90..53eeb7c2a92 100644 --- a/examples/Component/Constraint/Projective/FixedRotationProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/FixedRotationProjectiveConstraint.scn @@ -6,7 +6,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/Constraint/Projective/HermiteSplineProjectiveConstraint.scn b/examples/Component/Constraint/Projective/HermiteSplineProjectiveConstraint.scn index 333dd716e00..78705209463 100644 --- a/examples/Component/Constraint/Projective/HermiteSplineProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/HermiteSplineProjectiveConstraint.scn @@ -2,12 +2,12 @@ - + - + diff --git a/examples/Component/Constraint/Projective/LineProjectiveConstraint.scn b/examples/Component/Constraint/Projective/LineProjectiveConstraint.scn index 154d59fd95b..aeecda3ab5e 100644 --- a/examples/Component/Constraint/Projective/LineProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/LineProjectiveConstraint.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/examples/Component/Constraint/Projective/LinearMovementProjectiveConstraint.scn b/examples/Component/Constraint/Projective/LinearMovementProjectiveConstraint.scn index 616488569a9..4d296621a78 100644 --- a/examples/Component/Constraint/Projective/LinearMovementProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/LinearMovementProjectiveConstraint.scn @@ -5,14 +5,14 @@ - + - + - + - + - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint.scn b/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint.scn index 5d506af507d..5332536aa36 100644 --- a/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint_rigid.scn b/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint_rigid.scn index d3d1dbefcdd..75148b91adc 100644 --- a/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint_rigid.scn +++ b/examples/Component/Constraint/Projective/OscillatorProjectiveConstraint_rigid.scn @@ -1,12 +1,12 @@ - + - + diff --git a/examples/Component/Constraint/Projective/ParabolicProjectiveConstraint.scn b/examples/Component/Constraint/Projective/ParabolicProjectiveConstraint.scn index 8d97da02204..7f7a7420317 100644 --- a/examples/Component/Constraint/Projective/ParabolicProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/ParabolicProjectiveConstraint.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Constraint/Projective/PartialFixedProjectiveConstraint.scn b/examples/Component/Constraint/Projective/PartialFixedProjectiveConstraint.scn index 9bde024a554..9ae4eba7957 100644 --- a/examples/Component/Constraint/Projective/PartialFixedProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/PartialFixedProjectiveConstraint.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Constraint/Projective/PatchTestConstraint.scn b/examples/Component/Constraint/Projective/PatchTestConstraint.scn index 21a364e3682..b8579440fa2 100644 --- a/examples/Component/Constraint/Projective/PatchTestConstraint.scn +++ b/examples/Component/Constraint/Projective/PatchTestConstraint.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Constraint/Projective/PlaneConstraint.scn b/examples/Component/Constraint/Projective/PlaneConstraint.scn index ccffd245606..c9852a8e4ed 100644 --- a/examples/Component/Constraint/Projective/PlaneConstraint.scn +++ b/examples/Component/Constraint/Projective/PlaneConstraint.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Constraint/Projective/PlaneProjectiveConstraint.scn b/examples/Component/Constraint/Projective/PlaneProjectiveConstraint.scn index 22705de3a08..281701b93c7 100644 --- a/examples/Component/Constraint/Projective/PlaneProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/PlaneProjectiveConstraint.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/Constraint/Projective/PointProjectiveConstraint.scn b/examples/Component/Constraint/Projective/PointProjectiveConstraint.scn index 364ccf94bcd..932e45c69a3 100644 --- a/examples/Component/Constraint/Projective/PointProjectiveConstraint.scn +++ b/examples/Component/Constraint/Projective/PointProjectiveConstraint.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/examples/Component/Controller/MechanicalStateController.scn b/examples/Component/Controller/MechanicalStateController.scn index 864242f6434..7f4cc382846 100644 --- a/examples/Component/Controller/MechanicalStateController.scn +++ b/examples/Component/Controller/MechanicalStateController.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Controller/MechanicalStateControllerTranslation.scn b/examples/Component/Controller/MechanicalStateControllerTranslation.scn index edb8bbedde0..579473fe430 100644 --- a/examples/Component/Controller/MechanicalStateControllerTranslation.scn +++ b/examples/Component/Controller/MechanicalStateControllerTranslation.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Diffusion/TetrahedronDiffusionFEMForceField.scn b/examples/Component/Diffusion/TetrahedronDiffusionFEMForceField.scn index c763bd78fad..1c193d15cdd 100644 --- a/examples/Component/Diffusion/TetrahedronDiffusionFEMForceField.scn +++ b/examples/Component/Diffusion/TetrahedronDiffusionFEMForceField.scn @@ -6,7 +6,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Component/Engine/Analyze/ShapeMatching.scn b/examples/Component/Engine/Analyze/ShapeMatching.scn index 47822d4edc0..500aa4cb3e9 100644 --- a/examples/Component/Engine/Analyze/ShapeMatching.scn +++ b/examples/Component/Engine/Analyze/ShapeMatching.scn @@ -10,7 +10,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Engine/GL/TextureInterpolation.scn b/examples/Component/Engine/GL/TextureInterpolation.scn index ccdd0e2dab9..93e56aa1a77 100644 --- a/examples/Component/Engine/GL/TextureInterpolation.scn +++ b/examples/Component/Engine/GL/TextureInterpolation.scn @@ -4,7 +4,7 @@ - + @@ -23,7 +23,7 @@ - + - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/Engine/Generate/GenerateGrid.scn b/examples/Component/Engine/Generate/GenerateGrid.scn index dc27589ba69..83b37fb905c 100644 --- a/examples/Component/Engine/Generate/GenerateGrid.scn +++ b/examples/Component/Engine/Generate/GenerateGrid.scn @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Component/Engine/Generate/MergeMeshes.scn b/examples/Component/Engine/Generate/MergeMeshes.scn index 69953da06d8..cec6d6dfc83 100644 --- a/examples/Component/Engine/Generate/MergeMeshes.scn +++ b/examples/Component/Engine/Generate/MergeMeshes.scn @@ -3,14 +3,14 @@ - + - + diff --git a/examples/Component/Engine/Generate/MergePoints.scn b/examples/Component/Engine/Generate/MergePoints.scn index 88fdd5d16d8..8d71dae2ad4 100644 --- a/examples/Component/Engine/Generate/MergePoints.scn +++ b/examples/Component/Engine/Generate/MergePoints.scn @@ -11,7 +11,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/examples/Component/Engine/Generate/MeshTetraStuffing.scn b/examples/Component/Engine/Generate/MeshTetraStuffing.scn index 222d8ea6345..f4d562cfb6f 100644 --- a/examples/Component/Engine/Generate/MeshTetraStuffing.scn +++ b/examples/Component/Engine/Generate/MeshTetraStuffing.scn @@ -7,7 +7,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Engine/Select/BoxROI_1d.scn b/examples/Component/Engine/Select/BoxROI_1d.scn index 7112661daca..151a464ea7e 100644 --- a/examples/Component/Engine/Select/BoxROI_1d.scn +++ b/examples/Component/Engine/Select/BoxROI_1d.scn @@ -4,7 +4,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/examples/Component/Engine/Select/BoxROI_2d.scn b/examples/Component/Engine/Select/BoxROI_2d.scn index 6a30fd0421a..ac1c248ea86 100644 --- a/examples/Component/Engine/Select/BoxROI_2d.scn +++ b/examples/Component/Engine/Select/BoxROI_2d.scn @@ -4,7 +4,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/examples/Component/Engine/Select/MeshROI.scn b/examples/Component/Engine/Select/MeshROI.scn index f4e2cc29398..1f8f3253b67 100644 --- a/examples/Component/Engine/Select/MeshROI.scn +++ b/examples/Component/Engine/Select/MeshROI.scn @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/examples/Component/Engine/Select/MeshSplittingEngine.scn b/examples/Component/Engine/Select/MeshSplittingEngine.scn index 560fd1e8244..3e8f5ef46fb 100644 --- a/examples/Component/Engine/Select/MeshSplittingEngine.scn +++ b/examples/Component/Engine/Select/MeshSplittingEngine.scn @@ -9,7 +9,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Engine/Select/NearestPointROI.scn b/examples/Component/Engine/Select/NearestPointROI.scn index 18ec70b8b44..05a6bbc547a 100644 --- a/examples/Component/Engine/Select/NearestPointROI.scn +++ b/examples/Component/Engine/Select/NearestPointROI.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ This Node shows how NearestPointROI is used to create constraints to link close vertices --> - + @@ -36,14 +36,14 @@ - + - + @@ -52,7 +52,7 @@ - + @@ -66,7 +66,7 @@ This Node shows how NearestPointROI is used to create SubsetMultiMapping and EdgeSetTopologyContainer. --> - + @@ -75,14 +75,14 @@ - + - + @@ -91,7 +91,7 @@ - + - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Engine/Select/PointsFromIndices.scn b/examples/Component/Engine/Select/PointsFromIndices.scn index 206571960e0..cc0425e2570 100644 --- a/examples/Component/Engine/Select/PointsFromIndices.scn +++ b/examples/Component/Engine/Select/PointsFromIndices.scn @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/Engine/Select/ProximityROI.scn b/examples/Component/Engine/Select/ProximityROI.scn index e3113ff0791..de5a3b2bdce 100644 --- a/examples/Component/Engine/Select/ProximityROI.scn +++ b/examples/Component/Engine/Select/ProximityROI.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Engine/Select/SphereROI.scn b/examples/Component/Engine/Select/SphereROI.scn index 1da9c2c7744..39c4137559f 100644 --- a/examples/Component/Engine/Select/SphereROI.scn +++ b/examples/Component/Engine/Select/SphereROI.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Engine/Select/SubsetTopology.scn b/examples/Component/Engine/Select/SubsetTopology.scn index b3db9dacd73..f7aca297c5a 100644 --- a/examples/Component/Engine/Select/SubsetTopology.scn +++ b/examples/Component/Engine/Select/SubsetTopology.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Engine/Select/SubsetTopology_localIndicesOption.scn b/examples/Component/Engine/Select/SubsetTopology_localIndicesOption.scn index 0c1c247a289..f6589c8b716 100644 --- a/examples/Component/Engine/Select/SubsetTopology_localIndicesOption.scn +++ b/examples/Component/Engine/Select/SubsetTopology_localIndicesOption.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Engine/Select/SubsetTopology_refiningMesh.scn b/examples/Component/Engine/Select/SubsetTopology_refiningMesh.scn index 3c7c4963c03..12ba7f7e00d 100644 --- a/examples/Component/Engine/Select/SubsetTopology_refiningMesh.scn +++ b/examples/Component/Engine/Select/SubsetTopology_refiningMesh.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Engine/Select/SubsetTopology_subsetbehaviormodel.scn b/examples/Component/Engine/Select/SubsetTopology_subsetbehaviormodel.scn index d6d7f019af5..b5b2614ebf8 100644 --- a/examples/Component/Engine/Select/SubsetTopology_subsetbehaviormodel.scn +++ b/examples/Component/Engine/Select/SubsetTopology_subsetbehaviormodel.scn @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Engine/Select/SubsetTopology_withtetrahedra.scn b/examples/Component/Engine/Select/SubsetTopology_withtetrahedra.scn index 04b1a7f8cc5..c0f0c604889 100644 --- a/examples/Component/Engine/Select/SubsetTopology_withtetrahedra.scn +++ b/examples/Component/Engine/Select/SubsetTopology_withtetrahedra.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Engine/Select/ValuesFromPositions_vectorField.scn b/examples/Component/Engine/Select/ValuesFromPositions_vectorField.scn index d504d9728c1..ab72c346912 100644 --- a/examples/Component/Engine/Select/ValuesFromPositions_vectorField.scn +++ b/examples/Component/Engine/Select/ValuesFromPositions_vectorField.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Engine/Transform/DisplacementMatrixEngine.scn b/examples/Component/Engine/Transform/DisplacementMatrixEngine.scn index d45708ee824..773fc1bb04c 100644 --- a/examples/Component/Engine/Transform/DisplacementMatrixEngine.scn +++ b/examples/Component/Engine/Transform/DisplacementMatrixEngine.scn @@ -3,14 +3,14 @@ - + - + diff --git a/examples/Component/Engine/Transform/TransformEngine.scn b/examples/Component/Engine/Transform/TransformEngine.scn index 3d66c4afcf5..ed5484e53bf 100644 --- a/examples/Component/Engine/Transform/TransformEngine.scn +++ b/examples/Component/Engine/Transform/TransformEngine.scn @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Engine/Transform/TransformPosition.scn b/examples/Component/Engine/Transform/TransformPosition.scn index 0e9dcf6075d..5e2665cf9ab 100644 --- a/examples/Component/Engine/Transform/TransformPosition.scn +++ b/examples/Component/Engine/Transform/TransformPosition.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/IO/Mesh/GIDMeshLoader.scn b/examples/Component/IO/Mesh/GIDMeshLoader.scn index 4807a9fa50d..76a7942c2b6 100644 --- a/examples/Component/IO/Mesh/GIDMeshLoader.scn +++ b/examples/Component/IO/Mesh/GIDMeshLoader.scn @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Component/IO/Mesh/GridMeshCreator.scn b/examples/Component/IO/Mesh/GridMeshCreator.scn index 91268ad1abc..41020e5f721 100644 --- a/examples/Component/IO/Mesh/GridMeshCreator.scn +++ b/examples/Component/IO/Mesh/GridMeshCreator.scn @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/IO/Mesh/LiverUseNewLoaders.scn b/examples/Component/IO/Mesh/LiverUseNewLoaders.scn index c3fc3077d57..fa2fc97db9a 100644 --- a/examples/Component/IO/Mesh/LiverUseNewLoaders.scn +++ b/examples/Component/IO/Mesh/LiverUseNewLoaders.scn @@ -9,7 +9,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/IO/Mesh/MeshGmshLoader.scn b/examples/Component/IO/Mesh/MeshGmshLoader.scn index 8dbfa7da3f7..5a744dc6b68 100644 --- a/examples/Component/IO/Mesh/MeshGmshLoader.scn +++ b/examples/Component/IO/Mesh/MeshGmshLoader.scn @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/examples/Component/IO/Mesh/MeshOffLoader.scn b/examples/Component/IO/Mesh/MeshOffLoader.scn index 68d753d2282..76b21e3164a 100644 --- a/examples/Component/IO/Mesh/MeshOffLoader.scn +++ b/examples/Component/IO/Mesh/MeshOffLoader.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/IO/Mesh/MeshTrianLoader.scn b/examples/Component/IO/Mesh/MeshTrianLoader.scn index 8abeafe8b4b..751d0202a4a 100644 --- a/examples/Component/IO/Mesh/MeshTrianLoader.scn +++ b/examples/Component/IO/Mesh/MeshTrianLoader.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/IO/Mesh/OBJExporter.scn b/examples/Component/IO/Mesh/OBJExporter.scn index 30805407b21..37475c1330d 100644 --- a/examples/Component/IO/Mesh/OBJExporter.scn +++ b/examples/Component/IO/Mesh/OBJExporter.scn @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Component/IO/Mesh/VoxelGridLoader.scn b/examples/Component/IO/Mesh/VoxelGridLoader.scn index 292149e5b84..070f580fea2 100644 --- a/examples/Component/IO/Mesh/VoxelGridLoader.scn +++ b/examples/Component/IO/Mesh/VoxelGridLoader.scn @@ -1,12 +1,12 @@ - + - + diff --git a/examples/Component/ODESolver/Backward/BDFOdeSolver.scn b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme.scn similarity index 82% rename from examples/Component/ODESolver/Backward/BDFOdeSolver.scn rename to examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme.scn index 825f0c36869..b88c781783d 100644 --- a/examples/Component/ODESolver/Backward/BDFOdeSolver.scn +++ b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme.scn @@ -9,7 +9,7 @@ - + @@ -22,13 +22,7 @@ - - + diff --git a/examples/Component/ODESolver/Backward/BDFOdeSolver_spring1d.scn b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring1d.scn similarity index 73% rename from examples/Component/ODESolver/Backward/BDFOdeSolver_spring1d.scn rename to examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring1d.scn index b8ee9ec6c6e..5cefa8730d1 100644 --- a/examples/Component/ODESolver/Backward/BDFOdeSolver_spring1d.scn +++ b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring1d.scn @@ -2,7 +2,7 @@ - + @@ -16,8 +16,7 @@ - - + @@ -28,8 +27,7 @@ - - + @@ -40,8 +38,7 @@ - - + diff --git a/examples/Component/ODESolver/Backward/BDFOdeSolver_spring3d.scn b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring3d.scn similarity index 74% rename from examples/Component/ODESolver/Backward/BDFOdeSolver_spring3d.scn rename to examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring3d.scn index b6b7a250fee..b7b977c16c2 100644 --- a/examples/Component/ODESolver/Backward/BDFOdeSolver_spring3d.scn +++ b/examples/Component/IntegrationSchemes/Backward/BDFOdeIntegrationScheme_spring3d.scn @@ -4,7 +4,7 @@ - + @@ -18,8 +18,7 @@ - - + @@ -32,8 +31,7 @@ - - + @@ -46,8 +44,7 @@ - - + diff --git a/examples/Component/ODESolver/Backward/EulerImplicitSolver-comparison.scn b/examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme-comparison.scn similarity index 91% rename from examples/Component/ODESolver/Backward/EulerImplicitSolver-comparison.scn rename to examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme-comparison.scn index 4d6e908736f..6de9f6296a6 100644 --- a/examples/Component/ODESolver/Backward/EulerImplicitSolver-comparison.scn +++ b/examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme-comparison.scn @@ -5,7 +5,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -63,7 +63,7 @@ - + diff --git a/examples/Component/ODESolver/Backward/EulerImplicitSolver.scn b/examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme.scn similarity index 91% rename from examples/Component/ODESolver/Backward/EulerImplicitSolver.scn rename to examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme.scn index b19277c1ea7..2e025ba5caf 100644 --- a/examples/Component/ODESolver/Backward/EulerImplicitSolver.scn +++ b/examples/Component/IntegrationSchemes/Backward/EulerImplicitIntegrationScheme.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/ODESolver/Backward/NewmarkImplicitSolver.scn b/examples/Component/IntegrationSchemes/Backward/NewmarkIntegrationScheme.scn similarity index 92% rename from examples/Component/ODESolver/Backward/NewmarkImplicitSolver.scn rename to examples/Component/IntegrationSchemes/Backward/NewmarkIntegrationScheme.scn index c8ba0ec4c47..950ad9c64dc 100644 --- a/examples/Component/ODESolver/Backward/NewmarkImplicitSolver.scn +++ b/examples/Component/IntegrationSchemes/Backward/NewmarkIntegrationScheme.scn @@ -5,7 +5,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/examples/Component/ODESolver/Backward/StaticSolver.scn b/examples/Component/IntegrationSchemes/Backward/StaticSolver.scn similarity index 83% rename from examples/Component/ODESolver/Backward/StaticSolver.scn rename to examples/Component/IntegrationSchemes/Backward/StaticSolver.scn index c13769146fe..1df47d8fe1d 100644 --- a/examples/Component/ODESolver/Backward/StaticSolver.scn +++ b/examples/Component/IntegrationSchemes/Backward/StaticSolver.scn @@ -5,7 +5,7 @@ - + @@ -25,9 +25,8 @@ - - + @@ -42,9 +41,7 @@ - - + @@ -59,9 +56,7 @@ - - + diff --git a/examples/Component/ODESolver/Backward/StaticSolver.scn.view b/examples/Component/IntegrationSchemes/Backward/StaticSolver.scn.view similarity index 100% rename from examples/Component/ODESolver/Backward/StaticSolver.scn.view rename to examples/Component/IntegrationSchemes/Backward/StaticSolver.scn.view diff --git a/examples/Component/ODESolver/Forward/DampVelocitySolver.scn b/examples/Component/IntegrationSchemes/Forward/DampVelocityIntegrationScheme.scn similarity index 82% rename from examples/Component/ODESolver/Forward/DampVelocitySolver.scn rename to examples/Component/IntegrationSchemes/Forward/DampVelocityIntegrationScheme.scn index f8a3aa96562..4ed4dac1e71 100644 --- a/examples/Component/ODESolver/Forward/DampVelocitySolver.scn +++ b/examples/Component/IntegrationSchemes/Forward/DampVelocityIntegrationScheme.scn @@ -2,8 +2,8 @@ - - + + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/ODESolver/Forward/DampVelocitySolver.scn.view b/examples/Component/IntegrationSchemes/Forward/DampVelocityIntegrationScheme.scn.view similarity index 100% rename from examples/Component/ODESolver/Forward/DampVelocitySolver.scn.view rename to examples/Component/IntegrationSchemes/Forward/DampVelocityIntegrationScheme.scn.view diff --git a/examples/Component/ODESolver/Forward/EulerExplicitSolver.scn b/examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme.scn similarity index 91% rename from examples/Component/ODESolver/Forward/EulerExplicitSolver.scn rename to examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme.scn index 375b0cb820b..75eabacb4dc 100644 --- a/examples/Component/ODESolver/Forward/EulerExplicitSolver.scn +++ b/examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme.scn @@ -1,6 +1,6 @@ - + @@ -27,7 +27,7 @@ trivially, it requires a linear solver, here SparseLDLSolver. - + diff --git a/examples/Component/ODESolver/Forward/EulerExplicitSolver_diagonal.scn b/examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme_diagonal.scn similarity index 90% rename from examples/Component/ODESolver/Forward/EulerExplicitSolver_diagonal.scn rename to examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme_diagonal.scn index b3813c75865..9372e77b963 100644 --- a/examples/Component/ODESolver/Forward/EulerExplicitSolver_diagonal.scn +++ b/examples/Component/IntegrationSchemes/Forward/EulerExplicitIntegrationScheme_diagonal.scn @@ -1,6 +1,6 @@ - + @@ -27,7 +27,7 @@ trivially, it does not require a linear solver. - + diff --git a/examples/Component/ODESolver/Forward/EulerSymplecticSolver.scn b/examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme.scn similarity index 89% rename from examples/Component/ODESolver/Forward/EulerSymplecticSolver.scn rename to examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme.scn index 63bb581c5ae..f26b896dea5 100644 --- a/examples/Component/ODESolver/Forward/EulerSymplecticSolver.scn +++ b/examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme.scn @@ -1,6 +1,6 @@ - + @@ -21,7 +21,7 @@ trivially, it requires a linear solver, here SparseLDLSolver. - + diff --git a/examples/Component/ODESolver/Forward/EulerSymplecticSolver_diagonal.scn b/examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme_diagonal.scn similarity index 89% rename from examples/Component/ODESolver/Forward/EulerSymplecticSolver_diagonal.scn rename to examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme_diagonal.scn index 5f0d477c2b1..6d5a16ee507 100644 --- a/examples/Component/ODESolver/Forward/EulerSymplecticSolver_diagonal.scn +++ b/examples/Component/IntegrationSchemes/Forward/EulerSymplecticIntegrationScheme_diagonal.scn @@ -1,6 +1,6 @@ - + @@ -22,7 +22,7 @@ trivially, it does not require a linear solver. - + diff --git a/examples/Component/ODESolver/Forward/RungeKutta4Solver.scn b/examples/Component/IntegrationSchemes/Forward/RungeKutta4IntegrationScheme.scn similarity index 91% rename from examples/Component/ODESolver/Forward/RungeKutta4Solver.scn rename to examples/Component/IntegrationSchemes/Forward/RungeKutta4IntegrationScheme.scn index 2b6a37515a9..39519b5dde3 100644 --- a/examples/Component/ODESolver/Forward/RungeKutta4Solver.scn +++ b/examples/Component/IntegrationSchemes/Forward/RungeKutta4IntegrationScheme.scn @@ -5,7 +5,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/ODESolver/Forward/RungeKutta4Solver.scn.view b/examples/Component/IntegrationSchemes/Forward/RungeKutta4IntegrationScheme.scn.view similarity index 100% rename from examples/Component/ODESolver/Forward/RungeKutta4Solver.scn.view rename to examples/Component/IntegrationSchemes/Forward/RungeKutta4IntegrationScheme.scn.view diff --git a/examples/Component/LinearSolver/Direct/Eigen3-SVD.scn b/examples/Component/LinearSolver/Direct/Eigen3-SVD.scn index 644adda8cfa..616320aabbc 100644 --- a/examples/Component/LinearSolver/Direct/Eigen3-SVD.scn +++ b/examples/Component/LinearSolver/Direct/Eigen3-SVD.scn @@ -4,7 +4,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Component/LinearSolver/Direct/FEMBAR_SVDLinearSolver.scn b/examples/Component/LinearSolver/Direct/FEMBAR_SVDLinearSolver.scn index 890ac13f14e..1dfd5310aa0 100644 --- a/examples/Component/LinearSolver/Direct/FEMBAR_SVDLinearSolver.scn +++ b/examples/Component/LinearSolver/Direct/FEMBAR_SVDLinearSolver.scn @@ -4,7 +4,7 @@ - + diff --git a/examples/Component/LinearSolver/FEMBAR-common.xml b/examples/Component/LinearSolver/FEMBAR-common.xml index 36a7ea2f858..b55397009fb 100644 --- a/examples/Component/LinearSolver/FEMBAR-common.xml +++ b/examples/Component/LinearSolver/FEMBAR-common.xml @@ -4,7 +4,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/examples/Component/LinearSolver/Iterative/CGLinearSolver.scn b/examples/Component/LinearSolver/Iterative/CGLinearSolver.scn index ab156740437..748161b11d5 100644 --- a/examples/Component/LinearSolver/Iterative/CGLinearSolver.scn +++ b/examples/Component/LinearSolver/Iterative/CGLinearSolver.scn @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/examples/Component/LinearSystem/CompositeLinearSystem.scn b/examples/Component/LinearSystem/CompositeLinearSystem.scn index 5da0669d1a2..b08139b3e67 100644 --- a/examples/Component/LinearSystem/CompositeLinearSystem.scn +++ b/examples/Component/LinearSystem/CompositeLinearSystem.scn @@ -6,7 +6,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/LinearSystem/ConstantSparsityPatternSystem.scn b/examples/Component/LinearSystem/ConstantSparsityPatternSystem.scn index 4b7ff0bf454..8f3b13dc3bd 100644 --- a/examples/Component/LinearSystem/ConstantSparsityPatternSystem.scn +++ b/examples/Component/LinearSystem/ConstantSparsityPatternSystem.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/LinearSystem/MatrixLinearSystem.scn b/examples/Component/LinearSystem/MatrixLinearSystem.scn index 7471d6273e6..dcdcd31b182 100644 --- a/examples/Component/LinearSystem/MatrixLinearSystem.scn +++ b/examples/Component/LinearSystem/MatrixLinearSystem.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/LinearSystem/PendulumSpringsDistanceMapping.scn b/examples/Component/LinearSystem/PendulumSpringsDistanceMapping.scn index 9169e7b178f..b0cb3817b03 100644 --- a/examples/Component/LinearSystem/PendulumSpringsDistanceMapping.scn +++ b/examples/Component/LinearSystem/PendulumSpringsDistanceMapping.scn @@ -13,7 +13,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/examples/Component/Mapping/Linear/BarycentricMapping.scn b/examples/Component/Mapping/Linear/BarycentricMapping.scn index 3eb39286311..c99496a770b 100644 --- a/examples/Component/Mapping/Linear/BarycentricMapping.scn +++ b/examples/Component/Mapping/Linear/BarycentricMapping.scn @@ -9,7 +9,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -160,7 +160,7 @@ - + @@ -183,7 +183,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -241,7 +241,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -310,7 +310,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -367,7 +367,7 @@ - + @@ -389,7 +389,7 @@ - + @@ -411,7 +411,7 @@ - + @@ -445,7 +445,7 @@ - + @@ -465,7 +465,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -505,7 +505,7 @@ - + diff --git a/examples/Component/Mapping/Linear/BarycentricMappingTrussBeam.scn b/examples/Component/Mapping/Linear/BarycentricMappingTrussBeam.scn index 877dee6f79c..a055a4d0f08 100644 --- a/examples/Component/Mapping/Linear/BarycentricMappingTrussBeam.scn +++ b/examples/Component/Mapping/Linear/BarycentricMappingTrussBeam.scn @@ -10,7 +10,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Mapping/Linear/BarycentricTetraMapping.scn b/examples/Component/Mapping/Linear/BarycentricTetraMapping.scn index c04ee6147cc..db2bd428c20 100644 --- a/examples/Component/Mapping/Linear/BarycentricTetraMapping.scn +++ b/examples/Component/Mapping/Linear/BarycentricTetraMapping.scn @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/examples/Component/Mapping/Linear/CenterOfMassMapping.scn b/examples/Component/Mapping/Linear/CenterOfMassMapping.scn index a49d7d86002..ea87e364628 100644 --- a/examples/Component/Mapping/Linear/CenterOfMassMapping.scn +++ b/examples/Component/Mapping/Linear/CenterOfMassMapping.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + - + @@ -38,7 +38,7 @@ - + diff --git a/examples/Component/Mapping/Linear/DeformableOnRigidFrameMappingConstraints.scn b/examples/Component/Mapping/Linear/DeformableOnRigidFrameMappingConstraints.scn index bacae8e56c8..58d0be3207a 100644 --- a/examples/Component/Mapping/Linear/DeformableOnRigidFrameMappingConstraints.scn +++ b/examples/Component/Mapping/Linear/DeformableOnRigidFrameMappingConstraints.scn @@ -13,7 +13,7 @@ - + @@ -42,14 +42,14 @@ - + - + diff --git a/examples/Component/Mapping/Linear/DistanceToPlaneMapping.scn b/examples/Component/Mapping/Linear/DistanceToPlaneMapping.scn index e06da18f118..428ae06aa76 100644 --- a/examples/Component/Mapping/Linear/DistanceToPlaneMapping.scn +++ b/examples/Component/Mapping/Linear/DistanceToPlaneMapping.scn @@ -7,7 +7,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Component/Mapping/Linear/IdentityMapping.scn b/examples/Component/Mapping/Linear/IdentityMapping.scn index 665a44ac84e..9f260bcfaba 100644 --- a/examples/Component/Mapping/Linear/IdentityMapping.scn +++ b/examples/Component/Mapping/Linear/IdentityMapping.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Mapping/Linear/IdentityMultiMapping.scn b/examples/Component/Mapping/Linear/IdentityMultiMapping.scn index 8950162206c..98e5c313fa0 100644 --- a/examples/Component/Mapping/Linear/IdentityMultiMapping.scn +++ b/examples/Component/Mapping/Linear/IdentityMultiMapping.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Mapping/Linear/SimpleTesselatedTetraTopologicalMapping.scn b/examples/Component/Mapping/Linear/SimpleTesselatedTetraTopologicalMapping.scn index 53a93878f81..cfa9b07150c 100644 --- a/examples/Component/Mapping/Linear/SimpleTesselatedTetraTopologicalMapping.scn +++ b/examples/Component/Mapping/Linear/SimpleTesselatedTetraTopologicalMapping.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Mapping/Linear/SkinningMapping.scn b/examples/Component/Mapping/Linear/SkinningMapping.scn index 52fbc9d8268..16ae777c522 100644 --- a/examples/Component/Mapping/Linear/SkinningMapping.scn +++ b/examples/Component/Mapping/Linear/SkinningMapping.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Mapping/Linear/SubsetMapping.scn b/examples/Component/Mapping/Linear/SubsetMapping.scn index bc1fb517334..e00373bd256 100644 --- a/examples/Component/Mapping/Linear/SubsetMapping.scn +++ b/examples/Component/Mapping/Linear/SubsetMapping.scn @@ -9,7 +9,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Mapping/Linear/SubsetMultiMapping.scn b/examples/Component/Mapping/Linear/SubsetMultiMapping.scn index 4128aebe75c..5b7d56d5508 100644 --- a/examples/Component/Mapping/Linear/SubsetMultiMapping.scn +++ b/examples/Component/Mapping/Linear/SubsetMultiMapping.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/AreaMapping.scn b/examples/Component/Mapping/NonLinear/AreaMapping.scn index 4a7dba37dc2..bfaf0e1b738 100644 --- a/examples/Component/Mapping/NonLinear/AreaMapping.scn +++ b/examples/Component/Mapping/NonLinear/AreaMapping.scn @@ -11,7 +11,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -57,7 +57,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/DistanceFromTargetMapping.scn b/examples/Component/Mapping/NonLinear/DistanceFromTargetMapping.scn index 7bfe6c489a8..31f3d2e7692 100644 --- a/examples/Component/Mapping/NonLinear/DistanceFromTargetMapping.scn +++ b/examples/Component/Mapping/NonLinear/DistanceFromTargetMapping.scn @@ -4,7 +4,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/DistanceMapping.scn b/examples/Component/Mapping/NonLinear/DistanceMapping.scn index 661f104b989..7988c32a07f 100644 --- a/examples/Component/Mapping/NonLinear/DistanceMapping.scn +++ b/examples/Component/Mapping/NonLinear/DistanceMapping.scn @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/DistanceMultiMapping.scn b/examples/Component/Mapping/NonLinear/DistanceMultiMapping.scn index 214469f0d06..1ad0e2fb93e 100644 --- a/examples/Component/Mapping/NonLinear/DistanceMultiMapping.scn +++ b/examples/Component/Mapping/NonLinear/DistanceMultiMapping.scn @@ -9,7 +9,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/RigidMapping-basic.scn b/examples/Component/Mapping/NonLinear/RigidMapping-basic.scn index e331d587b0a..b7fd425fa77 100644 --- a/examples/Component/Mapping/NonLinear/RigidMapping-basic.scn +++ b/examples/Component/Mapping/NonLinear/RigidMapping-basic.scn @@ -5,14 +5,14 @@ - + - + diff --git a/examples/Component/Mapping/NonLinear/RigidMapping.scn b/examples/Component/Mapping/NonLinear/RigidMapping.scn index 73fd5efa1fe..2ccfe4aca26 100644 --- a/examples/Component/Mapping/NonLinear/RigidMapping.scn +++ b/examples/Component/Mapping/NonLinear/RigidMapping.scn @@ -8,7 +8,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/RigidMapping2d-basic.scn b/examples/Component/Mapping/NonLinear/RigidMapping2d-basic.scn index dd512deef01..69d8ce4179b 100644 --- a/examples/Component/Mapping/NonLinear/RigidMapping2d-basic.scn +++ b/examples/Component/Mapping/NonLinear/RigidMapping2d-basic.scn @@ -5,15 +5,15 @@ - + - - + + diff --git a/examples/Component/Mapping/NonLinear/RigidRigidMapping-basic.scn b/examples/Component/Mapping/NonLinear/RigidRigidMapping-basic.scn index 9f021cbe6d2..75d50b49e7c 100644 --- a/examples/Component/Mapping/NonLinear/RigidRigidMapping-basic.scn +++ b/examples/Component/Mapping/NonLinear/RigidRigidMapping-basic.scn @@ -5,7 +5,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/RigidRigidMapping.scn b/examples/Component/Mapping/NonLinear/RigidRigidMapping.scn index 12c7572451c..45d32d49437 100644 --- a/examples/Component/Mapping/NonLinear/RigidRigidMapping.scn +++ b/examples/Component/Mapping/NonLinear/RigidRigidMapping.scn @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/SquareDistanceMapping.scn b/examples/Component/Mapping/NonLinear/SquareDistanceMapping.scn index bcd67c95072..5aa9d7a35cf 100644 --- a/examples/Component/Mapping/NonLinear/SquareDistanceMapping.scn +++ b/examples/Component/Mapping/NonLinear/SquareDistanceMapping.scn @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/SquareMapping.scn b/examples/Component/Mapping/NonLinear/SquareMapping.scn index 881cfde4cd3..36c76aab02f 100644 --- a/examples/Component/Mapping/NonLinear/SquareMapping.scn +++ b/examples/Component/Mapping/NonLinear/SquareMapping.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/examples/Component/Mapping/NonLinear/VolumeMapping.scn b/examples/Component/Mapping/NonLinear/VolumeMapping.scn index a709699d0f6..2d89e571569 100644 --- a/examples/Component/Mapping/NonLinear/VolumeMapping.scn +++ b/examples/Component/Mapping/NonLinear/VolumeMapping.scn @@ -11,7 +11,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Mass/DiagonalMass.scn b/examples/Component/Mass/DiagonalMass.scn index 90ab445d606..0e48ca4b81d 100644 --- a/examples/Component/Mass/DiagonalMass.scn +++ b/examples/Component/Mass/DiagonalMass.scn @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Mass/MeshMatrixMass.scn b/examples/Component/Mass/MeshMatrixMass.scn index 52e91aa0016..b3c1b8cdf99 100644 --- a/examples/Component/Mass/MeshMatrixMass.scn +++ b/examples/Component/Mass/MeshMatrixMass.scn @@ -9,7 +9,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Mass/UniformMass.scn b/examples/Component/Mass/UniformMass.scn index dbb75173b02..71ddacfb023 100644 --- a/examples/Component/Mass/UniformMass.scn +++ b/examples/Component/Mass/UniformMass.scn @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Component/MechanicalLoad/BoxConstantForceField.scn b/examples/Component/MechanicalLoad/BoxConstantForceField.scn index 836e390d2ea..015c3b3c985 100644 --- a/examples/Component/MechanicalLoad/BoxConstantForceField.scn +++ b/examples/Component/MechanicalLoad/BoxConstantForceField.scn @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/MechanicalLoad/ConicalForceField.scn b/examples/Component/MechanicalLoad/ConicalForceField.scn index 2583f448ba1..50685dc8a79 100644 --- a/examples/Component/MechanicalLoad/ConicalForceField.scn +++ b/examples/Component/MechanicalLoad/ConicalForceField.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/MechanicalLoad/ConstantForceField.scn b/examples/Component/MechanicalLoad/ConstantForceField.scn index 1b37c217df4..93bb0e887c1 100644 --- a/examples/Component/MechanicalLoad/ConstantForceField.scn +++ b/examples/Component/MechanicalLoad/ConstantForceField.scn @@ -5,7 +5,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/examples/Component/MechanicalLoad/EdgePressureForceField.scn b/examples/Component/MechanicalLoad/EdgePressureForceField.scn index 85152e0f546..ba83c95c961 100644 --- a/examples/Component/MechanicalLoad/EdgePressureForceField.scn +++ b/examples/Component/MechanicalLoad/EdgePressureForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/MechanicalLoad/EllipsoidForceField.scn b/examples/Component/MechanicalLoad/EllipsoidForceField.scn index 433478cc798..f8300095a80 100644 --- a/examples/Component/MechanicalLoad/EllipsoidForceField.scn +++ b/examples/Component/MechanicalLoad/EllipsoidForceField.scn @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/MechanicalLoad/InteractionEllipsoidForceField.scn b/examples/Component/MechanicalLoad/InteractionEllipsoidForceField.scn index b8897cc0df7..a138d4c0120 100644 --- a/examples/Component/MechanicalLoad/InteractionEllipsoidForceField.scn +++ b/examples/Component/MechanicalLoad/InteractionEllipsoidForceField.scn @@ -9,8 +9,8 @@ - - + + @@ -25,13 +25,13 @@ - + - + diff --git a/examples/Component/MechanicalLoad/LinearForceField.scn b/examples/Component/MechanicalLoad/LinearForceField.scn index a3c5f749ffe..69fb67c981b 100644 --- a/examples/Component/MechanicalLoad/LinearForceField.scn +++ b/examples/Component/MechanicalLoad/LinearForceField.scn @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/MechanicalLoad/PlaneForceField.scn b/examples/Component/MechanicalLoad/PlaneForceField.scn index 0cc0bc907ab..bc27d94f132 100644 --- a/examples/Component/MechanicalLoad/PlaneForceField.scn +++ b/examples/Component/MechanicalLoad/PlaneForceField.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/MechanicalLoad/SphereForceField.scn b/examples/Component/MechanicalLoad/SphereForceField.scn index e44e681c3d3..0f438405fbc 100644 --- a/examples/Component/MechanicalLoad/SphereForceField.scn +++ b/examples/Component/MechanicalLoad/SphereForceField.scn @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/MechanicalLoad/SurfacePressureForceField.scn b/examples/Component/MechanicalLoad/SurfacePressureForceField.scn index 4f97c3e32b7..72e4ee1020a 100644 --- a/examples/Component/MechanicalLoad/SurfacePressureForceField.scn +++ b/examples/Component/MechanicalLoad/SurfacePressureForceField.scn @@ -10,7 +10,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/examples/Component/MechanicalLoad/TaitSurfacePressureForceField.scn b/examples/Component/MechanicalLoad/TaitSurfacePressureForceField.scn index 6fefd15eeff..c8ebf276bfc 100644 --- a/examples/Component/MechanicalLoad/TaitSurfacePressureForceField.scn +++ b/examples/Component/MechanicalLoad/TaitSurfacePressureForceField.scn @@ -10,7 +10,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/MechanicalLoad/TrianglePressureForceField.scn b/examples/Component/MechanicalLoad/TrianglePressureForceField.scn index 859672a5d56..10b31685c4c 100644 --- a/examples/Component/MechanicalLoad/TrianglePressureForceField.scn +++ b/examples/Component/MechanicalLoad/TrianglePressureForceField.scn @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/ODESolver/Backward/VariationalSymplecticSolver.scn b/examples/Component/ODESolver/Backward/VariationalSymplecticSolver.scn deleted file mode 100644 index 948fe2a86f6..00000000000 --- a/examples/Component/ODESolver/Backward/VariationalSymplecticSolver.scn +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Component/Playback/CompareState.scn b/examples/Component/Playback/CompareState.scn index 1c7c33ad999..2c3227a793d 100644 --- a/examples/Component/Playback/CompareState.scn +++ b/examples/Component/Playback/CompareState.scn @@ -4,7 +4,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/examples/Component/Playback/WriteState.scn b/examples/Component/Playback/WriteState.scn index 24ccc548946..86838108563 100644 --- a/examples/Component/Playback/WriteState.scn +++ b/examples/Component/Playback/WriteState.scn @@ -4,7 +4,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/examples/Component/SceneUtility/Gravity.scn b/examples/Component/SceneUtility/Gravity.scn index 4b77b6cbf08..beaf9bfb724 100644 --- a/examples/Component/SceneUtility/Gravity.scn +++ b/examples/Component/SceneUtility/Gravity.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/examples/Component/Setting/ViewerSetting.scn b/examples/Component/Setting/ViewerSetting.scn index 8197262de44..84d09df1790 100644 --- a/examples/Component/Setting/ViewerSetting.scn +++ b/examples/Component/Setting/ViewerSetting.scn @@ -11,7 +11,7 @@ - + @@ -40,7 +40,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/BeamFEMForceField.scn b/examples/Component/SolidMechanics/FEM/BeamFEMForceField.scn index 4fa2fb19e20..b3f9c620905 100644 --- a/examples/Component/SolidMechanics/FEM/BeamFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/BeamFEMForceField.scn @@ -12,7 +12,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/DampingForceField.scn b/examples/Component/SolidMechanics/FEM/DampingForceField.scn index 095fe077aee..4dcb8a00000 100644 --- a/examples/Component/SolidMechanics/FEM/DampingForceField.scn +++ b/examples/Component/SolidMechanics/FEM/DampingForceField.scn @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/FastTetrahedralCorotationalForceField.scn b/examples/Component/SolidMechanics/FEM/FastTetrahedralCorotationalForceField.scn index e110d14f9bd..088bae6db4e 100644 --- a/examples/Component/SolidMechanics/FEM/FastTetrahedralCorotationalForceField.scn +++ b/examples/Component/SolidMechanics/FEM/FastTetrahedralCorotationalForceField.scn @@ -4,7 +4,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -74,7 +74,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/FastTetrahedronCorotationalForceField_validation.scn b/examples/Component/SolidMechanics/FEM/FastTetrahedronCorotationalForceField_validation.scn index f50746e0abb..18e44faf8ad 100644 --- a/examples/Component/SolidMechanics/FEM/FastTetrahedronCorotationalForceField_validation.scn +++ b/examples/Component/SolidMechanics/FEM/FastTetrahedronCorotationalForceField_validation.scn @@ -10,7 +10,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/Heterogeneous-TetrahedronFEMForceField.scn b/examples/Component/SolidMechanics/FEM/Heterogeneous-TetrahedronFEMForceField.scn index b3c6b4d63a9..c9242ab643c 100644 --- a/examples/Component/SolidMechanics/FEM/Heterogeneous-TetrahedronFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/Heterogeneous-TetrahedronFEMForceField.scn @@ -12,7 +12,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedralFEMForceField.scn b/examples/Component/SolidMechanics/FEM/HexahedralFEMForceField.scn index d597a79fc44..b7d10bdf735 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedralFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedralFEMForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedralFEMForceFieldAndMass.scn b/examples/Component/SolidMechanics/FEM/HexahedralFEMForceFieldAndMass.scn index ce911e7a242..e4d1d91fc8c 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedralFEMForceFieldAndMass.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedralFEMForceFieldAndMass.scn @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn b/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn index bb74183bbd8..7a8c3639c48 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMForceFieldAndMass.scn @@ -9,7 +9,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMMapping.scn b/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMMapping.scn index 2ed75797281..c6722d445e5 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMMapping.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedronCompositeFEMMapping.scn @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedronFEMForceField.scn b/examples/Component/SolidMechanics/FEM/HexahedronFEMForceField.scn index d932c8d2f84..7f7016918d7 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedronFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedronFEMForceField.scn @@ -7,7 +7,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/HexahedronFEMForceFieldAndMass.scn b/examples/Component/SolidMechanics/FEM/HexahedronFEMForceFieldAndMass.scn index 65754c4878a..dcd62de21b6 100644 --- a/examples/Component/SolidMechanics/FEM/HexahedronFEMForceFieldAndMass.scn +++ b/examples/Component/SolidMechanics/FEM/HexahedronFEMForceFieldAndMass.scn @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/NonUniformHexahedronFEMForceFieldAndMass.scn b/examples/Component/SolidMechanics/FEM/NonUniformHexahedronFEMForceFieldAndMass.scn index a9aa05ff7fe..2dca74f292c 100644 --- a/examples/Component/SolidMechanics/FEM/NonUniformHexahedronFEMForceFieldAndMass.scn +++ b/examples/Component/SolidMechanics/FEM/NonUniformHexahedronFEMForceFieldAndMass.scn @@ -6,7 +6,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/QuadBendingFEMForceField.scn b/examples/Component/SolidMechanics/FEM/QuadBendingFEMForceField.scn index 7ff7d217b00..bd36d976e8a 100644 --- a/examples/Component/SolidMechanics/FEM/QuadBendingFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/QuadBendingFEMForceField.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/RestShapeSpringsForceField3.scn b/examples/Component/SolidMechanics/FEM/RestShapeSpringsForceField3.scn index b125c562173..1ecbb10f0ab 100644 --- a/examples/Component/SolidMechanics/FEM/RestShapeSpringsForceField3.scn +++ b/examples/Component/SolidMechanics/FEM/RestShapeSpringsForceField3.scn @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -103,7 +103,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedralCorotationalFEMForceField.scn b/examples/Component/SolidMechanics/FEM/TetrahedralCorotationalFEMForceField.scn index 5e57e25fb55..b1b24189b23 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedralCorotationalFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedralCorotationalFEMForceField.scn @@ -5,7 +5,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField.scn b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField.scn index 81d756aa93e..162711eb257 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField.scn @@ -4,7 +4,7 @@ - + @@ -15,30 +15,30 @@ - - - + + + - - + + - - - - + + + + - - + + + - - - + + + - - + + @@ -49,51 +49,51 @@ - - + - - - + + + - - + + - - - - + + + + - - + + + - - - + + + - - - + + + - - + + - - - - + + + + - - + + + - - - + + + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_Chain.scn b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_Chain.scn index 4d5dd87dd27..9dfa4746689 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_Chain.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_Chain.scn @@ -8,7 +8,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_assemble.scn b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_assemble.scn index e4df6231a6a..d27ec4fb04a 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_assemble.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_assemble.scn @@ -4,7 +4,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_plasticity.scn b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_plasticity.scn index f95eaa79ba7..fb9a8c82f07 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_plasticity.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronFEMForceField_plasticity.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField.scn b/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField.scn index b888ca94ff4..d95b9a71f95 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField.scn @@ -7,7 +7,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField_invertedTets.scn b/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField_invertedTets.scn index c08754a7e30..aaa6f6d6394 100644 --- a/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField_invertedTets.scn +++ b/examples/Component/SolidMechanics/FEM/TetrahedronHyperelasticityFEMForceField_invertedTets.scn @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TopoMap_cylinder3d.scn b/examples/Component/SolidMechanics/FEM/TopoMap_cylinder3d.scn index 3b03a2524c4..d37119014cb 100644 --- a/examples/Component/SolidMechanics/FEM/TopoMap_cylinder3d.scn +++ b/examples/Component/SolidMechanics/FEM/TopoMap_cylinder3d.scn @@ -11,7 +11,7 @@ - + @@ -28,8 +28,8 @@ - - + + diff --git a/examples/Component/SolidMechanics/FEM/TriangleFEMForceField.scn b/examples/Component/SolidMechanics/FEM/TriangleFEMForceField.scn index 43e38fd76fe..08e29b1cc1b 100644 --- a/examples/Component/SolidMechanics/FEM/TriangleFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/TriangleFEMForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TriangularFEMForceField.scn b/examples/Component/SolidMechanics/FEM/TriangularFEMForceField.scn index a89f825bd8f..f43ccb13fa8 100644 --- a/examples/Component/SolidMechanics/FEM/TriangularFEMForceField.scn +++ b/examples/Component/SolidMechanics/FEM/TriangularFEMForceField.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/SolidMechanics/FEM/TriangularFEMForceFieldOptim.scn b/examples/Component/SolidMechanics/FEM/TriangularFEMForceFieldOptim.scn index 57dfd734156..1d833d51e96 100644 --- a/examples/Component/SolidMechanics/FEM/TriangularFEMForceFieldOptim.scn +++ b/examples/Component/SolidMechanics/FEM/TriangularFEMForceFieldOptim.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -117,7 +117,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/FastTriangularBendingSprings.scn b/examples/Component/SolidMechanics/Spring/FastTriangularBendingSprings.scn index 58fe4ee9799..d90f8940096 100644 --- a/examples/Component/SolidMechanics/Spring/FastTriangularBendingSprings.scn +++ b/examples/Component/SolidMechanics/Spring/FastTriangularBendingSprings.scn @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/GearSpringForceField.scn b/examples/Component/SolidMechanics/Spring/GearSpringForceField.scn index 7672045962c..85e83a5f383 100644 --- a/examples/Component/SolidMechanics/Spring/GearSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/GearSpringForceField.scn @@ -6,7 +6,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/JointSpringForceField.scn b/examples/Component/SolidMechanics/Spring/JointSpringForceField.scn index 1a3d28195a5..58dae6d4125 100644 --- a/examples/Component/SolidMechanics/Spring/JointSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/JointSpringForceField.scn @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/MeshSpringForceField.scn b/examples/Component/SolidMechanics/Spring/MeshSpringForceField.scn index 634cde5b5d9..d16a196d872 100644 --- a/examples/Component/SolidMechanics/Spring/MeshSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/MeshSpringForceField.scn @@ -8,7 +8,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -71,7 +71,7 @@ - + @@ -92,7 +92,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/PolynomialRestShapeSpringsForceField.scn b/examples/Component/SolidMechanics/Spring/PolynomialRestShapeSpringsForceField.scn index 0b0a5dda90f..a4aead7ebca 100644 --- a/examples/Component/SolidMechanics/Spring/PolynomialRestShapeSpringsForceField.scn +++ b/examples/Component/SolidMechanics/Spring/PolynomialRestShapeSpringsForceField.scn @@ -1,7 +1,7 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/PolynomialSpringsForceField.scn b/examples/Component/SolidMechanics/Spring/PolynomialSpringsForceField.scn index e6eb3cb0964..d9970871d82 100644 --- a/examples/Component/SolidMechanics/Spring/PolynomialSpringsForceField.scn +++ b/examples/Component/SolidMechanics/Spring/PolynomialSpringsForceField.scn @@ -5,7 +5,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/QuadBendingSprings.scn b/examples/Component/SolidMechanics/Spring/QuadBendingSprings.scn index 168cedd6361..9d20325bf86 100644 --- a/examples/Component/SolidMechanics/Spring/QuadBendingSprings.scn +++ b/examples/Component/SolidMechanics/Spring/QuadBendingSprings.scn @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/QuadularBendingSprings.scn b/examples/Component/SolidMechanics/Spring/QuadularBendingSprings.scn index 4483d441154..6356411d6ad 100644 --- a/examples/Component/SolidMechanics/Spring/QuadularBendingSprings.scn +++ b/examples/Component/SolidMechanics/Spring/QuadularBendingSprings.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/RegularGridSpringForceField.scn b/examples/Component/SolidMechanics/Spring/RegularGridSpringForceField.scn index b1d16494944..dad8cae18dc 100644 --- a/examples/Component/SolidMechanics/Spring/RegularGridSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/RegularGridSpringForceField.scn @@ -7,7 +7,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField.scn b/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField.scn index 006d21c183f..57ffd9a0229 100644 --- a/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField.scn +++ b/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField.scn @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField2.scn b/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField2.scn index 68aef3dfc62..c464c93ebf2 100644 --- a/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField2.scn +++ b/examples/Component/SolidMechanics/Spring/RestShapeSpringsForceField2.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/StiffSpringForceField.scn b/examples/Component/SolidMechanics/Spring/StiffSpringForceField.scn index 6bd33f216c1..33d94cd43bd 100644 --- a/examples/Component/SolidMechanics/Spring/StiffSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/StiffSpringForceField.scn @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/StiffSpringForceField_simple.scn b/examples/Component/SolidMechanics/Spring/StiffSpringForceField_simple.scn index f8571e4887d..57051cbe95d 100644 --- a/examples/Component/SolidMechanics/Spring/StiffSpringForceField_simple.scn +++ b/examples/Component/SolidMechanics/Spring/StiffSpringForceField_simple.scn @@ -4,7 +4,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/TriangleBendingSprings.scn b/examples/Component/SolidMechanics/Spring/TriangleBendingSprings.scn index 808512d9630..4bfbec3c0de 100644 --- a/examples/Component/SolidMechanics/Spring/TriangleBendingSprings.scn +++ b/examples/Component/SolidMechanics/Spring/TriangleBendingSprings.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -54,7 +54,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/TriangularBendingSprings.scn b/examples/Component/SolidMechanics/Spring/TriangularBendingSprings.scn index 45c85d9451e..94a51a6e779 100644 --- a/examples/Component/SolidMechanics/Spring/TriangularBendingSprings.scn +++ b/examples/Component/SolidMechanics/Spring/TriangularBendingSprings.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/TriangularBiquadraticSpringsForceField.scn b/examples/Component/SolidMechanics/Spring/TriangularBiquadraticSpringsForceField.scn index 75de06ae75a..1abae9ba73d 100644 --- a/examples/Component/SolidMechanics/Spring/TriangularBiquadraticSpringsForceField.scn +++ b/examples/Component/SolidMechanics/Spring/TriangularBiquadraticSpringsForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/TriangularQuadraticSpringsForceField.scn b/examples/Component/SolidMechanics/Spring/TriangularQuadraticSpringsForceField.scn index 66d00268354..1644a1e678c 100644 --- a/examples/Component/SolidMechanics/Spring/TriangularQuadraticSpringsForceField.scn +++ b/examples/Component/SolidMechanics/Spring/TriangularQuadraticSpringsForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/SolidMechanics/Spring/angularSpringForceField.scn b/examples/Component/SolidMechanics/Spring/angularSpringForceField.scn index 1e061a313de..068f264d756 100644 --- a/examples/Component/SolidMechanics/Spring/angularSpringForceField.scn +++ b/examples/Component/SolidMechanics/Spring/angularSpringForceField.scn @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/examples/Component/SolidMechanics/TensorMass/TetrahedralTensorMassForceField.scn b/examples/Component/SolidMechanics/TensorMass/TetrahedralTensorMassForceField.scn index 21ec6ae5900..95ddb39251d 100644 --- a/examples/Component/SolidMechanics/TensorMass/TetrahedralTensorMassForceField.scn +++ b/examples/Component/SolidMechanics/TensorMass/TetrahedralTensorMassForceField.scn @@ -5,7 +5,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/SolidMechanics/TensorMass/TriangularTensorMassForceField.scn b/examples/Component/SolidMechanics/TensorMass/TriangularTensorMassForceField.scn index 3475f3095a4..c5fe686a5bf 100644 --- a/examples/Component/SolidMechanics/TensorMass/TriangularTensorMassForceField.scn +++ b/examples/Component/SolidMechanics/TensorMass/TriangularTensorMassForceField.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Constant/CubeTopology.scn b/examples/Component/Topology/Container/Constant/CubeTopology.scn index c436dc459db..e71b96340e8 100644 --- a/examples/Component/Topology/Container/Constant/CubeTopology.scn +++ b/examples/Component/Topology/Container/Constant/CubeTopology.scn @@ -6,7 +6,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Constant/MeshTopology.scn b/examples/Component/Topology/Container/Constant/MeshTopology.scn index bc554588d20..85762e1377e 100644 --- a/examples/Component/Topology/Container/Constant/MeshTopology.scn +++ b/examples/Component/Topology/Container/Constant/MeshTopology.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingHexa2QuadProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingHexa2QuadProcess.scn index 7ebf9eb0c35..e6cfc9708e6 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingHexa2QuadProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingHexa2QuadProcess.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingQuad2TriangleProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingQuad2TriangleProcess.scn index 9ab165971fb..2e3043a9f8a 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingQuad2TriangleProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingQuad2TriangleProcess.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingTetra2TriangleProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingTetra2TriangleProcess.scn index e143a1b0bd7..3223cc9c755 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingTetra2TriangleProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingTetra2TriangleProcess.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingTetraProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingTetraProcess.scn index 3df2c66ef06..26681a28141 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingTetraProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingTetraProcess.scn @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingTriangle2EdgeProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingTriangle2EdgeProcess.scn index 8f1b9a7a0a2..569c5fce120 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingTriangle2EdgeProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingTriangle2EdgeProcess.scn @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/AddingTrianglesProcess.scn b/examples/Component/Topology/Container/Dynamic/AddingTrianglesProcess.scn index f911d0d5722..a551e951f85 100644 --- a/examples/Component/Topology/Container/Dynamic/AddingTrianglesProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/AddingTrianglesProcess.scn @@ -7,7 +7,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/HexahedronForceFieldTopologyChangeHandling.scn b/examples/Component/Topology/Container/Dynamic/HexahedronForceFieldTopologyChangeHandling.scn index 5dab8950306..31b3dab99d1 100644 --- a/examples/Component/Topology/Container/Dynamic/HexahedronForceFieldTopologyChangeHandling.scn +++ b/examples/Component/Topology/Container/Dynamic/HexahedronForceFieldTopologyChangeHandling.scn @@ -7,7 +7,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/IncisionTrianglesProcess.scn b/examples/Component/Topology/Container/Dynamic/IncisionTrianglesProcess.scn index 96e5f3d8237..55c30185586 100644 --- a/examples/Component/Topology/Container/Dynamic/IncisionTrianglesProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/IncisionTrianglesProcess.scn @@ -8,7 +8,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/QuadForceFieldTopologyChangeHandling.scn b/examples/Component/Topology/Container/Dynamic/QuadForceFieldTopologyChangeHandling.scn index 5159967c4b1..687d13deee6 100644 --- a/examples/Component/Topology/Container/Dynamic/QuadForceFieldTopologyChangeHandling.scn +++ b/examples/Component/Topology/Container/Dynamic/QuadForceFieldTopologyChangeHandling.scn @@ -8,7 +8,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -54,7 +54,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingBilateralInteractionConstraint.scn b/examples/Component/Topology/Container/Dynamic/RemovingBilateralInteractionConstraint.scn index 074e4f01ecf..f696f6ad9ae 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingBilateralInteractionConstraint.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingBilateralInteractionConstraint.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ This Node shows how NearestPointROI is used to create constraints to link close vertices --> - + @@ -51,7 +51,7 @@ - + @@ -64,7 +64,7 @@ - + - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingHexa2TetraProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingHexa2TetraProcess.scn index 33700cd1406..11d40e1efff 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingHexa2TetraProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingHexa2TetraProcess.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingPointSprings.scn b/examples/Component/Topology/Container/Dynamic/RemovingPointSprings.scn index 8133cd9135a..5c0292458b7 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingPointSprings.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingPointSprings.scn @@ -3,7 +3,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingQuad2TriangleProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingQuad2TriangleProcess.scn index 3dbff5c0081..64fae595a9e 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingQuad2TriangleProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingQuad2TriangleProcess.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess.scn index 92682a241e4..dfee21976c0 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess.scn @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess_performanceTest.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess_performanceTest.scn index efbd87a97c9..f247ad81788 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess_performanceTest.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetra2TriangleProcess_performanceTest.scn @@ -11,7 +11,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options1.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options1.scn index d7113ccb867..d4b7de70cd7 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options1.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options1.scn @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options2.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options2.scn index 103aa6add7f..cb8034d1ab9 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options2.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetra2Triangle_options2.scn @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess.scn index eac62795ff1..b15725aac64 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess.scn @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess_withCollisionModel.scn b/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess_withCollisionModel.scn index 32244e3d1dc..39b8cc8b667 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess_withCollisionModel.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTetraProcess_withCollisionModel.scn @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTriangle2EdgeProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingTriangle2EdgeProcess.scn index 2784a778485..f2ce762a4c7 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTriangle2EdgeProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTriangle2EdgeProcess.scn @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/RemovingTrianglesProcess.scn b/examples/Component/Topology/Container/Dynamic/RemovingTrianglesProcess.scn index 91a4c193560..2875f81c75f 100644 --- a/examples/Component/Topology/Container/Dynamic/RemovingTrianglesProcess.scn +++ b/examples/Component/Topology/Container/Dynamic/RemovingTrianglesProcess.scn @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/TetrahedronForceFieldTopologyChangeHandling.scn b/examples/Component/Topology/Container/Dynamic/TetrahedronForceFieldTopologyChangeHandling.scn index a26a00e51fa..6c91bb7e986 100644 --- a/examples/Component/Topology/Container/Dynamic/TetrahedronForceFieldTopologyChangeHandling.scn +++ b/examples/Component/Topology/Container/Dynamic/TetrahedronForceFieldTopologyChangeHandling.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/examples/Component/Topology/Container/Dynamic/TriangularForceFieldTopologyChangeHandling.scn b/examples/Component/Topology/Container/Dynamic/TriangularForceFieldTopologyChangeHandling.scn index adece7254bc..7d111b3960f 100644 --- a/examples/Component/Topology/Container/Dynamic/TriangularForceFieldTopologyChangeHandling.scn +++ b/examples/Component/Topology/Container/Dynamic/TriangularForceFieldTopologyChangeHandling.scn @@ -11,7 +11,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -106,7 +106,7 @@ - + @@ -125,7 +125,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/CylinderGridTopology.scn b/examples/Component/Topology/Container/Grid/CylinderGridTopology.scn index 496f7be9cdc..e6dfbd7295b 100644 --- a/examples/Component/Topology/Container/Grid/CylinderGridTopology.scn +++ b/examples/Component/Topology/Container/Grid/CylinderGridTopology.scn @@ -4,7 +4,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/RegularGridTopology.scn b/examples/Component/Topology/Container/Grid/RegularGridTopology.scn index 45351893013..1699016e5c0 100644 --- a/examples/Component/Topology/Container/Grid/RegularGridTopology.scn +++ b/examples/Component/Topology/Container/Grid/RegularGridTopology.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/RegularGridTopology_TrianglesMesh.scn b/examples/Component/Topology/Container/Grid/RegularGridTopology_TrianglesMesh.scn index bde2d36b6e2..c7b82e989fa 100644 --- a/examples/Component/Topology/Container/Grid/RegularGridTopology_TrianglesMesh.scn +++ b/examples/Component/Topology/Container/Grid/RegularGridTopology_TrianglesMesh.scn @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/RegularGridTopology_dimension.scn b/examples/Component/Topology/Container/Grid/RegularGridTopology_dimension.scn index 6028a806b77..4e05aafc32c 100644 --- a/examples/Component/Topology/Container/Grid/RegularGridTopology_dimension.scn +++ b/examples/Component/Topology/Container/Grid/RegularGridTopology_dimension.scn @@ -10,7 +10,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/SparseGridMultipleTopology.scn b/examples/Component/Topology/Container/Grid/SparseGridMultipleTopology.scn index 578c6fdcc0c..f5ce236ac41 100644 --- a/examples/Component/Topology/Container/Grid/SparseGridMultipleTopology.scn +++ b/examples/Component/Topology/Container/Grid/SparseGridMultipleTopology.scn @@ -7,7 +7,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/SparseGridRamificationTopology.scn b/examples/Component/Topology/Container/Grid/SparseGridRamificationTopology.scn index fa8b5ee5717..efdd0d75bf0 100644 --- a/examples/Component/Topology/Container/Grid/SparseGridRamificationTopology.scn +++ b/examples/Component/Topology/Container/Grid/SparseGridRamificationTopology.scn @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -70,7 +70,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/SparseGridTopology.scn b/examples/Component/Topology/Container/Grid/SparseGridTopology.scn index 05ff932057e..c4865b37f9d 100644 --- a/examples/Component/Topology/Container/Grid/SparseGridTopology.scn +++ b/examples/Component/Topology/Container/Grid/SparseGridTopology.scn @@ -11,7 +11,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -68,7 +68,7 @@ - + diff --git a/examples/Component/Topology/Container/Grid/SphereGridTopology.scn b/examples/Component/Topology/Container/Grid/SphereGridTopology.scn index 82451b099bf..20b65a40efe 100644 --- a/examples/Component/Topology/Container/Grid/SphereGridTopology.scn +++ b/examples/Component/Topology/Container/Grid/SphereGridTopology.scn @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Edge2QuadTopologicalMapping.scn b/examples/Component/Topology/Mapping/Edge2QuadTopologicalMapping.scn index a1d1fc90150..f7be12d1832 100644 --- a/examples/Component/Topology/Mapping/Edge2QuadTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Edge2QuadTopologicalMapping.scn @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn b/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn index c2867de54c2..0dcc4560c99 100644 --- a/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Hexa2PrismTopologicalMapping.scn @@ -6,7 +6,7 @@ - + @@ -23,8 +23,9 @@ - - + + + diff --git a/examples/Component/Topology/Mapping/Hexa2QuadTopologicalMapping.scn b/examples/Component/Topology/Mapping/Hexa2QuadTopologicalMapping.scn index fd1c30fd33f..7c0d3c000f9 100644 --- a/examples/Component/Topology/Mapping/Hexa2QuadTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Hexa2QuadTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping.scn b/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping.scn index 0d0f670a358..fd14fce459d 100644 --- a/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping_export.scn b/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping_export.scn index 8ed0d65f88f..ff6548441d2 100644 --- a/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping_export.scn +++ b/examples/Component/Topology/Mapping/Hexa2TetraTopologicalMapping_export.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Mesh2PointTopologicalMapping.scn b/examples/Component/Topology/Mapping/Mesh2PointTopologicalMapping.scn index 3bb3519e170..b98141332db 100644 --- a/examples/Component/Topology/Mapping/Mesh2PointTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Mesh2PointTopologicalMapping.scn @@ -9,7 +9,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Quad2TriangleTopologicalMapping.scn b/examples/Component/Topology/Mapping/Quad2TriangleTopologicalMapping.scn index 83772634f28..6ebb10f6238 100644 --- a/examples/Component/Topology/Mapping/Quad2TriangleTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Quad2TriangleTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Mapping/SubsetTopologicalMapping.scn b/examples/Component/Topology/Mapping/SubsetTopologicalMapping.scn index 81e16e8a20c..35b5eedc20a 100644 --- a/examples/Component/Topology/Mapping/SubsetTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/SubsetTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Mapping/SubsetTopologicalMapping2.scn b/examples/Component/Topology/Mapping/SubsetTopologicalMapping2.scn index 4bda98483fc..f606677832d 100644 --- a/examples/Component/Topology/Mapping/SubsetTopologicalMapping2.scn +++ b/examples/Component/Topology/Mapping/SubsetTopologicalMapping2.scn @@ -11,7 +11,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping.scn b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping.scn index ba132539db1..08bf6357308 100644 --- a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping.scn @@ -11,7 +11,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_NoInitialTriangle_option.scn b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_NoInitialTriangle_option.scn index 4ceb4f9c6f6..11930e5bea3 100644 --- a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_NoInitialTriangle_option.scn +++ b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_NoInitialTriangle_option.scn @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_with_TetrahedronModel.scn b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_with_TetrahedronModel.scn index 5c7b4f0baea..f15eb77fb44 100644 --- a/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_with_TetrahedronModel.scn +++ b/examples/Component/Topology/Mapping/Tetra2TriangleTopologicalMapping_with_TetrahedronModel.scn @@ -10,7 +10,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Component/Topology/Mapping/TopoMap_Hexa2Quad2Triangle.scn b/examples/Component/Topology/Mapping/TopoMap_Hexa2Quad2Triangle.scn index 0f78abdace8..cfd03c08967 100644 --- a/examples/Component/Topology/Mapping/TopoMap_Hexa2Quad2Triangle.scn +++ b/examples/Component/Topology/Mapping/TopoMap_Hexa2Quad2Triangle.scn @@ -8,7 +8,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Topology/Mapping/Triangle2EdgeTopologicalMapping.scn b/examples/Component/Topology/Mapping/Triangle2EdgeTopologicalMapping.scn index fdad0cf23ce..15bc6a7b7ba 100644 --- a/examples/Component/Topology/Mapping/Triangle2EdgeTopologicalMapping.scn +++ b/examples/Component/Topology/Mapping/Triangle2EdgeTopologicalMapping.scn @@ -9,7 +9,7 @@ - + diff --git a/examples/Component/Topology/Utility/TopologicalChangeProcessor_useDataInputs_option.scn b/examples/Component/Topology/Utility/TopologicalChangeProcessor_useDataInputs_option.scn index 48c3d514463..f034003ea5c 100644 --- a/examples/Component/Topology/Utility/TopologicalChangeProcessor_useDataInputs_option.scn +++ b/examples/Component/Topology/Utility/TopologicalChangeProcessor_useDataInputs_option.scn @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Component/Topology/Utility/TopologyBoundingTrasher.scn b/examples/Component/Topology/Utility/TopologyBoundingTrasher.scn index 9584d7965e4..cd96ec79e27 100644 --- a/examples/Component/Topology/Utility/TopologyBoundingTrasher.scn +++ b/examples/Component/Topology/Utility/TopologyBoundingTrasher.scn @@ -7,7 +7,7 @@ - + diff --git a/examples/Component/Visual/ClipPlane.scn b/examples/Component/Visual/ClipPlane.scn index a130ef65f39..da18c6112d6 100644 --- a/examples/Component/Visual/ClipPlane.scn +++ b/examples/Component/Visual/ClipPlane.scn @@ -8,7 +8,7 @@ - + diff --git a/examples/Component/Visual/DataDisplay.scn b/examples/Component/Visual/DataDisplay.scn index 6eb9e797d16..d71c76ca769 100644 --- a/examples/Component/Visual/DataDisplay.scn +++ b/examples/Component/Visual/DataDisplay.scn @@ -8,7 +8,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/examples/Component/Visual/DirectionalLight.scn b/examples/Component/Visual/DirectionalLight.scn index f0def9a9d4a..483b2ab3e49 100644 --- a/examples/Component/Visual/DirectionalLight.scn +++ b/examples/Component/Visual/DirectionalLight.scn @@ -7,7 +7,7 @@ - + diff --git a/examples/Component/Visual/LightManager.scn b/examples/Component/Visual/LightManager.scn index 6ba206b80f3..32bcc718117 100644 --- a/examples/Component/Visual/LightManager.scn +++ b/examples/Component/Visual/LightManager.scn @@ -7,7 +7,7 @@ - + diff --git a/examples/Component/Visual/LinearBlendSkinningGPU.scn b/examples/Component/Visual/LinearBlendSkinningGPU.scn index 0e6811ed997..187f9463970 100644 --- a/examples/Component/Visual/LinearBlendSkinningGPU.scn +++ b/examples/Component/Visual/LinearBlendSkinningGPU.scn @@ -3,14 +3,14 @@ - + - + diff --git a/examples/Component/Visual/OglLabel.scn b/examples/Component/Visual/OglLabel.scn index 3a3c295330b..68165b80c05 100644 --- a/examples/Component/Visual/OglLabel.scn +++ b/examples/Component/Visual/OglLabel.scn @@ -5,7 +5,7 @@ - + @@ -19,7 +19,7 @@ - + - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Visual/OglShader_tessellation.scn b/examples/Component/Visual/OglShader_tessellation.scn index af07df247cf..4357d1d7e76 100644 --- a/examples/Component/Visual/OglShader_tessellation.scn +++ b/examples/Component/Visual/OglShader_tessellation.scn @@ -11,7 +11,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Component/Visual/OglViewport.scn b/examples/Component/Visual/OglViewport.scn index 0cf74456ce4..8af37657bd0 100644 --- a/examples/Component/Visual/OglViewport.scn +++ b/examples/Component/Visual/OglViewport.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Component/Visual/PointSplatModel.scn b/examples/Component/Visual/PointSplatModel.scn index 9fdb1fa41d9..306fb1aec26 100644 --- a/examples/Component/Visual/PointSplatModel.scn +++ b/examples/Component/Visual/PointSplatModel.scn @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Component/Visual/PositionalLight.scn b/examples/Component/Visual/PositionalLight.scn index 5414d46073e..f9873146165 100644 --- a/examples/Component/Visual/PositionalLight.scn +++ b/examples/Component/Visual/PositionalLight.scn @@ -7,7 +7,7 @@ - + diff --git a/examples/Component/Visual/PostProcessManager_DepthOfField.scn b/examples/Component/Visual/PostProcessManager_DepthOfField.scn index 4cedf825f85..b25f4ba5e9b 100644 --- a/examples/Component/Visual/PostProcessManager_DepthOfField.scn +++ b/examples/Component/Visual/PostProcessManager_DepthOfField.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Component/Visual/SpotLight.scn b/examples/Component/Visual/SpotLight.scn index 186cd4bd6ca..d88ee21411c 100644 --- a/examples/Component/Visual/SpotLight.scn +++ b/examples/Component/Visual/SpotLight.scn @@ -7,7 +7,7 @@ - + diff --git a/examples/Component/Visual/TrailRenderer.scn b/examples/Component/Visual/TrailRenderer.scn index f97a473368d..82f43c67b63 100644 --- a/examples/Component/Visual/TrailRenderer.scn +++ b/examples/Component/Visual/TrailRenderer.scn @@ -4,7 +4,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Component/Visual/VisualMesh.scn b/examples/Component/Visual/VisualMesh.scn index 6c660de094d..a0e14935c16 100644 --- a/examples/Component/Visual/VisualMesh.scn +++ b/examples/Component/Visual/VisualMesh.scn @@ -2,7 +2,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -39,7 +39,7 @@ - + diff --git a/examples/Component/Visual/VisualPointCloud.scn b/examples/Component/Visual/VisualPointCloud.scn index 7c904a6a79d..b1a5a295a87 100644 --- a/examples/Component/Visual/VisualPointCloud.scn +++ b/examples/Component/Visual/VisualPointCloud.scn @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/examples/Component/Visual/VisualVectorField.scn b/examples/Component/Visual/VisualVectorField.scn index 2f25adec931..bcf43050ef5 100644 --- a/examples/Component/Visual/VisualVectorField.scn +++ b/examples/Component/Visual/VisualVectorField.scn @@ -6,7 +6,7 @@ - + diff --git a/examples/Demos/2d.scn b/examples/Demos/2d.scn index 26a53ca19c8..0eb7053a9c7 100644 --- a/examples/Demos/2d.scn +++ b/examples/Demos/2d.scn @@ -3,14 +3,14 @@ - + - + diff --git a/examples/Demos/2d_explicit.scn b/examples/Demos/2d_explicit.scn index 1b5f43f6ba0..62fbd5e936f 100644 --- a/examples/Demos/2d_explicit.scn +++ b/examples/Demos/2d_explicit.scn @@ -2,14 +2,14 @@ - + - + diff --git a/examples/Demos/MeshInducedAnisotropy.scn b/examples/Demos/MeshInducedAnisotropy.scn index 17855e3280f..3349d432210 100644 --- a/examples/Demos/MeshInducedAnisotropy.scn +++ b/examples/Demos/MeshInducedAnisotropy.scn @@ -17,7 +17,7 @@ - + @@ -33,9 +33,8 @@ - - + @@ -59,9 +58,8 @@ - - + diff --git a/examples/Demos/SofaScene.scn b/examples/Demos/SofaScene.scn index c5c72d5c816..0fea42ca2aa 100644 --- a/examples/Demos/SofaScene.scn +++ b/examples/Demos/SofaScene.scn @@ -20,7 +20,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -91,7 +91,7 @@ - + - + @@ -162,14 +162,14 @@ - + - + @@ -187,7 +187,7 @@ - + @@ -213,7 +213,7 @@ - + diff --git a/examples/Demos/SofaWasher.scn b/examples/Demos/SofaWasher.scn index e806a089ad4..30f9aa340f3 100644 --- a/examples/Demos/SofaWasher.scn +++ b/examples/Demos/SofaWasher.scn @@ -15,7 +15,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/examples/Demos/TriangleSurfaceCutting.scn b/examples/Demos/TriangleSurfaceCutting.scn index 50dbb3633d1..1955d64fbbb 100644 --- a/examples/Demos/TriangleSurfaceCutting.scn +++ b/examples/Demos/TriangleSurfaceCutting.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Demos/caduceus.scn b/examples/Demos/caduceus.scn index 12758214a70..162cc26701c 100644 --- a/examples/Demos/caduceus.scn +++ b/examples/Demos/caduceus.scn @@ -14,7 +14,7 @@ - + @@ -48,13 +48,13 @@ - + - + diff --git a/examples/Demos/caduceus_penalty.scn b/examples/Demos/caduceus_penalty.scn index 3ba5260c53a..9c4671ba9a2 100644 --- a/examples/Demos/caduceus_penalty.scn +++ b/examples/Demos/caduceus_penalty.scn @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/examples/Demos/chainAll.scn b/examples/Demos/chainAll.scn index a80fc259cc5..a6a7283ca6d 100644 --- a/examples/Demos/chainAll.scn +++ b/examples/Demos/chainAll.scn @@ -8,7 +8,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -159,7 +159,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -200,7 +200,7 @@ - + @@ -220,7 +220,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -280,7 +280,7 @@ - + @@ -300,7 +300,7 @@ - + @@ -320,7 +320,7 @@ - + @@ -340,7 +340,7 @@ - + @@ -370,7 +370,7 @@ - + @@ -388,7 +388,7 @@ - + @@ -406,7 +406,7 @@ - + @@ -424,7 +424,7 @@ - + diff --git a/examples/Demos/chainHybrid.scn b/examples/Demos/chainHybrid.scn index c1e57a59390..f3b05ec3ade 100644 --- a/examples/Demos/chainHybrid.scn +++ b/examples/Demos/chainHybrid.scn @@ -9,7 +9,7 @@ - + diff --git a/examples/Demos/chainHybridNoGroup.scn b/examples/Demos/chainHybridNoGroup.scn index 37a4c891a98..8f961025ae3 100644 --- a/examples/Demos/chainHybridNoGroup.scn +++ b/examples/Demos/chainHybridNoGroup.scn @@ -9,7 +9,7 @@ - + diff --git a/examples/Demos/collisionMultiple.scn b/examples/Demos/collisionMultiple.scn index cd2ea9d47cd..443135f833d 100644 --- a/examples/Demos/collisionMultiple.scn +++ b/examples/Demos/collisionMultiple.scn @@ -8,7 +8,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/examples/Demos/collisionMultipleMask.scn b/examples/Demos/collisionMultipleMask.scn index c29afcb42c0..aaf53dff4ea 100644 --- a/examples/Demos/collisionMultipleMask.scn +++ b/examples/Demos/collisionMultipleMask.scn @@ -8,7 +8,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/examples/Demos/fallingBeamAugmentedLagrangianCollision.scn b/examples/Demos/fallingBeamAugmentedLagrangianCollision.scn index ed506194b37..21e9801726b 100644 --- a/examples/Demos/fallingBeamAugmentedLagrangianCollision.scn +++ b/examples/Demos/fallingBeamAugmentedLagrangianCollision.scn @@ -13,7 +13,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/examples/Demos/fallingBeamLagrangianCollision.scn b/examples/Demos/fallingBeamLagrangianCollision.scn index 50b100dfb71..56fb2bcd2ec 100644 --- a/examples/Demos/fallingBeamLagrangianCollision.scn +++ b/examples/Demos/fallingBeamLagrangianCollision.scn @@ -13,7 +13,7 @@ - + @@ -42,7 +42,7 @@ - + diff --git a/examples/Demos/fallingSOFA.scn b/examples/Demos/fallingSOFA.scn index d0a35dd5fa6..bfdaf8f97b6 100644 --- a/examples/Demos/fallingSOFA.scn +++ b/examples/Demos/fallingSOFA.scn @@ -15,7 +15,7 @@ - + @@ -68,7 +68,7 @@ - + diff --git a/examples/Demos/include_test.scn b/examples/Demos/include_test.scn index 3b0b1eed936..5133aa8c6e3 100644 --- a/examples/Demos/include_test.scn +++ b/examples/Demos/include_test.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Demos/liver.scn b/examples/Demos/liver.scn index 6b93edffdef..411396a931f 100644 --- a/examples/Demos/liver.scn +++ b/examples/Demos/liver.scn @@ -1,5 +1,5 @@ - + @@ -9,40 +9,114 @@ - + - - - - - + + - - - + + + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Demos/liverConfiguration.scn b/examples/Demos/liverConfiguration.scn index cccef60617a..1b2acc76d9c 100644 --- a/examples/Demos/liverConfiguration.scn +++ b/examples/Demos/liverConfiguration.scn @@ -9,7 +9,7 @@ - + @@ -41,7 +41,7 @@ - + diff --git a/examples/Demos/mixedPendulum.scn b/examples/Demos/mixedPendulum.scn index 01b5d5f5cc4..d2d75b7c10c 100644 --- a/examples/Demos/mixedPendulum.scn +++ b/examples/Demos/mixedPendulum.scn @@ -2,7 +2,7 @@ - + diff --git a/examples/Demos/oneTetrahedron.scn b/examples/Demos/oneTetrahedron.scn index 7b13d31c3b5..5480307d8c9 100644 --- a/examples/Demos/oneTetrahedron.scn +++ b/examples/Demos/oneTetrahedron.scn @@ -2,7 +2,7 @@ - + diff --git a/examples/Demos/particle.scn b/examples/Demos/particle.scn new file mode 100644 index 00000000000..9e804cad458 --- /dev/null +++ b/examples/Demos/particle.scn @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Demos/rigidifiedSectionsInBeam.scn b/examples/Demos/rigidifiedSectionsInBeam.scn index b4793fc7327..7f394f70ed9 100644 --- a/examples/Demos/rigidifiedSectionsInBeam.scn +++ b/examples/Demos/rigidifiedSectionsInBeam.scn @@ -24,7 +24,7 @@ The distances do not vary over time for the rigidified beam, whereas we can obse - + @@ -37,7 +37,7 @@ The distances do not vary over time for the rigidified beam, whereas we can obse - + @@ -70,7 +70,7 @@ The distances do not vary over time for the rigidified beam, whereas we can obse - + diff --git a/examples/Demos/simpleBoundaryConditions.scn b/examples/Demos/simpleBoundaryConditions.scn index 381f6ba1c0a..6a605b3846d 100644 --- a/examples/Demos/simpleBoundaryConditions.scn +++ b/examples/Demos/simpleBoundaryConditions.scn @@ -6,7 +6,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/examples/Demos/simpleSphere.scn b/examples/Demos/simpleSphere.scn index ecef3e3cd80..3c8872f279c 100644 --- a/examples/Demos/simpleSphere.scn +++ b/examples/Demos/simpleSphere.scn @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Demos/skybox.scn b/examples/Demos/skybox.scn index 22bdd1d6a75..5d7e784f70e 100644 --- a/examples/Demos/skybox.scn +++ b/examples/Demos/skybox.scn @@ -9,7 +9,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/examples/Demos/sofa_1000PR.scn b/examples/Demos/sofa_1000PR.scn index ea246809fd1..4a2e294aafb 100644 --- a/examples/Demos/sofa_1000PR.scn +++ b/examples/Demos/sofa_1000PR.scn @@ -13,7 +13,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -162,7 +162,7 @@ - + diff --git a/examples/Objects/CGImplicit.xml b/examples/Objects/CGImplicit.xml index a29847071af..6b44a2b17ad 100644 --- a/examples/Objects/CGImplicit.xml +++ b/examples/Objects/CGImplicit.xml @@ -1,4 +1,4 @@ - + diff --git a/examples/Objects/CGImplicitSolver.xml b/examples/Objects/CGImplicitSolver.xml index a29847071af..6b44a2b17ad 100644 --- a/examples/Objects/CGImplicitSolver.xml +++ b/examples/Objects/CGImplicitSolver.xml @@ -1,4 +1,4 @@ - + diff --git a/examples/Objects/GridHexaFEM.xml b/examples/Objects/GridHexaFEM.xml index 36c04df5112..8b12f10a867 100644 --- a/examples/Objects/GridHexaFEM.xml +++ b/examples/Objects/GridHexaFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/GridSpring.xml b/examples/Objects/GridSpring.xml index cf0ec28d93a..2a98844de36 100644 --- a/examples/Objects/GridSpring.xml +++ b/examples/Objects/GridSpring.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/GridTetraFEM.xml b/examples/Objects/GridTetraFEM.xml index dd9429e1419..89d7370c1e8 100644 --- a/examples/Objects/GridTetraFEM.xml +++ b/examples/Objects/GridTetraFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/InstrumentCoil.xml b/examples/Objects/InstrumentCoil.xml index 8fe3e9883a9..6da88f0e178 100644 --- a/examples/Objects/InstrumentCoil.xml +++ b/examples/Objects/InstrumentCoil.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/MeshFEM.xml b/examples/Objects/MeshFEM.xml index cf3065515e9..b86524473f9 100644 --- a/examples/Objects/MeshFEM.xml +++ b/examples/Objects/MeshFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/MeshHexaFEM.xml b/examples/Objects/MeshHexaFEM.xml index 17653582531..848d80e7db7 100644 --- a/examples/Objects/MeshHexaFEM.xml +++ b/examples/Objects/MeshHexaFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/MeshSpring.xml b/examples/Objects/MeshSpring.xml index 69de18601d7..43aff9eb3a6 100644 --- a/examples/Objects/MeshSpring.xml +++ b/examples/Objects/MeshSpring.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/MeshTetraFEM.xml b/examples/Objects/MeshTetraFEM.xml index 0ad9b7ac6a2..9bc08918438 100644 --- a/examples/Objects/MeshTetraFEM.xml +++ b/examples/Objects/MeshTetraFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/Rigid.xml b/examples/Objects/Rigid.xml index 6efdd7f80cd..930f1e7ed47 100644 --- a/examples/Objects/Rigid.xml +++ b/examples/Objects/Rigid.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/TorusFEM.xml b/examples/Objects/TorusFEM.xml index 3af39722c17..b226bb56b46 100644 --- a/examples/Objects/TorusFEM.xml +++ b/examples/Objects/TorusFEM.xml @@ -1,5 +1,5 @@ - + diff --git a/examples/Objects/TorusFFD.xml b/examples/Objects/TorusFFD.xml index 88a554d1197..0530ba08236 100644 --- a/examples/Objects/TorusFFD.xml +++ b/examples/Objects/TorusFFD.xml @@ -1,5 +1,5 @@ - + - + diff --git a/examples/Objects/TorusSpring.xml b/examples/Objects/TorusSpring.xml index 65ebc249c8a..76aec3a89a8 100644 --- a/examples/Objects/TorusSpring.xml +++ b/examples/Objects/TorusSpring.xml @@ -1,7 +1,7 @@ - + diff --git a/examples/RegressionStateScenes.regression-tests b/examples/RegressionStateScenes.regression-tests index 856e7e3570a..23c3c011443 100644 --- a/examples/RegressionStateScenes.regression-tests +++ b/examples/RegressionStateScenes.regression-tests @@ -69,10 +69,10 @@ Component/Mass/UniformMass.scn 100 1e-4 0 1 Component/Mass/DiagonalMass.scn 100 1e-4 0 1 Component/Mass/MeshMatrixMass.scn 100 1e-4 0 1 Component/MechanicalLoad/InteractionEllipsoidForceField.scn 100 1e-4 0 1 -Component/ODESolver/Forward/EulerExplicitSolver.scn 3000 1e-4 0 1 -Component/ODESolver/Forward/EulerExplicitSolver_diagonal.scn 3000 1e-4 0 1 -Component/ODESolver/Forward/RungeKutta4Solver.scn 3000 1e-4 0 1 -Component/ODESolver/Backward/EulerImplicitSolver.scn 3000 1e-4 0 1 +Component/IntegrationScheme/Forward/EulerExplicitIntegrationScheme.scn 3000 1e-4 0 1 +Component/IntegrationScheme/Forward/EulerExplicitIntegrationScheme_diagonal.scn 3000 1e-4 0 1 +Component/IntegrationScheme/Forward/RungeKutta4IntegrationScheme.scn 3000 1e-4 0 1 +Component/IntegrationScheme/Backward/EulerImplicitIntegrationScheme.scn 3000 1e-4 0 1 Component/SolidMechanics/FEM/BeamFEMForceField.scn 100 1e-4 0 1 Component/SolidMechanics/FEM/HexahedronFEMForceField.scn 300 1e-4 0 1 Component/SolidMechanics/FEM/HexahedronFEMForceFieldAndMass.scn 100 1e-4 0 1 diff --git a/examples/SimpleAPI/fallingSOFA.cpp b/examples/SimpleAPI/fallingSOFA.cpp index 24ed0ef3b42..bec638c8af7 100644 --- a/examples/SimpleAPI/fallingSOFA.cpp +++ b/examples/SimpleAPI/fallingSOFA.cpp @@ -34,7 +34,7 @@ sofa::simulation::Node::SPtr createScene(const sofa::simpleapi::Simulation::SPtr sofa::simpleapi::importPlugin(Sofa.Component.LinearSolver.Iterative); sofa::simpleapi::importPlugin(Sofa.Component.Mapping.Linear); sofa::simpleapi::importPlugin(Sofa.Component.Mass); - sofa::simpleapi::importPlugin(Sofa.Component.ODESolver.Backward); + sofa::simpleapi::importPlugin(Sofa.Component.IntegrationScheme.Backward); sofa::simpleapi::importPlugin(Sofa.Component.SolidMechanics.FEM.Elastic); sofa::simpleapi::importPlugin(Sofa.Component.StateContainer); sofa::simpleapi::importPlugin(Sofa.Component.Topology.Container.Dynamic); @@ -70,7 +70,7 @@ sofa::simulation::Node::SPtr createScene(const sofa::simpleapi::Simulation::SPtr //Simulated node const sofa::simulation::Node::SPtr FEMechanicalModel = sofa::simpleapi::createChild(root,"FE-MechanicalModel"); - sofa::simpleapi::createObject(FEMechanicalModel, "EulerImplicitSolver"); + sofa::simpleapi::createObject(FEMechanicalModel, "EulerImplicitIntegrationScheme"); sofa::simpleapi::createObject(FEMechanicalModel, "SparseLDLSolver", {{"name","ldl"}, {"template","CompressedRowSparseMatrixMat3x3"}, {"parallelInverseProduct","true"}} ); sofa::simpleapi::createObject(FEMechanicalModel, "TetrahedronSetTopologyContainer", {{"name","Container"}, {"position","@../BeamDomainFromGridTopology/HexaTop.position"}, {"tetrahedra","@../BeamDomainFromGridTopology/Container.tetrahedra"}}); sofa::simpleapi::createObject(FEMechanicalModel, "TetrahedronSetTopologyModifier", {{"name","Modifier"}}); diff --git a/examples/Tutorials/Basic/TutorialBasicCube.html b/examples/Tutorials/Basic/TutorialBasicCube.html index f09b1b94c97..365226b5c4e 100644 --- a/examples/Tutorials/Basic/TutorialBasicCube.html +++ b/examples/Tutorials/Basic/TutorialBasicCube.html @@ -15,7 +15,7 @@
The forces are the MeshSpringForceField, which defines springs according to the edges of the mesh (the Topology), and the PlaneForceField which try to prevent the particles to cross planes.

- The EulerImplicitSolver contains the algorithm used to update particle positions and velocities at each time step. It uses an auxiliary component, the CGLinearSolver, to solve equation systems.
+ The EulerImplicitIntegrationScheme contains the algorithm used to update particle positions and velocities at each time step. It uses an auxiliary component, the CGLinearSolver, to solve equation systems.
See Also:
diff --git a/examples/Tutorials/Basic/TutorialBasicCube.scn b/examples/Tutorials/Basic/TutorialBasicCube.scn index 8ae89f6eeef..3e6d34434bf 100644 --- a/examples/Tutorials/Basic/TutorialBasicCube.scn +++ b/examples/Tutorials/Basic/TutorialBasicCube.scn @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + - + @@ -13,7 +13,7 @@ - + - + @@ -29,7 +29,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/examples/Tutorials/Collision/AdvancedSolversMultipleGroupsSolver.scn b/examples/Tutorials/Collision/AdvancedSolversMultipleGroupsSolver.scn index 5962d1d8d6f..18e6e165102 100644 --- a/examples/Tutorials/Collision/AdvancedSolversMultipleGroupsSolver.scn +++ b/examples/Tutorials/Collision/AdvancedSolversMultipleGroupsSolver.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/Collision/ModelizationSphereBased.scn b/examples/Tutorials/Collision/ModelizationSphereBased.scn index b278a5c85f1..24ea4ff669a 100644 --- a/examples/Tutorials/Collision/ModelizationSphereBased.scn +++ b/examples/Tutorials/Collision/ModelizationSphereBased.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/Collision/ModelizationTriangleBased.scn b/examples/Tutorials/Collision/ModelizationTriangleBased.scn index b7d60e6dc42..022e8b50fe8 100644 --- a/examples/Tutorials/Collision/ModelizationTriangleBased.scn +++ b/examples/Tutorials/Collision/ModelizationTriangleBased.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/Collision/MultipleObjectsTwoCubes.scn b/examples/Tutorials/Collision/MultipleObjectsTwoCubes.scn index 8ab98c70dff..40f38c9b7a7 100644 --- a/examples/Tutorials/Collision/MultipleObjectsTwoCubes.scn +++ b/examples/Tutorials/Collision/MultipleObjectsTwoCubes.scn @@ -9,7 +9,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/examples/Tutorials/ForceFields/TutorialForceFieldLiverFEM.scn b/examples/Tutorials/ForceFields/TutorialForceFieldLiverFEM.scn index 9ba2e2eafdb..15695a25b0a 100644 --- a/examples/Tutorials/ForceFields/TutorialForceFieldLiverFEM.scn +++ b/examples/Tutorials/ForceFields/TutorialForceFieldLiverFEM.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/ForceFields/TutorialForceFieldLiverHexaFEM.scn b/examples/Tutorials/ForceFields/TutorialForceFieldLiverHexaFEM.scn index 00dc918fab1..8723e924904 100644 --- a/examples/Tutorials/ForceFields/TutorialForceFieldLiverHexaFEM.scn +++ b/examples/Tutorials/ForceFields/TutorialForceFieldLiverHexaFEM.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/ForceFields/TutorialForceFieldLiverSprings.scn b/examples/Tutorials/ForceFields/TutorialForceFieldLiverSprings.scn index 951cf8024f9..76aec568898 100644 --- a/examples/Tutorials/ForceFields/TutorialForceFieldLiverSprings.scn +++ b/examples/Tutorials/ForceFields/TutorialForceFieldLiverSprings.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/ForceFields/TutorialForceFieldLiverTriangleFEM.scn b/examples/Tutorials/ForceFields/TutorialForceFieldLiverTriangleFEM.scn index 583bf977caf..5fac22cb604 100644 --- a/examples/Tutorials/ForceFields/TutorialForceFieldLiverTriangleFEM.scn +++ b/examples/Tutorials/ForceFields/TutorialForceFieldLiverTriangleFEM.scn @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/Mappings/TutorialMappingCubeSurface.scn b/examples/Tutorials/Mappings/TutorialMappingCubeSurface.scn index 5d792a75b90..ea357e77fa6 100644 --- a/examples/Tutorials/Mappings/TutorialMappingCubeSurface.scn +++ b/examples/Tutorials/Mappings/TutorialMappingCubeSurface.scn @@ -5,7 +5,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Tutorials/Mappings/TutorialMappingDragonBarycentric.scn b/examples/Tutorials/Mappings/TutorialMappingDragonBarycentric.scn index 2027efd375e..df5cd8d98c2 100644 --- a/examples/Tutorials/Mappings/TutorialMappingDragonBarycentric.scn +++ b/examples/Tutorials/Mappings/TutorialMappingDragonBarycentric.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Tutorials/Mappings/TutorialMappingDragonRigid.scn b/examples/Tutorials/Mappings/TutorialMappingDragonRigid.scn index df099de3393..7898a68af80 100644 --- a/examples/Tutorials/Mappings/TutorialMappingDragonRigid.scn +++ b/examples/Tutorials/Mappings/TutorialMappingDragonRigid.scn @@ -6,14 +6,14 @@ - + - + diff --git a/examples/Tutorials/Mappings/TutorialMappingLiverBarycentric.scn b/examples/Tutorials/Mappings/TutorialMappingLiverBarycentric.scn index 4faadddb28e..b44d2f37bc2 100644 --- a/examples/Tutorials/Mappings/TutorialMappingLiverBarycentric.scn +++ b/examples/Tutorials/Mappings/TutorialMappingLiverBarycentric.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/Mappings/TutorialMappingOctopusArticulated.scn b/examples/Tutorials/Mappings/TutorialMappingOctopusArticulated.scn index e8eb4bc6ca1..182d3383939 100644 --- a/examples/Tutorials/Mappings/TutorialMappingOctopusArticulated.scn +++ b/examples/Tutorials/Mappings/TutorialMappingOctopusArticulated.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/Solvers/ExplicitEuler.html b/examples/Tutorials/Solvers/ExplicitEuler.html index 797b44ca3b2..2355aa0853b 100644 --- a/examples/Tutorials/Solvers/ExplicitEuler.html +++ b/examples/Tutorials/Solvers/ExplicitEuler.html @@ -39,8 +39,8 @@ Static Solver, Explicit RungeKutta Solver, Central Difference Solver, - Implicit Euler Solver, - Implicit Newmark Solver. + Implicit Euler Solver, + Implicit Newmark Solver.

--> diff --git a/examples/Tutorials/Solvers/ExplicitRungeKutta4.html b/examples/Tutorials/Solvers/ExplicitRungeKutta4.html index 8ceab079c3b..5c6eee7b199 100644 --- a/examples/Tutorials/Solvers/ExplicitRungeKutta4.html +++ b/examples/Tutorials/Solvers/ExplicitRungeKutta4.html @@ -44,8 +44,8 @@ Static Solver, Explicit Euler Solver, Central Difference Solver, - Implicit Euler Solver, - Implicit Newmark Solver. + Implicit Euler Solver, + Implicit Newmark Solver.

--> diff --git a/examples/Tutorials/Solvers/ImplicitEuler.html b/examples/Tutorials/Solvers/ImplicitEuler.html index 38ba6161841..52b2ab75bf9 100644 --- a/examples/Tutorials/Solvers/ImplicitEuler.html +++ b/examples/Tutorials/Solvers/ImplicitEuler.html @@ -11,7 +11,7 @@
Description

- The EulerImplicitSolver can be used to solve ODE systems of first or second order, using the Euler implicit integration scheme. The step size of the discretization corresponds to the timeStep of SOFA. + The EulerImplicitIntegrationScheme can be used to solve ODE systems of first or second order, using the Euler implicit integration scheme. The step size of the discretization corresponds to the timeStep of SOFA.
At each step of the scheme, the linear equation systems obtained have to be solved by an auxiliary component, the CGLinearSolver, which can be of different kinds (conjugated gradient, ...).
diff --git a/examples/Tutorials/Solvers/ImplicitNewmark.html b/examples/Tutorials/Solvers/ImplicitNewmark.html index aa4acecd883..ee9603159a4 100644 --- a/examples/Tutorials/Solvers/ImplicitNewmark.html +++ b/examples/Tutorials/Solvers/ImplicitNewmark.html @@ -10,7 +10,7 @@
Description

- The NewmarkImplicitSolver can be used to solve ODE systems, using the Newmark implicit integration scheme. The step size of the discretization corresponds to the timeStep of SOFA. + The NewmarkIntegrationScheme can be used to solve ODE systems, using the Newmark implicit integration scheme. The step size of the discretization corresponds to the timeStep of SOFA.
At each step of the scheme, the linear equation systems obtained have to be solved by an auxiliary component, the CGLinearSolver, which can be of different kinds (conjugated gradient, ...).
@@ -25,7 +25,7 @@
-
+
diff --git a/examples/Tutorials/Solvers/Solvers.html b/examples/Tutorials/Solvers/Solvers.html index 2b508c9fbc6..d61f72ac50c 100644 --- a/examples/Tutorials/Solvers/Solvers.html +++ b/examples/Tutorials/Solvers/Solvers.html @@ -4,7 +4,7 @@
-

OdeSolver Tutorial

+

IntegrationScheme Tutorial

diff --git a/examples/Tutorials/Solvers/Solvers.xml b/examples/Tutorials/Solvers/Solvers.xml index 1230b5756a0..f1a7214144f 100644 --- a/examples/Tutorials/Solvers/Solvers.xml +++ b/examples/Tutorials/Solvers/Solvers.xml @@ -3,11 +3,11 @@ - - + + - - + + diff --git a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.html b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.html index d8da96a8451..2b29a8fe377 100644 --- a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.html +++ b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.html @@ -19,7 +19,7 @@

Instrument visual model

  • First, we put a gravity in the whole scene with the Gravity component.
  • We set the instrument as a MechanicalObject. It describes the state of the particles of the object.
  • -
  • To compute the states at each time step, we need a time integrator, like the EulerImplicitSolver.
  • +
  • To compute the states at each time step, we need a time integrator, like the EulerImplicitIntegrationScheme.
  • We need a linear solver, like CGLinearSolver, to solve the linear system generated with our implicit solver.
  • We finally add a mass to the object with the UniformMass component.
diff --git a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.scn b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.scn index c27f6cdb7de..b2cb6970c5e 100644 --- a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.scn +++ b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_03.scn @@ -4,7 +4,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_04.scn b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_04.scn index 290182bfcf7..fea0f8b1c25 100644 --- a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_04.scn +++ b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_04.scn @@ -8,7 +8,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_05.scn b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_05.scn index ab54b99376a..48c295ee518 100644 --- a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_05.scn +++ b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_05.scn @@ -11,7 +11,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_07.html b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_07.html index 4955c1d380b..13055abca9b 100644 --- a/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_07.html +++ b/examples/Tutorials/StepByStep/Dentistry_Haptics/dentalSurgery_07.html @@ -17,7 +17,7 @@

Deformable model of the Tongue

Key points:

- To add a deformable model in the scene, we need to create a MechanicalObject. All the forces and displacement are computed using an Euler implicit solver (EulerImplicitSolver) for time integration and a Conjugate Gradient linear solver (CGLinearSolver) to solve a linear system. + To add a deformable model in the scene, we need to create a MechanicalObject. All the forces and displacement are computed using an Euler implicit solver (EulerImplicitIntegrationScheme) for time integration and a Conjugate Gradient linear solver (CGLinearSolver) to solve a linear system. We also need a container to store the tetrahedra (TetrahedronSetTopologyContainer). With all these components, we can add a force field to compute internal forces (TetrahedralCorotanionalFEMForceField).

diff --git a/examples/Tutorials/StepByStep/FullObject/1_FullObject.html b/examples/Tutorials/StepByStep/FullObject/1_FullObject.html index c924167be3c..fb8bfa02159 100644 --- a/examples/Tutorials/StepByStep/FullObject/1_FullObject.html +++ b/examples/Tutorials/StepByStep/FullObject/1_FullObject.html @@ -14,7 +14,7 @@

Add a new node to the root node. Rename the new node "Object".

-

Add an EulerImplicitSolver, CGLinearSolver, MechanicalObject and UniformMass component to the Object node.

+

Add an EulerImplicitIntegrationScheme, CGLinearSolver, MechanicalObject and UniformMass component to the Object node.

Key points
diff --git a/examples/Tutorials/StepByStep/FullObject/1_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/1_FullObject.scn index 5f46c6c4091..1fd367b49d3 100644 --- a/examples/Tutorials/StepByStep/FullObject/1_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/1_FullObject.scn @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/2_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/2_FullObject.scn index ff9f0196886..1728c401f29 100644 --- a/examples/Tutorials/StepByStep/FullObject/2_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/2_FullObject.scn @@ -7,7 +7,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/3_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/3_FullObject.scn index 0d957f42359..cd28abe3ca0 100644 --- a/examples/Tutorials/StepByStep/FullObject/3_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/3_FullObject.scn @@ -7,7 +7,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/4_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/4_FullObject.scn index fb3946910f4..b20bad4b939 100644 --- a/examples/Tutorials/StepByStep/FullObject/4_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/4_FullObject.scn @@ -8,7 +8,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/5_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/5_FullObject.scn index b60501ee02a..5633bdc8a2a 100644 --- a/examples/Tutorials/StepByStep/FullObject/5_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/5_FullObject.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/6_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/6_FullObject.scn index 4040541e0c4..e6f47bfbccb 100644 --- a/examples/Tutorials/StepByStep/FullObject/6_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/6_FullObject.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/7_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/7_FullObject.scn index 6460fd502f7..2fccb2f9a4f 100644 --- a/examples/Tutorials/StepByStep/FullObject/7_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/7_FullObject.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/StepByStep/FullObject/8_FullObject.scn b/examples/Tutorials/StepByStep/FullObject/8_FullObject.scn index 40c25aab0ac..22fa2cb73a8 100644 --- a/examples/Tutorials/StepByStep/FullObject/8_FullObject.scn +++ b/examples/Tutorials/StepByStep/FullObject/8_FullObject.scn @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/1_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/1_Pendulum.scn index 8f091282db9..05425731974 100644 --- a/examples/Tutorials/StepByStep/Pendulum/1_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/1_Pendulum.scn @@ -2,13 +2,13 @@ - + - + diff --git a/examples/Tutorials/StepByStep/Pendulum/2_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/2_Pendulum.scn index 60cfaac17c8..3b6c232d6fb 100644 --- a/examples/Tutorials/StepByStep/Pendulum/2_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/2_Pendulum.scn @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/3_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/3_Pendulum.scn index 79008a52172..2a35f5f45f2 100644 --- a/examples/Tutorials/StepByStep/Pendulum/3_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/3_Pendulum.scn @@ -3,7 +3,7 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/4_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/4_Pendulum.scn index 974b10bfbe4..b685d075623 100644 --- a/examples/Tutorials/StepByStep/Pendulum/4_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/4_Pendulum.scn @@ -3,7 +3,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/5_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/5_Pendulum.scn index 878e39d0381..cb40c6fbae4 100644 --- a/examples/Tutorials/StepByStep/Pendulum/5_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/5_Pendulum.scn @@ -3,7 +3,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/6_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/6_Pendulum.scn index ecac33dbe05..1acc8baa35e 100644 --- a/examples/Tutorials/StepByStep/Pendulum/6_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/6_Pendulum.scn @@ -3,7 +3,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.html b/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.html index 6c0b2e3d304..8431801e185 100644 --- a/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.html +++ b/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.html @@ -10,13 +10,13 @@

To show the genericity of SOFA, the last tutorial will simulate the same scene but using a different ODE solver and integration scheme.

-

We will remove the EulerSolver and replace it with the EulerImplicitSolver. This solver contains the algorithm used to update particle positions and velocities at each time step. It uses an auxiliary component, the CGLinearSolver, to solve equation systems.

+

We will remove the EulerSolver and replace it with the EulerImplicitIntegrationScheme. This solver contains the algorithm used to update particle positions and velocities at each time step. It uses an auxiliary component, the CGLinearSolver, to solve equation systems.

Key points

Right click on the EulerSolver in the Modeler's scene graph, and select Delete.

-

Find the EulerImplicitSolver component, and add it on the root node. Find the CGLinearSolver component, and add it on the root node.

+

Find the EulerImplicitIntegrationScheme component, and add it on the root node. Find the CGLinearSolver component, and add it on the root node.

Results
diff --git a/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.scn b/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.scn index 3ad2098a730..5f5e318e244 100644 --- a/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.scn +++ b/examples/Tutorials/StepByStep/Pendulum/7_Pendulum.scn @@ -4,7 +4,7 @@ - + @@ -15,7 +15,7 @@ - + diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.html b/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.html index 75bde4f22ea..cc841020ff4 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.html +++ b/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.html @@ -15,7 +15,7 @@
Key points

    -
  • EulerImplicitSolver component is used to solve the mechanical ODE system.
  • +
  • EulerImplicitIntegrationScheme component is used to solve the mechanical ODE system.
  • CGLinearSolver component is used to solve the linear system at each step of the ODE system.
  • TetrahedralCorotationalFEM is used to create tetrahedral finite element on this mechanical system.
  • DiagonalMass describe a global mass of the mesh elements.
  • @@ -23,7 +23,7 @@

-

Add an EulerImplicitSolver component to the Tetrahedrons Mesh node.

+

Add an EulerImplicitIntegrationScheme component to the Tetrahedrons Mesh node.

Repeat with a CGLinearSolver component. Change the tolerance property to 1e-09, and in the Property 2/2 tab, change the threshold property to 1e-09.

diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.scn b/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.scn index cccc50a7415..33908612e59 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.scn +++ b/examples/Tutorials/StepByStep/TopologicalMapping/2_TopoMapping.scn @@ -6,7 +6,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/3_TopoMapping.scn b/examples/Tutorials/StepByStep/TopologicalMapping/3_TopoMapping.scn index 065561e0b84..0e68dc15798 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/3_TopoMapping.scn +++ b/examples/Tutorials/StepByStep/TopologicalMapping/3_TopoMapping.scn @@ -7,7 +7,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/4_TopoMapping.scn b/examples/Tutorials/StepByStep/TopologicalMapping/4_TopoMapping.scn index 2ab514c4689..5f25a979516 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/4_TopoMapping.scn +++ b/examples/Tutorials/StepByStep/TopologicalMapping/4_TopoMapping.scn @@ -8,7 +8,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/5_TopoMapping.scn b/examples/Tutorials/StepByStep/TopologicalMapping/5_TopoMapping.scn index e316a83ada1..abfe37ca81b 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/5_TopoMapping.scn +++ b/examples/Tutorials/StepByStep/TopologicalMapping/5_TopoMapping.scn @@ -5,7 +5,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/examples/Tutorials/StepByStep/TopologicalMapping/6_TopoMapping.scn b/examples/Tutorials/StepByStep/TopologicalMapping/6_TopoMapping.scn index 36d8c7d9ea4..2b1f947d21d 100644 --- a/examples/Tutorials/StepByStep/TopologicalMapping/6_TopoMapping.scn +++ b/examples/Tutorials/StepByStep/TopologicalMapping/6_TopoMapping.scn @@ -7,7 +7,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyDynamicSurfaceMesh.scn b/examples/Tutorials/Topologies/TopologyDynamicSurfaceMesh.scn index ccc7e83cafe..05a9163a718 100644 --- a/examples/Tutorials/Topologies/TopologyDynamicSurfaceMesh.scn +++ b/examples/Tutorials/Topologies/TopologyDynamicSurfaceMesh.scn @@ -10,7 +10,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyHexa2QuadTopologicalMapping.scn b/examples/Tutorials/Topologies/TopologyHexa2QuadTopologicalMapping.scn index f50d94d556c..6fa72fa2968 100644 --- a/examples/Tutorials/Topologies/TopologyHexa2QuadTopologicalMapping.scn +++ b/examples/Tutorials/Topologies/TopologyHexa2QuadTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyHexa2TetraTopologicalMapping.scn b/examples/Tutorials/Topologies/TopologyHexa2TetraTopologicalMapping.scn index 53c2adf433e..0ec5ca0a0f1 100644 --- a/examples/Tutorials/Topologies/TopologyHexa2TetraTopologicalMapping.scn +++ b/examples/Tutorials/Topologies/TopologyHexa2TetraTopologicalMapping.scn @@ -9,7 +9,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyLinearDifferentMesh.scn b/examples/Tutorials/Topologies/TopologyLinearDifferentMesh.scn index 63467958663..e3ad8990da7 100644 --- a/examples/Tutorials/Topologies/TopologyLinearDifferentMesh.scn +++ b/examples/Tutorials/Topologies/TopologyLinearDifferentMesh.scn @@ -8,7 +8,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyLinearMesh.scn b/examples/Tutorials/Topologies/TopologyLinearMesh.scn index acd393c2649..da652afcc3b 100644 --- a/examples/Tutorials/Topologies/TopologyLinearMesh.scn +++ b/examples/Tutorials/Topologies/TopologyLinearMesh.scn @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyQuad2TriangleTopologicalMapping.scn b/examples/Tutorials/Topologies/TopologyQuad2TriangleTopologicalMapping.scn index d3ea6218b6a..b01b555ea6f 100644 --- a/examples/Tutorials/Topologies/TopologyQuad2TriangleTopologicalMapping.scn +++ b/examples/Tutorials/Topologies/TopologyQuad2TriangleTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologySurfaceDifferentMesh.scn b/examples/Tutorials/Topologies/TopologySurfaceDifferentMesh.scn index 99fccbeaed0..7e0f95b2c4c 100644 --- a/examples/Tutorials/Topologies/TopologySurfaceDifferentMesh.scn +++ b/examples/Tutorials/Topologies/TopologySurfaceDifferentMesh.scn @@ -10,7 +10,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyTetra2TriangleTopologicalMapping.scn b/examples/Tutorials/Topologies/TopologyTetra2TriangleTopologicalMapping.scn index 5c26ab4c7fc..0c6b110be6c 100644 --- a/examples/Tutorials/Topologies/TopologyTetra2TriangleTopologicalMapping.scn +++ b/examples/Tutorials/Topologies/TopologyTetra2TriangleTopologicalMapping.scn @@ -10,7 +10,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyTriangle2EdgeTopologicalMapping.scn b/examples/Tutorials/Topologies/TopologyTriangle2EdgeTopologicalMapping.scn index 8391d77596a..0b4e876a09c 100644 --- a/examples/Tutorials/Topologies/TopologyTriangle2EdgeTopologicalMapping.scn +++ b/examples/Tutorials/Topologies/TopologyTriangle2EdgeTopologicalMapping.scn @@ -9,7 +9,7 @@ - + diff --git a/examples/Tutorials/Topologies/TopologyVolumeDifferentMesh.scn b/examples/Tutorials/Topologies/TopologyVolumeDifferentMesh.scn index 5d4e37c4243..9dd418f0a90 100644 --- a/examples/Tutorials/Topologies/TopologyVolumeDifferentMesh.scn +++ b/examples/Tutorials/Topologies/TopologyVolumeDifferentMesh.scn @@ -10,7 +10,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/examples/Tutorials/Tutorials.xml b/examples/Tutorials/Tutorials.xml index 4d4c2890571..9f9b0c1dbac 100644 --- a/examples/Tutorials/Tutorials.xml +++ b/examples/Tutorials/Tutorials.xml @@ -4,6 +4,6 @@ - + diff --git a/examples/Tutorials/sandbox/explicit_singlehexaFEM.scn b/examples/Tutorials/sandbox/explicit_singlehexaFEM.scn index f66ab1d0607..08ebc1b3252 100644 --- a/examples/Tutorials/sandbox/explicit_singlehexaFEM.scn +++ b/examples/Tutorials/sandbox/explicit_singlehexaFEM.scn @@ -4,13 +4,13 @@ - + - + diff --git a/examples/Tutorials/sandbox/implicit_singlehexaFEM.scn b/examples/Tutorials/sandbox/implicit_singlehexaFEM.scn index 72a427ababa..28c7671dbc4 100644 --- a/examples/Tutorials/sandbox/implicit_singlehexaFEM.scn +++ b/examples/Tutorials/sandbox/implicit_singlehexaFEM.scn @@ -5,13 +5,13 @@ - + - + diff --git a/examples/Tutorials/sandbox/implicit_singlehexaFEM_2.scn b/examples/Tutorials/sandbox/implicit_singlehexaFEM_2.scn index 922bbadedf3..fda20f4139c 100644 --- a/examples/Tutorials/sandbox/implicit_singlehexaFEM_2.scn +++ b/examples/Tutorials/sandbox/implicit_singlehexaFEM_2.scn @@ -5,13 +5,13 @@ - + - + diff --git a/examples/Tutorials/sandbox/linearsolver_direct_or_iterative.scn b/examples/Tutorials/sandbox/linearsolver_direct_or_iterative.scn index 7179aa6db37..9e881137c24 100644 --- a/examples/Tutorials/sandbox/linearsolver_direct_or_iterative.scn +++ b/examples/Tutorials/sandbox/linearsolver_direct_or_iterative.scn @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/examples/Tutorials/sandbox/rungekutta2_heterogeneousobjects.scn b/examples/Tutorials/sandbox/rungekutta2_heterogeneousobjects.scn index e726769144b..8274396876f 100644 --- a/examples/Tutorials/sandbox/rungekutta2_heterogeneousobjects.scn +++ b/examples/Tutorials/sandbox/rungekutta2_heterogeneousobjects.scn @@ -2,13 +2,13 @@ - + - + diff --git a/examples/Tutorials/sandbox/rungekutta_singlehexaFEM.scn b/examples/Tutorials/sandbox/rungekutta_singlehexaFEM.scn index 4fb486e412e..051cec2725e 100644 --- a/examples/Tutorials/sandbox/rungekutta_singlehexaFEM.scn +++ b/examples/Tutorials/sandbox/rungekutta_singlehexaFEM.scn @@ -4,12 +4,12 @@ - + - + diff --git a/examples/Validation/cantilever_beam/CantileverBeam_ElementFEMForceField.xml b/examples/Validation/cantilever_beam/CantileverBeam_ElementFEMForceField.xml index 5953130431f..3ac0b6cf6a8 100644 --- a/examples/Validation/cantilever_beam/CantileverBeam_ElementFEMForceField.xml +++ b/examples/Validation/cantilever_beam/CantileverBeam_ElementFEMForceField.xml @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/scripts/deprecated/fix-modules-includes.sed b/scripts/deprecated/fix-modules-includes.sed index 67150cdf057..53d04813c5c 100644 --- a/scripts/deprecated/fix-modules-includes.sed +++ b/scripts/deprecated/fix-modules-includes.sed @@ -233,7 +233,7 @@ s:#include *[<"]sofa/component/behaviormodel/eulerianfluid/Grid3D.h[>"]:#include s:#include *[<"]sofa/component/behaviormodel/eulerianfluid/Grid2D.h[>"]:#include : s:#include *[<"]sofa/component/behaviormodel/eulerianfluid/Fluid3D.h[>"]:#include : s:#include *[<"]sofa/component/behaviormodel/eulerianfluid/Fluid2D.h[>"]:#include : -s:#include *[<"]sofa/component/odesolver/RungeKutta4Solver.h[>"]:#include : +s:#include *[<"]sofa/component/odesolver/RungeKutta4IntegrationScheme.h[>"]:#include : s:#include *[<"]sofa/component/odesolver/RungeKutta2Solver.h[>"]:#include : s:#include *[<"]sofa/component/odesolver/EulerSolver.h[>"]:#include : s:#include *[<"]sofa/component/odesolver/CentralDifferenceSolver.h[>"]:#include : @@ -252,7 +252,7 @@ s:#include *[<"]sofa/component/controller/NullForceFeedback.h[>"]:#include "]:#include : s:#include *[<"]sofa/component/controller/ForceFeedback.h[>"]:#include : s:#include *[<"]sofa/component/odesolver/StaticSolver.h[>"]:#include : -s:#include *[<"]sofa/component/odesolver/EulerImplicitSolver.h[>"]:#include : +s:#include *[<"]sofa/component/odesolver/EulerImplicitIntegrationScheme.h[>"]:#include : s:#include *[<"]sofa/component/collision/DirectSAP.inl[>"]:#include : s:#include *[<"]sofa/component/collision/DirectSAP.h[>"]:#include : s:#include *[<"]sofa/component/collision/IncrSAP.inl[>"]:#include :