commit df16288abb150656c54b2cdb3acbb4f9e39af1f7
parent 2b8fb8c7892e052ef12eaacf2dfda9291d51ebd5
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 12 Apr 2019 11:02:34 +0200
Fix length of domain when origo is non-zero
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/simulation.c b/simulation.c
@@ -5,7 +5,9 @@
void prepare_arrays(struct simulation* sim)
{
- sim->z = linspace(sim->origo_z, sim->L_z, sim->nz); /* spatial coordinates */
+ sim->z = linspace(sim->origo_z, /* spatial coordinates */
+ sim->origo_z + sim->L_z,
+ sim->nz);
sim->dz = sim->z[1] - sim->z[0]; /* cell spacing */
sim->mu = zeros(sim->nz); /* local stress ratio */
sim->p = zeros(sim->nz); /* local pressure */