Skip to content

Commit 54162cd

Browse files
authored
Merge pull request #1 from alxbilger/update
Update according to SOFA changes
2 parents ede540c + 6459919 commit 54162cd

14 files changed

+91
-52
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
os: [ubuntu-20.04, macos-10.15, windows-2019]
16-
sofa_branch: [master, v21.12]
15+
os: [ubuntu-20.04, macos-11, windows-2019]
16+
sofa_branch: [master]
1717

1818
steps:
1919
- name: Setup SOFA and environment
2020
id: sofa
21-
uses: sofa-framework/sofa-setup-action@v3.0
21+
uses: sofa-framework/sofa-setup-action@v4
2222
with:
2323
sofa_root: ${{ github.workspace }}/sofa
2424
sofa_version: ${{ matrix.sofa_branch }}
@@ -93,7 +93,7 @@ jobs:
9393
with:
9494
name: ${{ github.ref_name }}
9595
tag_name: release-${{ github.ref_name }}
96-
fail_on_unmatched_files: true
96+
fail_on_unmatched_files: false
9797
files: |
9898
artifacts/ShapeMatchingPlugin_*_Linux.zip
9999
artifacts/ShapeMatchingPlugin_*_Windows.zip

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ project(ShapeMatchingPlugin LANGUAGES CXX)
33

44
set(SHAPEMATCHINGPLUGIN_SRC "src/${PROJECT_NAME}")
55

6+
find_package(Sofa.Core REQUIRED)
7+
68
set(HEADER_FILES
79
${SHAPEMATCHINGPLUGIN_SRC}/config.h.in
810
${SHAPEMATCHINGPLUGIN_SRC}/initShapeMatchingPlugin.h
@@ -18,10 +20,8 @@ set(SOURCE_FILES
1820
${SHAPEMATCHINGPLUGIN_SRC}/ShapeMatchingForceField.cpp
1921
)
2022

21-
find_package(SofaBaseLinearSolver REQUIRED)
22-
2323
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
24-
target_link_libraries(${PROJECT_NAME} PUBLIC SofaBaseLinearSolver)
24+
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Core)
2525

2626
sofa_create_package_with_targets(
2727
PACKAGE_NAME ${PROJECT_NAME}

ShapeMatchingPluginConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@PACKAGE_INIT@
44

5-
find_package(SofaBaseLinearSolver QUIET REQUIRED)
5+
find_package(Sofa.Core QUIET REQUIRED)
66

77
if(NOT TARGET @PROJECT_NAME@)
88
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")

examples/ConstraintRotationFinder.scn

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
<Node name="root" gravity="0.0 -2.0 0.0" dt="0.04">
2-
<RequiredPlugin name="SofaBoundaryCondition"/>
3-
<RequiredPlugin name="SofaConstraint"/>
4-
<RequiredPlugin name="SofaDeformable"/>
5-
<RequiredPlugin name="SofaEngine"/>
6-
<RequiredPlugin name="SofaGeneralDeformable"/>
7-
<RequiredPlugin name="SofaImplicitOdeSolver"/>
8-
<RequiredPlugin name="SofaLoader"/>
9-
<RequiredPlugin name="SofaMeshCollision"/>
10-
<RequiredPlugin name="SofaOpenglVisual"/>
11-
<RequiredPlugin name="ShapeMatchingPlugin"/>
122

13-
<FreeMotionAnimationLoop initial_guess="true" displayTime="1" />
14-
<DefaultPipeline verbose="0" draw="0" />
3+
<Node name="plugins">
4+
<RequiredPlugin name="ShapeMatchingPlugin"/> <!-- Needed to use components [ShapeMatchingRotationFinder] -->
5+
<RequiredPlugin name="Sofa.Component.AnimationLoop"/> <!-- Needed to use components [FreeMotionAnimationLoop] -->
6+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase,BruteForceBroadPhase,CollisionPipeline] -->
7+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [LocalMinDistance] -->
8+
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [LineCollisionModel,PointCollisionModel,TriangleCollisionModel] -->
9+
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
10+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Correction"/> <!-- Needed to use components [PrecomputedConstraintCorrection] -->
11+
<RequiredPlugin name="Sofa.Component.Constraint.Lagrangian.Solver"/> <!-- Needed to use components [LCPConstraintSolver] -->
12+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
13+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
14+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
15+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
16+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
17+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
18+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
19+
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [MeshSpringForceField,QuadBendingSprings] -->
20+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
21+
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
22+
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
23+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
24+
</Node>
25+
26+
<FreeMotionAnimationLoop />
27+
<CollisionPipeline verbose="0" draw="0" />
1528
<BruteForceBroadPhase />
1629
<BVHNarrowPhase />
1730
<LocalMinDistance name="Proximity" alarmDistance="0.50" contactDistance="0.25" />
18-
<DefaultContactManager name="Response" response="FrictionContact" />
31+
<CollisionResponse name="Response" response="FrictionContactConstraint"/>
1932
<LCPConstraintSolver maxIt="1000" tolerance="0.001" />
20-
<DefaultAnimationLoop />
2133
<DefaultVisualManagerLoop />
2234
<Node name="Floor">
2335
<RegularGridTopology nx="2" ny="1" nz="2" xmin="20" xmax="-20" ymin="-3.05" ymax="-3.05" zmin="-20" zmax="20" />

