Tries to convert the parameters from one [Real] type to another [Real] type, returns `None` if conversion fails
(&self)
| 227 | |
| 228 | /// Tries to convert the parameters from one [Real] type to another [Real] type, returns `None` if conversion fails |
| 229 | pub fn try_convert<T: Real>(&self) -> Option<Parameters<T>> { |
| 230 | Some(Parameters { |
| 231 | particle_radius: self.particle_radius.try_convert()?, |
| 232 | rest_density: self.rest_density.try_convert()?, |
| 233 | compact_support_radius: self.compact_support_radius.try_convert()?, |
| 234 | cube_size: self.cube_size.try_convert()?, |
| 235 | iso_surface_threshold: self.iso_surface_threshold.try_convert()?, |
| 236 | particle_aabb: map_option!(&self.particle_aabb, aabb => aabb.try_convert()?), |
| 237 | enable_multi_threading: self.enable_multi_threading, |
| 238 | enable_simd: self.enable_simd, |
| 239 | spatial_decomposition: self.spatial_decomposition.clone(), |
| 240 | global_neighborhood_list: self.global_neighborhood_list, |
| 241 | }) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /// Result data returned when the surface reconstruction was successful |
no test coverage detected