-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caribou manufactured solution isn't converging #86
Comments
It looks like the p1 mesh is wrong. It is converging the p2 mesh. Using the following changes: diff --git a/Validation/manufactured_solution.py b/Validation/manufactured_solution.py
index 8734ec1..c7cb6a2 100644
--- a/Validation/manufactured_solution.py
+++ b/Validation/manufactured_solution.py
@@ -22,7 +22,7 @@ import Sofa, SofaRuntime, SofaCaribou
import meshio, numpy as np
from manufactured_solution import assemble, integrate, compute_solution, ConstantForceField
-mesh = meshio.read('meshes/cylinder_p1.vtu')
+mesh = meshio.read('meshes/cylinder_p2.vtu')
mu = 1.0
l = 1.25
@@ -41,9 +41,9 @@ def create_scene(root):
root.addObject('StaticODESolver', newton_iterations=10, residual_tolerance_threshold=1e-10, printLog=True)
root.addObject('LDLTSolver', backend='Pardiso')
root.addObject('MechanicalObject', name='mo', position=mesh.points.tolist())
- root.addObject('CaribouTopology', name='volume', template='Tetrahedron', indices=mesh.cells[1].data.tolist())
- root.addObject('CaribouTopology', name='dirichlet_boundary', template='Triangle', indices=mesh.cells[0].data[np.ma.masked_equal(mesh.cell_data['gmsh:physical'][0], 1).mask].tolist())
- root.addObject('CaribouTopology', name='neumann_boundary', template='Triangle', indices=mesh.cells[0].data[np.ma.masked_inside(mesh.cell_data['gmsh:physical'][0], 2, 3).mask].tolist())
+ root.addObject('CaribouTopology', name='volume', template='Tetrahedron10', indices=mesh.cells[1].data.tolist())
+ root.addObject('CaribouTopology', name='dirichlet_boundary', template='Triangle6', indices=mesh.cells[0].data[np.ma.masked_equal(mesh.cell_data['gmsh:physical'][0], 1).mask].tolist())
+ root.addObject('CaribouTopology', name='neumann_boundary', template='Triangle6', indices=mesh.cells[0].data[np.ma.masked_inside(mesh.cell_data['gmsh:physical'][0], 2, 3).mask].tolist())
root.addObject('SaintVenantKirchhoffMaterial', young_modulus=young_modulus, poisson_ratio=poisson_ratio)
root.addObject('HyperelasticForcefield', topology='@volume', printLog=True) leads to convergence:
|
@jnbrunet, I quickly checked and if you open the 2 meshes (cylinder_p1.vtu and cylinder_p2.vtu) with Paraview, you will clearly see a difference in size in the 2 meshes. In wireframe, the p1 cylinder and the small one is the p2. I can reproduce the same results for the p2 but when it comes to p1, I just adjust the length to the corresponding one (around 80 if I am not mistaken).
What do you think? |
Nice find @Ziemnono ! The radius and length of the cylinder mesh must indeed match to one provided to the manufactured solution. I guess the correct fix here is to update the mesh so that it matches to parameter of the manufactured solution. It would also be nice to add it to the CI unittests, I will have a look at it. |
Hi @jnbrunet,
We deliberately chose coarse meshes to avoid excessive computational time but by refining, you definitely reach a much better accuracy. |
The manufactured solution for the StVk material isn't converging anymore.
The text was updated successfully, but these errors were encountered: