Skip to content

Commit

Permalink
Merge branch 'master' into fix_TriangleSetTopologyContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod authored Dec 11, 2023
2 parents fef1c84 + 9c9e377 commit 390f842
Show file tree
Hide file tree
Showing 485 changed files with 8,510 additions and 6,331 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:<br>@' + context.repo.owner + ' your PR does not include any **descriptive** label :label:<br> Make sure to add an appropriate [PR label](https://github.com/sofa-framework/sofa/labels) before merge.<br>:warning: :warning: :warning:';
const comment = ':warning: :warning: :warning:<br>@' + context.payload.pull_request.user.login + ' your PR does not include any **descriptive** label :label:<br> Make sure to add an appropriate [PR label](https://github.com/sofa-framework/sofa/labels) before merge.<br>:warning: :warning: :warning:';
github.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
// Add comment in the PR to warn the author
if (!valid) {
const comment = ':warning: :warning: :warning:<br>@'+context.repo.owner+' your PR title is not following the required format :pencil2:<br>'+commentExplain+':warning: :warning: :warning:';
const comment = ':warning: :warning: :warning:<br>@' + context.payload.pull_request.user.login + ' your PR title is not following the required format :pencil2:<br>'+commentExplain+':warning: :warning: :warning:';
github.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/stale_github_discussions.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void ConstraintAnimationLoop::launchCollisionDetection(const core::ExecParams* p

////////////////// COLLISION DETECTION///////////////////////////////////////////////////////////////////////////////////////////
{
helper::ScopedAdvancedTimer timer("Collision");
SCOPED_TIMER("Collision");
computeCollision(params);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -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);

Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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());
Expand All @@ -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())
{
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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() ;

Expand Down Expand Up @@ -739,7 +739,7 @@ void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt )
}

{
helper::ScopedAdvancedTimer updateMappingTimer("UpdateMapping");
SCOPED_TIMER_VARNAME(updateMappingTimer, "UpdateMapping");

node->execute<UpdateMappingVisitor>(params);
sofa::helper::AdvancedTimer::step("UpdateMappingEndEvent");
Expand All @@ -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<UpdateBoundingBoxVisitor>(params);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand All @@ -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 );
Expand All @@ -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);
}
Expand All @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -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
Expand All @@ -283,14 +283,14 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d
node->execute<UpdateSimulationContextVisitor>(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<UpdateMappingVisitor>(params);
{
Expand All @@ -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<UpdateBoundingBoxVisitor>(params);
}

Expand All @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -383,18 +383,18 @@ void FreeMotionAnimationLoop::computeFreeMotion(const sofa::core::ExecParams* pa
auto node = dynamic_cast<sofa::simulation::Node*>(this->l_node.get());

{
sofa::helper::ScopedAdvancedTimer timer("FreeMotion");
SCOPED_TIMER("FreeMotion");
simulation::SolveVisitor freeMotion(params, dt, true, d_parallelODESolving.getValue());
node->execute(&freeMotion);
}

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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<UpdateMappingVisitor>(params);
}
{
Expand All @@ -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<UpdateBoundingBoxVisitor>(params);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void MultiTagAnimationLoop::step(const sofa::core::ExecParams* params, SReal dt)
{
auto node = dynamic_cast<sofa::simulation::Node*>(this->l_node.get());

helper::ScopedAdvancedTimer animationStepTimer("AnimationStep");
SCOPED_TIMER_VARNAME(animationStepTimer, "AnimationStep");

#ifdef SOFA_DUMP_VISITOR_INFO
simulation::Visitor::printNode("Step");
Expand Down Expand Up @@ -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<UpdateMappingVisitor>(params);
}
{
Expand All @@ -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<UpdateBoundingBoxVisitor>(params);
}

Expand Down
Loading

0 comments on commit 390f842

Please sign in to comment.