Skip to content
Snippets Groups Projects
Commit 5c9325ce authored by Thomas Toulorge's avatar Thomas Toulorge
Browse files

Removed pass on Jacobian in MeshQualityOptimizer unless explicitly required

parent 3619b8d5
No related branches found
No related tags found
No related merge requests found
...@@ -106,24 +106,31 @@ void MeshQualityOptimizer(GModel *gm, MeshQualOptParameters &p) ...@@ -106,24 +106,31 @@ void MeshQualityOptimizer(GModel *gm, MeshQualOptParameters &p)
minInvCondNumBarFunc.setTarget(p.minTargetInvCondNum, 1.); minInvCondNumBarFunc.setTarget(p.minTargetInvCondNum, 1.);
MeshOptPass minJacPass; MeshOptPass minJacPass;
minJacPass.barrierIterMax = p.optPassMax;
minJacPass.optIterMax = p.itMax;
minJacPass.contrib.push_back(&nodeDistFunc);
minJacPass.contrib.push_back(&minIdealJacBarFunc);
par.pass.push_back(minJacPass);
MeshOptPass minInvCondNumPass; MeshOptPass minInvCondNumPass;
minInvCondNumPass.barrierIterMax = p.optPassMax; if (p.onlyValidity) {
minInvCondNumPass.optIterMax = p.itMax; minJacPass.barrierIterMax = p.optPassMax;
minInvCondNumPass.contrib.push_back(&nodeDistFunc); minJacPass.optIterMax = p.itMax;
minInvCondNumPass.contrib.push_back(&minInvCondNumBarFunc); minJacPass.contrib.push_back(&nodeDistFunc);
par.pass.push_back(minInvCondNumPass); minJacPass.contrib.push_back(&minIdealJacBarFunc);
par.pass.push_back(minJacPass);
}
else {
minInvCondNumPass.barrierIterMax = p.optPassMax;
minInvCondNumPass.optIterMax = p.itMax;
minInvCondNumPass.contrib.push_back(&nodeDistFunc);
minInvCondNumPass.contrib.push_back(&minInvCondNumBarFunc);
par.pass.push_back(minInvCondNumPass);
}
meshOptimizer(gm, par); meshOptimizer(gm, par);
p.CPU = par.CPU; p.CPU = par.CPU;
// p.minIdealJac = minIdealJacBarFunc.getMin(); if (p.onlyValidity) {
// p.maxIdealJac = minIdealJacBarFunc.getMax(); p.minIdealJac = minIdealJacBarFunc.getMin();
p.minInvCondNum = minInvCondNumBarFunc.getMin(); p.maxIdealJac = minIdealJacBarFunc.getMax();
p.maxInvCondNum = minInvCondNumBarFunc.getMax(); }
else {
p.minInvCondNum = minInvCondNumBarFunc.getMin();
p.maxInvCondNum = minInvCondNumBarFunc.getMax();
}
} }
...@@ -33,38 +33,38 @@ ...@@ -33,38 +33,38 @@
class GModel; class GModel;
struct MeshQualOptParameters { struct MeshQualOptParameters {
bool onlyValidity;
bool excludeQuad, excludeHex, excludePrism; bool excludeQuad, excludeHex, excludePrism;
double minTargetIdealJac; double minTargetIdealJac;
double minTargetInvCondNum; double minTargetInvCondNum;
double weightFixed; // weight of the energy for fixed nodes double weightFixed; // weight of the energy for fixed nodes
double weightFree; // weight of the energy for free nodes double weightFree; // weight of the energy for free nodes
int nbLayers; // number of layers taken around a bad element int nbLayers; // number of layers taken around a bad element
int dim; // which dimension to optimize int dim; // which dimension to optimize
int itMax; // max number of iterations in the optimization process int itMax; // max number of iterations in the optimization process
int optPassMax; // max number of optimization passes int optPassMax; // max number of optimization passes
bool onlyVisible; // apply optimization to visible entities ONLY bool onlyVisible; // apply optimization to visible entities ONLY
double distanceFactor; // filter elements such that no elements further away double distanceFactor; // Distance criterion for patch creation
// than DistanceFactor times the max distance to bool fixBndNodes; // If points can move on boundaries
// straight sided version of an element are optimized int strategy; // 0 = connected blobs, 1 = adaptive one-by-one
bool fixBndNodes; // how jacobians are computed and if points can move on boundaries int maxAdaptBlob; // Max. nb. of blob adaptation interations (if adaptive)
int strategy; // 0 = connected blobs, 1 = adaptive one-by-one int adaptBlobLayerFact; // Growth factor in number of layers for blob adaptation (if adaptive)
int maxAdaptBlob; // Max. nb. of blob adaptation interations double adaptBlobDistFact; // Growth factor in distance factor for blob adaptation (if adaptive)
int adaptBlobLayerFact; // Growth factor in number of layers for blob adaptation
double adaptBlobDistFact; // Growth factor in distance factor for blob adaptation
int SUCCESS ; // 0 --> success , 1 --> Not converged int SUCCESS ; // 0 --> success , 1 --> Not converged
// double minIdealJac, maxIdealJac; // after optimization, range of jacobians double minIdealJac, maxIdealJac; // after optimization, range of jacobians
double minInvCondNum, maxInvCondNum; // after optimization, range of jacobians double minInvCondNum, maxInvCondNum; // after optimization, range of jacobians
double CPU; // Time for optimization double CPU; // Time for optimization
MeshQualOptParameters () MeshQualOptParameters ()
: excludeQuad(false), excludeHex(false), excludePrism(false), : onlyValidity(false), excludeQuad(false),
excludeHex(false), excludePrism(false),
minTargetIdealJac(0.1), minTargetInvCondNum(0.1), weightFixed(1000.), minTargetIdealJac(0.1), minTargetInvCondNum(0.1), weightFixed(1000.),
weightFree (1.), nbLayers (6) , dim(3) , itMax(300), optPassMax(50), weightFree (1.), nbLayers (6) , dim(3) , itMax(300), optPassMax(50),
onlyVisible(true), distanceFactor(12), fixBndNodes(false), strategy(0), onlyVisible(true), distanceFactor(12), fixBndNodes(false), strategy(0),
maxAdaptBlob(3), adaptBlobLayerFact(2.), adaptBlobDistFact(2.), CPU(0.), maxAdaptBlob(3), adaptBlobLayerFact(2.), adaptBlobDistFact(2.), CPU(0.),
// minIdealJac(0.), maxIdealJac(0.), SUCCESS(-1) minIdealJac(0.), maxIdealJac(0.), minInvCondNum(0.), maxInvCondNum(0.),
minInvCondNum(0.), maxInvCondNum(0.), SUCCESS(-1) SUCCESS(-1)
{ {
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment