Repurpose mat::Conductor to mat::Static
This will allow taking a material-independent snapshot of the SimState.
This commit is contained in:
@@ -8,11 +8,11 @@ fn main() {
|
||||
|
||||
for inset in 0..20 {
|
||||
for x in 0..width {
|
||||
*driver.state.get_mut(x, inset).mat_mut() = mat::Conductor { conductivity: 0.1*(20.0 - inset as f64) }.into();
|
||||
*driver.state.get_mut(x, inset).mat_mut() = mat::Static::conductor(0.1*(20.0 - inset as f64)).into();
|
||||
}
|
||||
for y in 0..100 {
|
||||
*driver.state.get_mut(inset, y).mat_mut() = mat::Conductor { conductivity: 0.1*(20.0 - inset as f64) }.into();
|
||||
*driver.state.get_mut(width-1 - inset, y).mat_mut() = mat::Conductor { conductivity: 0.1*(20.0 - inset as f64) }.into();
|
||||
*driver.state.get_mut(inset, y).mat_mut() = mat::Static::conductor(0.1*(20.0 - inset as f64)).into();
|
||||
*driver.state.get_mut(width-1 - inset, y).mat_mut() = mat::Static::conductor(0.1*(20.0 - inset as f64)).into();
|
||||
}
|
||||
}
|
||||
for y in 75..100 {
|
||||
@@ -21,7 +21,7 @@ fn main() {
|
||||
// NB: different sources give pretty different values for this
|
||||
// NB: Simulation misbehaves for values > 10... Proably this model isn't so great.
|
||||
// Maybe use \eps or \xi instead of conductivity.
|
||||
*driver.state.get_mut(x, y).mat_mut() = mat::Conductor { conductivity: 2.17 }.into();
|
||||
*driver.state.get_mut(x, y).mat_mut() = mat::Static::conductor(2.17).into();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user