Commit 2edd1f7d authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

add fluid_problem set_coordinates

parent 4326ad55
Pipeline #9159 passed with stages
in 4 minutes and 35 seconds
......@@ -1744,6 +1744,17 @@ void fluid_problem_adapt_mesh(FluidProblem *problem, Mesh *new_mesh, int old_n_p
free(old_particle_uvw);
}
void fluid_problem_set_coordinates(FluidProblem *problem, double *x) {
for (int i = 0; i < problem->mesh->n_nodes*3; ++i) {
problem->mesh->x[i] = x[i];
}
if(problem->mesh_tree)
mesh_tree_free(problem->mesh_tree);
problem->mesh_tree = mesh_tree_create(problem->mesh);
mesh_tree_particle_to_mesh(problem->mesh_tree, problem->n_particles, problem->particle_position, problem->particle_element_id, problem->particle_uvw);
compute_porosity(problem->mesh, problem->node_volume, problem->porosity, problem->n_particles, problem->particle_position, problem->particle_volume, problem->particle_element_id, problem->particle_uvw, NULL);
}
void fluid_problem_set_particles(FluidProblem *problem, int n, double *mass, double *volume, double *position, double *velocity, double *contact) {
if (problem->n_particles != n) {
problem->n_particles = n;
......
......@@ -176,6 +176,9 @@ class FluidProblem :
if(self._fp is not None) :
self._lib.fluid_problem_free(self._fp)
def set_coordinates(self, x):
self._lib.fluid_problem_set_coordinates(self._fp, _np2c(x))
def load_msh(self, mesh_file_name) :
"""Sets the domain geometry for the fluid computation.
......
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