Skip to content
Snippets Groups Projects
Commit f372cad7 authored by Maja Warlich's avatar Maja Warlich
Browse files

Add conversion full_velocity to sparse_velocity.

parent ab5816e6
No related merge requests found
Pipeline #34633 failed with stage
in 8 minutes and 14 seconds
......@@ -167,6 +167,16 @@ class SparseLbMapper:
index_arr = index_array.reshape([len(stencil) - 1, self.num_fluid_cells])
index_arr = index_arr.swapaxes(0, 1)
return index_arr
def set_velocity(self, full_vel_arr): #macht aus full_vel_arr einen sparse vel_arr
# Erstmal ghost layers von data_handling herausfinden und wegschneiden...
ghost_layers = [(full_vel_arr.shape[i] - self.domain_size[i])//2 for i in range(0, full_vel_arr.shape[-1])]
full_vel_arr = full_vel_arr[ghost_layers[0]:-ghost_layers[0], ghost_layers[1]:-ghost_layers[1]]
# Dann initial velocities in sparsen vector schreiben
fluid_cell_arr = self.coordinates
arr = fluid_cell_arr[:self.num_fluid_cells]
sparse_vel_arr = full_vel_arr[arr['x'], arr['y']]
return sparse_vel_arr
class SparseLbPeriodicityMapper:
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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