examples/RotationFinder.scn

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
<Node name="root" gravity="0.0 -2.0 0.0" dt="0.04">
2-
<RequiredPlugin name="SofaBoundaryCondition"/>
3-
<RequiredPlugin name="SofaDeformable"/>
4-
<RequiredPlugin name="SofaEngine"/>
5-
<RequiredPlugin name="SofaGeneralDeformable"/>
6-
<RequiredPlugin name="SofaImplicitOdeSolver"/>
7-
<RequiredPlugin name="SofaMeshCollision"/>
8-
<RequiredPlugin name="SofaOpenglVisual"/>
9-
<RequiredPlugin name="SofaLoader"/>
10-
<RequiredPlugin name="ShapeMatchingPlugin"/>
112

12-
<DefaultPipeline verbose="0" draw="0" />
3+
<Node name="plugins">
4+
<RequiredPlugin name="ShapeMatchingPlugin"/> <!-- Needed to use components [ShapeMatchingRotationFinder] -->
5+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase,BruteForceBroadPhase,CollisionPipeline] -->
6+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [NewProximityIntersection] -->
7+
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [TriangleCollisionModel] -->
8+
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
9+
<RequiredPlugin name="Sofa.Component.Constraint.Projective"/> <!-- Needed to use components [FixedConstraint] -->
10+
<RequiredPlugin name="Sofa.Component.Engine.Select"/> <!-- Needed to use components [BoxROI] -->
11+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
12+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
13+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
14+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
15+
<RequiredPlugin name="Sofa.Component.MechanicalLoad"/> <!-- Needed to use components [PlaneForceField,SphereForceField] -->
16+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
17+
<RequiredPlugin name="Sofa.Component.SolidMechanics.Spring"/> <!-- Needed to use components [MeshSpringForceField,QuadBendingSprings] -->
18+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
19+
<RequiredPlugin name="Sofa.Component.Topology.Container.Grid"/> <!-- Needed to use components [RegularGridTopology] -->
20+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
21+
</Node>
22+
23+
<CollisionPipeline verbose="0" draw="0" />
1324
<BruteForceBroadPhase />
1425
<BVHNarrowPhase />
15-
<DefaultContactManager name="Response" />
26+
<CollisionResponse name="Response" />
1627
<NewProximityIntersection alarmDistance="0.002" contactDistance="0.001" />
1728
<DefaultAnimationLoop />
1829
<DefaultVisualManagerLoop />

