Using Spline element (NURBS) in SOFA #148
Replies: 8 comments 2 replies
-
@Ziemnono @Sidaty1 and @hugtalbot, Could you please look into it. |
Beta Was this translation helpful? Give feedback.
-
Hi @bhagath555 ,
|
Beta Was this translation helpful? Give feedback.
-
@Ziemnono , I tried but no luck. Here is the code snippet and error messages Modified codecreateObject(root, "NurbsSurf", {{"name", "nurbs"}});
auto meca = createChild(root, "meca");
// Create the ODE system
createObject(meca, "StaticODESolver", {{"newton_iterations", "10"}, {"correction_tolerance_threshold", "1e-5"}, {"residual_tolerance_threshold", "1e-5"}});
createObject(meca, "LDLTSolver");
createObject(meca, "MechanicalObject", {{"name", "mo"}, {"src", "@" + executable_directory_path + "/meshes/splines/xy_rectangle.txt"}});
// Complete Nurbs topology container
createObject(meca, "CaribouSplineTopology", {{"name", "mechanical_topology"}, {"src", "@" + executable_directory_path + "/meshes/splines/xy_rectangle.txt"}});
// Mechanics
createObject(meca, "ElasticMaterial", {{"young_modulus", "3000"}, {"poisson_ratio", "0.499"}});
auto ff = dynamic_cast<SofaCaribou::forcefield::ElasticSplineForcefield<caribou::geometry::NurbsSurf<caribou::_2D>> *> (
createObject(meca, "ElasticSplineForcefield").get()
); List of error messages[ERROR] [DAGNode(root)] Component 'nurbs' of type 'NurbsSurf' failed: Object type NurbsSurf<> was not created The object is not in the factory. /home/bhagath/code/plugins/caribou_IGA/unittest/SofaCaribou/Forcefield/test_elasticsplineforcefield.cpp:35: Failure Failed A message of type 'Error' was not expected but it was received. ====================== Messages ======================= [DAGNode]: Message type : Error Message content: Component 'nurbs' of type 'NurbsSurf' failed: Object type NurbsSurf<> was not created The object is not in the factory. source code loc: /home/bhagath/code/sofa/SofaKernel/modules/SofaSimulationGraph/src/SofaSimulationGraph/SimpleApi.cpp:90 component: DAGNode(root) =============================================================== [ERROR] [MechanicalObject(unnamed)] Source object "@/home/bhagath/code/plugins/caribou_IGA/build/bin/meshes/splines/xy_rectangle.txt" NOT FOUND. /home/bhagath/code/plugins/caribou_IGA/unittest/SofaCaribou/Forcefield/test_elasticsplineforcefield.cpp:35: Failure Failed A message of type 'Error' was not expected but it was received. ====================== Messages ======================= [MechanicalObject]: Message type : Error Message content: Source object "@/home/bhagath/code/plugins/caribou_IGA/build/bin/meshes/splines/xy_rectangle.txt" NOT FOUND. source code loc: /home/bhagath/code/sofa/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseObject.cpp:135 component: MechanicalObject(unnamed) =============================================================== [ERROR] [CaribouSplineTopology(unnamed)] Source object "@/home/bhagath/code/plugins/caribou_IGA/build/bin/meshes/splines/xy_rectangle.txt" NOT FOUND. /home/bhagath/code/plugins/caribou_IGA/unittest/SofaCaribou/Forcefield/test_elasticsplineforcefield.cpp:35: Failure Failed A message of type 'Error' was not expected but it was received. ====================== Messages ======================= [CaribouSplineTopology]: Message type : Error Message content: Source object "@/home/bhagath/code/plugins/caribou_IGA/build/bin/meshes/splines/xy_rectangle.txt" NOT FOUND. source code loc: /home/bhagath/code/sofa/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseObject.cpp:135 component: CaribouSplineTopology(unnamed) =============================================================== [WARNING] [CaribouSplineTopology(mechanical_topology)] Template '' incorrect, used NurbsSurf in the list: * NurbsSurf * NurbsSurf_2D [ERROR] [DAGNode(meca)] Component 'ElasticSplineForcefield' of type 'ElasticSplineForcefield' failed: Object type ElasticSplineForcefield<> was not created The object is in the factory but cannot be created. Requested template : None Used template : None Also tried to create the object with the template 'NurbsSurf_2D' but failed for the following reason(s): 1. Cannot find a topology in the current context from which the template 'NurbsSurf_2D' can be deduced. /home/bhagath/code/plugins/caribou_IGA/unittest/SofaCaribou/Forcefield/test_elasticsplineforcefield.cpp:35: Failure Failed A message of type 'Error' was not expected but it was received. ====================== Messages ======================= [DAGNode]: Message type : Error Message content: Component 'ElasticSplineForcefield' of type 'ElasticSplineForcefield' failed: Object type ElasticSplineForcefield<> was not created The object is in the factory but cannot be created. Requested template : None Used template : None Also tried to create the object with the template 'NurbsSurf_2D' but failed for the following reason(s): 1. Cannot find a topology in the current context from which the template 'NurbsSurf_2D' can be deduced. source code loc: /home/bhagath/code/sofa/SofaKernel/modules/SofaSimulationGraph/src/SofaSimulationGraph/SimpleApi.cpp:90 component: DAGNode(meca) |
Beta Was this translation helpful? Give feedback.
-
@Ziemnono. Yeah, almost done. I am testing bindings of |
Beta Was this translation helpful? Give feedback.
-
Yes, those are completed. |
Beta Was this translation helpful? Give feedback.
-
OK, I think I understand what you're trying to do. You cannot create a NurbsSurf like this, as it is not a "proper" SOFA object. The best is to directly create your |
Beta Was this translation helpful? Give feedback.
-
Hey @bhagath555 How is it going on your end? I see you closed this issue. |
Beta Was this translation helpful? Give feedback.
-
Dear @hugtalbot , Almost all the formulation is implemented and visualization part completed yesterday :).
However, I still need to validate the implementation, and there are few minor issues regarding NURBS geometry reader and python binding of Meanwhile I am looking for some benchmark problems to validate the implementation and other features I can work on. Thanks, Have a nice day, |
Beta Was this translation helpful? Give feedback.
-
Hello Caribou Community,
This is Bhagath. I am implementing Isogeometric analysis IGA (Spline based FEM) in caribou (SOFA v 21.06).
Let me give you a brief introduction of developments.
NurbsSurf
- Equivalent to FEM Element with few extra variables.CoreNurbs
- Spline geometry processor, similar to VTK module.NurbsReaders
- Equivalent to VTKReader.SplinePatch
- does the function ofMesh
andDomain
CaribouSplineTopology
- Equivalent toCaribouTopology
CaribouSplineForcefield
- Equivalent toCaribouForcefield
.ElasticSplineForcefield
.We have validated the working of most of the code with unit-tests. However, When we tried to write unit-test of
ElasticSplineForcefield
with the inspiration ofHyperElasticsplineForcefield
. It prompted many errors. What are the possible changes I should make?RegularGridTopology
andHexahedronSetTopologyContainer
as input parameters ofcreateObject
function. If I am not wrong, these types are not part of Caribou but part of SOFA. How could I make it work for my case.“BocROI”
, what should I used instead of{"quad", "@surface_topology.quad"}
in case of NurbsSurf.Note: In this test I would like to specify the geometry file path (which is in
caribou/build/bin/mesh
)Code snippet : for full code see test_hyperelasticforcefield.cpp
Let me know, if any additional information required.
Thanks in advance.
Have a nice weekend.
Beta Was this translation helpful? Give feedback.
All reactions