When remeshing the FINDN subroutine in the REMESH.f file is used to find the element in the old mesh for each node in the new mesh. This is used to interpolated the last solution to the new mesh.
When comparing the Fortran remeshing code results with the converted C++ code I've noticed that FINDN does not always return the element the node is actually contained in.
FINDN calls the MAT_INV function which in turn calls the MAT_INV_GE function to compute the inverse of a 4x4 matrix used to find the local element coordinates for a given node.
The problem is that MAT_INV_GE does not always compute the correct inverse matrix. The inverse matrix can in fact sometimes contain NaNs.
When remeshing the
FINDN
subroutine in theREMESH.f
file is used to find the element in the old mesh for each node in the new mesh. This is used to interpolated the last solution to the new mesh.When comparing the Fortran remeshing code results with the converted C++ code I've noticed that
FINDN
does not always return the element the node is actually contained in.FINDN
calls theMAT_INV
function which in turn calls theMAT_INV_GE
function to compute the inverse of a 4x4 matrix used to find the local element coordinates for a given node.The problem is that
MAT_INV_GE
does not always compute the correct inverse matrix. The inverse matrix can in fact sometimes contain NaNs.