Skip to content

Commit

Permalink
Merge branch 'master' into inf_fix_meshtopology_init
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod authored Sep 5, 2024
2 parents 5c12eec + 0830f4c commit f902137
Show file tree
Hide file tree
Showing 1,930 changed files with 22,105 additions and 66,274 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/post-agenda-sofa-dev-meeting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Post - SOFA dev meeting agenda/reminder

on:
schedule:
- cron: '30 8 * * 1' # 9:30 am CET every Monday
- cron: '30 7 * * 3' # 8:00 am CET on Wednesdays
- cron: '30 8 * * 1' # 9:30 am UTC+1 every Monday
- cron: '30 7 * * 3' # 8:30 am UTC+1 on Wednesdays
- cron: '30 6 * * 3' # 7:30 am UTC+1 on Wednesdays (for summer times)

env:
TZ: "Europe/Paris"
Expand All @@ -24,7 +25,7 @@ jobs:
pip install requests
working-directory: ${{ github.workspace }}

# Monday message : agenda
# Monday message : request agenda info
- name: Run script post-discord-message.py
if: github.event.schedule == '30 8 * * 1'
run: |
Expand All @@ -38,9 +39,27 @@ jobs:
EMBEDS_URL: "https://github.com/sofa-framework/sofa/labels/pr%3A%20dev%20meeting%20topic"
EMBEDS_DESCRIPTION: ""

# Wednesday message : get ready
# Wednesday message : announce meeting and share link
- name: Check time depending on winter/summer times
if: ${{ (github.event.schedule == '30 7 * * 3') || (github.event.schedule == '30 6 * * 3') }}
id: check_time
run: |
# Set the timezone to CET
sudo ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
sudo dpkg-reconfigure -f noninteractive tzdata
# Get the current hour in CET
current_hour=$(date +'%H')
# Check if the current hour is 8 and set output
if [ "$current_hour" -eq 8 ]; then
echo "::set-output name=itstime::true"
else
echo "::set-output name=itstime::false"
fi
- name: Run script post-discord-message.py
if: github.event.schedule == '30 7 * * 3'
if: steps.check_time.outputs.itstime == 'true'
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
Expand Down
218 changes: 217 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

76 changes: 37 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 3.22)
project(Sofa) # Cannot use VERSION with patch like "00"
project(Sofa
HOMEPAGE_URL https://www.sofa-framework.org/
) # Cannot use VERSION with patch like "00"

include(CMakeDependentOption)

# Manually define VERSION
set(Sofa_VERSION_MAJOR 24)
set(Sofa_VERSION_MINOR 06)
set(Sofa_VERSION_MINOR 12)
set(Sofa_VERSION_PATCH 99)
set(Sofa_VERSION ${Sofa_VERSION_MAJOR}.${Sofa_VERSION_MINOR}.${Sofa_VERSION_PATCH})

set(SOFA_URL "${CMAKE_PROJECT_HOMEPAGE_URL}")

set(SOFA_VERSION_STR "\"${Sofa_VERSION}\"")
set(SOFA_VERSION "${Sofa_VERSION_MAJOR}${Sofa_VERSION_MINOR}${Sofa_VERSION_PATCH}")

Expand Down Expand Up @@ -44,16 +48,13 @@ option(SOFA_ALLOW_FETCH_DEPENDENCIES "Allow compatible dependencies to be fetche
# and https://cmake.org/cmake/help/v3.16/prop_tgt/DISABLE_PRECOMPILE_HEADERS.html

# https://cmake.org/cmake/help/latest/policy/CMP0127.html
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.22)
cmake_policy(SET CMP0127 NEW)
endif()
cmake_dependent_option(SOFA_BUILD_WITH_PCH_ENABLED
"Compile SOFA using precompiled header (to accelerate the build process)" OFF
"CMAKE_VERSION VERSION_GREATER_EQUAL 3.16" OFF)
cmake_policy(SET CMP0127 NEW)

option(SOFA_BUILD_WITH_PCH_ENABLED "Compile SOFA using precompiled header (to accelerate the build process)" OFF)
if(SOFA_BUILD_WITH_PCH_ENABLED)
message("-- Precompiled headers: enabled (SOFA_BUILD_WITH_PCH_ENABLED is ON).")
else()
message("-- Precompiled headers: disabled (SOFA_BUILD_WITH_PCH_ENABLED is OFF or CMake < 3.16).")
message("-- Precompiled headers: disabled (SOFA_BUILD_WITH_PCH_ENABLED is OFF).")
set(DISABLE_PRECOMPILE_HEADERS ON)
endif()

Expand Down Expand Up @@ -124,22 +125,26 @@ if(UNIX)
endif()
endif(UNIX)


### Windows config
if(MSVC)
option(SOFA_USE_DEPENDENCY_PACK "Enable the use of the Windows Dependency Pack" ON)
# WinDepPack
set(SOFA_DEPENDENCY_PACK_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Directory containing Windows Dependency Pack")
if(NOT EXISTS ${SOFA_DEPENDENCY_PACK_DIR})
# force back to default value
set(SOFA_DEPENDENCY_PACK_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Directory containing Windows Dependency Pack" FORCE)
endif()
list(APPEND CMAKE_INCLUDE_PATH ${SOFA_DEPENDENCY_PACK_DIR}/include)
if(CMAKE_CL_64)
list(APPEND CMAKE_LIBRARY_PATH ${SOFA_DEPENDENCY_PACK_DIR}/lib/win64)
else()
list(APPEND CMAKE_LIBRARY_PATH ${SOFA_DEPENDENCY_PACK_DIR}/lib/win32)
endif()
install(DIRECTORY ${SOFA_DEPENDENCY_PACK_DIR}/include/ DESTINATION include/extlibs/WinDepPack COMPONENT headers)
install(DIRECTORY ${SOFA_DEPENDENCY_PACK_DIR}/licenses/ DESTINATION licenses COMPONENT applications)
if(SOFA_USE_DEPENDENCY_PACK)
set(SOFA_DEPENDENCY_PACK_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Directory containing Windows Dependency Pack")
if(NOT EXISTS ${SOFA_DEPENDENCY_PACK_DIR})
# force back to default value
set(SOFA_DEPENDENCY_PACK_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Directory containing Windows Dependency Pack" FORCE)
endif()
list(APPEND CMAKE_INCLUDE_PATH ${SOFA_DEPENDENCY_PACK_DIR}/include)
if(CMAKE_CL_64)
list(APPEND CMAKE_LIBRARY_PATH ${SOFA_DEPENDENCY_PACK_DIR}/lib/win64)
else()
list(APPEND CMAKE_LIBRARY_PATH ${SOFA_DEPENDENCY_PACK_DIR}/lib/win32)
endif()
install(DIRECTORY ${SOFA_DEPENDENCY_PACK_DIR}/include/ DESTINATION include/extlibs/WinDepPack COMPONENT headers)
install(DIRECTORY ${SOFA_DEPENDENCY_PACK_DIR}/licenses/ DESTINATION licenses COMPONENT applications)
endif ()
endif()

### Testing
Expand All @@ -163,29 +168,25 @@ endif()
### Ninja build pools
option(SOFA_NINJA_BUILD_POOLS "Activate the Ninja build pools feature, to limit the cores used by specific targets" OFF)

### Warn the user that the legacy option has been deleted and is useless now
if(DEFINED SOFA_ENABLE_LEGACY_HEADERS)
message(WARNING "SOFA_ENABLE_LEGACY_HEADERS cmake option has been deleted in v24.12 and is now meaningless.")
endif()
### Warn the user that HeadlessRecorder option has been renamed (due to its move into applications/plguins)
if(DEFINED PLUGIN_SOFA_GUI_HEADLESSRECORDER AND PLUGIN_SOFA_GUI_HEADLESSRECORDER)
message(WARNING "HeadlessRecorder has been moved to applications/plugins in v24.12, thus its cmake option is named PLUGIN_HEADLESSRECORDER now.")
endif()


# Sofa.Config sets the environment (options, compiler flags, global variables)
sofa_add_subdirectory(library Sofa/framework/Config Sofa.Config ON)

### Extlibs
add_subdirectory(extlibs)

### Compatibility
option(SOFA_ENABLE_LEGACY_HEADERS "Enable the compatibility layer (headers located in legacy folders) and deprecated cmake modules." ON)
if(SOFA_ENABLE_LEGACY_HEADERS)
message("Using legacy headers is enabled.")
endif()
sofa_add_subdirectory(library Sofa/framework/Compat Sofa.Compat ON WHEN_TO_SHOW "SOFA_ENABLE_LEGACY_HEADERS" VALUE_IF_HIDDEN OFF)

### SOFA (framework and components)
add_subdirectory(Sofa)

### Compatibility
# Deprecated (hollow) framework and component modules.
# All depend on SOFA_ENABLE_LEGACY_HEADERS
# Some still contain (maybe useful) components not moved in Sofa/ yet.
# TODO: finally empty those remnants
add_subdirectory(applications/collections/deprecated)

## Tutorials option
option(SOFA_BUILD_TUTORIALS "Build (most of) the tutorials available." OFF)

Expand Down Expand Up @@ -290,9 +291,6 @@ if(SOFA_BUILD_RELEASE_PACKAGE)
################
# Package config
include(CPackComponent)
if(WIN32 AND ${CMAKE_VERSION} VERSION_LESS "3.13.0")
include(CPackNSIS)
endif()
include(CPackIFW)
set(CPACK_PACKAGE_VERSION "${Sofa_VERSION}")
set(CPACK_PACKAGE_NAME "SOFA v${CPACK_PACKAGE_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1,
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
Expand Down
1 change: 0 additions & 1 deletion Sofa/Component/AnimationLoop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR "src/sofa/component/animationloop")
set(HEADER_FILES
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/config.h.in
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/FreeMotionAnimationLoop.h
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/FreeMotionTask.h
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/ConstraintAnimationLoop.h
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiStepAnimationLoop.h
${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiTagAnimationLoop.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ using sofa::simulation::mechanicalvisitor::MechanicalEndIntegrationVisitor;
#include <sofa/simulation/mechanicalvisitor/MechanicalResetConstraintVisitor.h>
using sofa::simulation::mechanicalvisitor::MechanicalResetConstraintVisitor;

#include <sofa/component/constraint/lagrangian/solver/visitors/MechanicalGetConstraintResolutionVisitor.h>
#include <sofa/simulation/mechanicalvisitor/MechanicalBuildConstraintMatrix.h>
#include <sofa/simulation/mechanicalvisitor/MechanicalAccumulateMatrixDeriv.h>

/// Change that to true if you want to print extra message on this component.
/// You can eventually link that to an object attribute.
Expand All @@ -87,70 +90,6 @@ using namespace helper::system::thread;
using namespace core::behavior;
using namespace sofa::simulation;

sofa::simulation::Visitor::Result MechanicalGetConstraintResolutionVisitor::fwdConstraintSet(simulation::Node* node, core::behavior::BaseConstraintSet* cSet)
{
if (core::behavior::BaseConstraint *c=cSet->toBaseConstraint())
{
const ctime_t t0 = begin(node, c);
c->getConstraintResolution(_cparams, _res, _offset);
end(node, c, t0);
}
return RESULT_CONTINUE;
}

bool MechanicalGetConstraintResolutionVisitor::stopAtMechanicalMapping(simulation::Node* /*node*/, core::BaseMapping* /*map*/)
{
return false; // !map->isMechanical();
}

sofa::simulation::Visitor::Result MechanicalSetConstraint::fwdConstraintSet(simulation::Node* node, core::behavior::BaseConstraintSet* c)
{
const ctime_t t0 = begin(node, c);

c->setConstraintId(contactId);
c->buildConstraintMatrix(cparams, res, contactId);

end(node, c, t0);
return RESULT_CONTINUE;
}

const char* MechanicalSetConstraint::getClassName() const
{
return "MechanicalSetConstraint";
}

bool MechanicalSetConstraint::isThreadSafe() const
{
return false;
}

bool MechanicalSetConstraint::stopAtMechanicalMapping(simulation::Node* /*node*/, core::BaseMapping* /*map*/)
{
return false; // !map->isMechanical();
}

void MechanicalAccumulateConstraint2::bwdMechanicalMapping(simulation::Node* node, core::BaseMapping* map)
{
const ctime_t t0 = begin(node, map);
map->applyJT(cparams, res, res);
end(node, map, t0);
}

const char* MechanicalAccumulateConstraint2::getClassName() const
{
return "MechanicalAccumulateConstraint2";
}

bool MechanicalAccumulateConstraint2::isThreadSafe() const
{
return false;
}

bool MechanicalAccumulateConstraint2::stopAtMechanicalMapping(simulation::Node* /*node*/, core::BaseMapping* /*map*/)
{
return false; // !map->isMechanical();
}

ConstraintProblem::ConstraintProblem(bool printLog)
{
SOFA_UNUSED(printLog);
Expand Down Expand Up @@ -279,7 +218,7 @@ ConstraintAnimationLoop::ConstraintAnimationLoop() :
, d_tol( initData(&d_tol, 0.00001_sreal, "tolerance", "Tolerance of the Gauss-Seidel"))
, d_maxIt( initData(&d_maxIt, 1000, "maxIterations", "Maximum number of iterations of the Gauss-Seidel"))
, d_doCollisionsFirst(initData(&d_doCollisionsFirst, false, "doCollisionsFirst","Compute the collisions first (to support penality-based contacts)"))
, d_doubleBuffer( initData(&d_doubleBuffer, false, "doubleBuffer","Buffer the constraint problem in a doublebuffer to be accessible with an other thread"))
, d_doubleBuffer( initData(&d_doubleBuffer, false, "doubleBuffer","Double the buffer dedicated to the constraint problem to make it accessible to another thread"))
, d_scaleTolerance( initData(&d_scaleTolerance, true, "scaleTolerance","Scale the error tolerance with the number of constraints"))
, d_allVerified( initData(&d_allVerified, false, "allVerified","All contraints must be verified (each constraint's error < tolerance)"))
, d_sor( initData(&d_sor, 1.0_sreal, "sor","Successive Over Relaxation parameter (0-2)"))
Expand Down Expand Up @@ -1019,9 +958,10 @@ ConstraintProblem* ConstraintAnimationLoop::getCP()
return &CP1;
}


int ConstraintAnimationLoopClass = core::RegisterObject ( "Constraint animation loop manager" )
.add< ConstraintAnimationLoop >()
.addAlias("MasterConstraintSolver");
void registerConstraintAnimationLoop(sofa::core::ObjectFactory* factory)
{
factory->registerObjects(core::ObjectRegistrationData("Constraint animation loop manager")
.add< ConstraintAnimationLoop >());
}

} //namespace sofa::component::animationloop
Loading

0 comments on commit f902137

Please sign in to comment.