Commit 9f7b525f authored by Matthieu Constant's avatar Matthieu Constant
Browse files

new adapt formula

parent a288a6ae
......@@ -679,7 +679,7 @@ void fluid_problem_adapt_gen_mesh(FluidProblem *problem, double gradmin, double
double dphi[N_SF][DIMENSION];
grad_shape_functions(dxidx, dphi);
double ngrad2 = 0;
/*for (int i=0; i<DIMENSION; ++i){
for (int i=0; i<DIMENSION; ++i){
for (int j=0; j<DIMENSION; ++j){
double gradU = 0;
for (int k=0; k<N_SF; ++k){
......@@ -688,16 +688,16 @@ void fluid_problem_adapt_gen_mesh(FluidProblem *problem, double gradmin, double
ngrad2 += gradU*gradU;
}
}
double ngrad = pow(ngrad2, 0.25); */
for (int j=0; j<DIMENSION; ++j){
double gradP = 0;
for (int k=0; k<N_SF; ++k){
gradP += dphi[k][j]*P[k];
}
ngrad2 += gradP*gradP;
}
/* double ngrad = pow(ngrad2, 0.25); */
/* for (int j=0; j<DIMENSION; ++j){*/
/* double gradP = 0;*/
/* for (int k=0; k<N_SF; ++k){*/
/* gradP += dphi[k][j]*P[k];*/
/* }*/
/* ngrad2 += gradP*gradP;*/
/* }*/
double ngrad = sqrt(ngrad2);
double lc = lcmin /fmin(1,fmax(ngrad*ngrad*ngrad/(gradmax*gradmax*gradmax),gradmin*gradmin*gradmin/(gradmax*gradmax*gradmax)));
double lc = lcmin /fmin(1,fmax(ngrad*ngrad/(gradmax*gradmax),gradmin*gradmin/(gradmax*gradmax)));
for (int j = 0; j < N_N; ++j){
new_mesh_size[el[j]] += lc;
num_lc[el[j]] += 1.;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment