ex3: task 6
This commit is contained in:
@@ -106,8 +106,12 @@ void time_step(void) {
|
||||
// Neumann (reflective) boundary condition.
|
||||
void boundary_condition(void) {
|
||||
// BEGIN: T6
|
||||
U(-1) = U(1);
|
||||
U(N) = U(N - 2);
|
||||
if (comm_rank == ROOT) {
|
||||
U(-1) = U(1);
|
||||
}
|
||||
if (comm_rank == comm_size - 1) {
|
||||
U(n) = U(n - 2);
|
||||
}
|
||||
// END: T6
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user