examples/ShapeMatchingForceField.scn

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
<Node name="root" dt="0.02">
2-
<RequiredPlugin name="SofaImplicitOdeSolver"/>
3-
<RequiredPlugin name="SofaLoader"/>
4-
<RequiredPlugin name="SofaOpenglVisual"/>
5-
<RequiredPlugin name="SofaMeshCollision"/>
6-
<RequiredPlugin name="ShapeMatchingPlugin"/>
2+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase,BruteForceBroadPhase,CollisionPipeline] -->
3+
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
4+
<RequiredPlugin name="Sofa.Component.Collision.Geometry"/> <!-- Needed to use components [LineCollisionModel,PointCollisionModel,SphereCollisionModel,TriangleCollisionModel] -->
5+
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
6+
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
7+
<RequiredPlugin name="Sofa.Component.LinearSolver.Iterative"/> <!-- Needed to use components [CGLinearSolver] -->
8+
<RequiredPlugin name="Sofa.Component.Mapping.Linear"/> <!-- Needed to use components [IdentityMapping] -->
9+
<RequiredPlugin name="Sofa.Component.Mass"/> <!-- Needed to use components [UniformMass] -->
10+
<RequiredPlugin name="Sofa.Component.ODESolver.Backward"/> <!-- Needed to use components [EulerImplicitSolver] -->
11+
<RequiredPlugin name="Sofa.Component.SceneUtility"/> <!-- Needed to use components [InfoComponent] -->
12+
<RequiredPlugin name="Sofa.Component.StateContainer"/> <!-- Needed to use components [MechanicalObject] -->
13+
<RequiredPlugin name="Sofa.Component.Topology.Container.Constant"/> <!-- Needed to use components [MeshTopology] -->
14+
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
15+
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
16+
<RequiredPlugin name="ShapeMatchingPlugin"/> <!-- Needed to use components [ShapeMatchingForceField,ShapeMatchingRotationFinder] -->
717

18+
<DefaultAnimationLoop/>
819
<VisualStyle displayFlags="showBehaviorModels showForceFields" />
9-
<DefaultPipeline verbose="0" draw="0" />
20+
<CollisionPipeline verbose="0" draw="0" />
1021
<BruteForceBroadPhase />
1122
<BVHNarrowPhase />
1223
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" />
13-
<DefaultContactManager name="Response" response="default" />
24+
<CollisionResponse name="Response" response="PenalityContactForceField" />
1425
<Node name="cubeFEM">
1526
<EulerImplicitSolver name="cg_odesolver" printLog="false" />
1627
<CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" />

src/ShapeMatchingPlugin/ShapeMatchingForceField.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ namespace sofa::component::forcefield
3131
using namespace sofa::defaulttype;
3232

3333
int ShapeMatchingForceFieldClass = core::RegisterObject("Meshless deformations based on shape matching")
34-
.add< ShapeMatchingForceField<Vec3dTypes> >()
34+
.add< ShapeMatchingForceField<Vec3Types> >()
3535
;
3636

37-
template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingForceField<Vec3dTypes>;
37+
template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingForceField<Vec3Types>;
3838

3939
} // namespace sofa::component::forcefield

src/ShapeMatchingPlugin/ShapeMatchingForceField.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ShapeMatchingForceField : public core::behavior::ForceField<DataTypes>
7171
};
7272

7373
#if !defined(SOFA_COMPONENT_FORCEFIELD_SHAPEMATCHINGFORCEFIELD_CPP)
74-
extern template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingForceField<defaulttype::Vec3dTypes>;
74+
extern template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingForceField<defaulttype::Vec3Types>;
7575
#endif // !defined(SOFA_COMPONENT_FORCEFIELD_SHAPEMATCHINGFORCEFIELD_CPP)
7676

7777
} // namespace sofa::component::forcefield

src/ShapeMatchingPlugin/ShapeMatchingForceField.inl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <sofa/helper/rmath.h>
2828
#include <assert.h>
2929
#include <iostream>
30-
#include <sofa/simulation/Node.h>
3130

3231
namespace sofa::component::forcefield
3332
{

src/ShapeMatchingPlugin/ShapeMatchingRotationFinder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ using namespace sofa::defaulttype;
3939

4040
// Register in the Factory
4141
int ShapeMatchingRotationFinderClass = core::RegisterObject("ShapeMatchingRotationFinder")
42-
.add< ShapeMatchingRotationFinder< Vec3dTypes > >()
42+
.add< ShapeMatchingRotationFinder< Vec3Types > >()
4343
.addAlias("RotationFinder")
4444
;
4545

46-
template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingRotationFinder< defaulttype::Vec3dTypes >;
46+
template class SOFA_SHAPEMATCHINGPLUGIN_API ShapeMatchingRotationFinder< defaulttype::Vec3Types >;
4747

4848
} // namespace sofa::component::container

0 commit comments

Comments
 (0)