Skip to content

Commit

Permalink
Fix coordinates in et1d solid rust
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonis committed Jan 15, 2024
1 parent 55292e1 commit 1ee35d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions elastic-tube-1d/solid-rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn main() -> ExitCode {

const DOMAIN_SIZE: usize = 100;
const CHUNK_SIZE: usize = DOMAIN_SIZE + 1;
const TUBE_LENGTH: f64 = 10.0;

let mut participant = precice::Participant::new("Solid", &config, 0, 1);

Expand All @@ -44,11 +45,9 @@ fn main() -> ExitCode {
let grid_size = CHUNK_SIZE * dimensions as usize;
let grid: Vec<f64> = {
let mut v: Vec<f64> = vec![0_f64; grid_size];
const DX : f64 = TUBE_LENGTH / DOMAIN_SIZE as f64;
for i in 0..CHUNK_SIZE - 1 {
for j in 0..(dimensions as usize) - 1 {
let idx = i * dimensions as usize + j;
v[idx] = (i * (1 - j)) as f64;
}
v[i * dimensions as usize] = DX * i as f64;
}
v
};
Expand Down

0 comments on commit 1ee35d5

Please sign in to comment.