Skip to content

Commit

Permalink
Merge pull request #89 from SofaDefrost/master
Browse files Browse the repository at this point in the history
merge master CMakeLists into actuator branch
  • Loading branch information
adagolodjo authored Oct 10, 2023
2 parents 214a816 + 6e5b524 commit b4b005b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
SofaPython3_ROOT="$GITHUB_WORKSPACE/SofaPython3"
mkdir -p "${{ runner.temp }}/sp3_tmp/zip" "${{ runner.temp }}/sp3_tmp/binaries" "$SofaPython3_ROOT"
url="https://github.com/sofa-framework/SofaPython3/releases/download"
url="${url}/release-master-nightly/SofaPython3_master-nightly_python-${{ matrix.python_version }}_for-SOFA-${{ matrix.sofa_branch }}_${{ runner.os }}.zip"
url="${url}/release-${{ matrix.sofa_branch }}/SofaPython3_${{ matrix.sofa_branch }}_python-${{ matrix.python_version }}_for-SOFA-${{ matrix.sofa_branch }}_${{ runner.os }}.zip"
echo "Getting SofaPython3 from $url"
curl --output "${{ runner.temp }}/sp3_tmp/SofaPython3.zip" -L $url
unzip -qq "${{ runner.temp }}/sp3_tmp/SofaPython3.zip" -d "${{ runner.temp }}/sp3_tmp/binaries"
Expand Down Expand Up @@ -168,7 +168,9 @@ jobs:
with:
name: ${{ github.ref_name }}
tag_name: release-${{ github.ref_name }}
fail_on_unmatched_files: true
fail_on_unmatched_files: false
target_commitish: ${{ github.ref_name }}
files: |
artifacts/CosseratPlugin_*_Linux.zip
artifacts/CosseratPlugin_*_Windows.zip
artifacts/CosseratPlugin_*_macOS.zip
15 changes: 3 additions & 12 deletions Tests/forcefield/BeamHookeLawForceFieldTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ struct BeamHookeLawForceFieldTest : public testing::NumericTest<> {
fprintf(stderr, "Starting up ! \n");
sofa::simpleapi::importPlugin("Sofa.Component");
sofa::simpleapi::importPlugin("Cosserat");

//create the context for
if(simulation==nullptr)
sofa::simulation::setSimulation(simulation = new sofa::simulation::graph::DAGSimulation());
}

// Tears down the test fixture.
Expand All @@ -58,7 +54,7 @@ struct BeamHookeLawForceFieldTest : public testing::NumericTest<> {
// can be used instead of a destructor,
// but exceptions can be handled in this function only
if(root) {
simulation->unload(root);
sofa::simulation::node::unload(root);
}
fprintf(stderr, "Starting down ! \n");
}
Expand Down Expand Up @@ -105,8 +101,6 @@ struct BeamHookeLawForceFieldTest : public testing::NumericTest<> {
protected:
///< Root of the scene graph, created by the constructor an re-used in the tests
simulation::Node::SPtr root;
///< created by the constructor an re-used in the tests
simulation::Simulation* simulation {nullptr};

void testFonctionnel();
};
Expand All @@ -131,10 +125,9 @@ void BeamHookeLawForceFieldTest<defaulttype::Vec3Types>::testFonctionnel() {
EXPECT_NE(root.get(), nullptr) ;
root->init(sofa::core::execparams::defaultInstance()) ;

Simulation* simulation = sofa::simulation::getSimulation() ;
auto total_load = dynamic_cast<sofa::core::objectmodel::Data<double> *>(traction->findData("lengthY"));
for (unsigned int step = 1; step <= 5; ++step) {
simulation->animate(root.get(), 1);
sofa::simulation::node::animate(root.get(), 1);
EXPECT_DOUBLE_EQ(total_load->getValue(), 4*step) << "Total load at time step " << step << " is incorrect.";
}
}
Expand Down Expand Up @@ -176,10 +169,8 @@ void BeamHookeLawForceFieldTest<defaulttype::Vec3Types>::basicAttributesTest(){
<< "Missing attribute with name '"
<< attrname << "'." ;

Simulation* simulation = sofa::simulation::getSimulation() ;
ASSERT_NE(nullptr, simulation) ;
for(int i=0; i<10; i++){
simulation->animate(root.get(),(double)0.01);
sofa::simulation::node::animate(root.get(),(double)0.01);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cosserat/Binding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sofa_find_package(Sofa.GL QUIET)

SP3_add_python_module(
TARGET ${PROJECT_NAME}
PACKAGE Bindings
PACKAGE Cosserat
MODULE Cosserat
DESTINATION /
SOURCES ${SOURCE_FILES}
Expand Down

0 comments on commit b4b005b

Please sign in to comment.