Skip to content
Snippets Groups Projects
Commit e82c2475 authored by Tristan Carrier Baudouin's avatar Tristan Carrier Baudouin
Browse files

lpcvt

parent 85984ab1
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#endif #endif
#define AR_MAX 5 //maximal geometrical aspect ratio #define AR_MAX 5 //maximal geometrical aspect ratio
class rbf;
/* /*
A GFaceCompound is a model face that is the compound of model faces. A GFaceCompound is a model face that is the compound of model faces.
......
...@@ -402,7 +402,7 @@ void smoothing::optimize_model(){ ...@@ -402,7 +402,7 @@ void smoothing::optimize_model(){
for(it=model->firstFace();it!=model->lastFace();it++) for(it=model->firstFace();it!=model->lastFace();it++)
{ {
gf = *it; gf = *it;
if(gf->getNumMeshElements()>0){ if(gf->getNumMeshElements()>0 && gf->geomType()==GEntity::CompoundSurface){
optimize_face(gf); optimize_face(gf);
recombineIntoQuads(gf,1,1); recombineIntoQuads(gf,1,1);
} }
...@@ -645,6 +645,9 @@ SPoint2 lpcvt::seed(DocRecord& triangulator,GFace* gf){ ...@@ -645,6 +645,9 @@ SPoint2 lpcvt::seed(DocRecord& triangulator,GFace* gf){
int index2; int index2;
double x,y; double x,y;
SPoint2 x0,x1,x2; SPoint2 x0,x1,x2;
work_around = gf;
for(i=0;i<triangulator.numPoints;i++){ for(i=0;i<triangulator.numPoints;i++){
if(interior(triangulator,gf,i)){ if(interior(triangulator,gf,i)){
num = triangulator._adjacencies[i].t_length; num = triangulator._adjacencies[i].t_length;
...@@ -1126,7 +1129,7 @@ double lpcvt::get_rho(SPoint2 point,int p){ ...@@ -1126,7 +1129,7 @@ double lpcvt::get_rho(SPoint2 point,int p){
x = point.x(); x = point.x();
y = point.y(); y = point.y();
h = backgroundMesh::current()->operator()(x,y,0.0); //0.1; h = backgroundMesh::current()->operator()(x,y,0.0)*ratio(point); //0.1;
if(h>=0.0){ if(h>=0.0){
rho = pow_int(1.0/h,p+1); //integer only, theoric value : p+2 rho = pow_int(1.0/h,p+1); //integer only, theoric value : p+2
} }
...@@ -1220,6 +1223,18 @@ double lpcvt::drho_dy(SPoint2 point,int p){ ...@@ -1220,6 +1223,18 @@ double lpcvt::drho_dy(SPoint2 point,int p){
return val; return val;
} }
double lpcvt::ratio(SPoint2 point){
double val;
double uv[2];
double metric[3];
uv[0] = point.x();
uv[1] = point.y();
buildMetric(work_around,uv,metric);
val = 1.0/pow(metric[0]*metric[2]-metric[1]*metric[1],0.25);
return val;
}
void lpcvt::write(DocRecord& triangulator,GFace* gf,int p){ void lpcvt::write(DocRecord& triangulator,GFace* gf,int p){
int i; int i;
double energy; double energy;
......
...@@ -46,6 +46,7 @@ class lpcvt{ ...@@ -46,6 +46,7 @@ class lpcvt{
fullMatrix<double> gauss_weights; fullMatrix<double> gauss_weights;
std::vector<metric> metrics; std::vector<metric> metrics;
int gauss_num; int gauss_num;
GFace* work_around;
public : public :
lpcvt(); lpcvt();
~lpcvt(); ~lpcvt();
...@@ -81,6 +82,7 @@ class lpcvt{ ...@@ -81,6 +82,7 @@ class lpcvt{
double get_rho(SPoint2,int); double get_rho(SPoint2,int);
double drho_dx(SPoint2,int); double drho_dx(SPoint2,int);
double drho_dy(SPoint2,int); double drho_dy(SPoint2,int);
double ratio(SPoint2);
void write(DocRecord&,GFace*,int); void write(DocRecord&,GFace*,int);
void eval(DocRecord&,std::vector<SVector3>&,double&,int); void eval(DocRecord&,std::vector<SVector3>&,double&,int);
void swap(); void swap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment