Commit 68fc0517 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

some fixes

parent 74b2688e
Pipeline #5345 passed with stage
in 25 seconds
......@@ -192,6 +192,7 @@ static void f_boundary(WeakBoundary *wbnd, FluidProblem *problem,const double *n
dun[iD] = 0;
dunt[iD] = 0;
unold += sold[U+iD]*n[iD];
if(vid>=0)
unext += data[vid+iD]*n[iD];
dcn += dc[iD]*n[iD];
s_c += vid<0?0:(u[iD]-data[vid+iD])*n[iD];
......@@ -1818,7 +1819,7 @@ void fluid_problem_local_adapt_mesh(FluidProblem *problem, double lcmax, double
}
read_the_tree(mesh, Tree, x_new, n_nodes_new, elements_new, n_elements_new, boundaries_new, boundary_tags_new, n_boundaries_new);
problem->map = (Tree_cell *) malloc(n_elements_new*sizeof(Tree_cell));
problem->map = malloc(n_elements_new*sizeof(Tree_cell*));
problem->map2Tree = (int *) malloc(n_elements_new*sizeof(Tree_cell));
get_the_mapping(Tree, problem->map, problem->map2Tree, problem->size_initial_mesh);
......@@ -1843,16 +1844,16 @@ void fluid_problem_local_adapt_mesh(FluidProblem *problem, double lcmax, double
int *boundaries_new = (int*) calloc(2*n_boundaries_new, sizeof(int));
int *boundary_tags_new = (int*) malloc(n_boundaries_new*sizeof(int));
Tree_cell *map_new = (Tree_cell*) malloc(n_elements_new*sizeof(Tree_cell));
Tree_cell **map_new = malloc(n_elements_new*sizeof(Tree_cell*));
int *map2Tree_new = (int*) malloc(n_elements_new*sizeof(Tree_cell));
// initialize to zero
for (int n=0; n<mesh->n_elements; n++) {
for (int n=0; n<mesh->n_nodes; n++) {
for (int ii=0; ii<3; ii++) {
x_new[n*3+ii]=mesh->x[n*3+ii];
}
}
for (int n=mesh->n_elements; n<n_elements_new; n++) {
for (int n=mesh->n_nodes; n<n_nodes_new; n++) {
for (int ii=0; ii<3; ii++) {
x_new[n*3+ii]=0.;
}
......@@ -1860,7 +1861,7 @@ void fluid_problem_local_adapt_mesh(FluidProblem *problem, double lcmax, double
deep_tree_create_the_data_structure(mesh, problem->Tree, x_new, n_nodes_new, elements_new, n_elements_new, boundaries_new, n_boundaries_new, boundary_tags_new, map_new, map2Tree_new, problem->size_initial_mesh);
//fluid_problem_set_elements(problem, n_nodes_new, x_new, n_elements_new, elements_new, n_boundaries_new, boundaries_new, boundary_tags_new, mesh->n_boundaries, mesh->boundary_names,1);
fluid_problem_set_elements(problem, n_nodes_new, x_new, n_elements_new, elements_new, n_boundaries_new, boundaries_new, boundary_tags_new, mesh->n_boundaries, mesh->boundary_names,1);
/*char filename[128];
sprintf(filename, "test_%d.msh",global_ind); global_ind++;
......@@ -1868,15 +1869,14 @@ void fluid_problem_local_adapt_mesh(FluidProblem *problem, double lcmax, double
mesh_write_msh(problem->mesh,ftmp);
fclose(ftmp);*/
/*printf("HERE \n");
/*printf("HERE \n");*/
problem->map = map_new;
problem->map2Tree = map2Tree_new;*/
problem->map2Tree = map2Tree_new;
/*free(elements_new);
free(elements_new);
free(x_new);
free(boundaries_new);
free(boundary_tags_new);*/
exit(1);
free(boundary_tags_new);
}
/*Mesh *mesh = problem->mesh;
......
......@@ -64,7 +64,7 @@ struct FluidProblem {
Mesh *mesh;
MeshTree *mesh_tree;
Tree_cell *Tree;
Tree_cell *map;
Tree_cell **map;
int *map2Tree;
int size_initial_mesh;
MeshBoundary *boundaries;
......
This diff is collapsed.
......@@ -127,9 +127,7 @@ typedef struct Tree_cell
{
struct Tree_cell *children;
struct Tree_cell *parent;
struct Tree_cell *nghb0;
struct Tree_cell *nghb1;
struct Tree_cell *nghb2;
struct Tree_cell *nghb[3];
int tag;
int bool_ref;
......@@ -149,27 +147,27 @@ typedef struct Tree_cell
void create_the_tree(Mesh *mesh, Tree_cell *Tree, double h_min, int *n_nodes_new, int *n_elements_new, int *delta_boundaries_new);
void read_the_tree(Mesh *mesh, Tree_cell *Tree, double *x_new, int n_nodes_new, int *elements_new, int n_elements_new, int *boundaries_new, int *boundary_tags_new, int n_boundaries_new);
void deep_tree_walk_tree(Mesh *mesh, Tree_cell *Tree, Tree_cell *map, int *map2Tree, int size, double h_min, int *n_nodes_new, int *n_elements_new, int *n_boundaries_new);
void deep_tree_create_the_data_structure(Mesh *mesh, Tree_cell *Tree, double *x_new, int n_nodes_new, int *elements_new, int n_elements_new, int *boundaries_new, int n_boundaries_new, int *boundary_tags_new, Tree_cell *map_new, int *map2Tree_new, int size);
void deep_tree_get_map(Tree_cell *current, Tree_cell *map_new, int *map2Tree_new, int *elt, int root);
void deep_tree_walk_tree(Mesh *mesh, Tree_cell *Tree, Tree_cell **map, int *map2Tree, int size, double h_min, int *n_nodes_new, int *n_elements_new, int *n_boundaries_new);
void deep_tree_create_the_data_structure(Mesh *mesh, Tree_cell *Tree, double *x_new, int n_nodes_new, int *elements_new, int n_elements_new, int *boundaries_new, int n_boundaries_new, int *boundary_tags_new, Tree_cell **map_new, int *map2Tree_new, int size);
void deep_tree_get_map(Tree_cell *current, Tree_cell **map_new, int *map2Tree_new, int *elt, int root);
void deep_tree_create_x_elt_bd(Mesh *mesh, Tree_cell *current, double *x_new, int *elements_new, int *boundaries_new, int *boundary_tags_new, int *ibd);
void deep_tree_init_nghb_step1(Mesh *mesh, Tree_cell *map, Tree_cell *current);
void deep_tree_init_nghb_step2(Mesh *mesh, Tree_cell *Tree, Tree_cell *map, int *map2Tree, Tree_cell *current);
void deep_tree_transfert_nghb(Tree_cell *current, Tree_cell *tree_elt, int buffer, int bool_nghb0, int bool_nghb1);
//void deep_tree_init_nghb_step1(Mesh *mesh, Tree_cell **map, Tree_cell *current);
//void deep_tree_init_nghb_step2(Mesh *mesh, Tree_cell *Tree, Tree_cell **map, int *map2Tree, Tree_cell *current);
//void deep_tree_transfert_nghb(Tree_cell *current, Tree_cell *tree_elt, int buffer, int bool_nghb0, int bool_nghb1);
void deep_tree_transfer(Tree_cell *current, int iel);
void deep_tree_set_bool_ref(Mesh *mesh, Tree_cell *current, double h_min);
//void deep_tree_set_bool_ref(Mesh *mesh, Tree_cell *current, double h_min);
void deep_tree_refinement(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, double h_min, int *index, int *elt);
void deep_tree_complete_the_refinement(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, int *index, int *elt);
void deep_tree_remove_illegale_refinement(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, int *index, int *elt, int *ibd, int *num);
void deep_tree_talk_2_neighbours(Tree_cell *map, Tree_cell *current, int iel, int *index);
void deep_tree_talk_2_neighbours(Tree_cell **map, Tree_cell *current, int iel, int *index);
void deep_tree_cut_into_4(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, int iel, int *index, int *elt, int bool_2_transfert);
void deep_tree_cut_into_2(Tree_cell *current, int *index, int *elt);
void deep_tree_transform_into_4(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, int *index, int *elt);
void deep_tree_transfer_for_transform(Tree_cell *buf, int ii, Tree_cell *buf_nghb, int *index, int cut_edge, int save_tag1, int save_tag2);
void deep_tree_green_refinement(Mesh *mesh, Tree_cell *Tree, Tree_cell *map, Tree_cell *current, int *map2Tree, int *index, int *elt);
void deep_tree_green_refinement(Mesh *mesh, Tree_cell *Tree, Tree_cell *current, int *index, int *elt);
int find_nghb(Mesh *mesh, int current, int n_edges, int neighbours[3], int nodes[6], int phys[3]);
......@@ -185,7 +183,7 @@ int bool_2_nodes_no_children(Tree_cell *Tree, int iel);
void cut_in_2(Tree_cell *Tree, int iel, int *elements_new, int *elt);
void cut_in_4(Mesh *mesh, Tree_cell *Tree, int iel, double *x_new, int *elements_new, int *elt, int *boundaries_new, int *boundary_tags_new, int *ibd);
void get_the_mapping(Tree_cell *Tree, Tree_cell *map, int *map2Tree, int size);
void get_the_mapping(Tree_cell *Tree, Tree_cell **map, int *map2Tree, int size);
void printing_post_processing_files(Mesh *mesh, int *elements_new, double *x_new, int *boundaries_new, int n_elements_new, int n_boundaries_new);
void print_current(Tree_cell *current, int bool_print);
......
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