Skip to content
Snippets Groups Projects
Commit 2be605fe authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

hoipla

parent 312d7d46
No related branches found
No related tags found
No related merge requests found
......@@ -336,12 +336,12 @@ void Mesh::updateGEntityPositions()
void Mesh::scaledJacAndGradients(int iEl, std::vector<double> &sJ , std::vector<double> &gSJ) {
if (_dim == 2 && !projJac){
// printf("coucou\n");
gradScaledJac(iEl,gSJ);
scaledJac(iEl,sJ);
return;
}
// if (_dim == 2 && !projJac){
// // printf("coucou\n");
// gradScaledJac(iEl,gSJ);
// scaledJac(iEl,sJ);
// return;
// }
SVector3 n ;
if (_dim == 2)
......@@ -362,16 +362,18 @@ void Mesh::scaledJacAndGradients(int iEl, std::vector<double> &sJ , std::vector<
double jac[3][3];
for (int l = 0; l < nbBez; l++) {
fullMatrix<double> dPsi(gsf, l * 3, 3);
jac[0][0] = jac[0][1] = jac[0][2] = 0.;
jac[1][0] = jac[1][1] = jac[1][2] = 0.;
jac[2][0] = jac[2][1] = jac[2][2] = (_dim == 2) ? n.z() : 0.0;
jac[2][0] = (_dim == 2) ? n.x() : 0.0; jac[2][1] = (_dim == 2) ? n.y() : 0.0; jac[2][2] = (_dim == 2) ? n.z() : 0.0;
const double INVJ = (_dim == 3) ? _invStraightJac[iEl] : 1.0;
for (int i = 0; i < nbNod; i++) {
int &iVi = _el2V[iEl][i];
const double x = _xyz[iVi].x();
const double y = _xyz[iVi].y();
const double z = _xyz[iVi].z();
for (int k = 0; k < 3; k++) {
for (int k = 0; k < _dim; k++) {
const double gg = dPsi(i, k);
jac[k][0] += x * gg;
jac[k][1] += y * gg;
......
......@@ -486,6 +486,9 @@ void HighOrderMeshOptimizer (GModel *gm, OptHomParameters &p)
OptHOM temp(*itr, toOptimizeSplit[i], toFix, method);
temp.recalcJacDist();
temp.getJacDist(minJac, maxJac, distMaxBND, distAvgBND);
std::ostringstream ossI;
ossI << "initial_" << (*itr)->tag() << "BLOB_" << i << ".msh";
temp.mesh.writeMSH(ossI.str().c_str());
OptHomMessage("Optimizing a blob %i/%i composed of %4d elements minJ %12.5E -- maxJ %12.5E", i+1, toOptimizeSplit.size(), toOptimizeSplit[i].size(), minJac, maxJac);
p.SUCCESS = std::min(p.SUCCESS,temp.optimize(p.weightFixed, p.weightFree, p.BARRIER_MIN, p.BARRIER_MAX, samples, p.itMax));
temp.mesh.updateGEntityPositions();
......
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