diff --git a/.github/workflows/label-checker.yml b/.github/workflows/label-checker.yml
index 8c015e4dd1b1..966efef6e694 100644
--- a/.github/workflows/label-checker.yml
+++ b/.github/workflows/label-checker.yml
@@ -48,7 +48,7 @@ jobs:
// If no descriptive label is set, add a comment in the PR and make the action check fail
if (!hasDescriptiveLabel) {
- const comment = ':warning: :warning: :warning:
@' + context.repo.owner + ' your PR does not include any **descriptive** label :label:
Make sure to add an appropriate [PR label](https://github.com/sofa-framework/sofa/labels) before merge.
:warning: :warning: :warning:';
+ const comment = ':warning: :warning: :warning:
@' + context.payload.pull_request.user.login + ' your PR does not include any **descriptive** label :label:
Make sure to add an appropriate [PR label](https://github.com/sofa-framework/sofa/labels) before merge.
:warning: :warning: :warning:';
github.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
diff --git a/.github/workflows/pr-title-checker.yml b/.github/workflows/pr-title-checker.yml
index 4dd4bd287a4c..4a07fc661b99 100644
--- a/.github/workflows/pr-title-checker.yml
+++ b/.github/workflows/pr-title-checker.yml
@@ -39,7 +39,7 @@ jobs:
// Add comment in the PR to warn the author
if (!valid) {
- const comment = ':warning: :warning: :warning:
@'+context.repo.owner+' your PR title is not following the required format :pencil2:
'+commentExplain+':warning: :warning: :warning:';
+ const comment = ':warning: :warning: :warning:
@' + context.payload.pull_request.user.login + ' your PR title is not following the required format :pencil2:
'+commentExplain+':warning: :warning: :warning:';
github.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
diff --git a/.github/workflows/stale_github_discussions.yml b/.github/workflows/stale_github_discussions.yml
new file mode 100644
index 000000000000..cfac73e28d01
--- /dev/null
+++ b/.github/workflows/stale_github_discussions.yml
@@ -0,0 +1,32 @@
+name: Stale GitHub Discussions
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: '0 6 * * 1' # Every Monday at 6:00 AM UTC (8:00 AM CET)
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.10' # Use the desired Python version
+
+ - name: Install dependencies
+ run: |
+ pip install python-graphql-client
+ pip install python-dateutil
+ working-directory: ${{ github.workspace }}
+
+ - name: Run script comment-close-old-discussions.py
+ run: |
+ python scripts/comment-close-old-discussions.py
+ working-directory: ${{ github.workspace }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99b2d6cd2e68..ad2fea6d3d7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,6 +34,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIBRARY_OUTPUT_DIRECTOR
# Option for packaging
option(SOFA_BUILD_RELEASE_PACKAGE "Run package specific configure" OFF)
+# Option to allow some dependencies such as cxxopts to be fetched by cmake if
+# the package is not found
+option(SOFA_ALLOW_FETCH_DEPENDENCIES "Allow compatible dependencies to be fetched if the package is not found by cmake.
+ List of dependencies that can be fetched: cxxopts" ON)
+
# Option to accelerate the compilation
# see https://cmake.org/cmake/help/v3.16/command/target_precompile_headers.html
# and https://cmake.org/cmake/help/v3.16/prop_tgt/DISABLE_PRECOMPILE_HEADERS.html
@@ -256,11 +261,12 @@ install(FILES "${CMAKE_SOURCE_DIR}/CHANGELOG.md" DESTINATION . COMPONENT applica
install(FILES "${CMAKE_SOURCE_DIR}/LICENSE.LGPL.txt" DESTINATION . COMPONENT applications)
install(FILES "${CMAKE_SOURCE_DIR}/Authors.txt" DESTINATION . COMPONENT applications)
-option(SOFA_INSTALL_RESOURCES_FILES "Copy resources files (etc/, share/, examples/) when installing" ON)
+option(SOFA_INSTALL_RESOURCES_FILES "Copy resources files (etc/, share/, examples/, tools/sofa-launcher/) when installing" ON)
## Install resource files
if(SOFA_INSTALL_RESOURCES_FILES)
install(DIRECTORY share/ DESTINATION share/sofa COMPONENT resources)
install(DIRECTORY examples/ DESTINATION share/sofa/examples COMPONENT resources)
+ install(DIRECTORY tools/sofa-launcher/ DESTINATION share/sofa/sofa-launcher COMPONENT resources)
endif()
file(WRITE "${CMAKE_BINARY_DIR}/plugins/README.txt"
diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp
index 9263a1bbb52c..09996aff42f2 100644
--- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp
+++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp
@@ -336,7 +336,7 @@ void ConstraintAnimationLoop::launchCollisionDetection(const core::ExecParams* p
////////////////// COLLISION DETECTION///////////////////////////////////////////////////////////////////////////////////////////
{
- helper::ScopedAdvancedTimer timer("Collision");
+ SCOPED_TIMER("Collision");
computeCollision(params);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -357,7 +357,7 @@ void ConstraintAnimationLoop::freeMotion(const core::ExecParams* params, simulat
///////////////////////////////////////////// FREE MOTION /////////////////////////////////////////////////////////////
{
- helper::ScopedAdvancedTimer freeMotionTimer("Free Motion");
+ SCOPED_TIMER_VARNAME(freeMotionTimer, "Free Motion");
MechanicalBeginIntegrationVisitor(params, dt).execute(context);
@@ -416,7 +416,7 @@ void ConstraintAnimationLoop::setConstraintEquations(const core::ExecParams* par
msg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) <<"constraints Matrix construction is called" ;
{
- helper::ScopedAdvancedTimer constraintDefinitionTimer("Constraints definition");
+ SCOPED_TIMER_VARNAME(constraintDefinitionTimer, "Constraints definition");
if(!d_schemeCorrection.getValue())
{
@@ -495,7 +495,7 @@ void ConstraintAnimationLoop::computeComplianceInConstraintSpace()
/// calling getCompliance => getDelassusOperator(_W) = H*C*Ht
dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) << " 4. get Compliance " ;
- helper::ScopedAdvancedTimer getComplianceTimer("Get Compliance");
+ SCOPED_TIMER_VARNAME(getComplianceTimer, "Get Compliance");
for (const auto cc : constraintCorrections)
{
cc->addComplianceInConstraintSpace(core::constraintparams::defaultInstance(), getCP()->getW());
@@ -507,7 +507,7 @@ void ConstraintAnimationLoop::correctiveMotion(const core::ExecParams* params, s
dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE)
<<"constraintCorrections motion is called" ;
- helper::ScopedAdvancedTimer correctiveMotionTimer("Corrective Motion");
+ SCOPED_TIMER_VARNAME(correctiveMotionTimer, "Corrective Motion");
if(d_schemeCorrection.getValue())
{
@@ -637,7 +637,7 @@ void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt )
// Update the BehaviorModels => to be removed ?
// Required to allow the RayPickInteractor interaction
{
- helper::ScopedAdvancedTimer behaviorUpdateTimer("BehaviorUpdate");
+ SCOPED_TIMER_VARNAME(behaviorUpdateTimer, "BehaviorUpdate");
simulation::BehaviorUpdatePositionVisitor(params, dt).execute(node);
}
@@ -697,7 +697,7 @@ void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt )
}
{
- helper::ScopedAdvancedTimer gaussSeidelTimer("GaussSeidel");
+ SCOPED_TIMER_VARNAME(gaussSeidelTimer, "GaussSeidel");
if (EMIT_EXTRA_DEBUG_MESSAGE)
msg_info() << "Gauss-Seidel solver is called on problem of size " << CP.getSize() ;
@@ -739,7 +739,7 @@ void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt )
}
{
- helper::ScopedAdvancedTimer updateMappingTimer("UpdateMapping");
+ SCOPED_TIMER_VARNAME(updateMappingTimer, "UpdateMapping");
node->execute(params);
sofa::helper::AdvancedTimer::step("UpdateMappingEndEvent");
@@ -752,7 +752,7 @@ void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt )
if (d_computeBoundingBox.getValue())
{
- sofa::helper::ScopedAdvancedTimer updateBBoxTimer("UpdateBBox");
+ SCOPED_TIMER_VARNAME(updateBBoxTimer, "UpdateBBox");
node->execute(params);
}
diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp
index 1a97344d081e..645ca99947f9 100644
--- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp
+++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp
@@ -171,7 +171,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
cparams.setV(freeVel);
cparams.setDx(l_constraintSolver->getDx());
cparams.setLambda(l_constraintSolver->getLambda());
- cparams.setOrder(m_solveVelocityConstraintFirst.getValue() ? core::ConstraintParams::VEL : core::ConstraintParams::POS_AND_VEL);
+ cparams.setOrder(m_solveVelocityConstraintFirst.getValue() ? core::ConstraintOrder::VEL : core::ConstraintOrder::POS_AND_VEL);
MultiVecDeriv dx(&vop, core::VecDerivId::dx());
dx.realloc(&vop, !d_threadSafeVisitor.getValue(), true);
@@ -182,7 +182,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
// This solver will work in freePosition and freeVelocity vectors.
// We need to initialize them if it's not already done.
{
- ScopedAdvancedTimer timer("MechanicalVInitVisitor");
+ SCOPED_TIMER("MechanicalVInitVisitor");
MechanicalVInitVisitor< core::V_COORD >(params, core::VecCoordId::freePosition(), core::ConstVecCoordId::position(), true).execute(node);
MechanicalVInitVisitor< core::V_DERIV >(params, core::VecDerivId::freeVelocity(), core::ConstVecDerivId::velocity(), true).execute(node);
}
@@ -201,7 +201,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
#endif
{
- ScopedAdvancedTimer timer("AnimateBeginEvent");
+ SCOPED_TIMER("AnimateBeginEvent");
AnimateBeginEvent ev ( dt );
PropagateEventVisitor act ( params, &ev );
node->execute ( act );
@@ -212,7 +212,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
dmsg_info() << "updatePos called" ;
{
- ScopedAdvancedTimer timer("UpdatePosition");
+ SCOPED_TIMER("UpdatePosition");
BehaviorUpdatePositionVisitor beh(params, dt);
node->execute(&beh);
}
@@ -224,7 +224,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
dmsg_info() << "updateInternal called" ;
{
- ScopedAdvancedTimer timer("updateInternalData");
+ SCOPED_TIMER("updateInternalData");
node->execute(&iud);
}
@@ -239,14 +239,14 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
// Mapping geometric stiffness coming from previous lambda.
{
- ScopedAdvancedTimer timer("lambdaMultInvDt");
+ SCOPED_TIMER("lambdaMultInvDt");
MechanicalVOpVisitor lambdaMultInvDt(params, cparams.lambda(), sofa::core::ConstMultiVecId::null(), cparams.lambda(), 1.0 / dt);
lambdaMultInvDt.setMapped(true);
node->executeVisitor(&lambdaMultInvDt);
}
{
- ScopedAdvancedTimer timer("MechanicalComputeGeometricStiffness");
+ SCOPED_TIMER("MechanicalComputeGeometricStiffness");
MechanicalComputeGeometricStiffness geometricStiffnessVisitor(&mop.mparams, cparams.lambda());
node->executeVisitor(&geometricStiffnessVisitor);
}
@@ -256,9 +256,9 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
// Solve constraints
if (l_constraintSolver)
{
- ScopedAdvancedTimer timer("ConstraintSolver");
+ SCOPED_TIMER("ConstraintSolver");
- if (cparams.constOrder() == core::ConstraintParams::VEL )
+ if (cparams.constOrder() == core::ConstraintOrder::VEL )
{
l_constraintSolver->solveConstraint(&cparams, vel);
pos.eq(pos, vel, dt); //position += velocity * dt
@@ -283,14 +283,14 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
node->execute(params); // propagate time
{
- ScopedAdvancedTimer timer("AnimateEndEvent");
+ SCOPED_TIMER("AnimateEndEvent");
AnimateEndEvent ev ( dt );
PropagateEventVisitor act ( params, &ev );
node->execute ( act );
}
{
- ScopedAdvancedTimer timer("UpdateMapping");
+ SCOPED_TIMER("UpdateMapping");
//Visual Information update: Ray Pick add a MechanicalMapping used as VisualMapping
node->execute(params);
{
@@ -302,7 +302,7 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
if (d_computeBoundingBox.getValue())
{
- ScopedAdvancedTimer timer("UpdateBBox");
+ SCOPED_TIMER("UpdateBBox");
node->execute(params);
}
@@ -323,7 +323,7 @@ void FreeMotionAnimationLoop::computeFreeMotionAndCollisionDetection(const sofa:
if (!d_parallelCollisionDetectionAndFreeMotion.getValue())
{
- ScopedAdvancedTimer timer("FreeMotion+CollisionDetection");
+ SCOPED_TIMER("FreeMotion+CollisionDetection");
computeFreeMotion(params, cparams, dt, pos, freePos, freeVel, mop);
@@ -334,7 +334,7 @@ void FreeMotionAnimationLoop::computeFreeMotionAndCollisionDetection(const sofa:
}
else
{
- ScopedAdvancedTimer timer("FreeMotion+CollisionDetection");
+ SCOPED_TIMER("FreeMotion+CollisionDetection");
auto* taskScheduler = sofa::simulation::MainTaskSchedulerFactory::createInRegistry();
assert(taskScheduler != nullptr);
@@ -383,7 +383,7 @@ void FreeMotionAnimationLoop::computeFreeMotion(const sofa::core::ExecParams* pa
auto node = dynamic_cast(this->l_node.get());
{
- sofa::helper::ScopedAdvancedTimer timer("FreeMotion");
+ SCOPED_TIMER("FreeMotion");
simulation::SolveVisitor freeMotion(params, dt, true, d_parallelODESolving.getValue());
node->execute(&freeMotion);
}
@@ -391,10 +391,10 @@ void FreeMotionAnimationLoop::computeFreeMotion(const sofa::core::ExecParams* pa
mop->projectResponse(freeVel);
mop->propagateDx(freeVel, true);
- if (cparams.constOrder() == sofa::core::ConstraintParams::POS ||
- cparams.constOrder() == sofa::core::ConstraintParams::POS_AND_VEL)
+ if (cparams.constOrder() == sofa::core::ConstraintOrder::POS ||
+ cparams.constOrder() == sofa::core::ConstraintOrder::POS_AND_VEL)
{
- sofa::helper::ScopedAdvancedTimer timer("freePosEqPosPlusFreeVelDt");
+ SCOPED_TIMER("freePosEqPosPlusFreeVelDt");
MechanicalVOpVisitor freePosEqPosPlusFreeVelDt(params, freePos, pos, freeVel, dt);
freePosEqPosPlusFreeVelDt.setMapped(true);
node->executeVisitor(&freePosEqPosPlusFreeVelDt);
diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiStepAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiStepAnimationLoop.cpp
index 3ac3187c7495..53540049758d 100644
--- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiStepAnimationLoop.cpp
+++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiStepAnimationLoop.cpp
@@ -65,7 +65,7 @@ void MultiStepAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt
if (dt == 0)
dt = node->getDt();
- helper::ScopedAdvancedTimer animationStepTimer("AnimationStep");
+ SCOPED_TIMER_VARNAME(animationStepTimer, "AnimationStep");
#ifdef SOFA_DUMP_VISITOR_INFO
simulation::Visitor::printNode("Step");
@@ -122,7 +122,7 @@ void MultiStepAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt
//Visual Information update: Ray Pick add a MechanicalMapping used as VisualMapping
{
- helper::ScopedAdvancedTimer updateMappingTimer("UpdateMapping");
+ SCOPED_TIMER_VARNAME(updateMappingTimer, "UpdateMapping");
node->execute(params);
}
{
@@ -133,7 +133,7 @@ void MultiStepAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt
if (d_computeBoundingBox.getValue())
{
- sofa::helper::ScopedAdvancedTimer timer("UpdateBBox");
+ SCOPED_TIMER("UpdateBBox");
node->execute(params);
}
diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiTagAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiTagAnimationLoop.cpp
index 7526ae22bb19..6fb06c025503 100644
--- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiTagAnimationLoop.cpp
+++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/MultiTagAnimationLoop.cpp
@@ -71,7 +71,7 @@ void MultiTagAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt)
{
auto node = dynamic_cast(this->l_node.get());
- helper::ScopedAdvancedTimer animationStepTimer("AnimationStep");
+ SCOPED_TIMER_VARNAME(animationStepTimer, "AnimationStep");
#ifdef SOFA_DUMP_VISITOR_INFO
simulation::Visitor::printNode("Step");
@@ -124,7 +124,7 @@ void MultiTagAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt)
//Visual Information update: Ray Pick add a MechanicalMapping used as VisualMapping
{
- helper::ScopedAdvancedTimer updateMappingTimer("UpdateMapping");
+ SCOPED_TIMER_VARNAME(updateMappingTimer, "UpdateMapping");
node->execute(params);
}
{
@@ -135,7 +135,7 @@ void MultiTagAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt)
if (d_computeBoundingBox.getValue())
{
- sofa::helper::ScopedAdvancedTimer timer("UpdateBBox");
+ SCOPED_TIMER("UpdateBBox");
node->execute(params);
}
diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/CollisionPipeline.cpp b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/CollisionPipeline.cpp
index 7727761ff6fc..24209c2362df 100644
--- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/CollisionPipeline.cpp
+++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/CollisionPipeline.cpp
@@ -132,7 +132,7 @@ void CollisionPipeline::doCollisionReset()
void CollisionPipeline::doCollisionDetection(const type::vector& collisionModels)
{
- ScopedAdvancedTimer docollisiontimer("doCollisionDetection");
+ SCOPED_TIMER_VARNAME(docollisiontimer, "doCollisionDetection");
msg_info_when(d_doPrintInfoMessage.getValue())
<< "doCollisionDetection, compute Bounding Trees" ;
@@ -142,7 +142,7 @@ void CollisionPipeline::doCollisionDetection(const type::vector vectBoundingVolume;
{
- ScopedAdvancedTimer bboxtimer("ComputeBoundingTree");
+ SCOPED_TIMER_VARNAME(bboxtimer, "ComputeBoundingTree");
#ifdef SOFA_DUMP_VISITOR_INFO
simulation::Visitor::printNode("ComputeBoundingTree");
@@ -203,7 +203,7 @@ void CollisionPipeline::doCollisionDetection(const type::vectorbeginBroadPhase();
broadPhaseDetection->beginBroadPhase();
broadPhaseDetection->addCollisionModels(vectBoundingVolume); // detection is done there
@@ -227,7 +227,7 @@ void CollisionPipeline::doCollisionDetection(const type::vectorbeginNarrowPhase();
narrowPhaseDetection->beginNarrowPhase();
const type::vector >& vectCMPair = broadPhaseDetection->getCollisionModelPairs();
@@ -258,7 +258,7 @@ void CollisionPipeline::doCollisionResponse()
<< "Create Contacts " << contactManager->getName() ;
{
- helper::ScopedAdvancedTimer createContactsTimer("CreateContacts");
+ SCOPED_TIMER_VARNAME(createContactsTimer, "CreateContacts");
contactManager->createContacts(narrowPhaseDetection->getDetectionOutputs());
}
@@ -270,7 +270,7 @@ void CollisionPipeline::doCollisionResponse()
type::vector notStaticContacts;
{
- helper::ScopedAdvancedTimer createStaticObjectsResponseTimer("CreateStaticObjectsResponse");
+ SCOPED_TIMER_VARNAME(createStaticObjectsResponseTimer, "CreateStaticObjectsResponse");
for (const auto& contact : contacts)
{
const auto collisionModels = contact->getCollisionModels();
@@ -291,7 +291,7 @@ void CollisionPipeline::doCollisionResponse()
if (groupManager == nullptr)
{
- ScopedAdvancedTimer createResponseTimer("CreateMovingObjectsResponse");
+ SCOPED_TIMER_VARNAME(createResponseTimer, "CreateMovingObjectsResponse");
msg_info_when(d_doPrintInfoMessage.getValue())
<< "Linking all contacts to Scene" ;
diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/DirectSAPNarrowPhase.cpp b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/DirectSAPNarrowPhase.cpp
index 8fb085394d90..267abd1fa24e 100644
--- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/DirectSAPNarrowPhase.cpp
+++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/DirectSAPNarrowPhase.cpp
@@ -129,7 +129,7 @@ void DirectSAPNarrowPhase::endNarrowPhase()
void DirectSAPNarrowPhase::checkNewCollisionModels()
{
- helper::ScopedAdvancedTimer scopeTimer("Direct SAP check new cm");
+ SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP check new cm");
for (auto *cm : m_broadPhaseCollisionModels)
{
auto *last = cm->getLast();
@@ -190,7 +190,7 @@ int DirectSAPNarrowPhase::greatestVarianceAxis() const
void DirectSAPNarrowPhase::updateBoxes()
{
- sofa::helper::ScopedAdvancedTimer scopeTimer("Direct SAP update boxes");
+ SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP update boxes");
m_currentAxis = greatestVarianceAxis();
for (auto& dsapBox : m_boxes)
{
@@ -220,7 +220,7 @@ bool DirectSAPNarrowPhase::isSquaredDistanceLessThan(const DSAPBox &a, const DSA
void DirectSAPNarrowPhase::cacheData()
{
- sofa::helper::ScopedAdvancedTimer scopeTimer("Direct SAP cache");
+ SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP cache");
unsigned int i{ 0 };
for (const auto& box : m_boxes)
@@ -241,13 +241,13 @@ void DirectSAPNarrowPhase::cacheData()
void DirectSAPNarrowPhase::sortEndPoints()
{
- sofa::helper::ScopedAdvancedTimer scopeTimer("Direct SAP sort");
+ SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP sort");
std::sort(m_sortedEndPoints.begin(), m_sortedEndPoints.end(), CompPEndPoint());
}
void DirectSAPNarrowPhase::narrowCollisionDetectionFromSortedEndPoints()
{
- sofa::helper::ScopedAdvancedTimer scopeTimer("Direct SAP intersection");
+ SCOPED_TIMER_VARNAME(scopeTimer, "Direct SAP intersection");
int nbInvestigatedPairs{ 0 };
std::list activeBoxes;//active boxes are the one that we encoutered only their min (end point), so if there are two boxes b0 and b1,
diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/IncrSAP.cpp b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/IncrSAP.cpp
index f10191cdf9bc..d6fa4539d685 100644
--- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/IncrSAP.cpp
+++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/IncrSAP.cpp
@@ -370,7 +370,7 @@ void IncrSAP::boxPrune(){
const int axis1 = (1 << _cur_axis) & 3;
const int axis2 = (1 << axis1) & 3;
- helper::ScopedAdvancedTimer timer("Box Prune SAP intersection");
+ SCOPED_TIMER("Box Prune SAP intersection");
std::deque active_boxes; // active boxes are the one that we encoutered only their min (end point), so if there are two boxes b0 and b1,
// if we encounter b1_min as b0_min < b1_min, on the current axis, the two boxes intersect : b0_min--------------------b0_max
diff --git a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/DiscreteIntersection.h b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/DiscreteIntersection.h
index 2f4bae5dc5da..c39dcce3900f 100644
--- a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/DiscreteIntersection.h
+++ b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/DiscreteIntersection.h
@@ -98,7 +98,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API DiscreteIntersection :
namespace sofa::core::collision
{
-#if !defined(SOFA_COMPONENT_COLLISION_DISCRETEINTERSECTION_CPP)
+#if !defined(SOFA_COMPONENT_COLLISION_DISCRETEINTERSECTION_CPP)
extern template class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API IntersectorFactory;
#endif
} // namespace sofa::core::collision
diff --git a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/MinProximityIntersection.h b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/MinProximityIntersection.h
index 3aaf3b5513cf..cc4272ec2b71 100644
--- a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/MinProximityIntersection.h
+++ b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/MinProximityIntersection.h
@@ -92,7 +92,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API MinProximityIntersecti
namespace sofa::core::collision
{
-#if !defined(SOFA_COMPONENT_COLLISION_MINPROXIMITYINTERSECTION_CPP)
+#if !defined(SOFA_COMPONENT_COLLISION_MINPROXIMITYINTERSECTION_CPP)
extern template class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API IntersectorFactory;
#endif
} // namespace sofa::core::collision
diff --git a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/NewProximityIntersection.h b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/NewProximityIntersection.h
index 06c2586b3624..ad29aceb3e2c 100644
--- a/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/NewProximityIntersection.h
+++ b/Sofa/Component/Collision/Detection/Intersection/src/sofa/component/collision/detection/intersection/NewProximityIntersection.h
@@ -83,7 +83,7 @@ class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API NewProximityIntersecti
namespace sofa::core::collision
{
-#if !defined(SOFA_COMPONENT_COLLISION_NEWPROXIMITYINTERSECTION_CPP)
+#if !defined(SOFA_COMPONENT_COLLISION_NEWPROXIMITYINTERSECTION_CPP)
extern template class SOFA_COMPONENT_COLLISION_DETECTION_INTERSECTION_API IntersectorFactory;
#endif
diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleModel.h
index 3070ce52a66d..fa696451de25 100644
--- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleModel.h
+++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleModel.h
@@ -236,7 +236,7 @@ inline TTriangle::TTriangle(ParentModel* model, Index index, helper::
SOFA_UNUSED(x);
}
-#if !defined(SOFA_COMPONENT_COLLISION_TRIANGLECOLLISIONMODEL_CPP)
+#if !defined(SOFA_COMPONENT_COLLISION_TRIANGLECOLLISIONMODEL_CPP)
extern template class SOFA_COMPONENT_COLLISION_GEOMETRY_API TTriangle;
extern template class SOFA_COMPONENT_COLLISION_GEOMETRY_API TriangleCollisionModel;
#endif
diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.h b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.h
index 131399704be7..382e0c94518c 100644
--- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.h
+++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.h
@@ -129,7 +129,7 @@ class PenalityContactForceField : public core::behavior::PairInteractionForceFie
};
-#if !defined(SOFA_COMPONENT_INTERACTIONFORCEFIELD_PENALITYCONTACTFORCEFIELD_CPP)
+#if !defined(SOFA_COMPONENT_INTERACTIONFORCEFIELD_PENALITYCONTACTFORCEFIELD_CPP)
extern template class SOFA_COMPONENT_COLLISION_RESPONSE_CONTACT_API PenalityContactForceField;
#endif
diff --git a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/IdentityContactMapper.h b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/IdentityContactMapper.h
index aa7f561db9f8..460e5ea36e78 100644
--- a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/IdentityContactMapper.h
+++ b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/IdentityContactMapper.h
@@ -182,7 +182,7 @@ class ContactMapper, sofa::defaulttype::Vec3Types>;
extern template class SOFA_COMPONENT_COLLISION_RESPONSE_MAPPER_API ContactMapper, sofa::defaulttype::Vec3Types>;
#endif
diff --git a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/RigidContactMapper.h b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/RigidContactMapper.h
index 32d423dc717d..163b3c87c8e8 100644
--- a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/RigidContactMapper.h
+++ b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/RigidContactMapper.h
@@ -147,7 +147,7 @@ class ContactMapper, defaulttype::Vec3Types>;
extern template class SOFA_COMPONENT_COLLISION_RESPONSE_MAPPER_API ContactMapper;
diff --git a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/TetrahedronBarycentricContactMapper.h b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/TetrahedronBarycentricContactMapper.h
index c440c95ade0f..c3f0e5987cd4 100644
--- a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/TetrahedronBarycentricContactMapper.h
+++ b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/TetrahedronBarycentricContactMapper.h
@@ -45,7 +45,7 @@ class ContactMapper :
}
};
-#if !defined(SOFA_COMPONENT_COLLISION_TETRAHEDRONBARYCENTRICCONTACTMAPPER_CPP)
+#if !defined(SOFA_COMPONENT_COLLISION_TETRAHEDRONBARYCENTRICCONTACTMAPPER_CPP)
extern template class SOFA_COMPONENT_COLLISION_RESPONSE_MAPPER_API ContactMapper;
# ifdef _MSC_VER
diff --git a/Sofa/Component/Compat/src/SofaSparseSolver/SparseCholeskySolver.h b/Sofa/Component/Compat/src/SofaSparseSolver/SparseCholeskySolver.h
index c3829690869b..e08378ac130c 100644
--- a/Sofa/Component/Compat/src/SofaSparseSolver/SparseCholeskySolver.h
+++ b/Sofa/Component/Compat/src/SofaSparseSolver/SparseCholeskySolver.h
@@ -23,4 +23,6 @@
#include
-SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseCholeskySolver.h")
+SOFA_PRAGMA_ERROR( \
+ "This header has been DISABLED since v23.12. " \
+ "To fix this error you must use the CSparseSolvers plugins. " )
diff --git a/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.h b/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.h
index 406f08044d2e..4e21871483e7 100644
--- a/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.h
+++ b/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.h
@@ -23,4 +23,6 @@
#include
-SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseLUSolver.h")
+SOFA_PRAGMA_ERROR( \
+ "This header has been DISABLED since v23.12. " \
+ "To fix this error you must use the CSparseSolvers plugins. " )
diff --git a/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.inl b/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.inl
index 4610b2cc02d5..a50573db9b03 100644
--- a/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.inl
+++ b/Sofa/Component/Compat/src/SofaSparseSolver/SparseLUSolver.inl
@@ -23,4 +23,6 @@
#include
-SOFA_DISABLED_HEADER("v22.06", "v23.06", "sofa/component/linearsolver/direct/SparseLUSolver.inl")
+SOFA_PRAGMA_ERROR( \
+ "This header has been DISABLED since v23.12. " \
+ "To fix this error you must use the CSparseSolvers plugins. " )
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 af97de230433..30a0efcfdcd6 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
@@ -151,13 +151,13 @@ void GenericConstraintCorrection::addComplianceInConstraintSpace(const Constrain
switch (cparams->constOrder())
{
- case ConstraintParams::POS_AND_VEL :
- case ConstraintParams::POS :
+ case sofa::core::ConstraintOrder::POS_AND_VEL :
+ case sofa::core::ConstraintOrder::POS :
factor = l_ODESolver.get()->getPositionIntegrationFactor();
break;
- case ConstraintParams::ACC :
- case ConstraintParams::VEL :
+ case sofa::core::ConstraintOrder::ACC :
+ case sofa::core::ConstraintOrder::VEL :
factor = l_ODESolver.get()->getVelocityIntegrationFactor();
break;
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 2afcb241e700..5545d1445306 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
@@ -147,7 +147,7 @@ class LinearSolverConstraintCorrection : public sofa::core::behavior::Constraint
bool _new_force; // if true, a "new" force was added in setConstraintDForce which is not yet integrated by a new computation in addConstraintDisplacements
};
-#if !defined(SOFA_COMPONENT_CONSTRAINT_LINEARSOLVERCONSTRAINTCORRECTION_CPP)
+#if !defined(SOFA_COMPONENT_CONSTRAINT_LINEARSOLVERCONSTRAINTCORRECTION_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API LinearSolverConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API LinearSolverConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API LinearSolverConstraintCorrection;
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 a33fbbfbd8b8..2e228d321a82 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
@@ -174,14 +174,14 @@ void LinearSolverConstraintCorrection::addComplianceInConstraintSpace
switch (cparams->constOrder())
{
- case core::ConstraintParams::POS_AND_VEL :
- case core::ConstraintParams::POS :
- factor = l_ODESolver.get()->getPositionIntegrationFactor();
+ case core::ConstraintOrder::POS_AND_VEL :
+ case core::ConstraintOrder::POS :
+ factor = l_ODESolver->getPositionIntegrationFactor();
break;
- case core::ConstraintParams::ACC :
- case core::ConstraintParams::VEL :
- factor = l_ODESolver.get()->getVelocityIntegrationFactor();
+ case core::ConstraintOrder::ACC :
+ case core::ConstraintOrder::VEL :
+ factor = l_ODESolver->getVelocityIntegrationFactor();
break;
default :
diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.h
index 7b68edc9d38e..837869ae932f 100644
--- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.h
+++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/PrecomputedConstraintCorrection.h
@@ -215,7 +215,7 @@ void PrecomputedConstraintCorrection::draw(const core::v
-#if !defined(SOFA_COMPONENT_CONSTRAINTSET_PRECOMPUTEDCONSTRAINTCORRECTION_CPP)
+#if !defined(SOFA_COMPONENT_CONSTRAINTSET_PRECOMPUTEDCONSTRAINTCORRECTION_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API PrecomputedConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API PrecomputedConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API PrecomputedConstraintCorrection;
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 cf700aa980af..10f6d0f6b538 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
@@ -420,12 +420,12 @@ void PrecomputedConstraintCorrection< DataTypes >::addComplianceInConstraintSpac
switch (cparams->constOrder())
{
- case core::ConstraintParams::POS_AND_VEL :
- case core::ConstraintParams::POS :
+ case core::ConstraintOrder::POS_AND_VEL :
+ case core::ConstraintOrder::POS :
break;
- case core::ConstraintParams::ACC :
- case core::ConstraintParams::VEL :
+ case core::ConstraintOrder::ACC :
+ case core::ConstraintOrder::VEL :
factor = 1.0 / this->getContext()->getDt(); // @TODO : Consistency between ODESolver & Compliance and/or Admittance computation
break;
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 2f8be6779d37..2c7c33f01cbc 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
@@ -146,7 +146,7 @@ template<>
void UncoupledConstraintCorrection< sofa::defaulttype::Rigid3Types >::getComplianceMatrix(sofa::linearalgebra::BaseMatrix * /*m*/) const;
-#if !defined(SOFA_COMPONENT_CONSTRAINTSET_UNCOUPLEDCONSTRAINTCORRECTION_CPP)
+#if !defined(SOFA_COMPONENT_CONSTRAINTSET_UNCOUPLEDCONSTRAINTCORRECTION_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API UncoupledConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API UncoupledConstraintCorrection;
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API UncoupledConstraintCorrection;
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 2a073c7a379d..ef53af25c24c 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
@@ -295,13 +295,13 @@ void UncoupledConstraintCorrection::addComplianceInConstraintSpace(co
SReal factor = 1.0;
switch (cparams->constOrder())
{
- case core::ConstraintParams::POS_AND_VEL :
- case core::ConstraintParams::POS :
+ case core::ConstraintOrder::POS_AND_VEL :
+ case core::ConstraintOrder::POS :
factor = useOdeIntegrationFactors ? m_pOdeSolver->getPositionIntegrationFactor() : 1.0;
break;
- case core::ConstraintParams::ACC :
- case core::ConstraintParams::VEL :
+ case core::ConstraintOrder::ACC :
+ case core::ConstraintOrder::VEL :
factor = useOdeIntegrationFactors ? m_pOdeSolver->getVelocityIntegrationFactor() : 1.0;
break;
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralInteractionConstraint.inl b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralInteractionConstraint.inl
index c1be870f9f59..0aeec985ed2d 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralInteractionConstraint.inl
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralInteractionConstraint.inl
@@ -182,7 +182,7 @@ void BilateralInteractionConstraint::getConstraintViolation(const Con
const VecDeriv& restVector = this->restVector.getValue();
- if (cParams->constOrder() == ConstraintParams::VEL)
+ if (cParams->constOrder() == sofa::core::ConstraintOrder::VEL)
{
getVelocityViolation(v, d_x1, d_x2, d_v1, d_v2);
return;
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/SlidingConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/SlidingConstraint.h
index 089e84dfd921..19e2a124a907 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/SlidingConstraint.h
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/SlidingConstraint.h
@@ -105,7 +105,7 @@ class SlidingConstraint : public core::behavior::PairInteractionConstraint;
#endif
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperConstraint.h
index 9fa1915e94aa..42cdea0cfcf6 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperConstraint.h
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperConstraint.h
@@ -119,7 +119,7 @@ class StopperConstraint : public core::behavior::Constraint
void getConstraintResolution(const core::ConstraintParams *, std::vector& resTab, unsigned int& offset) override;
};
-#if !defined(SOFA_COMPONENT_CONSTRAINTSET_STOPPERCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_CONSTRAINTSET_STOPPERCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_MODEL_API StopperConstraint;
#endif
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformConstraint.inl b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformConstraint.inl
index ca5a28cfe85a..b34a9377b97a 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformConstraint.inl
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformConstraint.inl
@@ -88,7 +88,7 @@ void UniformConstraint::getConstraintViolation(const sofa::core::Cons
auto pos = this->getMState()->readPositions();
auto restPos = this->getMState()->readRestPositions();
- if (cParams->constOrder() == sofa::core::ConstraintParams::VEL)
+ if (cParams->constOrder() == sofa::core::ConstraintOrder::VEL)
{
if (d_constraintRestPos.getValue()){
computeViolation(resV, m_constraintIndex, vfree, Deriv::size(),[&invDt,&pos,&vfree,&restPos](int i, int j)
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h
index 6f723b7baf35..254103f59fee 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.h
@@ -221,7 +221,7 @@ class UnilateralInteractionConstraint : public core::behavior::PairInteractionCo
};
-#if !defined(SOFA_COMPONENT_CONSTRAINTSET_UNILATERALINTERACTIONCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_CONSTRAINTSET_UNILATERALINTERACTIONCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_MODEL_API UnilateralInteractionConstraint;
#endif
diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.inl b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.inl
index aaa8c0a2b498..7cd50ba7b9b5 100644
--- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.inl
+++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UnilateralInteractionConstraint.inl
@@ -295,13 +295,13 @@ void UnilateralInteractionConstraint::getConstraintViolation(const co
{
switch (cparams->constOrder())
{
- case core::ConstraintParams::POS_AND_VEL :
- case core::ConstraintParams::POS :
+ case core::ConstraintOrder::POS_AND_VEL :
+ case core::ConstraintOrder::POS :
getPositionViolation(v);
break;
- case core::ConstraintParams::ACC :
- case core::ConstraintParams::VEL :
+ case core::ConstraintOrder::ACC :
+ case core::ConstraintOrder::VEL :
getVelocityViolation(v);
break;
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.cpp
index 58893a90b8ca..e472cdba283b 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.cpp
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.cpp
@@ -21,9 +21,15 @@
******************************************************************************/
#include
+#include
#include
#include
#include
+#include
+#include
+#include
+#include
+
namespace sofa::component::constraint::lagrangian::solver
{
@@ -112,5 +118,48 @@ void ConstraintSolverImpl::clearConstraintCorrections()
l_constraintCorrections.clear();
}
+void ConstraintSolverImpl::resetConstraints(const core::ConstraintParams* cParams)
+{
+ SCOPED_TIMER("Reset Constraint");
+ simulation::mechanicalvisitor::MechanicalResetConstraintVisitor(cParams).execute(getContext());
+}
+
+void ConstraintSolverImpl::buildLocalConstraintMatrix(const core::ConstraintParams* cparams, unsigned int &constraintId)
+{
+ SCOPED_TIMER("Build Local Constraint Matrix");
+ simulation::mechanicalvisitor::MechanicalBuildConstraintMatrix buildConstraintMatrix(cparams, cparams->j(), constraintId );
+ buildConstraintMatrix.execute(getContext());
+}
+
+void ConstraintSolverImpl::accumulateMatrixDeriv(const core::ConstraintParams* cparams)
+{
+ SCOPED_TIMER("Project Mapped Constraint Matrix");
+ simulation::mechanicalvisitor::MechanicalAccumulateMatrixDeriv accumulateMatrixDeriv(cparams, cparams->j());
+ accumulateMatrixDeriv.execute(getContext());
+}
+
+unsigned int ConstraintSolverImpl::buildConstraintMatrix(const core::ConstraintParams* cparams)
+{
+ SCOPED_TIMER("Build Constraint Matrix");
+ unsigned int constraintId {};
+ resetConstraints(cparams);
+ buildLocalConstraintMatrix(cparams, constraintId);
+ accumulateMatrixDeriv(cparams);
+ return constraintId;
+}
+
+void ConstraintSolverImpl::applyProjectiveConstraintOnConstraintMatrix(const core::ConstraintParams* cparams)
+{
+ core::MechanicalParams mparams = core::MechanicalParams(*cparams);
+ simulation::mechanicalvisitor::MechanicalProjectJacobianMatrixVisitor(&mparams).execute(getContext());
+}
+
+void ConstraintSolverImpl::getConstraintViolation(
+ const core::ConstraintParams* cparams, sofa::linearalgebra::BaseVector* v)
+{
+ SCOPED_TIMER("Get Constraint Value");
+ MechanicalGetConstraintViolationVisitor(cparams, v).execute(getContext());
+}
+
} //namespace sofa::component::constraint::lagrangian::solver
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.h
index b049c4e51334..82aee17d67b4 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.h
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/ConstraintSolverImpl.h
@@ -93,6 +93,26 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API ConstraintSolverImpl : pub
core::behavior::BaseConstraintCorrection,
BaseLink::FLAG_STOREPATH> l_constraintCorrections;
+ /// Calls the method resetConstraint on all the mechanical states and BaseConstraintSet
+ /// In the case of a MechanicalObject, it clears the constraint jacobian matrix
+ void resetConstraints(const core::ConstraintParams* cParams);
+
+ /// Call the method buildConstraintMatrix on all the BaseConstraintSet
+ void buildLocalConstraintMatrix(const core::ConstraintParams* cparams, unsigned int &constraintId);
+
+ /// Calls the method applyJT on all the mappings to project the mapped
+ /// constraint matrices on the main constraint matrix
+ void accumulateMatrixDeriv(const core::ConstraintParams* cparams);
+
+ /// Reset and build the constraint matrix, including the projection from
+ /// the mapped DoFs
+ /// \return The number of constraints, i.e. the size of the constraint matrix
+ unsigned int buildConstraintMatrix(const core::ConstraintParams* cparams);
+
+ void applyProjectiveConstraintOnConstraintMatrix(const core::ConstraintParams* cparams);
+
+ void getConstraintViolation(const core::ConstraintParams* cparams, sofa::linearalgebra::BaseVector *v);
+
};
} //namespace sofa::component::constraint::lagrangian::solver
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintProblem.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintProblem.cpp
index 04384614b014..7f80cccce130 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintProblem.cpp
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintProblem.cpp
@@ -269,7 +269,7 @@ void GenericConstraintProblem::unbuiltGaussSeidel(SReal timeout, GenericConstrai
SReal *d = _d.ptr();
- int iter, nb;
+ unsigned int iter = 0, nb = 0;
SReal error=0.0;
@@ -317,7 +317,11 @@ void GenericConstraintProblem::unbuiltGaussSeidel(SReal timeout, GenericConstrai
tabErrors.resize(dimension);
- for(iter=0; iter errF;
+ std::vector tempF;
+
+ for(iter=0; iter < static_cast(maxIterations); iter++)
{
bool constraintsAreVerified = true;
if(sor != 1.0)
@@ -334,7 +338,11 @@ void GenericConstraintProblem::unbuiltGaussSeidel(SReal timeout, GenericConstrai
//2. for each line we compute the actual value of d
// (a)d is set to dfree
- std::vector errF(&force[j], &force[j+nb]);
+ if(nb > errF.size())
+ {
+ errF.resize(nb);
+ }
+ std::copy_n(&force[j], nb, errF.begin());
std::copy_n(&dfree[j], nb, &d[j]);
// (b) contribution of forces are added to d
@@ -351,10 +359,10 @@ void GenericConstraintProblem::unbuiltGaussSeidel(SReal timeout, GenericConstrai
SReal contraintError = 0.0;
if(nb > 1)
{
- for(int l=0; l tempF (&force[j], &force[j+nb]);
- for(int l=0; l tempF.size())
+ {
+ tempF.resize(nb);
+ }
+ std::copy_n(&force[j], nb, tempF.begin());
+ for(unsigned int l=0; lsetConstraintDForce(force, j, j+nb-1, update);
}
- std::copy(tempF.begin(), tempF.end(), &force[j]);
- }
+ std::copy_n(tempF.begin(), nb, &force[j]);
+ }
std::advance(it_c, nb);
}
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp
index f8fd5e4834ec..16d1e17e8329 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp
@@ -37,15 +37,6 @@
#include
using sofa::simulation::mechanicalvisitor::MechanicalVOpVisitor;
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalResetConstraintVisitor;
-
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalBuildConstraintMatrix;
-
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalAccumulateMatrixDeriv;
-
#include
using sofa::simulation::mechanicalvisitor::MechanicalProjectJacobianMatrixVisitor;
@@ -57,6 +48,7 @@ namespace
using sofa::helper::WriteOnlyAccessor;
using sofa::core::objectmodel::Data;
+using sofa::core::ConstraintParams;
template< typename TMultiVecId >
void clearMultiVecId(sofa::core::objectmodel::BaseContext* ctx, const sofa::core::ConstraintParams* cParams, const TMultiVecId& vid)
@@ -132,8 +124,6 @@ void GenericConstraintSolver::init()
{
ConstraintSolverImpl::init();
- constraintCorrectionIsActive.resize(l_constraintCorrections.size());
-
simulation::common::VectorOperations vop(sofa::core::execparams::defaultInstance(), this->getContext());
{
sofa::core::behavior::MultiVecDeriv lambda(&vop, m_lambdaId);
@@ -170,15 +160,12 @@ void GenericConstraintSolver::cleanup()
bool GenericConstraintSolver::prepareStates(const core::ConstraintParams *cParams, MultiVecId /*res1*/, MultiVecId /*res2*/)
{
- sofa::helper::ScopedAdvancedTimer vtimer("PrepareStates");
-
last_cp = current_cp;
clearConstraintProblemLocks(); // NOTE: this assumes we solve only one constraint problem per step
simulation::common::VectorOperations vop(cParams, this->getContext());
-
{
sofa::core::behavior::MultiVecDeriv lambda(&vop, m_lambdaId);
lambda.realloc(&vop,false,true, core::VecIdProperties{"lambda", GetClass()->className});
@@ -199,65 +186,42 @@ bool GenericConstraintSolver::prepareStates(const core::ConstraintParams *cParam
return true;
}
-bool GenericConstraintSolver::buildSystem(const core::ConstraintParams *cParams, MultiVecId /*res1*/, MultiVecId /*res2*/)
+bool GenericConstraintSolver::buildSystem(const core::ConstraintParams *cParams, MultiVecId res1, MultiVecId res2)
{
- unsigned int numConstraints = 0;
-
- {
- helper::ScopedAdvancedTimer timer("Accumulate Constraint");
-
- auto* context = getContext();
-
- // mechanical action executed from root node to propagate the constraints
- MechanicalResetConstraintVisitor(cParams).execute(context);
- // calling buildConstraintMatrix
- MechanicalBuildConstraintMatrix(cParams, cParams->j(), numConstraints).execute(context);
-
- MechanicalAccumulateMatrixDeriv(cParams, cParams->j(), reverseAccumulateOrder.getValue()).execute(context);
-
- // suppress the constraints that are on DOFS currently concerned by projective constraint
- core::MechanicalParams mparams = core::MechanicalParams(*cParams);
- MechanicalProjectJacobianMatrixVisitor(&mparams).execute(context);
- }
+ SOFA_UNUSED(res1);
+ SOFA_UNUSED(res2);
+ const unsigned int numConstraints = buildConstraintMatrix(cParams);
sofa::helper::AdvancedTimer::valSet("numConstraints", numConstraints);
+ // suppress the constraints that are on DOFS currently concerned by projective constraint
+ applyProjectiveConstraintOnConstraintMatrix(cParams);
+
current_cp->clear(numConstraints);
- {
- sofa::helper::ScopedAdvancedTimer getConstraintValueTimer("Get Constraint Value");
- MechanicalGetConstraintViolationVisitor(cParams, ¤t_cp->dFree).execute(getContext());
- }
+ getConstraintViolation(cParams, ¤t_cp->dFree);
{
- sofa::helper::ScopedAdvancedTimer getConstraintResolutionsTimer("Get Constraint Resolutions");
+ // creates constraint-specific objects used for the constraint resolution
+ // in a Gauss-Seidel algorithm
+ SCOPED_TIMER("Get Constraint Resolutions");
MechanicalGetConstraintResolutionVisitor(cParams, current_cp->constraintsResolutions).execute(getContext());
}
- msg_info() << numConstraints << " constraints";
-
- // Test if the nodes containing the constraint correction are active (not sleeping)
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
- constraintCorrectionIsActive[i] = !l_constraintCorrections[i]->getContext()->isSleeping();
-
// Resolution depending on the method selected
switch ( d_resolutionMethod.getValue().getSelectedId() )
{
- // ProjectedGaussSeidel
- case 0: {
+ case 0: // ProjectedGaussSeidel
+ case 2: // NonsmoothNonlinearConjugateGradient
+ {
buildSystem_matrixAssembly(cParams);
break;
}
- // UnbuiltGaussSeidel
- case 1: {
+ case 1: // UnbuiltGaussSeidel
+ {
buildSystem_matrixFree(numConstraints);
break;
}
- // NonsmoothNonlinearConjugateGradient
- case 2: {
- buildSystem_matrixAssembly(cParams);
- break;
- }
default:
msg_error() << "Wrong \"resolutionMethod\" given";
}
@@ -354,7 +318,7 @@ void GenericConstraintSolver::ComplianceWrapper::assembleMatrix() const
void GenericConstraintSolver::buildSystem_matrixAssembly(const core::ConstraintParams *cParams)
{
- sofa::helper::ScopedAdvancedTimer getComplianceTimer("Get Compliance");
+ SCOPED_TIMER_VARNAME(getComplianceTimer, "Get Compliance");
dmsg_info() <<" computeCompliance in " << l_constraintCorrections.size()<< " constraintCorrections" ;
const bool multithreading = d_multithreading.getValue();
@@ -366,8 +330,11 @@ void GenericConstraintSolver::buildSystem_matrixAssembly(const core::ConstraintP
simulation::TaskScheduler* taskScheduler = simulation::MainTaskSchedulerFactory::createInRegistry();
assert(taskScheduler);
+ //Used to prevent simultaneous accesses to the main compliance matrix
std::mutex mutex;
+ //Visits all constraint corrections to compute the compliance matrix projected
+ //in the constraint space.
simulation::forEachRange(execution, *taskScheduler, l_constraintCorrections.begin(), l_constraintCorrections.end(),
[&cParams, this, &multithreading, &mutex](const auto& range)
{
@@ -389,41 +356,49 @@ void GenericConstraintSolver::buildSystem_matrixAssembly(const core::ConstraintP
dmsg_info() << " computeCompliance_done " ;
}
-void GenericConstraintSolver::rebuildSystem(SReal massFactor, SReal forceFactor)
+void GenericConstraintSolver::rebuildSystem(const SReal massFactor, const SReal forceFactor)
{
for (const auto& cc : l_constraintCorrections)
{
- if (!cc->isActive()) continue;
- cc->rebuildSystem(massFactor, forceFactor);
+ if (cc->isActive())
+ {
+ cc->rebuildSystem(massFactor, forceFactor);
+ }
}
}
void printLCP(std::ostream& file, SReal *q, SReal **M, SReal *f, int dim, bool printMatrix = true)
{
file.precision(9);
- // affichage de la matrice du LCP
- if (printMatrix) {
+
+ // print LCP matrix
+ if (printMatrix)
+ {
file << msgendl << " W = [";
- for(int compteur=0;compteurgaussSeidel(0, this);
break;
}
// UnbuiltGaussSeidel
case 1: {
- sofa::helper::ScopedAdvancedTimer unbuiltGaussSeidelTimer("ConstraintsUnbuiltGaussSeidel");
+ SCOPED_TIMER_VARNAME(unbuiltGaussSeidelTimer, "ConstraintsUnbuiltGaussSeidel");
current_cp->unbuiltGaussSeidel(0, this);
break;
}
@@ -504,93 +479,87 @@ void GenericConstraintSolver::computeResidual(const core::ExecParams* eparam)
}
}
-
-bool GenericConstraintSolver::applyCorrection(const core::ConstraintParams *cParams, MultiVecId res1, MultiVecId res2)
+sofa::type::vector GenericConstraintSolver::filteredConstraintCorrections() const
{
- using sofa::helper::AdvancedTimer;
- using core::behavior::BaseConstraintCorrection;
-
- msg_info() << "KeepContactForces done" ;
+ sofa::type::vector filteredConstraintCorrections;
+ filteredConstraintCorrections.reserve(l_constraintCorrections.size());
+ std::copy_if(l_constraintCorrections.begin(), l_constraintCorrections.end(),
+ std::back_inserter(filteredConstraintCorrections),
+ [](const auto& constraintCorrection)
+ {
+ return constraintCorrection &&
+ !constraintCorrection->getContext()->isSleeping() &&
+ constraintCorrection->isActive();
+ });
+ return filteredConstraintCorrections;
+}
+void GenericConstraintSolver::applyMotionCorrection(
+ const core::ConstraintParams* cParams,
+ const core::MultiVecCoordId xId,
+ const core::MultiVecDerivId vId,
+ core::behavior::BaseConstraintCorrection* constraintCorrection) const
+{
+ if (cParams->constOrder() == sofa::core::ConstraintOrder::POS_AND_VEL)
{
- helper::ScopedAdvancedTimer timer("Compute And Apply Motion Correction");
-
- if (cParams->constOrder() == core::ConstraintParams::POS_AND_VEL)
- {
- const core::MultiVecCoordId xId(res1);
- const core::MultiVecDerivId vId(res2);
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
- {
- if (!constraintCorrectionIsActive[i]) continue;
- BaseConstraintCorrection* cc = l_constraintCorrections[i];
- if (!cc->isActive()) continue;
+ constraintCorrection->applyMotionCorrection(cParams, xId, vId, cParams->dx(), this->getDx() );
+ }
+ else if (cParams->constOrder() == sofa::core::ConstraintOrder::POS)
+ {
+ constraintCorrection->applyPositionCorrection(cParams, xId, cParams->dx(), this->getDx());
+ }
+ else if (cParams->constOrder() == sofa::core::ConstraintOrder::VEL)
+ {
+ constraintCorrection->applyVelocityCorrection(cParams, vId, cParams->dx(), this->getDx() );
+ }
+}
- {
- helper::ScopedAdvancedTimer computeCorrectonFromLambdaTimer("ComputeCorrection on: " + cc->getName());
- cc->computeMotionCorrectionFromLambda(cParams, this->getDx(), ¤t_cp->f);
- }
+void GenericConstraintSolver::computeAndApplyMotionCorrection(const core::ConstraintParams* cParams, MultiVecId res1, MultiVecId res2) const
+{
+ SCOPED_TIMER("Compute And Apply Motion Correction");
- {
- helper::ScopedAdvancedTimer applyCorrectonFromLambdaTimer("ApplyCorrection on: " + cc->getName());
- cc->applyMotionCorrection(cParams, xId, vId, cParams->dx(), this->getDx() );
- }
- }
- }
- else if (cParams->constOrder() == core::ConstraintParams::POS)
- {
- const core::MultiVecCoordId xId(res1);
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
- {
- if (!constraintCorrectionIsActive[i]) continue;
- BaseConstraintCorrection* cc = l_constraintCorrections[i];
- if (!cc->isActive()) continue;
+ static constexpr auto supportedCorrections = {
+ sofa::core::ConstraintOrder::POS_AND_VEL,
+ sofa::core::ConstraintOrder::POS,
+ sofa::core::ConstraintOrder::VEL
+ };
- {
- sofa::helper::ScopedAdvancedTimer computeCorrectionTimer("ComputeCorrection on: " + cc->getName());
- cc->computeMotionCorrectionFromLambda(cParams, this->getDx(), ¤t_cp->f);
- }
+ if (std::find(supportedCorrections.begin(), supportedCorrections.end(), cParams->constOrder()) != supportedCorrections.end())
+ {
+ const core::MultiVecCoordId xId(res1);
+ const core::MultiVecDerivId vId(cParams->constOrder() == sofa::core::ConstraintOrder::VEL ? res1 : res2);
- {
- sofa::helper::ScopedAdvancedTimer applyCorrectionTimer("ApplyCorrection on: " + cc->getName());
- cc->applyPositionCorrection(cParams, xId, cParams->dx(), this->getDx());
- }
- }
- }
- else if (cParams->constOrder() == core::ConstraintParams::VEL)
+ for (const auto& constraintCorrection : filteredConstraintCorrections())
{
- const core::MultiVecDerivId vId(res1);
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
{
- if (!constraintCorrectionIsActive[i]) continue;
- BaseConstraintCorrection* cc = l_constraintCorrections[i];
- if (!cc->isActive()) continue;
-
- {
- sofa::helper::ScopedAdvancedTimer computeCorrectionTimer("ComputeCorrection on: " + cc->getName());
- cc->computeMotionCorrectionFromLambda(cParams, this->getDx(), ¤t_cp->f);
- }
-
- {
- sofa::helper::ScopedAdvancedTimer applyCorrectionTimer("ApplyCorrection on: " + cc->getName());
- cc->applyVelocityCorrection(cParams, vId, cParams->dx(), this->getDx() );
- }
+ SCOPED_TIMER("ComputeCorrection");
+ constraintCorrection->computeMotionCorrectionFromLambda(cParams, this->getDx(), ¤t_cp->f);
}
+
+ SCOPED_TIMER("ApplyCorrection");
+ applyMotionCorrection(cParams, xId, vId, constraintCorrection);
}
}
+}
- msg_info() << "Compute And Apply Motion Correction in constraintCorrection done" ;
+void GenericConstraintSolver::storeConstraintLambdas(const core::ConstraintParams* cParams)
+{
+ SCOPED_TIMER("Store Constraint Lambdas");
- {
- helper::ScopedAdvancedTimer timer("Store Constraint Lambdas");
+ /// Some constraint correction schemes may have written the constraint motion space lambda in the lambdaId VecId.
+ /// In order to be sure that we are not accumulating things twice, we need to clear.
+ clearMultiVecId(getContext(), cParams, m_lambdaId);
- /// Some constraint correction schemes may have written the constraint motion space lambda in the lambdaId VecId.
- /// In order to be sure that we are not accumulating things twice, we need to clear.
- clearMultiVecId(getContext(), cParams, m_lambdaId);
+ /// Store lambda and accumulate.
+ ConstraintStoreLambdaVisitor v(cParams, ¤t_cp->f);
+ this->getContext()->executeVisitor(&v);
+}
- /// Store lambda and accumulate.
- ConstraintStoreLambdaVisitor v(cParams, ¤t_cp->f);
- this->getContext()->executeVisitor(&v);
- }
+
+bool GenericConstraintSolver::applyCorrection(const core::ConstraintParams *cParams, MultiVecId res1, MultiVecId res2)
+{
+ computeAndApplyMotionCorrection(cParams, res1, res2);
+ storeConstraintLambdas(cParams);
return true;
}
@@ -603,10 +572,7 @@ ConstraintProblem* GenericConstraintSolver::getConstraintProblem()
void GenericConstraintSolver::clearConstraintProblemLocks()
{
- for (unsigned int i = 0; i < CP_BUFFER_SIZE; ++i)
- {
- m_cpIsLocked[i] = false;
- }
+ std::fill(m_cpIsLocked.begin(), m_cpIsLocked.end(), false);
}
void GenericConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2)
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h
index cb878c135149..0a6189bfddfd 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h
@@ -51,8 +51,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver :
bool prepareStates(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
bool buildSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
- void buildSystem_matrixFree(unsigned int numConstraints);
- void buildSystem_matrixAssembly(const core::ConstraintParams *cParams);
void rebuildSystem(SReal massFactor, SReal forceFactor) override;
bool solveSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
bool applyCorrection(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
@@ -104,16 +102,20 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver :
void clearConstraintProblemLocks();
- enum { CP_BUFFER_SIZE = 10 };
- sofa::type::fixed_array m_cpBuffer;
- sofa::type::fixed_array m_cpIsLocked;
+ static constexpr auto CP_BUFFER_SIZE = 10;
+ sofa::type::fixed_array m_cpBuffer;
+ sofa::type::fixed_array m_cpIsLocked;
GenericConstraintProblem *current_cp, *last_cp;
SOFA_ATTRIBUTE_DISABLED__GENERICCONSTRAINTSOLVER_CONSTRAINTCORRECTIONS() DeprecatedAndRemoved constraintCorrections; //use ConstraintSolverImpl::l_constraintCorrections instead
- type::vector constraintCorrectionIsActive; // for each constraint correction, a boolean that is false if the parent node is sleeping
sofa::core::MultiVecDerivId m_lambdaId;
sofa::core::MultiVecDerivId m_dxId;
+ void buildSystem_matrixFree(unsigned int numConstraints);
+
+ // Explicitly compute the compliance matrix projected in the constraint space
+ void buildSystem_matrixAssembly(const core::ConstraintParams *cParams);
+
private:
struct ComplianceWrapper
@@ -133,6 +135,17 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver :
std::unique_ptr m_threadMatrix;
};
+
+ sofa::type::vector filteredConstraintCorrections() const;
+
+ void computeAndApplyMotionCorrection(const core::ConstraintParams* cParams, GenericConstraintSolver::MultiVecId res1, GenericConstraintSolver::MultiVecId res2) const;
+ void applyMotionCorrection(
+ const core::ConstraintParams* cParams,
+ const core::MultiVecCoordId xId,
+ const core::MultiVecDerivId vId,
+ core::behavior::BaseConstraintCorrection* constraintCorrection) const;
+ void storeConstraintLambdas(const core::ConstraintParams* cParams);
+
};
} //namespace sofa::component::constraint::lagrangian::solver
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.cpp
index 6180bd408e92..f2317f710a71 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.cpp
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.cpp
@@ -31,21 +31,12 @@
#include
#include
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalAccumulateMatrixDeriv;
-
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalBuildConstraintMatrix;
-
#include
using sofa::simulation::mechanicalvisitor::MechanicalGetConstraintInfoVisitor;
#include
using sofa::simulation::mechanicalvisitor::MechanicalVOpVisitor;
-#include
-using sofa::simulation::mechanicalvisitor::MechanicalResetConstraintVisitor;
-
using sofa::core::VecId;
namespace sofa::component::constraint::lagrangian::solver
@@ -75,8 +66,8 @@ LCPConstraintSolver::LCPConstraintSolver()
, showCellWidth( initData(&showCellWidth, "showCellWidth", "Distance between each constraint cells"))
, showTranslation( initData(&showTranslation, "showTranslation", "Position of the first cell"))
, showLevelTranslation( initData(&showLevelTranslation, "showLevelTranslation", "Translation between levels"))
- , lcp(&lcp1)
- , last_lcp(nullptr)
+ , current_cp(&lcp1)
+ , last_cp(nullptr)
, _W(&lcp1.W)
, _dFree(&lcp1.dFree)
, _result(&lcp1.f)
@@ -95,13 +86,6 @@ LCPConstraintSolver::~LCPConstraintSolver()
{
}
-void LCPConstraintSolver::init()
-{
- ConstraintSolverImpl::init();
-
- constraintCorrectionIsActive.resize(l_constraintCorrections.size());
-}
-
void LCPConstraintProblem::solveTimed(SReal tolerance, int maxIt, SReal timeout)
{
helper::nlcp_gaussseidelTimed(dimension, getDfree(), getW(), getF(), mu, tolerance, maxIt, true, timeout);
@@ -109,16 +93,14 @@ void LCPConstraintProblem::solveTimed(SReal tolerance, int maxIt, SReal timeout)
bool LCPConstraintSolver::prepareStates(const core::ConstraintParams * /*cParams*/, MultiVecId /*res1*/, MultiVecId /*res2*/)
{
- sofa::helper::AdvancedTimer::StepVar vtimer("PrepareStates");
-
- last_lcp = lcp;
+ last_cp = current_cp;
MechanicalVOpVisitor(core::execparams::defaultInstance(), (core::VecId)core::VecDerivId::dx()).setMapped(true).execute( getContext()); //dX=0
msg_info() <<" propagate DXn performed - collision called" ;
- helper::ScopedAdvancedTimer resetContactForceTimer("resetContactForce");
-
- for (const auto cc : l_constraintCorrections)
+ SCOPED_TIMER("resetContactForce");
+
+ for (const auto& cc : l_constraintCorrections)
{
cc->resetContactForce();
}
@@ -126,28 +108,45 @@ bool LCPConstraintSolver::prepareStates(const core::ConstraintParams * /*cParams
return true;
}
-bool LCPConstraintSolver::buildSystem(const core::ConstraintParams * /*cParams*/, MultiVecId /*res1*/, MultiVecId /*res2*/)
+bool LCPConstraintSolver::buildSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2)
{
+ SOFA_UNUSED(res1);
+ SOFA_UNUSED(res2);
- // Test if the nodes containing the constraint correction are active (not sleeping)
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
- {
- constraintCorrectionIsActive[i] = !l_constraintCorrections[i]->getContext()->isSleeping();
- }
+ buildSystem();
+ return true;
+}
- if(build_lcp.getValue())
- {
- helper::ScopedAdvancedTimer buildTimer("build_LCP");
- build_LCP();
+void LCPConstraintSolver::buildSystem()
+{
+ core::ConstraintParams cparams;
+
+ cparams.setX(core::ConstVecCoordId::freePosition());
+ cparams.setV(core::ConstVecDerivId::freeVelocity());
+
+ _numConstraints = buildConstraintMatrix(&cparams);
+ sofa::helper::AdvancedTimer::valSet("numConstraints", _numConstraints);
+
+ current_cp->mu = mu.getValue();
+ current_cp->clear(_numConstraints);
+
+ getConstraintViolation(&cparams, _dFree);
+
+ if (build_lcp.getValue())
+ {
+ addComplianceInConstraintSpace(cparams);
}
else
{
- helper::ScopedAdvancedTimer buildTimer("build_problem");
-
- build_problem_info();
+ // When the LCP or the NLCP is not fully built, the diagonal blocks of the matrix are still needed for the resolution
+ _Wdiag.resize(_numConstraints,_numConstraints);
}
- return true;
+
+ buildHierarchy();
+
+ getConstraintInfo(cparams);
+
}
bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/, MultiVecId /*res1*/, MultiVecId /*res2*/)
@@ -165,12 +164,12 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
if (_mu > 0.0)
{
- lcp->tolerance = _tol;
+ current_cp->tolerance = _tol;
if (multi_grid.getValue())
{
{
- helper::ScopedAdvancedTimer timer("ConstraintsMerge");
+ SCOPED_TIMER("ConstraintsMerge");
MultigridConstraintsMerge();
}
@@ -182,7 +181,7 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
graph_levels.clear();
{
- helper::ScopedAdvancedTimer timer("NLCP MultiGrid");
+ SCOPED_TIMER("NLCP MultiGrid");
helper::nlcp_multiGrid_Nlevels(_numConstraints, _dFree->ptr(), _W->lptr(), _result->ptr(), _mu, _tol, _maxIt, initial_guess.getValue(),
hierarchy_contact_group, hierarchy_num_group, hierarchy_constraint_group, hierarchy_constraint_group_fact, notMuted(), &graph_residuals, &graph_levels, &graph_violations);
}
@@ -196,7 +195,7 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
graph_violations.clear();
{
- helper::ScopedAdvancedTimer timer("NLCP GaussSeidel");
+ SCOPED_TIMER("NLCP GaussSeidel");
helper::nlcp_gaussseidel(_numConstraints, _dFree->ptr(), _W->lptr(), _result->ptr(), _mu, _tol, _maxIt, initial_guess.getValue(),
notMuted(), _minW, _maxF, &graph_error, &graph_violations);
}
@@ -208,7 +207,7 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
graph_error.clear();
{
- helper::ScopedAdvancedTimer timer("LCP GaussSeidel");
+ SCOPED_TIMER("LCP GaussSeidel");
helper::gaussSeidelLCP1(_numConstraints, _dFree->ptr(), _W->lptr(), _result->ptr(), _tol, _maxIt, _minW, _maxF, &graph_error);
}
if (notMuted())
@@ -224,7 +223,7 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
graph_error.clear();
{
- helper::ScopedAdvancedTimer timer("NLCP GaussSeidel Unbuild");
+ SCOPED_TIMER("NLCP GaussSeidel Unbuild");
gaussseidel_unbuilt(_dFree->ptr(), _result->ptr(), &graph_error);
}
@@ -237,7 +236,7 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
const SReal _tol = tol.getValue();
const int _maxIt = maxIt.getValue();
- build_LCP();
+ buildSystem();
helper::nlcp_gaussseidel(_numConstraints, _dFree->ptr(), _W->lptr(), _result->ptr(), _mu, _tol, _maxIt, initial_guess.getValue());
dmsg_info() <<"\n_result nlcp :"<<(*_result);
@@ -249,8 +248,8 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
if(d_computeConstraintForces.getValue())
{
sofa::helper::WriteOnlyAccessor>> constraints = d_constraintForces;
- constraints.resize(lcp->getDimension());
- for(int i=0; igetDimension(); i++)
+ constraints.resize(current_cp->getDimension());
+ for(int i=0; igetDimension(); i++)
{
constraints[i] = _result->ptr()[i];
}
@@ -262,48 +261,22 @@ bool LCPConstraintSolver::solveSystem(const core::ConstraintParams * /*cParams*/
bool LCPConstraintSolver::applyCorrection(const core::ConstraintParams * /*cParams*/, MultiVecId /*res1*/, MultiVecId /*res2*/)
{
if (initial_guess.getValue())
+ {
keepContactForcesValue();
+ }
- dmsg_info() << "keepContactForces done" ;
-
+ SCOPED_TIMER("Apply Contact Force");
+ for (const auto& l_constraintCorrection : l_constraintCorrections)
{
- helper::ScopedAdvancedTimer timer("Apply Contact Force");
- for (unsigned int i = 0; i < l_constraintCorrections.size(); i++)
+ if (!l_constraintCorrection->getContext()->isSleeping())
{
- if (!constraintCorrectionIsActive[i]) continue;
- core::behavior::BaseConstraintCorrection* cc = l_constraintCorrections[i];
- cc->applyContactForce(_result);
+ l_constraintCorrection->applyContactForce(_result);
}
}
- dmsg_info() <<"applyContactForce in constraintCorrection done" ;
-
return true;
}
-void LCPConstraintSolver::resetConstraints(core::ConstraintParams cparams)
-{
- helper::ScopedAdvancedTimer resetConstraintsTimer("Reset Constraint");
- MechanicalResetConstraintVisitor resetCtr(&cparams);
- resetCtr.execute(getContext());
-}
-
-void LCPConstraintSolver::buildConstraintMatrix(core::ConstraintParams cparams)
-{
- helper::ScopedAdvancedTimer buildConstraintMatrixTimer("Build Constraint Matrix");
-
- MechanicalBuildConstraintMatrix buildConstraintMatrix(&cparams, cparams.j(), _numConstraints );
- buildConstraintMatrix.execute(getContext());
-}
-
-void LCPConstraintSolver::accumulateMatrixDeriv(core::ConstraintParams cparams)
-{
- helper::ScopedAdvancedTimer accumulateMatrixDerivTimer("Accumulate Matrix Deriv");
-
- MechanicalAccumulateMatrixDeriv accumulateMatrixDeriv(&cparams, cparams.j());
- accumulateMatrixDeriv.execute(getContext());
-}
-
void LCPConstraintSolver::buildHierarchy()
{
int nLevels = 1;
@@ -332,64 +305,30 @@ void LCPConstraintSolver::getConstraintInfo(core::ConstraintParams cparams)
if ((initial_guess.getValue() || multi_grid.getValue() || showLevels.getValue()) && (_numConstraints != 0))
{
{
- helper::ScopedAdvancedTimer timer("Get Constraint Info");
+ SCOPED_TIMER("Get Constraint Info");
MechanicalGetConstraintInfoVisitor(&cparams, hierarchy_constraintBlockInfo[0], hierarchy_constraintIds[0], hierarchy_constraintPositions[0], hierarchy_constraintDirections[0], hierarchy_constraintAreas[0]).execute(getContext());
}
if (initial_guess.getValue())
+ {
computeInitialGuess();
+ }
}
}
void LCPConstraintSolver::addComplianceInConstraintSpace(core::ConstraintParams cparams)
{
- helper::ScopedAdvancedTimer timer("Get Compliance");
+ SCOPED_TIMER("Get Compliance");
- dmsg_info() <<" computeCompliance in " << l_constraintCorrections.size()<< " constraintCorrections" ;
+ dmsg_info() <<" computeCompliance in " << l_constraintCorrections.size() << " constraintCorrections" ;
- for (unsigned int i=0; iaddComplianceInConstraintSpace(&cparams, _W);
}
dmsg_info() << "W=" << *_W ;
}
-void LCPConstraintSolver::build_LCP()
-{
- _numConstraints = 0;
- core::ConstraintParams cparams;
-
- cparams.setX(core::ConstVecCoordId::freePosition());
- cparams.setV(core::ConstVecDerivId::freeVelocity());
-
- resetConstraints(cparams);
-
- buildConstraintMatrix(cparams);
-
- accumulateMatrixDeriv(cparams);
-
- const auto _mu = mu.getValue();
-
- sofa::helper::AdvancedTimer::valSet("numConstraints", _numConstraints);
-
- lcp->mu = _mu;
- lcp->clear(_numConstraints);
-
- {
- helper::ScopedAdvancedTimer getConstraintValueTimer("Get Constraint Value");
- MechanicalGetConstraintViolationVisitor(&cparams, _dFree).execute(getContext());
- }
-
- dmsg_info() << _numConstraints << " constraints, mu = "<<_mu;
-
- addComplianceInConstraintSpace(cparams);
-
- buildHierarchy();
-
- getConstraintInfo(cparams);
-}
-
void LCPConstraintSolver::build_Coarse_Compliance(std::vector &constraint_merge, int sizeCoarseSystem)
{
/* constraint_merge => tableau donne l'indice du groupe de contraintes dans le système grossier en fonction de l'indice de la contrainte dans le système de départ */
@@ -697,47 +636,6 @@ void LCPConstraintSolver::MultigridConstraintsMerge_Spatial()
}
}
-
-/// build_problem_info
-/// When the LCP or the NLCP is not fully built, the diagonal blocks of the matrix are still needed for the resolution
-/// This function ask to the constraintCorrection classes to build this diagonal blocks
-void LCPConstraintSolver::build_problem_info()
-{
- core::ConstraintParams cparams;
-
- cparams.setX(core::ConstVecCoordId::freePosition());
- cparams.setV(core::ConstVecDerivId::freeVelocity());
-
- _numConstraints = 0;
-
- resetConstraints(cparams);
-
- buildConstraintMatrix(cparams);
-
- accumulateMatrixDeriv(cparams);
-
- const auto _mu = mu.getValue();
-
- sofa::helper::AdvancedTimer::valSet("numConstraints", _numConstraints);
-
- lcp->mu = _mu;
- lcp->clear(_numConstraints);
-
- // as _Wdiag is a sparse matrix resize do not allocate memory
- _Wdiag.resize(_numConstraints,_numConstraints);
-
- {
- helper::ScopedAdvancedTimer getConstraintValueTimer("Get Constraint Value");
- MechanicalGetConstraintViolationVisitor(&cparams, _dFree).execute(getContext());
- }
-
- dmsg_info() << _numConstraints << " constraints, mu = "<<_mu;
-
- buildHierarchy();
-
- getConstraintInfo(cparams);
-}
-
void LCPConstraintSolver::computeInitialGuess()
{
sofa::helper::AdvancedTimer::StepVar vtimer("InitialGuess");
@@ -974,7 +872,7 @@ int LCPConstraintSolver::nlcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::v
buildDiagonalTimer.reset();
- helper::ScopedAdvancedTimer gaussSeidelTimer("GAUSS_SEIDEL");
+ SCOPED_TIMER_VARNAME(gaussSeidelTimer, "GAUSS_SEIDEL");
SReal error = 0;
SReal dn, dt, ds, fn, ft, fs, fn0;
@@ -1129,7 +1027,7 @@ int LCPConstraintSolver::lcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::ve
{
bool elem1 = false;
bool elem2 = false;
- for (const auto cc : l_constraintCorrections)
+ for (const auto& cc : l_constraintCorrections)
{
if(cc->hasConstraintNumber(c1))
{
@@ -1204,7 +1102,7 @@ int LCPConstraintSolver::lcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::ve
}
buildDiagonalTimer.reset();
- sofa::helper::ScopedAdvancedTimer gaussSeidelTimer("GAUSS_SEIDEL");
+ SCOPED_TIMER_VARNAME(gaussSeidelTimer, "GAUSS_SEIDEL");
SReal error = 0;
SReal dn, fn, fn0;
@@ -1281,25 +1179,25 @@ int LCPConstraintSolver::lcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::ve
ConstraintProblem* LCPConstraintSolver::getConstraintProblem()
{
- return last_lcp;
+ return last_cp;
}
void LCPConstraintSolver::lockConstraintProblem(sofa::core::objectmodel::BaseObject* /*from*/, ConstraintProblem* l1, ConstraintProblem* l2)
{
- if((lcp!=l1)&&(lcp!=l2)) // Le lcp courant n'est pas locké
+ if((current_cp!=l1)&&(current_cp!=l2)) // Le lcp courant n'est pas locké
return;
if((&lcp1!=l1)&&(&lcp1!=l2)) // lcp1 n'est pas locké
- lcp = &lcp1;
+ current_cp = &lcp1;
else if((&lcp2!=l1)&&(&lcp2!=l2)) // lcp2 n'est pas locké
- lcp = &lcp2;
+ current_cp = &lcp2;
else
- lcp = &lcp3; // lcp1 et lcp2 sont lockés, donc lcp3 n'est pas locké
+ current_cp = &lcp3; // lcp1 et lcp2 sont lockés, donc lcp3 n'est pas locké
// Mise � jour de _W _dFree et _result
- _W = &lcp->W;
- _dFree = &lcp->dFree;
- _result = &lcp->f;
+ _W = ¤t_cp->W;
+ _dFree = ¤t_cp->dFree;
+ _result = ¤t_cp->f;
}
diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h
index 14320ffad080..38dc4f782717 100644
--- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h
+++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h
@@ -39,7 +39,7 @@
namespace sofa::component::constraint::lagrangian::solver
{
-class LCPConstraintProblem : public ConstraintProblem
+class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintProblem : public ConstraintProblem
{
public:
SReal mu;
@@ -65,7 +65,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ
*/
~LCPConstraintSolver() override;
public:
- void init() override;
bool prepareStates(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
bool buildSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override;
@@ -104,19 +103,12 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ
void lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) override; ///< Do not use the following LCPs until the next call to this function. This is used to prevent concurent access to the LCP when using a LCPForceFeedback through an haptic thread
private:
- type::vector constraintCorrectionIsActive; // for each constraint correction, a boolean that is false if the parent node is sleeping
void computeInitialGuess();
void keepContactForcesValue();
unsigned int _numConstraints;
SOFA_ATTRIBUTE_DEPRECATED__LCPCONSTRAINTSOLVERMUMEMBER() DeprecatedAndRemoved _mu;
- /// Call the method resetConstraint on all the mechanical states and BaseConstraintSet
- void resetConstraints(core::ConstraintParams cparams);
- /// Call the method buildConstraintMatrix on all the BaseConstraintSet
- void buildConstraintMatrix(core::ConstraintParams cparams);
- /// Call the method applyJT on all the mappings
- void accumulateMatrixDeriv(core::ConstraintParams cparams);
/// Multigrid hierarchy is resized and cleared
void buildHierarchy();
/// Call the method getConstraintInfo on all the BaseConstraintSet
@@ -125,9 +117,8 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ
void addComplianceInConstraintSpace(core::ConstraintParams cparams);
/// for built lcp ///
- void build_LCP();
LCPConstraintProblem lcp1, lcp2, lcp3; // Triple buffer for LCP.
- LCPConstraintProblem *lcp, *last_lcp; /// use of last_lcp allows several LCPForceFeedback to be used in the same scene
+ LCPConstraintProblem *current_cp, *last_cp; /// use of last_lcp allows several LCPForceFeedback to be used in the same scene
sofa::linearalgebra::LPtrFullMatrix *_W;
/// multi-grid approach ///
@@ -145,10 +136,10 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ
/// common built-unbuilt
sofa::linearalgebra::FullVector *_dFree, *_result;
+ void buildSystem();
///
/// for unbuilt lcp ///
- void build_problem_info();
int lcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::vector* residuals = nullptr);
int nlcp_gaussseidel_unbuilt(SReal *dfree, SReal *f, std::vector* residuals = nullptr);
int gaussseidel_unbuilt(SReal *dfree, SReal *f, std::vector* residuals = nullptr);
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.cpp b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.cpp
index ff1389c146f1..433bad30dffd 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.cpp
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.cpp
@@ -19,7 +19,7 @@
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
-#define SOFABOUNDARYCONDITION_AFFINEMOVEMENT_CONSTRAINT_CPP
+#define SOFABOUNDARYCONDITION_AFFINEMOVEMENTCONSTRAINT_CPP
#include
#include
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.h
index 908ac1d430e3..74f2cae555cc 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AffineMovementConstraint.h
@@ -157,10 +157,9 @@ public :
void transform(const SetIndexArray & indices, VecCoord& x0 , VecCoord& xf);
};
-#if !defined(SOFABOUNDARYCONDITION_AFFINEMOVEMENT_CONSTRAINT_CPP)
+#if !defined(SOFABOUNDARYCONDITION_AFFINEMOVEMENTCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API AffineMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API AffineMovementConstraint;
-
-#endif //SOFABOUNDARYCONDITION_AFFINEMOVEMENT_CONSTRAINT_CPP
+#endif //SOFABOUNDARYCONDITION_AFFINEMOVEMENTCONSTRAINT_CPP
} // namespace sofa::component::constraint::projective
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AttachConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AttachConstraint.h
index 00aaa703e26d..14eff971abb8 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AttachConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/AttachConstraint.h
@@ -113,7 +113,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ATTACHCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ATTACHCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API AttachConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API AttachConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API AttachConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedConstraint.h
index 203161c096da..7c83fb40cb89 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedConstraint.h
@@ -125,7 +125,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedRotationConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedRotationConstraint.h
index b523781a7d99..cd66b14734a6 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedRotationConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedRotationConstraint.h
@@ -72,7 +72,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDROTATIONCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDROTATIONCONSTRAINT_CPP)
extern template class FixedRotationConstraint;
#endif
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedTranslationConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedTranslationConstraint.h
index d8e39f958be0..29360c586290 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedTranslationConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/FixedTranslationConstraint.h
@@ -96,7 +96,7 @@ class FixedTranslationConstraint : public core::behavior::ProjectiveConstraintSe
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDTRANSLATIONCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_FIXEDTRANSLATIONCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedTranslationConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedTranslationConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API FixedTranslationConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearMovementConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearMovementConstraint.h
index 9de0e3767b40..4df6f686718b 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearMovementConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearMovementConstraint.h
@@ -157,7 +157,7 @@ public :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_LINEARMOVEMENTCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_LINEARMOVEMENTCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearMovementConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearVelocityConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearVelocityConstraint.h
index 8765b925e749..e347423b33b9 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearVelocityConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/LinearVelocityConstraint.h
@@ -123,7 +123,7 @@ public :
void findKeyTimes();
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_LINEARVELOCITYCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_LINEARVELOCITYCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearVelocityConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearVelocityConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API LinearVelocityConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/OscillatorConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/OscillatorConstraint.h
index b15cd2f4ecdd..ab2389a61daa 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/OscillatorConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/OscillatorConstraint.h
@@ -104,7 +104,7 @@ class OscillatorConstraint : public core::behavior::ProjectiveConstraintSet;
extern template class OscillatorConstraint;
#endif
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ParabolicConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ParabolicConstraint.h
index 28c797a7311c..4b6b1bc7c75b 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ParabolicConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ParabolicConstraint.h
@@ -118,7 +118,7 @@ class ParabolicConstraint : public core::behavior::ProjectiveConstraintSet;
extern template class ParabolicConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialFixedConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialFixedConstraint.h
index 41b018db2a50..b54bdc2b6119 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialFixedConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialFixedConstraint.h
@@ -93,7 +93,7 @@ class PartialFixedConstraint : public FixedConstraint
const std::function& clear);
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PARTIALFIXEDCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PARTIALFIXEDCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialFixedConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialFixedConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialFixedConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialLinearMovementConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialLinearMovementConstraint.h
index ca8e15f467c2..072548a50301 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialLinearMovementConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PartialLinearMovementConstraint.h
@@ -165,7 +165,7 @@ public :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PARTIALLINEARMOVEMENTCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PARTIALLINEARMOVEMENTCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialLinearMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialLinearMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PartialLinearMovementConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PatchTestMovementConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PatchTestMovementConstraint.h
index a3908cf0d303..2a53250282d4 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PatchTestMovementConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PatchTestMovementConstraint.h
@@ -156,7 +156,7 @@ public :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PATCHTESTMOVEMENTCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_PATCHTESTMOVEMENTCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PatchTestMovementConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PatchTestMovementConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PositionBasedDynamicsConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PositionBasedDynamicsConstraint.h
index 1a0117c4dfcd..d861e5a7a727 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PositionBasedDynamicsConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/PositionBasedDynamicsConstraint.h
@@ -101,7 +101,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_POSITIONBASEDDYNAMICSCONSTRAINT_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_POSITIONBASEDDYNAMICSCONSTRAINT_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PositionBasedDynamicsConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PositionBasedDynamicsConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API PositionBasedDynamicsConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectDirectionConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectDirectionConstraint.h
index 375e4d7abe65..73b8f78525cd 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectDirectionConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectDirectionConstraint.h
@@ -125,7 +125,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectDirectionConstraint_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectDirectionConstraint_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectDirectionConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectDirectionConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToLineConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToLineConstraint.h
index 2614ddfbc592..9e30c5687d7d 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToLineConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToLineConstraint.h
@@ -129,7 +129,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToLineConstraint_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToLineConstraint_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToLineConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToLineConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPlaneConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPlaneConstraint.h
index b1184d892ca8..925bf007d652 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPlaneConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPlaneConstraint.h
@@ -127,7 +127,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToPlaneConstraint_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToPlaneConstraint_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToPlaneConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToPlaneConstraint;
diff --git a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPointConstraint.h b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPointConstraint.h
index df57029a954b..91a50f2b7c09 100644
--- a/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPointConstraint.h
+++ b/Sofa/Component/Constraint/Projective/src/sofa/component/constraint/projective/ProjectToPointConstraint.h
@@ -120,7 +120,7 @@ protected :
};
-#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToPointConstraint_CPP)
+#if !defined(SOFA_COMPONENT_PROJECTIVECONSTRAINTSET_ProjectToPointConstraint_CPP)
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToPointConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToPointConstraint;
extern template class SOFA_COMPONENT_CONSTRAINT_PROJECTIVE_API ProjectToPointConstraint;
diff --git a/Sofa/Component/Constraint/Projective/tests/FixedPlaneConstraint_test.cpp b/Sofa/Component/Constraint/Projective/tests/FixedPlaneConstraint_test.cpp
index 5ed1c9ca8555..b040bfced844 100644
--- a/Sofa/Component/Constraint/Projective/tests/FixedPlaneConstraint_test.cpp
+++ b/Sofa/Component/Constraint/Projective/tests/FixedPlaneConstraint_test.cpp
@@ -67,7 +67,7 @@ struct FixedPlaneConstraint_test : public BaseSimulationTest
/// Scene initialization
sofa::simulation::Simulation* simulation;
- sofa::simulation::setSimulation(simulation = new sofa::simulation::graph::DAGSimulation());
+ simulation = sofa::simulation::getSimulation();
simulation::Node::SPtr root = simulation->createNewGraph("root");
root->setGravity( type::Vec3(0,0,0) );
diff --git a/Sofa/Component/Controller/src/sofa/component/controller/MechanicalStateController.h b/Sofa/Component/Controller/src/sofa/component/controller/MechanicalStateController.h
index a4207c2a969f..34a15256e65a 100644
--- a/Sofa/Component/Controller/src/sofa/component/controller/MechanicalStateController.h
+++ b/Sofa/Component/Controller/src/sofa/component/controller/MechanicalStateController.h
@@ -149,7 +149,7 @@ class MechanicalStateController : public Controller
bool buttonDevice;
};
-#if !defined(SOFA_COMPONENT_CONTROLLER_MECHANICALSTATECONTROLLER_CPP)
+#if !defined(SOFA_COMPONENT_CONTROLLER_MECHANICALSTATECONTROLLER_CPP)
extern template class SOFA_COMPONENT_CONTROLLER_API MechanicalStateController;
extern template class SOFA_COMPONENT_CONTROLLER_API MechanicalStateController;
#endif
diff --git a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h
index a39b38afb912..7b2afa1a7108 100644
--- a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h
+++ b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h
@@ -134,7 +134,7 @@ class TetrahedronDiffusionFEMForceField : public core::behavior::ForceField;
extern template class SOFA_COMPONENT_DIFFUSION_API TetrahedronDiffusionFEMForceField;
extern template class SOFA_COMPONENT_DIFFUSION_API TetrahedronDiffusionFEMForceField;
diff --git a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.inl b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.inl
index 960ae9d9addd..add068861507 100644
--- a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.inl
+++ b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.inl
@@ -309,7 +309,7 @@ void TetrahedronDiffusionFEMForceField::setDiffusionCoefficient(const
template
void TetrahedronDiffusionFEMForceField::addForce (const core::MechanicalParams* /*mparams*/, DataVecDeriv& dataf, const DataVecCoord& datax, const DataVecDeriv& /*v*/)
{
- helper::ScopedAdvancedTimer timer("addForceDiffusion");
+ SCOPED_TIMER("addForceDiffusion");
auto f = sofa::helper::getWriteOnlyAccessor(dataf);
const VecCoord& x = datax.getValue();
@@ -334,7 +334,7 @@ void TetrahedronDiffusionFEMForceField::addForce (const core::Mechani
template
void TetrahedronDiffusionFEMForceField::addDForce(const sofa::core::MechanicalParams* mparams, DataVecDeriv& datadF , const DataVecDeriv& datadX)
{
- helper::ScopedAdvancedTimer timer("addDForceDiffusion");
+ SCOPED_TIMER("addDForceDiffusion");
auto df = sofa::helper::getWriteOnlyAccessor(datadF);
const VecDeriv& dx=datadX.getValue();
Real kFactor = mparams->kFactor();
@@ -359,7 +359,7 @@ void TetrahedronDiffusionFEMForceField::addDForce(const sofa::core::M
template
void TetrahedronDiffusionFEMForceField::addKToMatrix(const core::MechanicalParams* mparams, const sofa::core::behavior::MultiMatrixAccessor* matrix)
{
- helper::ScopedAdvancedTimer timer("addKToMatrix");
+ SCOPED_TIMER("addKToMatrix");
const auto N = defaulttype::DataTypeInfo::size();
sofa::core::behavior::MultiMatrixAccessor::MatrixRef r = matrix->getMatrix(this->mstate);
sofa::linearalgebra::BaseMatrix* mat = r.matrix;
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/AverageCoord.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/AverageCoord.h
index a10bca618c75..1adfd33caa5a 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/AverageCoord.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/AverageCoord.h
@@ -67,7 +67,7 @@ class AverageCoord : public core::DataEngine, public core::behavior::SingleState
void onBeginAnimationStep(const double /*dt*/);
};
-#if !defined(SOFA_COMPONENT_ENGINE_AverageCoord_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_AverageCoord_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API AverageCoord;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API AverageCoord;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API AverageCoord;
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ClusteringEngine.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ClusteringEngine.h
index 58899fbe43b0..887691e8672d 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ClusteringEngine.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ClusteringEngine.h
@@ -113,7 +113,7 @@ class ClusteringEngine : public core::DataEngine
bool save();
};
-#if !defined(SOFA_COMPONENT_ENGINE_CLUSTERINGENGINE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_CLUSTERINGENGINE_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API ClusteringEngine;
#endif
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/Distances.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/Distances.h
index 8fdf4a2a10e1..b832087431ca 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/Distances.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/Distances.h
@@ -218,7 +218,7 @@ class Distances : public core::DataEngine
inline void addContribution ( double& valueWrite, int& nbTest, double*** valueRead, const int& x, const int& y, const int& z, const int coeff, const bool& useStiffnessMap );
};
-#if !defined(SOFA_COMPONENT_ENGINE_DISTANCES_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_DISTANCES_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API Distances;
#endif
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/HausdorffDistance.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/HausdorffDistance.h
index 8505fe160703..e183b7d5b8c8 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/HausdorffDistance.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/HausdorffDistance.h
@@ -79,7 +79,7 @@ class HausdorffDistance : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_HAUSDORFFDISTANCE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_HAUSDORFFDISTANCE_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API HausdorffDistance;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API HausdorffDistance;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API HausdorffDistance;
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ShapeMatching.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ShapeMatching.h
index 5c98cfe1525c..f049c899c3a2 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ShapeMatching.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/ShapeMatching.h
@@ -95,7 +95,7 @@ class ShapeMatching : public core::DataEngine, public core::behavior::SingleStat
};
-#if !defined(SOFA_COMPONENT_ENGINE_SHAPEMATCHING_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_SHAPEMATCHING_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API ShapeMatching;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API ShapeMatching;
diff --git a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/SumEngine.h b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/SumEngine.h
index e559291b0f34..ff48e921caca 100644
--- a/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/SumEngine.h
+++ b/Sofa/Component/Engine/Analyze/src/sofa/component/engine/analyze/SumEngine.h
@@ -53,7 +53,7 @@ class SumEngine : public core::DataEngine
Data d_output; ///< output sum
};
-#if !defined(SOFA_COMPONENT_ENGINE_SumEngine_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_SumEngine_CPP)
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API SumEngine;
extern template class SOFA_COMPONENT_ENGINE_ANALYZE_API SumEngine;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeEdgesAndGenerateQuads.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeEdgesAndGenerateQuads.h
index 29648e4ba93c..3ccd29db3726 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeEdgesAndGenerateQuads.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeEdgesAndGenerateQuads.h
@@ -76,7 +76,7 @@ class ExtrudeEdgesAndGenerateQuads : public core::DataEngine
void checkInput();
};
-#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDEEDGESANDGENERATEQUADS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDEEDGESANDGENERATEQUADS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API ExtrudeEdgesAndGenerateQuads;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeQuadsAndGenerateHexas.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeQuadsAndGenerateHexas.h
index 6fa2ae248368..dc7742a8eb94 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeQuadsAndGenerateHexas.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeQuadsAndGenerateHexas.h
@@ -78,7 +78,7 @@ class ExtrudeQuadsAndGenerateHexas : public core::DataEngine
Data< type::vector > f_extrudedHexas; ///< List of hexahedra generated during the extrusion
};
-#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDEQUADSANDGENERATEHEXAS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDEQUADSANDGENERATEHEXAS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API ExtrudeQuadsAndGenerateHexas;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeSurface.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeSurface.h
index 2e6724833d26..787442e989ce 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeSurface.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/ExtrudeSurface.h
@@ -73,7 +73,7 @@ class ExtrudeSurface : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDESURFACE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_EXTRUDESURFACE_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API ExtrudeSurface;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateCylinder.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateCylinder.h
index c1963ac38017..02582c9d4130 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateCylinder.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateCylinder.h
@@ -84,7 +84,7 @@ class GenerateCylinder : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_GENERATECYLINDER_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_GENERATECYLINDER_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GenerateCylinder;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateGrid.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateGrid.h
index 5b5799809410..7c2e2cce47c8 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateGrid.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateGrid.h
@@ -81,7 +81,7 @@ class GenerateGrid : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_GENERATEGRID_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_GENERATEGRID_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GenerateGrid;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GenerateGrid;
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateRigidMass.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateRigidMass.h
index 50c0a33c3290..d0c8f7427f73 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateRigidMass.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateRigidMass.h
@@ -95,7 +95,7 @@ class GenerateRigidMass : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_GENERATERIGIDMASS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_GENERATERIGIDMASS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GenerateRigidMass;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateSphere.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateSphere.h
index d2b7cac8c1a8..aab693c3fb54 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateSphere.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GenerateSphere.h
@@ -93,7 +93,7 @@ class GenerateSphere : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_GENERATESPHERE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_GENERATESPHERE_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GenerateSphere;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GroupFilterYoungModulus.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GroupFilterYoungModulus.h
index fac712ea5049..0ba654b89d92 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GroupFilterYoungModulus.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/GroupFilterYoungModulus.h
@@ -65,7 +65,7 @@ class GroupFilterYoungModulus : public core::DataEngine
Data > p_groupMod; ///< list of young modulus for each group
};
-#if !defined(SOFA_COMPONENT_ENGINE_GROUPFILTERYOUNGMODULUS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_GROUPFILTERYOUNGMODULUS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API GroupFilterYoungModulus;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/JoinPoints.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/JoinPoints.h
index f89773cda54f..333b594aa221 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/JoinPoints.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/JoinPoints.h
@@ -71,7 +71,7 @@ class JoinPoints : public sofa::core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_JOINPOINTS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_JOINPOINTS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API JoinPoints;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeMeshes.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeMeshes.h
index 6131e27be5a4..6ff8d2abe421 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeMeshes.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeMeshes.h
@@ -152,7 +152,7 @@ class MergeMeshes : public core::DataEngine
}
};
-#if !defined(SOFA_COMPONENT_ENGINE_MERGEMESHES_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MERGEMESHES_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeMeshes;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeMeshes;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeMeshes;
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergePoints.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergePoints.h
index d50df8033539..ed690e72b86b 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergePoints.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergePoints.h
@@ -66,7 +66,7 @@ class MergePoints : public core::DataEngine
Data f_noUpdate; ///< do not update the output at eacth time step (false)
};
-#if !defined(SOFA_COMPONENT_ENGINE_MERGEPOINTS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MERGEPOINTS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergePoints;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergePoints;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergePoints;
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeSets.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeSets.h
index 98bdfbea56ea..c10e5a24d220 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeSets.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeSets.h
@@ -59,7 +59,7 @@ class MergeSets : public core::DataEngine
Data f_op; ///< name of operation to compute (union, intersection, difference, symmetric_difference)
};
-#if !defined(SOFA_COMPONENT_ENGINE_MERGESETS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MERGESETS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeSets;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeSets;
//extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeSets;
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeVectors.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeVectors.h
index d668e70c4292..b9a2272d6733 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeVectors.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MergeVectors.h
@@ -64,7 +64,7 @@ class MergeVectors : public core::DataEngine
Data f_output; ///< Output vector
};
-#if !defined(SOFA_COMPONENT_ENGINE_MERGEVECTORS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MERGEVECTORS_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeVectors< type::vector >;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeVectors< type::vector >;
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MergeVectors< type::vector >;
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshBarycentricMapperEngine.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshBarycentricMapperEngine.h
index be09a3c7276d..508294e1f716 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshBarycentricMapperEngine.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshBarycentricMapperEngine.h
@@ -88,7 +88,7 @@ class MeshBarycentricMapperEngine : public core::DataEngine
-#if !defined(SOFA_COMPONENT_ENGINE_MESHBARYCENTRICMAPPERENGINE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MESHBARYCENTRICMAPPERENGINE_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MeshBarycentricMapperEngine;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshClosingEngine.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshClosingEngine.h
index 02898f8d78bb..c0534374b2bc 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshClosingEngine.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/MeshClosingEngine.h
@@ -106,7 +106,7 @@ class MeshClosingEngine : public core::DataEngine
void doUpdate() override;
};
-#if !defined(SOFA_COMPONENT_ENGINE_MeshClosingEngine_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MeshClosingEngine_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API MeshClosingEngine;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormEngine.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormEngine.h
index 1036235e268a..edb1923d4b7a 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormEngine.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormEngine.h
@@ -59,7 +59,7 @@ class NormEngine : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_NORMENGINE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_NORMENGINE_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API NormEngine;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormalsFromPoints.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormalsFromPoints.h
index 5c722d44ac37..e8218266fac2 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormalsFromPoints.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/NormalsFromPoints.h
@@ -64,7 +64,7 @@ class NormalsFromPoints : public core::DataEngine
Data useAngles; ///< Use incident angles to weight faces normal contributions at each vertex
};
-#if !defined(SOFA_COMPONENT_ENGINE_NormalsFromPoints_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_NormalsFromPoints_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API NormalsFromPoints;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/RandomPointDistributionInSurface.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/RandomPointDistributionInSurface.h
index 85a78958a6ac..5bf1b0c5d36d 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/RandomPointDistributionInSurface.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/RandomPointDistributionInSurface.h
@@ -90,7 +90,7 @@ class RandomPointDistributionInSurface : public core::DataEngine
bool testDistance(Coord p);
};
-#if !defined(SOFA_COMPONENT_ENGINE_RANDOMPOINTDISTRIBUTIONINSURFACE_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_RANDOMPOINTDISTRIBUTIONINSURFACE_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API RandomPointDistributionInSurface;
#endif
diff --git a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/Spiral.h b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/Spiral.h
index f66cdfc75e39..ed3938f45298 100644
--- a/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/Spiral.h
+++ b/Sofa/Component/Engine/Generate/src/sofa/component/engine/generate/Spiral.h
@@ -65,7 +65,7 @@ class Spiral : public core::DataEngine
Data curvature; ///< Spiral curvature factor
};
-#if !defined(SOFA_COMPONENT_ENGINE_SPIRAL_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_SPIRAL_CPP)
extern template class SOFA_COMPONENT_ENGINE_GENERATE_API Spiral;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h
index e2eb1f64fb55..14417281c453 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/BoxROI.h
@@ -188,7 +188,7 @@ class BoxROI : public DataEngine
void getPointsFromOrientedBox(const Vec10& box, vector &points);
};
-#if !defined(SOFA_COMPONENT_ENGINE_BOXROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_BOXROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API BoxROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API BoxROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API BoxROI;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ComplementaryROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ComplementaryROI.h
index b8da48cc6506..a5abd2c42149 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ComplementaryROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ComplementaryROI.h
@@ -82,7 +82,7 @@ class ComplementaryROI : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_COMPLEMENTARYROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_COMPLEMENTARYROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ComplementaryROI;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/IndicesFromValues.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/IndicesFromValues.h
index 87579b2d3e74..28ea9777b486 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/IndicesFromValues.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/IndicesFromValues.h
@@ -66,7 +66,7 @@ class IndicesFromValues : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_INDICESFROMVALUES_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_INDICESFROMVALUES_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API IndicesFromValues;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API IndicesFromValues;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API IndicesFromValues;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshROI.h
index 294c1703c815..1bd346094c56 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshROI.h
@@ -149,11 +149,10 @@ class MeshROI : public core::DataEngine
Data d_doUpdate; ///< Update the computation (not only at the init)
};
-#if !defined(SOFA_COMPONENT_ENGINE_MESHROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MESHROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshROI;
-extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshROI; //Phuoc
-
+extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshROI;
#endif
} //namespace sofa::component::engine::select
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSampler.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSampler.h
index 35917d784710..a72b85377866 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSampler.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSampler.h
@@ -92,7 +92,7 @@ class MeshSampler : public core::DataEngine
void computeNeighbors(VVI& ngb);
};
-#if !defined(SOFA_COMPONENT_ENGINE_MESHSAMPLER_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MESHSAMPLER_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshSampler;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSplittingEngine.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSplittingEngine.h
index 3f70cdaaff82..fec8403c7460 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSplittingEngine.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSplittingEngine.h
@@ -143,7 +143,7 @@ class MeshSplittingEngine : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_MeshSplittingEngine_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MeshSplittingEngine_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshSplittingEngine;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSubsetEngine.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSubsetEngine.h
index 286259e20738..ffc25b1c806b 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSubsetEngine.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/MeshSubsetEngine.h
@@ -81,7 +81,7 @@ class MeshSubsetEngine : public core::DataEngine
void doUpdate() override;
};
-#if !defined(SOFA_COMPONENT_ENGINE_MeshSubsetEngine_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_MeshSubsetEngine_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API MeshSubsetEngine;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/NearestPointROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/NearestPointROI.h
index 8a910ffc48d0..c3bfc53f8fbb 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/NearestPointROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/NearestPointROI.h
@@ -88,7 +88,7 @@ class NearestPointROI : public sofa::core::DataEngine, public core::behavior::Pa
};
-#if !defined(SOFA_COMPONENT_ENGINE_NearestPointROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_NearestPointROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API NearestPointROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API NearestPointROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API NearestPointROI;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h
index f2fa453a3fee..496a4b70b948 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PairBoxRoi.h
@@ -114,7 +114,7 @@ class PairBoxROI : public core::DataEngine
Data _drawSize; ///< Draw Size
};
-#if !defined(SOFA_COMPONENT_ENGINE_PAIRBOXROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_PAIRBOXROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PairBoxROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PairBoxROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PairBoxROI; //Phuoc
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h
index 623bfeb2043d..e379506ebf2f 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PlaneROI.h
@@ -135,7 +135,7 @@ class PlaneROI : public core::DataEngine
Real width, length, depth;
};
-#if !defined(SOFA_COMPONENT_ENGINE_PLANEROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_PLANEROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PlaneROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PlaneROI;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PointsFromIndices.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PointsFromIndices.h
index 8f4a7bfe4649..7e39f513899c 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PointsFromIndices.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/PointsFromIndices.h
@@ -65,7 +65,7 @@ class PointsFromIndices : public core::DataEngine
bool contains(VecCoord& v, Coord c);
};
-#if !defined(SOFA_COMPONENT_ENGINE_POINTSFROMINDICES_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_POINTSFROMINDICES_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API PointsFromIndices;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h
index 138de78778cd..cbfba0f9b471 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ProximityROI.h
@@ -106,7 +106,7 @@ class ProximityROI : public core::DataEngine
Data _drawSize; ///< rendering size for box and topological elements
};
-#if !defined(SOFA_COMPONENT_ENGINE_PROXIMITYROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_PROXIMITYROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ProximityROI;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SphereROI.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SphereROI.h
index 2ec8977cee7c..ca9a76091e0b 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SphereROI.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SphereROI.h
@@ -157,7 +157,7 @@ template<> bool SphereROI::isTetrahedronInSphere(const
template<> void SphereROI::doUpdate();
-#if !defined(SOFA_COMPONENT_ENGINE_SPHEREROI_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_SPHEREROI_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API SphereROI;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API SphereROI;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h
index b1dadc3f61ee..e6cfb51c47d1 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/SubsetTopology.h
@@ -171,7 +171,7 @@ class SubsetTopology : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_SUBSETTOPOLOGY_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_SUBSETTOPOLOGY_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API SubsetTopology;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API SubsetTopology;
#endif
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromIndices.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromIndices.h
index f6f265c0d03c..4c17af008a03 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromIndices.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromIndices.h
@@ -65,7 +65,7 @@ class ValuesFromIndices : public core::DataEngine
Data f_outStr; ///< Output values corresponding to the indices, converted as a string
};
-#if !defined(SOFA_COMPONENT_ENGINE_VALUESFROMINDICES_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_VALUESFROMINDICES_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ValuesFromIndices;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ValuesFromIndices;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ValuesFromIndices;
diff --git a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h
index 95e28bd09d81..0c96979d6a24 100644
--- a/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h
+++ b/Sofa/Component/Engine/Select/src/sofa/component/engine/select/ValuesFromPositions.h
@@ -139,7 +139,7 @@ class ValuesFromPositions : public core::DataEngine
Data p_vectorLength; ///< vector length visualisation.
};
-#if !defined(SOFA_COMPONENT_ENGINE_VALUESFROMPOSITIONS_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_VALUESFROMPOSITIONS_CPP)
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ValuesFromPositions;
extern template class SOFA_COMPONENT_ENGINE_SELECT_API ValuesFromPositions;
#endif
diff --git a/Sofa/Component/Engine/Transform/src/sofa/component/engine/transform/DifferenceEngine.h b/Sofa/Component/Engine/Transform/src/sofa/component/engine/transform/DifferenceEngine.h
index f60c6699eec0..3e6f3cd65eaa 100644
--- a/Sofa/Component/Engine/Transform/src/sofa/component/engine/transform/DifferenceEngine.h
+++ b/Sofa/Component/Engine/Transform/src/sofa/component/engine/transform/DifferenceEngine.h
@@ -59,7 +59,7 @@ class DifferenceEngine : public core::DataEngine
};
-#if !defined(SOFA_COMPONENT_ENGINE_DifferenceEngine_CPP)
+#if !defined(SOFA_COMPONENT_ENGINE_DifferenceEngine_CPP)
extern template class SOFA_COMPONENT_ENGINE_TRANSFORM_API DifferenceEngine