clippy lints
This commit is contained in:
parent
d1151bbe3f
commit
d2c6d6af6c
|
@ -421,6 +421,7 @@ pub struct VortexParameters {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
#[allow(clippy::many_single_char_names)]
|
||||||
pub fn vortex(
|
pub fn vortex(
|
||||||
rho: ArrayViewMut1<Float>,
|
rho: ArrayViewMut1<Float>,
|
||||||
rhou: ArrayViewMut1<Float>,
|
rhou: ArrayViewMut1<Float>,
|
||||||
|
|
|
@ -130,16 +130,13 @@ impl System {
|
||||||
|
|
||||||
/// Suggested maximum dt for this problem
|
/// Suggested maximum dt for this problem
|
||||||
fn max_dt(&self) -> Float {
|
fn max_dt(&self) -> Float {
|
||||||
let c_max = if self.operators.iter().any(|op| {
|
let is_h2 = self.operators.iter().any(|op| {
|
||||||
op.as_ref().either(
|
op.as_ref().either(
|
||||||
|op| op.is_h2xi() || op.is_h2eta(),
|
|op| op.is_h2xi() || op.is_h2eta(),
|
||||||
|op| op.is_h2xi() || op.is_h2eta(),
|
|op| op.is_h2xi() || op.is_h2eta(),
|
||||||
)
|
)
|
||||||
}) {
|
});
|
||||||
0.5
|
let c_max = if is_h2 { 0.5 } else { 1.0 };
|
||||||
} else {
|
|
||||||
1.0
|
|
||||||
};
|
|
||||||
let mut max_dt: Float = Float::INFINITY;
|
let mut max_dt: Float = Float::INFINITY;
|
||||||
|
|
||||||
for (field, metrics) in self.fnow.iter().zip(self.metrics.iter()) {
|
for (field, metrics) in self.fnow.iter().zip(self.metrics.iter()) {
|
||||||
|
@ -220,7 +217,7 @@ fn main() {
|
||||||
op: operators,
|
op: operators,
|
||||||
integration_time,
|
integration_time,
|
||||||
vortex: vortexparams,
|
vortex: vortexparams,
|
||||||
} = config.to_runtime();
|
} = config.into_runtime();
|
||||||
|
|
||||||
let mut sys = System::new(grids, bt, operators);
|
let mut sys = System::new(grids, bt, operators);
|
||||||
sys.vortex(0.0, &vortexparams);
|
sys.vortex(0.0, &vortexparams);
|
||||||
|
|
|
@ -154,7 +154,7 @@ pub struct RuntimeConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Configuration {
|
impl Configuration {
|
||||||
pub fn to_runtime(mut self) -> RuntimeConfiguration {
|
pub fn into_runtime(mut self) -> RuntimeConfiguration {
|
||||||
let default = self.grids.shift_remove("default").unwrap_or_default();
|
let default = self.grids.shift_remove("default").unwrap_or_default();
|
||||||
let names = self.grids.keys().cloned().collect();
|
let names = self.grids.keys().cloned().collect();
|
||||||
let grids = self
|
let grids = self
|
||||||
|
|
|
@ -370,7 +370,7 @@ fn diff_op_col_simd(
|
||||||
for (iprev, &bl) in bl.iter().enumerate() {
|
for (iprev, &bl) in bl.iter().enumerate() {
|
||||||
f = index_to_simd(iprev).mul_adde(SimdT::splat(bl), f);
|
f = index_to_simd(iprev).mul_adde(SimdT::splat(bl), f);
|
||||||
}
|
}
|
||||||
f = f * idx;
|
f *= idx;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
f.write_to_slice_unaligned(std::slice::from_raw_parts_mut(
|
f.write_to_slice_unaligned(std::slice::from_raw_parts_mut(
|
||||||
|
@ -408,7 +408,7 @@ fn diff_op_col_simd(
|
||||||
let offset = ifut - half_diag_width + id;
|
let offset = ifut - half_diag_width + id;
|
||||||
f = index_to_simd(offset).mul_adde(SimdT::splat(d), f);
|
f = index_to_simd(offset).mul_adde(SimdT::splat(d), f);
|
||||||
}
|
}
|
||||||
f = f * idx;
|
f *= idx;
|
||||||
unsafe {
|
unsafe {
|
||||||
// puts simd along stride 1, j never goes past end of slice
|
// puts simd along stride 1, j never goes past end of slice
|
||||||
f.write_to_slice_unaligned(std::slice::from_raw_parts_mut(
|
f.write_to_slice_unaligned(std::slice::from_raw_parts_mut(
|
||||||
|
|
Loading…
Reference in New Issue