diff --git a/Mesh/meshMetric.cpp b/Mesh/meshMetric.cpp index 242d3a52e7a94c7e63b0b3af4778b4e2dd2c3124..cbf0b6c7ec897d5424abc9ea1376f8e8fb59a579 100644 --- a/Mesh/meshMetric.cpp +++ b/Mesh/meshMetric.cpp @@ -513,6 +513,13 @@ void meshMetric::computeMetric(){ it++; } + else if (_technique == meshMetric::ISOTROPIC_LINEARINTERP_H){ + SVector3 gr = grads[ver]; + double norm = gr.normalize(); + double h_dist = (signed_dist < _E && signed_dist > _E_moins && norm != 0.0) ? hmin + ((hmax-hmin)/_E)*dist : hmax; // the charcteristic element size in all directions - linear interp between hmin and hmax + H = SMetric3(1./h_dist/h_dist); + } + if (_technique != meshMetric::EIGENDIRECTIONS && _technique!=meshMetric::EIGENDIRECTIONS_LINEARINTERP_H){ diff --git a/Mesh/meshMetric.h b/Mesh/meshMetric.h index 24f2a9bd10971444c185d780bae818f474916267..3433e1ddcbd359e36e06d371d4b1a15c38eabbad 100644 --- a/Mesh/meshMetric.h +++ b/Mesh/meshMetric.h @@ -21,7 +21,7 @@ class STensor3; /**Anisotropic mesh size field based on a metric */ class meshMetric: public Field { public: - typedef enum {LEVELSET=1,HESSIAN=2, FREY=3, EIGENDIRECTIONS=4, EIGENDIRECTIONS_LINEARINTERP_H=5} MetricComputationTechnique; + typedef enum {LEVELSET=1,HESSIAN=2, FREY=3, EIGENDIRECTIONS=4, EIGENDIRECTIONS_LINEARINTERP_H=5, ISOTROPIC_LINEARINTERP_H=6} MetricComputationTechnique; private: // intersect all metrics added in "setOfMetrics", preserve eigendirections of the "most anisotropic" metric void intersectMetrics(); @@ -72,6 +72,7 @@ class meshMetric: public Field { // parameters[4] = thickness of the interface in the negative ls direction (default: =parameters[0] if not specified) // parameters[3] = the required minimum number of elements to represent a circle - used for curvature-based metric (default: = 15) // 5: same as 4, except that the transition in band E uses linear interpolation of h, instead of linear interpolation of metric + // 6: fct is a LS, metric is isotropic with linear interpolation of h in band E void addMetric(int technique, simpleFunction<double> *fct, std::vector<double> parameters); inline SMetric3 metricAtVertex (MVertex* v) {