Skip to content
Snippets Groups Projects
Commit 84fc5ca7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

invert vandermonde matrix numerically (jf pirenne)

parent 05393d34
No related branches found
No related tags found
No related merge requests found
......@@ -1084,7 +1084,7 @@ StringXNumber MeshOptions_Number[] = {
{ F|O, "RadiusSup" , opt_mesh_radius_sup , 0.0 ,
"Only display elements whose longest edge is smaller than RadiusSup" },
{ F|O, "RandomFactor" , opt_mesh_rand_factor , 1.e-9 ,
"Random factor used in the 2D meshing algorithm (use larger values if lc * rand approaches machine accuracy)" },
"Random factor used in the 2D meshing algorithm (should be increased if RandomFactor * size(triangle)/size(model) approaches machine accuracy)" },
{ F|O, "RefineSteps" , opt_mesh_refine_steps , 10 ,
"Number of refinement steps in the MeshAdapt-based 2D algorithms" },
{ F|O, "ReverseAllNormals" , opt_mesh_reverse_all_normals , 0. ,
......
......@@ -537,21 +537,9 @@ gmshMatrix<double> generateLagrangeMonomialCoefficients(const gmshMatrix<double>
}
}
double det = Vandermonde.determinant();
if (det == 0.){
Msg::Fatal("Vandermonde matrix has zero determinant!?");
return gmshMatrix<double>(1, 1);
}
gmshMatrix<double> coefficient(ndofs, ndofs);
for (int i = 0; i < ndofs; i++) {
for (int j = 0; j < ndofs; j++) {
int f = (i + j) % 2 == 0 ? 1 : -1;
gmshMatrix<double> cofactor = Vandermonde.cofactor(i, j);
coefficient(i, j) = f * cofactor.determinant() / det;
}
}
return coefficient;
Vandermonde.invert(coefficient);
return coefficient.transpose();
}
std::map<int, gmshFunctionSpace> gmshFunctionSpaces::fs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment