Skip to content
Snippets Groups Projects
Commit baeb2a2c authored by Adrien Crovato's avatar Adrien Crovato
Browse files

Decrease GMRES tolerance for adjoint mesh morpher, more robust.

parent bcfd5b18
No related branches found
No related tags found
No related merge requests found
......@@ -58,17 +58,23 @@ Adjoint::Adjoint(std::shared_ptr<Newton> _sol, std::shared_ptr<tbox::MshDeform>
nthreads = sol->nthreads;
verbose = sol->verbose;
// Linear solvers
// Linear solvers (if GMRES, use the same, but with a thighter tolerance)
if (sol->linsol->type() == LSOLTYPE::GMRES_ILUT)
{
// Use the same GMRES, but with a thighter tolerance
std::shared_ptr<Gmres> gmres = std::make_shared<Gmres>(*dynamic_cast<Gmres *>(sol->linsol.get()));
gmres->setTolerance(1e-8);
alinsol = gmres;
}
else
alinsol = sol->linsol;
mlinsol = morph->linsol;
if (morph->linsol->type() == LSOLTYPE::GMRES_ILUT)
{
std::shared_ptr<Gmres> gmres = std::make_shared<Gmres>(*dynamic_cast<Gmres *>(morph->linsol.get()));
gmres->setTolerance(1e-12);
mlinsol = gmres;
}
else
mlinsol = morph->linsol;
// Update element gradients
sol->pbl->initGradElems();
......@@ -423,7 +429,7 @@ void Adjoint::buildGradientLoadsFlow(Eigen::SparseMatrix<double, Eigen::RowMajor
/**
* @brief Build gradients of the load coefficients with respect to the flow variables on a given body
*
*
* Note: this is essentially the same as buildGradientLoadsFlow, but with an additional projection performed inside the loop for performance
*/
void Adjoint::buildGradientCoefficientsFlow(Eigen::RowVectorXd &dCl, Eigen::RowVectorXd &dCd, Body const &bnd)
......@@ -669,7 +675,7 @@ void Adjoint::buildGradientLoadsMesh(Eigen::SparseMatrix<double, Eigen::RowMajor
/**
* @brief Build gradients of the loads with respect to mesh coordinates on a given body
*
*
* Note: this is essentially the same as buildGradientLoadsMesh, but with an additional projection performed inside the loop for performance
*/
void Adjoint::buildGradientCoefficientsMesh(Eigen::RowVectorXd &dCl, Eigen::RowVectorXd &dCd, Body const &bnd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment