- This topic has 3 replies, 2 voices, and was last updated 3 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] How to use HexahedronCompositeFEMMapping in cpp
Tagged: SOFA_2106, Windows_10
Dear SOFA users.
Hello everyone. I’m the user of SOFA with CPP platform
In recent days, I’m interested in using “HexahedronCompositeFEMForceFieldAndMass” and “HexahedronCompositeFEMMapping” for my simulation.
Unlike the other mapping algorithms, HexahedronCompositeFEMMapping require <BasicMapping> template and inherit TIn and TOut from this BasicMapping.
(normal mappings: sofa::component::mapping::IdentityMapping<Vec3Types, Vec3Types>; or sofa::component::mapping::BarycentricMapping<Vec3Types, Vec3Types>;)
Is there anyone who have been used this HexahedronCompositeFEMMapping?
I already tested IdentityMapping and BarycentricMapping as BasicMapping, but it does not work.
Thanks a lot!
Hey @dst03251
Sorry I have not, but did you check out the example scenes:
– examples/Components/forcefield/HexahedronCompositeFEMForceFieldAndMass.scn
– examples/Components/mapping/HexahedronCompositeFEMMapping.scn
?
Best
Hugo
Thanks to your comment Hugo.
I already checked both scn examples.
Today, I can solve this problem by modifying the code of the “SofaNonUniformFem” module.
In “SofaNonUniformFem/HexahedronCompositeFEMMapping.cpp” file line 44,
the original code was like below.
“template class HexahedronCompositeFEMMapping< Mapping< Vec3dTypes, Vec3dTypes > >;”
To use this class outside from the module (my own simulation project with cpp platform) this line should be changed like below.
“template class SOFA_SOFANONUNIFORMFEM_API HexahedronCompositeFEMMapping< Mapping< Vec3dTypes, Vec3dTypes > >;”
I hope my experience will help others.
Best.
Great thanks for the feedback @dst03251
Could you pull-request this change in SOFA? (contributing doc)
Thanks a lot!
Best wishes,
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.