Commit 912bb0a6 authored by Jimmy Fraiture's avatar Jimmy Fraiture
Browse files

Fix velocity projection

parent af9e1a28
Pipeline #8642 passed with stages
in 3 minutes and 2 seconds
......@@ -1769,31 +1769,14 @@ void fluid_problem_load_new_mesh(FluidProblem *problem, const char *mesh_name, i
for (int i = 0; i < new_mesh->n_nodes; ++i) {
const int *el = problem->mesh->elements+eid[i]*N_N;
if(eid[i] == -1) {
/*
double min_dst = -1.0;
int index = -1;
for(int j = 0; j < problem->mesh->n_nodes; j++){
double dst = 0.0;
for(int k = 0; k < D; k++)
dst += (problem->mesh->x[3*j + k] - new_mesh->x[3*i + k]) * (problem->mesh->x[3*j + k] - new_mesh->x[3*i + k]);
if(dst < min_dst || min_dst == -1.0){
index = j;
min_dst = dst;
}
}*/
int index = find_closest_element(problem->mesh_tree, new_mesh->x+3*i, D);
if(index != -1){
for (int j = 0; j<nf; ++j)
new_solution[i*nf+j] = problem->solution[index];
if(problem->n_fluids > 1){
concentration_cg[i] = problem->concentration[index*N_N];//Le soucis c est que la concentration est stocké par élément et non par noeud
}
} else {
for (int j = 0; j<nf; ++j)
for (int j = 0; j<nf; ++j)
new_solution[i*nf+j] = 0;
if(problem->n_fluids > 1)
concentration_cg[i] = 0;
}
int index = find_closest_element(problem->mesh_tree, new_mesh->x+3*i, D);
if(problem->n_fluids > 1 && index != 1)
concentration_cg[i] = problem->concentration[index*N_N];
else if(index == -1)
concentration_cg[i] = 0;
} else {
double phi[N_SF];
shape_functions(mesh_point_uvw + i*D, phi);
......
Markdown is supported
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