Skip to content

Commit

Permalink
Merge pull request #147 from mimesis-inria/fix_23_06
Browse files Browse the repository at this point in the history
Compatibility with SOFA 23.06
  • Loading branch information
jnbrunet authored May 12, 2023
2 parents f96129b + fbeeba9 commit 2aa665c
Show file tree
Hide file tree
Showing 68 changed files with 286 additions and 424 deletions.
33 changes: 3 additions & 30 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ on:
jobs:
build:
name: Building with ${{ matrix.sofa_version }}
runs-on: macos-10.15
runs-on: macos-12
if: ${{ false }}
strategy:
fail-fast: false
matrix:
sofa_version: [ v20.06.01, v20.12.03, v21.06.03, v21.12.00, master ]
sofa_version: [ master ]
include:
- sofa_version: master
SOFA_VERSION_I: 999999
Expand All @@ -24,34 +25,6 @@ jobs:
BOOST_VERSION: 1.76.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
QT_VERSION: 5.12.6
- sofa_version: v21.12.00
SOFA_VERSION_I: 211200
PYTHON_VERSION: 3.9
PYBIND11_VERSION: 2.6
BOOST_VERSION: 1.76.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
QT_VERSION: 5.12.6
- sofa_version: v21.06.03
SOFA_VERSION_I: 210603
PYTHON_VERSION: 3.9
PYBIND11_VERSION: 2.6
BOOST_VERSION: 1.76.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
QT_VERSION: 5.12.6
- sofa_version: v20.12.03
SOFA_VERSION_I: 201203
PYTHON_VERSION: 3.7
PYBIND11_VERSION: 2.6
BOOST_VERSION: 1.67.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.67.0/source/boost_1_67_0.tar.gz
QT_VERSION: 5.12.6
- sofa_version: v20.06.01
SOFA_VERSION_I: 200601
PYTHON_VERSION: 2.7
PYBIND11_VERSION: 2.6
BOOST_VERSION: 1.67.0
BOOST_LINK: https://boostorg.jfrog.io/artifactory/main/release/1.67.0/source/boost_1_67_0.tar.gz
QT_VERSION: 5.11.1
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: /opt/sofa
Expand Down
38 changes: 3 additions & 35 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,13 @@ jobs:
strategy:
fail-fast: false
matrix:
sofa_version: [ v20.06.01, v20.12.03, v21.06.03, v21.12.00, master ]
sofa_version: [ master ]
include:
- sofa_version: master
SOFA_VERSION_I: 999999
CONTAINER: jnbrunet/caribou-ubuntu-2004-builder:latest
PYTHON_VERSION: 3.8
PYBIND11_VERSION: 2.6
- sofa_version: v21.12.00
SOFA_VERSION_I: 211200
CONTAINER: jnbrunet/caribou-ubuntu-2004-builder:latest
PYTHON_VERSION: 3.8
PYBIND11_VERSION: 2.4
- sofa_version: v21.06.03
SOFA_VERSION_I: 210603
CONTAINER: jnbrunet/caribou-ubuntu-1804-builder:latest
PYTHON_VERSION: 3.7
PYBIND11_VERSION: 2.4
- sofa_version: v20.12.03
SOFA_VERSION_I: 201203
CONTAINER: jnbrunet/caribou-ubuntu-1804-builder:latest
PYTHON_VERSION: 3.7
PYBIND11_VERSION: 2.4
- sofa_version: v20.06.01
SOFA_VERSION_I: 200601
CONTAINER: jnbrunet/caribou-ubuntu-1804-builder:latest
PYTHON_VERSION: 3.7
PYBIND11_VERSION: 2.4
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: /opt/sofa
Expand Down Expand Up @@ -136,23 +116,11 @@ jobs:
strategy:
fail-fast: false
matrix:
sofa_version: [ v20.06.01, v20.12.03, v21.06.03, v21.12.00, master ]
sofa_version: [ master ]
include:
- sofa_version: master
PYTHON_VERSION: 3.8
sofa_version_int: 211200
- sofa_version: v21.12.00
PYTHON_VERSION: 3.8
sofa_version_int: 211200
- sofa_version: v21.06.03
PYTHON_VERSION: 3.7
sofa_version_int: 210603
- sofa_version: v20.12.03
PYTHON_VERSION: 3.7
sofa_version_int: 201203
- sofa_version: v20.06.01
PYTHON_VERSION: 3.7
sofa_version_int: 200601
env:
SOFA_VERSION: ${{ matrix.sofa_version }}
SOFA_ROOT: /opt/sofa
Expand Down Expand Up @@ -249,7 +217,7 @@ jobs:
if: github.event_name == 'schedule'
strategy:
matrix:
sofa_version: [ v20.06.01, v20.12.03, v21.06.03, v21.12.00, master ]
sofa_version: [ master ]
env:
SOFA_VERSION: ${{ matrix.sofa_version }}

Expand Down
21 changes: 13 additions & 8 deletions scenes/CG_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@


def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', name='SofaSparseSolver')

root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.LinearSolver.Iterative', # CGLinearSolver
'Sofa.Component.ODESolver.Backward', # StaticSolver
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual' # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[3, 3, 7])

# Caribou ODE solver - Caribou CG solver - No preconditioner
i = 0
tx = 20*i
Expand Down
16 changes: 12 additions & 4 deletions scenes/HexahedronLinearElasticForce.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@
l = youngModulus * poissonRatio / ((1.0 + poissonRatio) * (1.0 - 2.0 * poissonRatio))

def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.SolidMechanics.FEM.Elastic', # HexahedronFEMForceField
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')
root.addObject('DefaultAnimationLoop')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])

Expand Down
17 changes: 14 additions & 3 deletions scenes/HyperelasticForcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,22 @@


def createScene(root):
root.addObject('APIVersion', level='21.06')
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.SolidMechanics.FEM.Elastic', # HexahedronFEMForceField
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.SolidMechanics.FEM.HyperElastic', # TetrahedronHyperelasticityFEMForceField, QuadSetTopologyContainer
'Sofa.Component.Topology.Mapping', # Hexa2TetraTopologicalMapping
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')
root.addObject('DefaultAnimationLoop')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])

Expand Down
17 changes: 11 additions & 6 deletions scenes/LDLT_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@


def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', name='SofaSparseSolver')

root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
Expand Down
17 changes: 11 additions & 6 deletions scenes/LLT_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
youngModulus = 3000

def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', name='SofaSparseSolver')

root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
Expand Down
17 changes: 11 additions & 6 deletions scenes/LU_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
youngModulus = 3000

def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', name='SofaSparseSolver')

root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
Expand Down
17 changes: 13 additions & 4 deletions scenes/TetrahedronLinearElasticForce.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@
l = youngModulus * poissonRatio / ((1.0 + poissonRatio) * (1.0 - 2.0 * poissonRatio))

def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.SolidMechanics.FEM.Elastic', # TetrahedronFEMForceField
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Topology.Mapping', # Hexa2TetraTopologicalMapping
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
Expand Down
16 changes: 12 additions & 4 deletions scenes/TractionForcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@


def createScene(root):
root.addObject('APIVersion', level='21.06')

root.addObject('RequiredPlugin', name='SofaComponentAll')
root.addObject('RequiredPlugin', name='SofaOpenglVisual')
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetTopologyContainer, QuadSetTopologyContainer, TetrahedronSetTopologyContainer, TetrahedronSetTopologyModifier, TriangleSetTopologyContainer
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Topology.Mapping', # Hexa2TetraTopologicalMapping
'Sofa.Component.Visual', # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideMappings showForceFields')

root.addObject('RegularGridTopology', name='mesh', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[9, 9, 21])
Expand Down
12 changes: 10 additions & 2 deletions scenes/backward_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ def createScene(root):
root.dt = 1

root.addObject('RequiredPlugin', pluginName=[
'SofaSparseSolver', 'SofaTopologyMapping', 'SofaBoundaryCondition', 'SofaEngine', 'SofaImplicitOdeSolver'
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.Topology.Container.Dynamic', # HexahedronSetGeometryAlgorithms, HexahedronSetTopologyContainer
'Sofa.Component.Mass', # DiagonalMass
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual' # VisualStyle
])

root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showForceFields')

root.addObject('RegularGridTopology', name='grid', min=[-7.5, -7.5, 0], max=[7.5, 7.5, 80], n=[3, 3, 9])
Expand Down
14 changes: 11 additions & 3 deletions scenes/barycentric_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,20 @@


def createScene(root):
root.addObject('APIVersion', level='21.06')
root.addObject('RequiredPlugin', pluginName='SofaBoundaryCondition SofaEngine SofaOpenglVisual SofaGeneralVisual')

root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Visual' # Visual3DText, VisualStyle
# 'Sofa.GL.Component.Rendering3D' # OglModel
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels')

root.addObject('StaticODESolver', newton_iterations=10, residual_tolerance_threshold=1e-5, pattern_analysis_strategy="BEGINNING_OF_THE_TIME_STEP")
root.addObject('LDLTSolver', backend="Pardiso")
root.addObject('LDLTSolver', backend="Eigen") # Change to backend="Pardiso" if using Caribou with pardiso

for name, mesh, p, caribou_type, meshio_type in meshes:
n = root.addChild(name)
Expand Down
12 changes: 11 additions & 1 deletion scenes/caribou_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@

def createScene(root):
root.dt = 0.001
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Constraint.Projective', # FixedConstraint
'Sofa.Component.Engine.Select', # BoxROI
'Sofa.Component.ODESolver.Forward', # CentralDifferenceSolver
'Sofa.Component.StateContainer', # MechanicalObject
'Sofa.Component.Topology.Container.Grid', # RegularGridTopology
'Sofa.Component.Visual' # VisualStyle
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showForceFields')
root.addObject('RequiredPlugin', pluginName=['SofaBaseMechanics', 'SofaEngine', 'SofaTopologyMapping', 'SofaBoundaryCondition', 'SofaGeneralExplicitOdeSolver'])
root.addObject('RegularGridTopology', name='grid', min=[-length/2, -radius, -radius], max=[length/2, radius, radius], n=[nz, nx, nx])
root.addObject('DefaultAnimationLoop')

# Caribou lumped mass
root.addChild('caribou_lumped')
Expand Down
7 changes: 6 additions & 1 deletion scenes/fictitious_grid_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

def createScene(root):
root.bbox = " ".join([str(a) for a in [-radius, -radius, -1, radius, radius, 1]])
root.addObject('APIVersion', level='21.06')
root.addObject('RequiredPlugin', pluginName=[
'Sofa.Component.SceneUtility', # APIVersion
'Sofa.Component.Visual', # InteractiveCamera
])
root.addObject('APIVersion', level='23.06.99')
root.addObject('DefaultAnimationLoop')
root.addObject('InteractiveCamera', position=[0, 0, 1], lookAt=[0, 0, 0], projectionType=1, printLog=True)

root.addObject('CircleIsoSurface', radius=radius, center=[0, 0])
Expand Down
Loading

0 comments on commit 2aa665c

Please sign in to comment.