From 865f30b734f38b2c30cff57ea0513abb2d39afe0 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Sun, 26 Dec 2021 17:03:34 +0000 Subject: [PATCH 01/64] Remove duplicate io_info_arg_t --- src/field.c | 2 +- src/hydro.c | 2 +- src/io_harness.c | 7 +++++-- src/io_harness.h | 9 +-------- src/map.c | 2 +- src/noise.c | 2 +- src/psi.c | 2 +- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/field.c b/src/field.c index 0139d96a6..e0ee2d666 100644 --- a/src/field.c +++ b/src/field.c @@ -265,7 +265,7 @@ __host__ __device__ int field_nf(field_t * obj, int * nf) { __host__ int field_init_io_info(field_t * obj, int grid[3], int form_in, int form_out) { - io_info_arg_t args; + io_info_args_t args = {}; assert(obj); assert(obj->info == NULL); diff --git a/src/hydro.c b/src/hydro.c index 705bf11ec..3525a885c 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -295,7 +295,7 @@ __host__ int hydro_halo_swap(hydro_t * obj, hydro_halo_enum_t flag) { __host__ int hydro_init_io_info(hydro_t * obj, int grid[3], int form_in, int form_out) { - io_info_arg_t args; + io_info_args_t args = {}; assert(obj); assert(grid); diff --git a/src/io_harness.c b/src/io_harness.c index b44fca41c..6fca4f170 100644 --- a/src/io_harness.c +++ b/src/io_harness.c @@ -54,11 +54,14 @@ int io_unpack_local_buf(io_info_t * obj, int mpi_sender, const char * buf, * * io_info_create * - * Retrun a pointer to a new io_info_t with specified arguments. + * Return a pointer to a new io_info_t with specified arguments. + * + * This needs to be phased out in favour of version with implementation + * details. At the moment only arg->grid is used. * *****************************************************************************/ -int io_info_create(pe_t * pe, cs_t * cs, io_info_arg_t * arg, io_info_t ** p) { +int io_info_create(pe_t * pe, cs_t * cs, io_info_args_t * arg, io_info_t ** p) { io_info_t * info = NULL; diff --git a/src/io_harness.h b/src/io_harness.h index 6fd3ad549..5ade2f674 100644 --- a/src/io_harness.h +++ b/src/io_harness.h @@ -38,13 +38,6 @@ typedef struct io_info_s io_info_t; /* Callback signature for lattice site I/O */ typedef int (*io_rw_cb_ft)(FILE * fp, int index, void * self); -/* TO BE REMVOED */ -typedef struct io_info_arg_s io_info_arg_t; - -struct io_info_arg_s { - int grid[3]; /* Current */ -}; - struct io_implementation_s { char name[BUFSIZ]; /* Descriptive name */ io_rw_cb_ft write_ascii; /* Callback function for ascii write */ @@ -98,7 +91,7 @@ struct io_info_s { io_rw_cb_ft read_binary; }; -__host__ int io_info_create(pe_t * pe, cs_t * cs, io_info_arg_t * arg, +__host__ int io_info_create(pe_t * pe, cs_t * cs, io_info_args_t * arg, io_info_t ** pinfo); __host__ int io_info_free(io_info_t *); diff --git a/src/map.c b/src/map.c index e02f9edf8..c5ff3ed3e 100644 --- a/src/map.c +++ b/src/map.c @@ -214,7 +214,7 @@ __host__ int map_memcpy(map_t * map, tdpMemcpyKind flag) { __host__ int map_init_io_info(map_t * obj, int grid[3], int form_in, int form_out) { - io_info_arg_t args; + io_info_args_t args = {}; size_t sz; assert(obj); diff --git a/src/noise.c b/src/noise.c index f522c4602..696c90f5d 100644 --- a/src/noise.c +++ b/src/noise.c @@ -296,7 +296,7 @@ __host__ int noise_init_io_info(noise_t * obj, int grid[3], int form_in, const char * name = "Lattice noise RNG state"; const char * stubname = "noise"; - io_info_arg_t args; + io_info_args_t args = {}; assert(obj); diff --git a/src/psi.c b/src/psi.c index d68cfe549..48752c38f 100644 --- a/src/psi.c +++ b/src/psi.c @@ -255,7 +255,7 @@ int psi_diffusivity(psi_t * obj, int n, double * diff) { int psi_init_io_info(psi_t * obj, int grid[3], int form_in, int form_out) { - io_info_arg_t args; + io_info_args_t args = {}; assert(obj); assert(grid); From 34aa542ab633f6067535cb6f53f62da5d850be8b Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Sun, 26 Dec 2021 17:05:27 +0000 Subject: [PATCH 02/64] Move to unified initialisation of lb --- src/distribution_rt.c | 150 +++++++--- src/distribution_rt.h | 4 +- src/lb_data.h | 201 +++++++++++++ src/ludwig.c | 7 +- src/model.c | 650 +++++++++++++++++++++++++++++++++--------- 5 files changed, 823 insertions(+), 189 deletions(-) create mode 100644 src/lb_data.h diff --git a/src/distribution_rt.c b/src/distribution_rt.c index b2ed67c12..1222d59d0 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -24,7 +24,6 @@ #include "util.h" #include "runtime.h" #include "coords.h" -#include "lb_model_s.h" #include "io_info_args_rt.h" #include "distribution_rt.h" @@ -43,6 +42,32 @@ static int lb_init_uniform(lb_t * lb, double rho0, double u0[3]); static int lb_init_poiseuille(lb_t * lb, double rho0, const double umax[3]); +static int lb_ndist_rt(rt_t * rt); + +/***************************************************************************** + * + * lb_ndist_rt + * + * Determine the number of distributions required at run time. + * + *****************************************************************************/ + +int lb_ndist_rt(rt_t * rt) { + + int ndist = 1; + + assert(rt); + + { + /* The only exception ... */ + char description[BUFSIZ] = {}; + rt_string_parameter(rt, "free_energy", description, BUFSIZ); + if (strcmp(description, "symmetric_lb") == 0) ndist = 2; + } + + return ndist; +} + /***************************************************************************** * * lb_run_time @@ -77,15 +102,14 @@ static int lb_init_poiseuille(lb_t * lb, double rho0, * *****************************************************************************/ -int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb); +int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb); -int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { +int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { if (1) { lb_run_time_prev(pe, cs, rt, lb); } else { - /* Miscellaneous */ /* I/O */ @@ -93,14 +117,11 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { io_info_args_t rho_info = io_info_args_default(); io_info_args_rt(pe, rt, "lb", IO_INFO_READ_WRITE, &lb_info); - lb_io_info_commit(lb, lb_info); /* density is output only */ io_info_args_rt(pe, rt, "rho", IO_INFO_WRITE_ONLY, &rho_info); - /* lb_io_info_rho_commit(lb, rho_info); */ - /* Report to stdout */ } return 0; @@ -122,21 +143,23 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { * *****************************************************************************/ -int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { +int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { int ndist; int nreduced; int io_grid[3] = {1, 1, 1}; char string[FILENAME_MAX] = ""; char memory = ' '; - int form_in = IO_FORMAT_DEFAULT; - int form_out = IO_FORMAT_DEFAULT; + int lb_form_in = IO_FORMAT_DEFAULT; + int lb_form_out = IO_FORMAT_DEFAULT; int rho_wanted; - io_info_arg_t param; io_info_t * io_info = NULL; io_info_t * io_rho = NULL; + io_mode_enum_t lb_input_opt_mode = io_mode_default(); + lb_data_options_t options = lb_data_options_default(); + assert(pe); assert(cs); assert(rt); @@ -148,11 +171,6 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { rt_int_parameter_vector(rt, "distribution_io_grid", io_grid); - param.grid[X] = io_grid[X]; - param.grid[Y] = io_grid[Y]; - param.grid[Z] = io_grid[Z]; - io_info_create(pe, cs, ¶m, &io_info); - rt_string_parameter(rt,"distribution_io_format_input", string, FILENAME_MAX); @@ -160,7 +178,9 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { /* TODO: r -> "AOS" or "SOA" or "AOSOA" */ if (DATA_MODEL == DATA_MODEL_SOA) memory = 'R'; - lb_ndist(lb, &ndist); + + ndist = lb_ndist_rt(rt); + assert(ndist == 1 || ndist == 2); pe_info(pe, "\n"); pe_info(pe, "Lattice Boltzmann distributions\n"); @@ -173,11 +193,11 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { if (strcmp("BINARY_SERIAL", string) == 0) { pe_info(pe, "Input format: binary single serial file\n"); - io_info_set_processor_independent(io_info); + lb_input_opt_mode = IO_MODE_SINGLE; } else if (strcmp(string, "ASCII") == 0) { - form_in = IO_FORMAT_ASCII; - form_out = IO_FORMAT_ASCII; + lb_form_in = IO_FORMAT_ASCII; + lb_form_out = IO_FORMAT_ASCII; pe_info(pe, "Input format: ASCII\n"); pe_info(pe, "Output format: ASCII\n"); } @@ -188,8 +208,6 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { pe_info(pe, "I/O grid: %d %d %d\n", io_grid[X], io_grid[Y], io_grid[Z]); - lb_io_info_set(lb, io_info, form_in, form_out); - /* Density io_info: * * rho_io_wanted switch to indicate output wanted [no] @@ -198,42 +216,92 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb) { * rho_io_format ASCII/BINARY (default BINARY) * */ - form_in = IO_FORMAT_BINARY; - form_out = IO_FORMAT_BINARY; - io_grid[X] = 1; io_grid[Y] = 1; io_grid[Z] = 1; + int rho_form_in = IO_FORMAT_BINARY; + int rho_form_out = IO_FORMAT_BINARY; + io_info_args_t rhoio = io_info_args_default(); rho_wanted = rt_switch(rt, "rho_io_wanted"); - rt_int_parameter_vector(rt, "rho_io_grid", io_grid); + rt_int_parameter_vector(rt, "rho_io_grid", rhoio.grid); rt_string_parameter(rt,"rho_io_format", string, FILENAME_MAX); - param.grid[X] = io_grid[X]; - param.grid[Y] = io_grid[Y]; - param.grid[Z] = io_grid[Z]; - if (strcmp(string, "ASCII") == 0) { - form_in = IO_FORMAT_ASCII; - form_out = IO_FORMAT_ASCII; + rho_form_in = IO_FORMAT_ASCII; + rho_form_out = IO_FORMAT_ASCII; } - io_info_create(pe, cs, ¶m, &io_rho); - io_info_metadata_filestub_set(io_rho, "rho"); - lb_io_rho_set(lb, io_rho, form_in, form_out); - if (rho_wanted) { pe_info(pe, "Fluid density output\n"); - if (form_out==IO_FORMAT_ASCII) pe_info(pe, "Output format: ASCII\n"); - if (form_out==IO_FORMAT_BINARY) pe_info(pe, "Output format: binary\n"); + if (rho_form_out == IO_FORMAT_ASCII) { + pe_info(pe, "Output format: ASCII\n"); + } + if (rho_form_out == IO_FORMAT_BINARY) { + pe_info(pe, "Output format: binary\n"); + } pe_info(pe, "I/O grid: %d %d %d\n", - io_grid[X], io_grid[Y], io_grid[Z]); + rhoio.grid[X], rhoio.grid[Y], rhoio.grid[Z]); } + /* Initialise */ - lb_init(lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + + /* Halo options */ + if (nreduced == 1) options.halo = LB_HALO_REDUCED; + { + char htype[BUFSIZ] = {}; + int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); + if (strcmp(htype, "lb_halo_host") == 0) { + options.halo = LB_HALO_HOST; + } + else if (strcmp(htype, "lb_halo_target") == 0) { + options.halo = LB_HALO_TARGET; + } + else if (strcmp(htype, "lb_halo_full") == 0) { + options.halo = LB_HALO_FULL; + } + else if (strcmp(htype, "lb_halo_reduced") == 0) { + options.halo = LB_HALO_REDUCED; + } + else if (strcmp(htype, "lb_halo_openmp_full") == 0) { + options.halo = LB_HALO_OPENMP_FULL; + } + else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { + options.halo = LB_HALO_OPENMP_REDUCED; + } + else { + pe_fatal(pe, "lb_halo_scheme not recognised\n"); + } + if (havetype) { + pe_info(pe, "Halo scheme: %s\n", htype); + } + } + + lb_data_create(pe, cs, &options, lb); + + /* distribution i/o */ + { + io_info_args_t tmp = {}; + tmp.grid[X] = io_grid[X]; + tmp.grid[Y] = io_grid[Y]; + tmp.grid[Z] = io_grid[Z]; + io_info_create(pe, cs, &tmp, &io_info); + } io_info_metadata_filestub_set(io_info, "dist"); - if (nreduced == 1) lb_halo_set(lb, LB_HALO_REDUCED); + if (lb_input_opt_mode == IO_MODE_SINGLE) { + io_info_set_processor_independent(io_info); + } + lb_io_info_set(*lb, io_info, lb_form_in, lb_form_out); + + /* rho i/o */ + + io_info_create(pe, cs, &rhoio, &io_rho); + io_info_metadata_filestub_set(io_rho, "rho"); + lb_io_rho_set(*lb, io_rho, rho_form_in, rho_form_out); return 0; } diff --git a/src/distribution_rt.h b/src/distribution_rt.h index 229acd69d..a2db70b21 100644 --- a/src/distribution_rt.h +++ b/src/distribution_rt.h @@ -17,9 +17,9 @@ #include "coords.h" #include "runtime.h" #include "physics.h" -#include "model.h" +#include "lb_data.h" -int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t * lb); +int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb); int lb_rt_initial_conditions(pe_t * pe, rt_t * rt, lb_t * lb, physics_t * phys); #endif diff --git a/src/lb_data.h b/src/lb_data.h new file mode 100644 index 000000000..684ab8090 --- /dev/null +++ b/src/lb_data.h @@ -0,0 +1,201 @@ +/***************************************************************************** + * + * lb_data.h + * + * LB distribution data structure implementation. + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2014-2021 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#ifndef LB_DATA_H +#define LB_DATA_H + +#include + +#include "pe.h" +#include "coords.h" +#include "lb_data_options.h" +#include "lb_model.h" + +#include "io_harness.h" +#include "halo_swap.h" + +#ifdef _D2Q9_ +#include "d2q9.h" + +enum {NDIM = NDIM9, + NVEL = NVEL9, + CVXBLOCK = CVXBLOCK9, + CVYBLOCK = CVYBLOCK9, + CVZBLOCK = CVZBLOCK9}; +#endif + +#ifdef _D3Q15_ +#include "d3q15.h" + +enum {NDIM = NDIM15, + NVEL = NVEL15, + CVXBLOCK = CVXBLOCK15, + CVYBLOCK = CVYBLOCK15, + CVZBLOCK = CVZBLOCK15}; +#endif + +#ifdef _D3Q19_ + +#include "d3q19.h" + +enum {NDIM = NDIM19, + NVEL = NVEL19, + CVXBLOCK = CVXBLOCK19, + CVYBLOCK = CVYBLOCK19, + CVZBLOCK = CVZBLOCK19}; +#endif + +typedef struct lb_collide_param_s lb_collide_param_t; +typedef struct lb_halo_s lb_halo_t; +typedef struct lb_data_s lb_t; + +struct lb_collide_param_s { + int8_t isghost; /* switch for ghost modes */ + int8_t cv[NVEL][3]; + int nsite; + int ndist; + int nvel; + double rho0; + double eta_shear; + double var_shear; + double eta_bulk; + double var_bulk; + double rna[NVEL]; /* reciprocal of normaliser[p] */ + double rtau[NVEL]; + double wv[NVEL]; + double ma[NVEL][NVEL]; + double mi[NVEL][NVEL]; +}; + +struct lb_data_s { + + int ndim; + int nvel; + int ndist; /* Number of distributions (default one) */ + int nsite; /* Number of lattice sites (local) */ + + pe_t * pe; /* parallel environment */ + cs_t * cs; /* coordinate system */ + + lb_model_t model; /* Current LB model information */ + halo_swap_t * halo; /* halo swap driver */ + io_info_t * io_info; /* Distributions */ + io_info_t * io_rho; /* Fluid density (here; could be hydrodynamics...) */ + + double * f; /* Distributions */ + double * fprime; /* used in propagation only */ + + lb_collide_param_t * param; /* Collision parameters REFACTOR THIS */ + lb_relaxation_enum_t nrelax; /* Relaxation scheme */ + lb_halo_enum_t haloscheme; /* halo scheme */ + + /* MPI data types for halo swaps; these are comupted at runtime + * to conform to the model selected at compile time */ + + MPI_Datatype plane_xy_full; + MPI_Datatype plane_xz_full; + MPI_Datatype plane_yz_full; + MPI_Datatype plane_xy_reduced[2]; + MPI_Datatype plane_xz_reduced[2]; + MPI_Datatype plane_yz_reduced[2]; + MPI_Datatype plane_xy[2]; + MPI_Datatype plane_xz[2]; + MPI_Datatype plane_yz[2]; + MPI_Datatype site_x[2]; + MPI_Datatype site_y[2]; + MPI_Datatype site_z[2]; + + lb_t * target; /* copy of this structure on target */ +}; + +/* Data storage: A rank two object */ + +#include "memory.h" + +#define LB_ADDR(nsites, ndist, nvel, index, n, p) \ + addr_rank2(nsites, ndist, nvel, index, n, p) + +/* Number of hydrodynamic modes */ +enum {NHYDRO = 1 + NDIM + NDIM*(NDIM+1)/2}; + +/* Labels to locate relaxation times in array[NVEL] */ +/* Bulk viscosity is XX in stress */ +/* Shear is XY in stress */ + +enum {LB_TAU_BULK = 1 + NDIM + XX, LB_TAU_SHEAR = 1 + NDIM + XY}; + +#define LB_CS2_DOUBLE(cs2) const double cs2 = (1.0/3.0) +#define LB_RCS2_DOUBLE(rcs2) const double rcs2 = 3.0 + +typedef enum lb_dist_enum_type{LB_RHO = 0, LB_PHI = 1} lb_dist_enum_t; +typedef enum lb_mode_enum_type{LB_GHOST_ON = 0, LB_GHOST_OFF = 1} lb_mode_enum_t; + +__host__ int lb_data_create(pe_t * pe, cs_t * cs, + const lb_data_options_t * opts, lb_t ** lb); +__host__ int lb_free(lb_t * lb); +__host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag); +__host__ int lb_collide_param_commit(lb_t * lb); +__host__ int lb_halo(lb_t * lb); +__host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag); +__host__ int lb_halo_via_copy(lb_t * lb); +__host__ int lb_halo_via_struct(lb_t * lb); +__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t halo); +__host__ int lb_io_info(lb_t * lb, io_info_t ** io_info); +__host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int fin, int fout); +__host__ int lb_io_rho_set(lb_t *lb, io_info_t * io_rho, int fin, int fout); + +__host__ int lb_io_info_commit(lb_t * lb, io_info_args_t args); + +__host__ __device__ int lb_ndist(lb_t * lb, int * ndist); +__host__ __device__ int lb_f(lb_t * lb, int index, int p, int n, double * f); +__host__ __device__ int lb_f_set(lb_t * lb, int index, int p, int n, double f); +__host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, + double * rho); +/* These could be __host__ __device__ pending removal of + * static constants */ + +__host__ int lb_init_rest_f(lb_t * lb, double rho0); +__host__ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]); +__host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]); +__host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); +__host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); + +/* Halo */ + +#include "cs_limits.h" + +struct lb_halo_s { + + MPI_Comm comm; /* coords: Cartesian communicator */ + int nbrrank[3][3][3]; /* coords: neighbour rank look-up */ + int nlocal[3]; /* coords: local domain size */ + + lb_model_t map; /* Communication map 2d or 3d */ + int tagbase; /* send/recv tag */ + int full; /* All velocities at each site required. */ + int count[27]; /* halo: item data count per direction */ + cs_limits_t slim[27]; /* halo: send data region (rectangular) */ + cs_limits_t rlim[27]; /* halo: recv data region (rectangular) */ + double * send[27]; /* halo: send buffer per direction */ + double * recv[27]; /* halo: recv buffer per direction */ + MPI_Request request[2*27]; /* halo: array of requests */ + +}; + +int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full); +int lb_halo_free(lb_t * lb, lb_halo_t * h); + +#endif diff --git a/src/ludwig.c b/src/ludwig.c index de8624c90..16b619364 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -32,7 +32,6 @@ #include "control.h" #include "util.h" -#include "model.h" #include "model_le.h" #include "bbl.h" @@ -120,7 +119,6 @@ #include "fe_lc_stats.h" #include "fe_ternary_stats.h" -#include "lb_model_s.h" #include "field_s.h" #include "ludwig.h" @@ -241,7 +239,7 @@ static int ludwig_rt(ludwig_t * ludwig) { if (ludwig->psi) psi_petsc_init(ludwig->psi, ludwig->fe, ludwig->epsilon); #endif - lb_run_time(pe, cs, rt, ludwig->lb); + lb_run_time(pe, cs, rt, &ludwig->lb); collision_run_time(pe, rt, ludwig->lb, ludwig->noise_rho); map_init_rt(pe, cs, rt, &ludwig->map); @@ -1263,7 +1261,6 @@ int free_energy_init_rt(ludwig_t * ludwig) { rt = ludwig->rt; cs_create(pe,&cs); - lb_create(pe, cs, &ludwig->lb); noise_create(pe, cs, &ludwig->noise_rho); lees_edw_init_rt(rt, info); @@ -1369,8 +1366,6 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* Symmetric free energy via full lattice kintic equation */ - lb_ndist_set(ludwig->lb, 2); - nf = 1; /* 1 scalar order parameter */ nhalo = 1; /* Require one point for LB. */ ngrad = 2; /* \nabla^2 required */ diff --git a/src/model.c b/src/model.c index 30816c957..537cc01c3 100644 --- a/src/model.c +++ b/src/model.c @@ -28,8 +28,7 @@ #include "pe.h" #include "coords.h" -#include "model.h" -#include "lb_model_s.h" +#include "lb_data.h" #include "io_harness.h" #include "util.h" @@ -44,61 +43,87 @@ static int lb_f_write_ascii(FILE *, int index, void * self); static int lb_rho_write(FILE *, int index, void * self); static int lb_rho_write_ascii(FILE *, int index, void * self); static int lb_model_param_init(lb_t * lb); +static int lb_init(lb_t * lb); static __constant__ lb_collide_param_t static_param; -/**************************************************************************** - * - * lb_create_ndist +/***************************************************************************** * - * Allocate memory for lb_data_s only. + * lb_data_create * - ****************************************************************************/ + *****************************************************************************/ -__host__ int lb_create_ndist(pe_t * pe, cs_t * cs, int ndist, lb_t ** plb) { +int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, + lb_t ** lb) { - lb_t * lb = NULL; + lb_t * obj = NULL; assert(pe); assert(cs); - assert(ndist > 0); - assert(plb); - - lb = (lb_t *) calloc(1, sizeof(lb_t)); + assert(options); assert(lb); - if (lb == NULL) pe_fatal(pe, "calloc(1, lb_t) failed\n"); - lb->param = (lb_collide_param_t *) calloc(1, sizeof(lb_collide_param_t)); - if (lb->param == NULL) pe_fatal(pe, "calloc(1, lb_collide_param_t) failed\n"); + obj = (lb_t *) calloc(1, sizeof(lb_t)); + assert(obj); + if (obj == NULL) pe_fatal(pe, "calloc(1, lb_t) failed\n"); - lb->pe = pe; - lb->cs = cs; - lb->ndist = ndist; - lb->nrelax = LB_RELAXATION_M10; + /* Check options. An internal error if we haven't sanitised the options... */ - /* Compile time via NVEL at the moment. */ - lb_model_create(NVEL, &lb->model); + if (lb_data_options_valid(options) == 0) { + pe_fatal(pe, "Internal error: lb_data_options not valid.\n"); + } - *plb = lb; + obj->pe = pe; + obj->cs = cs; + obj->ndim = options->ndim; + obj->nvel = options->nvel; + obj->ndist = options->ndist; + obj->nrelax = options->nrelax; + obj->haloscheme = options->halo; - return 0; -} + lb_model_create(obj->nvel, &obj->model); -/***************************************************************************** - * - * lb_create - * - * Default ndist = 1 - * - *****************************************************************************/ + /* Storage */ + + { + /* Allocate storage following cs specification */ + int nhalo = 1; + int nlocal[3] = {}; + cs_nhalo(cs, &nhalo); + cs_nlocal(cs, nlocal); + + { + int nx = nlocal[X] + 2*nhalo; + int ny = nlocal[Y] + 2*nhalo; + int nz = nlocal[Z] + 2*nhalo; + obj->nsite = nx*ny*nz; + } + { + size_t sz = sizeof(double)*obj->nsite*obj->ndist*obj->nvel; + assert(sz > 0); /* Should not overflow in size_t I hope! */ + obj->f = (double *) mem_aligned_malloc(MEM_PAGESIZE, sz); + obj->fprime = (double *) mem_aligned_malloc(MEM_PAGESIZE, sz); + assert(obj->f); + assert(obj->fprime); + if (obj->f == NULL) pe_fatal(pe, "malloc(lb->f) failed\n"); + if (obj->fprime == NULL) pe_fatal(pe, "malloc(lb->fprime) failed\n"); + memset(obj->f, 0, sz); + memset(obj->fprime, 0, sz); + } + } -__host__ int lb_create(pe_t * pe, cs_t * cs, lb_t ** plb) { + /* Collision parameters. This is fixed-size struct could not allocate...*/ + obj->param = (lb_collide_param_t *) calloc(1, sizeof(lb_collide_param_t)); + assert(obj->param); + if (obj->param == NULL) { + pe_fatal(pe, "calloc(1, lb_collide_param_t) failed\n"); + } - assert(pe); - assert(cs); - assert(plb); + lb_init(obj); + + *lb = obj; - return lb_create_ndist(pe, cs, 1, plb); + return 0; } /***************************************************************************** @@ -213,7 +238,7 @@ __host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag) { * ***************************************************************************/ -__host__ int lb_init(lb_t * lb) { +static int lb_init(lb_t * lb) { int nlocal[3]; int nx, ny, nz; @@ -236,23 +261,6 @@ __host__ int lb_init(lb_t * lb) { /* The total number of distribution data is then... */ ndata = lb->nsite*lb->ndist*lb->model.nvel; -#ifdef OLD_DATA - lb->f = (double *) calloc(ndata, sizeof(double)); - if (lb->f == NULL) pe_fatal(lb->pe, "malloc(distributions) failed\n"); - - lb->fprime = (double *) calloc(ndata, sizeof(double)); - if (lb->fprime == NULL) pe_fatal(lb->pe, "malloc(distributions) failed\n"); -#else - lb->f = (double *) mem_aligned_malloc(MEM_PAGESIZE, ndata*sizeof(double)); - if (lb->f == NULL) pe_fatal(lb->pe, "malloc(distributions) failed\n"); - memset(lb->f, 0, ndata*sizeof(double)); - - lb->fprime = (double *) mem_aligned_malloc(MEM_PAGESIZE, ndata*sizeof(double)); - if (lb->fprime == NULL) pe_fatal(lb->pe, "malloc(distributions) failed\n"); - memset(lb->fprime, 0, ndata*sizeof(double)); -#endif - - /* Allocate target copy of structure or alias */ tdpGetDeviceCount(&ndevice); @@ -285,21 +293,21 @@ __host__ int lb_init(lb_t * lb) { * in XZ plane nx blocks of nz sites with stride ny*nz; * in YZ plane one contiguous block of ny*nz sites. */ - MPI_Type_vector(nx*ny, lb->ndist*NVEL*nhalolocal, lb->ndist*NVEL*nz, + MPI_Type_vector(nx*ny, lb->ndist*lb->nvel*nhalolocal, lb->ndist*lb->nvel*nz, MPI_DOUBLE, &lb->plane_xy_full); MPI_Type_commit(&lb->plane_xy_full); - MPI_Type_vector(nx, lb->ndist*NVEL*nz*nhalolocal, lb->ndist*NVEL*ny*nz, + MPI_Type_vector(nx, lb->ndist*lb->nvel*nz*nhalolocal, + lb->ndist*lb->nvel*ny*nz, MPI_DOUBLE, &lb->plane_xz_full); MPI_Type_commit(&lb->plane_xz_full); - MPI_Type_vector(1, lb->ndist*NVEL*ny*nz*nhalolocal, 1, MPI_DOUBLE, + MPI_Type_vector(1, lb->ndist*lb->nvel*ny*nz*nhalolocal, 1, MPI_DOUBLE, &lb->plane_yz_full); MPI_Type_commit(&lb->plane_yz_full); lb_mpi_init(lb); lb_model_param_init(lb); - lb_halo_set(lb, LB_HALO_FULL); lb_memcpy(lb, tdpMemcpyHostToDevice); return 0; @@ -415,6 +423,7 @@ static int lb_mpi_init(lb_t * lb) { MPI_Datatype tmpf, tmpb; assert(lb); + assert(CVXBLOCK > 0); cs_nhalo(lb->cs, &nhalo); cs_nlocal(lb->cs, nlocal); @@ -424,7 +433,7 @@ static int lb_mpi_init(lb_t * lb) { nz = nlocal[Z] + 2*nhalo; /* extent of single site (AOS) */ - extent = NVEL*lb->ndist*sizeof(double); + extent = lb->nvel*lb->ndist*sizeof(double); /* X direction */ @@ -537,7 +546,8 @@ static int lb_mpi_init(lb_t * lb) { free(disp_bwd); free(types); - halo_swap_create_r2(lb->pe, lb->cs, 1, lb->nsite, lb->ndist, NVEL,&lb->halo); + halo_swap_create_r2(lb->pe, lb->cs, 1, lb->nsite, lb->ndist, lb->nvel, + &lb->halo); halo_swap_handlers_set(lb->halo, halo_swap_pack_rank1, halo_swap_unpack_rank1); return 0; @@ -610,7 +620,7 @@ static int lb_set_displacements(lb_t * lb, int ndisp, MPI_Aint * disp, for (n = 0; n < lb->ndist; n++) { for (p = 0; p < nbasic; p++) { - MPI_Get_address(lb->f + n*NVEL + disp_basic[p], &disp1); + MPI_Get_address(lb->f + n*lb->nvel + disp_basic[p], &disp1); disp[n*nbasic + p] = disp1 - disp0; } } @@ -631,14 +641,15 @@ __host__ int lb_io_info_commit(lb_t * lb, io_info_args_t args) { assert(lb); assert(lb->io_info == NULL); - sprintf(impl.name, "%1d x Distribution: d%dq%d", lb->ndist, NDIM, NVEL); + sprintf(impl.name, "%1d x Distribution: d%dq%d", lb->ndist, lb->ndim, + lb->nvel); impl.write_ascii = lb_f_write_ascii; impl.read_ascii = lb_f_read_ascii; impl.write_binary = lb_f_write; impl.read_binary = lb_f_read; impl.bytesize_ascii = 0; /* HOW MANY BYTES! */ - impl.bytesize_binary = lb->ndist*NVEL*sizeof(double); + impl.bytesize_binary = lb->ndist*lb->nvel*sizeof(double); io_info_create_impl(lb->pe, lb->cs, args, &impl, &lb->io_info); @@ -660,12 +671,13 @@ __host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int form_in, int for lb->io_info = io_info; - sprintf(string, "%1d x Distribution: d%dq%d", lb->ndist, NDIM, NVEL); + sprintf(string, "%1d x Distribution: d%dq%d", lb->ndist, lb->ndim, lb->nvel); io_info_set_name(lb->io_info, string); io_info_read_set(lb->io_info, IO_FORMAT_BINARY, lb_f_read); io_info_write_set(lb->io_info, IO_FORMAT_BINARY, lb_f_write); - io_info_set_bytesize(lb->io_info, IO_FORMAT_BINARY, lb->ndist*NVEL*sizeof(double)); + io_info_set_bytesize(lb->io_info, IO_FORMAT_BINARY, + lb->ndist*lb->nvel*sizeof(double)); io_info_read_set(lb->io_info, IO_FORMAT_ASCII, lb_f_read_ascii); io_info_write_set(lb->io_info, IO_FORMAT_ASCII, lb_f_write_ascii); io_info_format_set(lb->io_info, form_in, form_out); @@ -732,7 +744,7 @@ __host__ int lb_halo(lb_t * lb) { assert(lb); - lb_halo_swap(lb, LB_HALO_TARGET); + lb_halo_swap(lb, lb->haloscheme); return 0; } @@ -772,6 +784,20 @@ __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag) { lb_halo_set(lb, LB_HALO_REDUCED); lb_halo_via_struct(lb); break; + case LB_HALO_OPENMP_FULL: + { + lb_halo_t h = {}; + lb_halo_create(lb, &h, 1); + lb_halo_free(lb, &h); + } + break; + case LB_HALO_OPENMP_REDUCED: + { + lb_halo_t h = {}; + lb_halo_create(lb, &h, 0); + lb_halo_free(lb, &h); + } + break; default: /* Should not be here... */ assert(0); @@ -803,6 +829,7 @@ __host__ int lb_halo_via_struct(lb_t * lb) { int nlocal[3]; int mpi_cartsz[3]; int periodic[3]; + int persite; const int tagf = 900; const int tagb = 901; @@ -813,6 +840,8 @@ __host__ int lb_halo_via_struct(lb_t * lb) { assert(lb); + persite = lb->ndist*lb->nvel; + cs_nhalo(lb->cs, &nhalo); cs_nlocal(lb->cs, nlocal); cs_cart_comm(lb->cs, &comm); @@ -826,13 +855,13 @@ __host__ int lb_halo_via_struct(lb_t * lb) { for (jc = 1; jc <= nlocal[Y]; jc++) { for (kc = 1; kc <= nlocal[Z]; kc++) { - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 0, jc, kc); - ireal = lb->ndist*NVEL*cs_index(lb->cs, nlocal[X], jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, 0, jc, kc); + ireal = persite*cs_index(lb->cs, nlocal[X], jc, kc); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, nlocal[X]+1, jc, kc); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1, jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, nlocal[X]+1, jc, kc); + ireal = persite*cs_index(lb->cs, 1, jc, kc); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); } } } @@ -840,16 +869,16 @@ __host__ int lb_halo_via_struct(lb_t * lb) { else { pforw = cs_cart_neighb(lb->cs, CS_FORW, X); pback = cs_cart_neighb(lb->cs, CS_BACK, X); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, nlocal[X] + 1, 1 - nhalo, 1 - nhalo); + ihalo = persite*cs_index(lb->cs, nlocal[X] + 1, 1 - nhalo, 1 - nhalo); MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[BACKWARD], pforw, tagb, comm, &request[0]); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 0, 1 - nhalo, 1 - nhalo); + ihalo = persite*cs_index(lb->cs, 0, 1 - nhalo, 1 - nhalo); MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[FORWARD], pback, tagf, comm, &request[1]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1, 1-nhalo, 1-nhalo); + ireal = persite*cs_index(lb->cs, 1, 1-nhalo, 1-nhalo); MPI_Issend(lb->f + ireal, 1, lb->plane_yz[BACKWARD], pback, tagb, comm, &request[2]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, nlocal[X], 1-nhalo, 1-nhalo); + ireal = persite*cs_index(lb->cs, nlocal[X], 1-nhalo, 1-nhalo); MPI_Issend(lb->f + ireal, 1, lb->plane_yz[FORWARD], pforw, tagf, comm, &request[3]); MPI_Waitall(4, request, status); @@ -862,13 +891,13 @@ __host__ int lb_halo_via_struct(lb_t * lb) { for (ic = 0; ic <= nlocal[X] + 1; ic++) { for (kc = 1; kc <= nlocal[Z]; kc++) { - ihalo = lb->ndist*NVEL*cs_index(lb->cs, ic, 0, kc); - ireal = lb->ndist*NVEL*cs_index(lb->cs, ic, nlocal[Y], kc); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, ic, 0, kc); + ireal = persite*cs_index(lb->cs, ic, nlocal[Y], kc); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - ireal = lb->ndist*NVEL*cs_index(lb->cs, ic, 1, kc); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, ic, nlocal[Y] + 1, kc); + ireal = persite*cs_index(lb->cs, ic, 1, kc); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); } } } @@ -876,16 +905,16 @@ __host__ int lb_halo_via_struct(lb_t * lb) { else { pforw = cs_cart_neighb(lb->cs, CS_FORW, Y); pback = cs_cart_neighb(lb->cs, CS_BACK, Y); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, nlocal[Y] + 1, 1 - nhalo); + ihalo = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y] + 1, 1 - nhalo); MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[BACKWARD], pforw, tagb, comm, &request[0]); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 0, 1 - nhalo); + ihalo = persite*cs_index(lb->cs, 1 - nhalo, 0, 1 - nhalo); MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[FORWARD], pback, tagf, comm, &request[1]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 1, 1 - nhalo); + ireal = persite*cs_index(lb->cs, 1 - nhalo, 1, 1 - nhalo); MPI_Issend(lb->f + ireal, 1, lb->plane_xz[BACKWARD], pback, tagb, comm, &request[2]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, nlocal[Y], 1 - nhalo); + ireal = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y], 1 - nhalo); MPI_Issend(lb->f + ireal, 1, lb->plane_xz[FORWARD], pforw, tagf, comm, &request[3]); MPI_Waitall(4, request, status); @@ -898,13 +927,13 @@ __host__ int lb_halo_via_struct(lb_t * lb) { for (ic = 0; ic <= nlocal[X] + 1; ic++) { for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - ihalo = lb->ndist*NVEL*cs_index(lb->cs, ic, jc, 0); - ireal = lb->ndist*NVEL*cs_index(lb->cs, ic, jc, nlocal[Z]); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, ic, jc, 0); + ireal = persite*cs_index(lb->cs, ic, jc, nlocal[Z]); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - ireal = lb->ndist*NVEL*cs_index(lb->cs, ic, jc, 1); - memcpy(lb->f + ihalo, lb->f + ireal, lb->ndist*NVEL*sizeof(double)); + ihalo = persite*cs_index(lb->cs, ic, jc, nlocal[Z] + 1); + ireal = persite*cs_index(lb->cs, ic, jc, 1); + memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); } } } @@ -912,16 +941,16 @@ __host__ int lb_halo_via_struct(lb_t * lb) { else { pforw = cs_cart_neighb(lb->cs, CS_FORW, Z); pback = cs_cart_neighb(lb->cs, CS_BACK, Z); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z] + 1); + ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z] + 1); MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[BACKWARD], pforw, tagb, comm, &request[0]); - ihalo = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 0); + ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 0); MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[FORWARD], pback, tagf, comm, &request[1]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 1); + ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 1); MPI_Issend(lb->f + ireal, 1, lb->plane_xy[BACKWARD], pback, tagb, comm, &request[2]); - ireal = lb->ndist*NVEL*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z]); + ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z]); MPI_Issend(lb->f + ireal, 1, lb->plane_xy[FORWARD], pforw, tagf, comm, &request[3]); MPI_Waitall(4, request, status); @@ -1184,26 +1213,6 @@ __host__ __device__ int lb_ndist(lb_t * lb, int * ndist) { return 0; } -/***************************************************************************** - * - * lb_ndist_set - * - * Set the number of distribution functions to be used. - * This needs to occur between create() and init() - * - *****************************************************************************/ - -__host__ int lb_ndist_set(lb_t * lb, int n) { - - assert(lb); - assert(n > 0); - assert(lb->f == NULL); /* don't change after initialisation */ - - lb->ndist = n; - - return 0; -} - /***************************************************************************** * * lb_f @@ -1217,10 +1226,10 @@ int lb_f(lb_t * lb, int index, int p, int n, double * f) { assert(lb); assert(index >= 0 && index < lb->nsite); - assert(p >= 0 && p < NVEL); + assert(p >= 0 && p < lb->nvel); assert(n >= 0 && n < lb->ndist); - *f = lb->f[LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p)]; + *f = lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p)]; return 0; } @@ -1238,10 +1247,10 @@ int lb_f_set(lb_t * lb, int index, int p, int n, double fvalue) { assert(lb); assert(index >= 0 && index < lb->nsite); - assert(p >= 0 && p < NVEL); + assert(p >= 0 && p < lb->nvel); assert(n >= 0 && n < lb->ndist); - lb->f[LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p)] = fvalue; + lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p)] = fvalue; return 0; } @@ -1266,8 +1275,8 @@ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, double * rho) { *rho = 0.0; - for (p = 0; p < NVEL; p++) { - *rho += lb->f[LB_ADDR(lb->nsite, lb->ndist, NVEL, index, nd, p)]; + for (p = 0; p < lb->nvel; p++) { + *rho += lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, nd, p)]; } return 0; @@ -1299,7 +1308,7 @@ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]) { for (p = 0; p < lb->model.nvel; p++) { for (n = 0; n < lb->model.ndim; n++) { g[n] += lb->model.cv[p][n] - *lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->model.nvel, index, nd, p)]; + *lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, nd, p)]; } } @@ -1335,7 +1344,7 @@ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]) { double f = 0.0; double cs2 = lb->model.cs2; double dab = (ia == ib); - f = lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->model.nvel, index, nd, p)]; + f = lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, nd, p)]; s[ia][ib] += f*(lb->model.cv[p][ia]*lb->model.cv[p][ib] - cs2*dab); } } @@ -1365,7 +1374,7 @@ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho) { for (p = 0; p < lb->model.nvel; p++) { double f = lb->model.wv[p]*rho; - lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->model.nvel, index, n, p)] = f; + lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p)] = f; } return 0; @@ -1400,7 +1409,7 @@ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]) { } } - lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->model.nvel, index, LB_RHO, p)] + lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, LB_RHO, p)] = rho*lb->model.wv[p]*(1.0 + rcs2*udotc + 0.5*rcs2*rcs2*sdotq); } @@ -1413,7 +1422,7 @@ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]) { * * A version of the halo swap which uses a flat buffer to copy the * relevant data rathar than MPI data types. It is therefore a 'full' - * halo swapping NVEL distributions at each site. + * halo swapping nvel distributions at each site. * * It works for both MODEL and MODEL_R, but the loop order favours * MODEL_R. @@ -1469,11 +1478,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (kc = 1; kc <= nlocal[Z]; kc++) { index = cs_index(lb->cs, nlocal[X], jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendforw[count] = lb->f[indexreal]; index = cs_index(lb->cs, 1, jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendback[count] = lb->f[indexreal]; ++count; } @@ -1508,11 +1517,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (kc = 1; kc <= nlocal[Z]; kc++) { index = cs_index(lb->cs, 0, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvback[count]; index = cs_index(lb->cs, nlocal[X] + 1, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvforw[count]; ++count; } @@ -1552,11 +1561,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (kc = 1; kc <= nlocal[Z]; kc++) { index = cs_index(lb->cs, ic, nlocal[Y], kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendforw[count] = lb->f[indexreal]; index = cs_index(lb->cs, ic, 1, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendback[count] = lb->f[indexreal]; ++count; } @@ -1592,11 +1601,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (kc = 1; kc <= nlocal[Z]; kc++) { index = cs_index(lb->cs, ic, 0, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvback[count]; index = cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvforw[count]; ++count; } @@ -1634,11 +1643,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (jc = 0; jc <= nlocal[Y] + 1; jc++) { index = cs_index(lb->cs, ic, jc, nlocal[Z]); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendforw[count] = lb->f[indexreal]; index = cs_index(lb->cs, ic, jc, 1); - indexreal = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); sendback[count] = lb->f[indexreal]; ++count; } @@ -1673,11 +1682,11 @@ __host__ int lb_halo_via_copy(lb_t * lb) { for (jc = 0; jc <= nlocal[Y] + 1; jc++) { index = cs_index(lb->cs, ic, jc, 0); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvback[count]; index = cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, NVEL, index, n, p); + indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); lb->f[indexhalo] = recvforw[count]; ++count; } @@ -1698,3 +1707,364 @@ __host__ int lb_halo_via_copy(lb_t * lb) { return 0; } + +/* We will not exceed 27 directions! Direction index 0, in keeping + * with the LB model definition, is (0,0,0) - so no communication. */ + +/***************************************************************************** + * + * lb_halo_size + * + * Utility to compute a number of sites from cs_limits_t. + * + *****************************************************************************/ + +int lb_halo_size(cs_limits_t lim) { + + int szx = 1 + lim.imax - lim.imin; + int szy = 1 + lim.jmax - lim.jmin; + int szz = 1 + lim.kmax - lim.kmin; + + return szx*szy*szz; +} + +/***************************************************************************** + * + * lb_halo_enqueue_send + * + * Pack the send buffer. The ireq determines the direction of the + * communication. + * + *****************************************************************************/ + +int lb_halo_enqueue_send(const lb_t * lb, const lb_halo_t * h, int ireq) { + + assert(1 <= ireq && ireq < h->map.nvel); + assert(lb->ndist == 1); + + if (h->count[ireq] > 0) { + + int8_t mx = h->map.cv[ireq][X]; + int8_t my = h->map.cv[ireq][Y]; + int8_t mz = h->map.cv[ireq][Z]; + int8_t mm = mx*mx + my*my + mz*mz; + + int ib = 0; /* Buffer index */ + + assert(mm == 1 || mm == 2 || mm == 3); + + for (int ic = h->slim[ireq].imin; ic <= h->slim[ireq].imax; ic++) { + for (int jc = h->slim[ireq].jmin; jc <= h->slim[ireq].jmax; jc++) { + for (int kc = h->slim[ireq].kmin; kc <= h->slim[ireq].kmax; kc++) { + /* If full, we need p = 0 */ + for (int p = 0; p < lb->nvel; p++) { + int8_t px = lb->model.cv[p][X]; + int8_t py = lb->model.cv[p][Y]; + int8_t pz = lb->model.cv[p][Z]; + int dot = mx*px + my*py + mz*pz; + if (h->full || dot == mm) { + int index = cs_index(lb->cs, ic, jc, kc); + int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); + h->send[ireq][ib++] = lb->f[laddr]; + } + } + } + } + } + assert(ib == h->count[ireq]*lb_halo_size(h->slim[ireq])); + } + + return 0; +} + +/***************************************************************************** + * + * lb_halo_dequeue_recv + * + * Unpack the recv buffer into place in the distributions. + * + *****************************************************************************/ + +int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { + + assert(lb); + assert(h); + assert(0 < ireq && ireq < h->map.nvel); + assert(lb->ndist == 1); + + if (h->count[ireq] > 0) { + + /* The communication direction is reversed cf. the send... */ + int8_t mx = h->map.cv[h->map.nvel-ireq][X]; + int8_t my = h->map.cv[h->map.nvel-ireq][Y]; + int8_t mz = h->map.cv[h->map.nvel-ireq][Z]; + int8_t mm = mx*mx + my*my + mz*mz; + + int ib = 0; /* Buffer index */ + double * recv = h->recv[ireq]; + + { + int i = 1 + mx; + int j = 1 + my; + int k = 1 + mz; + /* If Cartesian neighbour is self, just copy out of send buffer. */ + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) recv = h->send[ireq]; + } + + assert(mm == 1 || mm == 2 || mm == 3); + + for (int ic = h->rlim[ireq].imin; ic <= h->rlim[ireq].imax; ic++) { + for (int jc = h->rlim[ireq].jmin; jc <= h->rlim[ireq].jmax; jc++) { + for (int kc = h->rlim[ireq].kmin; kc <= h->rlim[ireq].kmax; kc++) { + for (int p = 0; p < lb->nvel; p++) { + /* For reduced swap, we must have -cv[p] here... */ + int8_t px = lb->model.cv[lb->nvel-p][X]; + int8_t py = lb->model.cv[lb->nvel-p][Y]; + int8_t pz = lb->model.cv[lb->nvel-p][Z]; + int dot = mx*px + my*py + mz*pz; + if (h->full || dot == mm) { + int index = cs_index(lb->cs, ic, jc, kc); + int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); + lb->f[laddr] = recv[ib++]; + } + } + } + } + } + assert(ib == h->count[ireq]*lb_halo_size(h->rlim[ireq])); + } + + return 0; +} + +/***************************************************************************** + * + * lb_halo_create + * + * Currently: generate all send and receive requests. + * + *****************************************************************************/ + +int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { + + assert(lb); + assert(h); + + *h = (lb_halo_t) {0}; + + /* Communication model */ + if (lb->model.ndim == 2) lb_model_create( 9, &h->map); + if (lb->model.ndim == 3) lb_model_create(27, &h->map); + + assert(lb->model.ndim == 2 || lb->model.ndim == 3); + assert(h->map.ndim == lb->model.ndim); + + cs_nlocal(lb->cs, h->nlocal); + cs_cart_comm(lb->cs, &h->comm); + h->tagbase = 211216; + h->full = full; + + /* Determine look-up table of ranks of neighbouring processes */ + { + int dims[3] = {}; + int periods[3] = {}; + int coords[3] = {}; + + MPI_Cart_get(h->comm, h->map.ndim, dims, periods, coords); + + for (int p = 0; p < h->map.nvel; p++) { + int nbr[3] = {}; + int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int i = 1 + h->map.cv[p][X]; + int j = 1 + h->map.cv[p][Y]; + int k = 1 + h->map.cv[p][Z]; + + nbr[X] = coords[X] + h->map.cv[p][X]; + nbr[Y] = coords[Y] + h->map.cv[p][Y]; + nbr[Z] = coords[Z] + h->map.cv[p][Z]; + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + + if (out[X] || out[Y] || out[Z]) { + h->nbrrank[i][j][k] = MPI_PROC_NULL; + } + else { + MPI_Cart_rank(h->comm, nbr, &h->nbrrank[i][j][k]); + } + } + /* I must be in the middle */ + assert(h->nbrrank[1][1][1] == cs_cart_rank(lb->cs)); + } + + + /* Limits of the halo regions in each communication direction */ + + for (int p = 1; p < h->map.nvel; p++) { + + /* Limits for send and recv regions*/ + int8_t cx = h->map.cv[p][X]; + int8_t cy = h->map.cv[p][Y]; + int8_t cz = h->map.cv[p][Z]; + + cs_limits_t send = {1, h->nlocal[X], 1, h->nlocal[Y], 1, h->nlocal[Z]}; + cs_limits_t recv = {1, h->nlocal[X], 1, h->nlocal[Y], 1, h->nlocal[Z]}; + + if (cx == -1) send.imax = 1; + if (cx == +1) send.imin = send.imax; + if (cy == -1) send.jmax = 1; + if (cy == +1) send.jmin = send.jmax; + if (cz == -1) send.kmax = 1; + if (cz == +1) send.kmin = send.kmax; + + /* velocity is reversed... */ + if (cx == +1) recv.imax = recv.imin = 0; + if (cx == -1) recv.imin = recv.imax = recv.imax + 1; + if (cy == +1) recv.jmax = recv.jmin = 0; + if (cy == -1) recv.jmin = recv.jmax = recv.jmax + 1; + if (cz == +1) recv.kmax = recv.kmin = 0; + if (cz == -1) recv.kmin = recv.kmax = recv.kmax + 1; + + h->slim[p] = send; + h->rlim[p] = recv; + } + + /* Message count (velocities) for each communication direction */ + + for (int p = 1; p < h->map.nvel; p++) { + + int count = 0; + + if (h->full) { + count = lb->model.nvel; + } + else { + int8_t mx = h->map.cv[p][X]; + int8_t my = h->map.cv[p][Y]; + int8_t mz = h->map.cv[p][Z]; + int8_t mm = mx*mx + my*my + mz*mz; + + /* Consider each model velocity in turn */ + for (int q = 1; q < lb->model.nvel; q++) { + int8_t qx = lb->model.cv[q][X]; + int8_t qy = lb->model.cv[q][Y]; + int8_t qz = lb->model.cv[q][Z]; + int8_t dot = mx*qx + my*qy + mz*qz; + + if (mm == 3 && dot == mm) count +=1; /* This is a corner */ + if (mm == 2 && dot == mm) count +=1; /* This is an edge */ + if (mm == 1 && dot == mm) count +=1; /* This is a side */ + } + } + + h->count[p] = count; + /* Allocate send buffer for send region */ + if (count > 0) { + int scount = count*lb_halo_size(h->slim[p]); + h->send[p] = (double *) malloc(scount*sizeof(double)); + assert(h->send[p]); + } + /* Allocate recv buffer */ + if (count > 0) { + int rcount = count*lb_halo_size(h->rlim[p]); + h->recv[p] = (double *) malloc(rcount*sizeof(double)); + assert(h->recv[p]); + } + } + + /* Post recvs (from opposite direction cf send) */ + + for (int ireq = 0; ireq < h->map.nvel; ireq++) { + + h->request[ireq] = MPI_REQUEST_NULL; + + if (h->count[ireq] > 0) { + int i = 1 + h->map.cv[h->map.nvel-ireq][X]; + int j = 1 + h->map.cv[h->map.nvel-ireq][Y]; + int k = 1 + h->map.cv[h->map.nvel-ireq][Z]; + int mcount = h->count[ireq]*lb_halo_size(h->rlim[ireq]); + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + MPI_Irecv(h->recv[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + h->tagbase + ireq, h->comm, h->request + ireq); + } + } + + /* Enqueue sends (second half of request array) */ + + #pragma omp parallel for schedule(dynamic, 1) + for (int ireq = 0; ireq < h->map.nvel; ireq++) { + + h->request[27+ireq] = MPI_REQUEST_NULL; + + if (h->count[ireq] > 0) { + int i = 1 + h->map.cv[ireq][X]; + int j = 1 + h->map.cv[ireq][Y]; + int k = 1 + h->map.cv[ireq][Z]; + int mcount = h->count[ireq]*lb_halo_size(h->slim[ireq]); + + lb_halo_enqueue_send(lb, h, ireq); + + /* Short circuit messages to self. */ + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + #pragma omp critical + { + MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + h->tagbase + ireq, h->comm, h->request + 27 + ireq); + } + } + } + + return 0; +} + +/***************************************************************************** + * + * lb_halo_free + * + * Complete all the send and receive requests. + * + *****************************************************************************/ + +int lb_halo_free(lb_t * lb, lb_halo_t * h) { + + assert(lb); + assert(h); + + /* Can free() be used with thread safety? */ + + #pragma omp parallel for schedule(dynamic, 1) + for (int ireq = 0; ireq < 2*h->map.nvel; ireq++) { + + int issatisfied = -1; + MPI_Status status = {}; + + #pragma omp critical + { + MPI_Waitany(2*h->map.nvel, h->request, &issatisfied, &status); + } + /* Check status is what we expect? */ + + if (issatisfied == MPI_UNDEFINED) { + /* No action e.g., for (0,0,0) case */ + } + else { + /* Handle either send or recv request completion */ + if (issatisfied < h->map.nvel) { + /* This is a recv */ + int irreq = issatisfied; + lb_halo_dequeue_recv(lb, h, irreq); + free(h->recv[irreq]); + } + else { + /* This was a send */ + int isreq = issatisfied - 27; + free(h->send[isreq]); + } + } + } + + return 0; +} From e9e24763c44a8e05c67275b030533cb5f42c78f5 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Sun, 26 Dec 2021 17:06:55 +0000 Subject: [PATCH 03/64] Update for new lb initialisation --- tests/unit/test_halo.c | 31 +- tests/unit/test_io.c | 4 +- tests/unit/test_lb_bc_inflow_rhou.c | 4 +- tests/unit/test_lb_bc_outflow_rhou.c | 12 +- tests/unit/test_model.c | 520 ++------------------------- tests/unit/test_prop.c | 18 +- tests/unit/test_wall.c | 35 +- 7 files changed, 88 insertions(+), 536 deletions(-) diff --git a/tests/unit/test_halo.c b/tests/unit/test_halo.c index dc9042a7c..03ea35328 100644 --- a/tests/unit/test_halo.c +++ b/tests/unit/test_halo.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * Edinburgh Parallel Computing Centre * - * (c) 2010-2017 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -23,7 +23,7 @@ #include "pe.h" #include "coords.h" -#include "model.h" +#include "lb_data.h" #include "control.h" #include "tests.h" @@ -47,7 +47,7 @@ int test_halo_suite(void) { cs_init(cs); do_test_const_blocks(); - + do_test_halo_null(pe, cs, LB_HALO_FULL); do_test_halo_null(pe, cs, LB_HALO_REDUCED); @@ -128,11 +128,14 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { MPI_Comm_rank(comm, &rank); - lb_create(pe, cs, &lb); - lb_ndist_set(lb, ndist); - lb_init(lb); - lb_halo_set(lb, halo); - + { + lb_data_options_t options = lb_data_options_default(); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); + lb_halo_set(lb, halo); + } cs_nlocal(cs, nlocal); /* Set entire distribution (all sites including halos) to 1.0 */ @@ -233,10 +236,14 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { assert(dim == X || dim == Y || dim == Z); - lb_create(pe, cs, &lb); - lb_ndist_set(lb, ndist); - lb_init(lb); - lb_halo_set(lb, halo); + { + lb_data_options_t options = lb_data_options_default(); + options.nvel = NVEL; + options.ndim = NDIM; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); + lb_halo_set(lb, halo); + } cs_nhalo(cs, &nhalo); nextra = nhalo; diff --git a/tests/unit/test_io.c b/tests/unit/test_io.c index 879fd384a..3cbe9dd8a 100644 --- a/tests/unit/test_io.c +++ b/tests/unit/test_io.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2020 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -74,7 +74,7 @@ int do_test_io_info_struct(pe_t * pe, cs_t * cs) { char stubp[FILENAME_MAX]; test_io_t data = {2, 1.0}; - io_info_arg_t args; + io_info_args_t args; io_info_t * io_info = NULL; assert(pe); diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index bf72220f7..0d5bc1014 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -188,6 +188,7 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_inflow_opts_t options = {.nvel = nvel, .flow = {1, 0, 0}, .u0 = {0.01, 0.0, 0.0}}; + lb_data_options_t lb_options = lb_data_options_default(); lb_bc_inflow_rhou_t * inflow = NULL; hydro_t * hydro = NULL; lb_t * lb = NULL; @@ -203,8 +204,7 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_inflow_rhou_create(pe, cs, &options, &inflow); hydro_create(pe, cs, NULL, 1, &hydro); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &lb_options, &lb); /* Set the relevant domain values (rho only here) */ diff --git a/tests/unit/test_lb_bc_outflow_rhou.c b/tests/unit/test_lb_bc_outflow_rhou.c index 4c05d716c..8659b455c 100644 --- a/tests/unit/test_lb_bc_outflow_rhou.c +++ b/tests/unit/test_lb_bc_outflow_rhou.c @@ -6,6 +6,8 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2021 The University of Edinburgh + * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -167,8 +169,14 @@ __host__ int test_lb_bc_outflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_outflow_rhou_create(pe, cs, &options, &outflow); hydro_create(pe, cs, NULL, 1, &hydro); - lb_create(pe, cs, &lb); - lb_init(lb); + + { + lb_data_options_t opts = lb_data_options_default(); + opts.ndim = NDIM; + opts.nvel = nvel; + lb_data_create(pe, cs, &opts, &lb); + } + /* Set some outflow velocities in the domain */ diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index e308635f4..9ee8d34c0 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -22,8 +22,7 @@ #include "pe.h" #include "coords.h" #include "util.h" -#include "cs_limits.h" -#include "lb_model_s.h" +#include "lb_data.h" #include "tests.h" static void test_model_constants(void); @@ -36,16 +35,6 @@ int do_test_lb_model_io(pe_t * pe, cs_t * cs); static int test_model_is_domain(cs_t * cs, int ic, int jc, int kc); - - - -typedef struct lb_data_options_s { - int ndim; - int nvel; - int ndist; -} lb_data_options_t; - - /* Utility to return a unique value for global (ic,jc,kc,p) */ /* This allows e.g., tests to check distribution values in parallel * exchanges. */ @@ -104,453 +93,6 @@ int64_t lb_data_index(lb_t * lb, int ic, int jc, int kc, int p) { return index; } -int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, - lb_t ** lb); - -int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, - lb_t ** lb) { - - lb_t * obj = NULL; - - assert(pe); - assert(cs); - assert(options); - assert(lb); - - obj = (lb_t *) calloc(1, sizeof(lb_t)); - assert(obj); - if (obj == NULL) pe_fatal(pe, "calloc(1, lb_t) failed\n"); - - /* Check options */ - - obj->pe = pe; - obj->cs = cs; - obj->ndim = options->ndim; - obj->nvel = options->nvel; - obj->ndist = options->ndist; - - lb_model_create(obj->nvel, &obj->model); - - /* Storage */ - - { - /* Allocate storage following cs specification */ - int nhalo = 1; - int nlocal[3] = {}; - cs_nhalo(cs, &nhalo); - cs_nlocal(cs, nlocal); - - { - int nx = nlocal[X] + 2*nhalo; - int ny = nlocal[Y] + 2*nhalo; - int nz = nlocal[Z] + 2*nhalo; - obj->nsite = nx*ny*nz; - } - { - size_t sz = sizeof(double)*obj->nsite*obj->nvel; - assert(sz > 0); /* Should not overflow in size_t I hope! */ - obj->f = (double *) mem_aligned_malloc(MEM_PAGESIZE, sz); - assert(obj->f); - if (obj->f == NULL) pe_fatal(pe, "malloc(lb->f) failed\n"); - } - } - - *lb = obj; - - return 0; -} - -int lb_data_free(lb_t * lb) { - - assert(lb); - - free(lb->f); - lb_model_free(&lb->model); - free(lb); - - return 0; -} - -/* We will not exceed 27 directions! Direction index 0, in keeping - * with the LB model definition, is (0,0,0) - so no communication. */ - -typedef struct lb_halo_s { - - MPI_Comm comm; /* coords: Cartesian communicator */ - int nbrrank[3][3][3]; /* coords: neighbour rank look-up */ - int nlocal[3]; /* coords: local domain size */ - - lb_model_t map; /* Communication map 2d or 3d */ - int tagbase; /* send/recv tag */ - int full; /* All velocities at each site required. */ - int count[27]; /* halo: item data count per direction */ - cs_limits_t slim[27]; /* halo: send data region (rectangular) */ - cs_limits_t rlim[27]; /* halo: recv data region (rectangular) */ - double * send[27]; /* halo: send buffer per direction */ - double * recv[27]; /* halo: recv buffer per direction */ - MPI_Request request[2*27]; /* halo: array of requests */ - -} lb_halo_t; - -/***************************************************************************** - * - * lb_halo_size - * - * Utility to compute a number of sites from cs_limits_t. - * - *****************************************************************************/ - -int cs_limits_size(cs_limits_t lim) { - - int szx = 1 + lim.imax - lim.imin; - int szy = 1 + lim.jmax - lim.jmin; - int szz = 1 + lim.kmax - lim.kmin; - - return szx*szy*szz; -} - -/***************************************************************************** - * - * lb_halo_enqueue_send - * - * Pack the send buffer. The ireq determines the direction of the - * communication. - * - *****************************************************************************/ - -int lb_halo_enqueue_send(const lb_t * lb, const lb_halo_t * h, int ireq) { - - assert(1 <= ireq && ireq < h->map.nvel); - assert(lb->ndist == 1); - - if (h->count[ireq] > 0) { - - int8_t mx = h->map.cv[ireq][X]; - int8_t my = h->map.cv[ireq][Y]; - int8_t mz = h->map.cv[ireq][Z]; - int8_t mm = mx*mx + my*my + mz*mz; - - int ib = 0; /* Buffer index */ - - assert(mm == 1 || mm == 2 || mm == 3); - - for (int ic = h->slim[ireq].imin; ic <= h->slim[ireq].imax; ic++) { - for (int jc = h->slim[ireq].jmin; jc <= h->slim[ireq].jmax; jc++) { - for (int kc = h->slim[ireq].kmin; kc <= h->slim[ireq].kmax; kc++) { - /* If full, we need p = 0 */ - for (int p = 0; p < lb->nvel; p++) { - int8_t px = lb->model.cv[p][X]; - int8_t py = lb->model.cv[p][Y]; - int8_t pz = lb->model.cv[p][Z]; - int dot = mx*px + my*py + mz*pz; - if (h->full || dot == mm) { - int index = cs_index(lb->cs, ic, jc, kc); - int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); - h->send[ireq][ib++] = lb->f[laddr]; - } - } - } - } - } - assert(ib == h->count[ireq]*cs_limits_size(h->slim[ireq])); - } - - return 0; -} - -/***************************************************************************** - * - * lb_halo_dequeue_recv - * - * Unpack the recv buffer into place in the distributions. - * - *****************************************************************************/ - -int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { - - assert(lb); - assert(h); - assert(0 < ireq && ireq < h->map.nvel); - assert(lb->ndist == 1); - - if (h->count[ireq] > 0) { - - /* The communication direction is reversed cf. the send... */ - int8_t mx = h->map.cv[h->map.nvel-ireq][X]; - int8_t my = h->map.cv[h->map.nvel-ireq][Y]; - int8_t mz = h->map.cv[h->map.nvel-ireq][Z]; - int8_t mm = mx*mx + my*my + mz*mz; - - int ib = 0; /* Buffer index */ - double * recv = h->recv[ireq]; - - { - int i = 1 + mx; - int j = 1 + my; - int k = 1 + mz; - /* If Cartesian neighbour is self, just copy out of send buffer. */ - if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) recv = h->send[ireq]; - } - - assert(mm == 1 || mm == 2 || mm == 3); - - for (int ic = h->rlim[ireq].imin; ic <= h->rlim[ireq].imax; ic++) { - for (int jc = h->rlim[ireq].jmin; jc <= h->rlim[ireq].jmax; jc++) { - for (int kc = h->rlim[ireq].kmin; kc <= h->rlim[ireq].kmax; kc++) { - for (int p = 0; p < lb->nvel; p++) { - /* For reduced swap, we must have -cv[p] here... */ - int8_t px = lb->model.cv[lb->nvel-p][X]; - int8_t py = lb->model.cv[lb->nvel-p][Y]; - int8_t pz = lb->model.cv[lb->nvel-p][Z]; - int dot = mx*px + my*py + mz*pz; - if (h->full || dot == mm) { - int index = cs_index(lb->cs, ic, jc, kc); - int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); - lb->f[laddr] = recv[ib++]; - } - } - } - } - } - assert(ib == h->count[ireq]*cs_limits_size(h->rlim[ireq])); - } - - return 0; -} - -/***************************************************************************** - * - * lb_halo_create - * - * Currently: generate all send and receive requests. - * - *****************************************************************************/ - -int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { - - lb_halo_t hnull = {}; - - assert(lb); - assert(h); - - *h = hnull; - - /* Communication model */ - if (lb->model.ndim == 2) lb_model_create( 9, &h->map); - if (lb->model.ndim == 3) lb_model_create(27, &h->map); - - assert(h->map.ndim == lb->model.ndim); - - cs_nlocal(lb->cs, h->nlocal); - cs_cart_comm(lb->cs, &h->comm); - h->tagbase = 211216; - h->full = full; - - /* Determine look-up table of ranks of neighbouring processes */ - { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; - - MPI_Cart_get(h->comm, h->map.ndim, dims, periods, coords); - - for (int p = 0; p < h->map.nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ - int i = 1 + h->map.cv[p][X]; - int j = 1 + h->map.cv[p][Y]; - int k = 1 + h->map.cv[p][Z]; - - nbr[X] = coords[X] + h->map.cv[p][X]; - nbr[Y] = coords[Y] + h->map.cv[p][Y]; - nbr[Z] = coords[Z] + h->map.cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); - - if (out[X] || out[Y] || out[Z]) { - h->nbrrank[i][j][k] = MPI_PROC_NULL; - } - else { - MPI_Cart_rank(h->comm, nbr, &h->nbrrank[i][j][k]); - } - } - /* I must be in the middle */ - assert(h->nbrrank[1][1][1] == cs_cart_rank(lb->cs)); - } - - - /* Limits of the halo regions in each communication direction */ - - for (int p = 1; p < h->map.nvel; p++) { - - /* Limits for send and recv regions*/ - int8_t cx = h->map.cv[p][X]; - int8_t cy = h->map.cv[p][Y]; - int8_t cz = h->map.cv[p][Z]; - - cs_limits_t send = {1, h->nlocal[X], 1, h->nlocal[Y], 1, h->nlocal[Z]}; - cs_limits_t recv = {1, h->nlocal[X], 1, h->nlocal[Y], 1, h->nlocal[Z]}; - - if (cx == -1) send.imax = 1; - if (cx == +1) send.imin = send.imax; - if (cy == -1) send.jmax = 1; - if (cy == +1) send.jmin = send.jmax; - if (cz == -1) send.kmax = 1; - if (cz == +1) send.kmin = send.kmax; - - /* velocity is reversed... */ - if (cx == +1) recv.imax = recv.imin = 0; - if (cx == -1) recv.imin = recv.imax = recv.imax + 1; - if (cy == +1) recv.jmax = recv.jmin = 0; - if (cy == -1) recv.jmin = recv.jmax = recv.jmax + 1; - if (cz == +1) recv.kmax = recv.kmin = 0; - if (cz == -1) recv.kmin = recv.kmax = recv.kmax + 1; - - h->slim[p] = send; - h->rlim[p] = recv; - } - - /* Message count (velocities) for each communication direction */ - - for (int p = 1; p < h->map.nvel; p++) { - - int count = 0; - - if (h->full) { - count = lb->model.nvel; - } - else { - int8_t mx = h->map.cv[p][X]; - int8_t my = h->map.cv[p][Y]; - int8_t mz = h->map.cv[p][Z]; - int8_t mm = mx*mx + my*my + mz*mz; - - /* Consider each model velocity in turn */ - for (int q = 1; q < lb->model.nvel; q++) { - int8_t qx = lb->model.cv[q][X]; - int8_t qy = lb->model.cv[q][Y]; - int8_t qz = lb->model.cv[q][Z]; - int8_t dot = mx*qx + my*qy + mz*qz; - - if (mm == 3 && dot == mm) count +=1; /* This is a corner */ - if (mm == 2 && dot == mm) count +=1; /* This is an edge */ - if (mm == 1 && dot == mm) count +=1; /* This is a side */ - } - } - - h->count[p] = count; - /* Allocate send buffer for send region */ - if (count > 0) { - int scount = count*cs_limits_size(h->slim[p]); - h->send[p] = (double *) malloc(scount*sizeof(double)); - assert(h->send[p]); - } - /* Allocate recv buffer */ - if (count > 0) { - int rcount = count*cs_limits_size(h->rlim[p]); - h->recv[p] = (double *) malloc(rcount*sizeof(double)); - assert(h->recv[p]); - } - } - - /* Post recvs (from opposite direction cf send) */ - - for (int ireq = 0; ireq < h->map.nvel; ireq++) { - - h->request[ireq] = MPI_REQUEST_NULL; - - if (h->count[ireq] > 0) { - int i = 1 + h->map.cv[h->map.nvel-ireq][X]; - int j = 1 + h->map.cv[h->map.nvel-ireq][Y]; - int k = 1 + h->map.cv[h->map.nvel-ireq][Z]; - int mcount = h->count[ireq]*cs_limits_size(h->rlim[ireq]); - - if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; - - MPI_Irecv(h->recv[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], - h->tagbase + ireq, h->comm, h->request + ireq); - } - } - - /* Enqueue sends (upper half of request array) */ - - #pragma omp parallel for schedule(dynamic, 1) - for (int ireq = 0; ireq < h->map.nvel; ireq++) { - - h->request[27+ireq] = MPI_REQUEST_NULL; - - if (h->count[ireq] > 0) { - int i = 1 + h->map.cv[ireq][X]; - int j = 1 + h->map.cv[ireq][Y]; - int k = 1 + h->map.cv[ireq][Z]; - int mcount = h->count[ireq]*cs_limits_size(h->slim[ireq]); - - lb_halo_enqueue_send(lb, h, ireq); - - /* Short circuit messages to self. */ - if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; - - #pragma omp critical - { - MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], - h->tagbase + ireq, h->comm, h->request + 27 + ireq); - } - } - } - - return 0; -} - -/***************************************************************************** - * - * lb_halo_free - * - * Complete all the send and receive requests. - * - *****************************************************************************/ - -int lb_halo_free(lb_t * lb, lb_halo_t * h) { - - assert(lb); - assert(h); - - /* Can free() be used with thread safety? */ - - #pragma omp parallel for schedule(dynamic, 1) - for (int ireq = 0; ireq < 2*h->map.nvel; ireq++) { - - int issatisfied = -1; - MPI_Status status = {}; - - #pragma omp critical - { - MPI_Waitany(2*h->map.nvel, h->request, &issatisfied, &status); - } - /* Check status is what we expect? */ - - if (issatisfied == MPI_UNDEFINED) { - /* No action e.g., for (0,0,0) case */ - } - else { - /* Handle either send or recv request completion */ - if (issatisfied < h->map.nvel) { - /* This is a recv */ - int irreq = issatisfied; - lb_halo_dequeue_recv(lb, h, irreq); - free(h->recv[irreq]); - } - else { - /* This was a send */ - int isreq = issatisfied - 27; - free(h->send[isreq]); - } - } - } - - return 0; -} - /***************************************************************************** * * util_lb_data_check_set @@ -648,12 +190,14 @@ int util_lb_data_check(lb_t * lb, int full) { int test_lb_halo_create(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { - lb_data_options_t options = {.ndim = ndim, .nvel = nvel, .ndist = 1}; + lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; assert(pe); assert(cs); + options.ndim = ndim; + options.nvel = nvel; lb_data_create(pe, cs, &options, &lb); util_lb_data_check_set(lb); @@ -665,8 +209,7 @@ int test_lb_halo_create(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { } util_lb_data_check(lb, full); - - lb_data_free(lb); + lb_free(lb); return 0; } @@ -707,9 +250,10 @@ int test_lb_halo(pe_t * pe) { test_lb_halo_create(pe, cs, 3, 15, 1); test_lb_halo_create(pe, cs, 3, 19, 0); test_lb_halo_create(pe, cs, 3, 19, 1); + /* This will break while still fixed NVEL present... test_lb_halo_create(pe, cs, 3, 27, 0); test_lb_halo_create(pe, cs, 3, 27, 1); - + */ cs_free(cs); } @@ -837,25 +381,21 @@ int do_test_model_distributions(pe_t * pe, cs_t * cs) { double fvalue, fvalue_expected; double u[3]; - lb_t * lb; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; assert(pe); assert(cs); /* Tests of the basic distribution functions. */ - lb_create(pe, cs, &lb); - assert(lb); - lb_ndist(lb, &n); - assert(n == 1); /* Default */ - - lb_ndist_set(lb, ndist); - lb_init(lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; - /* Report the number of distributions */ - - lb_ndist(lb, &n); - assert(n == ndist); + lb_data_create(pe, cs, &options, &lb); + assert(lb); + assert(lb->ndist == ndist); for (n = 0; n < ndist; n++) { for (p = 0; p < lb->model.nvel; p++) { @@ -902,15 +442,17 @@ int do_test_model_halo_swap(pe_t * pe, cs_t * cs) { double f_expect; double f_actual; + lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; assert(pe); assert(cs); - lb_create(pe, cs, &lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_ndist_set(lb, ndist); - lb_init(lb); cs_nlocal(cs, nlocal); @@ -1001,15 +543,17 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { double f_expect; double f_actual; + lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; assert(pe); assert(cs); - lb_create(pe, cs, &lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_ndist_set(lb, ndist); - lb_init(lb); lb_halo_set(lb, LB_HALO_REDUCED); cs_nlocal(cs, nlocal); @@ -1123,27 +667,13 @@ static int test_model_is_domain(cs_t * cs, int ic, int jc, int kc) { int do_test_lb_model_io(pe_t * pe, cs_t * cs) { - int ndist = 2; - lb_t * lbrd = NULL; - lb_t * lbwr = NULL; - assert(pe); assert(cs); - lb_create_ndist(pe, cs, ndist, &lbrd); - lb_create_ndist(pe, cs, ndist, &lbwr); - - lb_init(lbwr); - lb_init(lbrd); - /* Write */ - /* Read */ /* Compare */ - lb_free(lbwr); - lb_free(lbrd); - return 0; } diff --git a/tests/unit/test_prop.c b/tests/unit/test_prop.c index 6322cda56..b81842518 100644 --- a/tests/unit/test_prop.c +++ b/tests/unit/test_prop.c @@ -22,7 +22,6 @@ #include "coords.h" #include "kernel.h" #include "memory.h" -#include "lb_model_s.h" #include "propagation.h" #include "tests.h" @@ -83,17 +82,18 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { int ndist = 2; double f_actual; + lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; assert(pe); assert(cs); - lb_create(pe, cs, &lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_ndist_set(lb, ndist); - lb_init(lb); - cs_nlocal(cs, nlocal); /* Set test values */ @@ -173,15 +173,17 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { double f_actual, f_expect; double ltot[3]; + lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; assert(pe); assert(cs); - lb_create(pe, cs, &lb); + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_ndist_set(lb, ndist); - lb_init(lb); cs_ltot(cs, ltot); cs_ntotal(cs, ntotal); diff --git a/tests/unit/test_wall.c b/tests/unit/test_wall.c index 67b5282fd..a0f5ae1d0 100644 --- a/tests/unit/test_wall.c +++ b/tests/unit/test_wall.c @@ -163,16 +163,17 @@ __host__ int test_wall_slip(void) { __host__ int test_wall_link_normal(pe_t * pe, cs_t * cs) { - lb_t * lb = NULL; map_t * map = NULL; wall_t * wall = NULL; wall_param_t param = {0}; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; + assert(pe); assert(cs); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &options, &lb); map_create(pe, cs, 1, &map); wall_create(pe, cs, map, lb, &wall); @@ -234,16 +235,17 @@ __host__ int test_wall_link_normal(pe_t * pe, cs_t * cs) { __host__ int test_wall_link_slip_direction(pe_t * pe, cs_t * cs) { - lb_t * lb = NULL; map_t * map = NULL; wall_t * wall = NULL; wall_param_t param = {0}; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; + assert(pe); assert(cs); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &options, &lb); map_create(pe, cs, 1, &map); wall_create(pe, cs, map, lb, &wall); @@ -294,16 +296,17 @@ __host__ int test_wall_link_slip_direction(pe_t * pe, cs_t * cs) { __host__ int test_wall_link_slip(pe_t * pe, cs_t * cs) { - lb_t * lb = NULL; map_t * map = NULL; wall_t * wall = NULL; wall_param_t param = {0}; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; + assert(pe); assert(cs); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &options, &lb); map_create(pe, cs, 1, &map); wall_create(pe, cs, map, lb, &wall); @@ -347,16 +350,17 @@ __host__ int test_wall_link_slip(pe_t * pe, cs_t * cs) { __host__ int test_wall_commit1(pe_t * pe, cs_t * cs) { - lb_t * lb = NULL; map_t * map = NULL; wall_t * wall = NULL; wall_param_t param = {0}; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; + assert(pe); assert(cs); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &options, &lb); map_create(pe, cs, 1, &map); wall_create(pe, cs, map, lb, &wall); @@ -394,16 +398,17 @@ __host__ int test_wall_commit1(pe_t * pe, cs_t * cs) { __host__ int test_wall_commit2(pe_t * pe, cs_t * cs) { - lb_t * lb = NULL; map_t * map = NULL; wall_t * wall = NULL; wall_param_t param = {0}; + lb_data_options_t options = lb_data_options_default(); + lb_t * lb = NULL; + assert(pe); assert(cs); - lb_create(pe, cs, &lb); - lb_init(lb); + lb_data_create(pe, cs, &options, &lb); map_create(pe, cs, 1, &map); wall_create(pe, cs, map, lb, &wall); From 589b19df95aebc40e81a827794fa90056c3b3c73 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Sun, 26 Dec 2021 17:07:43 +0000 Subject: [PATCH 04/64] Change of header file names for lb_data --- src/bbl.c | 2 - src/bbl.h | 2 +- src/build.c | 1 - src/build.h | 2 +- src/collision.c | 2 - src/collision.h | 4 +- src/collision_rt.c | 1 - src/collision_rt.h | 9 ++-- src/lb_bc_open.h | 2 +- src/lb_data_options.c | 54 ++++++++++++++++++++ src/lb_data_options.h | 48 ++++++++++++++++++ src/lb_model_s.h | 90 --------------------------------- src/model_le.c | 3 +- src/model_le.h | 8 +-- src/phi_lb_coupler.c | 3 +- src/phi_lb_coupler.h | 4 +- src/propagation.c | 1 - src/propagation.h | 2 +- src/stats_colloid_force_split.c | 2 +- src/stats_distribution.c | 12 ++--- src/stats_distribution.h | 8 +-- src/stats_rheology.c | 1 - src/stats_rheology.h | 4 +- src/wall.c | 1 - src/wall.h | 2 +- src/wall_rt.h | 2 +- 26 files changed, 135 insertions(+), 135 deletions(-) create mode 100644 src/lb_data_options.c create mode 100644 src/lb_data_options.h delete mode 100644 src/lb_model_s.h diff --git a/src/bbl.c b/src/bbl.c index cdd3a9d78..d5dc74d36 100644 --- a/src/bbl.c +++ b/src/bbl.c @@ -24,8 +24,6 @@ #include "coords.h" #include "physics.h" #include "colloid_sums.h" -#include "model.h" -#include "lb_model_s.h" #include "util.h" #include "wall.h" #include "bbl.h" diff --git a/src/bbl.h b/src/bbl.h index 4e8871295..f612828c7 100644 --- a/src/bbl.h +++ b/src/bbl.h @@ -15,7 +15,7 @@ #include "coords.h" #include "colloids.h" -#include "model.h" +#include "lb_data.h" #include "wall.h" typedef struct bbl_s bbl_t; diff --git a/src/build.c b/src/build.c index 9ca5410cc..cb047cae9 100644 --- a/src/build.c +++ b/src/build.c @@ -24,7 +24,6 @@ #include "pe.h" #include "coords.h" #include "physics.h" -#include "lb_model_s.h" #include "colloid_sums.h" #include "psi_colloid.h" #include "util.h" diff --git a/src/build.h b/src/build.h index 514886864..bc925e4e6 100644 --- a/src/build.h +++ b/src/build.h @@ -17,7 +17,7 @@ #include "map.h" #include "psi.h" #include "colloids.h" -#include "model.h" +#include "lb_data.h" #include "wall.h" #include "free_energy.h" diff --git a/src/collision.c b/src/collision.c index f19eb0c35..a12812908 100644 --- a/src/collision.c +++ b/src/collision.c @@ -30,8 +30,6 @@ #include "util.h" #include "coords_s.h" #include "physics.h" -#include "model.h" -#include "lb_model_s.h" #include "free_energy.h" #include "visc.h" #include "control.h" diff --git a/src/collision.h b/src/collision.h index 141c2ed92..f267cfe36 100644 --- a/src/collision.h +++ b/src/collision.h @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2020 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -20,7 +20,7 @@ #include "hydro.h" #include "map.h" #include "noise.h" -#include "model.h" +#include "lb_data.h" #include "free_energy.h" #include "visc.h" diff --git a/src/collision_rt.c b/src/collision_rt.c index efabbec5c..dc020bb6c 100644 --- a/src/collision_rt.c +++ b/src/collision_rt.c @@ -16,7 +16,6 @@ #include #include "pe.h" -#include "model.h" #include "physics.h" #include "runtime.h" #include "collision.h" diff --git a/src/collision_rt.h b/src/collision_rt.h index 7a9125469..3f8349d6a 100644 --- a/src/collision_rt.h +++ b/src/collision_rt.h @@ -8,15 +8,16 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2016 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ -#ifndef COLLISION_RT_H -#define COLLISION_RT_H +#ifndef LUDWIG_COLLISION_RT_H +#define LUDWIG_COLLISION_RT_H +#include "pe.h" #include "runtime.h" -#include "model.h" +#include "lb_data.h" #include "noise.h" int collision_run_time(pe_t * pe, rt_t * rt, lb_t * lb, noise_t * noise); diff --git a/src/lb_bc_open.h b/src/lb_bc_open.h index a4cd946cf..14641eecc 100644 --- a/src/lb_bc_open.h +++ b/src/lb_bc_open.h @@ -18,7 +18,7 @@ #define LUDWIG_LB_BC_OPEN_H #include "hydro.h" -#include "model.h" +#include "lb_data.h" typedef struct lb_bc_open_vtable_s lb_bc_open_vtable_t; typedef struct lb_bc_open_s lb_bc_open_t; diff --git a/src/lb_data_options.c b/src/lb_data_options.c new file mode 100644 index 000000000..e30d41e25 --- /dev/null +++ b/src/lb_data_options.c @@ -0,0 +1,54 @@ +/***************************************************************************** + * + * lb_data_options.c + * + * Options available for distribution data at run time. + * + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#include + +#include "lb_data_options.h" + +/***************************************************************************** + * + * lb_data_options_default + * + *****************************************************************************/ + +lb_data_options_t lb_data_options_default(void) { + + lb_data_options_t opts = {.ndim = 3, .nvel = 19, .ndist = 1, + .nrelax = LB_RELAXATION_M10, + .halo = LB_HALO_TARGET, + .data = io_info_args_default(), + .rho = io_info_args_default()}; + + return opts; +} + +/***************************************************************************** + * + * lb_data_options_valid + * + *****************************************************************************/ + +int lb_data_options_valid(const lb_data_options_t * opts) { + + int valid = 1; + + if (!(opts->ndim == 2 || opts->ndim == 3)) valid = 0; + /* nvel */ + if (!(opts->ndist == 1 || opts->ndist == 2)) valid = 0; + + return valid; +} diff --git a/src/lb_data_options.h b/src/lb_data_options.h new file mode 100644 index 000000000..2ccb361e6 --- /dev/null +++ b/src/lb_data_options.h @@ -0,0 +1,48 @@ +/***************************************************************************** + * + * lb_data_options.h + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#ifndef LUDWIG_LB_DATA_OPTIONS_H +#define LUDWIG_LB_DATA_OPTIONS_H + +#include "io_info_args.h" + +typedef enum lb_relaxation_enum {LB_RELAXATION_M10, + LB_RELAXATION_BGK, + LB_RELAXATION_TRT} + lb_relaxation_enum_t; + +typedef enum lb_halo_enum {LB_HALO_FULL, + LB_HALO_REDUCED, + LB_HALO_HOST, + LB_HALO_TARGET, + LB_HALO_OPENMP_FULL, + LB_HALO_OPENMP_REDUCED} lb_halo_enum_t; + +typedef struct lb_data_options_s lb_data_options_t; + +struct lb_data_options_s { + int ndim; + int nvel; + int ndist; + lb_relaxation_enum_t nrelax; + lb_halo_enum_t halo; + + io_info_args_t data; + io_info_args_t rho; +}; + +lb_data_options_t lb_data_options_default(void); +int lb_data_options_valid(const lb_data_options_t * opts); + +#endif diff --git a/src/lb_model_s.h b/src/lb_model_s.h deleted file mode 100644 index 75cdd8e33..000000000 --- a/src/lb_model_s.h +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * - * lb_model_s.h - * - * LB model data structure implementation. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2014-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LB_MODEL_S_H -#define LB_MODEL_S_H - -#include "model.h" -#include "halo_swap.h" -#include "io_harness.h" -#include "stdint.h" - -typedef struct lb_collide_param_s lb_collide_param_t; - -struct lb_collide_param_s { - int8_t isghost; /* switch for ghost modes */ - int8_t cv[NVEL][3]; - int nsite; - int ndist; - int nvel; - double rho0; - double eta_shear; - double var_shear; - double eta_bulk; - double var_bulk; - double rna[NVEL]; /* reciprocal of normaliser[p] */ - double rtau[NVEL]; - double wv[NVEL]; - double ma[NVEL][NVEL]; - double mi[NVEL][NVEL]; -}; - -struct lb_data_s { - - int ndim; - int nvel; - int ndist; /* Number of distributions (default one) */ - int nsite; /* Number of lattice sites (local) */ - - pe_t * pe; /* parallel environment */ - cs_t * cs; /* coordinate system */ - - lb_model_t model; /* Current LB model information */ - halo_swap_t * halo; /* halo swap driver */ - io_info_t * io_info; /* Distributions */ - io_info_t * io_rho; /* Fluid density (here; could be hydrodynamics...) */ - - double * f; /* Distributions */ - double * fprime; /* used in propagation only */ - - lb_collide_param_t * param; /* Collision parameters REFACTOR THIS */ - lb_relaxation_enum_t nrelax; /* Relaxation scheme */ - - /* MPI data types for halo swaps; these are comupted at runtime - * to conform to the model selected at compile time */ - - MPI_Datatype plane_xy_full; - MPI_Datatype plane_xz_full; - MPI_Datatype plane_yz_full; - MPI_Datatype plane_xy_reduced[2]; - MPI_Datatype plane_xz_reduced[2]; - MPI_Datatype plane_yz_reduced[2]; - MPI_Datatype plane_xy[2]; - MPI_Datatype plane_xz[2]; - MPI_Datatype plane_yz[2]; - MPI_Datatype site_x[2]; - MPI_Datatype site_y[2]; - MPI_Datatype site_z[2]; - - lb_t * target; /* copy of this structure on target */ -}; - -/* Data storage: A rank two object */ - -#define LB_ADDR(nsites, ndist, nvel, index, n, p) \ - addr_rank2(nsites, ndist, nvel, index, n, p) - -#endif diff --git a/src/model_le.c b/src/model_le.c index 61bbb5f92..c1d4de288 100644 --- a/src/model_le.c +++ b/src/model_le.c @@ -29,9 +29,8 @@ #include "timer.h" #include "coords.h" #include "control.h" -#include "lb_model_s.h" #include "physics.h" -#include "leesedwards.h" +#include "model_le.h" #include "util.h" static int le_reproject(lb_t * lb, lees_edw_t * le); diff --git a/src/model_le.h b/src/model_le.h index c2cd691ed..546013975 100644 --- a/src/model_le.h +++ b/src/model_le.h @@ -5,15 +5,15 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2014 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * Kevin Stratford (kevin@epcc.ed.ac.uk) * *****************************************************************************/ -#ifndef MODEL_LE_H -#define MODEL_LE_H +#ifndef LUDWIG_MODEL_LE_H +#define LUDWIG_MODEL_LE_H -#include "model.h" +#include "lb_data.h" #include "leesedwards.h" int lb_le_apply_boundary_conditions(lb_t * lb, lees_edw_t * le); diff --git a/src/phi_lb_coupler.c b/src/phi_lb_coupler.c index f0f253d97..7870d9a1e 100644 --- a/src/phi_lb_coupler.c +++ b/src/phi_lb_coupler.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2017 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -20,7 +20,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "lb_model_s.h" #include "field_s.h" #include "phi_lb_coupler.h" diff --git a/src/phi_lb_coupler.h b/src/phi_lb_coupler.h index c85e22c17..317a0374f 100644 --- a/src/phi_lb_coupler.h +++ b/src/phi_lb_coupler.h @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2016 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -17,7 +17,7 @@ #define PHI_LB_COUPLER_H #include "field.h" -#include "model.h" +#include "lb_data.h" __host__ int phi_lb_to_field(field_t * phi, lb_t * lb); __host__ int phi_lb_from_field(field_t * phi, lb_t * lb); diff --git a/src/propagation.c b/src/propagation.c index c215a807f..77188cb9c 100644 --- a/src/propagation.c +++ b/src/propagation.c @@ -22,7 +22,6 @@ #include "coords_s.h" #include "kernel.h" #include "propagation.h" -#include "lb_model_s.h" #include "timer.h" __host__ int lb_propagation_driver(lb_t * lb); diff --git a/src/propagation.h b/src/propagation.h index d9b1f1027..d3b36152d 100644 --- a/src/propagation.h +++ b/src/propagation.h @@ -16,7 +16,7 @@ #ifndef LUDWIG_LB_PROPAGATION_H #define LUDWIG_LB_PROPAGATION_H -#include "model.h" +#include "lb_data.h" __host__ int lb_propagation(lb_t * lb); diff --git a/src/stats_colloid_force_split.c b/src/stats_colloid_force_split.c index aad4aa4a4..9f8d7127a 100644 --- a/src/stats_colloid_force_split.c +++ b/src/stats_colloid_force_split.c @@ -22,7 +22,7 @@ #include "pe.h" #include "pth_s.h" -#include "model.h" +#include "lb_data.h" #include "blue_phase.h" #include "colloid_sums.h" #include "phi_force_stress.h" diff --git a/src/stats_distribution.c b/src/stats_distribution.c index f753b8a43..898e333df 100644 --- a/src/stats_distribution.c +++ b/src/stats_distribution.c @@ -23,7 +23,6 @@ #include "pe.h" #include "coords.h" -#include "lb_model_s.h" #include "util.h" #include "util_sum.h" #include "stats_distribution.h" @@ -303,12 +302,11 @@ __global__ void distribution_gm_kernel(kernel_ctxt_t * ktx, lb_t * lb, map_status(map, index, &status); if (status == MAP_FLUID) { - for (int p = 1; p < NVEL; p++) { - LB_CV(cv); - double f = lb->f[LB_ADDR(lb->nsite,lb->ndist,NVEL,index,LB_RHO,p)]; - double gxf = f*cv[p][X]; - double gyf = f*cv[p][Y]; - double gzf = f*cv[p][Z]; + for (int p = 1; p < lb->nvel; p++) { + double f = lb->f[LB_ADDR(lb->nsite,lb->ndist,lb->nvel,index,LB_RHO,p)]; + double gxf = f*lb->model.cv[p][X]; + double gyf = f*lb->model.cv[p][Y]; + double gzf = f*lb->model.cv[p][Z]; kahan_add_double(&gx[tid], gxf); kahan_add_double(&gy[tid], gyf); kahan_add_double(&gz[tid], gzf); diff --git a/src/stats_distribution.h b/src/stats_distribution.h index 77195a11a..6d1359dec 100644 --- a/src/stats_distribution.h +++ b/src/stats_distribution.h @@ -6,14 +6,14 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2014 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ -#ifndef STATS_DISTRIBUTION_H -#define STATS_DISTRIBUTION_H +#ifndef LUDWIG_STATS_DISTRIBUTION_H +#define LUDWIG_STATS_DISTRIBUTION_H -#include "model.h" +#include "lb_data.h" #include "map.h" int stats_distribution_print(lb_t * lb, map_t * map); diff --git a/src/stats_rheology.c b/src/stats_rheology.c index b2b54f37a..f610936fe 100644 --- a/src/stats_rheology.c +++ b/src/stats_rheology.c @@ -31,7 +31,6 @@ #include "pe.h" #include "coords.h" -#include "lb_model_s.h" #include "util.h" #include "control.h" #include "physics.h" diff --git a/src/stats_rheology.h b/src/stats_rheology.h index af6761431..f41585df8 100644 --- a/src/stats_rheology.h +++ b/src/stats_rheology.h @@ -7,7 +7,7 @@ * * $Id: stats_rheology.h,v 1.3 2009-10-14 17:16:01 kevin Exp $ * - * (c) 2009-2017 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -18,7 +18,7 @@ #define LUDWIG_STATS_RHEOLOGY_H #include "free_energy.h" -#include "model.h" +#include "lb_data.h" #include "hydro.h" typedef struct stats_rheo_s stats_rheo_t; diff --git a/src/wall.c b/src/wall.c index a1a66eb83..39ed3c8dd 100644 --- a/src/wall.c +++ b/src/wall.c @@ -22,7 +22,6 @@ #include #include "kernel.h" -#include "lb_model_s.h" #include "physics.h" #include "util.h" #include "wall.h" diff --git a/src/wall.h b/src/wall.h index b04bd364d..65dec5173 100644 --- a/src/wall.h +++ b/src/wall.h @@ -19,7 +19,7 @@ #include "pe.h" #include "coords.h" -#include "model.h" +#include "lb_data.h" #include "map.h" typedef enum wall_slip_enum {WALL_NO_SLIP = 0, diff --git a/src/wall_rt.h b/src/wall_rt.h index 761cfad42..40462a6ae 100644 --- a/src/wall_rt.h +++ b/src/wall_rt.h @@ -18,7 +18,7 @@ #include "pe.h" #include "runtime.h" #include "coords.h" -#include "model.h" +#include "lb_data.h" #include "map.h" #include "wall.h" From 6877c47c67079c761cf059668b84b3c26c8eb09b Mon Sep 17 00:00:00 2001 From: not populated Date: Thu, 30 Dec 2021 15:03:32 +0000 Subject: [PATCH 05/64] Corrections and performance improvements --- src/lb_data.h | 52 +++++++------ src/main.c | 3 +- src/model.c | 211 ++++++++++++++++++++++++++++++-------------------- 3 files changed, 156 insertions(+), 110 deletions(-) diff --git a/src/lb_data.h b/src/lb_data.h index 684ab8090..fb24b91c2 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -80,6 +80,31 @@ struct lb_collide_param_s { double mi[NVEL][NVEL]; }; +/* Halo */ + +#include "cs_limits.h" + +struct lb_halo_s { + + MPI_Comm comm; /* coords: Cartesian communicator */ + int nbrrank[3][3][3]; /* coords: neighbour rank look-up */ + int nlocal[3]; /* coords: local domain size */ + + lb_model_t map; /* Communication map 2d or 3d */ + int tagbase; /* send/recv tag */ + int full; /* All velocities at each site required. */ + int count[27]; /* halo: item data count per direction */ + cs_limits_t slim[27]; /* halo: send data region (rectangular) */ + cs_limits_t rlim[27]; /* halo: recv data region (rectangular) */ + double * send[27]; /* halo: send buffer per direction */ + double * recv[27]; /* halo: recv buffer per direction */ + MPI_Request request[2*27]; /* halo: array of requests */ + +}; + +int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme); +int lb_halo_free(lb_t * lb, lb_halo_t * h); + struct lb_data_s { int ndim; @@ -102,6 +127,8 @@ struct lb_data_s { lb_relaxation_enum_t nrelax; /* Relaxation scheme */ lb_halo_enum_t haloscheme; /* halo scheme */ + lb_halo_t h; /* halo information/buffers */ + /* MPI data types for halo swaps; these are comupted at runtime * to conform to the model selected at compile time */ @@ -173,29 +200,4 @@ __host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][ __host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); __host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); -/* Halo */ - -#include "cs_limits.h" - -struct lb_halo_s { - - MPI_Comm comm; /* coords: Cartesian communicator */ - int nbrrank[3][3][3]; /* coords: neighbour rank look-up */ - int nlocal[3]; /* coords: local domain size */ - - lb_model_t map; /* Communication map 2d or 3d */ - int tagbase; /* send/recv tag */ - int full; /* All velocities at each site required. */ - int count[27]; /* halo: item data count per direction */ - cs_limits_t slim[27]; /* halo: send data region (rectangular) */ - cs_limits_t rlim[27]; /* halo: recv data region (rectangular) */ - double * send[27]; /* halo: send buffer per direction */ - double * recv[27]; /* halo: recv buffer per direction */ - MPI_Request request[2*27]; /* halo: array of requests */ - -}; - -int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full); -int lb_halo_free(lb_t * lb, lb_halo_t * h); - #endif diff --git a/src/main.c b/src/main.c index a744e0013..92521ecf3 100644 --- a/src/main.c +++ b/src/main.c @@ -30,9 +30,10 @@ int main(int argc, char ** argv) { char inputfile[FILENAME_MAX] = "input"; + int provided = MPI_THREAD_SINGLE; - MPI_Init(&argc, &argv); + MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided); #ifdef PETSC PetscInitialize(&argc, &argv, (char*) 0, NULL); #endif diff --git a/src/model.c b/src/model.c index 537cc01c3..f3cb7bafa 100644 --- a/src/model.c +++ b/src/model.c @@ -45,6 +45,11 @@ static int lb_rho_write_ascii(FILE *, int index, void * self); static int lb_model_param_init(lb_t * lb); static int lb_init(lb_t * lb); +int lb_halo_post(const lb_t * lb, lb_halo_t * h); +int lb_halo_wait(lb_t * lb, lb_halo_t * h); +int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int irreq); +int lb_halo_enqueue_send(const lb_t * lb, lb_halo_t * h, int irreq); + static __constant__ lb_collide_param_t static_param; /***************************************************************************** @@ -119,6 +124,7 @@ int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, pe_fatal(pe, "calloc(1, lb_collide_param_t) failed\n"); } + lb_halo_create(obj, &obj->h, obj->haloscheme); lb_init(obj); *lb = obj; @@ -158,6 +164,8 @@ __host__ int lb_free(lb_t * lb) { if (lb->f) free(lb->f); if (lb->fprime) free(lb->fprime); + lb_halo_free(lb, &lb->h); + MPI_Type_free(&lb->plane_xy_full); MPI_Type_free(&lb->plane_xz_full); MPI_Type_free(&lb->plane_yz_full); @@ -786,16 +794,14 @@ __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag) { break; case LB_HALO_OPENMP_FULL: { - lb_halo_t h = {}; - lb_halo_create(lb, &h, 1); - lb_halo_free(lb, &h); + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); } break; case LB_HALO_OPENMP_REDUCED: { - lb_halo_t h = {}; - lb_halo_create(lb, &h, 0); - lb_halo_free(lb, &h); + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); } break; default: @@ -1737,7 +1743,7 @@ int lb_halo_size(cs_limits_t lim) { * *****************************************************************************/ -int lb_halo_enqueue_send(const lb_t * lb, const lb_halo_t * h, int ireq) { +int lb_halo_enqueue_send(const lb_t * lb, lb_halo_t * h, int ireq) { assert(1 <= ireq && ireq < h->map.nvel); assert(lb->ndist == 1); @@ -1749,29 +1755,38 @@ int lb_halo_enqueue_send(const lb_t * lb, const lb_halo_t * h, int ireq) { int8_t mz = h->map.cv[ireq][Z]; int8_t mm = mx*mx + my*my + mz*mz; - int ib = 0; /* Buffer index */ + int nx = 1 + h->slim[ireq].imax - h->slim[ireq].imin; + int ny = 1 + h->slim[ireq].jmax - h->slim[ireq].jmin; + int nz = 1 + h->slim[ireq].kmax - h->slim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; assert(mm == 1 || mm == 2 || mm == 3); - for (int ic = h->slim[ireq].imin; ic <= h->slim[ireq].imax; ic++) { - for (int jc = h->slim[ireq].jmin; jc <= h->slim[ireq].jmax; jc++) { - for (int kc = h->slim[ireq].kmin; kc <= h->slim[ireq].kmax; kc++) { - /* If full, we need p = 0 */ - for (int p = 0; p < lb->nvel; p++) { - int8_t px = lb->model.cv[p][X]; - int8_t py = lb->model.cv[p][Y]; - int8_t pz = lb->model.cv[p][Z]; - int dot = mx*px + my*py + mz*pz; - if (h->full || dot == mm) { - int index = cs_index(lb->cs, ic, jc, kc); - int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); - h->send[ireq][ib++] = lb->f[laddr]; - } - } - } + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->slim[ireq].imin + ih/strx; + int jc = h->slim[ireq].jmin + (ih % strx)/stry; + int kc = h->slim[ireq].kmin + (ih % stry)/strz; + int ib = 0; /* Buffer index */ + + for (int p = 0; p < lb->nvel; p++) { + /* Recall, if full, we need p = 0 */ + int8_t px = lb->model.cv[p][X]; + int8_t py = lb->model.cv[p][Y]; + int8_t pz = lb->model.cv[p][Z]; + int dot = mx*px + my*py + mz*pz; + if (h->full || dot == mm) { + int index = cs_index(lb->cs, ic, jc, kc); + int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); + h->send[ireq][ih*h->count[ireq] + ib] = lb->f[laddr]; + ib++; + } } + assert(ib == h->count[ireq]); } - assert(ib == h->count[ireq]*lb_halo_size(h->slim[ireq])); } return 0; @@ -1800,7 +1815,14 @@ int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { int8_t mz = h->map.cv[h->map.nvel-ireq][Z]; int8_t mm = mx*mx + my*my + mz*mz; - int ib = 0; /* Buffer index */ + int nx = 1 + h->rlim[ireq].imax - h->rlim[ireq].imin; + int ny = 1 + h->rlim[ireq].jmax - h->rlim[ireq].jmin; + int nz = 1 + h->rlim[ireq].kmax - h->rlim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; + double * recv = h->recv[ireq]; { @@ -1813,25 +1835,29 @@ int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { assert(mm == 1 || mm == 2 || mm == 3); - for (int ic = h->rlim[ireq].imin; ic <= h->rlim[ireq].imax; ic++) { - for (int jc = h->rlim[ireq].jmin; jc <= h->rlim[ireq].jmax; jc++) { - for (int kc = h->rlim[ireq].kmin; kc <= h->rlim[ireq].kmax; kc++) { - for (int p = 0; p < lb->nvel; p++) { - /* For reduced swap, we must have -cv[p] here... */ - int8_t px = lb->model.cv[lb->nvel-p][X]; - int8_t py = lb->model.cv[lb->nvel-p][Y]; - int8_t pz = lb->model.cv[lb->nvel-p][Z]; - int dot = mx*px + my*py + mz*pz; - if (h->full || dot == mm) { - int index = cs_index(lb->cs, ic, jc, kc); - int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); - lb->f[laddr] = recv[ib++]; - } - } - } + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->rlim[ireq].imin + ih/strx; + int jc = h->rlim[ireq].jmin + (ih % strx)/stry; + int kc = h->rlim[ireq].kmin + (ih % stry)/strz; + int ib = 0; /* Buffer index */ + + for (int p = 0; p < lb->nvel; p++) { + /* For reduced swap, we must have -cv[p] here... */ + int8_t px = lb->model.cv[lb->nvel-p][X]; + int8_t py = lb->model.cv[lb->nvel-p][Y]; + int8_t pz = lb->model.cv[lb->nvel-p][Z]; + int dot = mx*px + my*py + mz*pz; + + if (h->full || dot == mm) { + int index = cs_index(lb->cs, ic, jc, kc); + int laddr = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, 0, p); + lb->f[laddr] = recv[ih*h->count[ireq] + ib]; + ib++; + } } + assert(ib == h->count[ireq]); } - assert(ib == h->count[ireq]*lb_halo_size(h->rlim[ireq])); } return 0; @@ -1845,7 +1871,7 @@ int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { * *****************************************************************************/ -int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { +int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { assert(lb); assert(h); @@ -1862,7 +1888,8 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { cs_nlocal(lb->cs, h->nlocal); cs_cart_comm(lb->cs, &h->comm); h->tagbase = 211216; - h->full = full; + + if (scheme == LB_HALO_OPENMP_FULL) h->full = 1; /* Determine look-up table of ranks of neighbouring processes */ { @@ -1972,6 +1999,20 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { } } + return 0; +} + +/***************************************************************************** + * + * lb_halo_post + * + *****************************************************************************/ + +int lb_halo_post(const lb_t * lb, lb_halo_t * h) { + + assert(lb); + assert(h); + /* Post recvs (from opposite direction cf send) */ for (int ireq = 0; ireq < h->map.nvel; ireq++) { @@ -1991,9 +2032,16 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { } } + /* Load send buffers */ /* Enqueue sends (second half of request array) */ - #pragma omp parallel for schedule(dynamic, 1) + #pragma omp parallel + { + for (int ireq = 0; ireq < h->map.nvel; ireq++) { + lb_halo_enqueue_send(lb, h, ireq); + } + } + for (int ireq = 0; ireq < h->map.nvel; ireq++) { h->request[27+ireq] = MPI_REQUEST_NULL; @@ -2004,16 +2052,11 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { int k = 1 + h->map.cv[ireq][Z]; int mcount = h->count[ireq]*lb_halo_size(h->slim[ireq]); - lb_halo_enqueue_send(lb, h, ireq); - /* Short circuit messages to self. */ if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; - #pragma omp critical - { - MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], - h->tagbase + ireq, h->comm, h->request + 27 + ireq); - } + MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + h->tagbase + ireq, h->comm, h->request + 27 + ireq); } } @@ -2022,49 +2065,49 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, int full) { /***************************************************************************** * - * lb_halo_free - * - * Complete all the send and receive requests. + * lb_halo_wait * *****************************************************************************/ -int lb_halo_free(lb_t * lb, lb_halo_t * h) { +int lb_halo_wait(lb_t * lb, lb_halo_t * h) { assert(lb); assert(h); - /* Can free() be used with thread safety? */ + { + MPI_Status statuses[2*27] = {}; + MPI_Waitall(2*h->map.nvel, h->request, statuses); + } - #pragma omp parallel for schedule(dynamic, 1) - for (int ireq = 0; ireq < 2*h->map.nvel; ireq++) { + #pragma omp parallel + { + for (int ireq = 0; ireq < h->map.nvel; ireq++) { + lb_halo_dequeue_recv(lb, h, ireq); + } + } - int issatisfied = -1; - MPI_Status status = {}; + return 0; +} - #pragma omp critical - { - MPI_Waitany(2*h->map.nvel, h->request, &issatisfied, &status); - } - /* Check status is what we expect? */ +/***************************************************************************** + * + * lb_halo_free + * + * Complete all the send and receive requests. + * + *****************************************************************************/ - if (issatisfied == MPI_UNDEFINED) { - /* No action e.g., for (0,0,0) case */ - } - else { - /* Handle either send or recv request completion */ - if (issatisfied < h->map.nvel) { - /* This is a recv */ - int irreq = issatisfied; - lb_halo_dequeue_recv(lb, h, irreq); - free(h->recv[irreq]); - } - else { - /* This was a send */ - int isreq = issatisfied - 27; - free(h->send[isreq]); - } - } +int lb_halo_free(lb_t * lb, lb_halo_t * h) { + + assert(lb); + assert(h); + + for (int ireq = 0; ireq < 27; ireq++) { + free(h->send[ireq]); + free(h->recv[ireq]); } + lb_model_free(&h->map); + return 0; } From 373ba382f941eeefeedb29fb53a00fc3e6b6fdb7 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Thu, 30 Dec 2021 19:55:32 +0000 Subject: [PATCH 06/64] Added openmp halo --- src/field.c | 401 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/field.h | 36 ++++- 2 files changed, 428 insertions(+), 9 deletions(-) diff --git a/src/field.c b/src/field.c index e0ee2d666..5365d0300 100644 --- a/src/field.c +++ b/src/field.c @@ -42,12 +42,13 @@ static int field_read_ascii(FILE * fp, int index, void * self); static int field_leesedwards_parallel(field_t * obj); +__host__ int field_init(field_t * obj, int nhcomm, lees_edw_t * le); + /***************************************************************************** * * field_create * - * Allocation of data space is deferred until phi_init(), at which point - * a via coordinate system object should be available. + * le_t * le may be NULL if no Lees Edwards planes are present. * * This just sets the type of field; often order parameter, e.g.,: * nf = 1 for scalar "phi" @@ -56,21 +57,28 @@ static int field_leesedwards_parallel(field_t * obj); * *****************************************************************************/ -__host__ int field_create(pe_t * pe, cs_t * cs, int nf, const char * name, +__host__ int field_create(pe_t * pe, cs_t * cs, lees_edw_t * le, + const char * name, + const field_options_t * opts, field_t ** pobj) { field_t * obj = NULL; assert(pe); assert(cs); - assert(nf > 0); + assert(name); + assert(opts); assert(pobj); + if (field_options_valid(opts) == 0) { + pe_fatal(pe, "Internal error: invalid field options\n"); + } + obj = (field_t *) calloc(1, sizeof(field_t)); assert(obj); if (obj == NULL) pe_fatal(pe, "calloc(obj) failed\n"); - obj->nf = nf; + obj->nf = opts->ndata; obj->name = (char *) calloc(strlen(name) + 1, sizeof(char)); assert(obj->name); @@ -84,6 +92,10 @@ __host__ int field_create(pe_t * pe, cs_t * cs, int nf, const char * name, pe_retain(pe); cs_retain(cs); + field_init(obj, opts->nhcomm, le); + field_halo_create(obj, &obj->h); + obj->opts = *opts; + *pobj = obj; return 0; @@ -115,6 +127,9 @@ __host__ int field_free(field_t * obj) { if (obj->name) free(obj->name); if (obj->halo) halo_swap_free(obj->halo); if (obj->info) io_info_free(obj->info); + + field_halo_free(&obj->h); + cs_free(obj->cs); pe_free(obj->pe); free(obj); @@ -332,7 +347,7 @@ __host__ int field_halo(field_t * obj) { } else { /* Default to ... */ - field_halo_swap(obj, FIELD_HALO_TARGET); + field_halo_swap(obj, obj->opts.haloscheme); } return 0; @@ -359,6 +374,10 @@ __host__ int field_halo_swap(field_t * obj, field_halo_enum_t flag) { tdpMemcpyDeviceToHost); halo_swap_packed(obj->halo, data); break; + case FIELD_HALO_OPENMP: + field_halo_post(obj, &obj->h); + field_halo_wait(obj, &obj->h); + break; default: assert(0); } @@ -954,3 +973,373 @@ static int field_write_ascii(FILE * fp, int index, void * self) { return 0; } + +/***************************************************************************** + * + * field_halo_size + * + *****************************************************************************/ + +int field_halo_size(cs_limits_t lim) { + + int szx = 1 + lim.imax - lim.imin; + int szy = 1 + lim.jmax - lim.jmin; + int szz = 1 + lim.kmax - lim.kmin; + + return szx*szy*szz; +} + +/***************************************************************************** + * + * field_halo_enqueue_send + * + *****************************************************************************/ + +int field_halo_enqueue_send(const field_t * field, field_halo_t * h, int ireq) { + + assert(field); + assert(h); + assert(1 <= ireq && ireq < h->nvel); + + int nx = 1 + h->slim[ireq].imax - h->slim[ireq].imin; + int ny = 1 + h->slim[ireq].jmax - h->slim[ireq].jmin; + int nz = 1 + h->slim[ireq].kmax - h->slim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; + + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->slim[ireq].imin + ih/strx; + int jc = h->slim[ireq].jmin + (ih % strx)/stry; + int kc = h->slim[ireq].kmin + (ih % stry)/strz; + int index = cs_index(field->cs, ic, jc, kc); + + for (int ibf = 0; ibf < field->nf; ibf++) { + int faddr = addr_rank1(field->nsites, field->nf, index, ibf); + h->send[ireq][ih*field->nf + ibf] = field->data[faddr]; + } + } + + return 0; +} + +/***************************************************************************** + * + * field_halo_dequeue_recv + * + *****************************************************************************/ + +int field_halo_dequeue_recv(field_t * field, const field_halo_t * h, int ireq) { + assert(field); + assert(h); + assert(1 <= ireq && ireq < h->nvel); + + int nx = 1 + h->rlim[ireq].imax - h->rlim[ireq].imin; + int ny = 1 + h->rlim[ireq].jmax - h->rlim[ireq].jmin; + int nz = 1 + h->rlim[ireq].kmax - h->rlim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; + + double * recv = h->recv[ireq]; + + /* Check if this a copy from our own send buffer */ + { + int i = 1 + h->cv[h->nvel - ireq][X]; + int j = 1 + h->cv[h->nvel - ireq][Y]; + int k = 1 + h->cv[h->nvel - ireq][Z]; + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) recv = h->send[ireq]; + } + + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->rlim[ireq].imin + ih/strx; + int jc = h->rlim[ireq].jmin + (ih % strx)/stry; + int kc = h->rlim[ireq].kmin + (ih % stry)/strz; + int index = cs_index(field->cs, ic, jc, kc); + + for (int ibf = 0; ibf < field->nf; ibf++) { + int faddr = addr_rank1(field->nsites, field->nf, index, ibf); + field->data[faddr] = recv[ih*field->nf + ibf]; + } + } + + return 0; +} + +/***************************************************************************** + * + * field_halo_create + * + * It's convenient to borrow the velocity notation from the lb for + * the commnunication directions. + * + *****************************************************************************/ + +#include "lb_d3q27.h" + +int field_halo_create(const field_t * field, field_halo_t * h) { + + int nlocal[3] = {}; + int nhalo = 0; + + assert(field); + assert(h); + + *h = (field_halo_t) {0}; + + /* Communictation model */ + + cs_cart_comm(field->cs, &h->comm); + + { + LB_CV_D3Q27(cv27); + + h->nvel = 27; + for (int p = 0; p < h->nvel; p++) { + h->cv[p][X] = cv27[p][X]; + h->cv[p][Y] = cv27[p][Y]; + h->cv[p][Z] = cv27[p][Z]; + } + } + + /* Ranks of Cartesian neighbours */ + + { + int dims[3] = {}; + int periods[3] = {}; + int coords[3] = {}; + + MPI_Cart_get(h->comm, 3, dims, periods, coords); + + for (int p = 0; p < h->nvel; p++) { + int nbr[3] = {}; + int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int i = 1 + h->cv[p][X]; + int j = 1 + h->cv[p][Y]; + int k = 1 + h->cv[p][Z]; + + nbr[X] = coords[X] + h->cv[p][X]; + nbr[Y] = coords[Y] + h->cv[p][Y]; + nbr[Z] = coords[Z] + h->cv[p][Z]; + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + + if (out[X] || out[Y] || out[Z]) { + h->nbrrank[i][j][k] = MPI_PROC_NULL; + } + else { + MPI_Cart_rank(h->comm, nbr, &h->nbrrank[i][j][k]); + } + } + /* I must be in the middle */ + assert(h->nbrrank[1][1][1] == cs_cart_rank(field->cs)); + } + + /* Set out limits for send and recv regions. */ + + cs_nlocal(field->cs, nlocal); + cs_nhalo(field->cs, &nhalo); + + for (int p = 1; p < h->nvel; p++) { + + int8_t cx = h->cv[p][X]; + int8_t cy = h->cv[p][Y]; + int8_t cz = h->cv[p][Z]; + + cs_limits_t send = {1, nlocal[X], 1, nlocal[Y], 1, nlocal[Z]}; + cs_limits_t recv = {1, nlocal[X], 1, nlocal[Y], 1, nlocal[Z]}; + + if (cx == -1) send.imax = nhalo; + if (cx == +1) send.imin = send.imax - (nhalo - 1); + if (cy == -1) send.jmax = nhalo; + if (cy == +1) send.jmin = send.jmax - (nhalo - 1); + if (cz == -1) send.kmax = nhalo; + if (cz == +1) send.kmin = send.kmax - (nhalo - 1); + + /* For recv, direction is reversed cf. send */ + if (cx == +1) { recv.imin = 1 - nhalo; recv.imax = 0;} + if (cx == -1) { recv.imin = recv.imax + 1; recv.imax = recv.imax + nhalo;} + if (cy == +1) { recv.jmin = 1 - nhalo; recv.jmax = 0;} + if (cy == -1) { recv.jmin = recv.jmax + 1; recv.jmax = recv.jmax + nhalo;} + if (cz == +1) { recv.kmin = 1 - nhalo; recv.kmax = 0;} + if (cz == -1) { recv.kmin = recv.kmax + 1; recv.kmax = recv.kmax + nhalo;} + + h->slim[p] = send; + h->rlim[p] = recv; + } + + /* Message count and buffers */ + + for (int p = 1; p < h->nvel; p++) { + + int scount = field->nf*field_halo_size(h->slim[p]); + int rcount = field->nf*field_halo_size(h->rlim[p]); + + h->send[p] = (double *) malloc(scount*sizeof(double)); + h->recv[p] = (double *) malloc(rcount*sizeof(double)); + assert(h->send[p]); + assert(h->recv[p]); + } + + return 0; +} + +/***************************************************************************** + * + * field_halo_post + * + *****************************************************************************/ + +int field_halo_post(const field_t * field, field_halo_t * h) { + + const int tagbase = 2022; + + assert(field); + assert(h); + + /* Post recvs */ + + h->request[0] = MPI_REQUEST_NULL; + + for (int ireq = 1; ireq < h->nvel; ireq++) { + + int i = 1 + h->cv[h->nvel - ireq][X]; + int j = 1 + h->cv[h->nvel - ireq][Y]; + int k = 1 + h->cv[h->nvel - ireq][Z]; + int mcount = field->nf*field_halo_size(h->rlim[ireq]); + + h->request[ireq] = MPI_REQUEST_NULL; + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + MPI_Irecv(h->recv[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + tagbase + ireq, h->comm, h->request + ireq); + } + + /* Load send buffers; post sends */ + + #pragma omp parallel + { + for (int ireq = 1; ireq < h->nvel; ireq++) { + field_halo_enqueue_send(field, h, ireq); + } + } + + h->request[27] = MPI_REQUEST_NULL; + + for (int ireq = 1; ireq < h->nvel; ireq++) { + int i = 1 + h->cv[ireq][X]; + int j = 1 + h->cv[ireq][Y]; + int k = 1 + h->cv[ireq][Z]; + int mcount = field->nf*field_halo_size(h->slim[ireq]); + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + tagbase + ireq, h->comm, h->request + 27 + ireq); + } + + return 0; +} + +/***************************************************************************** + * + * field_halo_wait + * + *****************************************************************************/ + +int field_halo_wait(field_t * field, field_halo_t * h) { + + assert(field); + assert(h); + + { + MPI_Status statuses[2*27] = {}; + MPI_Waitall(2*h->nvel, h->request, statuses); + } + + #pragma omp parallel + { + for (int ireq = 1; ireq < h->nvel; ireq++) { + field_halo_dequeue_recv(field, h, ireq); + } + } + + return 0; +} + +/***************************************************************************** + * + * field_halo_info + * + *****************************************************************************/ + +int field_halo_info(pe_t * pe, const field_t * f, const field_halo_t * h) { + + assert(pe); + assert(h); + + /* For each direction, send limits */ + + pe_info(pe, "\n"); + pe_info(pe, "Field halo information at root: %s\n", f->name); + pe_info(pe, "\n"); + pe_info(pe, "Send requests\n"); + pe_info(pe, + "Req (cx cy cz) imin imax jmin jmax kmin kmax bytes\n"); + pe_info(pe, + "------------------------------------------------------\n"); + for (int ireq = 1; ireq < h->nvel; ireq++) { + pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9d\n", ireq, + h->cv[ireq][X], h->cv[ireq][Y], h->cv[ireq][Z], + h->slim[ireq].imin, h->slim[ireq].imax, + h->slim[ireq].jmin, h->slim[ireq].jmax, + h->slim[ireq].kmin, h->slim[ireq].kmax, + f->nf*field_halo_size(h->slim[ireq])*sizeof(double)); + } + + /* Recv limits counts */ + pe_info(pe, "\n"); + pe_info(pe, "Receive requests\n"); + pe_info(pe, + "Req (cx cy cz) imin imax jmin jmax kmin kmax bytes\n"); + pe_info(pe, + "------------------------------------------------------\n"); + for (int ireq = 1; ireq < h->nvel; ireq++) { + pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9d\n", ireq, + h->cv[ireq][X], h->cv[ireq][Y], h->cv[ireq][Z], + h->rlim[ireq].imin, h->rlim[ireq].imax, + h->rlim[ireq].jmin, h->rlim[ireq].jmax, + h->rlim[ireq].kmin, h->rlim[ireq].kmax, + f->nf*field_halo_size(h->rlim[ireq])*sizeof(double)); + } + + + return 0; +} + +/***************************************************************************** + * + * field_halo_free + * + *****************************************************************************/ + +int field_halo_free(field_halo_t * h) { + + assert(h); + + for (int p = 1; p < h->nvel; p++) { + free(h->send[p]); + free(h->recv[p]); + } + + *h = (field_halo_t) {0}; + + return 0; +} diff --git a/src/field.h b/src/field.h index 88bb06dab..d695ea742 100644 --- a/src/field.h +++ b/src/field.h @@ -23,9 +23,29 @@ #include "io_harness.h" #include "leesedwards.h" #include "halo_swap.h" +#include "field_options.h" + +/* Halo */ + +#include "cs_limits.h" + +typedef struct field_halo_s field_halo_t; + +struct field_halo_s { + + MPI_Comm comm; /* coords: Cartesian communicator */ + int nbrrank[3][3][3]; /* coords: Cartesian neighbours */ + + int nvel; /* Number of directions involved (2d or 3d) */ + int8_t cv[27][3]; /* Send/recv directions */ + cs_limits_t slim[27]; /* halo: send regions (rectangular) */ + cs_limits_t rlim[27]; /* halo: recv regions (rectangular) */ + double * send[27]; /* halo: send data buffers */ + double * recv[27]; /* halo: recv data buffers */ + MPI_Request request[2*27]; /* halo: array of send/recv requests */ +}; typedef struct field_s field_t; -typedef enum {FIELD_HALO_HOST = 0, FIELD_HALO_TARGET} field_halo_enum_t; struct field_s { int nf; /* Number of field components */ @@ -41,16 +61,26 @@ struct field_s { lees_edw_t * le; /* Lees-Edwards */ io_info_t * info; /* I/O Handler */ halo_swap_t * halo; /* Halo swap driver object */ + field_halo_t h; /* Host halo */ + field_options_t opts; /* Options */ field_t * target; /* target structure */ }; -__host__ int field_create(pe_t * pe, cs_t * cs, int nf, const char * name, + +int field_halo_create(const field_t * field, field_halo_t * h); +int field_halo_post(const field_t * field, field_halo_t * h); +int field_halo_wait(field_t * field, field_halo_t * h); +int field_halo_info(pe_t * pe, const field_t * field, const field_halo_t * h); +int field_halo_free(field_halo_t * h); + +__host__ int field_create(pe_t * pe, cs_t * cs, lees_edw_t * le, + const char * name, + const field_options_t * opts, field_t ** pobj); __host__ int field_free(field_t * obj); __host__ int field_memcpy(field_t * obj, tdpMemcpyKind flag); -__host__ int field_init(field_t * obj, int nhcomm, lees_edw_t * le); __host__ int field_init_io_info(field_t * obj, int grid[3], int form_in, int form_out); __host__ int field_io_info(field_t * obj, io_info_t ** info); From 421580fb6f326b01996b84bb06a182c3ee5e4dc9 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Thu, 30 Dec 2021 19:59:55 +0000 Subject: [PATCH 07/64] Update field header/initialisation --- src/advection.c | 1 - src/advection_bcs.c | 1 - src/blue_phase.c | 11 ++-- src/blue_phase_beris_edwards.c | 1 - src/blue_phase_init.c | 1 - src/brazovskii.c | 1 - src/cahn_hilliard.c | 1 - src/cahn_hilliard_stats.c | 1 - src/collision.c | 1 - src/distribution_rt.c | 2 +- src/fe_ternary_rt.c | 1 - src/fe_ternary_stats.c | 1 - src/field_options.c | 66 +++++++++++++++++++ src/field_options.h | 39 ++++++++++++ src/field_phi_init.c | 1 - src/field_psi_init_rt.c | 1 - src/field_s.h | 23 ------- src/field_ternary_init.c | 1 - src/gradient_2d_5pt_fluid.c | 1 - src/gradient_2d_ternary_solid.c | 1 - src/gradient_2d_tomita_fluid.c | 1 - src/gradient_3d_27pt_fluid.c | 1 - src/gradient_3d_27pt_solid.c | 1 - src/gradient_3d_7pt_fluid.c | 1 - src/gradient_3d_7pt_solid.c | 1 - src/gradient_3d_ternary_solid.c | 1 - src/input-new-ternary1 | 89 ++++++++++++++++++++++++++ src/input-ternary1 | 88 +++++++++++++++++++++++++ src/input-ternary2 | 88 +++++++++++++++++++++++++ src/input-ternary3 | 92 +++++++++++++++++++++++++++ src/lb_data.h | 2 + src/leslie_ericksen.c | 1 - src/ludwig.c | 90 ++++++++++++++++---------- src/model.c | 12 ++-- src/phi_cahn_hilliard.c | 5 +- src/phi_force.c | 1 - src/phi_lb_coupler.c | 1 - src/polar_active.c | 1 - src/polar_active_rt.c | 3 - src/stats_symmetric.c | 1 - src/surfactant_rt.c | 12 ++-- src/symmetric.c | 1 - src/visc_arrhenius.c | 1 - tests/unit/test_blue_phase.c | 11 ++-- tests/unit/test_fe_electro_symm.c | 7 +- tests/unit/test_fe_surfactant1.c | 7 +- tests/unit/test_fe_ternary.c | 5 +- tests/unit/test_field.c | 82 ++++++++++++++++++------ tests/unit/test_field_grad.c | 21 +++--- tests/unit/test_lb_bc_inflow_rhou.c | 2 +- tests/unit/test_model.c | 22 ++++--- tests/unit/test_phi_bc_inflow_fixed.c | 5 +- tests/unit/test_phi_bc_outflow_free.c | 5 +- tests/unit/test_phi_ch.c | 9 +-- tests/unit/test_polar_active.c | 5 +- tests/unit/test_visc_arrhenius.c | 7 +- 56 files changed, 665 insertions(+), 173 deletions(-) create mode 100644 src/field_options.c create mode 100644 src/field_options.h delete mode 100644 src/field_s.h create mode 100644 src/input-new-ternary1 create mode 100644 src/input-ternary1 create mode 100644 src/input-ternary2 create mode 100644 src/input-ternary3 diff --git a/src/advection.c b/src/advection.c index 62bb15474..cbc773509 100644 --- a/src/advection.c +++ b/src/advection.c @@ -33,7 +33,6 @@ #include #include -#include "field_s.h" #include "advection_s.h" #include "psi_gradients.h" #include "hydro.h" diff --git a/src/advection_bcs.c b/src/advection_bcs.c index ea2f12b4a..971b69077 100644 --- a/src/advection_bcs.c +++ b/src/advection_bcs.c @@ -24,7 +24,6 @@ #include "kernel.h" #include "advection_s.h" #include "psi_gradients.h" -#include "field_s.h" #include "timer.h" #include "advection_bcs.h" diff --git a/src/blue_phase.c b/src/blue_phase.c index e89812c3f..d2004c02a 100644 --- a/src/blue_phase.c +++ b/src/blue_phase.c @@ -22,7 +22,6 @@ #include "util.h" #include "physics.h" -#include "field_s.h" #include "blue_phase.h" static __constant__ fe_lc_param_t const_param; @@ -105,9 +104,13 @@ __host__ int fe_lc_create(pe_t * pe, cs_t * cs, lees_edw_t * le, /* Additional active stress field "p" */ cs_nhalo(fe->cs, &nhalo); - field_create(fe->pe, fe->cs, 3, "Active P", &fe->p); - field_init(fe->p, nhalo, le); - field_grad_create(fe->pe, fe->p, 2, &fe->dp); + + { + /* Active P 3-vector */ + field_options_t opts = field_options_ndata_nhalo(3, nhalo); + field_create(pe, cs, le, "Active P", &opts, &fe->p); + field_grad_create(pe, fe->p, 2, &fe->dp); + } /* free energy interface functions */ fe->super.func = &fe_hvt; diff --git a/src/blue_phase_beris_edwards.c b/src/blue_phase_beris_edwards.c index 93012845a..c8f55baf1 100644 --- a/src/blue_phase_beris_edwards.c +++ b/src/blue_phase_beris_edwards.c @@ -53,7 +53,6 @@ #include "blue_phase.h" #include "blue_phase_beris_edwards.h" #include "advection_s.h" -#include "field_s.h" #include "colloids.h" #include "timer.h" diff --git a/src/blue_phase_init.c b/src/blue_phase_init.c index c533080d4..6020e429b 100644 --- a/src/blue_phase_init.c +++ b/src/blue_phase_init.c @@ -25,7 +25,6 @@ #include "pe.h" #include "util.h" #include "coords.h" -#include "field_s.h" #include "field_grad.h" #include "blue_phase.h" #include "blue_phase_init.h" diff --git a/src/brazovskii.c b/src/brazovskii.c index b7dc41ef5..97c090c68 100644 --- a/src/brazovskii.c +++ b/src/brazovskii.c @@ -38,7 +38,6 @@ #include #include "pe.h" -#include "field_s.h" #include "util.h" #include "brazovskii.h" diff --git a/src/cahn_hilliard.c b/src/cahn_hilliard.c index 7507612b1..d890dddf0 100644 --- a/src/cahn_hilliard.c +++ b/src/cahn_hilliard.c @@ -29,7 +29,6 @@ #include #include -#include "field_s.h" #include "advection_s.h" #include "advection_bcs.h" #include "coords_s.h" diff --git a/src/cahn_hilliard_stats.c b/src/cahn_hilliard_stats.c index 988b08148..587372413 100644 --- a/src/cahn_hilliard_stats.c +++ b/src/cahn_hilliard_stats.c @@ -18,7 +18,6 @@ #include #include "phi_cahn_hilliard.h" -#include "field_s.h" #include "util.h" #include "util_sum.h" diff --git a/src/collision.c b/src/collision.c index a12812908..e4530e3cc 100644 --- a/src/collision.c +++ b/src/collision.c @@ -34,7 +34,6 @@ #include "visc.h" #include "control.h" #include "collision.h" -#include "field_s.h" #include "kernel.h" #include "timer.h" diff --git a/src/distribution_rt.c b/src/distribution_rt.c index 1222d59d0..99c085608 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -272,7 +272,7 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { options.halo = LB_HALO_OPENMP_REDUCED; } - else { + else if (havetype) { pe_fatal(pe, "lb_halo_scheme not recognised\n"); } if (havetype) { diff --git a/src/fe_ternary_rt.c b/src/fe_ternary_rt.c index 9b2481e22..a1df9112e 100644 --- a/src/fe_ternary_rt.c +++ b/src/fe_ternary_rt.c @@ -22,7 +22,6 @@ #include "runtime.h" #include "fe_ternary.h" #include "fe_ternary_rt.h" -#include "field_s.h" #include "field_ternary_init.h" /**************************************************************************** diff --git a/src/fe_ternary_stats.c b/src/fe_ternary_stats.c index 01877ffd0..2fc5c0154 100644 --- a/src/fe_ternary_stats.c +++ b/src/fe_ternary_stats.c @@ -20,7 +20,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "field_s.h" #include "fe_ternary_stats.h" diff --git a/src/field_options.c b/src/field_options.c new file mode 100644 index 000000000..fe1ce3cdc --- /dev/null +++ b/src/field_options.c @@ -0,0 +1,66 @@ +/***************************************************************************** + * + * field_options.c + * + * Wrangle field options. + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford + * + *****************************************************************************/ + +#include + +#include "field_options.h" + +/***************************************************************************** + * + * field_options_default + * + *****************************************************************************/ + +field_options_t field_options_default(void) { + + field_options_t opts = {.ndata = 1, + .nhcomm = 0, + .haloscheme = FIELD_HALO_TARGET, + .iodata = io_info_args_default()}; + return opts; +} + +/***************************************************************************** + * + * field_options_ndata_nhalo + * + *****************************************************************************/ + +field_options_t field_options_ndata_nhalo(int ndata, int nhalo) { + + field_options_t opts = field_options_default(); + + opts.ndata = ndata; + opts.nhcomm = nhalo; + + return opts; +} + +/***************************************************************************** + * + * field_options_valid + * + *****************************************************************************/ + +int field_options_valid(const field_options_t * opts) { + + int valid = 1; + + if (opts->ndata < 1) valid = 0; + if (opts->nhcomm < 0) valid = 0; /* Must also be < nhalo ... */ + + return valid; +} diff --git a/src/field_options.h b/src/field_options.h new file mode 100644 index 000000000..360e97b79 --- /dev/null +++ b/src/field_options.h @@ -0,0 +1,39 @@ +/***************************************************************************** + * + * field_options.h + * + * Container. + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contrbuting authors: + * Kevin Stratford + * + *****************************************************************************/ + +#ifndef LUDWIG_FIELD_OPTIONS_H +#define LUDWIG_FIELD_OPTIONS_H + +#include "io_info_args.h" + +typedef enum field_halo_enum {FIELD_HALO_HOST, + FIELD_HALO_TARGET, + FIELD_HALO_OPENMP} field_halo_enum_t; + +typedef struct field_options_s field_options_t; + +struct field_options_s { + int ndata; /* Number of field components */ + int nhcomm; /* Actual halo width required */ + field_halo_enum_t haloscheme; /* Halo swap method */ + io_info_args_t iodata; /* I/O information */ +}; + +field_options_t field_options_default(void); +field_options_t field_options_ndata_nhalo(int ndata, int nhalo); +int field_options_valid(const field_options_t * opts); + +#endif diff --git a/src/field_phi_init.c b/src/field_phi_init.c index 4e0868516..541183a73 100644 --- a/src/field_phi_init.c +++ b/src/field_phi_init.c @@ -20,7 +20,6 @@ #include "noise.h" #include "util.h" -#include "field_s.h" #include "field_phi_init.h" /***************************************************************************** diff --git a/src/field_psi_init_rt.c b/src/field_psi_init_rt.c index d0ef42811..c6056cbc1 100644 --- a/src/field_psi_init_rt.c +++ b/src/field_psi_init_rt.c @@ -18,7 +18,6 @@ #include #include -#include "field_s.h" #include "field_psi_init_rt.h" int field_init_uniform(field_t * psi, double psi0); diff --git a/src/field_s.h b/src/field_s.h deleted file mode 100644 index 289573644..000000000 --- a/src/field_s.h +++ /dev/null @@ -1,23 +0,0 @@ -/***************************************************************************** - * - * field_s.h - * - * $Id$ - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2012-2016 The University of Edinburgh - * - *****************************************************************************/ - -#ifndef FIELD_S_H -#define FIELD_S_H - -/* TO BE REMOVED */ - -#define addr_qab(nsites, index, ia) addr_rank1(nsites, NQAB, index, ia) - -#endif - diff --git a/src/field_ternary_init.c b/src/field_ternary_init.c index 8eedcb523..7282349c7 100644 --- a/src/field_ternary_init.c +++ b/src/field_ternary_init.c @@ -33,7 +33,6 @@ #include "noise.h" #include "util.h" -#include "field_s.h" #include "field_ternary_init.h" /* Three phases c_1, c_2, c_3 */ diff --git a/src/gradient_2d_5pt_fluid.c b/src/gradient_2d_5pt_fluid.c index 937b4ad33..27d0d4e93 100644 --- a/src/gradient_2d_5pt_fluid.c +++ b/src/gradient_2d_5pt_fluid.c @@ -31,7 +31,6 @@ #include "pe.h" #include "coords.h" -#include "field_s.h" #include "leesedwards.h" #include "wall.h" #include "gradient_2d_5pt_fluid.h" diff --git a/src/gradient_2d_ternary_solid.c b/src/gradient_2d_ternary_solid.c index 933e4cd33..cc8257cf7 100644 --- a/src/gradient_2d_ternary_solid.c +++ b/src/gradient_2d_ternary_solid.c @@ -24,7 +24,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "field_s.h" #include "gradient_2d_ternary_solid.h" typedef struct solid_s { diff --git a/src/gradient_2d_tomita_fluid.c b/src/gradient_2d_tomita_fluid.c index 76a055037..ba15e2289 100644 --- a/src/gradient_2d_tomita_fluid.c +++ b/src/gradient_2d_tomita_fluid.c @@ -48,7 +48,6 @@ #include "leesedwards.h" #include "kernel.h" #include "wall.h" -#include "field_s.h" #include "gradient_2d_tomita_fluid.h" static const double epsilon_ = 0.5; diff --git a/src/gradient_3d_27pt_fluid.c b/src/gradient_3d_27pt_fluid.c index b5accf82b..042da671e 100644 --- a/src/gradient_3d_27pt_fluid.c +++ b/src/gradient_3d_27pt_fluid.c @@ -48,7 +48,6 @@ #include "kernel.h" #include "leesedwards.h" #include "wall.h" -#include "field_s.h" #include "gradient_3d_27pt_fluid.h" typedef enum grad_enum_type {GRAD_DEL2, GRAD_DEL4} grad_enum_t; diff --git a/src/gradient_3d_27pt_solid.c b/src/gradient_3d_27pt_solid.c index e4feba8bc..7e3f98030 100644 --- a/src/gradient_3d_27pt_solid.c +++ b/src/gradient_3d_27pt_solid.c @@ -39,7 +39,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "field_s.h" #include "gradient_3d_27pt_solid.h" typedef struct solid_s { diff --git a/src/gradient_3d_7pt_fluid.c b/src/gradient_3d_7pt_fluid.c index 47a773f55..b51d37071 100644 --- a/src/gradient_3d_7pt_fluid.c +++ b/src/gradient_3d_7pt_fluid.c @@ -38,7 +38,6 @@ #include "pe.h" #include "leesedwards.h" -#include "field_s.h" #include "timer.h" #include "gradient_3d_7pt_fluid.h" diff --git a/src/gradient_3d_7pt_solid.c b/src/gradient_3d_7pt_solid.c index 3402a1243..9f8f7c440 100644 --- a/src/gradient_3d_7pt_solid.c +++ b/src/gradient_3d_7pt_solid.c @@ -60,7 +60,6 @@ #include "coords.h" #include "kernel.h" #include "colloids.h" -#include "field_s.h" #include "gradient_3d_7pt_solid.h" typedef struct param_s param_t; diff --git a/src/gradient_3d_ternary_solid.c b/src/gradient_3d_ternary_solid.c index f82e0e6f2..0e2124494 100644 --- a/src/gradient_3d_ternary_solid.c +++ b/src/gradient_3d_ternary_solid.c @@ -29,7 +29,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "field_s.h" #include "gradient_3d_ternary_solid.h" typedef struct solid_s { diff --git a/src/input-new-ternary1 b/src/input-new-ternary1 new file mode 100644 index 000000000..967ebffe4 --- /dev/null +++ b/src/input-new-ternary1 @@ -0,0 +1,89 @@ +############################################################################## +# +# +# +############################################################################## + +############################################################################## +# +# Run duration +# +############################################################################### + + +N_cycles 200000 + +############################################################################## +# +# System +# +############################################################################## + +size 180_120_1 +grid 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.16666666666667 + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy ternary + +ternary_kappa1 0.01 +ternary_kappa2 0.02 +ternary_kappa3 0.001 +ternary_alpha 1.00 + +ternary_mobility_phi 0.500 +ternary_mobility_psi 0.167 + +ternary_initialisation 2d_double_emulsion + +hydrodynamics no +fd_gradient_calculation 2d_tomita_fluid + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init no_colloids + +############################################################################### +# +# Periodic conditions / boundaries +# +############################################################################### + +boundary_walls_on no +periodicity 1_1_1 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 1000 +phi_format BINARY +config_at_end yes + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/src/input-ternary1 b/src/input-ternary1 new file mode 100644 index 000000000..de80a83f1 --- /dev/null +++ b/src/input-ternary1 @@ -0,0 +1,88 @@ +############################################################################## +# +# +# +############################################################################## + +############################################################################## +# +# Run duration +# +############################################################################### + +N_cycles 20000 + +############################################################################## +# +# System +# +############################################################################## + +size 50_50_1 +grid 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.16666666666667 + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy ternary + +ternary_kappa1 0.01 +ternary_kappa2 0.02 +ternary_kappa3 0.05 +ternary_alpha 1.00 + +ternary_mobility_phi 0.15 +ternary_mobility_psi 0.10 + +ternary_initialisation 2d_double_emulsion + +hydrodynamics no +fd_gradient_calculation 2d_tomita_fluid + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init no_colloids + +############################################################################### +# +# Periodic conditions / boundaries +# +############################################################################### + +boundary_walls_on no +periodicity 1_1_1 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 1000 +phi_format BINARY +config_at_end yes + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/src/input-ternary2 b/src/input-ternary2 new file mode 100644 index 000000000..9d46ce4d0 --- /dev/null +++ b/src/input-ternary2 @@ -0,0 +1,88 @@ +############################################################################## +# +# +# +############################################################################## + +############################################################################## +# +# Run duration +# +############################################################################### + +N_cycles 20000 + +############################################################################## +# +# System +# +############################################################################## + +size 50_50_1 +grid 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.16666666666667 + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy ternary + +ternary_kappa1 0.01 +ternary_kappa2 0.02 +ternary_kappa3 0.05 +ternary_alpha 1.00 + +ternary_mobility_phi 0.15 +ternary_mobility_psi 0.10 + +ternary_initialisation 2d_double_emulsion + +hydrodynamics no +fd_gradient_calculation 2d_ternary_solid + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init no_colloids + +############################################################################### +# +# Periodic conditions / boundaries +# +############################################################################### + +boundary_walls_on no +periodicity 1_1_1 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 200 +phi_format BINARY +config_at_end yes + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/src/input-ternary3 b/src/input-ternary3 new file mode 100644 index 000000000..e3353148f --- /dev/null +++ b/src/input-ternary3 @@ -0,0 +1,92 @@ +############################################################################## +# +# Contact angle cf Fig. 2 +# +############################################################################## + +############################################################################## +# +# Run duration +# +############################################################################### + +N_cycles 40000 + +############################################################################## +# +# System +# +############################################################################## + +size 50_50_1 +grid 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.16666666666667 + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy ternary + +ternary_kappa1 0.01 +ternary_kappa2 0.02 +ternary_kappa3 0.03 +ternary_alpha 1.00 + +ternary_h1 -0.001 +ternary_h2 +0.002 +ternary_h3 0.000 + +ternary_mobility_phi 0.15 +ternary_mobility_psi 0.10 + +ternary_initialisation 2d_tee + +hydrodynamics no +fd_gradient_calculation 2d_ternary_solid + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init no_colloids + +############################################################################### +# +# Periodic conditions / boundaries +# +############################################################################### + +boundary_walls 1_1_0 +periodicity 0_0_1 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 200 +phi_format BINARY +config_at_end yes + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/src/lb_data.h b/src/lb_data.h index fb24b91c2..f36cc4ea7 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -103,6 +103,8 @@ struct lb_halo_s { }; int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme); +int lb_halo_post(const lb_t * lb, lb_halo_t * h); +int lb_halo_wait(lb_t * lb, lb_halo_t * h); int lb_halo_free(lb_t * lb, lb_halo_t * h); struct lb_data_s { diff --git a/src/leslie_ericksen.c b/src/leslie_ericksen.c index 66fe374e0..15c947edf 100644 --- a/src/leslie_ericksen.c +++ b/src/leslie_ericksen.c @@ -20,7 +20,6 @@ #include "pe.h" #include "coords.h" -#include "field_s.h" #include "advection_s.h" #include "leslie_ericksen.h" diff --git a/src/ludwig.c b/src/ludwig.c index 16b619364..7b2ec72ac 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -119,8 +119,6 @@ #include "fe_lc_stats.h" #include "fe_ternary_stats.h" -#include "field_s.h" - #include "ludwig.h" typedef struct ludwig_s ludwig_t; @@ -1303,9 +1301,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, le); - field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "phi", &opts, &ludwig->phi); + field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1375,9 +1375,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, le); - field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "phi", &opts, &ludwig->phi); + field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1413,10 +1415,12 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, le); - field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); - phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "phi", &opts, &ludwig->phi); + field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1459,8 +1463,10 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* No Lees Edwards for the time being */ - field_create(pe, cs, nf, "surfactant1", &ludwig->phi); - field_init(ludwig->phi, nhalo, NULL); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, NULL, "surfactant1", &opts, &ludwig->phi); + } field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); @@ -1516,8 +1522,10 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* No Lees Edwards for the time being */ - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, NULL); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, NULL, "phi", &opts, &ludwig->phi); + } field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); @@ -1582,9 +1590,15 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "q", &ludwig->q); - field_init(ludwig->q, nhalo, le); - field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + + if (rt_switch(rt, "field_halo_openmp")) { + opts.haloscheme = FIELD_HALO_OPENMP; + } + field_create(pe, cs, le, "q", &opts, &ludwig->q); + field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1630,9 +1644,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "p", &ludwig->p); - field_init(ludwig->p, nhalo, le); - field_grad_create(pe, ludwig->p, ngrad, &ludwig->p_grad); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "p", &opts, &ludwig->p); + field_grad_create(pe, ludwig->p, ngrad, &ludwig->p_grad); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1679,10 +1695,12 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, le); - field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); - phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "phi", &opts, &ludwig->phi); + field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1709,10 +1727,12 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* Liquid crystal part */ nhalo = 2; /* Required for stress diveregnce. */ ngrad = 2; /* (\nabla^2) required */ - - field_create(pe, cs, NQAB, "q", &ludwig->q); - field_init(ludwig->q, nhalo, le); - field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); + + { + field_options_t opts = field_options_ndata_nhalo(NQAB, nhalo); + field_create(pe, cs, le, "q", &opts, &ludwig->q); + field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); + } pe_info(pe, "\n"); pe_info(pe, "Free energy details\n"); @@ -1809,10 +1829,12 @@ int free_energy_init_rt(ludwig_t * ludwig) { lees_edw_create(pe, cs, info, &le); lees_edw_info(le); - field_create(pe, cs, nf, "phi", &ludwig->phi); - field_init(ludwig->phi, nhalo, le); - field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); - phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + { + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + field_create(pe, cs, le, "phi", &opts, &ludwig->phi); + field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); + phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); + } pe_info(pe, "\n"); pe_info(pe, "Charged binary fluid 'Electrosymmetric' free energy\n"); diff --git a/src/model.c b/src/model.c index f3cb7bafa..77947e62f 100644 --- a/src/model.c +++ b/src/model.c @@ -45,8 +45,6 @@ static int lb_rho_write_ascii(FILE *, int index, void * self); static int lb_model_param_init(lb_t * lb); static int lb_init(lb_t * lb); -int lb_halo_post(const lb_t * lb, lb_halo_t * h); -int lb_halo_wait(lb_t * lb, lb_halo_t * h); int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int irreq); int lb_halo_enqueue_send(const lb_t * lb, lb_halo_t * h, int irreq); @@ -1745,7 +1743,7 @@ int lb_halo_size(cs_limits_t lim) { int lb_halo_enqueue_send(const lb_t * lb, lb_halo_t * h, int ireq) { - assert(1 <= ireq && ireq < h->map.nvel); + assert(0 <= ireq && ireq < h->map.nvel); assert(lb->ndist == 1); if (h->count[ireq] > 0) { @@ -1804,7 +1802,7 @@ int lb_halo_dequeue_recv(lb_t * lb, const lb_halo_t * h, int ireq) { assert(lb); assert(h); - assert(0 < ireq && ireq < h->map.nvel); + assert(0 <= ireq && ireq < h->map.nvel); assert(lb->ndist == 1); if (h->count[ireq] > 0) { @@ -1999,6 +1997,12 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { } } + /* Ensure all requests are NULL in case a particular one is not required */ + + for (int ireq = 0; ireq < 2*27; ireq++) { + h->request[ireq] = MPI_REQUEST_NULL; + } + return 0; } diff --git a/src/phi_cahn_hilliard.c b/src/phi_cahn_hilliard.c index 1a33d3c43..4426a0e1c 100644 --- a/src/phi_cahn_hilliard.c +++ b/src/phi_cahn_hilliard.c @@ -40,7 +40,6 @@ #include #include -#include "field_s.h" #include "physics.h" #include "advection_s.h" #include "advection_bcs.h" @@ -121,8 +120,8 @@ __host__ int phi_ch_create(pe_t * pe, cs_t * cs, lees_edw_t * le, advflux_le_create(pe, cs, le, 1, &obj->flux); if (obj->info.conserve) { - field_create(pe, cs, 1, "compensated sum", &obj->csum); - field_init(obj->csum, 0, NULL); + field_options_t opts = field_options_ndata_nhalo(1, 0); + field_create(pe, cs, NULL, "compensated sum", &opts, &obj->csum); } pe_retain(pe); diff --git a/src/phi_force.c b/src/phi_force.c index 338055069..86b0cb061 100644 --- a/src/phi_force.c +++ b/src/phi_force.c @@ -30,7 +30,6 @@ #include #include "kernel.h" -#include "field_s.h" #include "hydro.h" #include "pth_s.h" #include "timer.h" diff --git a/src/phi_lb_coupler.c b/src/phi_lb_coupler.c index 7870d9a1e..33078b84e 100644 --- a/src/phi_lb_coupler.c +++ b/src/phi_lb_coupler.c @@ -20,7 +20,6 @@ #include "pe.h" #include "coords.h" #include "kernel.h" -#include "field_s.h" #include "phi_lb_coupler.h" #define NDIST 2 diff --git a/src/polar_active.c b/src/polar_active.c index 8be71935f..f9614fd90 100644 --- a/src/polar_active.c +++ b/src/polar_active.c @@ -48,7 +48,6 @@ #include "pe.h" #include "coords.h" -#include "field_s.h" #include "polar_active.h" #include "util.h" diff --git a/src/polar_active_rt.c b/src/polar_active_rt.c index 41aa7dce3..5c17a712f 100644 --- a/src/polar_active_rt.c +++ b/src/polar_active_rt.c @@ -4,8 +4,6 @@ * * Run time initialisation for active gel free energy. * - * $Id$ - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * @@ -23,7 +21,6 @@ #include #include "coords.h" -#include "field_s.h" #include "polar_active_rt.h" static int polar_active_init_code(field_t * p); diff --git a/src/stats_symmetric.c b/src/stats_symmetric.c index c2125dd4c..a133bbe10 100644 --- a/src/stats_symmetric.c +++ b/src/stats_symmetric.c @@ -21,7 +21,6 @@ #include "pe.h" #include "util.h" #include "coords.h" -#include "field_s.h" #include "symmetric.h" #include "stats_symmetric.h" diff --git a/src/surfactant_rt.c b/src/surfactant_rt.c index a61c5bf39..462225d62 100644 --- a/src/surfactant_rt.c +++ b/src/surfactant_rt.c @@ -21,7 +21,6 @@ #include "surfactant.h" #include "surfactant_rt.h" -#include "field_s.h" #include "field_phi_init_rt.h" #include "field_psi_init_rt.h" @@ -73,6 +72,7 @@ __host__ int fe_surf_phi_init_rt(pe_t * pe, rt_t * rt, fe_surf_t * fe, field_t * phi) { field_phi_info_t param = {0}; + field_options_t opts = field_options_default(); field_t * tmp = NULL; assert(pe); @@ -85,8 +85,7 @@ __host__ int fe_surf_phi_init_rt(pe_t * pe, rt_t * rt, fe_surf_t * fe, /* Initialise phi via a temporary scalar field */ - field_create(pe, phi->cs, 1, "tmp", &tmp); - field_init(tmp, 0, NULL); + field_create(pe, phi->cs, NULL, "tmp", &opts, &tmp); field_phi_init_rt(pe, rt, param, tmp); field_init_combine_insert(phi, tmp, 0); @@ -106,8 +105,10 @@ __host__ int fe_surf_phi_init_rt(pe_t * pe, rt_t * rt, fe_surf_t * fe, __host__ int fe_surf_psi_init_rt(pe_t * pe, rt_t * rt, fe_surf_t * fe, field_t * phi) { - field_t * tmp = NULL; + + field_options_t opts = field_options_default(); field_psi_info_t param = {0}; + field_t * tmp = NULL; assert(pe); assert(rt); @@ -116,8 +117,7 @@ __host__ int fe_surf_psi_init_rt(pe_t * pe, rt_t * rt, fe_surf_t * fe, /* Initialise surfactant via a temporary field */ - field_create(pe, phi->cs, 1, "tmp", &tmp); - field_init(tmp, 0, NULL); + field_create(pe, phi->cs, NULL, "tmp", &opts, &tmp); field_psi_init_rt(pe, rt, param, tmp); field_init_combine_insert(phi, tmp, 1); diff --git a/src/symmetric.c b/src/symmetric.c index 46d8c294b..4dfecbb06 100644 --- a/src/symmetric.c +++ b/src/symmetric.c @@ -33,7 +33,6 @@ #include "pe.h" #include "util.h" #include "coords.h" -#include "field_s.h" #include "symmetric.h" /* Defaults */ diff --git a/src/visc_arrhenius.c b/src/visc_arrhenius.c index 415b7eea0..0cfa892b3 100644 --- a/src/visc_arrhenius.c +++ b/src/visc_arrhenius.c @@ -28,7 +28,6 @@ #include #include -#include "field_s.h" #include "kernel.h" #include "visc_arrhenius.h" diff --git a/tests/unit/test_blue_phase.c b/tests/unit/test_blue_phase.c index 1bb2ae58c..fc8c41026 100644 --- a/tests/unit/test_blue_phase.c +++ b/tests/unit/test_blue_phase.c @@ -70,10 +70,13 @@ int test_bp_suite(void) { test_bp_nonfield(); - field_create(pe, cs, NQAB, "q", &fq); - field_init(fq, nhalo, le); - field_grad_create(pe, fq, 2, &fqgrad); - field_grad_set(fqgrad, grad_3d_27pt_fluid_d2, NULL); + { + field_options_t opts = field_options_ndata_nhalo(NQAB, nhalo); + field_create(pe, cs, le, "q", &opts, &fq); + + field_grad_create(pe, fq, 2, &fqgrad); + field_grad_set(fqgrad, grad_3d_27pt_fluid_d2, NULL); + } fe_lc_create(pe, cs, le, fq, fqgrad, &fe); diff --git a/tests/unit/test_fe_electro_symm.c b/tests/unit/test_fe_electro_symm.c index d00f1c691..6fb702016 100644 --- a/tests/unit/test_fe_electro_symm.c +++ b/tests/unit/test_fe_electro_symm.c @@ -92,9 +92,10 @@ static int do_test1(pe_t * pe) { assert(psi); fe_electro_create(pe, psi, &fe_elec); - field_create(pe, cs, 1, "phi", &phi); - assert(phi); - field_init(phi, 1, NULL); + { + field_options_t opts = field_options_ndata_nhalo(1, 1); + field_create(pe, cs, NULL, "phi", &opts, &phi); + } field_grad_create(pe, phi, 2, &dphi); assert(dphi); diff --git a/tests/unit/test_fe_surfactant1.c b/tests/unit/test_fe_surfactant1.c index f4c97fca4..06d0943fd 100644 --- a/tests/unit/test_fe_surfactant1.c +++ b/tests/unit/test_fe_surfactant1.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2019 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -66,11 +66,12 @@ __host__ int test_fe_surfactant1_suite(void) { } else { + field_options_t opts = field_options_ndata_nhalo(nf2, nhalo); + cs_create(pe, &cs); cs_init(cs); - field_create(pe, cs, nf2, "surfactant", &phi); - field_init(phi, nhalo, NULL); + field_create(pe, cs, NULL, "surfactant", &opts, &phi); test_fe_surf_create(pe, cs, phi); test_fe_surf_xi_etc(pe, cs, phi); diff --git a/tests/unit/test_fe_ternary.c b/tests/unit/test_fe_ternary.c index c07a7d014..419c78e98 100644 --- a/tests/unit/test_fe_ternary.c +++ b/tests/unit/test_fe_ternary.c @@ -57,11 +57,12 @@ __host__ int test_fe_ternary_suite(void) { } else { + field_options_t opts = field_options_ndata_nhalo(nf2, nhalo); + cs_create(pe, &cs); cs_init(cs); - field_create(pe, cs, nf2, "ternary", &phi); - field_init(phi, nhalo, NULL); + field_create(pe, cs, NULL, "ternary", &opts, &phi); test_fe_ternary_create(pe, cs, phi); test_fe_ternary_fed(pe, cs, phi); diff --git a/tests/unit/test_field.c b/tests/unit/test_field.c index d6f3f841d..e5b2a6dad 100644 --- a/tests/unit/test_field.c +++ b/tests/unit/test_field.c @@ -36,6 +36,8 @@ static int do_test_io(pe_t * pe, int nf, int io_format); static int test_field_halo(cs_t * cs, field_t * phi); int do_test_device1(pe_t * pe); +int test_field_halo_create(pe_t * pe); + __global__ void do_test_field_kernel1(field_t * phi); /***************************************************************************** @@ -61,6 +63,8 @@ int test_field_suite(void) { do_test_io(pe, 5, IO_FORMAT_ASCII); do_test_io(pe, 5, IO_FORMAT_BINARY); + test_field_halo_create(pe); + pe_info(pe, "PASS ./unit/test_field\n"); pe_free(pe); @@ -83,6 +87,7 @@ static int do_test0(pe_t * pe) { cs_t * cs = NULL; field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, nhalo); assert(pe); @@ -91,8 +96,7 @@ static int do_test0(pe_t * pe) { cs_ntotal_set(cs, ntotal); cs_init(cs); - field_create(pe, cs, nfref, "phi", &phi); - field_init(phi, nhalo, NULL); + field_create(pe, cs, NULL, "phi", &opts, &phi); /* Halo */ test_field_halo(cs, phi); @@ -122,6 +126,7 @@ int do_test1(pe_t * pe) { cs_t * cs = NULL; field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, nhalo); assert(pe); @@ -129,14 +134,12 @@ int do_test1(pe_t * pe) { cs_nhalo_set(cs, nhalo); cs_init(cs); - field_create(pe, cs, nfref, "phi", &phi); + field_create(pe, cs, NULL, "phi", &opts, &phi); assert(phi); field_nf(phi, &nf); assert(nf == nfref); - field_init(phi, nhalo, NULL); - ref = 1.0; field_scalar_set(phi, index, ref); field_scalar(phi, index, &value); @@ -176,6 +179,7 @@ int do_test_device1(pe_t * pe) { cs_t * cs = NULL; field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, nhalo); assert(pe); @@ -183,14 +187,12 @@ int do_test_device1(pe_t * pe) { cs_nhalo_set(cs, nhalo); cs_init(cs); - field_create(pe, cs, nfref, "phi", &phi); + field_create(pe, cs, NULL, "phi", &opts, &phi); assert(phi); field_nf(phi, &nf); assert(nf == nfref); - field_init(phi, nhalo, NULL); - kernel_launch_param(1, &nblk, &ntpb); ntpb.x = 1; @@ -252,6 +254,7 @@ static int do_test3(pe_t * pe) { cs_t * cs = NULL; field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, nhalo); assert(pe); @@ -259,14 +262,12 @@ static int do_test3(pe_t * pe) { cs_nhalo_set(cs, nhalo); cs_init(cs); - field_create(pe, cs, nfref, "p", &phi); + field_create(pe, cs, NULL, "p", &opts, &phi); assert(phi); field_nf(phi, &nf); assert(nf == nfref); - field_init(phi, nhalo, NULL); - field_vector_set(phi, index, ref); field_vector(phi, index, value); assert(fabs(value[0] - ref[0]) < DBL_EPSILON); @@ -307,6 +308,7 @@ static int do_test5(pe_t * pe) { cs_t * cs = NULL; field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, nhalo); assert(pe); @@ -314,14 +316,12 @@ static int do_test5(pe_t * pe) { cs_nhalo_set(cs, nhalo); cs_init(cs); - field_create(pe, cs, nfref, "q", &phi); + field_create(pe, cs, NULL, "q", &opts, &phi); assert(phi); field_nf(phi, &nf); assert(nf == nfref); - field_init(phi, nhalo, NULL); - field_tensor_set(phi, index, qref); field_tensor(phi, index, qvalue); assert(fabs(qvalue[X][X] - qref[X][X]) < DBL_EPSILON); @@ -391,6 +391,7 @@ static int do_test_io(pe_t * pe, int nf, int io_format) { cs_t * cs = NULL; field_t * phi = NULL; io_info_t * iohandler = NULL; + field_options_t opts = field_options_default(); assert(pe); @@ -405,9 +406,10 @@ static int do_test_io(pe_t * pe, int nf, int io_format) { grid[Z] = 2; } - field_create(pe, cs, nf, "phi-test", &phi); - assert(phi); - field_init(phi, nhalo, NULL); + opts.ndata = nf; + opts.nhcomm = nhalo; + field_create(pe, cs, NULL, "phi-test", &opts, &phi); + field_init_io_info(phi, grid, io_format, io_format); test_coords_field_set(cs, nf, phi->data, MPI_DOUBLE, test_ref_double1); @@ -419,8 +421,7 @@ static int do_test_io(pe_t * pe, int nf, int io_format) { field_free(phi); MPI_Barrier(comm); - field_create(pe, cs, nf, "phi-test", &phi); - field_init(phi, nhalo, NULL); + field_create(pe, cs, NULL, "phi-test", &opts,&phi); field_init_io_info(phi, grid, io_format, io_format); field_io_info(phi, &iohandler); @@ -439,3 +440,46 @@ static int do_test_io(pe_t * pe, int nf, int io_format) { return 0; } + +/***************************************************************************** + * + * test_field_halo_create + * + *****************************************************************************/ + +int test_field_halo_create(pe_t * pe) { + + cs_t * cs = NULL; + field_t * field = NULL; + field_options_t opts = field_options_default(); + + field_halo_t h = {}; + + { + int nhalo = 2; + int ntotal[3] = {32, 16, 8}; + cs_create(pe, &cs); + cs_nhalo_set(cs, nhalo); + cs_ntotal_set(cs, ntotal); + cs_init(cs); + } + + opts.ndata = 2; + opts.nhcomm = 2; + field_create(pe, cs, NULL, "halotest", &opts, &field); + + field_halo_create(field, &h); + field_halo_info(pe, field, &h); + + test_coords_field_set(cs, 2, field->data, MPI_DOUBLE, test_ref_double1); + field_halo_post(field, &h); + field_halo_wait(field, &h); + test_coords_field_check(cs, 2, 2, field->data, MPI_DOUBLE, test_ref_double1); + + field_halo_free(&h); + + field_free(field); + cs_free(cs); + + return 0; +} diff --git a/tests/unit/test_field_grad.c b/tests/unit/test_field_grad.c index ef75d327c..a99192841 100644 --- a/tests/unit/test_field_grad.c +++ b/tests/unit/test_field_grad.c @@ -24,7 +24,6 @@ #include "pe.h" #include "coords.h" #include "leesedwards.h" -#include "field_s.h" #include "field_grad.h" #include "tests.h" @@ -80,6 +79,7 @@ int do_test1(pe_t * pe) { lees_edw_t * le = NULL; field_t * field = NULL; field_grad_t * gradient = NULL; + field_options_t opts = field_options_ndata_nhalo(nfref, 1); assert(pe); @@ -87,9 +87,7 @@ int do_test1(pe_t * pe) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nfref, "scalar-field-test", &field); - assert(field); - field_init(field, 0, le); + field_create(pe, cs, le, "scalar-field-test", &opts, &field); field_grad_create(pe, field, 4, &gradient); assert(gradient); @@ -137,6 +135,7 @@ static int do_test3(pe_t * pe) { lees_edw_t * le = NULL; field_t * field = NULL; field_grad_t * gradient = NULL; + field_options_t opts = field_options_ndata_nhalo(nf, 0); assert(pe); @@ -144,9 +143,7 @@ static int do_test3(pe_t * pe) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nf, "vector-field-test", &field); - assert(field); - field_init(field, 0, le); + field_create(pe, cs, le, "vector-field-test", &opts, &field); field_grad_create(pe, field, 4, &gradient); assert(gradient); @@ -191,6 +188,7 @@ static int do_test5(pe_t * pe) { lees_edw_t * le = NULL; field_t * field = NULL; field_grad_t * gradient = NULL; + field_options_t opts = field_options_ndata_nhalo(nf, 0); assert(pe); @@ -198,9 +196,7 @@ static int do_test5(pe_t * pe) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nf, "tensor-field-test", &field); - assert(field); - field_init(field, 0, le); + field_create(pe, cs, le, "tensor-field-test", &opts, &field); field_grad_create(pe, field, 4, &gradient); assert(gradient); @@ -256,6 +252,7 @@ int do_test_dab(pe_t * pe) { lees_edw_t * le = NULL; field_t * field = NULL; field_grad_t * gradient = NULL; + field_options_t opts = field_options_ndata_nhalo(nf, 0); assert(pe); @@ -263,9 +260,7 @@ int do_test_dab(pe_t * pe) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nf, "dab-field-test", &field); - assert(field); - field_init(field, 0, le); + field_create(pe, cs, NULL, "dab-field-test", &opts, &field); field_grad_create(pe, field, 3, &gradient); assert(gradient); diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index 0d5bc1014..c5ef2f16b 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -70,7 +70,7 @@ __host__ int test_lb_bc_inflow_rhou_create(pe_t * pe, cs_t * cs) { assert(inflow); assert(inflow->pe == pe); - assert(inflow->cs = cs); + assert(inflow->cs == cs); assert(inflow->super.func); assert(inflow->super.id == LB_BC_INFLOW_RHOU); diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index 9ee8d34c0..db9f5dfbf 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -184,11 +184,11 @@ int util_lb_data_check(lb_t * lb, int full) { /***************************************************************************** * - * test_lb_halo_create + * test_lb_halo_post_wait * *****************************************************************************/ -int test_lb_halo_create(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { +int test_lb_halo_post_wait(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { lb_data_options_t options = lb_data_options_default(); lb_t * lb = NULL; @@ -196,6 +196,8 @@ int test_lb_halo_create(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { assert(pe); assert(cs); + printf("test halo create ndim = %2d nvel = %2d full = %2d\n", + ndim, nvel, full); options.ndim = ndim; options.nvel = nvel; lb_data_create(pe, cs, &options, &lb); @@ -204,7 +206,9 @@ int test_lb_halo_create(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { { lb_halo_t h = {}; - lb_halo_create(lb, &h, full); + lb_halo_create(lb, &h, LB_HALO_OPENMP_FULL); + lb_halo_post(lb, &h); + lb_halo_wait(lb, &h); lb_halo_free(lb, &h); } @@ -233,8 +237,8 @@ int test_lb_halo(pe_t * pe) { cs_ntotal_set(cs, ntotal); cs_init(cs); - test_lb_halo_create(pe, cs, 2, 9, 0); - test_lb_halo_create(pe, cs, 2, 9, 1); + test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_REDUCED); + test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_FULL); cs_free(cs); } @@ -246,10 +250,10 @@ int test_lb_halo(pe_t * pe) { cs_create(pe, &cs); cs_init(cs); - test_lb_halo_create(pe, cs, 3, 15, 0); - test_lb_halo_create(pe, cs, 3, 15, 1); - test_lb_halo_create(pe, cs, 3, 19, 0); - test_lb_halo_create(pe, cs, 3, 19, 1); + test_lb_halo_post_wait(pe, cs, 3, 15, LB_HALO_OPENMP_REDUCED); + test_lb_halo_post_wait(pe, cs, 3, 15, LB_HALO_OPENMP_FULL); + test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_REDUCED); + test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_FULL); /* This will break while still fixed NVEL present... test_lb_halo_create(pe, cs, 3, 27, 0); test_lb_halo_create(pe, cs, 3, 27, 1); diff --git a/tests/unit/test_phi_bc_inflow_fixed.c b/tests/unit/test_phi_bc_inflow_fixed.c index f47afa5a9..943d0db4e 100644 --- a/tests/unit/test_phi_bc_inflow_fixed.c +++ b/tests/unit/test_phi_bc_inflow_fixed.c @@ -80,13 +80,14 @@ __host__ int test_phi_bc_inflow_fixed_update(pe_t * pe, cs_t * cs) { int noffset[3] = {}; phi_bc_inflow_opts_t options = {.phi0 = 999.999, .flow = {1,0,0}}; phi_bc_inflow_fixed_t * inflow = NULL; + field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(1, 1); assert(pe); assert(cs); - field_create(pe, cs, 1, "phi", &phi); - field_init(phi, 1, NULL); + field_create(pe, cs, NULL, "phi", &opts, &phi); assert(phi); phi_bc_inflow_fixed_create(pe, cs, &options, &inflow); diff --git a/tests/unit/test_phi_bc_outflow_free.c b/tests/unit/test_phi_bc_outflow_free.c index 12964c548..e41ebecf3 100644 --- a/tests/unit/test_phi_bc_outflow_free.c +++ b/tests/unit/test_phi_bc_outflow_free.c @@ -83,13 +83,14 @@ __host__ int test_phi_bc_outflow_free_update(pe_t * pe, cs_t * cs) { phi_bc_outflow_opts_t options = {.flow = {1,0,0}}; phi_bc_outflow_free_t * outflow = NULL; + field_t * phi = NULL; + field_options_t opts = field_options_ndata_nhalo(1, 1); assert(pe); assert(cs); - field_create(pe, cs, 1, "phi", &phi); - field_init(phi, 1, NULL); + field_create(pe, cs, NULL, "phi", &opts, &phi); /* Provide some initial conditions in the domain proper, * with some artificial data. */ diff --git a/tests/unit/test_phi_ch.c b/tests/unit/test_phi_ch.c index 5c46ab1f5..cac58b711 100644 --- a/tests/unit/test_phi_ch.c +++ b/tests/unit/test_phi_ch.c @@ -62,6 +62,8 @@ int test_phi_ch_suite(void) { physics_t * phys = NULL; phi_ch_t * pch = NULL; + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); cs_create(pe, &cs); cs_nhalo_set(cs, nhalo); @@ -69,11 +71,10 @@ int test_phi_ch_suite(void) { physics_create(pe, &phys); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nf, "phi", &phi); - assert(phi); - field_init(phi, nhalo, le); - + field_create(pe, cs, le, "phi", &opts, &phi); hydro_create(pe, cs, le, 1, &hydro); + + assert(phi); assert(hydro); phi_ch_create(pe, cs, le, NULL, &pch); diff --git a/tests/unit/test_polar_active.c b/tests/unit/test_polar_active.c index 64042fc81..60a3bacf8 100644 --- a/tests/unit/test_polar_active.c +++ b/tests/unit/test_polar_active.c @@ -58,6 +58,8 @@ int test_polar_active_suite(void) { field_grad_t * fpgrad = NULL; fe_polar_t * fe = NULL; + field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + tdpGetDeviceCount(&ndevice); pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); @@ -74,8 +76,7 @@ int test_polar_active_suite(void) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - field_create(pe, cs, nf, "p", &fp); - field_init(fp, nhalo, le); + field_create(pe, cs, le, "p", &opts, &fp); field_grad_create(pe, fp, 2, &fpgrad); field_grad_set(fpgrad, grad_2d_5pt_fluid_d2, NULL); diff --git a/tests/unit/test_visc_arrhenius.c b/tests/unit/test_visc_arrhenius.c index fbaea67f2..15bf2b3c6 100644 --- a/tests/unit/test_visc_arrhenius.c +++ b/tests/unit/test_visc_arrhenius.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2020 The University of Edinburgh + * (c) 2020-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -55,11 +55,12 @@ __host__ int test_visc_arrhenius_suite(void) { } else { + field_options_t opts = field_options_ndata_nhalo(1, nhalo); + cs_create(pe, &cs); cs_init(cs); - field_create(pe, cs, 1, "ternary", &phi); - field_init(phi, nhalo, NULL); + field_create(pe, cs, NULL, "ternary", &opts, &phi); test_visc_arrhenius_create(pe, cs, phi); test_visc_arrhenius_update(pe, cs, phi); From 5079ab3a934babadf0866a67d8af488312263e99 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 31 Dec 2021 12:38:27 +0000 Subject: [PATCH 08/64] Remove unwanted files --- src/input-new-ternary1 | 89 ---------------------------------------- src/input-ternary1 | 88 ---------------------------------------- src/input-ternary2 | 88 ---------------------------------------- src/input-ternary3 | 92 ------------------------------------------ 4 files changed, 357 deletions(-) delete mode 100644 src/input-new-ternary1 delete mode 100644 src/input-ternary1 delete mode 100644 src/input-ternary2 delete mode 100644 src/input-ternary3 diff --git a/src/input-new-ternary1 b/src/input-new-ternary1 deleted file mode 100644 index 967ebffe4..000000000 --- a/src/input-new-ternary1 +++ /dev/null @@ -1,89 +0,0 @@ -############################################################################## -# -# -# -############################################################################## - -############################################################################## -# -# Run duration -# -############################################################################### - - -N_cycles 200000 - -############################################################################## -# -# System -# -############################################################################## - -size 180_120_1 -grid 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.16666666666667 - -############################################################################## -# -# Free energy parameters -# -############################################################################### - -free_energy ternary - -ternary_kappa1 0.01 -ternary_kappa2 0.02 -ternary_kappa3 0.001 -ternary_alpha 1.00 - -ternary_mobility_phi 0.500 -ternary_mobility_psi 0.167 - -ternary_initialisation 2d_double_emulsion - -hydrodynamics no -fd_gradient_calculation 2d_tomita_fluid - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init no_colloids - -############################################################################### -# -# Periodic conditions / boundaries -# -############################################################################### - -boundary_walls_on no -periodicity 1_1_1 - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 1000 -phi_format BINARY -config_at_end yes - -############################################################################### -# -# Miscellaneous -# -# random_seed +ve integer is the random number generator seed -# -############################################################################### - -random_seed 8361235 diff --git a/src/input-ternary1 b/src/input-ternary1 deleted file mode 100644 index de80a83f1..000000000 --- a/src/input-ternary1 +++ /dev/null @@ -1,88 +0,0 @@ -############################################################################## -# -# -# -############################################################################## - -############################################################################## -# -# Run duration -# -############################################################################### - -N_cycles 20000 - -############################################################################## -# -# System -# -############################################################################## - -size 50_50_1 -grid 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.16666666666667 - -############################################################################## -# -# Free energy parameters -# -############################################################################### - -free_energy ternary - -ternary_kappa1 0.01 -ternary_kappa2 0.02 -ternary_kappa3 0.05 -ternary_alpha 1.00 - -ternary_mobility_phi 0.15 -ternary_mobility_psi 0.10 - -ternary_initialisation 2d_double_emulsion - -hydrodynamics no -fd_gradient_calculation 2d_tomita_fluid - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init no_colloids - -############################################################################### -# -# Periodic conditions / boundaries -# -############################################################################### - -boundary_walls_on no -periodicity 1_1_1 - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 1000 -phi_format BINARY -config_at_end yes - -############################################################################### -# -# Miscellaneous -# -# random_seed +ve integer is the random number generator seed -# -############################################################################### - -random_seed 8361235 diff --git a/src/input-ternary2 b/src/input-ternary2 deleted file mode 100644 index 9d46ce4d0..000000000 --- a/src/input-ternary2 +++ /dev/null @@ -1,88 +0,0 @@ -############################################################################## -# -# -# -############################################################################## - -############################################################################## -# -# Run duration -# -############################################################################### - -N_cycles 20000 - -############################################################################## -# -# System -# -############################################################################## - -size 50_50_1 -grid 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.16666666666667 - -############################################################################## -# -# Free energy parameters -# -############################################################################### - -free_energy ternary - -ternary_kappa1 0.01 -ternary_kappa2 0.02 -ternary_kappa3 0.05 -ternary_alpha 1.00 - -ternary_mobility_phi 0.15 -ternary_mobility_psi 0.10 - -ternary_initialisation 2d_double_emulsion - -hydrodynamics no -fd_gradient_calculation 2d_ternary_solid - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init no_colloids - -############################################################################### -# -# Periodic conditions / boundaries -# -############################################################################### - -boundary_walls_on no -periodicity 1_1_1 - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 200 -phi_format BINARY -config_at_end yes - -############################################################################### -# -# Miscellaneous -# -# random_seed +ve integer is the random number generator seed -# -############################################################################### - -random_seed 8361235 diff --git a/src/input-ternary3 b/src/input-ternary3 deleted file mode 100644 index e3353148f..000000000 --- a/src/input-ternary3 +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################## -# -# Contact angle cf Fig. 2 -# -############################################################################## - -############################################################################## -# -# Run duration -# -############################################################################### - -N_cycles 40000 - -############################################################################## -# -# System -# -############################################################################## - -size 50_50_1 -grid 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.16666666666667 - -############################################################################## -# -# Free energy parameters -# -############################################################################### - -free_energy ternary - -ternary_kappa1 0.01 -ternary_kappa2 0.02 -ternary_kappa3 0.03 -ternary_alpha 1.00 - -ternary_h1 -0.001 -ternary_h2 +0.002 -ternary_h3 0.000 - -ternary_mobility_phi 0.15 -ternary_mobility_psi 0.10 - -ternary_initialisation 2d_tee - -hydrodynamics no -fd_gradient_calculation 2d_ternary_solid - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init no_colloids - -############################################################################### -# -# Periodic conditions / boundaries -# -############################################################################### - -boundary_walls 1_1_0 -periodicity 0_0_1 - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 200 -phi_format BINARY -config_at_end yes - -############################################################################### -# -# Miscellaneous -# -# random_seed +ve integer is the random number generator seed -# -############################################################################### - -random_seed 8361235 From 700b43203e84807c42d9503a4492b6caf0c1526b Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 31 Dec 2021 12:39:00 +0000 Subject: [PATCH 09/64] Use calloc, MPI_STATUSES_IGNORE --- src/field.c | 9 +++------ src/model.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/field.c b/src/field.c index 5365d0300..3bcb5bb59 100644 --- a/src/field.c +++ b/src/field.c @@ -1181,8 +1181,8 @@ int field_halo_create(const field_t * field, field_halo_t * h) { int scount = field->nf*field_halo_size(h->slim[p]); int rcount = field->nf*field_halo_size(h->rlim[p]); - h->send[p] = (double *) malloc(scount*sizeof(double)); - h->recv[p] = (double *) malloc(rcount*sizeof(double)); + h->send[p] = (double *) calloc(scount, sizeof(double)); + h->recv[p] = (double *) calloc(rcount, sizeof(double)); assert(h->send[p]); assert(h->recv[p]); } @@ -1259,10 +1259,7 @@ int field_halo_wait(field_t * field, field_halo_t * h) { assert(field); assert(h); - { - MPI_Status statuses[2*27] = {}; - MPI_Waitall(2*h->nvel, h->request, statuses); - } + MPI_Waitall(2*h->nvel, h->request, MPI_STATUSES_IGNORE); #pragma omp parallel { diff --git a/src/model.c b/src/model.c index 77947e62f..a3a2c5f3a 100644 --- a/src/model.c +++ b/src/model.c @@ -1986,13 +1986,13 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { /* Allocate send buffer for send region */ if (count > 0) { int scount = count*lb_halo_size(h->slim[p]); - h->send[p] = (double *) malloc(scount*sizeof(double)); + h->send[p] = (double *) calloc(scount, sizeof(double)); assert(h->send[p]); } /* Allocate recv buffer */ if (count > 0) { int rcount = count*lb_halo_size(h->rlim[p]); - h->recv[p] = (double *) malloc(rcount*sizeof(double)); + h->recv[p] = (double *) calloc(rcount, sizeof(double)); assert(h->recv[p]); } } @@ -2078,10 +2078,7 @@ int lb_halo_wait(lb_t * lb, lb_halo_t * h) { assert(lb); assert(h); - { - MPI_Status statuses[2*27] = {}; - MPI_Waitall(2*h->map.nvel, h->request, statuses); - } + MPI_Waitall(2*h->map.nvel, h->request, MPI_STATUSES_IGNORE); #pragma omp parallel { From 3e24acc8bbdfdae983932cebf681a27f86c0e781 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 31 Dec 2021 15:21:18 +0000 Subject: [PATCH 10/64] Add hydro options type --- src/hydro_options.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ src/hydro_options.h | 36 +++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 src/hydro_options.c create mode 100644 src/hydro_options.h diff --git a/src/hydro_options.c b/src/hydro_options.c new file mode 100644 index 000000000..b19750390 --- /dev/null +++ b/src/hydro_options.c @@ -0,0 +1,56 @@ +/***************************************************************************** + * + * hydro_options.c + * + * Options for hydrodynamics sector. + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#include + +#include "hydro_options.h" + +/***************************************************************************** + * + * hydro_options_default + * + * At the moment, there's not a great deal to see here. + * + * There is almost never any case for using anything other than nhcomm = 1 + * in a real computation. + * + *****************************************************************************/ + +hydro_options_t hydro_options_default(void) { + + hydro_options_t opts = {.nhcomm = 1, .haloscheme = HYDRO_U_HALO_TARGET}; + + return opts; +} + +/***************************************************************************** + * + * hydro_options_nhalo + * + * Useful to set halo width (mostly in tests). + * + *****************************************************************************/ + +hydro_options_t hydro_options_nhalo(int nhalo) { + + hydro_options_t opts = hydro_options_default(); + + assert(nhalo >= 0); + + opts.nhcomm = nhalo; + + return opts; +} diff --git a/src/hydro_options.h b/src/hydro_options.h new file mode 100644 index 000000000..3b84872e4 --- /dev/null +++ b/src/hydro_options.h @@ -0,0 +1,36 @@ +/***************************************************************************** + * + * hydro_options.h + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford + * + *****************************************************************************/ + +#ifndef LUDWIG_HYDRO_OPTIONS_H +#define LUDWIG_HYDRO_OPTIONS_H + +/* Possible halo schemes */ + +typedef enum hydro_halo_enum { + HYDRO_U_HALO_HOST, /* older host version */ + HYDRO_U_HALO_TARGET, /* host or target */ + HYDRO_U_HALO_OPENMP /* Host-only OpenMP implementation */ +} hydro_halo_enum_t; + +typedef struct hydro_options_s hydro_options_t; + +struct hydro_options_s { + int nhcomm; /* Actual halo width */ + hydro_halo_enum_t haloscheme; /* Halo exchange method */ +}; + +hydro_options_t hydro_options_default(void); +hydro_options_t hydro_options_nhalo(int nhalo); + +#endif From 7ac0b2b44bf130bf675d87e9dae44c715c2f2050 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 31 Dec 2021 15:21:41 +0000 Subject: [PATCH 11/64] Update halo and options --- src/hydro.c | 334 ++++++++++++++++++++++++++++++++++++++++++++++++- src/hydro.h | 37 +++++- src/hydro_rt.c | 32 ++++- 3 files changed, 389 insertions(+), 14 deletions(-) diff --git a/src/hydro.c b/src/hydro.c index 3525a885c..e2056dd8f 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -54,15 +54,16 @@ __global__ void hydro_rho0_kernel(int nsite, double rho0, double * rho); * *****************************************************************************/ -__host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, int nhcomm, +__host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, + const hydro_options_t * opts, hydro_t ** pobj) { - int ndevice; double * tmp; hydro_t * obj = (hydro_t *) NULL; assert(pe); assert(cs); + assert(opts); assert(pobj); obj = (hydro_t *) calloc(1, sizeof(hydro_t)); @@ -72,7 +73,7 @@ __host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, int nhcomm, obj->pe = pe; obj->cs = cs; obj->le = le; - obj->nhcomm = nhcomm; + obj->nhcomm = opts->nhcomm; cs_nsites(cs, &obj->nsite); if (le) lees_edw_nsites(le, &obj->nsite); @@ -92,7 +93,7 @@ __host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, int nhcomm, (double *) mem_aligned_calloc(MEM_PAGESIZE, obj->nsite, sizeof(double)); if (obj->eta == NULL) pe_fatal(pe, "calloc(hydro->eta) failed\n"); - halo_swap_create_r1(pe, cs, nhcomm, obj->nsite, NHDIM, &obj->halo); + halo_swap_create_r1(pe, cs, opts->nhcomm, obj->nsite, NHDIM, &obj->halo); assert(obj->halo); halo_swap_handlers_set(obj->halo, halo_swap_pack_rank1, halo_swap_unpack_rank1); @@ -133,6 +134,9 @@ __host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, int nhcomm, tdpMemcpyHostToDevice)); } + hydro_halo_create(obj, &obj->h); + obj->opts = *opts; + *pobj = obj; return 0; @@ -172,6 +176,7 @@ __host__ int hydro_free(hydro_t * obj) { } halo_swap_free(obj->halo); + hydro_halo_free(&obj->h); if (obj->info) io_info_free(obj->info); free(obj->eta); free(obj->f); @@ -247,7 +252,7 @@ __host__ int hydro_u_halo(hydro_t * obj) { assert(obj); - hydro_halo_swap(obj, HYDRO_U_HALO_TARGET); + hydro_halo_swap(obj, obj->opts.haloscheme); return 0; } @@ -276,6 +281,10 @@ __host__ int hydro_halo_swap(hydro_t * obj, hydro_halo_enum_t flag) { tdpMemcpyDeviceToHost)); halo_swap_packed(obj->halo, data); break; + case HYDRO_U_HALO_OPENMP: + hydro_halo_post(obj); + hydro_halo_wait(obj); + break; default: assert(0); } @@ -1294,3 +1303,318 @@ __global__ void hydro_correct_kernel_v(kernel_ctxt_t * ktx, hydro_t * hydro, return; } + +/***************************************************************************** + * + * hydro_halo_size + * + *****************************************************************************/ + +int hydro_halo_size(cs_limits_t lim) { + + int szx = 1 + lim.imax - lim.imin; + int szy = 1 + lim.jmax - lim.jmin; + int szz = 1 + lim.kmax - lim.kmin; + + return szx*szy*szz; +} + +/***************************************************************************** + * + * hydro_halo_enqueue_send + * + *****************************************************************************/ + +int hydro_halo_enqueue_send(const hydro_t * hydro, hydro_halo_t * h, int ireq) { + + assert(hydro); + assert(h); + assert(1 <= ireq && ireq < h->nvel); + + int nx = 1 + h->slim[ireq].imax - h->slim[ireq].imin; + int ny = 1 + h->slim[ireq].jmax - h->slim[ireq].jmin; + int nz = 1 + h->slim[ireq].kmax - h->slim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; + + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->slim[ireq].imin + ih/strx; + int jc = h->slim[ireq].jmin + (ih % strx)/stry; + int kc = h->slim[ireq].kmin + (ih % stry)/strz; + int index = cs_index(hydro->cs, ic, jc, kc); + + for (int ibf = 0; ibf < NHDIM; ibf++) { + int uaddr = addr_rank1(hydro->nsite, NHDIM, index, ibf); + h->send[ireq][ih*NHDIM + ibf] = hydro->u[uaddr]; + } + } + + return 0; +} + +/***************************************************************************** + * + * hydro_halo_dequeue_recv + * + *****************************************************************************/ + +int hydro_halo_dequeue_recv(hydro_t * hydro, const hydro_halo_t * h, int ireq) { + assert(hydro); + assert(h); + assert(1 <= ireq && ireq < h->nvel); + + int nx = 1 + h->rlim[ireq].imax - h->rlim[ireq].imin; + int ny = 1 + h->rlim[ireq].jmax - h->rlim[ireq].jmin; + int nz = 1 + h->rlim[ireq].kmax - h->rlim[ireq].kmin; + + int strz = 1; + int stry = strz*nz; + int strx = stry*ny; + + double * recv = h->recv[ireq]; + + /* Check if this a copy from our own send buffer */ + { + int i = 1 + h->cv[h->nvel - ireq][X]; + int j = 1 + h->cv[h->nvel - ireq][Y]; + int k = 1 + h->cv[h->nvel - ireq][Z]; + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) recv = h->send[ireq]; + } + + #pragma omp for nowait + for (int ih = 0; ih < nx*ny*nz; ih++) { + int ic = h->rlim[ireq].imin + ih/strx; + int jc = h->rlim[ireq].jmin + (ih % strx)/stry; + int kc = h->rlim[ireq].kmin + (ih % stry)/strz; + int index = cs_index(hydro->cs, ic, jc, kc); + + for (int ibf = 0; ibf < NHDIM; ibf++) { + int uaddr = addr_rank1(hydro->nsite, NHDIM, index, ibf); + hydro->u[uaddr] = recv[ih*NHDIM + ibf]; + } + } + + return 0; +} + +/***************************************************************************** + * + * hydro_halo_create + * + * It's convenient to borrow the velocity notation from the lb for + * the commnunication directions. + * + *****************************************************************************/ + +#include "lb_d3q27.h" + +int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { + + int nlocal[3] = {}; + + assert(hydro); + assert(h); + + *h = (hydro_halo_t) {0}; + + /* Communictation model */ + + cs_cart_comm(hydro->cs, &h->comm); + + { + LB_CV_D3Q27(cv27); + + h->nvel = 27; + for (int p = 0; p < h->nvel; p++) { + h->cv[p][X] = cv27[p][X]; + h->cv[p][Y] = cv27[p][Y]; + h->cv[p][Z] = cv27[p][Z]; + } + } + + /* Ranks of Cartesian neighbours */ + + { + int dims[3] = {}; + int periods[3] = {}; + int coords[3] = {}; + + MPI_Cart_get(h->comm, 3, dims, periods, coords); + + for (int p = 0; p < h->nvel; p++) { + int nbr[3] = {}; + int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int i = 1 + h->cv[p][X]; + int j = 1 + h->cv[p][Y]; + int k = 1 + h->cv[p][Z]; + + nbr[X] = coords[X] + h->cv[p][X]; + nbr[Y] = coords[Y] + h->cv[p][Y]; + nbr[Z] = coords[Z] + h->cv[p][Z]; + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + + if (out[X] || out[Y] || out[Z]) { + h->nbrrank[i][j][k] = MPI_PROC_NULL; + } + else { + MPI_Cart_rank(h->comm, nbr, &h->nbrrank[i][j][k]); + } + } + /* I must be in the middle */ + assert(h->nbrrank[1][1][1] == cs_cart_rank(hydro->cs)); + } + + /* Set out limits for send and recv regions. */ + + cs_nlocal(hydro->cs, nlocal); + + for (int p = 1; p < h->nvel; p++) { + + int8_t cx = h->cv[p][X]; + int8_t cy = h->cv[p][Y]; + int8_t cz = h->cv[p][Z]; + int nhalo = hydro->nhcomm; + + cs_limits_t send = {1, nlocal[X], 1, nlocal[Y], 1, nlocal[Z]}; + cs_limits_t recv = {1, nlocal[X], 1, nlocal[Y], 1, nlocal[Z]}; + + if (cx == -1) send.imax = nhalo; + if (cx == +1) send.imin = send.imax - (nhalo - 1); + if (cy == -1) send.jmax = nhalo; + if (cy == +1) send.jmin = send.jmax - (nhalo - 1); + if (cz == -1) send.kmax = nhalo; + if (cz == +1) send.kmin = send.kmax - (nhalo - 1); + + /* For recv, direction is reversed cf. send */ + if (cx == +1) { recv.imin = 1 - nhalo; recv.imax = 0;} + if (cx == -1) { recv.imin = recv.imax + 1; recv.imax = recv.imax + nhalo;} + if (cy == +1) { recv.jmin = 1 - nhalo; recv.jmax = 0;} + if (cy == -1) { recv.jmin = recv.jmax + 1; recv.jmax = recv.jmax + nhalo;} + if (cz == +1) { recv.kmin = 1 - nhalo; recv.kmax = 0;} + if (cz == -1) { recv.kmin = recv.kmax + 1; recv.kmax = recv.kmax + nhalo;} + + h->slim[p] = send; + h->rlim[p] = recv; + } + + /* Message count and buffers (NHDIM is always 3 for u) */ + + for (int p = 1; p < h->nvel; p++) { + + int scount = NHDIM*hydro_halo_size(h->slim[p]); + int rcount = NHDIM*hydro_halo_size(h->rlim[p]); + + h->send[p] = (double *) calloc(scount, sizeof(double)); + h->recv[p] = (double *) calloc(rcount, sizeof(double)); + assert(h->send[p]); + assert(h->recv[p]); + } + + for (int ireq = 0; ireq < 2*27; ireq++) { + h->request[ireq] = MPI_REQUEST_NULL; + } + + return 0; +} + +/***************************************************************************** + * + * hydro_halo_post + * + *****************************************************************************/ + +int hydro_halo_post(hydro_t * hydro) { + + assert(hydro); + + const int tagbase = 2022; + hydro_halo_t * h = &hydro->h; + + /* Post recvs */ + + for (int ireq = 1; ireq < h->nvel; ireq++) { + + int i = 1 + h->cv[h->nvel - ireq][X]; + int j = 1 + h->cv[h->nvel - ireq][Y]; + int k = 1 + h->cv[h->nvel - ireq][Z]; + int mcount = NHDIM*hydro_halo_size(h->rlim[ireq]); + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + MPI_Irecv(h->recv[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + tagbase + ireq, h->comm, h->request + ireq); + } + + /* Load send buffers; post sends */ + + #pragma omp parallel + { + for (int ireq = 1; ireq < h->nvel; ireq++) { + hydro_halo_enqueue_send(hydro, h, ireq); + } + } + + for (int ireq = 1; ireq < h->nvel; ireq++) { + int i = 1 + h->cv[ireq][X]; + int j = 1 + h->cv[ireq][Y]; + int k = 1 + h->cv[ireq][Z]; + int mcount = NHDIM*hydro_halo_size(h->slim[ireq]); + + if (h->nbrrank[i][j][k] == h->nbrrank[1][1][1]) mcount = 0; + + MPI_Isend(h->send[ireq], mcount, MPI_DOUBLE, h->nbrrank[i][j][k], + tagbase + ireq, h->comm, h->request + 27 + ireq); + } + + return 0; +} + +/***************************************************************************** + * + * hydro_halo_wait + * + *****************************************************************************/ + +int hydro_halo_wait(hydro_t * hydro) { + + assert(hydro); + + hydro_halo_t * h = &hydro->h; + + MPI_Waitall(2*h->nvel, h->request, MPI_STATUSES_IGNORE); + + #pragma omp parallel + { + for (int ireq = 1; ireq < h->nvel; ireq++) { + hydro_halo_dequeue_recv(hydro, h, ireq); + } + } + + return 0; +} + +/***************************************************************************** + * + * hydro_halo_free + * + *****************************************************************************/ + +int hydro_halo_free(hydro_halo_t * h) { + + assert(h); + + for (int p = 1; p < h->nvel; p++) { + free(h->send[p]); + free(h->recv[p]); + } + + *h = (hydro_halo_t) {0}; + + return 0; +} diff --git a/src/hydro.h b/src/hydro.h index 3f5500410..a303c3638 100644 --- a/src/hydro.h +++ b/src/hydro.h @@ -22,6 +22,27 @@ #include "halo_swap.h" #include "leesedwards.h" #include "io_harness.h" +#include "hydro_options.h" + +/* Halo */ + +#include "cs_limits.h" + +typedef struct hydro_halo_s hydro_halo_t; + +struct hydro_halo_s { + + MPI_Comm comm; /* coords: Cartesian communicator */ + int nbrrank[3][3][3]; /* coords: Cartesian neighbours */ + + int nvel; /* Number of directions involved (2d or 3d) */ + int8_t cv[27][3]; /* Send/recv directions */ + cs_limits_t slim[27]; /* halo: send regions (rectangular) */ + cs_limits_t rlim[27]; /* halo: recv regions (rectangular) */ + double * send[27]; /* halo: send data buffers */ + double * recv[27]; /* halo: recv data buffers */ + MPI_Request request[2*27]; /* halo: array of send/recv requests */ +}; typedef struct hydro_s hydro_t; @@ -42,14 +63,15 @@ struct hydro_s { lees_edw_t * le; /* Lees Edwards */ io_info_t * info; /* I/O handler. */ halo_swap_t * halo; /* Halo driver object */ - hydro_t * target; /* structure on target */ -}; + hydro_halo_t h; /* Host OpenMP halo swap */ + hydro_options_t opts; /* Copy of the options requested */ -typedef enum {HYDRO_U_HALO_HOST, HYDRO_U_HALO_TARGET} hydro_halo_enum_t; + hydro_t * target; /* structure on target */ +}; __host__ int hydro_create(pe_t * pe, cs_t * cs, lees_edw_t * le, - int nhalocomm, hydro_t ** pobj); + const hydro_options_t * opts, hydro_t ** pobj); __host__ int hydro_free(hydro_t * obj); __host__ int hydro_init_io_info(hydro_t * obj, int grid[3], int form_in, int form_out); @@ -75,4 +97,11 @@ __host__ __device__ int hydro_rho(hydro_t * hydro, int index, double * rho); __host__ __device__ int hydro_u_set(hydro_t * obj, int index, const double u[3]); __host__ __device__ int hydro_u(hydro_t * obj, int index, double u[3]); +/* Host halo interface */ + +int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h); +int hydro_halo_post(hydro_t * hydro); +int hydro_halo_wait(hydro_t * hydro); +int hydro_halo_free(hydro_halo_t * h); + #endif diff --git a/src/hydro_rt.c b/src/hydro_rt.c index fba497073..bc0e698e8 100644 --- a/src/hydro_rt.c +++ b/src/hydro_rt.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2018 The University of Edinburgh + * (c) 2018-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -58,18 +58,19 @@ int hydro_rt(pe_t * pe, rt_t * rt, cs_t * cs, lees_edw_t * le, * * hydro_do_init * - * Note that input format is really irrelevant for velocity, as it - * is never read from file. + * Some work on the I/O options is required: + * - should be specified as part of the options. + * Halo options should be extended to include density. * *****************************************************************************/ static int hydro_do_init(pe_t * pe, rt_t * rt, cs_t * cs, lees_edw_t * le, hydro_t ** phydro) { + hydro_options_t opts = hydro_options_default(); hydro_t * obj = NULL; char value[BUFSIZ] = ""; - int nhcomm = 1; /* Always create with halo width one */ int io_grid[3] = {1, 1, 1}; int io_format_in = IO_FORMAT_DEFAULT; int io_format_out = IO_FORMAT_DEFAULT; @@ -77,7 +78,28 @@ static int hydro_do_init(pe_t * pe, rt_t * rt, cs_t * cs, lees_edw_t * le, assert(rt); assert(phydro); - hydro_create(pe, cs, le, nhcomm, &obj); + if (rt_string_parameter(rt, "hydro_halo_scheme", value, BUFSIZ)) { + /* The output is only provided if the key is present to + * prevent the regression tests getting upset. */ + if (strcmp(value, "hydro_u_halo_target") == 0) { + /* Should be the default */ + opts.haloscheme = HYDRO_U_HALO_TARGET; + pe_info(pe, "Hydro halo: %s\n", "hydro_u_halo_target"); + } + else if (strcmp(value, "hydro_u_halo_openmp") == 0) { + opts.haloscheme = HYDRO_U_HALO_OPENMP; + pe_info(pe, "Hydro halo: %s\n", "hydro_u_halo_openmp"); + } + else if (strcmp(value, "hydro_u_halo_host") == 0) { + opts.haloscheme = HYDRO_U_HALO_HOST; + pe_info(pe, "Hydro halo: %s\n", "hydro_u_halo_host"); + } + else { + pe_fatal(pe, "hydro_halo_scheme is present but not recongnised\n"); + } + } + + hydro_create(pe, cs, le, &opts, &obj); assert(obj); rt_int_parameter_vector(rt, "default_io_grid", io_grid); From 9195e11b7115c2e33755a5dd350bda8710545dad Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 31 Dec 2021 15:23:03 +0000 Subject: [PATCH 12/64] Updated hydro options for halo --- tests/unit/test_hydro.c | 33 +++++++++++++++++++--------- tests/unit/test_lb_bc_inflow_rhou.c | 13 +++++++---- tests/unit/test_lb_bc_outflow_rhou.c | 10 ++++++--- tests/unit/test_phi_ch.c | 3 ++- tests/unit/test_visc_arrhenius.c | 3 ++- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/tests/unit/test_hydro.c b/tests/unit/test_hydro.c index 4d2b7bf8a..c2ca3337c 100644 --- a/tests/unit/test_hydro.c +++ b/tests/unit/test_hydro.c @@ -31,7 +31,8 @@ #include "tests.h" static int do_test1(pe_t * pe); -static int do_test_halo1(pe_t * pe, int nhalo, int nhcomm); +static int do_test_halo1(pe_t * pe, int nhalo, int nhcomm, + hydro_halo_enum_t haloscheme); static int do_test_io1(pe_t * pe, int io_format); int test_hydro_rho(pe_t * pe); @@ -49,9 +50,11 @@ int test_hydro_suite(void) { pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); do_test1(pe); - do_test_halo1(pe, 1, 1); - do_test_halo1(pe, 2, 2); - do_test_halo1(pe, 2, 1); + do_test_halo1(pe, 1, 1, HYDRO_U_HALO_TARGET); + do_test_halo1(pe, 2, 2, HYDRO_U_HALO_TARGET); + do_test_halo1(pe, 2, 1, HYDRO_U_HALO_TARGET); + do_test_halo1(pe, 1, 1, HYDRO_U_HALO_OPENMP); + do_test_halo1(pe, 2, 1, HYDRO_U_HALO_OPENMP); test_hydro_rho(pe); @@ -80,6 +83,8 @@ static int do_test1(pe_t * pe) { cs_t * cs = NULL; lees_edw_t * le = NULL; + + hydro_options_t opts = hydro_options_default(); hydro_t * hydro = NULL; assert(pe); @@ -89,8 +94,9 @@ static int do_test1(pe_t * pe) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - hydro_create(pe, cs, le, 1, &hydro); + hydro_create(pe, cs, le, &opts, &hydro); assert(hydro); + assert(hydro->opts.nhcomm == 1); index = cs_index(cs, 1, 1, 1); hydro_f_local_set(hydro, index, force); @@ -123,12 +129,15 @@ static int do_test1(pe_t * pe) { * *****************************************************************************/ -static int do_test_halo1(pe_t * pe, int nhalo, int nhcomm) { +static int do_test_halo1(pe_t * pe, int nhalo, int nhcomm, + hydro_halo_enum_t haloscheme) { - hydro_t * hydro = NULL; cs_t * cs = NULL; lees_edw_t * le = NULL; + hydro_options_t opts = {.nhcomm = nhcomm, .haloscheme = haloscheme}; + hydro_t * hydro = NULL; + assert(pe); cs_create(pe, &cs); @@ -136,7 +145,7 @@ static int do_test_halo1(pe_t * pe, int nhalo, int nhcomm) { cs_init(cs); lees_edw_create(pe, cs, NULL, &le); - hydro_create(pe, cs, le, nhcomm, &hydro); + hydro_create(pe, cs, le, &opts, &hydro); assert(hydro); test_coords_field_set(cs, NHDIM, hydro->u, MPI_DOUBLE, test_ref_double1); @@ -171,6 +180,8 @@ static int do_test_io1(pe_t * pe, int io_format) { cs_t * cs = NULL; io_info_t * iohandler = NULL; + + hydro_options_t opts = hydro_options_default(); hydro_t * hydro = NULL; assert(pe); @@ -186,7 +197,7 @@ static int do_test_io1(pe_t * pe, int io_format) { grid[Z] = 2; } - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &opts, &hydro); assert(hydro); hydro_init_io_info(hydro, grid, io_format, io_format); @@ -216,6 +227,8 @@ static int do_test_io1(pe_t * pe, int io_format) { int test_hydro_rho(pe_t * pe) { cs_t * cs = NULL; + + hydro_options_t opts = hydro_options_default(); hydro_t * hydro = NULL; assert(pe); @@ -223,7 +236,7 @@ int test_hydro_rho(pe_t * pe) { cs_create(pe, &cs); cs_init(cs); - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &opts, &hydro); assert(hydro->rho); diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index c5ef2f16b..2298041e7 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -107,6 +107,8 @@ __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { .flow = {1, 0, 0}, .u0 = {-1.0,-2.0,-3.0}}; lb_bc_inflow_rhou_t * inflow = NULL; + + hydro_options_t hopts = hydro_options_default(); hydro_t * hydro = NULL; assert(pe); @@ -116,7 +118,7 @@ __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { cs_nlocal_offset(cs, noffset); lb_bc_inflow_rhou_create(pe, cs, &options, &inflow); - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &hopts, &hydro); /* Set the relevant domain values (rho only here) */ @@ -188,11 +190,14 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_inflow_opts_t options = {.nvel = nvel, .flow = {1, 0, 0}, .u0 = {0.01, 0.0, 0.0}}; - lb_data_options_t lb_options = lb_data_options_default(); lb_bc_inflow_rhou_t * inflow = NULL; - hydro_t * hydro = NULL; + + lb_data_options_t lb_options = lb_data_options_default(); lb_t * lb = NULL; + hydro_options_t hopts = hydro_options_default(); + hydro_t * hydro = NULL; + assert(pe); assert(cs); @@ -203,7 +208,7 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { cs_nlocal_offset(cs, noffset); lb_bc_inflow_rhou_create(pe, cs, &options, &inflow); - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &hopts, &hydro); lb_data_create(pe, cs, &lb_options, &lb); /* Set the relevant domain values (rho only here) */ diff --git a/tests/unit/test_lb_bc_outflow_rhou.c b/tests/unit/test_lb_bc_outflow_rhou.c index 8659b455c..a544f57ba 100644 --- a/tests/unit/test_lb_bc_outflow_rhou.c +++ b/tests/unit/test_lb_bc_outflow_rhou.c @@ -101,13 +101,15 @@ __host__ int test_lb_bc_outflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { .flow = {0, 1, 0}, .rho0 = 2.0}; lb_bc_outflow_rhou_t * outflow = NULL; + + hydro_options_t hopts = hydro_options_default(); hydro_t * hydro = NULL; assert(pe); assert(cs); lb_bc_outflow_rhou_create(pe, cs, &options, &outflow); - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &hopts, &hydro); /* The rho0 is fixed and comes from options.rho0, so just run update */ @@ -159,16 +161,18 @@ __host__ int test_lb_bc_outflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { .flow = {0, 0, 1}, .rho0 = 3.0}; lb_bc_outflow_rhou_t * outflow = NULL; - hydro_t * hydro = NULL; lb_t * lb = NULL; + hydro_options_t hopts = hydro_options_default(); + hydro_t * hydro = NULL; + double u0[3] = {0.0, 0.0, 0.01}; /* Domain outflow in z-direction */ assert(pe); assert(cs); lb_bc_outflow_rhou_create(pe, cs, &options, &outflow); - hydro_create(pe, cs, NULL, 1, &hydro); + hydro_create(pe, cs, NULL, &hopts, &hydro); { lb_data_options_t opts = lb_data_options_default(); diff --git a/tests/unit/test_phi_ch.c b/tests/unit/test_phi_ch.c index cac58b711..8d5b890d4 100644 --- a/tests/unit/test_phi_ch.c +++ b/tests/unit/test_phi_ch.c @@ -62,6 +62,7 @@ int test_phi_ch_suite(void) { physics_t * phys = NULL; phi_ch_t * pch = NULL; + hydro_options_t hopts = hydro_options_default(); field_options_t opts = field_options_ndata_nhalo(nf, nhalo); pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); @@ -72,7 +73,7 @@ int test_phi_ch_suite(void) { lees_edw_create(pe, cs, NULL, &le); field_create(pe, cs, le, "phi", &opts, &phi); - hydro_create(pe, cs, le, 1, &hydro); + hydro_create(pe, cs, le, &hopts, &hydro); assert(phi); assert(hydro); diff --git a/tests/unit/test_visc_arrhenius.c b/tests/unit/test_visc_arrhenius.c index 15bf2b3c6..b4fa641a8 100644 --- a/tests/unit/test_visc_arrhenius.c +++ b/tests/unit/test_visc_arrhenius.c @@ -125,6 +125,7 @@ int test_visc_arrhenius_update(pe_t * pe, cs_t * cs, field_t * phi) { visc_arrhenius_param_t param = {eta_minus, eta_plus, phistar}; visc_arrhenius_t * visc = NULL; + hydro_options_t hopts = hydro_options_nhalo(0); hydro_t * hydro = NULL; int ifail; @@ -145,7 +146,7 @@ int test_visc_arrhenius_update(pe_t * pe, cs_t * cs, field_t * phi) { /* Initialise the hydrodynamic sector and update the viscosity */ - hydro_create(pe, cs, NULL, 0, &hydro); + hydro_create(pe, cs, NULL, &hopts, &hydro); visc_arrhenius_update(visc, hydro); hydro_memcpy(hydro, tdpMemcpyDeviceToHost); From 88979e22bacdf19d48e204fdbcd0b5ff0d0a01db Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 12:45:05 +0000 Subject: [PATCH 13/64] Remove unused input keys --- .../regression/d3q19-elec/serial-elec-do1.inp | 10 --------- .../regression/d3q19-elec/serial-elec-do2.inp | 10 --------- .../regression/d3q19-elec/serial-elec-do3.inp | 6 ------ .../regression/d3q19-elec/serial-elec-dr1.inp | 10 --------- .../regression/d3q19-elec/serial-elec-dr2.inp | 10 --------- .../regression/d3q19-elec/serial-elec-eo1.inp | 10 ++------- .../regression/d3q19-elec/serial-elec-eo2.inp | 9 ++------ .../regression/d3q19-elec/serial-elec-ep1.inp | 11 ---------- .../regression/d3q19-elec/serial-elec-ep2.inp | 11 ---------- .../regression/d3q19-elec/serial-elec-gc1.inp | 10 ++------- .../regression/d3q19-elec/serial-elec-gc2.inp | 21 +++++-------------- .../regression/d3q19-elec/serial-elec-rr1.inp | 2 -- .../regression/d3q19-elec/serial-elec-rr2.inp | 2 -- .../regression/d3q19-elec/serial-elec-rr3.inp | 2 -- .../regression/d3q19-elec/serial-elec-rr4.inp | 2 -- .../regression/d3q19-elec/serial-rest-ec1.inp | 2 -- .../regression/d3q19-elec/serial-rest-ec2.inp | 14 ------------- 17 files changed, 11 insertions(+), 131 deletions(-) diff --git a/tests/regression/d3q19-elec/serial-elec-do1.inp b/tests/regression/d3q19-elec/serial-elec-do1.inp index ed5e1948d..b954c4026 100644 --- a/tests/regression/d3q19-elec/serial-elec-do1.inp +++ b/tests/regression/d3q19-elec/serial-elec-do1.inp @@ -49,8 +49,6 @@ free_energy fe_electro_symmetric fd_advection_scheme_order 3 fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 1 ############################################################################### @@ -74,11 +72,9 @@ fd_force_divergence 1 A -0.01 B 0.01 K 0.03 -C 0.0 mobility 0.05 -noise 0.0 phi0 0.0 phi_initialisation block @@ -97,8 +93,6 @@ electric_e0 0.0_0.0_0.0 ############################################################################### colloid_init no_colloids -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # @@ -107,10 +101,6 @@ magnetic_b0 0.0_0.0_0.0 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-do2.inp b/tests/regression/d3q19-elec/serial-elec-do2.inp index f769ee9f6..f7875b529 100644 --- a/tests/regression/d3q19-elec/serial-elec-do2.inp +++ b/tests/regression/d3q19-elec/serial-elec-do2.inp @@ -49,8 +49,6 @@ free_energy fe_electro_symmetric fd_advection_scheme_order 3 fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 0 ############################################################################### @@ -74,11 +72,9 @@ fd_force_divergence 0 A -0.01 B 0.01 K 0.03 -C 0.0 mobility 0.05 -noise 0.0 phi0 0.0 phi_initialisation block @@ -97,8 +93,6 @@ electric_e0 0.0_0.0_0.0 ############################################################################### colloid_init no_colloids -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # @@ -107,10 +101,6 @@ magnetic_b0 0.0_0.0_0.0 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-do3.inp b/tests/regression/d3q19-elec/serial-elec-do3.inp index 60ff115d2..ef882b9d2 100644 --- a/tests/regression/d3q19-elec/serial-elec-do3.inp +++ b/tests/regression/d3q19-elec/serial-elec-do3.inp @@ -48,8 +48,6 @@ free_energy fe_electro_symmetric fd_advection_scheme_order 3 fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 1 ############################################################################### @@ -61,11 +59,9 @@ fd_force_divergence 1 A -0.01 B 0.01 K 0.03 -C 0.0 mobility 0.05 -noise 0.0 phi0 0.0 phi_initialisation block @@ -84,8 +80,6 @@ electric_e0 0.0_0.0_0.0 ############################################################################### colloid_init no_colloids -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-dr1.inp b/tests/regression/d3q19-elec/serial-elec-dr1.inp index ab2fe8eff..b6f5d6d7d 100644 --- a/tests/regression/d3q19-elec/serial-elec-dr1.inp +++ b/tests/regression/d3q19-elec/serial-elec-dr1.inp @@ -49,8 +49,6 @@ free_energy fe_electro_symmetric fd_advection_scheme_order 3 fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 1 ############################################################################### @@ -74,11 +72,9 @@ fd_force_divergence 1 A -0.001 B 0.001 K 0.003 -C 0.0 mobility 1.0 -noise 0.0 phi0 0.0 phi_initialisation drop phi_init_drop_radius 20.0 @@ -100,8 +96,6 @@ electric_e0 0.0_0.75_0.0 ############################################################################### colloid_init no_colloids -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # @@ -110,10 +104,6 @@ magnetic_b0 0.0_0.0_0.0 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-dr2.inp b/tests/regression/d3q19-elec/serial-elec-dr2.inp index 010e7a8e3..bdbd39463 100644 --- a/tests/regression/d3q19-elec/serial-elec-dr2.inp +++ b/tests/regression/d3q19-elec/serial-elec-dr2.inp @@ -49,8 +49,6 @@ free_energy fe_electro_symmetric fd_advection_scheme_order 3 fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 0 ############################################################################### @@ -74,11 +72,9 @@ fd_force_divergence 0 A -0.001 B 0.001 K 0.003 -C 0.0 mobility 1.0 -noise 0.0 phi0 0.0 phi_initialisation drop phi_init_drop_radius 20.0 @@ -100,8 +96,6 @@ electric_e0 0.0_0.75_0.0 ############################################################################### colloid_init no_colloids -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # @@ -110,10 +104,6 @@ magnetic_b0 0.0_0.0_0.0 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-eo1.inp b/tests/regression/d3q19-elec/serial-elec-eo1.inp index 1bd4f4619..b614fbbe7 100644 --- a/tests/regression/d3q19-elec/serial-elec-eo1.inp +++ b/tests/regression/d3q19-elec/serial-elec-eo1.inp @@ -51,9 +51,6 @@ electric_e0 0.0_1.0e-6_0.0 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 -fd_phi_fluctuations_seed 17 fd_force_divergence 0 ############################################################################### @@ -63,7 +60,6 @@ fd_force_divergence 0 ############################################################################### colloid_init none -colloid_gravity 0.0_0.0_0.0 ############################################################################### # @@ -74,7 +70,6 @@ colloid_gravity 0.0_0.0_0.0 boundary_walls 1_0_0 boundary_speed_bottom 0.0 boundary_speed_top 0.0 -boundary_shear_init 0 boundary_lubrication_rcnormal 0.0 ############################################################################### @@ -96,13 +91,14 @@ config_at_end no default_io_grid 1_1_1 distribution_io_grid 1_1_1 -distribution_io_input_format BINARY phi_io_grid 1_1_1 phi_format ASCII psi_format ASCII vel_format ASCII +stats_vel_print_vol_flux yes + ############################################################################## # # colloid i/o @@ -136,7 +132,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3300.0 electrokinetics_init gouy_chapman electrokinetics_init_rho_el 0.00 -electrokinetics_init_delta_el 0.01 electrokinetics_init_sigma 0.0125 ############################################################################### @@ -147,5 +142,4 @@ electrokinetics_init_sigma 0.0125 # ############################################################################### -#random_seed 7361237 random_seed 8361235 diff --git a/tests/regression/d3q19-elec/serial-elec-eo2.inp b/tests/regression/d3q19-elec/serial-elec-eo2.inp index 009a96e9c..889b1af07 100644 --- a/tests/regression/d3q19-elec/serial-elec-eo2.inp +++ b/tests/regression/d3q19-elec/serial-elec-eo2.inp @@ -49,9 +49,6 @@ electric_e0 0.0_3.0e-2_0.0 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 -fd_phi_fluctuations_seed 17 fd_force_divergence 0 ############################################################################### @@ -61,7 +58,6 @@ fd_force_divergence 0 ############################################################################### colloid_init none -colloid_gravity 0.0_0.0_0.0 ############################################################################### # @@ -72,7 +68,6 @@ colloid_gravity 0.0_0.0_0.0 boundary_walls 1_0_0 boundary_speed_bottom 0.0 boundary_speed_top 0.0 -boundary_shear_init 0 boundary_lubrication_rcnormal 0.0 ############################################################################### @@ -88,7 +83,8 @@ config_at_end no default_io_grid 1_1_1 distribution_io_grid 1_1_1 -distribution_io_input_format BINARY + +stats_vel_print_vol_flux yes ############################################################################### # @@ -115,7 +111,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3300.0 electrokinetics_init gouy_chapman electrokinetics_init_rho_el 0.00 -electrokinetics_init_delta_el 0.01 electrokinetics_init_sigma 0.0125 electrokinetics_rel_tol 1e-07 diff --git a/tests/regression/d3q19-elec/serial-elec-ep1.inp b/tests/regression/d3q19-elec/serial-elec-ep1.inp index e8b23516a..951252d27 100644 --- a/tests/regression/d3q19-elec/serial-elec-ep1.inp +++ b/tests/regression/d3q19-elec/serial-elec-ep1.inp @@ -48,9 +48,6 @@ temperature 3.3333e-4 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 1 ############################################################################### @@ -68,7 +65,6 @@ electric_e0 0.0_0.01_0.0 ############################################################################### colloid_init input_one -colloid_type inactive colloid_rho0 6.0 colloid_one_a0 3.75 @@ -106,10 +102,6 @@ soft_sphere_cutoff 0.25 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # @@ -132,9 +124,6 @@ colloid_io_grid 1_1_1 colloid_io_format_input ASCII colloid_io_format_output ASCII -qs_dir_io_grid 1_1_1 -qs_dir_format BINARY - ############################################################################### # # Electrokinetics ALWAYS 2 SPECIES FOR NOW diff --git a/tests/regression/d3q19-elec/serial-elec-ep2.inp b/tests/regression/d3q19-elec/serial-elec-ep2.inp index 081ff9d7c..ee3fe9f3f 100644 --- a/tests/regression/d3q19-elec/serial-elec-ep2.inp +++ b/tests/regression/d3q19-elec/serial-elec-ep2.inp @@ -48,9 +48,6 @@ temperature 3.3333e-4 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 - fd_force_divergence 0 ############################################################################### @@ -68,7 +65,6 @@ electric_e0 0.0_0.01_0.0 ############################################################################### colloid_init input_one -colloid_type inactive colloid_rho0 6.0 colloid_one_a0 3.75 @@ -106,10 +102,6 @@ soft_sphere_cutoff 0.25 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # @@ -132,9 +124,6 @@ colloid_io_grid 1_1_1 colloid_io_format_input ASCII colloid_io_format_output ASCII -qs_dir_io_grid 1_1_1 -qs_dir_format BINARY - ############################################################################### # # Electrokinetics ALWAYS 2 SPECIES FOR NOW diff --git a/tests/regression/d3q19-elec/serial-elec-gc1.inp b/tests/regression/d3q19-elec/serial-elec-gc1.inp index 8d84f8987..87dcd6e0e 100644 --- a/tests/regression/d3q19-elec/serial-elec-gc1.inp +++ b/tests/regression/d3q19-elec/serial-elec-gc1.inp @@ -50,9 +50,6 @@ temperature 3.33333333333333333e-5 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 -fd_phi_fluctuations_seed 17 fd_force_divergence 0 ############################################################################### @@ -62,7 +59,6 @@ fd_force_divergence 0 ############################################################################### colloid_init none -colloid_gravity 0.0_0.0_0.0 magnetic_b0 0.0_0.0_0.0 ############################################################################### @@ -72,10 +68,6 @@ magnetic_b0 0.0_0.0_0.0 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 ############################################################################### # @@ -89,6 +81,8 @@ config_at_end no colloid_io_freq 1000 +stats_vel_print_vol_flux yes + ############################################################################### # # Electrokinetics ALWAYS 2 SPECIES FOR NOW diff --git a/tests/regression/d3q19-elec/serial-elec-gc2.inp b/tests/regression/d3q19-elec/serial-elec-gc2.inp index 6cf079515..763ad4bf8 100644 --- a/tests/regression/d3q19-elec/serial-elec-gc2.inp +++ b/tests/regression/d3q19-elec/serial-elec-gc2.inp @@ -52,9 +52,6 @@ temperature 3.33333333333333333e-5 free_energy fe_electro fd_advection_scheme_order 3 -fd_gradient_calculation 3d_7pt_fluid -fd_phi_fluctuations 0 -fd_phi_fluctuations_seed 17 fd_force_divergence 0 ############################################################################### @@ -64,8 +61,6 @@ fd_force_divergence 0 ############################################################################### colloid_init none -colloid_gravity 0.0_0.0_0.0 -magnetic_b0 0.0_0.0_0.0 ############################################################################### # @@ -73,15 +68,9 @@ magnetic_b0 0.0_0.0_0.0 # ############################################################################### -boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.0 - -porous_media_format BINARY -porous_media_file map-elec-gc2 -porous_media_type status_only +porous_media_file yes +porous_media_ndata 0 +porous_media_format binary ############################################################################### # @@ -95,6 +84,8 @@ config_at_end no colloid_io_freq 1000 +stats_vel_print_vol_flux yes + ############################################################################### # # Electrokinetics ALWAYS 2 SPECIES FOR NOW @@ -119,8 +110,6 @@ electrokinetics_d1 0.01 electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init from_file -electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-rr1.inp b/tests/regression/d3q19-elec/serial-elec-rr1.inp index 180cc25b3..bb9f78b94 100644 --- a/tests/regression/d3q19-elec/serial-elec-rr1.inp +++ b/tests/regression/d3q19-elec/serial-elec-rr1.inp @@ -29,7 +29,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -78,7 +77,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-rr2.inp b/tests/regression/d3q19-elec/serial-elec-rr2.inp index 016721c8c..785c4734d 100644 --- a/tests/regression/d3q19-elec/serial-elec-rr2.inp +++ b/tests/regression/d3q19-elec/serial-elec-rr2.inp @@ -29,7 +29,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -79,7 +78,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-rr3.inp b/tests/regression/d3q19-elec/serial-elec-rr3.inp index d8c8cd1cf..0e58ca5d2 100644 --- a/tests/regression/d3q19-elec/serial-elec-rr3.inp +++ b/tests/regression/d3q19-elec/serial-elec-rr3.inp @@ -28,7 +28,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -77,7 +76,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-elec-rr4.inp b/tests/regression/d3q19-elec/serial-elec-rr4.inp index 9f1c6337c..ac77ebccc 100644 --- a/tests/regression/d3q19-elec/serial-elec-rr4.inp +++ b/tests/regression/d3q19-elec/serial-elec-rr4.inp @@ -28,7 +28,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -78,7 +77,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-rest-ec1.inp b/tests/regression/d3q19-elec/serial-rest-ec1.inp index 2a9cb805d..f88888cb5 100644 --- a/tests/regression/d3q19-elec/serial-rest-ec1.inp +++ b/tests/regression/d3q19-elec/serial-rest-ec1.inp @@ -26,7 +26,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -75,7 +74,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # diff --git a/tests/regression/d3q19-elec/serial-rest-ec2.inp b/tests/regression/d3q19-elec/serial-rest-ec2.inp index 07f24f7f8..6028db447 100644 --- a/tests/regression/d3q19-elec/serial-rest-ec2.inp +++ b/tests/regression/d3q19-elec/serial-rest-ec2.inp @@ -26,7 +26,6 @@ temperature 0.00001 free_energy fe_electro fd_advection_scheme_order 2 -fd_gradient_calculation 3d_7pt_fluid fd_force_divergence 0 ############################################################################### @@ -37,18 +36,6 @@ fd_force_divergence 0 colloid_init from_file -colloid_one_type inactive - -colloid_one_a0 2.3 -colloid_one_ah 2.3 -colloid_one_r 16.0_16.0_15.699 -colloid_one_v 0.0_0.0_0.01 -colloid_one_s 1.0_0.0_0.0 -colloid_one_m 1.0_0.0_0.0 - -colloid_one_q0 +0.01 -colloid_one_q1 0.0000 - ############################################################################### # # Output frequency and type @@ -75,7 +62,6 @@ electrokinetics_eunit 1.0 electrokinetics_epsilon 3.3e3 electrokinetics_init uniform electrokinetics_init_rho_el 0.001 -electrokinetics_init_sigma 0.03125 ############################################################################### # From 306d1a109fc5711cb45285e150a26cf7c3cc5b68 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 12:51:01 +0000 Subject: [PATCH 14/64] Update for porous file input changes --- .../regression/d3q19-elec/serial-elec-gc2.log | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/tests/regression/d3q19-elec/serial-elec-gc2.log b/tests/regression/d3q19-elec/serial-elec-gc2.log index dc8937e63..142b482e7 100644 --- a/tests/regression/d3q19-elec/serial-elec-gc2.log +++ b/tests/regression/d3q19-elec/serial-elec-gc2.log @@ -1,9 +1,16 @@ -Welcome to Ludwig v0.5.48 (Serial version running on 1 process) +Welcome to Ludwig v0.15.0 (Serial version running on 1 process) +Start time: Wed Jan 12 12:46:04 2022 + +Compiler: + name: Gnu 11.2.0 + version-string: 11.2.0 -The SVN revision details are: 2982 Note assertions via standard C assert() are on. -Read 41 user parameters from serial-elec-gc2.inp +Target thread model: OpenMP. +OpenMP threads: 1; maximum number of threads: 8. + +Read 30 user parameters from serial-elec-gc2.inp System details -------------- @@ -63,6 +70,7 @@ I/O grid: 1 1 1 Lattice Boltzmann collision --------------------------- +Relaxation time scheme: M10 Hydrodynamic modes: on Ghost modes: on Isothermal fluctuations: off @@ -72,9 +80,9 @@ Ghost relaxation time: 1.00000e+00 Porous media ------------ -Porous media file requested: map-elec-gc2 -Porous media file type: status_only -Porous media format (serial): BINARY +Porous media file stub: capillary +Porous media file data items: 0 +Porous media format (serial): binary Porous media io grid: 1 1 1 [User ] Random number seed: 8361235 @@ -92,6 +100,7 @@ Porous Media ------------ Wall boundary links allocated: 160 Memory (total, bytes): 2560 + Arranging initial charge neutrality. Initial conditions. @@ -101,11 +110,11 @@ Scalars - total mean variance min max [psi] 0.0000000e+00 0.0000000e+00 0.0000000e+00 [rho] 1.9920000e+00 1.0000000e-03 3.1250000e-02 [rho] 1.9920000e+00 0.0000000e+00 2.0080645e-03 -[elc] -1.2878587e-14 -1.0080645e-03 3.1250000e-02 +[elc] -2.3203661e-14 -1.0080645e-03 3.1250000e-02 Momentum - x y z -[total ] 1.3766766e-14 0.0000000e+00 0.0000000e+00 -[fluid ] 1.3766766e-14 0.0000000e+00 0.0000000e+00 +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 [walls ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 Starting time step loop. @@ -113,17 +122,17 @@ Starting time step loop. Scalars - total mean variance min max [rho] 992.00 1.00000000000 1.5210055e-14 0.99999998294 1.00000011145 -[psi] -1.4122037e-12 -1.5210888e+00 2.9128003e+00 +[psi] 1.1990409e-14 -1.5210888e+00 2.9128003e+00 [rho] 1.9920000e+00 8.2093661e-04 3.1250000e-02 [rho] 1.9920000e+00 0.0000000e+00 2.4098347e-03 -[elc] 4.9960036e-16 -1.5888981e-03 3.1250000e-02 +[elc] -1.4988011e-14 -1.5888981e-03 3.1250000e-02 Free energy density - timestep total fluid [fed] 100 -2.4613216884e-02 -2.2373587017e-02 Momentum - x y z -[total ] -1.1102230e-15 3.3306691e-16 0.0000000e+00 -[fluid ] -1.4899193e-13 3.3306691e-16 0.0000000e+00 +[total ] -6.6613381e-16 3.1225023e-17 0.0000000e+00 +[fluid ] -1.4854784e-13 3.1225023e-17 0.0000000e+00 [walls ] 1.4788171e-13 0.0000000e+00 0.0000000e+00 Velocity - x y z @@ -137,18 +146,19 @@ Timer resolution: 1e-06 second Timer statistics Section: tmin tmax total - Total: 3.383 3.383 3.383 3.382850 (1 call) - Time step loop: 0.031 0.045 3.380 0.033796 (100 calls) - Propagation: 0.001 0.001 0.069 0.000694 (100 calls) - Propagtn (krnl) : 0.001 0.001 0.069 0.000692 (100 calls) - Collision: 0.001 0.002 0.123 0.001227 (100 calls) - Collision (krnl) : 0.001 0.002 0.123 0.001225 (100 calls) - Lattice halos: 0.000 0.001 0.073 0.000183 (400 calls) - phi gradients: 0.000 0.000 0.000 0.000001 (100 calls) - BBL: 0.000 0.000 0.002 0.000022 (100 calls) - Force calculation: 0.000 0.000 0.015 0.000073 (200 calls) + Total: 2.751 2.751 2.751 2.750747 (1 call) + Time step loop: 0.027 0.029 2.746 0.027462 (100 calls) + Propagation: 0.001 0.001 0.061 0.000605 (100 calls) + Propagtn (krnl) : 0.001 0.001 0.060 0.000604 (100 calls) + Collision: 0.001 0.001 0.120 0.001200 (100 calls) + Collision (krnl) : 0.001 0.001 0.120 0.001198 (100 calls) + Lattice halos: 0.000 0.001 0.066 0.000165 (400 calls) + phi gradients: 0.000 0.000 0.000 0.000000 (100 calls) + BBL: 0.000 0.000 0.002 0.000024 (100 calls) + Force calculation: 0.000 0.000 0.013 0.000067 (200 calls) phi update: 0.000 0.000 0.000 0.000000 (100 calls) - Poisson equation: 0.027 0.039 2.927 0.029268 (100 calls) - Nernst Planck: 0.001 0.003 0.161 0.001611 (100 calls) - Free1: 0.000 0.001 0.001 0.000007 (100 calls) + Poisson equation: 0.023 0.025 2.338 0.023377 (100 calls) + Nernst Planck: 0.001 0.002 0.137 0.001366 (100 calls) + Free1: 0.000 0.001 0.001 0.000009 (100 calls) +End time: Wed Jan 12 12:46:06 2022 Ludwig finished normally. From 5c0e5dcda244ffb2b76b985292e42a820b57648e Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 13:02:11 +0000 Subject: [PATCH 15/64] input and loghad become separated --- .../regression/d3q19-elec/serial-rest-ec1.inp | 84 ------------------- .../regression/d3q19-elec/serial-rest-ec2.inp | 72 ---------------- 2 files changed, 156 deletions(-) delete mode 100644 tests/regression/d3q19-elec/serial-rest-ec1.inp delete mode 100644 tests/regression/d3q19-elec/serial-rest-ec2.inp diff --git a/tests/regression/d3q19-elec/serial-rest-ec1.inp b/tests/regression/d3q19-elec/serial-rest-ec1.inp deleted file mode 100644 index f88888cb5..000000000 --- a/tests/regression/d3q19-elec/serial-rest-ec1.inp +++ /dev/null @@ -1,84 +0,0 @@ -############################################################################## -# -# Restart smoke test part 1 (see also serial-rest-ec2.inp). -# -# Charge fluid plus colloid default output (ASCII). -# -############################################################################## - -N_start 0 -N_cycles 20 - -size 32_32_32 -periodicity 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.1 -viscosity_bulk 0.1 -isothermal_fluctuations off -temperature 0.00001 - -free_energy fe_electro - -fd_advection_scheme_order 2 -fd_force_divergence 0 - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init input_one - -colloid_one_type inactive - -colloid_one_a0 2.3 -colloid_one_ah 2.3 -colloid_one_r 16.0_16.0_15.699 -colloid_one_v 0.0_0.0_0.01 -colloid_one_s 1.0_0.0_0.0 -colloid_one_m 1.0_0.0_0.0 - -colloid_one_q0 +0.01 -colloid_one_q1 0.0000 - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 20 -config_at_end yes - -default_io_grid 1_1_1 -colloid_io_freq 1000 - -############################################################################### -# -# Electrokinetics ALWAYS 2 SPECIES FOR NOW -# -############################################################################### - -electrokinetics_z0 +1 -electrokinetics_z1 -1 -electrokinetics_d0 0.01 -electrokinetics_d1 0.01 -electrokinetics_eunit 1.0 -electrokinetics_epsilon 3.3e3 -electrokinetics_init uniform -electrokinetics_init_rho_el 0.001 - -############################################################################### -# -# Miscellaneous -# -############################################################################### - -random_seed 8361235 diff --git a/tests/regression/d3q19-elec/serial-rest-ec2.inp b/tests/regression/d3q19-elec/serial-rest-ec2.inp deleted file mode 100644 index 6028db447..000000000 --- a/tests/regression/d3q19-elec/serial-rest-ec2.inp +++ /dev/null @@ -1,72 +0,0 @@ -############################################################################## -# -# Restart smoke test part 2 (see also serial-rest-ec1.inp) -# -# Charged fluid plus colloid. -# -############################################################################## - -N_start 20 -N_cycles 20 - -size 32_32_32 -periodicity 1_1_1 - -############################################################################## -# -# Fluid parameters -# -############################################################################## - -viscosity 0.1 -viscosity_bulk 0.1 -isothermal_fluctuations off -temperature 0.00001 - -free_energy fe_electro - -fd_advection_scheme_order 2 -fd_force_divergence 0 - -############################################################################### -# -# Colloid parameters -# -############################################################################### - -colloid_init from_file - -############################################################################### -# -# Output frequency and type -# -############################################################################### - -freq_statistics 20 -config_at_end no - -default_io_grid 1_1_1 -colloid_io_freq 1000 - -############################################################################### -# -# Electrokinetics ALWAYS 2 SPECIES FOR NOW -# -############################################################################### - -electrokinetics_z0 +1 -electrokinetics_z1 -1 -electrokinetics_d0 0.01 -electrokinetics_d1 0.01 -electrokinetics_eunit 1.0 -electrokinetics_epsilon 3.3e3 -electrokinetics_init uniform -electrokinetics_init_rho_el 0.001 - -############################################################################### -# -# Miscellaneous -# -############################################################################### - -random_seed 8361235 From c295e442c8ca02493e36a4df943b8f12bd512e13 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 13:02:32 +0000 Subject: [PATCH 16/64] Reunite log and input --- .../d3q19-short/serial-rest-ec1.inp | 84 +++++++++++++++++++ .../d3q19-short/serial-rest-ec2.inp | 72 ++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 tests/regression/d3q19-short/serial-rest-ec1.inp create mode 100644 tests/regression/d3q19-short/serial-rest-ec2.inp diff --git a/tests/regression/d3q19-short/serial-rest-ec1.inp b/tests/regression/d3q19-short/serial-rest-ec1.inp new file mode 100644 index 000000000..f88888cb5 --- /dev/null +++ b/tests/regression/d3q19-short/serial-rest-ec1.inp @@ -0,0 +1,84 @@ +############################################################################## +# +# Restart smoke test part 1 (see also serial-rest-ec2.inp). +# +# Charge fluid plus colloid default output (ASCII). +# +############################################################################## + +N_start 0 +N_cycles 20 + +size 32_32_32 +periodicity 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.1 +viscosity_bulk 0.1 +isothermal_fluctuations off +temperature 0.00001 + +free_energy fe_electro + +fd_advection_scheme_order 2 +fd_force_divergence 0 + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init input_one + +colloid_one_type inactive + +colloid_one_a0 2.3 +colloid_one_ah 2.3 +colloid_one_r 16.0_16.0_15.699 +colloid_one_v 0.0_0.0_0.01 +colloid_one_s 1.0_0.0_0.0 +colloid_one_m 1.0_0.0_0.0 + +colloid_one_q0 +0.01 +colloid_one_q1 0.0000 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 20 +config_at_end yes + +default_io_grid 1_1_1 +colloid_io_freq 1000 + +############################################################################### +# +# Electrokinetics ALWAYS 2 SPECIES FOR NOW +# +############################################################################### + +electrokinetics_z0 +1 +electrokinetics_z1 -1 +electrokinetics_d0 0.01 +electrokinetics_d1 0.01 +electrokinetics_eunit 1.0 +electrokinetics_epsilon 3.3e3 +electrokinetics_init uniform +electrokinetics_init_rho_el 0.001 + +############################################################################### +# +# Miscellaneous +# +############################################################################### + +random_seed 8361235 diff --git a/tests/regression/d3q19-short/serial-rest-ec2.inp b/tests/regression/d3q19-short/serial-rest-ec2.inp new file mode 100644 index 000000000..6028db447 --- /dev/null +++ b/tests/regression/d3q19-short/serial-rest-ec2.inp @@ -0,0 +1,72 @@ +############################################################################## +# +# Restart smoke test part 2 (see also serial-rest-ec1.inp) +# +# Charged fluid plus colloid. +# +############################################################################## + +N_start 20 +N_cycles 20 + +size 32_32_32 +periodicity 1_1_1 + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.1 +viscosity_bulk 0.1 +isothermal_fluctuations off +temperature 0.00001 + +free_energy fe_electro + +fd_advection_scheme_order 2 +fd_force_divergence 0 + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init from_file + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 20 +config_at_end no + +default_io_grid 1_1_1 +colloid_io_freq 1000 + +############################################################################### +# +# Electrokinetics ALWAYS 2 SPECIES FOR NOW +# +############################################################################### + +electrokinetics_z0 +1 +electrokinetics_z1 -1 +electrokinetics_d0 0.01 +electrokinetics_d1 0.01 +electrokinetics_eunit 1.0 +electrokinetics_epsilon 3.3e3 +electrokinetics_init uniform +electrokinetics_init_rho_el 0.001 + +############################################################################### +# +# Miscellaneous +# +############################################################################### + +random_seed 8361235 From f47c446eaa1c123f7760765a7b0f8a7ab789425f Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 13:03:27 +0000 Subject: [PATCH 17/64] Add rule for restart test --- tests/regression/d3q19-short/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/regression/d3q19-short/Makefile b/tests/regression/d3q19-short/Makefile index a3d3c0714..09c3e591f 100644 --- a/tests/regression/d3q19-short/Makefile +++ b/tests/regression/d3q19-short/Makefile @@ -32,6 +32,7 @@ logs: $(LOGS) # Restart tests must be in the right order serial-rest-c02.new: serial-rest-c01.new +serial-rest-ec2.new: serial-rest-ec1.new # Generate initial conditions for polymer test before running From 53c9dcc0504960d0e2fcbc98598884177eb08b55 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 13:05:21 +0000 Subject: [PATCH 18/64] Clean up electrokinetic resources --- src/ludwig.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ludwig.c b/src/ludwig.c index de8624c90..509dd95e8 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -1102,6 +1102,7 @@ void ludwig_run(const char * inputfile) { #ifdef PETSC if (ludwig->psi) psi_petsc_finish(); #endif + if (ludwig->psi) psi_free(ludwig->psi); if (ludwig->stat_rheo) stats_rheology_free(ludwig->stat_rheo); if (ludwig->stat_turb) stats_turbulent_free(ludwig->stat_turb); From aaf894c6251f0c47a3291040a6098694bd37c531 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 12 Jan 2022 13:42:48 +0000 Subject: [PATCH 19/64] Rejoin electrokeinetic tests --- tests/regression/d3q19-elec/Makefile | 20 ++++++++++++++++--- .../serial-rest-ec1.inp | 0 .../serial-rest-ec1.log | 0 .../serial-rest-ec2.inp | 0 .../serial-rest-ec2.log | 0 tests/regression/d3q19-short/Makefile | 1 - 6 files changed, 17 insertions(+), 4 deletions(-) rename tests/regression/{d3q19-short => d3q19-elec}/serial-rest-ec1.inp (100%) rename tests/regression/{d3q19-short => d3q19-elec}/serial-rest-ec1.log (100%) rename tests/regression/{d3q19-short => d3q19-elec}/serial-rest-ec2.inp (100%) rename tests/regression/{d3q19-short => d3q19-elec}/serial-rest-ec2.log (100%) diff --git a/tests/regression/d3q19-elec/Makefile b/tests/regression/d3q19-elec/Makefile index f982abcba..38bde537f 100644 --- a/tests/regression/d3q19-elec/Makefile +++ b/tests/regression/d3q19-elec/Makefile @@ -17,10 +17,24 @@ endif SER=${LAUNCH_SERIAL_CMD} PAR=${LAUNCH_MPIRUN_CMD} ${MPIRUN_NTASK_FLAG} ${MPIRUN_NTASKS} +SOURCES = $(wildcard *.inp) +LOGS = ${SOURCES:.inp=.new} + test: - @echo "TEST --> regression tests d3q19-elec" - inputs='serial*inp'; \ - for file in $$inputs; do ../../test.sh $$file "${SER}" "${PAR}"; done + $(MAKE) -s clean + $(MAKE) -s logs + @echo End of tests. + +# Run a test + +%.new: %.inp + ../../test.sh $< "${SER}" "${PAR}" + +logs: $(LOGS) + +# Rule to ensure restart test runs in correct order + +serial-rest-ec2.new: serial-rest-ec1.new clean: rm -f *new test-diff* diff --git a/tests/regression/d3q19-short/serial-rest-ec1.inp b/tests/regression/d3q19-elec/serial-rest-ec1.inp similarity index 100% rename from tests/regression/d3q19-short/serial-rest-ec1.inp rename to tests/regression/d3q19-elec/serial-rest-ec1.inp diff --git a/tests/regression/d3q19-short/serial-rest-ec1.log b/tests/regression/d3q19-elec/serial-rest-ec1.log similarity index 100% rename from tests/regression/d3q19-short/serial-rest-ec1.log rename to tests/regression/d3q19-elec/serial-rest-ec1.log diff --git a/tests/regression/d3q19-short/serial-rest-ec2.inp b/tests/regression/d3q19-elec/serial-rest-ec2.inp similarity index 100% rename from tests/regression/d3q19-short/serial-rest-ec2.inp rename to tests/regression/d3q19-elec/serial-rest-ec2.inp diff --git a/tests/regression/d3q19-short/serial-rest-ec2.log b/tests/regression/d3q19-elec/serial-rest-ec2.log similarity index 100% rename from tests/regression/d3q19-short/serial-rest-ec2.log rename to tests/regression/d3q19-elec/serial-rest-ec2.log diff --git a/tests/regression/d3q19-short/Makefile b/tests/regression/d3q19-short/Makefile index 09c3e591f..a3d3c0714 100644 --- a/tests/regression/d3q19-short/Makefile +++ b/tests/regression/d3q19-short/Makefile @@ -32,7 +32,6 @@ logs: $(LOGS) # Restart tests must be in the right order serial-rest-c02.new: serial-rest-c01.new -serial-rest-ec2.new: serial-rest-ec1.new # Generate initial conditions for polymer test before running From f75df64025d2739e87882b4d1e966e9db80f7455 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Tue, 25 Jan 2022 20:44:15 +0000 Subject: [PATCH 20/64] Added reference for CF1 initial configuration --- src/blue_phase_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blue_phase_init.c b/src/blue_phase_init.c index c533080d4..4a1ab6c57 100644 --- a/src/blue_phase_init.c +++ b/src/blue_phase_init.c @@ -1417,6 +1417,8 @@ static int rotate_inplace(const rotation_t * rot, double r[3]) { * Uses the current free energy parameters * q0 (P=2pi/q0) * + * See also P. Ribiere, S. Pirkl, P. Oswald, Phys. Rev. A 44, 8198--8209 (1991). + * *****************************************************************************/ int blue_phase_cf1_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, @@ -1522,6 +1524,8 @@ int blue_phase_cf1_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, * Uses the current free energy parameters * q0 (pitch = 2pi/q0) * + * See also P. Ribiere, S. Pirkl, P. Oswald, Phys. Rev. A 44, 8198--8209 (1991). + * *****************************************************************************/ int blue_phase_random_cf1_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, From 3fb6b2101b051b1ffc13842e8f575615ec94a4ff Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:04:57 +0000 Subject: [PATCH 21/64] Add option to report imbalance time in host halo --- src/distribution_rt.c | 5 +++++ src/lb_data.h | 1 + src/lb_data_options.c | 4 ++-- src/lb_data_options.h | 1 + src/model.c | 30 ++++++++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/distribution_rt.c b/src/distribution_rt.c index 99c085608..f68069308 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -278,6 +278,11 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { if (havetype) { pe_info(pe, "Halo scheme: %s\n", htype); } + + options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); + if (options.reportimbalance) { + pe_info(pe, "Imbalance time: %s\n", "reported"); + } } lb_data_create(pe, cs, &options, lb); diff --git a/src/lb_data.h b/src/lb_data.h index f36cc4ea7..2b1c52ef6 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -129,6 +129,7 @@ struct lb_data_s { lb_relaxation_enum_t nrelax; /* Relaxation scheme */ lb_halo_enum_t haloscheme; /* halo scheme */ + lb_data_options_t opts; /* Copy of run time options */ lb_halo_t h; /* halo information/buffers */ /* MPI data types for halo swaps; these are comupted at runtime diff --git a/src/lb_data_options.c b/src/lb_data_options.c index e30d41e25..63f4943d3 100644 --- a/src/lb_data_options.c +++ b/src/lb_data_options.c @@ -30,6 +30,7 @@ lb_data_options_t lb_data_options_default(void) { lb_data_options_t opts = {.ndim = 3, .nvel = 19, .ndist = 1, .nrelax = LB_RELAXATION_M10, .halo = LB_HALO_TARGET, + .reportimbalance = 0, .data = io_info_args_default(), .rho = io_info_args_default()}; @@ -46,8 +47,7 @@ int lb_data_options_valid(const lb_data_options_t * opts) { int valid = 1; - if (!(opts->ndim == 2 || opts->ndim == 3)) valid = 0; - /* nvel */ + if (!(opts->ndim == 2 || opts->ndim == 3)) valid = 0; if (!(opts->ndist == 1 || opts->ndist == 2)) valid = 0; return valid; diff --git a/src/lb_data_options.h b/src/lb_data_options.h index 2ccb361e6..5accb8ad0 100644 --- a/src/lb_data_options.h +++ b/src/lb_data_options.h @@ -37,6 +37,7 @@ struct lb_data_options_s { int ndist; lb_relaxation_enum_t nrelax; lb_halo_enum_t halo; + int reportimbalance; io_info_args_t data; io_info_args_t rho; diff --git a/src/model.c b/src/model.c index a3a2c5f3a..2771b9f8f 100644 --- a/src/model.c +++ b/src/model.c @@ -30,6 +30,8 @@ #include "coords.h" #include "lb_data.h" #include "io_harness.h" + +#include "timer.h" #include "util.h" static int lb_mpi_init(lb_t * lb); @@ -125,6 +127,7 @@ int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, lb_halo_create(obj, &obj->h, obj->haloscheme); lb_init(obj); + obj->opts = *options; *lb = obj; return 0; @@ -2017,8 +2020,17 @@ int lb_halo_post(const lb_t * lb, lb_halo_t * h) { assert(lb); assert(h); + /* Imbalance timer */ + if (lb->opts.reportimbalance) { + TIMER_start(TIMER_LB_HALO_IMBAL); + MPI_Barrier(h->comm); + TIMER_stop(TIMER_LB_HALO_IMBAL); + } + /* Post recvs (from opposite direction cf send) */ + TIMER_start(TIMER_LB_HALO_IRECV); + for (int ireq = 0; ireq < h->map.nvel; ireq++) { h->request[ireq] = MPI_REQUEST_NULL; @@ -2036,9 +2048,13 @@ int lb_halo_post(const lb_t * lb, lb_halo_t * h) { } } + TIMER_stop(TIMER_LB_HALO_IRECV); + /* Load send buffers */ /* Enqueue sends (second half of request array) */ + TIMER_start(TIMER_LB_HALO_PACK); + #pragma omp parallel { for (int ireq = 0; ireq < h->map.nvel; ireq++) { @@ -2046,6 +2062,10 @@ int lb_halo_post(const lb_t * lb, lb_halo_t * h) { } } + TIMER_stop(TIMER_LB_HALO_PACK); + + TIMER_start(TIMER_LB_HALO_ISEND); + for (int ireq = 0; ireq < h->map.nvel; ireq++) { h->request[27+ireq] = MPI_REQUEST_NULL; @@ -2064,6 +2084,8 @@ int lb_halo_post(const lb_t * lb, lb_halo_t * h) { } } + TIMER_stop(TIMER_LB_HALO_ISEND); + return 0; } @@ -2078,8 +2100,14 @@ int lb_halo_wait(lb_t * lb, lb_halo_t * h) { assert(lb); assert(h); + TIMER_start(TIMER_LB_HALO_WAIT); + MPI_Waitall(2*h->map.nvel, h->request, MPI_STATUSES_IGNORE); + TIMER_stop(TIMER_LB_HALO_WAIT); + + TIMER_start(TIMER_LB_HALO_UNPACK); + #pragma omp parallel { for (int ireq = 0; ireq < h->map.nvel; ireq++) { @@ -2087,6 +2115,8 @@ int lb_halo_wait(lb_t * lb, lb_halo_t * h) { } } + TIMER_stop(TIMER_LB_HALO_UNPACK); + return 0; } From f1f7e15be185333211311faba309d2f4be385955 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:05:22 +0000 Subject: [PATCH 22/64] Add timers for explicit host halo breakdown --- src/timer.c | 20 +++++++++++++++++++- src/timer.h | 23 ++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/timer.c b/src/timer.c index 82ccc5a0f..795a13053 100644 --- a/src/timer.c +++ b/src/timer.c @@ -44,9 +44,21 @@ static const char * timer_name[] = {"Total", "Collision", "Collision (krnl) ", "Lattice halos", + "-> imbalance", + "-> irecv", + "-> pack", + "-> isend", + "-> waitall", + "-> unpack", "phi gradients", "phi grad (krnl) ", "phi halos", + "-> imbalance", + "-> irecv", + "-> pack", + "-> isend", + "-> waitall", + "-> unpack", "Lees Edwards BC", "I/O", "Forces", @@ -63,6 +75,12 @@ static const char * timer_name[] = {"Total", "Phi force (krnl) ", "phi update", "Velocity Halo ", + "-> imbalance", + "-> irecv", + "-> pack", + "-> isend", + "-> waitall", + "-> unpack", "BE mol field (krnl) ", "BP BE update (krnl) ", "Advectn (krnl) ", @@ -74,7 +92,7 @@ static const char * timer_name[] = {"Total", "Lap timer (no report)", "Free1", "Free2", - "Free3" + "Free3", "Free4", "Free5", "Free6" }; diff --git a/src/timer.h b/src/timer.h index 49e1e2fa3..28067c188 100644 --- a/src/timer.h +++ b/src/timer.h @@ -56,9 +56,21 @@ enum timer_id {TIMER_TOTAL = 0, TIMER_COLLIDE, TIMER_COLLIDE_KERNEL, TIMER_HALO_LATTICE, + TIMER_LB_HALO_IMBAL, + TIMER_LB_HALO_IRECV, + TIMER_LB_HALO_PACK, + TIMER_LB_HALO_ISEND, + TIMER_LB_HALO_WAIT, + TIMER_LB_HALO_UNPACK, TIMER_PHI_GRADIENTS, TIMER_PHI_GRAD_KERNEL, TIMER_PHI_HALO, + TIMER_FIELD_HALO_IMBAL, + TIMER_FIELD_HALO_IRECV, + TIMER_FIELD_HALO_PACK, + TIMER_FIELD_HALO_ISEND, + TIMER_FIELD_HALO_WAITALL, + TIMER_FIELD_HALO_UNPACK, TIMER_LE, TIMER_IO, TIMER_FORCES, @@ -74,7 +86,13 @@ enum timer_id {TIMER_TOTAL = 0, TIMER_CHEMICAL_STRESS_KERNEL, TIMER_PHI_FORCE_CALC, TIMER_ORDER_PARAMETER_UPDATE, - TIMER_U_HALO, + TIMER_U_HALO, + TIMER_HYDRO_HALO_IMBAL, + TIMER_HYDRO_HALO_IRECV, + TIMER_HYDRO_HALO_PACK, + TIMER_HYDRO_HALO_ISEND, + TIMER_HYDRO_HALO_WAITALL, + TIMER_HYDRO_HALO_UNPACK, TIMER_BE_MOL_FIELD, BP_BE_UPDATE_KERNEL, ADVECTION_X_KERNEL, @@ -87,6 +105,9 @@ enum timer_id {TIMER_TOTAL = 0, TIMER_FREE1, TIMER_FREE2, TIMER_FREE3, + TIMER_FREE4, + TIMER_FREE5, + TIMER_FREE6, TIMER_NTIMERS /* This must be the last entry */ }; From db2e4f45f24c5b6b3671050c208aa3def4d71942 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:06:49 +0000 Subject: [PATCH 23/64] Add options for halo report --- src/field.c | 35 +++++++++++++++++++++++++++++++---- src/field.h | 2 +- src/field_options.c | 1 + src/field_options.h | 3 +++ src/ludwig.c | 3 ++- 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/field.c b/src/field.c index 3bcb5bb59..afe51a55c 100644 --- a/src/field.c +++ b/src/field.c @@ -32,6 +32,8 @@ #include "coords.h" #include "leesedwards.h" #include "io_harness.h" + +#include "timer.h" #include "util.h" #include "field.h" @@ -96,6 +98,8 @@ __host__ int field_create(pe_t * pe, cs_t * cs, lees_edw_t * le, field_halo_create(obj, &obj->h); obj->opts = *opts; + if (obj->opts.haloverbose) field_halo_info(obj); + *pobj = obj; return 0; @@ -1205,6 +1209,8 @@ int field_halo_post(const field_t * field, field_halo_t * h) { /* Post recvs */ + TIMER_start(TIMER_FIELD_HALO_IRECV); + h->request[0] = MPI_REQUEST_NULL; for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1222,8 +1228,12 @@ int field_halo_post(const field_t * field, field_halo_t * h) { tagbase + ireq, h->comm, h->request + ireq); } + TIMER_stop(TIMER_FIELD_HALO_IRECV); + /* Load send buffers; post sends */ + TIMER_start(TIMER_FIELD_HALO_PACK); + #pragma omp parallel { for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1231,6 +1241,10 @@ int field_halo_post(const field_t * field, field_halo_t * h) { } } + TIMER_stop(TIMER_FIELD_HALO_PACK); + + TIMER_start(TIMER_FIELD_HALO_ISEND); + h->request[27] = MPI_REQUEST_NULL; for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1245,6 +1259,8 @@ int field_halo_post(const field_t * field, field_halo_t * h) { tagbase + ireq, h->comm, h->request + 27 + ireq); } + TIMER_stop(TIMER_FIELD_HALO_ISEND); + return 0; } @@ -1259,8 +1275,14 @@ int field_halo_wait(field_t * field, field_halo_t * h) { assert(field); assert(h); + TIMER_start(TIMER_FIELD_HALO_WAITALL); + MPI_Waitall(2*h->nvel, h->request, MPI_STATUSES_IGNORE); + TIMER_stop(TIMER_FIELD_HALO_WAITALL); + + TIMER_start(TIMER_FIELD_HALO_UNPACK); + #pragma omp parallel { for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1268,6 +1290,8 @@ int field_halo_wait(field_t * field, field_halo_t * h) { } } + TIMER_stop(TIMER_FIELD_HALO_UNPACK); + return 0; } @@ -1277,10 +1301,14 @@ int field_halo_wait(field_t * field, field_halo_t * h) { * *****************************************************************************/ -int field_halo_info(pe_t * pe, const field_t * f, const field_halo_t * h) { +int field_halo_info(const field_t * f) { - assert(pe); - assert(h); + assert(f); + assert(f->pe); + assert(f->h); + + pe_t * pe = f->pe; + const field_halo_t * h = &f->h; /* For each direction, send limits */ @@ -1317,7 +1345,6 @@ int field_halo_info(pe_t * pe, const field_t * f, const field_halo_t * h) { f->nf*field_halo_size(h->rlim[ireq])*sizeof(double)); } - return 0; } diff --git a/src/field.h b/src/field.h index d695ea742..56881e5e5 100644 --- a/src/field.h +++ b/src/field.h @@ -71,7 +71,7 @@ struct field_s { int field_halo_create(const field_t * field, field_halo_t * h); int field_halo_post(const field_t * field, field_halo_t * h); int field_halo_wait(field_t * field, field_halo_t * h); -int field_halo_info(pe_t * pe, const field_t * field, const field_halo_t * h); +int field_halo_info(const field_t * field); int field_halo_free(field_halo_t * h); __host__ int field_create(pe_t * pe, cs_t * cs, lees_edw_t * le, diff --git a/src/field_options.c b/src/field_options.c index fe1ce3cdc..0247ac0e4 100644 --- a/src/field_options.c +++ b/src/field_options.c @@ -29,6 +29,7 @@ field_options_t field_options_default(void) { field_options_t opts = {.ndata = 1, .nhcomm = 0, .haloscheme = FIELD_HALO_TARGET, + .haloverbose = 0, .iodata = io_info_args_default()}; return opts; } diff --git a/src/field_options.h b/src/field_options.h index 360e97b79..82478fcfd 100644 --- a/src/field_options.h +++ b/src/field_options.h @@ -28,7 +28,10 @@ typedef struct field_options_s field_options_t; struct field_options_s { int ndata; /* Number of field components */ int nhcomm; /* Actual halo width required */ + field_halo_enum_t haloscheme; /* Halo swap method */ + int haloverbose; /* Halo information level */ + io_info_args_t iodata; /* I/O information */ }; diff --git a/src/ludwig.c b/src/ludwig.c index 7b2ec72ac..a4f9e8f1d 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2011-2021 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -1595,6 +1595,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { if (rt_switch(rt, "field_halo_openmp")) { opts.haloscheme = FIELD_HALO_OPENMP; + opts.haloverbose = rt_switch(rt, "field_halo_verbose"); } field_create(pe, cs, le, "q", &opts, &ludwig->q); field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); From de958591a7ed2cd42077b6fd3ec76ec6e663a955 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:07:17 +0000 Subject: [PATCH 24/64] Add halo breakdown tiemrs --- src/hydro.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/hydro.c b/src/hydro.c index e2056dd8f..e995718b9 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -24,6 +24,8 @@ #include "util.h" #include "hydro.h" +#include "timer.h" + static int hydro_lees_edwards_parallel(hydro_t * obj); static int hydro_u_write(FILE * fp, int index, void * self); static int hydro_u_write_ascii(FILE * fp, int index, void * self); @@ -1538,6 +1540,8 @@ int hydro_halo_post(hydro_t * hydro) { /* Post recvs */ + TIMER_start(TIMER_HYDRO_HALO_IRECV); + for (int ireq = 1; ireq < h->nvel; ireq++) { int i = 1 + h->cv[h->nvel - ireq][X]; @@ -1551,8 +1555,12 @@ int hydro_halo_post(hydro_t * hydro) { tagbase + ireq, h->comm, h->request + ireq); } + TIMER_stop(TIMER_HYDRO_HALO_IRECV); + /* Load send buffers; post sends */ + TIMER_start(TIMER_HYDRO_HALO_PACK); + #pragma omp parallel { for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1560,6 +1568,10 @@ int hydro_halo_post(hydro_t * hydro) { } } + TIMER_stop(TIMER_HYDRO_HALO_PACK); + + TIMER_start(TIMER_HYDRO_HALO_ISEND); + for (int ireq = 1; ireq < h->nvel; ireq++) { int i = 1 + h->cv[ireq][X]; int j = 1 + h->cv[ireq][Y]; @@ -1572,6 +1584,8 @@ int hydro_halo_post(hydro_t * hydro) { tagbase + ireq, h->comm, h->request + 27 + ireq); } + TIMER_stop(TIMER_HYDRO_HALO_ISEND); + return 0; } @@ -1587,8 +1601,14 @@ int hydro_halo_wait(hydro_t * hydro) { hydro_halo_t * h = &hydro->h; + TIMER_start(TIMER_HYDRO_HALO_WAITALL); + MPI_Waitall(2*h->nvel, h->request, MPI_STATUSES_IGNORE); + TIMER_stop(TIMER_HYDRO_HALO_WAITALL); + + TIMER_start(TIMER_HYDRO_HALO_UNPACK); + #pragma omp parallel { for (int ireq = 1; ireq < h->nvel; ireq++) { @@ -1596,6 +1616,8 @@ int hydro_halo_wait(hydro_t * hydro) { } } + TIMER_stop(TIMER_HYDRO_HALO_UNPACK); + return 0; } From dc5fabb54883fbbe7303678b112abd064841446c Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:29:00 +0000 Subject: [PATCH 25/64] Remove erroneous assertion --- src/field.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/field.c b/src/field.c index afe51a55c..9fb3af781 100644 --- a/src/field.c +++ b/src/field.c @@ -1305,7 +1305,6 @@ int field_halo_info(const field_t * f) { assert(f); assert(f->pe); - assert(f->h); pe_t * pe = f->pe; const field_halo_t * h = &f->h; From e884383c0dd79b70237c6584fce61dd3987ad500 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:29:33 +0000 Subject: [PATCH 26/64] Remove outdated call --- tests/unit/test_field.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/test_field.c b/tests/unit/test_field.c index e5b2a6dad..dfa4cf50a 100644 --- a/tests/unit/test_field.c +++ b/tests/unit/test_field.c @@ -469,7 +469,6 @@ int test_field_halo_create(pe_t * pe) { field_create(pe, cs, NULL, "halotest", &opts, &field); field_halo_create(field, &h); - field_halo_info(pe, field, &h); test_coords_field_set(cs, 2, field->data, MPI_DOUBLE, test_ref_double1); field_halo_post(field, &h); From fc659a0538a8149709fe93e6475a4920a7a7400a Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:30:21 +0000 Subject: [PATCH 27/64] Add OpenMP to prevent unrecognised pragma warnings --- .travis.yml | 1 + config/travis-gcc.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7334f3005..7c59ea523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,5 @@ script: - cp config/travis-gcc.mk ./config.mk - make serial - make + - export OMP_NUM_THREADS=1 - make test diff --git a/config/travis-gcc.mk b/config/travis-gcc.mk index 45b2c132f..0fbea80e3 100644 --- a/config/travis-gcc.mk +++ b/config/travis-gcc.mk @@ -9,7 +9,7 @@ BUILD = serial MODEL = -D_D3Q19_ -CC = gcc +CC = gcc -fopenmp CFLAGS = -O -g -Wall AR = ar From 8d85ba1d3cd2e5b3eb3e36b5990399b8aeb62973 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:56:41 +0000 Subject: [PATCH 28/64] Avoid potential overflow/incorrect argument --- src/field.c | 8 ++++---- src/model.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/field.c b/src/field.c index 9fb3af781..8759284c7 100644 --- a/src/field.c +++ b/src/field.c @@ -1320,12 +1320,12 @@ int field_halo_info(const field_t * f) { pe_info(pe, "------------------------------------------------------\n"); for (int ireq = 1; ireq < h->nvel; ireq++) { - pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9d\n", ireq, + pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9ld\n", ireq, h->cv[ireq][X], h->cv[ireq][Y], h->cv[ireq][Z], h->slim[ireq].imin, h->slim[ireq].imax, h->slim[ireq].jmin, h->slim[ireq].jmax, h->slim[ireq].kmin, h->slim[ireq].kmax, - f->nf*field_halo_size(h->slim[ireq])*sizeof(double)); + (size_t) f->nf*field_halo_size(h->slim[ireq])*sizeof(double)); } /* Recv limits counts */ @@ -1336,12 +1336,12 @@ int field_halo_info(const field_t * f) { pe_info(pe, "------------------------------------------------------\n"); for (int ireq = 1; ireq < h->nvel; ireq++) { - pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9d\n", ireq, + pe_info(pe, "%3d (%2d %2d %2d) %4d %4d %4d %4d %4d %4d %9ld\n", ireq, h->cv[ireq][X], h->cv[ireq][Y], h->cv[ireq][Z], h->rlim[ireq].imin, h->rlim[ireq].imax, h->rlim[ireq].jmin, h->rlim[ireq].jmax, h->rlim[ireq].kmin, h->rlim[ireq].kmax, - f->nf*field_halo_size(h->rlim[ireq])*sizeof(double)); + (size_t) f->nf*field_halo_size(h->rlim[ireq])*sizeof(double)); } return 0; diff --git a/src/model.c b/src/model.c index 2771b9f8f..295579d6f 100644 --- a/src/model.c +++ b/src/model.c @@ -442,7 +442,7 @@ static int lb_mpi_init(lb_t * lb) { nz = nlocal[Z] + 2*nhalo; /* extent of single site (AOS) */ - extent = lb->nvel*lb->ndist*sizeof(double); + extent = sizeof(double)*lb->nvel*lb->ndist; /* X direction */ @@ -686,7 +686,7 @@ __host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int form_in, int for io_info_read_set(lb->io_info, IO_FORMAT_BINARY, lb_f_read); io_info_write_set(lb->io_info, IO_FORMAT_BINARY, lb_f_write); io_info_set_bytesize(lb->io_info, IO_FORMAT_BINARY, - lb->ndist*lb->nvel*sizeof(double)); + sizeof(double)*lb->ndist*lb->nvel); io_info_read_set(lb->io_info, IO_FORMAT_ASCII, lb_f_read_ascii); io_info_write_set(lb->io_info, IO_FORMAT_ASCII, lb_f_write_ascii); io_info_format_set(lb->io_info, form_in, form_out); From 6e95338e14b55753af7f490f2167f7892680f2f4 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 09:56:54 +0000 Subject: [PATCH 29/64] Remove commented out code --- tests/unit/test_model.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index db9f5dfbf..9668b2923 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -254,10 +254,12 @@ int test_lb_halo(pe_t * pe) { test_lb_halo_post_wait(pe, cs, 3, 15, LB_HALO_OPENMP_FULL); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_REDUCED); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_FULL); - /* This will break while still fixed NVEL present... - test_lb_halo_create(pe, cs, 3, 27, 0); - test_lb_halo_create(pe, cs, 3, 27, 1); - */ + + /* TODO: add when NVEL is not fixed... + * "3, 27, LB_HALO_OPENMP_REDUCED" + * "3, 27, LB_HALO_OPENMP_FULL" + */ + cs_free(cs); } From 0ffca98cb0d867032b7ab25c7737c017a0caadd6 Mon Sep 17 00:00:00 2001 From: not populated Date: Fri, 28 Jan 2022 10:08:20 +0000 Subject: [PATCH 30/64] Prevent integer overflow --- src/model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model.c b/src/model.c index 295579d6f..69381635d 100644 --- a/src/model.c +++ b/src/model.c @@ -658,7 +658,7 @@ __host__ int lb_io_info_commit(lb_t * lb, io_info_args_t args) { impl.write_binary = lb_f_write; impl.read_binary = lb_f_read; impl.bytesize_ascii = 0; /* HOW MANY BYTES! */ - impl.bytesize_binary = lb->ndist*lb->nvel*sizeof(double); + impl.bytesize_binary = sizeof(double)*lb->ndist*lb->nvel; io_info_create_impl(lb->pe, lb->cs, args, &impl, &lb->io_info); From f88c78c7df4447f81e726cca8e390f255ff85098 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Mon, 31 Jan 2022 14:45:16 +0000 Subject: [PATCH 31/64] Add comments for overview of subgrid update --- src/subgrid.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/subgrid.c b/src/subgrid.c index 03a1f754f..42afc1ef2 100644 --- a/src/subgrid.c +++ b/src/subgrid.c @@ -6,10 +6,47 @@ * * See Nash et al. (2007). * + * Overview. + * + * Two-way coupling between sub-grid particles and the fluid is implemented + * in roughly two phases. + * + * (1) Force on each particle from the immediately surrounding fluid. + * (2) Influence of the particles on local fluid nodes; + * + * (1) subgrid_update() is responsible for the particle update and setting + * any poistion increment dr. Schematically: + * + * -> subgrid_interpolation() + * accumulates contributions to the force on the particle from + * local fluid nodes to local particle copies (fsub[3]); + * -> COLLOID_SUM_SUBGRID + * ensures all copies agree on the net force per particle fsub[3]. + * -> all copies update v and dr = v.dt from fsub[3] and must agree. + * -> Actual position updates must be deferred until the start of + * the next time step and solloids_info_position_update(). + * + * (2) subgrid_force_from_particle() is responsible for computing + * the force on local fluid nodes from particles. Schematically; + * + * -> On entry, fex[3] may contain pair interaction and other + * "external" forces on the particle; + * -> subgrid_wall_lubrication() + * detect and compute particle/wall lubrication forces, + * and accumulate to fex[3] once per particle (i.e. local copies + * only involved); + * -> COLLOID_SUM_FORCE_EXT_ONLY + * => all copies agree on fext[3], text[3] + * + * -> All particle copies contribute \delta(r - R_i) fext[3] to local + * fluid nodes only via hydro_f_local_add() at position r. + * -> This force may then enter the fluid collision stage. + * + * * Edinburgh Soft Matter and Statistical Phyiscs Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) From 9b0112ad3b261050092f2e31421aab13c54ee080 Mon Sep 17 00:00:00 2001 From: Oliver Henrich Date: Mon, 31 Jan 2022 17:37:54 +0000 Subject: [PATCH 32/64] Updated tutorials --- docs/tutorial/Makefile | 2 +- docs/tutorial/test1/input | 2 - docs/tutorial/test1/stdout | 549 +++++++++--------- .../test1/{vel-00010000.vtk => vel-00010000} | 0 docs/tutorial/test2/extract.sh | 7 + docs/tutorial/test2/input | 2 +- docs/tutorial/test2/phi-00010000.001-001 | Bin 262144 -> 262144 bytes docs/tutorial/test2/phi-00010000.vtk | 4 +- docs/tutorial/test2/stdout | 467 +++++++-------- docs/tutorial/test2/vel-00010000.001-001 | Bin 786432 -> 786432 bytes docs/tutorial/test2/vel-00010000.vtk | 4 +- ...ds00010000.csv => col-cdsvel-00010000.csv} | 0 docs/tutorial/test3/extract.sh | 8 + docs/tutorial/test3/input | 163 +----- .../{dir-q-00010000.vtk => lcd-00010000.vtk} | 134 ++--- .../{op-q-00010000.vtk => lcs-00010000.vtk} | 4 +- docs/tutorial/test3/stdout | 185 +++--- docs/tutorial/test3/vel-00010000.vtk | 4 +- docs/tutorial/tutorial.tex | 122 ++-- 19 files changed, 763 insertions(+), 894 deletions(-) rename docs/tutorial/test1/{vel-00010000.vtk => vel-00010000} (100%) create mode 100755 docs/tutorial/test2/extract.sh rename docs/tutorial/test3/{col-cds00010000.csv => col-cdsvel-00010000.csv} (100%) create mode 100755 docs/tutorial/test3/extract.sh rename docs/tutorial/test3/{dir-q-00010000.vtk => lcd-00010000.vtk} (99%) rename docs/tutorial/test3/{op-q-00010000.vtk => lcs-00010000.vtk} (99%) diff --git a/docs/tutorial/Makefile b/docs/tutorial/Makefile index a424ae62a..3b86244f4 100644 --- a/docs/tutorial/Makefile +++ b/docs/tutorial/Makefile @@ -4,7 +4,7 @@ # # Makefile for documentation # -# make pdf +# make # make clean (probably the most useful) # # should both work. diff --git a/docs/tutorial/test1/input b/docs/tutorial/test1/input index 9872ce626..9f94bbd01 100644 --- a/docs/tutorial/test1/input +++ b/docs/tutorial/test1/input @@ -2,8 +2,6 @@ # # Poiseuille flow tutorial # -# Momentum statistics should tally with some flow. -# ############################################################################## N_cycles 10000 diff --git a/docs/tutorial/test1/stdout b/docs/tutorial/test1/stdout index ef7abe4f6..f66623420 100644 --- a/docs/tutorial/test1/stdout +++ b/docs/tutorial/test1/stdout @@ -1,6 +1,12 @@ -Welcome to Ludwig v0.8.9 (MPI version running on 4 processes) +Welcome to Ludwig v0.15.0 (MPI version running on 4 processes) +Start time: Mon Jan 31 12:18:59 2022 -Note assertions via standard C assert() are on. +Compiler: + name: Gnu 11.2.0 + version-string: 11.2.0 + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. Read 15 user parameters from input @@ -30,7 +36,7 @@ External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 Lattice Boltzmann distributions ------------------------------- Model: d3q19 -SIMD vector len: 1 +SIMD vector len: 4 Number of sets: 1 Halo type: full Input format: binary @@ -67,8 +73,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 8.8817842e-16 0.0000000e+00 0.0000000e+00 -[fluid ] 8.8817842e-16 0.0000000e+00 0.0000000e+00 +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 [walls ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 Starting time step loop. @@ -91,8 +97,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.5673907e-15 1.2800000e-01 0.0000000e+00 -[fluid ] -1.1199375e-14 8.9502713e-02 0.0000000e+00 +[total ] -2.6992297e-15 1.2800000e-01 0.0000000e+00 +[fluid ] -1.1331214e-14 8.9502713e-02 0.0000000e+00 [walls ] 8.6319840e-15 3.8497287e-02 0.0000000e+00 Velocity - x y z @@ -105,8 +111,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.5084101e-15 1.9200000e-01 0.0000000e+00 -[fluid ] 1.1175089e-14 1.2109980e-01 0.0000000e+00 +[total ] -2.2863655e-15 1.9200000e-01 0.0000000e+00 +[fluid ] 1.1397133e-14 1.2109980e-01 0.0000000e+00 [walls ] -1.3683499e-14 7.0900205e-02 0.0000000e+00 Velocity - x y z @@ -119,8 +125,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.7832957e-15 2.5600000e-01 0.0000000e+00 -[fluid ] -1.0998147e-14 1.4688852e-01 0.0000000e+00 +[total ] -1.9290125e-15 2.5600000e-01 0.0000000e+00 +[fluid ] -1.1143864e-14 1.4688852e-01 0.0000000e+00 [walls ] 9.2148511e-15 1.0911148e-01 0.0000000e+00 Velocity - x y z @@ -133,8 +139,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.9647786e-15 3.2000000e-01 0.0000000e+00 -[fluid ] 6.9701189e-15 1.6796527e-01 0.0000000e+00 +[total ] -5.0619231e-15 3.2000000e-01 0.0000000e+00 +[fluid ] 6.8729744e-15 1.6796527e-01 0.0000000e+00 [walls ] -1.1934898e-14 1.5203473e-01 0.0000000e+00 Velocity - x y z @@ -144,11 +150,11 @@ Velocity - x y z Completed cycle 500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -6.9805273e-15 3.8400000e-01 0.0000000e+00 -[fluid ] -9.0344399e-15 1.8519545e-01 0.0000000e+00 +[total ] -6.9250161e-15 3.8400000e-01 0.0000000e+00 +[fluid ] -8.9789287e-15 1.8519545e-01 0.0000000e+00 [walls ] 2.0539126e-15 1.9880455e-01 0.0000000e+00 Velocity - x y z @@ -161,8 +167,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -6.9250161e-15 4.4800000e-01 0.0000000e+00 -[fluid ] 2.2898350e-15 1.9928175e-01 0.0000000e+00 +[total ] -7.1331829e-15 4.4800000e-01 0.0000000e+00 +[fluid ] 2.0816682e-15 1.9928175e-01 0.0000000e+00 [walls ] -9.2148511e-15 2.4871825e-01 0.0000000e+00 Velocity - x y z @@ -172,11 +178,11 @@ Velocity - x y z Completed cycle 700 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -5.6898930e-15 5.1200000e-01 0.0000000e+00 -[fluid ] 1.7347235e-15 2.1079794e-01 0.0000000e+00 +[total ] -5.5927485e-15 5.1200000e-01 0.0000000e+00 +[fluid ] 1.8318680e-15 2.1079794e-01 0.0000000e+00 [walls ] -7.4246165e-15 3.0120206e-01 0.0000000e+00 Velocity - x y z @@ -189,8 +195,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.4339532e-15 5.7600000e-01 0.0000000e+00 -[fluid ] -7.3205331e-15 2.2021294e-01 0.0000000e+00 +[total ] -4.3159920e-15 5.7600000e-01 0.0000000e+00 +[fluid ] -7.2025719e-15 2.2021294e-01 0.0000000e+00 [walls ] 2.8865799e-15 3.5578706e-01 0.0000000e+00 Velocity - x y z @@ -201,11 +207,11 @@ Completed cycle 900 Writing velocity output at step 1000! Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.6386506e-15 6.4000000e-01 0.0000000e+00 -[fluid ] 1.1501217e-14 2.2791015e-01 0.0000000e+00 +[total ] -4.5831394e-15 6.4000000e-01 0.0000000e+00 +[fluid ] 1.1556728e-14 2.2791015e-01 0.0000000e+00 [walls ] -1.6139867e-14 4.1208985e-01 0.0000000e+00 Velocity - x y z @@ -215,11 +221,11 @@ Velocity - x y z Completed cycle 1000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.0453751e-15 7.0400000e-01 0.0000000e+00 -[fluid ] -1.5175361e-14 2.3420297e-01 0.0000000e+00 +[total ] -4.0731307e-15 7.0400000e-01 0.0000000e+00 +[fluid ] -1.5203117e-14 2.3420297e-01 0.0000000e+00 [walls ] 1.1129986e-14 4.6979703e-01 0.0000000e+00 Velocity - x y z @@ -229,11 +235,11 @@ Velocity - x y z Completed cycle 1100 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.3792413e-15 7.6800000e-01 0.0000000e+00 -[fluid ] 1.3176960e-14 2.3934764e-01 0.0000000e+00 +[total ] -3.1918912e-15 7.6800000e-01 0.0000000e+00 +[fluid ] 1.3364310e-14 2.3934764e-01 0.0000000e+00 [walls ] -1.6556201e-14 5.2865236e-01 0.0000000e+00 Velocity - x y z @@ -243,11 +249,11 @@ Velocity - x y z Completed cycle 1200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.2647496e-15 8.3200000e-01 0.0000000e+00 -[fluid ] -9.7456765e-15 2.4355365e-01 0.0000000e+00 +[total ] -3.2092384e-15 8.3200000e-01 0.0000000e+00 +[fluid ] -9.6901653e-15 2.4355365e-01 0.0000000e+00 [walls ] 6.4809269e-15 5.8844635e-01 0.0000000e+00 Velocity - x y z @@ -260,8 +266,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.0253577e-15 8.9600000e-01 0.0000000e+00 -[fluid ] 1.0116907e-14 2.4699225e-01 0.0000000e+00 +[total ] -2.9351521e-15 8.9600000e-01 0.0000000e+00 +[fluid ] 1.0207113e-14 2.4699225e-01 0.0000000e+00 [walls ] -1.3142265e-14 6.4900775e-01 0.0000000e+00 Velocity - x y z @@ -271,11 +277,11 @@ Velocity - x y z Completed cycle 1400 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.9073965e-15 9.6000000e-01 0.0000000e+00 -[fluid ] -2.5465741e-15 2.4980347e-01 0.0000000e+00 +[total ] -2.8657632e-15 9.6000000e-01 0.0000000e+00 +[fluid ] -2.5049407e-15 2.4980347e-01 0.0000000e+00 [walls ] -3.6082248e-16 7.1019653e-01 0.0000000e+00 Velocity - x y z @@ -285,11 +291,11 @@ Velocity - x y z Completed cycle 1500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.7755576e-15 1.0240000e+00 0.0000000e+00 -[fluid ] 2.5535130e-15 2.5210178e-01 0.0000000e+00 +[total ] -2.8935188e-15 1.0240000e+00 0.0000000e+00 +[fluid ] 2.4355518e-15 2.5210178e-01 0.0000000e+00 [walls ] -5.3290705e-15 7.7189822e-01 0.0000000e+00 Velocity - x y z @@ -299,11 +305,11 @@ Velocity - x y z Completed cycle 1600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.4243441e-15 1.0880000e+00 0.0000000e+00 -[fluid ] -3.7574110e-15 2.5398074e-01 0.0000000e+00 +[total ] -3.2925052e-15 1.0880000e+00 0.0000000e+00 +[fluid ] -3.6255721e-15 2.5398074e-01 0.0000000e+00 [walls ] 3.3306691e-16 8.3401926e-01 0.0000000e+00 Velocity - x y z @@ -316,8 +322,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.9759862e-15 1.1520000e+00 0.0000000e+00 -[fluid ] -2.3522850e-15 2.5551689e-01 0.0000000e+00 +[total ] -3.9829251e-15 1.1520000e+00 0.0000000e+00 +[fluid ] -2.3592239e-15 2.5551689e-01 0.0000000e+00 [walls ] -1.6237012e-15 8.9648311e-01 0.0000000e+00 Velocity - x y z @@ -327,11 +333,11 @@ Velocity - x y z Completed cycle 1800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.1876225e-15 1.2160000e+00 0.0000000e+00 -[fluid ] 2.1545266e-15 2.5677276e-01 0.0000000e+00 +[total ] -4.2570114e-15 1.2160000e+00 0.0000000e+00 +[fluid ] 2.0851376e-15 2.5677276e-01 0.0000000e+00 [walls ] -6.3421490e-15 9.5922724e-01 0.0000000e+00 Velocity - x y z @@ -345,8 +351,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -5.8460181e-15 1.2800000e+00 0.0000000e+00 -[fluid ] -9.6068986e-15 2.5779949e-01 0.0000000e+00 +[total ] -5.7003013e-15 1.2800000e+00 0.0000000e+00 +[fluid ] -9.4611818e-15 2.5779949e-01 0.0000000e+00 [walls ] 3.7608805e-15 1.0222005e+00 0.0000000e+00 Velocity - x y z @@ -356,11 +362,11 @@ Velocity - x y z Completed cycle 2000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -5.0966176e-15 1.3440000e+00 0.0000000e+00 -[fluid ] 1.1417950e-14 2.5863889e-01 0.0000000e+00 +[total ] -5.2978455e-15 1.3440000e+00 0.0000000e+00 +[fluid ] 1.1216722e-14 2.5863889e-01 0.0000000e+00 [walls ] -1.6514567e-14 1.0853611e+00 0.0000000e+00 Velocity - x y z @@ -373,8 +379,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -6.2380656e-15 1.4080000e+00 0.0000000e+00 -[fluid ] -1.6861512e-15 2.5932513e-01 0.0000000e+00 +[total ] -6.3421490e-15 1.4080000e+00 0.0000000e+00 +[fluid ] -1.7902346e-15 2.5932513e-01 0.0000000e+00 [walls ] -4.5519144e-15 1.1486749e+00 0.0000000e+00 Velocity - x y z @@ -384,11 +390,11 @@ Velocity - x y z Completed cycle 2200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.8617668e-15 1.4720000e+00 0.0000000e+00 -[fluid ] 1.3183898e-16 2.5988617e-01 0.0000000e+00 +[total ] -7.8825835e-15 1.4720000e+00 0.0000000e+00 +[fluid ] 1.1102230e-16 2.5988617e-01 0.0000000e+00 [walls ] -7.9936058e-15 1.2121138e+00 0.0000000e+00 Velocity - x y z @@ -401,8 +407,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.0182827e-14 1.5360000e+00 0.0000000e+00 -[fluid ] -4.6178339e-15 2.6034485e-01 0.0000000e+00 +[total ] -1.0217521e-14 1.5360000e+00 0.0000000e+00 +[fluid ] -4.6525284e-15 2.6034485e-01 0.0000000e+00 [walls ] -5.5649929e-15 1.2756551e+00 0.0000000e+00 Velocity - x y z @@ -415,8 +421,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2836954e-14 1.6000000e+00 0.0000000e+00 -[fluid ] 9.5617958e-15 2.6071984e-01 0.0000000e+00 +[total ] -1.2587154e-14 1.6000000e+00 0.0000000e+00 +[fluid ] 9.8115960e-15 2.6071984e-01 0.0000000e+00 [walls ] -2.2398750e-14 1.3392802e+00 0.0000000e+00 Velocity - x y z @@ -429,8 +435,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2771034e-14 1.6640000e+00 0.0000000e+00 -[fluid ] -1.4436369e-14 2.6102641e-01 0.0000000e+00 +[total ] -1.2847362e-14 1.6640000e+00 0.0000000e+00 +[fluid ] -1.4512697e-14 2.6102641e-01 0.0000000e+00 [walls ] 1.6653345e-15 1.4029736e+00 0.0000000e+00 Velocity - x y z @@ -440,11 +446,11 @@ Velocity - x y z Completed cycle 2600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.5022705e-14 1.7280000e+00 0.0000000e+00 -[fluid ] 4.2674198e-15 2.6127705e-01 0.0000000e+00 +[total ] -1.4932500e-14 1.7280000e+00 0.0000000e+00 +[fluid ] 4.3576254e-15 2.6127705e-01 0.0000000e+00 [walls ] -1.9290125e-14 1.4667230e+00 0.0000000e+00 Velocity - x y z @@ -457,8 +463,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2601031e-14 1.7920000e+00 0.0000000e+00 -[fluid ] 3.7053693e-15 2.6148195e-01 0.0000000e+00 +[total ] -1.2573276e-14 1.7920000e+00 0.0000000e+00 +[fluid ] 3.7331249e-15 2.6148195e-01 0.0000000e+00 [walls ] -1.6306401e-14 1.5305180e+00 0.0000000e+00 Velocity - x y z @@ -468,11 +474,11 @@ Velocity - x y z Completed cycle 2800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 5.5511151e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2181228e-14 1.8560000e+00 0.0000000e+00 -[fluid ] -1.6802532e-14 2.6164947e-01 0.0000000e+00 +[total ] -1.2306128e-14 1.8560000e+00 0.0000000e+00 +[fluid ] -1.6927432e-14 2.6164947e-01 0.0000000e+00 [walls ] 4.6213033e-15 1.5943505e+00 0.0000000e+00 Velocity - x y z @@ -486,8 +492,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.3562068e-14 1.9200000e+00 0.0000000e+00 -[fluid ] 1.3277573e-14 2.6178643e-01 0.0000000e+00 +[total ] -1.3603701e-14 1.9200000e+00 0.0000000e+00 +[fluid ] 1.3235940e-14 2.6178643e-01 0.0000000e+00 [walls ] -2.6839642e-14 1.6582136e+00 0.0000000e+00 Velocity - x y z @@ -497,11 +503,11 @@ Velocity - x y z Completed cycle 3000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 5.5511151e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2739809e-14 1.9840000e+00 0.0000000e+00 -[fluid ] -3.2890357e-15 2.6189840e-01 0.0000000e+00 +[total ] -1.2725931e-14 1.9840000e+00 0.0000000e+00 +[fluid ] -3.2751579e-15 2.6189840e-01 0.0000000e+00 [walls ] -9.4507735e-15 1.7221016e+00 0.0000000e+00 Velocity - x y z @@ -514,8 +520,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.1549789e-14 2.0480000e+00 0.0000000e+00 -[fluid ] 1.1084883e-14 2.6198993e-01 0.0000000e+00 +[total ] -1.1376317e-14 2.0480000e+00 0.0000000e+00 +[fluid ] 1.1258355e-14 2.6198993e-01 0.0000000e+00 [walls ] -2.2634672e-14 1.7860101e+00 0.0000000e+00 Velocity - x y z @@ -528,8 +534,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -9.5826125e-15 2.1120000e+00 0.0000000e+00 -[fluid ] -1.0290380e-14 2.6206477e-01 0.0000000e+00 +[total ] -9.4230179e-15 2.1120000e+00 0.0000000e+00 +[fluid ] -1.0130785e-14 2.6206477e-01 0.0000000e+00 [walls ] 7.0776718e-16 1.8499352e+00 0.0000000e+00 Velocity - x y z @@ -539,11 +545,11 @@ Velocity - x y z Completed cycle 3300 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -9.5236319e-15 2.1760000e+00 0.0000000e+00 -[fluid ] 9.4611818e-15 2.6212595e-01 0.0000000e+00 +[total ] -9.4473041e-15 2.1760000e+00 0.0000000e+00 +[fluid ] 9.5375097e-15 2.6212595e-01 0.0000000e+00 [walls ] -1.8984814e-14 1.9138740e+00 0.0000000e+00 Velocity - x y z @@ -553,11 +559,11 @@ Velocity - x y z Completed cycle 3400 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -9.7526154e-15 2.2400000e+00 0.0000000e+00 -[fluid ] -6.6717465e-15 2.6217597e-01 0.0000000e+00 +[total ] -9.6832264e-15 2.2400000e+00 0.0000000e+00 +[fluid ] -6.6023575e-15 2.6217597e-01 0.0000000e+00 [walls ] -3.0808689e-15 1.9778240e+00 0.0000000e+00 Velocity - x y z @@ -567,11 +573,11 @@ Velocity - x y z Completed cycle 3500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -8.8921925e-15 2.3040000e+00 0.0000000e+00 -[fluid ] 9.4264874e-15 2.6221687e-01 0.0000000e+00 +[total ] -8.9130092e-15 2.3040000e+00 0.0000000e+00 +[fluid ] 9.4056707e-15 2.6221687e-01 0.0000000e+00 [walls ] -1.8318680e-14 2.0417831e+00 0.0000000e+00 Velocity - x y z @@ -581,11 +587,11 @@ Velocity - x y z Completed cycle 3600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.2060413e-15 2.3680000e+00 0.0000000e+00 -[fluid ] -4.0280279e-15 2.6225030e-01 0.0000000e+00 +[total ] -7.2615525e-15 2.3680000e+00 0.0000000e+00 +[fluid ] -4.0835391e-15 2.6225030e-01 0.0000000e+00 [walls ] -3.1780134e-15 2.1057497e+00 0.0000000e+00 Velocity - x y z @@ -598,8 +604,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.6223750e-15 2.4320000e+00 0.0000000e+00 -[fluid ] 1.6358442e-14 2.6227763e-01 0.0000000e+00 +[total ] -7.5321693e-15 2.4320000e+00 0.0000000e+00 +[fluid ] 1.6448648e-14 2.6227763e-01 0.0000000e+00 [walls ] -2.3980817e-14 2.1697224e+00 0.0000000e+00 Velocity - x y z @@ -609,11 +615,11 @@ Velocity - x y z Completed cycle 3800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -8.1046281e-15 2.4960000e+00 0.0000000e+00 -[fluid ] -1.9012569e-14 2.6229998e-01 0.0000000e+00 +[total ] -8.1878948e-15 2.4960000e+00 0.0000000e+00 +[fluid ] -1.9095836e-14 2.6229998e-01 0.0000000e+00 [walls ] 1.0907941e-14 2.2337000e+00 0.0000000e+00 Velocity - x y z @@ -627,8 +633,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -9.4126096e-15 2.5600000e+00 0.0000000e+00 -[fluid ] 1.9772378e-14 2.6231825e-01 0.0000000e+00 +[total ] -9.4056707e-15 2.5600000e+00 0.0000000e+00 +[fluid ] 1.9779317e-14 2.6231825e-01 0.0000000e+00 [walls ] -2.9184988e-14 2.2976818e+00 0.0000000e+00 Velocity - x y z @@ -638,11 +644,11 @@ Velocity - x y z Completed cycle 4000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.0168949e-14 2.6240000e+00 0.0000000e+00 -[fluid ] -1.2417151e-14 2.6233318e-01 0.0000000e+00 +[total ] -1.0210582e-14 2.6240000e+00 0.0000000e+00 +[fluid ] -1.2458784e-14 2.6233318e-01 0.0000000e+00 [walls ] 2.2482016e-15 2.3616668e+00 0.0000000e+00 Velocity - x y z @@ -655,8 +661,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.0821205e-14 2.6880000e+00 0.0000000e+00 -[fluid ] 1.2465723e-14 2.6234539e-01 0.0000000e+00 +[total ] -1.0800388e-14 2.6880000e+00 0.0000000e+00 +[fluid ] 1.2486540e-14 2.6234539e-01 0.0000000e+00 [walls ] -2.3286928e-14 2.4256546e+00 0.0000000e+00 Velocity - x y z @@ -669,8 +675,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.0755286e-14 2.7520000e+00 0.0000000e+00 -[fluid ] -9.1038288e-15 2.6235537e-01 0.0000000e+00 +[total ] -1.0921819e-14 2.7520000e+00 0.0000000e+00 +[fluid ] -9.2703623e-15 2.6235537e-01 0.0000000e+00 [walls ] -1.6514567e-15 2.4896446e+00 0.0000000e+00 Velocity - x y z @@ -680,11 +686,11 @@ Velocity - x y z Completed cycle 4300 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2895934e-14 2.8160000e+00 0.0000000e+00 -[fluid ] -1.5612511e-16 2.6236354e-01 0.0000000e+00 +[total ] -1.2958384e-14 2.8160000e+00 0.0000000e+00 +[fluid ] -2.1857516e-16 2.6236354e-01 0.0000000e+00 [walls ] -1.2739809e-14 2.5536365e+00 0.0000000e+00 Velocity - x y z @@ -694,11 +700,11 @@ Velocity - x y z Completed cycle 4400 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2587154e-14 2.8800000e+00 0.0000000e+00 -[fluid ] 7.4801276e-15 2.6237021e-01 0.0000000e+00 +[total ] -1.2906343e-14 2.8800000e+00 0.0000000e+00 +[fluid ] 7.1609385e-15 2.6237021e-01 0.0000000e+00 [walls ] -2.0067281e-14 2.6176298e+00 0.0000000e+00 Velocity - x y z @@ -711,8 +717,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2476131e-14 2.9440000e+00 0.0000000e+00 -[fluid ] -1.3641865e-14 2.6237566e-01 0.0000000e+00 +[total ] -1.2302659e-14 2.9440000e+00 0.0000000e+00 +[fluid ] -1.3468393e-14 2.6237566e-01 0.0000000e+00 [walls ] 1.1657342e-15 2.6816243e+00 0.0000000e+00 Velocity - x y z @@ -722,11 +728,11 @@ Velocity - x y z Completed cycle 4600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.4856172e-14 3.0080000e+00 0.0000000e+00 -[fluid ] 7.3066553e-15 2.6238012e-01 0.0000000e+00 +[total ] -1.4994950e-14 3.0080000e+00 0.0000000e+00 +[fluid ] 7.1678774e-15 2.6238012e-01 0.0000000e+00 [walls ] -2.2162827e-14 2.7456199e+00 0.0000000e+00 Velocity - x y z @@ -736,11 +742,11 @@ Velocity - x y z Completed cycle 4700 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2951445e-14 3.0720000e+00 0.0000000e+00 -[fluid ] 8.5695340e-16 2.6238377e-01 0.0000000e+00 +[total ] -1.3069407e-14 3.0720000e+00 0.0000000e+00 +[fluid ] 7.3899220e-16 2.6238377e-01 0.0000000e+00 [walls ] -1.3808399e-14 2.8096162e+00 0.0000000e+00 Velocity - x y z @@ -750,11 +756,11 @@ Velocity - x y z Completed cycle 4800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.1463053e-14 3.1360000e+00 0.0000000e+00 -[fluid ] -2.8171909e-15 2.6238675e-01 0.0000000e+00 +[total ] -1.1567136e-14 3.1360000e+00 0.0000000e+00 +[fluid ] -2.9212743e-15 2.6238675e-01 0.0000000e+00 [walls ] -8.6458618e-15 2.8736133e+00 0.0000000e+00 Velocity - x y z @@ -765,11 +771,11 @@ Completed cycle 4900 Writing velocity output at step 5000! Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.1074475e-14 3.2000000e+00 0.0000000e+00 -[fluid ] 5.4817262e-15 2.6238919e-01 0.0000000e+00 +[total ] -1.1067536e-14 3.2000000e+00 0.0000000e+00 +[fluid ] 5.4886651e-15 2.6238919e-01 0.0000000e+00 [walls ] -1.6556201e-14 2.9376108e+00 0.0000000e+00 Velocity - x y z @@ -779,11 +785,11 @@ Velocity - x y z Completed cycle 5000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -9.3987318e-15 3.2640000e+00 0.0000000e+00 -[fluid ] -5.6517291e-15 2.6239118e-01 0.0000000e+00 +[total ] -9.5028152e-15 3.2640000e+00 0.0000000e+00 +[fluid ] -5.7558125e-15 2.6239118e-01 0.0000000e+00 [walls ] -3.7470027e-15 3.0016088e+00 0.0000000e+00 Velocity - x y z @@ -793,11 +799,11 @@ Velocity - x y z Completed cycle 5100 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.3309414e-15 3.3280000e+00 0.0000000e+00 -[fluid ] 3.5631220e-15 2.6239281e-01 0.0000000e+00 +[total ] -7.1713468e-15 3.3280000e+00 0.0000000e+00 +[fluid ] 3.7227166e-15 2.6239281e-01 0.0000000e+00 [walls ] -1.0894063e-14 3.0656072e+00 0.0000000e+00 Velocity - x y z @@ -807,11 +813,11 @@ Velocity - x y z Completed cycle 5200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.1123663e-15 3.3920000e+00 0.0000000e+00 -[fluid ] -1.7347235e-16 2.6239414e-01 0.0000000e+00 +[total ] -6.8486883e-15 3.3920000e+00 0.0000000e+00 +[fluid ] 9.0205621e-17 2.6239414e-01 0.0000000e+00 [walls ] -6.9388939e-15 3.1296059e+00 0.0000000e+00 Velocity - x y z @@ -824,8 +830,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.6189055e-15 3.4560000e+00 0.0000000e+00 -[fluid ] 3.1918912e-15 2.6239523e-01 0.0000000e+00 +[total ] -7.6327833e-15 3.4560000e+00 0.0000000e+00 +[fluid ] 3.1780134e-15 2.6239523e-01 0.0000000e+00 [walls ] -1.0810797e-14 3.1936048e+00 0.0000000e+00 Velocity - x y z @@ -838,8 +844,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -8.4689200e-15 3.5200000e+00 0.0000000e+00 -[fluid ] 5.2041704e-17 2.6239612e-01 0.0000000e+00 +[total ] -8.4758589e-15 3.5200000e+00 0.0000000e+00 +[fluid ] 4.5102810e-17 2.6239612e-01 0.0000000e+00 [walls ] -8.5209617e-15 3.2576039e+00 0.0000000e+00 Velocity - x y z @@ -849,11 +855,11 @@ Velocity - x y z Completed cycle 5500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -7.9207474e-15 3.5840000e+00 0.0000000e+00 -[fluid ] 8.8713759e-15 2.6239684e-01 0.0000000e+00 +[total ] -7.7889084e-15 3.5840000e+00 0.0000000e+00 +[fluid ] 9.0032148e-15 2.6239684e-01 0.0000000e+00 [walls ] -1.6792123e-14 3.3216032e+00 0.0000000e+00 Velocity - x y z @@ -863,11 +869,11 @@ Velocity - x y z Completed cycle 5600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.8025139e-15 3.6480000e+00 0.0000000e+00 -[fluid ] -9.5340402e-15 2.6239744e-01 0.0000000e+00 +[total ] -3.8580250e-15 3.6480000e+00 0.0000000e+00 +[fluid ] -9.5895514e-15 2.6239744e-01 0.0000000e+00 [walls ] 5.7315264e-15 3.3856026e+00 0.0000000e+00 Velocity - x y z @@ -880,8 +886,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.1772141e-15 3.7120000e+00 0.0000000e+00 -[fluid ] 1.0505485e-14 2.6239793e-01 0.0000000e+00 +[total ] -4.1355808e-15 3.7120000e+00 0.0000000e+00 +[fluid ] 1.0547119e-14 2.6239793e-01 0.0000000e+00 [walls ] -1.4682700e-14 3.4496021e+00 0.0000000e+00 Velocity - x y z @@ -891,11 +897,11 @@ Velocity - x y z Completed cycle 5800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.8033131e-15 3.7760000e+00 0.0000000e+00 -[fluid ] 4.7739590e-15 2.6239832e-01 0.0000000e+00 +[total ] -2.7408631e-15 3.7760000e+00 0.0000000e+00 +[fluid ] 4.8364091e-15 2.6239832e-01 0.0000000e+00 [walls ] -7.5772721e-15 3.5136017e+00 0.0000000e+00 Velocity - x y z @@ -906,11 +912,11 @@ Completed cycle 5900 Writing velocity output at step 6000! Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.5631220e-15 3.8400000e+00 0.0000000e+00 -[fluid ] -9.2391372e-15 2.6239865e-01 0.0000000e+00 +[total ] -3.6325110e-15 3.8400000e+00 0.0000000e+00 +[fluid ] -9.3085262e-15 2.6239865e-01 0.0000000e+00 [walls ] 5.6760152e-15 3.5776014e+00 0.0000000e+00 Velocity - x y z @@ -920,11 +926,11 @@ Velocity - x y z Completed cycle 6000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.3827108e-15 3.9040000e+00 0.0000000e+00 -[fluid ] 1.1868978e-14 2.6239891e-01 0.0000000e+00 +[total ] -3.5353664e-15 3.9040000e+00 0.0000000e+00 +[fluid ] 1.1716322e-14 2.6239891e-01 0.0000000e+00 [walls ] -1.5251689e-14 3.6416011e+00 0.0000000e+00 Velocity - x y z @@ -934,11 +940,11 @@ Velocity - x y z Completed cycle 6100 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.5222879e-15 3.9680000e+00 0.0000000e+00 -[fluid ] -7.8929918e-15 2.6239913e-01 0.0000000e+00 +[total ] -2.6333102e-15 3.9680000e+00 0.0000000e+00 +[fluid ] -8.0040141e-15 2.6239913e-01 0.0000000e+00 [walls ] 5.3707039e-15 3.7056009e+00 0.0000000e+00 Velocity - x y z @@ -951,8 +957,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.8719028e-15 4.0320000e+00 0.0000000e+00 -[fluid ] 8.2295282e-15 2.6239931e-01 0.0000000e+00 +[total ] -3.7261860e-15 4.0320000e+00 0.0000000e+00 +[fluid ] 8.3752449e-15 2.6239931e-01 0.0000000e+00 [walls ] -1.2101431e-14 3.7696007e+00 0.0000000e+00 Velocity - x y z @@ -962,11 +968,11 @@ Velocity - x y z Completed cycle 6300 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.7277846e-15 4.0960000e+00 0.0000000e+00 -[fluid ] -7.9034002e-15 2.6239945e-01 0.0000000e+00 +[total ] -1.7832957e-15 4.0960000e+00 0.0000000e+00 +[fluid ] -7.9589113e-15 2.6239945e-01 0.0000000e+00 [walls ] 6.1756156e-15 3.8336005e+00 0.0000000e+00 Velocity - x y z @@ -979,8 +985,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.1286419e-16 4.1600000e+00 0.0000000e+00 -[fluid ] 1.0078743e-14 2.6239957e-01 0.0000000e+00 +[total ] -3.4347525e-16 4.1600000e+00 0.0000000e+00 +[fluid ] 1.0148132e-14 2.6239957e-01 0.0000000e+00 [walls ] -1.0491608e-14 3.8976004e+00 0.0000000e+00 Velocity - x y z @@ -990,11 +996,11 @@ Velocity - x y z Completed cycle 6500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.2281842e-15 4.2240000e+00 0.0000000e+00 -[fluid ] -5.7384653e-15 2.6239967e-01 0.0000000e+00 +[total ] 1.2073675e-15 4.2240000e+00 0.0000000e+00 +[fluid ] -5.7592819e-15 2.6239967e-01 0.0000000e+00 [walls ] 6.9666495e-15 3.9616003e+00 0.0000000e+00 Velocity - x y z @@ -1004,11 +1010,11 @@ Velocity - x y z Completed cycle 6600 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 9.1246455e-16 4.2880000e+00 0.0000000e+00 -[fluid ] 2.1753432e-15 2.6239975e-01 0.0000000e+00 +[total ] 1.1692036e-15 4.2880000e+00 0.0000000e+00 +[fluid ] 2.4320823e-15 2.6239975e-01 0.0000000e+00 [walls ] -1.2628787e-15 4.0256003e+00 0.0000000e+00 Velocity - x y z @@ -1018,11 +1024,11 @@ Velocity - x y z Completed cycle 6700 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.8804402e-15 4.3520000e+00 0.0000000e+00 -[fluid ] -1.8943180e-15 2.6239981e-01 0.0000000e+00 +[total ] 1.6514567e-15 4.3520000e+00 0.0000000e+00 +[fluid ] -2.1233015e-15 2.6239981e-01 0.0000000e+00 [walls ] 3.7747583e-15 4.0896002e+00 0.0000000e+00 Velocity - x y z @@ -1032,11 +1038,11 @@ Velocity - x y z Completed cycle 6800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.3888504e-15 4.4160000e+00 0.0000000e+00 -[fluid ] 1.9775848e-16 2.6239987e-01 0.0000000e+00 +[total ] 4.2015003e-15 4.4160000e+00 0.0000000e+00 +[fluid ] 1.0408341e-17 2.6239987e-01 0.0000000e+00 [walls ] 4.1910919e-15 4.1536001e+00 0.0000000e+00 Velocity - x y z @@ -1047,11 +1053,11 @@ Completed cycle 6900 Writing velocity output at step 7000! Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] 5.2145788e-15 4.4800000e+00 0.0000000e+00 -[fluid ] -6.5572547e-16 2.6239991e-01 0.0000000e+00 +[total ] 5.2770288e-15 4.4800000e+00 0.0000000e+00 +[fluid ] -5.9327543e-16 2.6239991e-01 0.0000000e+00 [walls ] 5.8703042e-15 4.2176001e+00 0.0000000e+00 Velocity - x y z @@ -1064,8 +1070,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.7878368e-15 4.5440000e+00 0.0000000e+00 -[fluid ] 3.2751579e-15 2.6239995e-01 0.0000000e+00 +[total ] 4.8086535e-15 4.5440000e+00 0.0000000e+00 +[fluid ] 3.2959746e-15 2.6239995e-01 0.0000000e+00 [walls ] 1.5126789e-15 4.2816001e+00 0.0000000e+00 Velocity - x y z @@ -1078,8 +1084,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 5.6205041e-15 4.6080000e+00 0.0000000e+00 -[fluid ] -5.3845817e-15 2.6239997e-01 0.0000000e+00 +[total ] 5.5788707e-15 4.6080000e+00 0.0000000e+00 +[fluid ] -5.4262150e-15 2.6239997e-01 0.0000000e+00 [walls ] 1.1005086e-14 4.3456000e+00 0.0000000e+00 Velocity - x y z @@ -1089,11 +1095,11 @@ Velocity - x y z Completed cycle 7200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.8155924e-15 4.6720000e+00 0.0000000e+00 -[fluid ] 8.7430063e-16 2.6240000e-01 0.0000000e+00 +[total ] 4.6698756e-15 4.6720000e+00 0.0000000e+00 +[fluid ] 7.2858386e-16 2.6240000e-01 0.0000000e+00 [walls ] 3.9412917e-15 4.4096000e+00 0.0000000e+00 Velocity - x y z @@ -1103,11 +1109,11 @@ Velocity - x y z Completed cycle 7300 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.6098234e-15 4.7360000e+00 0.0000000e+00 -[fluid ] -2.9698466e-15 2.6240002e-01 0.0000000e+00 +[total ] 1.9151347e-15 4.7360000e+00 0.0000000e+00 +[fluid ] -2.6645353e-15 2.6240002e-01 0.0000000e+00 [walls ] 4.5796700e-15 4.4736000e+00 0.0000000e+00 Velocity - x y z @@ -1117,11 +1123,11 @@ Velocity - x y z Completed cycle 7400 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] 2.2516711e-15 4.8000000e+00 0.0000000e+00 -[fluid ] 9.7179209e-15 2.6240003e-01 0.0000000e+00 +[total ] 2.0781987e-15 4.8000000e+00 0.0000000e+00 +[fluid ] 9.5444486e-15 2.6240003e-01 0.0000000e+00 [walls ] -7.4662498e-15 4.5376000e+00 0.0000000e+00 Velocity - x y z @@ -1131,11 +1137,11 @@ Velocity - x y z Completed cycle 7500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 3.6602665e-15 4.8640000e+00 0.0000000e+00 -[fluid ] -4.7774285e-15 2.6240005e-01 0.0000000e+00 +[total ] 3.8268000e-15 4.8640000e+00 0.0000000e+00 +[fluid ] -4.6108950e-15 2.6240005e-01 0.0000000e+00 [walls ] 8.4376950e-15 4.6016000e+00 0.0000000e+00 Velocity - x y z @@ -1148,8 +1154,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.3680337e-15 4.9280000e+00 0.0000000e+00 -[fluid ] -1.8908486e-15 2.6240006e-01 0.0000000e+00 +[total ] 4.4651782e-15 4.9280000e+00 0.0000000e+00 +[fluid ] -1.7937041e-15 2.6240006e-01 0.0000000e+00 [walls ] 6.2588823e-15 4.6655999e+00 0.0000000e+00 Velocity - x y z @@ -1162,8 +1168,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.3183898e-15 4.9920000e+00 0.0000000e+00 -[fluid ] 2.7894353e-15 2.6240007e-01 0.0000000e+00 +[total ] 1.2698176e-15 4.9920000e+00 0.0000000e+00 +[fluid ] 2.7408631e-15 2.6240007e-01 0.0000000e+00 [walls ] -1.4710455e-15 4.7295999e+00 0.0000000e+00 Velocity - x y z @@ -1176,8 +1182,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.7694179e-16 5.0560000e+00 0.0000000e+00 -[fluid ] 1.2941037e-15 2.6240007e-01 0.0000000e+00 +[total ] -3.0878078e-16 5.0560000e+00 0.0000000e+00 +[fluid ] 1.1622647e-15 2.6240007e-01 0.0000000e+00 [walls ] -1.4710455e-15 4.7935999e+00 0.0000000e+00 Velocity - x y z @@ -1191,8 +1197,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.2767565e-15 5.1200000e+00 0.0000000e+00 -[fluid ] -4.7462034e-15 2.6240008e-01 0.0000000e+00 +[total ] -1.2420620e-15 5.1200000e+00 0.0000000e+00 +[fluid ] -4.7115090e-15 2.6240008e-01 0.0000000e+00 [walls ] 3.4694470e-15 4.8575999e+00 0.0000000e+00 Velocity - x y z @@ -1205,8 +1211,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.6567971e-15 5.1840000e+00 0.0000000e+00 -[fluid ] 4.6559978e-15 2.6240008e-01 0.0000000e+00 +[total ] -3.7470027e-15 5.1840000e+00 0.0000000e+00 +[fluid ] 4.5657922e-15 2.6240008e-01 0.0000000e+00 [walls ] -8.3127949e-15 4.9215999e+00 0.0000000e+00 Velocity - x y z @@ -1216,11 +1222,11 @@ Velocity - x y z Completed cycle 8100 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.3723024e-15 5.2480000e+00 0.0000000e+00 -[fluid ] -3.2057690e-15 2.6240009e-01 0.0000000e+00 +[total ] -3.4694470e-15 5.2480000e+00 0.0000000e+00 +[fluid ] -3.3029135e-15 2.6240009e-01 0.0000000e+00 [walls ] -1.6653345e-16 4.9855999e+00 0.0000000e+00 Velocity - x y z @@ -1230,11 +1236,11 @@ Velocity - x y z Completed cycle 8200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 5.5511151e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 8.8817842e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -1.9532986e-15 5.3120000e+00 0.0000000e+00 -[fluid ] 4.3610948e-15 2.6240009e-01 0.0000000e+00 +[total ] -2.1267710e-15 5.3120000e+00 0.0000000e+00 +[fluid ] 4.1876225e-15 2.6240009e-01 0.0000000e+00 [walls ] -6.3143935e-15 5.0495999e+00 0.0000000e+00 Velocity - x y z @@ -1247,8 +1253,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] -3.4694470e-17 5.3760000e+00 0.0000000e+00 -[fluid ] 4.5033421e-15 2.6240009e-01 0.0000000e+00 +[total ] -9.7144515e-17 5.3760000e+00 0.0000000e+00 +[fluid ] 4.4408921e-15 2.6240009e-01 0.0000000e+00 [walls ] -4.5380366e-15 5.1135999e+00 0.0000000e+00 Velocity - x y z @@ -1258,11 +1264,11 @@ Velocity - x y z Completed cycle 8400 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -2.9143354e-16 5.4400000e+00 0.0000000e+00 -[fluid ] -5.7870375e-15 2.6240010e-01 0.0000000e+00 +[total ] -2.7061686e-16 5.4400000e+00 0.0000000e+00 +[fluid ] -5.7662208e-15 2.6240010e-01 0.0000000e+00 [walls ] 5.4956040e-15 5.1775999e+00 0.0000000e+00 Velocity - x y z @@ -1275,8 +1281,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] -4.4061976e-16 5.5040000e+00 0.0000000e+00 -[fluid ] 1.7000290e-16 2.6240010e-01 0.0000000e+00 +[total ] -4.8919202e-16 5.5040000e+00 0.0000000e+00 +[fluid ] 1.2143064e-16 2.6240010e-01 0.0000000e+00 [walls ] -6.1062266e-16 5.2415999e+00 0.0000000e+00 Velocity - x y z @@ -1289,8 +1295,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 2.4251434e-15 5.5680000e+00 0.0000000e+00 -[fluid ] -5.1798843e-15 2.6240010e-01 0.0000000e+00 +[total ] 2.2724878e-15 5.5680000e+00 0.0000000e+00 +[fluid ] -5.3325400e-15 2.6240010e-01 0.0000000e+00 [walls ] 7.6050277e-15 5.3055999e+00 0.0000000e+00 Velocity - x y z @@ -1300,11 +1306,11 @@ Velocity - x y z Completed cycle 8700 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] 6.5572547e-16 5.6320000e+00 0.0000000e+00 -[fluid ] 8.5001450e-16 2.6240010e-01 0.0000000e+00 +[total ] 5.3082538e-16 5.6320000e+00 0.0000000e+00 +[fluid ] 7.2511441e-16 2.6240010e-01 0.0000000e+00 [walls ] -1.9428903e-16 5.3695999e+00 0.0000000e+00 Velocity - x y z @@ -1317,8 +1323,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] 9.3675068e-17 5.6960000e+00 0.0000000e+00 -[fluid ] -2.9490299e-16 2.6240010e-01 0.0000000e+00 +[total ] 2.4286129e-17 5.6960000e+00 0.0000000e+00 +[fluid ] -3.6429193e-16 2.6240010e-01 0.0000000e+00 [walls ] 3.8857806e-16 5.4335999e+00 0.0000000e+00 Velocity - x y z @@ -1332,8 +1338,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.8041124e-15 5.7600000e+00 0.0000000e+00 -[fluid ] 1.4432899e-15 2.6240010e-01 0.0000000e+00 +[total ] 1.5820678e-15 5.7600000e+00 0.0000000e+00 +[fluid ] 1.2212453e-15 2.6240010e-01 0.0000000e+00 [walls ] 3.6082248e-16 5.4975999e+00 0.0000000e+00 Velocity - x y z @@ -1343,11 +1349,11 @@ Velocity - x y z Completed cycle 9000 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.6698756e-15 5.8240000e+00 0.0000000e+00 -[fluid ] 4.2327253e-16 2.6240010e-01 0.0000000e+00 +[total ] 4.4686477e-15 5.8240000e+00 0.0000000e+00 +[fluid ] 2.2204460e-16 2.6240010e-01 0.0000000e+00 [walls ] 4.2466031e-15 5.5615999e+00 0.0000000e+00 Velocity - x y z @@ -1357,11 +1363,11 @@ Velocity - x y z Completed cycle 9100 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 4.6490589e-15 5.8880000e+00 0.0000000e+00 -[fluid ] 3.5110803e-15 2.6240010e-01 0.0000000e+00 +[total ] 5.0098814e-15 5.8880000e+00 0.0000000e+00 +[fluid ] 3.8719028e-15 2.6240010e-01 0.0000000e+00 [walls ] 1.1379786e-15 5.6255999e+00 0.0000000e+00 Velocity - x y z @@ -1371,11 +1377,11 @@ Velocity - x y z Completed cycle 9200 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 5.7107097e-15 5.9520000e+00 0.0000000e+00 -[fluid ] -2.7963742e-15 2.6240010e-01 0.0000000e+00 +[total ] 5.6343818e-15 5.9520000e+00 0.0000000e+00 +[fluid ] -2.8727021e-15 2.6240010e-01 0.0000000e+00 [walls ] 8.5070839e-15 5.6895999e+00 0.0000000e+00 Velocity - x y z @@ -1388,8 +1394,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 6.4705186e-15 6.0160000e+00 0.0000000e+00 -[fluid ] 3.6533276e-15 2.6240010e-01 0.0000000e+00 +[total ] 6.3664352e-15 6.0160000e+00 0.0000000e+00 +[fluid ] 3.5492442e-15 2.6240010e-01 0.0000000e+00 [walls ] 2.8171909e-15 5.7535999e+00 0.0000000e+00 Velocity - x y z @@ -1402,8 +1408,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 7.1574691e-15 6.0800000e+00 0.0000000e+00 -[fluid ] -7.0950190e-15 2.6240010e-01 0.0000000e+00 +[total ] 7.0742023e-15 6.0800000e+00 0.0000000e+00 +[fluid ] -7.1782857e-15 2.6240010e-01 0.0000000e+00 [walls ] 1.4252488e-14 5.8175999e+00 0.0000000e+00 Velocity - x y z @@ -1413,11 +1419,11 @@ Velocity - x y z Completed cycle 9500 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 4.4408921e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 6.6613381e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 9.1870955e-15 6.1440000e+00 0.0000000e+00 -[fluid ] 8.5348395e-15 2.6240010e-01 0.0000000e+00 +[total ] 9.0830121e-15 6.1440000e+00 0.0000000e+00 +[fluid ] 8.4307561e-15 2.6240010e-01 0.0000000e+00 [walls ] 6.5225603e-16 5.8815999e+00 0.0000000e+00 Velocity - x y z @@ -1430,8 +1436,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 9.7005737e-15 6.2080000e+00 0.0000000e+00 -[fluid ] 4.3159920e-15 2.6240010e-01 0.0000000e+00 +[total ] 9.7907793e-15 6.2080000e+00 0.0000000e+00 +[fluid ] 4.4061976e-15 2.6240010e-01 0.0000000e+00 [walls ] 5.3845817e-15 5.9455999e+00 0.0000000e+00 Velocity - x y z @@ -1444,8 +1450,8 @@ Scalars - total mean variance min max [rho] 64.00 1.00000000000 0.0000000e+00 1.00000000000 1.00000000000 Momentum - x y z -[total ] 9.0934205e-15 6.2720000e+00 0.0000000e+00 -[fluid ] -9.9330266e-15 2.6240010e-01 0.0000000e+00 +[total ] 9.0448482e-15 6.2720000e+00 0.0000000e+00 +[fluid ] -9.9815989e-15 2.6240010e-01 0.0000000e+00 [walls ] 1.9026447e-14 6.0095999e+00 0.0000000e+00 Velocity - x y z @@ -1455,11 +1461,11 @@ Velocity - x y z Completed cycle 9800 Scalars - total mean variance min max -[rho] 64.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.0647733e-14 6.3360000e+00 0.0000000e+00 -[fluid ] 2.9733160e-15 2.6240010e-01 0.0000000e+00 +[total ] 1.0633855e-14 6.3360000e+00 0.0000000e+00 +[fluid ] 2.9594383e-15 2.6240010e-01 0.0000000e+00 [walls ] 7.6744167e-15 6.0735999e+00 0.0000000e+00 Velocity - x y z @@ -1470,11 +1476,11 @@ Completed cycle 9900 Writing velocity output at step 10000! Scalars - total mean variance min max -[rho] 64.00 1.00000000000 3.3306691e-16 1.00000000000 1.00000000000 +[rho] 64.00 1.00000000000 1.1102230e-16 1.00000000000 1.00000000000 Momentum - x y z -[total ] 1.1039780e-14 6.4000000e+00 0.0000000e+00 -[fluid ] -1.0061396e-15 2.6240010e-01 0.0000000e+00 +[total ] 1.0928758e-14 6.4000000e+00 0.0000000e+00 +[fluid ] -1.1171619e-15 2.6240010e-01 0.0000000e+00 [walls ] 1.2045920e-14 6.1375999e+00 0.0000000e+00 Velocity - x y z @@ -1488,16 +1494,17 @@ Timer resolution: 1e-06 second Timer statistics Section: tmin tmax total - Total: 1.766 1.766 1.766 1.765916 (1 call) - Time step loop: 0.000 0.001 1.744 0.000174 (10000 calls) - Propagation: 0.000 0.000 0.333 0.000033 (10000 calls) - Propagtn (krnl) : 0.000 0.000 0.325 0.000032 (10000 calls) - Collision: 0.000 0.000 0.747 0.000075 (10000 calls) - Collision (krnl) : 0.000 0.000 0.737 0.000074 (10000 calls) - Lattice halos: 0.000 0.000 0.621 0.000062 (10000 calls) - phi gradients: 0.000 0.000 0.000 0.000000 (10000 calls) - BBL: 0.000 0.000 0.005 0.000001 (10000 calls) - Force calculation: 0.000 0.000 0.000 0.000000 (10000 calls) - phi update: 0.000 0.000 0.000 0.000000 (10000 calls) - Free1: 0.000 0.002 0.016 0.000002 (10000 calls) + Total: 32.172 32.172 32.172 32.172115 (1 call) + Time step loop: 0.001 0.004 32.043 0.003204 (10000 calls) + Propagation: 0.000 0.000 1.340 0.000134 (10000 calls) + Propagtn (krnl) : 0.000 0.000 1.301 0.000130 (10000 calls) + Collision: 0.000 0.000 1.361 0.000136 (10000 calls) + Collision (krnl) : 0.000 0.000 1.305 0.000131 (10000 calls) + Lattice halos: 0.001 0.004 17.145 0.001715 (10000 calls) + phi gradients: 0.000 0.000 0.011 0.000001 (10000 calls) + BBL: 0.000 0.003 9.637 0.000964 (10000 calls) + Force calculation: 0.000 0.000 0.002 0.000000 (10000 calls) + phi update: 0.000 0.000 0.001 0.000000 (10000 calls) + Free1: 0.000 0.005 0.123 0.000012 (10000 calls) +End time: Mon Jan 31 12:19:31 2022 Ludwig finished normally. diff --git a/docs/tutorial/test1/vel-00010000.vtk b/docs/tutorial/test1/vel-00010000 similarity index 100% rename from docs/tutorial/test1/vel-00010000.vtk rename to docs/tutorial/test1/vel-00010000 diff --git a/docs/tutorial/test2/extract.sh b/docs/tutorial/test2/extract.sh new file mode 100755 index 000000000..a56a23d29 --- /dev/null +++ b/docs/tutorial/test2/extract.sh @@ -0,0 +1,7 @@ +#!/bin/bash +for i in `seq 1000 1000 10000`; +do + tstep=$(printf "%08d" $i) + ./extract -k vel.001-001.meta vel-${tstep}.001-001 + ./extract -k phi.001-001.meta phi-${tstep}.001-001 +done diff --git a/docs/tutorial/test2/input b/docs/tutorial/test2/input index 88575dbb6..2da94a908 100644 --- a/docs/tutorial/test2/input +++ b/docs/tutorial/test2/input @@ -1,6 +1,6 @@ ############################################################################## # -# Spinodal finite difference smoke test +# Spinodal decomposition tutorial # ############################################################################## diff --git a/docs/tutorial/test2/phi-00010000.001-001 b/docs/tutorial/test2/phi-00010000.001-001 index 005ff2a5069563f30f4dc0036d49bb3588da1e6f..b0a272a4e062a91e4113c589ba1d9110ee9a069e 100644 GIT binary patch delta 8702 zcmW;QQ?Mo07DnOf?%1|%+qP}nHfG1hOtMyN+qP}nww?RU`!G(%I1kx>rFK_m&4^JV zMmZ@m;^c@^A|eMw4rT)|IC5a*A#5NHi5wJpC>w-BBZr7Qj17UqB8QAToDGS?BZrDS zf(?ZuB8QGVk`0X`)twJy;GCd6Zql;Hb!9Baddo;^@fXB9CFi;h4zbBaaJzaIg|MUEJGJR1?mM~)PE0vib@M2;MJA{!YeMjOV0qw2#+57vgo(G{cz zYs2A~3etnM;c;vQ>A~6vIIe>9U~NPkUqO1XHWE&#AU#+c87Eed9xO+RJjt?A;CnD? zpI^@o`q<1d(U632=7ggpud4 z32{#3M3LvRiEwV@#F6K*iE&=EaV$8!KAiMmZCspDL3*$@9?q;FJy;tbXH}3MtWAKk zD@YI4Cd4@vqz7vg;oJ(+gSClqUIppFa+1jNEt>@AM@|}f0h<&TL{1iYA)5>rMou1i z5t|$rMNScUF`EJxM@|`e37Zm^L{1fXDVqwHMot}h8JilHMVrKe^XtP&57s8d1r?+R zYm?!^3etnM$#GEy>A~6*xVVD!U~NiVQbBsKHWe%&P8)@H>G6{H7iv*E@H(u1|xaZ?59!P*?S zxq|dyZBE=$L3*$@7jCT}Jy@F?w^fiHEa!>5-LiRbd*r;4cd&VJN925wce43#XXN~m zcd_|#SL6bbce4d>cjSVR_pk+VPvk<8_p*g>Z{)&}_pya>U$l8FxV=7{^k8jX+)+V# zur?p=tROvDn;&;okRGfpfV(S557rjMJr$$}YYXAt3etnMg>hd6>A`Z5$onl@1ouZS z8uhgSEx+PzCA1+7fuUg7jc*Njy?Pda$+>9<3lf zSX&y8RgfMmmx+AbvSsjigzb6{H7iE8*D+(u1{?@mvMz!E%+z=Pg?W&quBr`2t%NFGQ{u`662lFGj8& z`4U?lFGa2q`7&DrFGsE!`3hSTuSBjD`6^oruSTvN`5IdruSHwMg6HeQNe|Xm#S0ar z2WzY0#R}4cwbk)b1?j=s8hE*a^k8jGyi!4Wu(lRntsp&ETN|%ckRB}8iG1C%b?|!R zx{+_Nb@4{zdXaCk_3&oo`jKz3_3>8Z29a;G4e)m4hLP{E4e?IoMv?Ebjqq;d#*y!_ zjqzTzbu4(jKAiMmZC$)kL3*&Z9^R}VJy=^GZ&i>UtZjg|D@YI4HpDv>qz7vo;oS<- zgSCzEUIppFa+ApSE!za|M{XMV0oxQGL~a)OA=?ZeMs6PY5!)OeMQ#!KG1~$kM{XJU z3EL8%L~a%NDccI4Ms6MX8QU74Mcc%J_v^z+57sut2Nk3TYn$Q23etnM&GAtM>A~6- z__%`fU~Nl$QbBsKwiQ0DAU#;y8lP2=9xS(s{M@o_@Ok96kzcTF@kQizkzcay@MYxo zkzcXx@m1swkzcbN@O9*lk>9W#@lE7Tk>9eN@NMMIk>9bM@m;iSEcm=Wob+IATYOPL zda$+~zN{cUSlb?7RgfO6?SQW%&P8)^^1Y6{H7iyWz(Q(u1|#@lyrq!P*}9xq|dyZBP7CL3*&Z7k;fE zJy_d&z~DaMw*d$D*t>r9oBsg&ME-8tKKMOy-^f4MzW5_@zsNt?e)uzT|H!}C{`f2M zfXKhu0r)%ez{r2tf%qr#pvZsOLHIZF;K={j!T2xQK4$!0A5MC(wlDsuAU#;y4}VsW z9<1$;zbZ%%)(*hm6{H7i2jZU!(u1{w@NWg_!P>$2uYz0_{|y+>Jnm0}xA;I$Bn++~ z-r{N?4yhpC;%X2MtsvgwY6u)wLA=G)kT|@8c#Er{a6|?17FR>#$O_^uJ}^!l@)5z+n}{8Z{&iuOQZ_p>RY6u|^GzBP)nCY8d;D zs%gYaT@8z)D~Ol68V<))5HEE#JdUj(Ug~ND99KcS)YXVMzJhqEtC4U*1@Tf>Bjdyh z;-#*JvFWH9N9<9<;^+!uj~WigR1kaA@Hn=D*rP_kaTUZKH6o6$Aoi${a6$#KM~#dV zD~LU66q`<}al}hrjf#^ih?l$?4UR}&^7VtY(Q!%z>A~6; zkD3A(R}g#Dl(?jV*rTSxr4_^;H8n1)Aoi$fY`T2l;68Yof&RX_TuqBBYA$gpP}AYc z3gS|rrpHwk#HB#ZfU7HrOM#jZ*HjRf0yPt^tspK1YGzzlL0k&dG&Wsc`~L<$_iqSnjTkG5PQ@NxVnPaqh`c46~rDj6Rxcw_NbY0T?Mg6&0^E_HIBF>s9AAC z1#wAGv*E@H;*y|d$4wQ)B|*)Bn=6P*f|?VzR1lX0H5YEJAT9}NZroNuToTkQHeFxi zh&^gn+)zR6QM2L33Sy6%9XC}Fd(<4bxq{fE=EN-(#2z&lZml5psJU@l1+hoXW7F+5 zj<__ad2vStacNNV;m!);(xB$YT@}QoK`ns0D~L;jS`hbC5SIqE5bmuYE)8m7+*d(d z8q_>C-CpB}J!)RuQ9b*Ep=kGm>}L23cqT|o>|3*w#%Vvt%0 z_f`;t)WW#0f*7P0G3x$WM|!ZfC?2RFP7!J`JXk@TBGlq|sDd~}s3q`l1#yZ{OZsCw z;F0=cyJY?95x-grk5&-32(>gGs~~O>Y7wLEuXV&AwJ08_AO@+$@L&ZoNG*HdDu`Q#S_`jM5Vs7qHeRbBZW(G7o1U+6#2&ROUZ^1U zsMYXd1+ho1j+ZKkJ!%cSTtVznYvPp(Vvkx2uT~Iy)Y^Ehg4mrm_CtqS7Sp*FzV6~wJWZHRX&h+Bu+2=7)9w+^*2-m4&P9cmq$UaxV) z9HQi< zda$-BKBypWA!;*xSV7!E)aLl8g1CjKE%0##aSKsf;*$#E7NWMorxnC4L~V`FDu`Q% z+Qg>!YaFphZHf;nh&^gEd{{y3QJdqV3Sy7i0v}fpd(@Wrq=ML^w!)_s#2&RZKC2-1 zsBLWeyv7l?616S9s32}7YCC*cLEK8z_V}uTxRt0K@O1@oD^WY*n+oDqqISZ!6~wJX z?Tqg#h+B!;#-`6}9I;1ji!UmOJ!(6ASwZYk+vBSWVvpJZUsn)&)Q)IK)-UgL;Ui`o}|R1l{YwIBYhAWki6fBaQJoLbZY z_`8BQwWtH}PX%#mQ3v7Q3gXnF4#s~Kqz7yJ*z|jiBlf6$@ka%*N9~6{D~LU6fBaQJ h>`@2c?+Rj%IuQR<5PQ@?__u=CqYlP@6~vxF@jtj4wPyeT delta 8702 zcmW;PW3*h&7DnN5a$?)IZQHhO+gP!+lAKsyY}>YN+jes2dq?ytl6hkDB<4xYlbI(sPhp=9=4H*xnU^=OU|!L@l6hnE zCgx4eo0&H^Z(-ijyp?%t^ET#f&D)u`H}7EH(Y%wnnGZG}Vm{P-nE7z?5#}S!N12Z{ zA7eh&e4P1s^9kk?%@>$2H2=?hk@;ftCFV=bmzgg&Utzw|e3kiX^EKvc&DWXlH$Py0 z(EO13Ve=#AN6n9!A2&Z?e$xDu`Dybr=4Z{%ncp{mVE)kjk@;iuC+1JhpP4^5e_{U8 z{FV7@^Ec*i&EMJ701FC0Fa#nvLLekUAvD4uEW#l?A|N6nAu*C5DUu;MQXnN#AvMw< zEz%)9G9V)|p)iV|D2kytN}wc4p)|^%EXtugDxe}Np)s1EDVm`37+B^p5p~x;uT)w4c_8ifK4`= z!V*leU4JD1)*nhw`X^il~IfXo99_hURF2mS~06XoI$BhxX`zj_3q^ z|G^l7p%{kY7=e)(h0z#;u^5N(n1G2`fQ9%Ei?A3=uoTO%94oLAtFRhtuommE9|v#{ zhj182a1_UI94BxRr*Il)a2Drq9}n;lkMI~z@D$JR953(^ukadg@D}fE8o&K?3s8b7 zfl6>Cgc4E-rG!?(C}EXwN_ZuL5>bhyBvz6rNtI+uawUb5Qc0zxR?;YGm2^saC4-Vt z$)prkiYP^uVoGtPgi=x|rIc36C}ov$N_nM%Qc7@LB{RV3^L>a0KQ-&)el#$9PWwbIz8LNy_#w!z)iOK?Hq4J-yNLj2b zQI;ypl;z3_Wu>x8S*@&5)++0i{mKF5pmIn#tQ=8}D#w)L$_eG9a!NU^oKemy=al=( z1LdLeNO`P0QJyN#l;_F|<)!jUd9A!r-YV|`%p;peF^_5<%{;n!4D*=gvCLze$1#s< z9?v|!c>?o<=84QRn`bf4YM#wJyLk@toaVXAbDQTe&ugB~JimDX^MdAu%qyE$F|TS~ z&AhsK4fC4jwajaq*D`6lzt z=3C6Snr}1TZob2Or}-}P-R67D_nPlBKW~1){G$0K^ULN}%&(eXGrw+r!~CZCE%V#v zcg*ja-!p%2{=xjC`6u(w=3mUentwC@ZvMmkr};1Q-{ybJ|C;}^pvas8Q4kf;5FIfP z6R{8*aS#{r5FZJU5Q&f(S&$XkkR3UY6ScO{6TQ$Ieb5*E&>sUZ5Q8uYli`?xshEZ!OvenOCl z9L&W$%*T3cz(#DsW^BP$Y{Pc!z)tMKZtTHc?8A9nz(ribWn95kT*GzTz)jr3ZQQ}# zfWgxP?gb1Ade7toKH?KT;|spx8@}TQe&QE?;}8DgUjS!7WJEz!L_>7MKup9!Y{Wra z#6x@}Ktd!!W@JHDWJ7l3Ku+XBZsb8; zY`{ir!e(s2R&2v|?7&X!!fx!rUhKnpT);(K!ev~+Rb0b$+`vuT!fo8aUEITae85M1 z!e@NJSA4^F{J>BA!f*V+U;N`6M%GpwMTx3JQ=%&|l$c5^CAJbriL1m@;wuT1gi0bM zvyw&0s$^5LD>;;$N-ib0l1Is_rU9l$uH{rM6N>sjJje z>MISDhDsx)v(iQBs&rGjD?OB+N-w3i(nsm5^i%pP1C)WvAZ3y=S#f2GGF6$T1S!*% z8Ols$mNHwJqs&$2Df5-}$_8blvPs#jY*Dr<+m!9f4rQmZOWCdLQT8hPl=I33<)U&) zxvX4Kt}54*>&gw~rgBTUt=v)WD)*H4$_M46@=5uud{MqC-<0pl59O!wOZlz*QT_(- za{MnKASfUhS5E{YI6@#KLLoH5AS}WmJR%?>A|Wx7ASsd|IZ_}cQXw_cAT81%Ju)C8 zGNCYvpeTx=I7*--N})8$pe)LvJSw0fDxoo&pedT6Ia;74TA?-Cpe@>=JvyKxI)OV^ z&|nO~Pz=LxjKD~Y!f1@aSd7DXOu$4ez(V|oMOcg_Sc+v>julvmRalKRSc`Soj{`V} zLpY2hIErI9juSYEQ#g$?IE!<*j|X^&M|g}Uc#3Cuju&`|S9py#c#C(zY-%8X4+KLX zf+GY%A{0U+48jI-)`bfk6cnCG1Vlt6Bt{Y>MKUBu3Zz6Tq(&N~MLMKM24qAg6h;vg zMKKgd36w-BltvkpMLCp51yn>OG)5CNMKd%<3$#Qlv_>1WMLV=d2XsUyaNiCZj3F3` zVHl1P7>Q9BjWHODaTt#Yn1}^fi2tw%i?IYtu?)+x0xPi!tFZ=au@3uj00(ghhj9c) zaSX?C0w-|_r*Q^naSr$K01xp9kMRUg@eI%L0x$6juki+N@h*^4HW)iWfD%jzRDvrZ zl#og&CA1Po39E!t!YdJ!h)N_Sv64hdsw7jAD=CzeN-8C_l153Zq*Kx>8I+7lCZ(`a zL@BBiQ;I7kl#)s*rL3osx(uYD=n0kN-L$c(ne{kv{TwE z9h8nrC*}X^H&~+~%1~vPGF%yy-V<0p*}_NI9$=QI0Cdl;g??<)m^-Ijx*g&MN1W z`^p35q4G$1tUOVkD$kVX$_wSC@=AHFyiwjN?}G981u_Uwf+>MYa3zEiQVFGmR>CM@ zm2gUUC4v%BiKHY}k|;@)WJ+=+g_2T9rKDEUC~1{+N_r)Ol2OT|6jq8TMU`SoaixS( zQYodBR>~-4m2ygXrGipXsiZVknkY?`W=eCVh0;=KrLy-V<0p*}_NI9$=QI0Cdl;g??<)m^-Ijx*g&MN1W`^p35q4G$1tUOVkD$kVX z$_wSC@=AHFyiwjN@7Mt&a|%X5R768`#6V2MLTtoAT*O0sBtSwWLS|$^R%AnV#+eFu?d^81zWKV+pz;Xu?xGg z2Yay(=WziSaS4}k1y^wm*Kq?kaSOL`2X}D~@9_a2@d=;VJp;Z38x-`F$v1q*5B$V0 z{Kg;r#Xm&mA&7#gh=%BhftZMe*ocF;h==${fP_ed%*cYQ$cF65ft<*N+{lBx$cOwW zfPyH5%BX^>sD|pOftsj=+NguNsE7J!fQD#<&gg=!=!Wj-fu87v-spqA=!gCofPol< zNtg`B6imf51YtU6U?yf^Hs)Y1=3ze8V*@r~6E|R`Mu$m3&HmrGQdU zDWp_Zswh>JYD#sbhEh|hrPNmHD0P*3N`0k)(okunbXK}3U6pQ1ccq8YQ|YDjR{AJ? zm3~TpWq>kJ8Kg{7CM&K?QKl->lptlgGDDfE%u;46bCkKtJY~MJUfG~*R5mG_l`YCv zWt*~H*`e%Ib}74+J<48XpK@Ngpj=cgDVLQi%2nl>a$UKh+*EEUx0O4}UFDwgUiqMW zR6Z%6l`qOy<(u+d`Jwz&eks3|KgwU_pAuOQVH72*5>1JV@?v6R?K93`$2Pl>N2 zP!cMMl*~#NC99H6$*$y3aw@r$+)5rLuaZy6uM|)UDutBFN)@H5QcbC@)KF?FwUpXQ z9i^^PPpPjoP#P+Yl+H>QrK{3S>8|updMdq?-bx>(uhLKHuMAKIDua|s%4EfrDaur3 zni8Z;S7s{HHj zaUOgjkoWnEnqE>aD_4}O$~EP>aznYP+){2Uca*!zJ>|XfLHVeBQa&qRl&{J+<-77j R`KkO;ek*^JzskQr`yVcxwPyeT diff --git a/docs/tutorial/test2/phi-00010000.vtk b/docs/tutorial/test2/phi-00010000.vtk index 18028ceca..d5043837d 100644 --- a/docs/tutorial/test2/phi-00010000.vtk +++ b/docs/tutorial/test2/phi-00010000.vtk @@ -1,12 +1,12 @@ # vtk DataFile Version 2.0 -Generated by vtk_extract.c +Generated by ludwig extract.c ASCII DATASET STRUCTURED_POINTS DIMENSIONS 32 32 32 ORIGIN 0 0 0 SPACING 1 1 1 POINT_DATA 32768 -SCALARS something float 1 +SCALARS composition float 1 LOOKUP_TABLE default -8.210241e-01 -9.040529e-01 diff --git a/docs/tutorial/test2/stdout b/docs/tutorial/test2/stdout index d5461a46e..0e9bd75cb 100644 --- a/docs/tutorial/test2/stdout +++ b/docs/tutorial/test2/stdout @@ -1,6 +1,12 @@ -Welcome to Ludwig v0.8.9 (MPI version running on 8 processes) +Welcome to Ludwig v0.15.0 (MPI version running on 8 processes) +Start time: Mon Jan 31 12:19:42 2022 -Note assertions via standard C assert() are on. +Compiler: + name: Gnu 11.2.0 + version-string: 11.2.0 + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. Read 25 user parameters from input @@ -45,7 +51,7 @@ External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 Lattice Boltzmann distributions ------------------------------- Model: d3q19 -SIMD vector len: 1 +SIMD vector len: 4 Number of sets: 1 Halo type: full Input format: binary @@ -82,21 +88,21 @@ Scalars - total mean variance min max [phi] -5.9892076e+00 -1.8277611e-04 8.3100414e-04 -4.9989121e-02 4.9997941e-02 Momentum - x y z -[total ] 4.5474735e-13 0.0000000e+00 0.0000000e+00 -[fluid ] 4.5474735e-13 0.0000000e+00 0.0000000e+00 +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 Starting time step loop. Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 1.7097435e-13 0.99999597100 1.00000224425 +[rho] 32768.00 1.00000000000 1.7075230e-13 0.99999597100 1.00000224425 [phi] -5.9892076e+00 -1.8277611e-04 8.4736999e-05 -3.7913090e-02 3.4553839e-02 Free energy density - timestep total fluid [fed] 100 -1.6003803788e-07 -1.6003803788e-07 Momentum - x y z -[total ] 4.5677351e-13 1.7208457e-14 -2.2870594e-14 -[fluid ] 4.5677351e-13 1.7208457e-14 -2.2870594e-14 +[total ] 4.5555920e-13 1.6264767e-14 -2.2329361e-14 +[fluid ] 4.5555920e-13 1.6264767e-14 -2.2329361e-14 Velocity - x y z [minimum ] -2.8195285e-07 -2.7984482e-07 -2.7511604e-07 @@ -112,8 +118,8 @@ Free energy density - timestep total fluid [fed] 200 -2.1166939546e-07 -2.1166939546e-07 Momentum - x y z -[total ] 4.3739665e-13 1.1893264e-14 1.2934098e-14 -[fluid ] 4.3739665e-13 1.1893264e-14 1.2934098e-14 +[total ] 4.3795523e-13 1.0769163e-14 1.3211654e-14 +[fluid ] 4.3795523e-13 1.0769163e-14 1.3211654e-14 Velocity - x y z [minimum ] -3.5782155e-07 -3.3708348e-07 -3.1246038e-07 @@ -122,15 +128,15 @@ Velocity - x y z Completed cycle 200 Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 3.0375702e-13 0.99999675733 1.00000529794 +[rho] 32768.00 1.00000000000 3.0397906e-13 0.99999675733 1.00000529794 [phi] -5.9892076e+00 -1.8277611e-04 1.7194304e-04 -4.8845813e-02 5.0039839e-02 Free energy density - timestep total fluid [fed] 300 -3.3293730614e-07 -3.3293730614e-07 Momentum - x y z -[total ] 4.9479518e-13 -3.1061959e-14 -1.6299462e-14 -[fluid ] 4.9479518e-13 -3.1061959e-14 -1.6299462e-14 +[total ] 4.9548213e-13 -3.0576236e-14 -1.5668022e-14 +[fluid ] 4.9548213e-13 -3.0576236e-14 -1.5668022e-14 Velocity - x y z [minimum ] -5.6663924e-07 -5.1289673e-07 -4.8532584e-07 @@ -146,8 +152,8 @@ Free energy density - timestep total fluid [fed] 400 -5.5467543213e-07 -5.5467543213e-07 Momentum - x y z -[total ] 4.7328114e-13 -2.7623737e-14 -3.1301350e-14 -[fluid ] 4.7328114e-13 -2.7623737e-14 -3.1301350e-14 +[total ] 4.7468973e-13 -2.8997638e-14 -3.1391556e-14 +[fluid ] 4.7468973e-13 -2.8997638e-14 -3.1391556e-14 Velocity - x y z [minimum ] -9.2606434e-07 -8.3892858e-07 -8.2672027e-07 @@ -163,8 +169,8 @@ Free energy density - timestep total fluid [fed] 500 -9.5113387392e-07 -9.5113387392e-07 Momentum - x y z -[total ] 3.7670561e-13 -2.0438512e-14 -1.9706459e-15 -[fluid ] 3.7670561e-13 -2.0438512e-14 -1.9706459e-15 +[total ] 3.8016118e-13 -1.9591967e-14 -1.6861512e-15 +[fluid ] 3.8016118e-13 -1.9591967e-14 -1.6861512e-15 Velocity - x y z [minimum ] -1.5213472e-06 -1.3906223e-06 -1.4460630e-06 @@ -180,8 +186,8 @@ Free energy density - timestep total fluid [fed] 600 -1.6589269429e-06 -1.6589269429e-06 Momentum - x y z -[total ] 3.4471384e-13 -4.9623500e-14 2.3342439e-14 -[fluid ] 3.4471384e-13 -4.9623500e-14 2.3342439e-14 +[total ] 3.4618142e-13 -4.8721444e-14 2.3113456e-14 +[fluid ] 3.4618142e-13 -4.8721444e-14 2.3113456e-14 Velocity - x y z [minimum ] -2.5105422e-06 -2.3296874e-06 -2.5656221e-06 @@ -190,15 +196,15 @@ Velocity - x y z Completed cycle 600 Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 1.8600010e-11 0.99999122790 1.00003787823 +[rho] 32768.00 1.00000000000 1.8600232e-11 0.99999122790 1.00003787823 [phi] -5.9892076e+00 -1.8277611e-04 1.4957928e-03 -1.4699277e-01 1.4101269e-01 Free energy density - timestep total fluid [fed] 700 -2.9231794916e-06 -2.9231794916e-06 Momentum - x y z -[total ] 3.7551212e-13 -2.8737429e-14 3.9496184e-14 -[fluid ] 3.7551212e-13 -2.8737429e-14 3.9496184e-14 +[total ] 3.7717052e-13 -3.0152963e-14 3.8882092e-14 +[fluid ] 3.7717052e-13 -3.0152963e-14 3.8882092e-14 Velocity - x y z [minimum ] -4.3643705e-06 -3.9379776e-06 -4.5252998e-06 @@ -214,8 +220,8 @@ Free energy density - timestep total fluid [fed] 800 -5.1763760514e-06 -5.1763760514e-06 Momentum - x y z -[total ] 3.7715664e-13 -2.1850577e-14 3.0933589e-14 -[fluid ] 3.7715664e-13 -2.1850577e-14 3.0933589e-14 +[total ] 3.8025139e-13 -2.0813212e-14 3.1585845e-14 +[fluid ] 3.8025139e-13 -2.0813212e-14 3.1585845e-14 Velocity - x y z [minimum ] -7.7112587e-06 -6.7001329e-06 -7.9264262e-06 @@ -231,8 +237,8 @@ Free energy density - timestep total fluid [fed] 900 -9.1605026959e-06 -9.1605026959e-06 Momentum - x y z -[total ] 3.4339892e-13 5.3290705e-15 1.8318680e-14 -[fluid ] 3.4339892e-13 5.3290705e-15 1.8318680e-14 +[total ] 3.3962416e-13 5.0827398e-15 1.9002161e-14 +[fluid ] 3.3962416e-13 5.0827398e-15 1.9002161e-14 Velocity - x y z [minimum ] -1.3605055e-05 -1.1431695e-05 -1.3743350e-05 @@ -243,15 +249,15 @@ Writing phi file at step 1000! Writing velocity output at step 1000! Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 4.7816662e-10 0.99995964285 1.00017786147 +[rho] 32768.00 1.00000000000 4.7816684e-10 0.99995964285 1.00017786147 [phi] -5.9892076e+00 -1.8277611e-04 8.3323309e-03 -3.0584417e-01 3.0376499e-01 Free energy density - timestep total fluid [fed] 1000 -1.6085949744e-05 -1.6085949744e-05 Momentum - x y z -[total ] 3.1832870e-13 4.7219173e-14 1.4092894e-14 -[fluid ] 3.1832870e-13 4.7219173e-14 1.4092894e-14 +[total ] 3.2119793e-13 4.6830595e-14 1.4668822e-14 +[fluid ] 3.2119793e-13 4.6830595e-14 1.4668822e-14 Velocity - x y z [minimum ] -2.3844024e-05 -1.9451814e-05 -2.3457745e-05 @@ -260,15 +266,15 @@ Velocity - x y z Completed cycle 1000 Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 1.2734762e-09 0.99992961011 1.00027173542 +[rho] 32768.00 1.00000000000 1.2734758e-09 0.99992961011 1.00027173542 [phi] -5.9892076e+00 -1.8277611e-04 1.4546646e-02 -3.7942017e-01 3.8365780e-01 Free energy density - timestep total fluid [fed] 1100 -2.7759431109e-05 -2.7759431109e-05 Momentum - x y z -[total ] 3.2480962e-13 4.5508736e-14 6.8695050e-16 -[fluid ] 3.2480962e-13 4.5508736e-14 6.8695050e-16 +[total ] 3.2598924e-13 4.5886905e-14 3.1225023e-16 +[fluid ] 3.2598924e-13 4.5886905e-14 3.1225023e-16 Velocity - x y z [minimum ] -4.1187553e-05 -3.3030063e-05 -3.9121286e-05 @@ -284,8 +290,8 @@ Free energy density - timestep total fluid [fed] 1200 -4.6487867780e-05 -4.6487867780e-05 Momentum - x y z -[total ] 3.2484085e-13 3.1641356e-14 2.3765712e-14 -[fluid ] 3.2484085e-13 3.1641356e-14 2.3765712e-14 +[total ] 3.2741865e-13 3.2782804e-14 2.3765712e-14 +[fluid ] 3.2741865e-13 3.2782804e-14 2.3765712e-14 Velocity - x y z [minimum ] -6.9320212e-05 -5.7326406e-05 -6.3236647e-05 @@ -294,15 +300,15 @@ Velocity - x y z Completed cycle 1200 Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 6.5221648e-09 0.99979872526 1.00049859044 +[rho] 32768.00 1.00000000000 6.5221646e-09 0.99979872526 1.00049859044 [phi] -5.9892076e+00 -1.8277611e-04 4.0771304e-02 -5.6361095e-01 5.5385116e-01 Free energy density - timestep total fluid [fed] 1300 -7.4451116718e-05 -7.4451116718e-05 Momentum - x y z -[total ] 3.1287473e-13 -4.3021142e-15 1.2337353e-14 -[fluid ] 3.1287473e-13 -4.3021142e-15 1.2337353e-14 +[total ] 3.0911038e-13 -5.0480453e-15 1.1438767e-14 +[fluid ] 3.0911038e-13 -5.0480453e-15 1.1438767e-14 Velocity - x y z [minimum ] -1.1192839e-04 -9.5461422e-05 -9.8364928e-05 @@ -318,8 +324,8 @@ Free energy density - timestep total fluid [fed] 1400 -1.1241463288e-04 -1.1241463288e-04 Momentum - x y z -[total ] 3.4504691e-13 -3.6456949e-14 4.9044102e-14 -[fluid ] 3.4504691e-13 -3.6456949e-14 4.9044102e-14 +[total ] 3.4230604e-13 -3.5440401e-14 4.9064919e-14 +[fluid ] 3.4230604e-13 -3.5440401e-14 4.9064919e-14 Velocity - x y z [minimum ] -1.7030817e-04 -1.4974956e-04 -1.4632369e-04 @@ -335,8 +341,8 @@ Free energy density - timestep total fluid [fed] 1500 -1.5839325740e-04 -1.5839325740e-04 Momentum - x y z -[total ] 3.5005332e-13 -2.8393954e-14 3.6901038e-14 -[fluid ] 3.5005332e-13 -2.8393954e-14 3.6901038e-14 +[total ] 3.5459136e-13 -2.9878877e-14 3.6807363e-14 +[fluid ] 3.5459136e-13 -2.9878877e-14 3.6807363e-14 Velocity - x y z [minimum ] -2.4021427e-04 -2.1783912e-04 -2.0674707e-04 @@ -345,15 +351,15 @@ Velocity - x y z Completed cycle 1500 Scalars - total mean variance min max -[rho] 32768.00 1.00000000000 3.3567837e-08 0.99936467043 1.00127692931 +[rho] 32768.00 1.00000000000 3.3567838e-08 0.99936467043 1.00127692931 [phi] -5.9892076e+00 -1.8277611e-04 1.2795908e-01 -7.7039086e-01 7.5884040e-01 Free energy density - timestep total fluid [fed] 1600 -2.0764082960e-04 -2.0764082960e-04 Momentum - x y z -[total ] 3.2735620e-13 -6.3449246e-14 4.1411319e-14 -[fluid ] 3.2735620e-13 -6.3449246e-14 4.1411319e-14 +[total ] 3.2753314e-13 -6.6457256e-14 4.1570913e-14 +[fluid ] 3.2753314e-13 -6.6457256e-14 4.1570913e-14 Velocity - x y z [minimum ] -3.1103588e-04 -2.9863543e-04 -2.7548567e-04 @@ -369,8 +375,8 @@ Free energy density - timestep total fluid [fed] 1700 -2.5465038414e-04 -2.5465038414e-04 Momentum - x y z -[total ] 3.3517633e-13 -3.4416914e-14 4.8488991e-14 -[fluid ] 3.3517633e-13 -3.4416914e-14 4.8488991e-14 +[total ] 3.3881578e-13 -3.9593329e-14 4.8325927e-14 +[fluid ] 3.3881578e-13 -3.9593329e-14 4.8325927e-14 Velocity - x y z [minimum ] -3.6977684e-04 -3.7603175e-04 -3.4478297e-04 @@ -386,8 +392,8 @@ Free energy density - timestep total fluid [fed] 1800 -2.9568815377e-04 -2.9568815377e-04 Momentum - x y z -[total ] 4.0657755e-13 -3.1669112e-14 6.3060668e-14 -[fluid ] 4.0657755e-13 -3.1669112e-14 6.3060668e-14 +[total ] 4.1325277e-13 -3.2578107e-14 6.2370248e-14 +[fluid ] 4.1325277e-13 -3.2578107e-14 6.2370248e-14 Velocity - x y z [minimum ] -4.2250139e-04 -4.3775053e-04 -4.0569514e-04 @@ -403,8 +409,8 @@ Free energy density - timestep total fluid [fed] 1900 -3.2969781596e-04 -3.2969781596e-04 Momentum - x y z -[total ] 4.5209669e-13 2.0511370e-14 9.3841601e-14 -[fluid ] 4.5209669e-13 2.0511370e-14 9.3841601e-14 +[total ] 4.4905399e-13 1.5144136e-14 9.3203223e-14 +[fluid ] 4.4905399e-13 1.5144136e-14 9.3203223e-14 Velocity - x y z [minimum ] -4.8820353e-04 -5.1059547e-04 -4.4955466e-04 @@ -422,8 +428,8 @@ Free energy density - timestep total fluid [fed] 2000 -3.5743943403e-04 -3.5743943403e-04 Momentum - x y z -[total ] 4.5642656e-13 3.4021397e-14 1.1854406e-13 -[fluid ] 4.5642656e-13 3.4021397e-14 1.1854406e-13 +[total ] 4.5986825e-13 3.0964814e-14 1.2033430e-13 +[fluid ] 4.5986825e-13 3.0964814e-14 1.2033430e-13 Velocity - x y z [minimum ] -5.3161790e-04 -5.6909095e-04 -5.0341812e-04 @@ -439,8 +445,8 @@ Free energy density - timestep total fluid [fed] 2100 -3.8030380903e-04 -3.8030380903e-04 Momentum - x y z -[total ] 4.0088766e-13 -6.7168493e-15 1.1812773e-13 -[fluid ] 4.0088766e-13 -6.7168493e-15 1.1812773e-13 +[total ] 4.0342382e-13 -7.6050277e-15 1.1809997e-13 +[fluid ] 4.0342382e-13 -7.6050277e-15 1.1809997e-13 Velocity - x y z [minimum ] -5.8967138e-04 -6.0804985e-04 -5.6840897e-04 @@ -456,8 +462,8 @@ Free energy density - timestep total fluid [fed] 2200 -3.9961992143e-04 -3.9961992143e-04 Momentum - x y z -[total ] 3.5843550e-13 2.6117997e-14 1.1629586e-13 -[fluid ] 3.5843550e-13 2.6117997e-14 1.1629586e-13 +[total ] 3.6047207e-13 2.3706731e-14 1.1840529e-13 +[fluid ] 3.6047207e-13 2.3706731e-14 1.1840529e-13 Velocity - x y z [minimum ] -6.6396259e-04 -6.3847100e-04 -6.1683250e-04 @@ -473,8 +479,8 @@ Free energy density - timestep total fluid [fed] 2300 -4.1640588236e-04 -4.1640588236e-04 Momentum - x y z -[total ] 3.6401437e-13 3.5665915e-15 8.5320639e-14 -[fluid ] 3.6401437e-13 3.5665915e-15 8.5320639e-14 +[total ] 3.6675524e-13 3.4243441e-15 8.3603263e-14 +[fluid ] 3.6675524e-13 3.4243441e-15 8.3603263e-14 Velocity - x y z [minimum ] -7.3291753e-04 -6.6486556e-04 -6.3693388e-04 @@ -490,8 +496,8 @@ Free energy density - timestep total fluid [fed] 2400 -4.3139276720e-04 -4.3139276720e-04 Momentum - x y z -[total ] 3.5682568e-13 2.6478819e-14 7.0055073e-14 -[fluid ] 3.5682568e-13 2.6478819e-14 7.0055073e-14 +[total ] 3.5708936e-13 2.7814556e-14 6.5999289e-14 +[fluid ] 3.5708936e-13 2.7814556e-14 6.5999289e-14 Velocity - x y z [minimum ] -7.9328336e-04 -6.8204057e-04 -6.9062259e-04 @@ -507,8 +513,8 @@ Free energy density - timestep total fluid [fed] 2500 -4.4510185331e-04 -4.4510185331e-04 Momentum - x y z -[total ] 2.8554936e-13 -2.4244495e-14 7.0110584e-14 -[fluid ] 2.8554936e-13 -2.4244495e-14 7.0110584e-14 +[total ] 2.8481384e-13 -2.2443852e-14 7.3167167e-14 +[fluid ] 2.8481384e-13 -2.2443852e-14 7.3167167e-14 Velocity - x y z [minimum ] -8.5241659e-04 -7.1624144e-04 -7.4971797e-04 @@ -524,8 +530,8 @@ Free energy density - timestep total fluid [fed] 2600 -4.5788029540e-04 -4.5788029540e-04 Momentum - x y z -[total ] 2.9265479e-13 -1.6937840e-14 1.2889689e-13 -[fluid ] 2.9265479e-13 -1.6937840e-14 1.2889689e-13 +[total ] 2.9035455e-13 -1.9116653e-14 1.2768606e-13 +[fluid ] 2.9035455e-13 -1.9116653e-14 1.2768606e-13 Velocity - x y z [minimum ] -8.9660599e-04 -7.3285507e-04 -7.8827216e-04 @@ -541,8 +547,8 @@ Free energy density - timestep total fluid [fed] 2700 -4.6990915587e-04 -4.6990915587e-04 Momentum - x y z -[total ] 3.5560443e-13 -2.0494023e-14 1.2823076e-13 -[fluid ] 3.5560443e-13 -2.0494023e-14 1.2823076e-13 +[total ] 3.5043843e-13 -2.2874064e-14 1.2582990e-13 +[fluid ] 3.5043843e-13 -2.2874064e-14 1.2582990e-13 Velocity - x y z [minimum ] -9.2449734e-04 -7.3498427e-04 -8.0221295e-04 @@ -558,8 +564,8 @@ Free energy density - timestep total fluid [fed] 2800 -4.8131459723e-04 -4.8131459723e-04 Momentum - x y z -[total ] 3.1363800e-13 1.3281043e-14 1.4577228e-13 -[fluid ] 3.1363800e-13 1.3281043e-14 1.4577228e-13 +[total ] 3.1362413e-13 1.1195905e-14 1.4585555e-13 +[fluid ] 3.1362413e-13 1.1195905e-14 1.4585555e-13 Velocity - x y z [minimum ] -9.6171328e-04 -7.2638476e-04 -8.0661498e-04 @@ -575,8 +581,8 @@ Free energy density - timestep total fluid [fed] 2900 -4.9224983337e-04 -4.9224983337e-04 Momentum - x y z -[total ] 3.1441516e-13 2.0233815e-14 1.4943602e-13 -[fluid ] 3.1441516e-13 2.0233815e-14 1.4943602e-13 +[total ] 3.2281122e-13 1.7340296e-14 1.4955051e-13 +[fluid ] 3.2281122e-13 1.7340296e-14 1.4955051e-13 Velocity - x y z [minimum ] -9.9692693e-04 -7.2141695e-04 -8.2570924e-04 @@ -594,8 +600,8 @@ Free energy density - timestep total fluid [fed] 3000 -5.0286105589e-04 -5.0286105589e-04 Momentum - x y z -[total ] 2.8521630e-13 -2.1177504e-14 2.0139446e-13 -[fluid ] 2.8521630e-13 -2.1177504e-14 2.0139446e-13 +[total ] 2.8751654e-13 -2.2599977e-14 2.0206406e-13 +[fluid ] 2.8751654e-13 -2.2599977e-14 2.0206406e-13 Velocity - x y z [minimum ] -1.0282932e-03 -7.1849432e-04 -8.7258355e-04 @@ -611,8 +617,8 @@ Free energy density - timestep total fluid [fed] 3100 -5.1325502587e-04 -5.1325502587e-04 Momentum - x y z -[total ] 3.2718273e-13 -1.8318680e-14 2.2692959e-13 -[fluid ] 3.2718273e-13 -1.8318680e-14 2.2692959e-13 +[total ] 3.3717820e-13 -1.7399276e-14 2.2839022e-13 +[fluid ] 3.3717820e-13 -1.7399276e-14 2.2839022e-13 Velocity - x y z [minimum ] -1.0380846e-03 -7.0991436e-04 -9.1252013e-04 @@ -628,8 +634,8 @@ Free energy density - timestep total fluid [fed] 3200 -5.2347310258e-04 -5.2347310258e-04 Momentum - x y z -[total ] 2.9765079e-13 -9.1038288e-15 2.1771474e-13 -[fluid ] 2.9765079e-13 -9.1038288e-15 2.1771474e-13 +[total ] 2.9630465e-13 -8.4411644e-15 2.1490101e-13 +[fluid ] 2.9630465e-13 -8.4411644e-15 2.1490101e-13 Velocity - x y z [minimum ] -1.0248215e-03 -7.1329700e-04 -9.4048576e-04 @@ -645,8 +651,8 @@ Free energy density - timestep total fluid [fed] 3300 -5.3348188801e-04 -5.3348188801e-04 Momentum - x y z -[total ] 3.1086245e-13 1.3655743e-14 2.1105340e-13 -[fluid ] 3.1086245e-13 1.3655743e-14 2.1105340e-13 +[total ] 3.0552297e-13 8.3266727e-15 2.0995358e-13 +[fluid ] 3.0552297e-13 8.3266727e-15 2.0995358e-13 Velocity - x y z [minimum ] -9.9692717e-04 -7.4171687e-04 -9.5192752e-04 @@ -662,8 +668,8 @@ Free energy density - timestep total fluid [fed] 3400 -5.4320227640e-04 -5.4320227640e-04 Momentum - x y z -[total ] 2.7478020e-13 -5.3845817e-15 1.9206858e-13 -[fluid ] 2.7478020e-13 -5.3845817e-15 1.9206858e-13 +[total ] 2.7239322e-13 -6.6752159e-15 1.8843260e-13 +[fluid ] 2.7239322e-13 -6.6752159e-15 1.8843260e-13 Velocity - x y z [minimum ] -9.8713261e-04 -7.6033120e-04 -9.4727910e-04 @@ -679,8 +685,8 @@ Free energy density - timestep total fluid [fed] 3500 -5.5257952580e-04 -5.5257952580e-04 Momentum - x y z -[total ] 2.5945912e-13 -7.1054274e-15 2.0750068e-13 -[fluid ] 2.5945912e-13 -7.1054274e-15 2.0750068e-13 +[total ] 2.6305694e-13 -6.6162353e-15 2.0400695e-13 +[fluid ] 2.6305694e-13 -6.6162353e-15 2.0400695e-13 Velocity - x y z [minimum ] -9.7366374e-04 -7.6956770e-04 -9.4056566e-04 @@ -696,8 +702,8 @@ Free energy density - timestep total fluid [fed] 3600 -5.6160991815e-04 -5.6160991815e-04 Momentum - x y z -[total ] 2.9620750e-13 -1.5765167e-14 2.0283775e-13 -[fluid ] 2.9620750e-13 -1.5765167e-14 2.0283775e-13 +[total ] 3.0295558e-13 -1.3846563e-14 2.0440247e-13 +[fluid ] 3.0295558e-13 -1.3846563e-14 2.0440247e-13 Velocity - x y z [minimum ] -9.7627892e-04 -7.9065320e-04 -9.2266455e-04 @@ -713,8 +719,8 @@ Free energy density - timestep total fluid [fed] 3700 -5.7030517223e-04 -5.7030517223e-04 Momentum - x y z -[total ] 2.6578739e-13 -2.2870594e-14 2.2604141e-13 -[fluid ] 2.6578739e-13 -2.2870594e-14 2.2604141e-13 +[total ] 2.6881622e-13 -2.4698993e-14 2.2523997e-13 +[fluid ] 2.6881622e-13 -2.4698993e-14 2.2523997e-13 Velocity - x y z [minimum ] -9.9586301e-04 -8.0775523e-04 -9.1639905e-04 @@ -730,8 +736,8 @@ Free energy density - timestep total fluid [fed] 3800 -5.7863504929e-04 -5.7863504929e-04 Momentum - x y z -[total ] 2.2737368e-13 -2.1760371e-14 2.3314684e-13 -[fluid ] 2.2737368e-13 -2.1760371e-14 2.3314684e-13 +[total ] 2.2918126e-13 -2.3338970e-14 2.3475666e-13 +[fluid ] 2.2918126e-13 -2.3338970e-14 2.3475666e-13 Velocity - x y z [minimum ] -1.0013199e-03 -8.1011543e-04 -9.0231714e-04 @@ -747,8 +753,8 @@ Free energy density - timestep total fluid [fed] 3900 -5.8655093315e-04 -5.8655093315e-04 Momentum - x y z -[total ] 2.3325786e-13 -6.2616579e-14 1.8385293e-13 -[fluid ] 2.3325786e-13 -6.2616579e-14 1.8385293e-13 +[total ] 2.3254662e-13 -5.8227728e-14 1.8556337e-13 +[fluid ] 2.3254662e-13 -5.8227728e-14 1.8556337e-13 Velocity - x y z [minimum ] -9.9460579e-04 -7.9559461e-04 -8.7783218e-04 @@ -766,8 +772,8 @@ Free energy density - timestep total fluid [fed] 4000 -5.9406770779e-04 -5.9406770779e-04 Momentum - x y z -[total ] 1.9351187e-13 -2.2870594e-14 1.9290125e-13 -[fluid ] 1.9351187e-13 -2.2870594e-14 1.9290125e-13 +[total ] 1.9892421e-13 -2.1951191e-14 1.9268268e-13 +[fluid ] 1.9892421e-13 -2.1951191e-14 1.9268268e-13 Velocity - x y z [minimum ] -9.7476646e-04 -7.9646965e-04 -8.5686130e-04 @@ -783,8 +789,8 @@ Free energy density - timestep total fluid [fed] 4100 -6.0128847152e-04 -6.0128847152e-04 Momentum - x y z -[total ] 2.1027624e-13 -1.2545520e-14 2.2093438e-13 -[fluid ] 2.1027624e-13 -1.2545520e-14 2.2093438e-13 +[total ] 2.1061972e-13 -9.6068986e-15 2.2249216e-13 +[fluid ] 2.1061972e-13 -9.6068986e-15 2.2249216e-13 Velocity - x y z [minimum ] -9.4801376e-04 -8.0172997e-04 -8.2518101e-04 @@ -800,8 +806,8 @@ Free energy density - timestep total fluid [fed] 4200 -6.0828227333e-04 -6.0828227333e-04 Momentum - x y z -[total ] 2.0983215e-13 9.7699626e-15 2.1038726e-13 -[fluid ] 2.0983215e-13 9.7699626e-15 2.1038726e-13 +[total ] 2.1338487e-13 1.0217521e-14 2.1267710e-13 +[fluid ] 2.1338487e-13 1.0217521e-14 2.1267710e-13 Velocity - x y z [minimum ] -9.3368757e-04 -8.0106728e-04 -7.8398941e-04 @@ -817,8 +823,8 @@ Free energy density - timestep total fluid [fed] 4300 -6.1507481459e-04 -6.1507481459e-04 Momentum - x y z -[total ] 2.0217161e-13 4.3298698e-15 2.1632696e-13 -[fluid ] 2.0217161e-13 4.3298698e-15 2.1632696e-13 +[total ] 2.0751109e-13 7.1748163e-15 2.1598348e-13 +[fluid ] 2.0751109e-13 7.1748163e-15 2.1598348e-13 Velocity - x y z [minimum ] -9.1137936e-04 -7.9411351e-04 -7.4706526e-04 @@ -834,8 +840,8 @@ Free energy density - timestep total fluid [fed] 4400 -6.2169732216e-04 -6.2169732216e-04 Momentum - x y z -[total ] 2.1305180e-13 4.6962434e-14 2.1366242e-13 -[fluid ] 2.1305180e-13 4.6962434e-14 2.1366242e-13 +[total ] 2.1744759e-13 4.0325382e-14 2.1540755e-13 +[fluid ] 2.1744759e-13 4.0325382e-14 2.1540755e-13 Velocity - x y z [minimum ] -9.1329632e-04 -7.7956479e-04 -7.1505624e-04 @@ -851,8 +857,8 @@ Free energy density - timestep total fluid [fed] 4500 -6.2818015585e-04 -6.2818015585e-04 Momentum - x y z -[total ] 1.9240165e-13 3.8524739e-14 2.0586310e-13 -[fluid ] 1.9240165e-13 3.8524739e-14 2.0586310e-13 +[total ] 1.8801627e-13 4.0384363e-14 2.0650148e-13 +[fluid ] 1.8801627e-13 4.0384363e-14 2.0650148e-13 Velocity - x y z [minimum ] -9.1929130e-04 -7.5542037e-04 -6.8538634e-04 @@ -868,8 +874,8 @@ Free energy density - timestep total fluid [fed] 4600 -6.3452462819e-04 -6.3452462819e-04 Momentum - x y z -[total ] 2.3081537e-13 7.3385742e-14 1.8110513e-13 -[fluid ] 2.3081537e-13 7.3385742e-14 1.8110513e-13 +[total ] 2.3095068e-13 6.8799133e-14 1.8211474e-13 +[fluid ] 2.3095068e-13 6.8799133e-14 1.8211474e-13 Velocity - x y z [minimum ] -9.2629448e-04 -7.3820236e-04 -6.8483897e-04 @@ -885,8 +891,8 @@ Free energy density - timestep total fluid [fed] 4700 -6.4070401052e-04 -6.4070401052e-04 Momentum - x y z -[total ] 2.3891999e-13 1.0036416e-13 1.9140245e-13 -[fluid ] 2.3891999e-13 1.0036416e-13 1.9140245e-13 +[total ] 2.4174759e-13 1.0457260e-13 1.8505336e-13 +[fluid ] 2.4174759e-13 1.0457260e-13 1.8505336e-13 Velocity - x y z [minimum ] -9.3096935e-04 -7.4937634e-04 -7.1287911e-04 @@ -902,8 +908,8 @@ Free energy density - timestep total fluid [fed] 4800 -6.4671154431e-04 -6.4671154431e-04 Momentum - x y z -[total ] 2.2215563e-13 9.9031894e-14 1.7011392e-13 -[fluid ] 2.2215563e-13 9.9031894e-14 1.7011392e-13 +[total ] 2.1695840e-13 1.0247012e-13 1.6521853e-13 +[fluid ] 2.1695840e-13 1.0247012e-13 1.6521853e-13 Velocity - x y z [minimum ] -9.3155057e-04 -7.4764220e-04 -7.6292132e-04 @@ -919,8 +925,8 @@ Free energy density - timestep total fluid [fed] 4900 -6.5256660086e-04 -6.5256660086e-04 Momentum - x y z -[total ] 2.2581936e-13 1.0658141e-13 1.8718360e-13 -[fluid ] 2.2581936e-13 1.0658141e-13 1.8718360e-13 +[total ] 2.2795307e-13 1.0426382e-13 1.8927915e-13 +[fluid ] 2.2795307e-13 1.0426382e-13 1.8927915e-13 Velocity - x y z [minimum ] -9.2100134e-04 -7.3696988e-04 -8.0931406e-04 @@ -938,8 +944,8 @@ Free energy density - timestep total fluid [fed] 5000 -6.5828010521e-04 -6.5828010521e-04 Momentum - x y z -[total ] 1.8607338e-13 1.0569323e-13 2.2926105e-13 -[fluid ] 1.8607338e-13 1.0569323e-13 2.2926105e-13 +[total ] 1.8569521e-13 1.1214987e-13 2.3381297e-13 +[fluid ] 1.8569521e-13 1.1214987e-13 2.3381297e-13 Velocity - x y z [minimum ] -9.0143402e-04 -7.2983090e-04 -8.4081680e-04 @@ -955,8 +961,8 @@ Free energy density - timestep total fluid [fed] 5100 -6.6382764111e-04 -6.6382764111e-04 Momentum - x y z -[total ] 2.0039526e-13 1.0969003e-13 2.0128343e-13 -[fluid ] 2.0039526e-13 1.0969003e-13 2.0128343e-13 +[total ] 1.9838645e-13 1.0829185e-13 1.9867788e-13 +[fluid ] 1.9838645e-13 1.0829185e-13 1.9867788e-13 Velocity - x y z [minimum ] -8.7667232e-04 -7.3692769e-04 -8.5101086e-04 @@ -972,8 +978,8 @@ Free energy density - timestep total fluid [fed] 5200 -6.6917203555e-04 -6.6917203555e-04 Momentum - x y z -[total ] 2.2415403e-13 6.8389738e-14 1.8551827e-13 -[fluid ] 2.2415403e-13 6.8389738e-14 1.8551827e-13 +[total ] 2.2169419e-13 7.3975548e-14 1.8730503e-13 +[fluid ] 2.2169419e-13 7.3975548e-14 1.8730503e-13 Velocity - x y z [minimum ] -8.4972983e-04 -7.3891432e-04 -8.6731588e-04 @@ -989,8 +995,8 @@ Free energy density - timestep total fluid [fed] 5300 -6.7429355544e-04 -6.7429355544e-04 Momentum - x y z -[total ] 1.8596236e-13 8.2711615e-14 1.7374990e-13 -[fluid ] 1.8596236e-13 8.2711615e-14 1.7374990e-13 +[total ] 1.8618787e-13 8.0418311e-14 1.7169252e-13 +[fluid ] 1.8618787e-13 8.0418311e-14 1.7169252e-13 Velocity - x y z [minimum ] -8.2180389e-04 -7.3300320e-04 -8.7961984e-04 @@ -1006,8 +1012,8 @@ Free energy density - timestep total fluid [fed] 5400 -6.7920222496e-04 -6.7920222496e-04 Momentum - x y z -[total ] 1.6797674e-13 9.9475983e-14 1.0913492e-13 -[fluid ] 1.6797674e-13 9.9475983e-14 1.0913492e-13 +[total ] 1.6568344e-13 1.0248399e-13 1.1162946e-13 +[fluid ] 1.6568344e-13 1.0248399e-13 1.1162946e-13 Velocity - x y z [minimum ] -7.9812112e-04 -7.2209643e-04 -8.7287723e-04 @@ -1023,8 +1029,8 @@ Free energy density - timestep total fluid [fed] 5500 -6.8392653381e-04 -6.8392653381e-04 Momentum - x y z -[total ] 1.1801671e-13 1.0613732e-13 1.3244961e-13 -[fluid ] 1.1801671e-13 1.0613732e-13 1.3244961e-13 +[total ] 1.1741996e-13 1.0647386e-13 1.2993773e-13 +[fluid ] 1.1741996e-13 1.0647386e-13 1.2993773e-13 Velocity - x y z [minimum ] -8.2213503e-04 -7.0830584e-04 -8.4736395e-04 @@ -1040,8 +1046,8 @@ Free energy density - timestep total fluid [fed] 5600 -6.8850147400e-04 -6.8850147400e-04 Momentum - x y z -[total ] 1.7175150e-13 5.9396932e-14 1.4976909e-13 -[fluid ] 1.7175150e-13 5.9396932e-14 1.4976909e-13 +[total ] 1.6442403e-13 6.2803929e-14 1.5001195e-13 +[fluid ] 1.6442403e-13 6.2803929e-14 1.5001195e-13 Velocity - x y z [minimum ] -8.4075132e-04 -7.0212255e-04 -8.1536956e-04 @@ -1057,8 +1063,8 @@ Free energy density - timestep total fluid [fed] 5700 -6.9295542311e-04 -6.9295542311e-04 Momentum - x y z -[total ] 1.4388490e-13 6.6169292e-14 1.2367884e-13 -[fluid ] 1.4388490e-13 6.6169292e-14 1.2367884e-13 +[total ] 1.4722945e-13 6.8684641e-14 1.2451151e-13 +[fluid ] 1.4722945e-13 6.8684641e-14 1.2451151e-13 Velocity - x y z [minimum ] -8.4593427e-04 -7.0475552e-04 -7.8586595e-04 @@ -1074,8 +1080,8 @@ Free energy density - timestep total fluid [fed] 5800 -6.9730189620e-04 -6.9730189620e-04 Momentum - x y z -[total ] 1.5032420e-13 2.9309888e-14 1.0746959e-13 -[fluid ] 1.5032420e-13 2.9309888e-14 1.0746959e-13 +[total ] 1.5173626e-13 3.3226893e-14 1.0627610e-13 +[fluid ] 1.5173626e-13 3.3226893e-14 1.0627610e-13 Velocity - x y z [minimum ] -8.4315615e-04 -7.0670258e-04 -7.5673755e-04 @@ -1091,8 +1097,8 @@ Free energy density - timestep total fluid [fed] 5900 -7.0154899700e-04 -7.0154899700e-04 Momentum - x y z -[total ] 1.1457502e-13 -3.7747583e-14 1.3344881e-13 -[fluid ] 1.1457502e-13 -3.7747583e-14 1.3344881e-13 +[total ] 1.1122700e-13 -3.5017128e-14 1.3543333e-13 +[fluid ] 1.1122700e-13 -3.5017128e-14 1.3543333e-13 Velocity - x y z [minimum ] -8.4616123e-04 -7.0754159e-04 -7.3456956e-04 @@ -1110,8 +1116,8 @@ Free energy density - timestep total fluid [fed] 6000 -7.0571261526e-04 -7.0571261526e-04 Momentum - x y z -[total ] 1.5043522e-13 -2.6423308e-14 1.3744561e-13 -[fluid ] 1.5043522e-13 -2.6423308e-14 1.3744561e-13 +[total ] 1.4304530e-13 -2.8144154e-14 1.3440291e-13 +[fluid ] 1.4304530e-13 -2.8144154e-14 1.3440291e-13 Velocity - x y z [minimum ] -8.4709557e-04 -7.0717499e-04 -7.3331802e-04 @@ -1127,8 +1133,8 @@ Free energy density - timestep total fluid [fed] 6100 -7.0980943393e-04 -7.0980943393e-04 Momentum - x y z -[total ] 1.1879386e-13 -3.9301895e-14 1.0436096e-13 -[fluid ] 1.1879386e-13 -3.9301895e-14 1.0436096e-13 +[total ] 1.1735751e-13 -3.6932263e-14 1.0242848e-13 +[fluid ] 1.1735751e-13 -3.6932263e-14 1.0242848e-13 Velocity - x y z [minimum ] -8.4528576e-04 -7.0579044e-04 -7.2881594e-04 @@ -1144,8 +1150,8 @@ Free energy density - timestep total fluid [fed] 6200 -7.1385365736e-04 -7.1385365736e-04 Momentum - x y z -[total ] 6.3615779e-14 2.7533531e-14 1.4921397e-13 -[fluid ] 6.3615779e-14 2.7533531e-14 1.4921397e-13 +[total ] 6.0045718e-14 2.2301605e-14 1.4784007e-13 +[fluid ] 6.0045718e-14 2.2301605e-14 1.4784007e-13 Velocity - x y z [minimum ] -8.4144322e-04 -7.0469359e-04 -7.2152507e-04 @@ -1161,8 +1167,8 @@ Free energy density - timestep total fluid [fed] 6300 -7.1786624559e-04 -7.1786624559e-04 Momentum - x y z -[total ] 8.6486374e-14 1.2212453e-14 1.4344081e-13 -[fluid ] 8.6486374e-14 1.2212453e-14 1.4344081e-13 +[total ] 8.5556562e-14 1.1383255e-14 1.4651128e-13 +[fluid ] 8.5556562e-14 1.1383255e-14 1.4651128e-13 Velocity - x y z [minimum ] -8.3204427e-04 -7.0551546e-04 -7.1403335e-04 @@ -1178,8 +1184,8 @@ Free energy density - timestep total fluid [fed] 6400 -7.2185709930e-04 -7.2185709930e-04 Momentum - x y z -[total ] 5.3956839e-14 2.8199665e-14 1.7208457e-13 -[fluid ] 5.3956839e-14 2.8199665e-14 1.7208457e-13 +[total ] 5.3193561e-14 2.2419566e-14 1.7262927e-13 +[fluid ] 5.3193561e-14 2.2419566e-14 1.7262927e-13 Velocity - x y z [minimum ] -8.2147115e-04 -7.0596855e-04 -7.0651851e-04 @@ -1195,8 +1201,8 @@ Free energy density - timestep total fluid [fed] 6500 -7.2581938148e-04 -7.2581938148e-04 Momentum - x y z -[total ] 4.0301096e-14 3.9301895e-14 1.9539925e-13 -[fluid ] 4.0301096e-14 3.9301895e-14 1.9539925e-13 +[total ] 3.4795083e-14 4.0793757e-14 2.0064506e-13 +[fluid ] 3.4795083e-14 4.0793757e-14 2.0064506e-13 Velocity - x y z [minimum ] -8.2336157e-04 -7.0720608e-04 -6.9614013e-04 @@ -1212,8 +1218,8 @@ Free energy density - timestep total fluid [fed] 6600 -7.2974215204e-04 -7.2974215204e-04 Momentum - x y z -[total ] 1.0436096e-14 7.7271523e-14 2.2937208e-13 -[fluid ] 1.0436096e-14 7.7271523e-14 2.2937208e-13 +[total ] 1.2150003e-14 7.4742296e-14 2.3056210e-13 +[fluid ] 1.2150003e-14 7.4742296e-14 2.3056210e-13 Velocity - x y z [minimum ] -8.2461601e-04 -7.1514377e-04 -6.8463728e-04 @@ -1229,8 +1235,8 @@ Free energy density - timestep total fluid [fed] 6700 -7.3362364642e-04 -7.3362364642e-04 Momentum - x y z -[total ] -2.3314684e-15 1.2190249e-13 2.2271074e-13 -[fluid ] -2.3314684e-15 1.2190249e-13 2.2271074e-13 +[total ] -4.3402781e-15 1.2884138e-13 2.2222502e-13 +[fluid ] -4.3402781e-15 1.2884138e-13 2.2222502e-13 Velocity - x y z [minimum ] -8.2369286e-04 -7.1904593e-04 -6.7910907e-04 @@ -1246,8 +1252,8 @@ Free energy density - timestep total fluid [fed] 6800 -7.3749174717e-04 -7.3749174717e-04 Momentum - x y z -[total ] -6.4448447e-14 1.3145041e-13 2.0006219e-13 -[fluid ] -6.4448447e-14 1.3145041e-13 2.0006219e-13 +[total ] -6.2144734e-14 1.2908771e-13 1.9770297e-13 +[fluid ] -6.2144734e-14 1.2908771e-13 1.9770297e-13 Velocity - x y z [minimum ] -8.1946292e-04 -7.2315050e-04 -6.7767174e-04 @@ -1263,8 +1269,8 @@ Free energy density - timestep total fluid [fed] 6900 -7.4138381873e-04 -7.4138381873e-04 Momentum - x y z -[total ] -1.0791368e-13 1.3344881e-13 2.2759572e-13 -[fluid ] -1.0791368e-13 1.3344881e-13 2.2759572e-13 +[total ] -1.0977330e-13 1.3334819e-13 2.2782123e-13 +[fluid ] -1.0977330e-13 1.3334819e-13 2.2782123e-13 Velocity - x y z [minimum ] -8.1174889e-04 -7.2684792e-04 -6.7302108e-04 @@ -1282,8 +1288,8 @@ Free energy density - timestep total fluid [fed] 7000 -7.4531744328e-04 -7.4531744328e-04 Momentum - x y z -[total ] -1.2784218e-13 1.0880186e-13 2.1227464e-13 -[fluid ] -1.2784218e-13 1.0880186e-13 2.1227464e-13 +[total ] -1.2449070e-13 1.1047413e-13 2.1943211e-13 +[fluid ] -1.2449070e-13 1.1047413e-13 2.1943211e-13 Velocity - x y z [minimum ] -8.0170847e-04 -7.2572061e-04 -6.7040516e-04 @@ -1299,8 +1305,8 @@ Free energy density - timestep total fluid [fed] 7100 -7.4930197673e-04 -7.4930197673e-04 Momentum - x y z -[total ] -1.1590728e-13 1.3322676e-13 2.1427304e-13 -[fluid ] -1.1590728e-13 1.3322676e-13 2.1427304e-13 +[total ] -1.1435297e-13 1.3564497e-13 2.1664615e-13 +[fluid ] -1.1435297e-13 1.3564497e-13 2.1664615e-13 Velocity - x y z [minimum ] -7.9142336e-04 -7.2012375e-04 -6.7968814e-04 @@ -1316,8 +1322,8 @@ Free energy density - timestep total fluid [fed] 7200 -7.5334297806e-04 -7.5334297806e-04 Momentum - x y z -[total ] -1.1668444e-13 1.6497914e-13 2.3714364e-13 -[fluid ] -1.1668444e-13 1.6497914e-13 2.3714364e-13 +[total ] -1.2037940e-13 1.6938187e-13 2.3266111e-13 +[fluid ] -1.2037940e-13 1.6938187e-13 2.3266111e-13 Velocity - x y z [minimum ] -7.8788069e-04 -7.2248780e-04 -6.8807574e-04 @@ -1333,8 +1339,8 @@ Free energy density - timestep total fluid [fed] 7300 -7.5743502496e-04 -7.5743502496e-04 Momentum - x y z -[total ] -1.1340928e-13 1.1513013e-13 1.9562130e-13 -[fluid ] -1.1340928e-13 1.1513013e-13 1.9562130e-13 +[total ] -1.1567830e-13 1.2500764e-13 1.9442781e-13 +[fluid ] -1.1567830e-13 1.2500764e-13 1.9442781e-13 Velocity - x y z [minimum ] -7.8212896e-04 -7.2610133e-04 -6.9621146e-04 @@ -1350,8 +1356,8 @@ Free energy density - timestep total fluid [fed] 7400 -7.6156877786e-04 -7.6156877786e-04 Momentum - x y z -[total ] -1.0169643e-13 1.1701751e-13 1.6142643e-13 -[fluid ] -1.0169643e-13 1.1701751e-13 1.6142643e-13 +[total ] -9.9937419e-14 1.1715628e-13 1.6189480e-13 +[fluid ] -9.9937419e-14 1.1715628e-13 1.6189480e-13 Velocity - x y z [minimum ] -7.8172958e-04 -7.2882879e-04 -7.2222331e-04 @@ -1367,8 +1373,8 @@ Free energy density - timestep total fluid [fed] 7500 -7.6572970465e-04 -7.6572970465e-04 Momentum - x y z -[total ] -1.1529666e-13 8.4376950e-14 1.4299673e-13 -[fluid ] -1.1529666e-13 8.4376950e-14 1.4299673e-13 +[total ] -1.2126064e-13 8.5095125e-14 1.4329163e-13 +[fluid ] -1.2126064e-13 8.5095125e-14 1.4329163e-13 Velocity - x y z [minimum ] -7.8584377e-04 -7.3065420e-04 -7.5341686e-04 @@ -1384,8 +1390,8 @@ Free energy density - timestep total fluid [fed] 7600 -7.6987187907e-04 -7.6987187907e-04 Momentum - x y z -[total ] -1.0394463e-13 5.9507954e-14 1.5010215e-13 -[fluid ] -1.0394463e-13 5.9507954e-14 1.5010215e-13 +[total ] -1.0206419e-13 6.0333682e-14 1.5123666e-13 +[fluid ] -1.0206419e-13 6.0333682e-14 1.5123666e-13 Velocity - x y z [minimum ] -7.8747662e-04 -7.3151322e-04 -7.7568442e-04 @@ -1401,8 +1407,8 @@ Free energy density - timestep total fluid [fed] 7700 -7.7395401887e-04 -7.7395401887e-04 Momentum - x y z -[total ] -6.5031314e-14 8.6153307e-14 1.4743762e-13 -[fluid ] -6.5031314e-14 8.6153307e-14 1.4743762e-13 +[total ] -6.1433497e-14 8.7100466e-14 1.4827722e-13 +[fluid ] -6.1433497e-14 8.7100466e-14 1.4827722e-13 Velocity - x y z [minimum ] -7.8546216e-04 -7.3447149e-04 -7.8730448e-04 @@ -1418,8 +1424,8 @@ Free energy density - timestep total fluid [fed] 7800 -7.7798227665e-04 -7.7798227665e-04 Momentum - x y z -[total ] -7.8242968e-14 8.1712415e-14 1.4743762e-13 -[fluid ] -7.8242968e-14 8.1712415e-14 1.4743762e-13 +[total ] -7.6987028e-14 8.1337714e-14 1.4568555e-13 +[fluid ] -7.6987028e-14 8.1337714e-14 1.4568555e-13 Velocity - x y z [minimum ] -7.7932239e-04 -7.4553930e-04 -7.9874951e-04 @@ -1435,8 +1441,8 @@ Free energy density - timestep total fluid [fed] 7900 -7.8198024118e-04 -7.8198024118e-04 Momentum - x y z -[total ] -8.7374552e-14 5.6621374e-14 1.2567725e-13 -[fluid ] -8.7374552e-14 5.6621374e-14 1.2567725e-13 +[total ] -8.9837859e-14 4.8620830e-14 1.2380721e-13 +[fluid ] -8.9837859e-14 4.8620830e-14 1.2380721e-13 Velocity - x y z [minimum ] -7.6935654e-04 -7.5443734e-04 -8.0366148e-04 @@ -1454,8 +1460,8 @@ Free energy density - timestep total fluid [fed] 8000 -7.8595081742e-04 -7.8595081742e-04 Momentum - x y z -[total ] -4.8003268e-14 2.8976821e-14 1.0480505e-13 -[fluid ] -4.8003268e-14 2.8976821e-14 1.0480505e-13 +[total ] -4.3628295e-14 2.8720082e-14 1.0567588e-13 +[fluid ] -4.3628295e-14 2.8720082e-14 1.0567588e-13 Velocity - x y z [minimum ] -7.6264147e-04 -7.6103495e-04 -8.0149803e-04 @@ -1471,8 +1477,8 @@ Free energy density - timestep total fluid [fed] 8100 -7.8987950230e-04 -7.8987950230e-04 Momentum - x y z -[total ] -1.8554602e-14 4.7739590e-14 1.1768364e-13 -[fluid ] -1.8554602e-14 4.7739590e-14 1.1768364e-13 +[total ] -1.6858043e-14 5.2440691e-14 1.1581361e-13 +[fluid ] -1.6858043e-14 5.2440691e-14 1.1581361e-13 Velocity - x y z [minimum ] -7.5789317e-04 -7.6524721e-04 -7.9356831e-04 @@ -1488,8 +1494,8 @@ Free energy density - timestep total fluid [fed] 8200 -7.9374963577e-04 -7.9374963577e-04 Momentum - x y z -[total ] -3.7164716e-14 1.5543122e-14 1.2745360e-13 -[fluid ] -3.7164716e-14 1.5543122e-14 1.2745360e-13 +[total ] -3.7948811e-14 1.6948248e-14 1.2415416e-13 +[fluid ] -3.7948811e-14 1.6948248e-14 1.2415416e-13 Velocity - x y z [minimum ] -7.4923006e-04 -7.6716283e-04 -7.8177069e-04 @@ -1505,8 +1511,8 @@ Free energy density - timestep total fluid [fed] 8300 -7.9755148706e-04 -7.9755148706e-04 Momentum - x y z -[total ] -3.6137759e-14 3.1974423e-14 1.2079227e-13 -[fluid ] -3.6137759e-14 3.1974423e-14 1.2079227e-13 +[total ] -3.5690201e-14 3.7615744e-14 1.2459131e-13 +[fluid ] -3.5690201e-14 3.7615744e-14 1.2459131e-13 Velocity - x y z [minimum ] -7.3839413e-04 -7.6707062e-04 -7.6798312e-04 @@ -1522,8 +1528,8 @@ Free energy density - timestep total fluid [fed] 8400 -8.0129742135e-04 -8.0129742135e-04 Momentum - x y z -[total ] -8.0879747e-14 1.8429702e-14 1.2656542e-13 -[fluid ] -8.0879747e-14 1.8429702e-14 1.2656542e-13 +[total ] -8.2728963e-14 2.3401420e-14 1.2650991e-13 +[fluid ] -8.2728963e-14 2.3401420e-14 1.2650991e-13 Velocity - x y z [minimum ] -7.3370095e-04 -7.6542862e-04 -7.6045611e-04 @@ -1539,8 +1545,8 @@ Free energy density - timestep total fluid [fed] 8500 -8.0501259763e-04 -8.0501259763e-04 Momentum - x y z -[total ] -1.0860757e-13 4.3298698e-14 1.3455903e-13 -[fluid ] -1.0860757e-13 4.3298698e-14 1.3455903e-13 +[total ] -1.1223661e-13 4.2670728e-14 1.3529455e-13 +[fluid ] -1.1223661e-13 4.2670728e-14 1.3529455e-13 Velocity - x y z [minimum ] -7.2344387e-04 -7.6275390e-04 -7.5475345e-04 @@ -1556,8 +1562,8 @@ Free energy density - timestep total fluid [fed] 8600 -8.0870793886e-04 -8.0870793886e-04 Momentum - x y z -[total ] -1.2639889e-13 6.0063066e-14 1.1457502e-13 -[fluid ] -1.2639889e-13 6.0063066e-14 1.1457502e-13 +[total ] -1.2350190e-13 6.3161282e-14 1.1849202e-13 +[fluid ] -1.2350190e-13 6.3161282e-14 1.1849202e-13 Velocity - x y z [minimum ] -7.0820369e-04 -7.7146775e-04 -7.4943049e-04 @@ -1573,8 +1579,8 @@ Free energy density - timestep total fluid [fed] 8700 -8.1237290353e-04 -8.1237290353e-04 Momentum - x y z -[total ] -1.0064172e-13 1.1446399e-13 1.1946000e-13 -[fluid ] -1.0064172e-13 1.1446399e-13 1.1946000e-13 +[total ] -9.8893116e-14 1.1114720e-13 1.1555687e-13 +[fluid ] -9.8893116e-14 1.1114720e-13 1.1555687e-13 Velocity - x y z [minimum ] -6.8988652e-04 -7.8197513e-04 -7.4370669e-04 @@ -1590,8 +1596,8 @@ Free energy density - timestep total fluid [fed] 8800 -8.1597345547e-04 -8.1597345547e-04 Momentum - x y z -[total ] -9.8532293e-14 1.0946799e-13 1.0613732e-13 -[fluid ] -9.8532293e-14 1.0946799e-13 1.0613732e-13 +[total ] -1.0135989e-13 1.0841328e-13 1.0930146e-13 +[fluid ] -1.0135989e-13 1.0841328e-13 1.0930146e-13 Velocity - x y z [minimum ] -6.7071073e-04 -7.9407470e-04 -7.3671334e-04 @@ -1607,8 +1613,8 @@ Free energy density - timestep total fluid [fed] 8900 -8.1947951561e-04 -8.1947951561e-04 Momentum - x y z -[total ] -6.9999562e-14 9.0927266e-14 1.0613732e-13 -[fluid ] -6.9999562e-14 9.0927266e-14 1.0613732e-13 +[total ] -6.9996092e-14 8.9071112e-14 1.0633161e-13 +[fluid ] -6.9996092e-14 8.9071112e-14 1.0633161e-13 Velocity - x y z [minimum ] -6.5903188e-04 -8.0839659e-04 -7.3096442e-04 @@ -1626,8 +1632,8 @@ Free energy density - timestep total fluid [fed] 9000 -8.2287647705e-04 -8.2287647705e-04 Momentum - x y z -[total ] -7.2830630e-14 5.8175686e-14 1.0125234e-13 -[fluid ] -7.2830630e-14 5.8175686e-14 1.0125234e-13 +[total ] -7.8118068e-14 6.6759098e-14 1.0364973e-13 +[fluid ] -7.8118068e-14 6.6759098e-14 1.0364973e-13 Velocity - x y z [minimum ] -6.4495937e-04 -8.2567761e-04 -7.2841974e-04 @@ -1643,8 +1649,8 @@ Free energy density - timestep total fluid [fed] 9100 -8.2616253867e-04 -8.2616253867e-04 Momentum - x y z -[total ] -7.6466611e-14 6.0840222e-14 8.7485574e-14 -[fluid ] -7.6466611e-14 6.0840222e-14 8.7485574e-14 +[total ] -7.7896023e-14 6.4663552e-14 8.5091656e-14 +[fluid ] -7.7896023e-14 6.4663552e-14 8.5091656e-14 Velocity - x y z [minimum ] -6.2906105e-04 -8.5011866e-04 -7.2561621e-04 @@ -1660,8 +1666,8 @@ Free energy density - timestep total fluid [fed] 9200 -8.2935618367e-04 -8.2935618367e-04 Momentum - x y z -[total ] -5.3457239e-14 8.0491169e-14 1.0480505e-13 -[fluid ] -5.3457239e-14 8.0491169e-14 1.0480505e-13 +[total ] -4.9970444e-14 8.2767126e-14 1.1077597e-13 +[fluid ] -4.9970444e-14 8.2767126e-14 1.1077597e-13 Velocity - x y z [minimum ] -6.2122356e-04 -8.8121278e-04 -7.2109381e-04 @@ -1677,8 +1683,8 @@ Free energy density - timestep total fluid [fed] 9300 -8.3248300181e-04 -8.3248300181e-04 Momentum - x y z -[total ] -4.8377968e-14 9.9920072e-14 1.2567725e-13 -[fluid ] -4.8377968e-14 9.9920072e-14 1.2567725e-13 +[total ] -4.9016347e-14 1.0072498e-13 1.2430335e-13 +[fluid ] -4.9016347e-14 1.0072498e-13 1.2430335e-13 Velocity - x y z [minimum ] -6.0956654e-04 -9.1665049e-04 -7.1353905e-04 @@ -1694,8 +1700,8 @@ Free energy density - timestep total fluid [fed] 9400 -8.3556215469e-04 -8.3556215469e-04 Momentum - x y z -[total ] -4.7961635e-14 1.5154544e-13 1.6031620e-13 -[fluid ] -4.7961635e-14 1.5154544e-13 1.6031620e-13 +[total ] -4.6972842e-14 1.5321078e-13 1.5682594e-13 +[fluid ] -4.6972842e-14 1.5321078e-13 1.5682594e-13 Velocity - x y z [minimum ] -5.9448804e-04 -9.5619302e-04 -7.0195213e-04 @@ -1711,8 +1717,8 @@ Free energy density - timestep total fluid [fed] 9500 -8.3860798056e-04 -8.3860798056e-04 Momentum - x y z -[total ] -1.1174395e-13 1.6298074e-13 1.4810375e-13 -[fluid ] -1.1174395e-13 1.6298074e-13 1.4810375e-13 +[total ] -1.1226090e-13 1.6231114e-13 1.5262791e-13 +[fluid ] -1.1226090e-13 1.6231114e-13 1.5262791e-13 Velocity - x y z [minimum ] -6.2631535e-04 -9.9990504e-04 -6.8582361e-04 @@ -1728,8 +1734,8 @@ Free energy density - timestep total fluid [fed] 9600 -8.4163812744e-04 -8.4163812744e-04 Momentum - x y z -[total ] -1.0219603e-13 9.9920072e-14 1.6608936e-13 -[fluid ] -1.0219603e-13 9.9920072e-14 1.6608936e-13 +[total ] -9.8133307e-14 1.0275461e-13 1.6339360e-13 +[fluid ] -9.8133307e-14 1.0275461e-13 1.6339360e-13 Velocity - x y z [minimum ] -6.4378469e-04 -1.0482407e-03 -6.7496878e-04 @@ -1745,8 +1751,8 @@ Free energy density - timestep total fluid [fed] 9700 -8.4467624785e-04 -8.4467624785e-04 Momentum - x y z -[total ] -1.5781820e-13 1.3300472e-13 1.7741364e-13 -[fluid ] -1.5781820e-13 1.3300472e-13 1.7741364e-13 +[total ] -1.5886251e-13 1.3459373e-13 1.7739976e-13 +[fluid ] -1.5886251e-13 1.3459373e-13 1.7739976e-13 Velocity - x y z [minimum ] -6.3985227e-04 -1.1011704e-03 -6.6898585e-04 @@ -1762,8 +1768,8 @@ Free energy density - timestep total fluid [fed] 9800 -8.4774207100e-04 -8.4774207100e-04 Momentum - x y z -[total ] -1.9639845e-13 1.1690648e-13 1.7230661e-13 -[fluid ] -1.9639845e-13 1.1690648e-13 1.7230661e-13 +[total ] -1.9828236e-13 1.1137966e-13 1.7126231e-13 +[fluid ] -1.9828236e-13 1.1137966e-13 1.7126231e-13 Velocity - x y z [minimum ] -6.1950455e-04 -1.1561307e-03 -6.6385462e-04 @@ -1779,8 +1785,8 @@ Free energy density - timestep total fluid [fed] 9900 -8.5085111878e-04 -8.5085111878e-04 Momentum - x y z -[total ] -2.1266322e-13 1.2589929e-13 1.7119639e-13 -[fluid ] -2.1266322e-13 1.2589929e-13 1.7119639e-13 +[total ] -2.1282975e-13 1.2553153e-13 1.6732449e-13 +[fluid ] -2.1282975e-13 1.2553153e-13 1.6732449e-13 Velocity - x y z [minimum ] -5.9822672e-04 -1.2050207e-03 -6.6125896e-04 @@ -1798,8 +1804,8 @@ Free energy density - timestep total fluid [fed] 10000 -8.5399505820e-04 -8.5399505820e-04 Momentum - x y z -[total ] -2.1738167e-13 8.5709218e-14 1.5631940e-13 -[fluid ] -2.1738167e-13 8.5709218e-14 1.5631940e-13 +[total ] -2.1913721e-13 8.4966756e-14 1.5647553e-13 +[fluid ] -2.1913721e-13 8.4966756e-14 1.5647553e-13 Velocity - x y z [minimum ] -5.8662322e-04 -1.2361346e-03 -6.5612134e-04 @@ -1813,20 +1819,25 @@ Timer resolution: 1e-06 second Timer statistics Section: tmin tmax total - Total: 296.258 296.259 296.258 296.257998 (1 call) - Time step loop: 0.023 0.059 295.673 0.029567 (10000 calls) - Propagation: 0.001 0.008 31.874 0.003187 (10000 calls) - Propagtn (krnl) : 0.001 0.008 31.827 0.003183 (10000 calls) - Collision: 0.003 0.013 67.774 0.006777 (10000 calls) - Collision (krnl) : 0.003 0.013 67.711 0.006771 (10000 calls) - Lattice halos: 0.001 0.018 21.647 0.002165 (10000 calls) - phi gradients: 0.002 0.026 61.615 0.006162 (10000 calls) - phi halos: 0.000 0.019 5.652 0.000565 (10000 calls) - BBL: 0.000 0.000 0.007 0.000001 (10000 calls) - Force calculation: 0.003 0.015 70.809 0.007081 (10000 calls) - Phi force (krnl) : 0.002 0.013 56.634 0.005663 (10000 calls) - phi update: 0.002 0.023 38.234 0.003823 (10000 calls) - Advectn (krnl) : 0.001 0.011 9.731 0.000973 (10000 calls) - Advectn BCS (krnl) : 0.000 0.008 5.395 0.000540 (10000 calls) - Free1: 0.000 0.010 0.549 0.000055 (10000 calls) + Total: 114.180 114.183 114.181 114.180596 (1 call) + Time step loop: 0.009 0.025 113.333 0.011333 (10000 calls) + Propagation: 0.000 0.004 8.376 0.000838 (10000 calls) + Propagtn (krnl) : 0.000 0.004 8.217 0.000822 (10000 calls) + Collision: 0.000 0.002 8.508 0.000851 (10000 calls) + Collision (krnl) : 0.000 0.002 8.391 0.000839 (10000 calls) + Lattice halos: 0.001 0.008 21.612 0.002161 (10000 calls) + phi gradients: 0.001 0.009 22.505 0.002250 (10000 calls) + phi halos: 0.001 0.008 17.626 0.001763 (10000 calls) + BBL: 0.000 0.001 0.024 0.000002 (10000 calls) + Force calculation: 0.000 0.002 8.851 0.000885 (10000 calls) + Phi force (krnl) : 0.000 0.002 4.629 0.000463 (10000 calls) + phi update: 0.002 0.014 34.963 0.003496 (10000 calls) + Advectn (krnl) : 0.000 0.006 3.704 0.000370 (10000 calls) + Advectn BCS (krnl) : 0.000 0.010 3.178 0.000318 (10000 calls) + Free1: 0.000 0.014 0.801 0.000080 (10000 calls) +Warning: key/value present in input but not used: +(Line 67): boundary_walls_on +Warning: key/value present in input but not used: +(Line 44): C +End time: Mon Jan 31 12:21:37 2022 Ludwig finished normally. diff --git a/docs/tutorial/test2/vel-00010000.001-001 b/docs/tutorial/test2/vel-00010000.001-001 index 6131d37c930da5c4b67474498d62dfa1436f261b..71e228738c46da7320657620c8a217fc11a954bc 100644 GIT binary patch delta 11089 zcmXBZb(B?Q8$j_zHwq|S(n?D=(vk{F7=Uz&bP9tK(jna_sS*xw0i_WIr8@=b?#}Ps z`}^mvXZ_Z@=01C7)|_+CL`4;diYl-?Dn=wKMpTRyysVBI7+#}e1^ZTujSa%$1{V`H)8!NzMTu~sz@f1R#E2w7hp7oYJDjtL(UEErbrkvl|VsjJZv=vuX;`WsprU8j~& z*Q4dojcR#y6Iub?qE=M5qLtBYY8Ca*Fh^GlxZQ^LY1lzmjbQ(1HL;yo?O?mLI@liU z!(jWgy4Zf~qhJTMkFi5ogJ4IrhS*W;lVHcSPq7o&=fO^Cjj?~j7^%kA+uizox86ZZ z4fG$irn(cYjqX4(S2%NbwBzMdQkmXJ%lzukEjjRqv$8-arIO61o}C8N^PwE z8|LVy0nga*1r7g&F}iuMb6N}RJk~1MMXfb<32Phdiq;OhiggHfUF(S5z&ZuHrG16n z#<~Q%t98ZhVcmm0(0X7G!x(AG)@R)M3%C9+%#r5kIkkm)9&LqQR9mZ;(6;CmwViqu z?SNiaJE}L(PUtQ5EA=+o1-+|wRqvtQ(FbY|^l@wPK}Qa zM-!?e)I{hgG>JM|O&aFtu>oJVVI1$6jIQs4rO+l|Z(x&xrPL;4sj#WR(rDALwAhSb z>9v_y25fe)OxheQGxkHUEZUD)R&0K-?Aih>M;Iex+4^<29_QA{!W{V?O`%Ru-#{m! zDb>kpDs(EEMxCanMQ5Pt)tPDrbT*nvoug((e?YUSKdM>L`Dk`^ftn-C(Tf7+vSBd| zZ`1X2u-w`&SRQO?uzcDwEI;;Zu!34N_Aa(ESYd4yRs>reteCb2D~|mZtfclkRtj4m ztc_AsB$M5_C&oAE3B?ki=eAH zTTES}7DsB71p6=87us2@8FoHc3+)2d61xM+$8H4csNKZA3}fUdTQ_v;V{Y9j%#jo5r|L=dGxT4yv3goIJnWdI@cH!3&UD=i)>XTYb;BM8>!Cfu zdSXw4_12zZeX!@j`e`q)ud!Fb281E}1;C=h7>OCi$TwkH9TiLc7L9`rR^zHe(A#YO zm7Cvj^Un0#L%XW?)o$oRw1@gg?TJ1?d#g{?KIn6_pZY@m8hwQh2-B+ne=dsxV{&Et z#-p*qxH{@vG!8mgjjIkp;}h|n5ebYKMnocXgqm0#i6%uytFNhJ&}8U1HMu$-eFL4K zzNt<`Q=ya9)an#8Ejmq2r%p#RpflBs>MS%q72jErz=~m1Btl21iPe#4QgpQXnmPte zhK^H{tK-o(&O?dZI$2GvPC?V6)6{h8bTk7xQ_ZN(LNik_$BMVCm`g=g^hY(D zIuFf(E>Lr-3(>dH#p*liPiP+W7d5ZC1kH~wQwyle(Ra~kwUD|3ErPC6i>eVcGZk~J zc*}~pRAfbeRI{n`&>ZLjHK)1|eH&e@zN7wx=0Sf^^QueG{OB^ZfVv!g7mZd6sVmST z=qk0S8bOOwvBruLR;;C>6#BbbT3v^hMK`GB)Q#wS=w`Kox&^I-{-IV@x1m+hztn2# zcCXJYoWW;+Ujof11k1f@u3y_sHle?P(M-+qV>_kY6JBM z+6XnKSNKdpR1?PCg^Fksd@%&hMrZMtLM;`=moWvdJ+AAioI5RXvID%>Y)eJ zkJN)`ee|%}Ks|ysLXWARsK?RI(39%t>M67ddRlF&opdQI)1UPr$~Z>pWtTWDwWj@m`Ni*`frtKHQHXixN!+DmsDb#*M7938KwP`^jtL?@~#)k$b- zBBmIT#)zq;r9-Ey>D3u%Ms${%Nu71uj)2AUC_rDjrRqi>;e)hy}{Xf|}7 znq8fb=0q2&xzt7IJLpepZuMt0FS!)WMIm&BT3B6)7DXd!F?BUs z0$rUy*sx=}5!ZbB=dThxl`R}%teOJ?Mw%KDDm8AN>eDsD7*-ipO*J264lC9+4Z$ zM>+fnhmWhDswdFT(Nk(;^Up#kdQokyUP9ZVSJZauRkQOHhO z`atcWK16#_@z{#qRy?7iFZxXFr#?sfqc7C~>ML|08Y4ben{U*ZVU7$!W2=MJIOtF` zp8A~{A03V+R7a?Z&{1d-b+nok?M207D|%b;go?iCGqs=k9PN+3R0pW9(1B=-MDDA` z40B`<8e1K##zBXo@zn3s_~>vnp*liMgpNX!sH4@S=vXRVw_=kpDs(EEMxCanMQ5Pt)tPDrbT*nvoug((e?YUSKdM>L`Dk`^ftmvyOU3I}jI$yc z72l&N)CuYv=p;0yI$2GHPDRtG)6}%+3^ctuQ_Xrisn<7srk`g(Sj=f6Aw>E(UoXnb(LBKU5yq~*QmwO z-_Vlk?`kP@Jz7THpq51!QIX4v#a6sc#m{JN^%pe{x)jZ)E>rWPzoG?I{$C&VMZNPY ztgcdvpsP7sOkJZEM}I?0s=uqH(Di5;b%Rhs49u-^Bis~O~CG=0Uiu#vY z72Scpul}u8M|Yw%)m>^WbPrlb-K&0p?nmpY2h@7#A@pPQuv#D8L`8WkHe2x?6K|$)^iQ;k`j=W2-GRQZ{;gI=ccL}bU1}|K4_ZgvtA2p)N9(Ew)OzS4^kem~S|2@1 zMMEo&S<#4!6X>VvN%b@IU$n7$T5W>>Lax$`ULH*K2`gm z&(VJIxf6U5?#jY*U-T6^AWWq^fnP+8F9ym z&P3cpyQ=rqZs1MZR$o)cpvlm2YI1cv z`UW~deN&x?ra~vHsnscHT6CJ4PMwZsKxe8M)mdm}D&|=6mKAfU$cp}`W>e>(InV`a zPIV#rHo91SNBs%SgZ`rCRhOXo(Pe4@bvgPj8m$&mSD;1ERccW+f@Y>-jumfNF_((0 z=#OePbsm}nU7+Sv7ou;Yi`943pU^z$FKS+O37Q{WrWR0_qwk{8Y9Vz6S_ECC7F8o? zaVpkWQNoI~RFp!0S4*qw(6ZD*BgNP2G-GNB>r9 zsQ;j~&|PY6bvIg^iZxc0uwpG0rO@Bi(&{?2EV@B0r*1^wLpQ4x)GcTw^bfVNx(%(0 z{-st^x1-h3zttM*KWHsOr(VdRT3s9zh$S$J9^M zwo)&mA5gK^iVv;WM@2pKfclYo5Ur0M zRvV~C&_?Jn^%M0t`Wbps{aihTHbGCTP1Q4KGxV(5Ts?=jL@%hV)Qe~vDlS{m)`}}s zv`4S09n|aSm*`EklX?s7jNVbZsCUtB=zX=j`T*^TKJuE^D?CqI9rYOPgFf|aU(Y^6 zzeZoE{neLf8!9ea(bkG9RJ2F0sU6ho=$GhCwUc@a?Tp@0yQp{3Zs>iryZQj_i9S+$ XsgKb<=u@??`V9RVeWCVOUxxXAkj&!5 delta 11091 zcmW;Qb+lAf8-Ve3Q3(+Q43LfwL^>pt?hXkN5b16V8ZO=49nv5majyZQba!`ygml-p zpXZO~x8|I6?yNO;_IYP!M@Hs|jLfkzGGf(Rp_rjKq4z@XhZ2Q83MC083#AOD3H>kh zX(&@DYp6k}aj03SWvET4eW+9D$55A0_fW4;pHTnMpwQ6Jh|u4mO`)x!9iiQ!eW8P) zBcbD=Q=zk=3!%%QYoQyV+mR7bsUrgEAOm~`Ss**)f;^BP3P52f1|^{kl!rTZ`2u+|lw1T!U8-9ibuo#xX3Rnee;Wzjb{(^sCGi-yMuqUu4 ztfi>8AST3t_uzd<1Rp^XNCqh(4g3#2g-nnY8bD)c1}&itw1-acBXoi8&V%LVH@m(J+L1R!BIE?r{Nr2ge!0zZo+?&5z&!p!V8X${GWcR znKY~B(A=6=ztDnOM2l-FEvpr@vi8ybI!K4=2pz5CbfQkt={ig2>U>?KOLe(k(93#F zZ|H5ks}Jz(2w;KO|Gdlt)|zE znpv}HLv5nXwUxHj4*I?Rq+PX#_SU{SKnLqE9jX85X5FScb&u}XLwZzC=xIHt7xju> z*PHsErV00YSpWK|X40&hLvw3h{Xz?B5iPEzw5(Rp%GyW!>mVJfBXqQm(}_Aor|T@8 ztMhe{F4g6FK`-kyy`i`Du0GJm`b=Ny8;ud>UReJcTjOecEv6;4jF#6*T2-s-*IHY@ z)%w~}?3cU`9&bfa$3?Yc|%23O?> zpeeL~*3b?*!Vl0HxpF=+Q5(+^F_#S?OuFwN|LthvGgJBqqgfTE4Cc#vg0sG+)9EB5b z8qUE*xB}PVCj1BY;2}JL=kN-0gaHzj8}h;zP!NhhaVQ04p#oHfub>9hf;vzSM#DIm z2vcA>%!0Wv9~Qw)}*bo=uLqhlv5<^l* z0ac+od=0hXTc{6>peeL~*3b?*!Vl0HxIb!1NX9P+`JPzZ`b2`CNapdwU( zYETotfx7S=jDhhm38umfm<>O}0$2>oU{O`^#(rGBL~w3gPpcGq6|tFF;#{X^I5-?~Y+ z>JHtl`}Ck5(c^kb&uYRjKcXW))Wn)pQ)p^Ury2A!&7#>gm*&y@T0jeHNBu!NYd7tw zk=joO>JS~SqjaoJ(8)SYXX*hxtjF}Ep3(DqNw4a^dQ0!I?W8|y7wxXS z^jBS@(fWt3*S~d>Zq*&STleWfJ)+0;l%CauVSI(WkpQ$k*?@74=rkFyUiD9C#1jheYrZB!Og*64Jo`;8Vy1S)lYwkOY!JN=O6$ zgHIt7WQ7LM7@9##Xant`6Z{BWpgZ(}KF}Wq!B7|hf5Rr&3Oiso?1O`F1dhWgI13lx zGF*cja2ryG{k^DkkO4k}ERY>?K_18t1)wk#gOX4N%0ne!zc8vF41^&t97e%dm;jSu z8q9<_Fb@{O68Htq!zH*1|H3V}1NY$(JcSqV8Y1Eb-iBE4F2sYPPy$LrIj9I#pc>SK zZ=f!G2MwVKG>2Bu7G}fGumBdrGFSntU@iOxf5Knz4{U~QuoLzK!tdrV6vB3u#?p5+ zo+i)_^ke-*lWQtXtLZhPX4Y)lP@8CTZKZ9sgMP0+X;UkRH_&dRouvMZKce^``!(X~J{~+g19hX40&hLvw3h{Xz@I3X{E0kyyRM-xl{w zDJ`oNw6gZm{yIp9>IfaJ<8-1<(djx%=jwc2q)TWO>gLJy{ixOu|Ct6`bJ}f zF%`C}G`7ao_*zU$Y8frBm9(l>*RQpD|NL->F>Hu zH|R#)qT6+s?$wAemBRYhSo*HU(**i~eypEpa!sXaHN9rk%$iLbY7=d)t+cIn(C_sp z?W#SrxAxTmI#`G4Nc~4Q>o(n~dvw1Z(xZAJ4lDC?99HHz&s@|idR=eof0`zYx3K>8 zQ_ZAVHHYTby!wR})FN73OKDlHpp~_c_SZo=R7dD&9j6m@icZ&AI#=iGB3-J>^@3j3 zYkEU(>s@`IkM)_p)HfQ#Ir)yp*0>s9i)l$Mqvf@dR@LhIwbs^ewZ1merrJVVYdf8z z^K_vu(O-0>uGT31UDxS`xV+aJIl_>O$_;tp3n&Ohpg5F*vQPmk z!&guPYC#>S2cuyeOoS;g9cIB?m=B9!DJ+LyVGTsXAFv+o!UK2=&)_Azff!*xMZE*D zAuhy+gzzCGhNO^!nH*6y%;c!*9Dfb9;ajK=ji4#C@aooF-Hzjq@B?&)ZqO4}!fJ?u z-(ekWfQ_&Pw!<#i3kTpZ9D|c^1`>p^6!igo44*)9NCjyjJ!FK;kPULe=a3J+ghJ2( zzK5TnEA)Wg&=&^4U>F7?VGN9iNiY>=zLYE8rnfe z_yIaYH|Pl~VKqd-@30Owz(&{t+hG^%g#&OHj=@Pd0|^)lAHc`(2_%P9kQUNIM#v1= zASZkd`QS?^1Rdae_zAi~59kejVE_zs)e>4-%V|ZeqSdsfexr5uI~}9rb&^ii89G~k z)&;s)m+1;!rEB#!{Zs$ad-_nH=yQD)T+7e%u=S-eHIBZg?`tCcNRwzXO{rgL4Xveh zw4OH5#@b9Z>pnfGNA$R!(zBW{44JU? zrHM7ErqI-yPBZ9dnnkl~F3qF)wSX4Zj{1Xk)^6HUBekCn)FC=tN9kCdpp$i)&eQ{X zSdZyRJ)`IKl3vw+^_Jez`}#I;3XIl~wW%U|>9ms&`RY6&f^<+P$!(P~;#ztOt- zosQA*I!UMM44th%>jGV@%XEdV(zW`V{;7ZIJ$;w$06dz diff --git a/docs/tutorial/test2/vel-00010000.vtk b/docs/tutorial/test2/vel-00010000.vtk index 1dc2015fe..99748f01c 100644 --- a/docs/tutorial/test2/vel-00010000.vtk +++ b/docs/tutorial/test2/vel-00010000.vtk @@ -1,12 +1,12 @@ # vtk DataFile Version 2.0 -Generated by vtk_extract.c +Generated by ludwig extract.c ASCII DATASET STRUCTURED_POINTS DIMENSIONS 32 32 32 ORIGIN 0 0 0 SPACING 1 1 1 POINT_DATA 32768 -VECTORS vel float +VECTORS velocity_field float -1.433729e-04 9.129210e-05 4.866202e-04 -1.544351e-04 1.043418e-04 4.716756e-04 -1.626945e-04 9.364005e-05 4.417081e-04 diff --git a/docs/tutorial/test3/col-cds00010000.csv b/docs/tutorial/test3/col-cdsvel-00010000.csv similarity index 100% rename from docs/tutorial/test3/col-cds00010000.csv rename to docs/tutorial/test3/col-cdsvel-00010000.csv diff --git a/docs/tutorial/test3/extract.sh b/docs/tutorial/test3/extract.sh new file mode 100755 index 000000000..35e35c233 --- /dev/null +++ b/docs/tutorial/test3/extract.sh @@ -0,0 +1,8 @@ +#!/bin/bash +for i in `seq 1000 1000 10000`; +do + tstep=$(printf "%08d" $i) + ./extract -k vel.001-001.meta vel-${tstep}.001-001 + ./extract -k -s -d q.001-001.meta q-${tstep}.001-001 + ./extract_colloids config.cds${tstep} 1 col-cdsvel-${tstep}.csv +done diff --git a/docs/tutorial/test3/input b/docs/tutorial/test3/input index ee2c15767..b14a143f5 100644 --- a/docs/tutorial/test3/input +++ b/docs/tutorial/test3/input @@ -1,22 +1,6 @@ ############################################################################## # -# Ludwig input file -# Reference. -# -# Lines introduced with # and blank lines are ignored. -# -# The file is made up of a series of (case-sensitive) keyword value -# pairs which should be separated by a space: -# -# keyword value -# -# Components of vector values are separated by an underscore, e.g., -# force 0.01_0.00_0.00 -# -# If a given keyword does not appear, or is commented out, a default -# value will be used. -# -# $Id: input.ref 1365 2011-05-16 13:24:17Z stratford $ +# Colloids in LC tutorial # ############################################################################## @@ -78,9 +62,6 @@ viscosity_bulk 0.833333 isothermal_fluctuations off temperature 0.000000002133333 -# ghost_modes off -# force 0.00_0.0_0.0 - ############################################################################## # # Free energy parameters @@ -117,66 +98,6 @@ free_energy lc_blue_phase fd_advection_scheme_order 2 fd_gradient_calculation 3d_7pt_solid -############################################################################### -# -# Symmetric / Brazovskii -# -# A symmetric bulk parameter (A < 0 for binary fluid) -# B symmetric bulk parameter (B = -A for binary fluid) -# kappa surface 'penalty' parameter (kappa > 0 for binary fluid) -# C additional brazovskki parameter (C = 0 for binary fluid) -# -# mobility Order parameter mobility M -# -# phi_initialisation spinodal or block [spinodal] -# noise magnitude of initial order parameter noise [default 0.05] -# phi0 mean order parameter -# -# -############################################################################### - -A -0.0625 -B 0.0625 -K 0.04 -C 0.0 - -mobility 0.15 - -noise 0.05 -phi0 0.0 -phi_initialisation spinodal - -############################################################################### -# -# Surfactant free energy; set -# -# In addition to A, B, K, of the symmrtric binary fluid, there are the -# extra parameters -# -# surf_kT bulk surfactant parameter -# surf_epsilon surface term -# surf_beta non-linear term -# surf_W entropy term -# -# surf_mobility_phi fluid order parameter mobility -# surf_mobility_psi surfactant order parameter mobility -# surf_psi_b initial uniform (background) concentration -# -############################################################################### - -surf_A -0.0208333 -surf_B 0.0208333 -surf_kappa 0.12 - -surf_kT 0.00056587 -surf_epsilon 0.03 -surf_beta 0.0 -surf_W 0.0 - -surf_mobility_phi 0.15 -surf_mobility_psi 2.0 -surf_psi_b 0.01 - ############################################################################### # # Blue Phase free energy @@ -227,7 +148,6 @@ lc_kappa1 0.01 lc_xi 0.7 lc_Gamma 0.3 -lc_active_zeta 0.0 lc_q_init_amplitude 0.2 lc_q_initialisation nematic @@ -236,27 +156,9 @@ lc_redshift_update 0 lc_init_nematic 1.0_0.0_0.0 lc_anchoring_method two -#lc_wall_anchoring normal lc_coll_anchoring normal -#lc_anchoring_strength_wall 0.006 lc_anchoring_strength_colloid 0.01 -############################################################################### -# -# polar active gel -# -############################################################################### - -polar_active_a -0.1 -polar_active_b +0.1 -polar_active_k 0.01 -polar_active_klc 0.02 -polar_active_zeta 0.0 -polar_active_lambda 0.0 - -leslie_ericksen_gamma 0.3 -leslie_ericksen_swim 0.0 - ############################################################################### # # Colloid parameters @@ -277,24 +179,8 @@ leslie_ericksen_swim 0.0 ############################################################################### colloid_init from_file -colloid_type inactive colloid_rho0 1.0 -colloid_random_no 1 -colloid_random_dh 0.4 -colloid_random_type default - -colloid_one_a0 5.0 -colloid_one_ah 5.0 -colloid_one_r 24.0_24.0_24.0 -colloid_one_isfixedr 0 - -colloid_random_v 0.0_0.0_0.0 -colloid_random_s 1.0_0.0_0.0 -colloid_random_m 1.0_0.0_0.0 -colloid_random_c 0.0 -colloid_random_h 0.0 - # Constant body force on all colloids ("gravity") [default is zero] # Uniform magnetic field [default is zero] @@ -306,8 +192,6 @@ magnetic_b0 0.0_0.0_0.0 # Colloid-colloid lubrication corrections lubrication_on 0 -lubrication_normal_cutoff 0.3 -lubrication_tangential_cutoff 0.0 ############################################################################### # @@ -322,12 +206,6 @@ soft_sphere_sigma 0.1 soft_sphere_nu 1.0 soft_sphere_cutoff 0.25 -# Lennard Jones -lennard_jones_on 0 -lj_sigma 2.3 -lj_cutoff 4.6 -lj_epsilon 0.0003 - ############################################################################### # # Walls / boundaries @@ -350,14 +228,6 @@ lj_epsilon 0.0003 ############################################################################### boundary_walls 0_0_0 -boundary_speed_bottom 0.0 -boundary_speed_top 0.0 -boundary_shear_init 0 -boundary_lubrication_rcnormal 0.1 - -#porous_media_format BINARY -#porous_media_file capillary_8_8_32.dat -#porous_media_type status_only ############################################################################### # @@ -397,7 +267,6 @@ config_at_end yes default_io_grid 1_1_1 distribution_io_grid 1_1_1 -distribution_io_input_format BINARY phi_io_grid 1_1_1 phi_format BINARY @@ -422,35 +291,6 @@ colloid_io_grid 1_1_1 colloid_io_format_input ASCII_SERIAL colloid_io_format_output ASCII -############################################################################### -# -# Lees-Edwards planes -# -# These parameters set up a number of equally spaced planes -# with constant velocity. -# -# N_LE_plane the number of planes -# LE_plane_vel the y-component of the plane velocity -# LE_init_profile set the initial velocity profile to be consistent with -# desired shear rate. (Only valid at t = 0). [0|1] -# -# LE_oscillation_period -# Integer > 1, switches on u = u_0 cos(2\pi t/T) where -# u_0 is maximum plane velocity set via LE_plane_vel, -# and T is the oscillation period -# -# LE_time_offset Integer offset to allow equilibration etc. CARE! -# This must be <= N_start and fixed for given run. -# Default is 0, ie., no offset. -# -############################################################################### - -#N_LE_plane 2 -#LE_plane_vel 0.008 -#LE_init_profile 1 -#LE_oscillation_period 0 -#LE_time_offset 0 - ############################################################################### # # Miscellaneous @@ -459,5 +299,4 @@ colloid_io_format_output ASCII # ############################################################################### -#random_seed 7361237 random_seed 8361435 diff --git a/docs/tutorial/test3/dir-q-00010000.vtk b/docs/tutorial/test3/lcd-00010000.vtk similarity index 99% rename from docs/tutorial/test3/dir-q-00010000.vtk rename to docs/tutorial/test3/lcd-00010000.vtk index a88e210d2..51ea334ee 100644 --- a/docs/tutorial/test3/dir-q-00010000.vtk +++ b/docs/tutorial/test3/lcd-00010000.vtk @@ -1,12 +1,12 @@ # vtk DataFile Version 2.0 -Generated by vtk_extract.c +Generated by ludwig extract.c ASCII DATASET STRUCTURED_POINTS DIMENSIONS 32 32 32 ORIGIN 0 0 0 SPACING 1 1 1 POINT_DATA 32768 -VECTORS director float +VECTORS Q_ab_director float 9.989947e-01 -4.375101e-02 9.769845e-03 9.980990e-01 -5.978756e-02 1.496330e-02 9.970232e-01 -7.474138e-02 1.893469e-02 @@ -456,7 +456,7 @@ VECTORS director float 9.738887e-01 1.162835e-01 -1.949844e-01 9.379623e-01 1.723747e-01 -3.008548e-01 7.655876e-01 1.546870e-01 -6.244578e-01 - 5.144329e-01 1.905670e-01 -8.360880e-01 +-5.144329e-01 -1.905670e-01 8.360880e-01 1.819038e-01 -2.025643e-01 9.622259e-01 6.600667e-01 -1.491698e-01 7.362475e-01 8.575350e-01 -1.077005e-01 5.030252e-01 @@ -488,7 +488,7 @@ VECTORS director float 9.683633e-01 7.501704e-02 -2.380019e-01 9.112877e-01 1.109703e-01 -3.965353e-01 7.509398e-01 1.124813e-02 -6.602749e-01 - 4.813181e-01 3.879987e-03 -8.765374e-01 +-4.813181e-01 -3.879987e-03 8.765374e-01 1.814932e-01 1.521817e-02 9.832744e-01 6.181566e-01 2.279795e-02 7.857243e-01 8.133803e-01 2.237945e-02 5.813017e-01 @@ -520,7 +520,7 @@ VECTORS director float 9.688127e-01 1.736539e-02 -2.471850e-01 9.094509e-01 1.664267e-02 -4.154781e-01 7.942195e-01 -1.198965e-01 -5.956847e-01 - 5.490802e-01 -1.734047e-01 -8.175829e-01 +-5.490802e-01 1.734047e-01 8.175829e-01 2.689614e-01 2.332997e-01 9.344683e-01 6.682356e-01 1.985842e-01 7.169557e-01 8.518714e-01 1.596022e-01 4.988409e-01 @@ -718,7 +718,7 @@ VECTORS director float 6.688781e-01 7.298955e-01 1.409062e-01 3.364309e-01 9.198151e-01 2.018771e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.703539e-01 -8.698886e-01 -1.485296e-01 +-4.703539e-01 8.698886e-01 1.485296e-01 7.950053e-01 -5.982672e-01 -1.002145e-01 9.460210e-01 -3.194470e-01 -5.475318e-02 9.836675e-01 -1.776901e-01 -2.871208e-02 @@ -940,7 +940,7 @@ VECTORS director float 9.690853e-01 -2.420194e-01 4.796164e-02 9.102580e-01 -4.070011e-01 7.602944e-02 7.595722e-01 -6.407506e-01 1.117531e-01 - 4.919176e-01 -8.590532e-01 1.415791e-01 +-4.919176e-01 8.590532e-01 -1.415791e-01 1.995116e-01 9.674430e-01 -1.557214e-01 6.452249e-01 7.542970e-01 -1.213297e-01 8.560776e-01 5.085666e-01 -9.214791e-02 @@ -1742,7 +1742,7 @@ VECTORS director float 6.450435e-01 7.629110e-01 -4.342430e-02 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.715431e-01 -8.791414e-01 6.897496e-02 +-4.715431e-01 8.791414e-01 -6.897496e-02 7.770835e-01 -6.266933e-01 5.828065e-02 9.341187e-01 -3.543554e-01 4.306478e-02 9.804456e-01 -1.945017e-01 2.992502e-02 @@ -1964,7 +1964,7 @@ VECTORS director float 9.676764e-01 -2.515588e-01 -1.790419e-02 9.040083e-01 -4.265276e-01 -2.903770e-02 7.437194e-01 -6.671035e-01 -4.306294e-02 - 4.718029e-01 -8.798670e-01 -5.688585e-02 +-4.718029e-01 8.798670e-01 5.688585e-02 1.901997e-01 9.795376e-01 6.580410e-02 6.261770e-01 7.777571e-01 5.473880e-02 8.223526e-01 5.673955e-01 4.240885e-02 @@ -2765,8 +2765,8 @@ VECTORS director float 8.953362e-01 4.262373e-01 -1.292084e-01 7.131001e-01 6.693978e-01 -2.083145e-01 4.032768e-01 8.577111e-01 -3.189035e-01 - 8.403152e-02 -9.321044e-01 3.523068e-01 - 5.893844e-01 -7.612663e-01 2.703695e-01 +-8.403152e-02 9.321044e-01 -3.523068e-01 +-5.893844e-01 7.612663e-01 -2.703695e-01 8.106369e-01 -5.497128e-01 2.017019e-01 9.425023e-01 -3.075991e-01 1.306608e-01 9.808224e-01 -1.762622e-01 8.318094e-02 @@ -2988,7 +2988,7 @@ VECTORS director float 9.707297e-01 -2.272924e-01 -7.760104e-02 9.166399e-01 -3.802123e-01 -1.233282e-01 7.815513e-01 -5.963312e-01 -1.832120e-01 - 5.502818e-01 -7.998244e-01 -2.397309e-01 +-5.502818e-01 7.998244e-01 2.397309e-01 2.562144e-01 9.257917e-01 2.779640e-01 6.894748e-01 6.916798e-01 2.149501e-01 8.707971e-01 4.641070e-01 1.622252e-01 @@ -3789,7 +3789,7 @@ VECTORS director float 9.336433e-01 3.089337e-01 -1.813014e-01 8.411751e-01 4.653839e-01 -2.753946e-01 6.356457e-01 6.691404e-01 -3.849748e-01 - 2.473338e-01 -8.214847e-01 5.137984e-01 +-2.473338e-01 8.214847e-01 -5.137984e-01 8.138113e-01 -4.736711e-01 3.366703e-01 9.003736e-01 -3.506186e-01 2.576704e-01 9.596754e-01 -2.227951e-01 1.714222e-01 @@ -3822,7 +3822,7 @@ VECTORS director float 6.006403e-01 5.769591e-01 -5.534884e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.394860e-01 -6.435276e-01 6.266771e-01 +-4.394860e-01 6.435276e-01 -6.266771e-01 7.243559e-01 -4.907376e-01 4.842367e-01 9.255960e-01 -2.651570e-01 2.701183e-01 9.766282e-01 -1.475363e-01 1.563023e-01 @@ -3980,7 +3980,7 @@ VECTORS director float 9.649965e-01 -1.972746e-01 -1.728131e-01 8.869672e-01 -3.470874e-01 -3.046630e-01 6.542688e-01 -5.684422e-01 -4.988043e-01 - 3.005508e-01 -7.182925e-01 -6.274752e-01 +-3.005508e-01 7.182925e-01 6.274752e-01 6.738873e-01 6.738873e-01 3.029054e-01 4.573457e-01 6.690038e-01 5.858915e-01 8.144217e-01 4.371058e-01 3.816489e-01 @@ -4876,7 +4876,7 @@ VECTORS director float 9.679814e-01 9.817050e-02 -2.310295e-01 9.038359e-01 1.576548e-01 -3.977759e-01 7.201013e-01 2.433968e-01 -6.497784e-01 - 3.873189e-01 3.530197e-01 -8.516814e-01 +-3.873189e-01 -3.530197e-01 8.516814e-01 1.397592e-01 -3.720297e-01 9.176390e-01 5.980965e-01 -2.672418e-01 7.555544e-01 8.038117e-01 -1.961464e-01 5.616168e-01 @@ -4907,7 +4907,7 @@ VECTORS director float 9.880813e-01 1.928812e-02 -1.527199e-01 9.650510e-01 3.064375e-02 -2.602643e-01 8.877875e-01 4.842085e-02 -4.576994e-01 - 6.456494e-01 7.258042e-02 -7.601769e-01 +-6.456494e-01 -7.258042e-02 7.601769e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 4.990132e-01 -7.766579e-02 8.631071e-01 @@ -4939,7 +4939,7 @@ VECTORS director float 9.881375e-01 -2.673048e-02 -1.512273e-01 9.652044e-01 -4.498486e-02 -2.575984e-01 8.884187e-01 -7.518652e-02 -4.528346e-01 - 6.465247e-01 -1.192276e-01 -7.535188e-01 +-6.465247e-01 1.192276e-01 7.535188e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 5.045327e-01 1.361759e-01 8.525860e-01 @@ -4972,7 +4972,7 @@ VECTORS director float 9.689540e-01 -1.051805e-01 -2.237525e-01 9.077419e-01 -1.712611e-01 -3.829807e-01 7.336065e-01 -2.713944e-01 -6.230302e-01 - 4.030263e-01 -4.069441e-01 -8.197355e-01 +-4.030263e-01 4.069441e-01 8.197355e-01 1.621177e-01 4.328247e-01 8.867810e-01 6.292408e-01 3.108623e-01 7.123346e-01 8.538876e-01 2.230109e-01 4.702576e-01 @@ -19591,7 +19591,7 @@ VECTORS director float 9.411463e-01 1.737993e-01 2.898922e-01 9.095722e-01 2.124615e-01 3.571254e-01 9.791129e-01 1.029616e-01 1.753192e-01 - 6.425004e-01 -2.171271e-01 -7.348803e-01 +-6.425004e-01 2.171271e-01 7.348803e-01 8.520048e-01 -1.576188e-01 -4.992436e-01 9.380485e-01 -1.042591e-01 -3.304467e-01 9.756003e-01 -6.495909e-02 -2.097244e-01 @@ -19623,7 +19623,7 @@ VECTORS director float 8.932117e-01 1.361756e-01 4.285196e-01 7.306247e-01 1.973761e-01 6.536285e-01 3.106738e-01 2.726169e-01 9.105832e-01 - 5.114550e-01 -5.646925e-02 -8.574526e-01 +-5.114550e-01 5.646925e-02 8.574526e-01 7.698356e-01 -4.095637e-02 -6.369268e-01 9.142041e-01 -2.298990e-02 -4.046014e-01 9.702197e-01 -1.134608e-02 -2.419606e-01 @@ -19655,7 +19655,7 @@ VECTORS director float 8.683670e-01 3.793354e-02 4.944692e-01 6.519979e-01 5.470322e-02 7.562449e-01 1.860560e-01 6.868966e-02 9.801351e-01 - 5.139850e-01 1.348415e-01 -8.471347e-01 +-5.139850e-01 -1.348415e-01 8.471347e-01 7.699129e-01 1.077560e-01 -6.289855e-01 9.134322e-01 7.652525e-02 -3.997318e-01 9.696081e-01 5.091212e-02 -2.393074e-01 @@ -20583,7 +20583,7 @@ VECTORS director float 9.327948e-01 2.799304e-01 2.270086e-01 8.920322e-01 3.536066e-01 2.814975e-01 9.659879e-01 2.005170e-01 1.632799e-01 - 4.358498e-01 -5.759265e-01 -6.916239e-01 +-4.358498e-01 5.759265e-01 6.916239e-01 7.451484e-01 -4.014840e-01 -5.325077e-01 9.190564e-01 -2.451424e-01 -3.086108e-01 9.720699e-01 -1.464881e-01 -1.833611e-01 @@ -21575,7 +21575,7 @@ VECTORS director float 9.558961e-01 2.736516e-01 1.066654e-01 9.488404e-01 2.945876e-01 1.136667e-01 9.941498e-01 9.959108e-02 4.180610e-02 - 5.350734e-01 -7.613328e-01 -3.661542e-01 +-5.350734e-01 7.613328e-01 3.661542e-01 7.805848e-01 -5.662182e-01 -2.647343e-01 9.282227e-01 -3.313937e-01 -1.690589e-01 9.741225e-01 -1.992322e-01 -1.067328e-01 @@ -22599,7 +22599,7 @@ VECTORS director float 9.333376e-01 3.543346e-01 5.768760e-02 9.096707e-01 4.100387e-01 6.608641e-02 9.704722e-01 2.374417e-01 4.248683e-02 - 3.757093e-01 -9.023194e-01 -2.113343e-01 +-3.757093e-01 9.023194e-01 2.113343e-01 7.168853e-01 -6.843356e-01 -1.332675e-01 9.071538e-01 -4.125067e-01 -8.312720e-02 9.698566e-01 -2.380717e-01 -5.196302e-02 @@ -22853,7 +22853,7 @@ VECTORS director float 9.849424e-01 -1.635036e-01 5.617056e-02 9.561460e-01 -2.804686e-01 8.439242e-02 8.660192e-01 -4.840213e-01 1.254359e-01 - 6.075955e-01 -7.786300e-01 1.567263e-01 +-6.075955e-01 7.786300e-01 -1.567263e-01 5.055116e-02 9.860820e-01 -1.583882e-01 9.158089e-01 4.013970e-01 1.320626e-02 9.210894e-01 3.893043e-01 -6.041011e-03 @@ -23624,7 +23624,7 @@ VECTORS director float 9.012127e-01 4.329919e-01 -1.826666e-02 9.481741e-01 3.176335e-01 -8.646866e-03 6.738873e-01 6.738873e-01 3.029054e-01 - 6.653234e-01 -7.449537e-01 4.887412e-02 +-6.653234e-01 7.449537e-01 -4.887412e-02 8.960120e-01 -4.427052e-01 3.427185e-02 9.678416e-01 -2.506957e-01 2.084151e-02 9.892825e-01 -1.455606e-01 1.149788e-02 @@ -23877,7 +23877,7 @@ VECTORS director float 9.868394e-01 -1.615175e-01 7.755161e-03 9.577964e-01 -2.873922e-01 5.628302e-03 8.391000e-01 -5.439350e-01 -6.770068e-03 - 5.738967e-01 -8.184506e-01 -2.794883e-02 +-5.738967e-01 8.184506e-01 2.794883e-02 1.221117e-01 9.900745e-01 6.957852e-02 8.844206e-01 4.561683e-01 9.854265e-02 8.987511e-01 4.314208e-01 7.824682e-02 @@ -24647,7 +24647,7 @@ VECTORS director float 9.405381e-01 3.287870e-01 -8.536548e-02 9.308785e-01 3.542301e-01 -8.936623e-02 9.914383e-01 1.278584e-01 -2.650076e-02 - 4.022796e-01 -8.570645e-01 3.218875e-01 +-4.022796e-01 8.570645e-01 -3.218875e-01 7.280948e-01 -6.496107e-01 2.188239e-01 9.075855e-01 -3.957624e-01 1.402165e-01 9.698290e-01 -2.279900e-01 8.632637e-02 @@ -24901,7 +24901,7 @@ VECTORS director float 9.905895e-01 -1.320445e-01 -3.601057e-02 9.719250e-01 -2.269476e-01 -6.210072e-02 9.119810e-01 -3.952127e-01 -1.099894e-01 - 6.788994e-01 -7.088338e-01 -1.914426e-01 +-6.788994e-01 7.088338e-01 1.914426e-01 3.007548e-01 9.118515e-01 2.794162e-01 8.705085e-01 4.575054e-01 1.813940e-01 8.862026e-01 4.338147e-01 1.626340e-01 @@ -25065,7 +25065,7 @@ VECTORS director float 9.472062e-01 9.763085e-02 3.053991e-01 8.841076e-01 3.036903e-02 4.662955e-01 7.466813e-01 2.746923e-02 6.646146e-01 - 5.240023e-02 9.110321e-03 -9.985846e-01 +-5.240023e-02 -9.110321e-03 9.985846e-01 8.052043e-01 4.100113e-02 -5.915783e-01 9.128139e-01 3.947187e-02 -4.064637e-01 9.626694e-01 3.384857e-02 -2.685551e-01 @@ -25671,7 +25671,7 @@ VECTORS director float 9.629645e-01 2.424751e-01 -1.179201e-01 9.627215e-01 2.453358e-01 -1.139197e-01 9.975227e-01 6.662075e-02 -2.258523e-02 - 6.265132e-01 -6.652100e-01 4.061734e-01 +-6.265132e-01 6.652100e-01 -4.061734e-01 8.481301e-01 -4.421538e-01 2.918482e-01 9.390084e-01 -2.840626e-01 1.938340e-01 9.761073e-01 -1.781854e-01 1.243566e-01 @@ -25893,7 +25893,7 @@ VECTORS director float 9.869841e-01 -1.125063e-01 -1.149121e-01 9.580784e-01 -2.082848e-01 -1.967312e-01 8.550216e-01 -3.857882e-01 -3.465624e-01 - 4.979501e-01 -6.564351e-01 -5.666909e-01 +-4.979501e-01 6.564351e-01 5.666909e-01 8.993963e-02 7.622363e-01 6.410200e-01 7.637784e-01 5.604782e-01 3.201667e-01 8.258426e-01 4.883048e-01 2.820325e-01 @@ -26026,7 +26026,7 @@ VECTORS director float 7.778949e-01 3.465159e-01 5.242196e-01 4.810914e-01 4.757701e-01 7.363381e-01 6.535750e-02 5.229194e-01 8.498728e-01 - 5.942781e-01 -3.632437e-01 -7.175567e-01 +-5.942781e-01 3.632437e-01 7.175567e-01 8.737027e-01 -2.101465e-01 -4.387277e-01 9.600526e-01 -1.138719e-01 -2.556018e-01 9.860310e-01 -6.169874e-02 -1.547128e-01 @@ -26058,7 +26058,7 @@ VECTORS director float 6.641423e-01 1.996544e-01 7.204534e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.144973e-01 -2.581699e-01 -8.726628e-01 +-4.144973e-01 2.581699e-01 8.726628e-01 7.598581e-01 -1.442414e-01 -6.338849e-01 9.347560e-01 -6.921295e-02 -3.484836e-01 9.795892e-01 -3.187063e-02 -1.984675e-01 @@ -26122,7 +26122,7 @@ VECTORS director float 7.113170e-01 -1.779827e-01 6.799635e-01 3.427260e-01 -2.867997e-01 8.945864e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.235476e-01 2.831205e-01 -8.604942e-01 +-4.235476e-01 -2.831205e-01 8.604942e-01 7.506789e-01 1.939868e-01 -6.315460e-01 9.268548e-01 1.259548e-01 -3.536602e-01 9.755407e-01 8.234399e-02 -2.038134e-01 @@ -26153,7 +26153,7 @@ VECTORS director float 9.048276e-01 -1.033931e-01 4.130338e-01 8.361202e-01 -2.647471e-01 4.804289e-01 5.539661e-01 -3.992465e-01 7.305640e-01 - 1.217263e-01 5.253901e-01 -8.421092e-01 +-1.217263e-01 -5.253901e-01 8.421092e-01 6.194050e-01 4.002652e-01 -6.753704e-01 8.463629e-01 2.890494e-01 -4.473481e-01 9.443331e-01 1.879144e-01 -2.700430e-01 @@ -26758,7 +26758,7 @@ VECTORS director float 9.484489e-01 1.903809e-01 -2.533766e-01 8.637592e-01 2.927214e-01 -4.101637e-01 6.829954e-01 4.003968e-01 -6.109006e-01 - 1.765980e-01 5.308099e-01 -8.288872e-01 +-1.765980e-01 -5.308099e-01 8.288872e-01 4.108255e-01 -3.373794e-01 8.469932e-01 7.254517e-01 -2.250427e-01 6.504427e-01 9.054980e-01 -1.410213e-01 4.002329e-01 @@ -26789,8 +26789,8 @@ VECTORS director float 9.750127e-01 9.605391e-02 -2.003096e-01 9.274184e-01 1.479571e-01 -3.435168e-01 7.659760e-01 2.290960e-01 -6.006627e-01 - 4.911800e-01 3.314264e-01 -8.055425e-01 - 6.716914e-02 3.725854e-01 -9.255639e-01 +-4.911800e-01 -3.314264e-01 8.055425e-01 +-6.716914e-02 -3.725854e-01 9.255639e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.572580e-01 -5.276258e-02 7.518165e-01 8.901613e-01 -2.981951e-02 4.546688e-01 @@ -26853,7 +26853,7 @@ VECTORS director float 9.770021e-01 -1.404780e-02 -2.127664e-01 9.252648e-01 -4.181798e-02 -3.770097e-01 7.588395e-01 -9.678498e-02 -6.440461e-01 - 4.215886e-01 -1.886559e-01 -8.869453e-01 +-4.215886e-01 1.886559e-01 8.869453e-01 6.738873e-01 6.738873e-01 3.029054e-01 4.627154e-01 4.276098e-01 7.765593e-01 7.294601e-01 3.088159e-01 6.103448e-01 @@ -26885,7 +26885,7 @@ VECTORS director float 9.843220e-01 -5.048989e-02 -1.690001e-01 9.553845e-01 -9.843175e-02 -2.784809e-01 8.707652e-01 -1.792205e-01 -4.578733e-01 - 6.041509e-01 -3.104360e-01 -7.339149e-01 +-6.041509e-01 3.104360e-01 7.339149e-01 3.926006e-02 4.664551e-01 8.836732e-01 7.632377e-01 4.521608e-01 4.615396e-01 8.381489e-01 3.763264e-01 3.948225e-01 @@ -27018,7 +27018,7 @@ VECTORS director float 7.578197e-01 5.323077e-01 3.773034e-01 4.736750e-01 7.044822e-01 5.285232e-01 1.178436e-01 7.899662e-01 6.017195e-01 - 4.837426e-01 -6.919284e-01 -5.359368e-01 +-4.837426e-01 6.919284e-01 5.359368e-01 8.670392e-01 -3.951478e-01 -3.034820e-01 9.632412e-01 -2.096047e-01 -1.680248e-01 9.882116e-01 -1.165695e-01 -9.924429e-02 @@ -27208,7 +27208,7 @@ VECTORS director float 9.689462e-01 -1.574956e-01 1.906263e-01 8.911867e-01 -2.979338e-01 3.420844e-01 8.230503e-01 -4.520572e-01 3.438495e-01 - 4.569851e-01 -7.085157e-01 5.377453e-01 +-4.569851e-01 7.085157e-01 -5.377453e-01 1.415648e-01 7.949321e-01 -5.899512e-01 5.512649e-01 6.750510e-01 -4.903195e-01 8.263601e-01 4.677909e-01 -3.135294e-01 @@ -28231,7 +28231,7 @@ VECTORS director float 9.913072e-01 -1.094097e-01 7.307177e-02 9.675122e-01 -2.164436e-01 1.306609e-01 8.578499e-01 -4.563276e-01 2.363446e-01 - 6.786979e-01 -6.914239e-01 2.475926e-01 +-6.786979e-01 6.914239e-01 -2.475926e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 @@ -29034,7 +29034,7 @@ VECTORS director float 8.132862e-01 5.786038e-01 6.150739e-02 5.907644e-01 8.036848e-01 7.133178e-02 1.864033e-01 9.802148e-01 6.657964e-02 - 6.148043e-01 -7.885287e-01 -1.543225e-02 +-6.148043e-01 7.885287e-01 1.543225e-02 8.955052e-01 -4.449322e-01 1.028438e-02 9.647435e-01 -2.628602e-01 1.320748e-02 9.875638e-01 -1.567301e-01 1.238664e-02 @@ -29255,7 +29255,7 @@ VECTORS director float 9.927666e-01 -1.190780e-01 1.532747e-02 9.706921e-01 -2.386548e-01 2.829801e-02 8.671458e-01 -4.955953e-01 4.943172e-02 - 6.618664e-01 -7.475653e-01 5.548913e-02 +-6.618664e-01 7.475653e-01 -5.548913e-02 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 @@ -29288,7 +29288,7 @@ VECTORS director float 9.728525e-01 -2.300958e-01 2.477861e-02 9.017293e-01 -4.304837e-01 3.959763e-02 8.902771e-01 -4.528215e-01 4.857353e-02 - 5.873195e-01 -8.073275e-01 5.725537e-02 +-5.873195e-01 8.073275e-01 -5.725537e-02 3.580360e-01 9.333114e-01 -2.720376e-02 6.646129e-01 7.471109e-01 -1.072359e-02 8.460510e-01 5.331017e-01 4.787282e-04 @@ -30058,7 +30058,7 @@ VECTORS director float 8.366910e-01 5.439107e-01 -6.410400e-02 6.283337e-01 7.717831e-01 -9.771198e-02 1.432210e-01 9.783937e-01 -1.491090e-01 - 6.700726e-01 -7.268176e-01 1.507940e-01 +-6.700726e-01 7.268176e-01 -1.507940e-01 8.960314e-01 -4.303384e-01 1.092548e-01 9.619713e-01 -2.619281e-01 7.749058e-02 9.857903e-01 -1.588848e-01 5.452619e-02 @@ -30279,7 +30279,7 @@ VECTORS director float 9.925787e-01 -1.123462e-01 -4.653963e-02 9.708312e-01 -2.253141e-01 -8.197745e-02 8.689886e-01 -4.722249e-01 -1.478599e-01 - 6.723711e-01 -7.253399e-01 -1.476455e-01 +-6.723711e-01 7.253399e-01 1.476455e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 @@ -30312,7 +30312,7 @@ VECTORS director float 9.751213e-01 -2.158094e-01 -5.064321e-02 9.099884e-01 -4.054084e-01 -8.697825e-02 9.143870e-01 -4.018615e-01 -4.902726e-02 - 6.739817e-01 -7.309617e-01 -1.069745e-01 +-6.739817e-01 7.309617e-01 1.069745e-01 4.669842e-01 8.698872e-01 1.588143e-01 6.884026e-01 7.122738e-01 1.369961e-01 8.433437e-01 5.261860e-01 1.090858e-01 @@ -30477,7 +30477,7 @@ VECTORS director float 9.281443e-01 1.521219e-01 3.397161e-01 8.341718e-01 2.119866e-01 5.091355e-01 6.349068e-01 2.630178e-01 7.264399e-01 - 1.235465e-01 -2.972390e-01 -9.467762e-01 +-1.235465e-01 2.972390e-01 9.467762e-01 7.413655e-01 -1.754074e-01 -6.477726e-01 9.070278e-01 -1.057656e-01 -4.075712e-01 9.648894e-01 -6.471208e-02 -2.545600e-01 @@ -30509,8 +30509,8 @@ VECTORS director float 9.098215e-01 5.437146e-02 4.114227e-01 7.622311e-01 7.361055e-02 6.431059e-01 5.135576e-01 8.576345e-02 8.537583e-01 - 1.431054e-01 -7.958714e-02 -9.865023e-01 - 6.568053e-01 -4.706517e-02 -7.525900e-01 +-1.431054e-01 7.958714e-02 9.865023e-01 +-6.568053e-01 4.706517e-02 7.525900e-01 8.774248e-01 -2.265370e-02 -4.791790e-01 9.553499e-01 -9.717770e-03 -2.953169e-01 9.834349e-01 -2.942612e-03 -1.812375e-01 @@ -30541,8 +30541,8 @@ VECTORS director float 9.122152e-01 -5.429001e-02 4.060984e-01 7.663616e-01 -8.463115e-02 6.368104e-01 5.116295e-01 -1.128356e-01 8.517649e-01 - 1.768232e-01 1.410008e-01 -9.740905e-01 - 6.596418e-01 1.159866e-01 -7.425764e-01 +-1.768232e-01 -1.410008e-01 9.740905e-01 +-6.596418e-01 -1.159866e-01 7.425764e-01 8.754157e-01 8.501908e-02 -4.758352e-01 9.541032e-01 5.930947e-02 -2.935465e-01 9.827784e-01 4.058129e-02 -1.802771e-01 @@ -30573,7 +30573,7 @@ VECTORS director float 9.371181e-01 -1.327583e-01 3.227767e-01 8.531490e-01 -1.957072e-01 4.835654e-01 6.493644e-01 -2.640649e-01 7.131588e-01 - 3.244270e-01 3.367948e-01 -8.839210e-01 +-3.244270e-01 -3.367948e-01 8.839210e-01 7.431856e-01 2.428672e-01 -6.234506e-01 9.006583e-01 1.687611e-01 -4.004177e-01 9.614482e-01 1.141882e-01 -2.501568e-01 @@ -31114,7 +31114,7 @@ VECTORS director float 6.999272e-01 6.392472e-01 -3.185356e-01 3.482877e-01 8.101406e-01 -4.715590e-01 6.738873e-01 6.738873e-01 3.029054e-01 - 4.197652e-01 -7.781623e-01 4.671836e-01 +-4.197652e-01 7.781623e-01 -4.671836e-01 7.624353e-01 -5.664751e-01 3.127272e-01 9.334635e-01 -3.035320e-01 1.910870e-01 9.784936e-01 -1.689424e-01 1.183587e-01 @@ -31304,7 +31304,7 @@ VECTORS director float 9.707886e-01 -1.748318e-01 -1.643272e-01 8.966539e-01 -3.337136e-01 -2.909416e-01 7.579402e-01 -5.791608e-01 -3.001656e-01 - 3.714066e-01 -8.025085e-01 -4.669446e-01 +-3.714066e-01 8.025085e-01 4.669446e-01 1.749209e-01 8.522606e-01 4.930056e-01 5.069569e-01 7.473022e-01 4.295744e-01 7.458753e-01 5.965089e-01 2.963903e-01 @@ -31469,7 +31469,7 @@ VECTORS director float 8.977191e-01 3.053015e-01 3.176342e-01 7.164830e-01 4.522723e-01 5.311326e-01 4.444460e-01 5.976687e-01 6.672780e-01 - 8.365112e-03 -6.604987e-01 -7.507806e-01 +-8.365112e-03 6.604987e-01 7.507806e-01 5.499392e-01 -5.419289e-01 -6.355155e-01 8.610500e-01 -3.132802e-01 -4.005601e-01 9.577437e-01 -1.731149e-01 -2.296917e-01 @@ -31628,8 +31628,8 @@ VECTORS director float 9.709626e-01 -1.644607e-01 1.737365e-01 9.215721e-01 -2.681613e-01 2.807033e-01 7.917141e-01 -4.236216e-01 4.401517e-01 - 4.482037e-01 -6.224115e-01 6.416521e-01 - 1.392486e-01 6.909357e-01 -7.093784e-01 +-4.482037e-01 6.224115e-01 -6.416521e-01 +-1.392486e-01 -6.909357e-01 7.093784e-01 5.769043e-01 5.707991e-01 -5.842686e-01 8.582467e-01 3.592976e-01 -3.664939e-01 9.520429e-01 2.156224e-01 -2.170744e-01 @@ -32137,7 +32137,7 @@ VECTORS director float 9.646374e-01 2.277554e-01 -1.326732e-01 8.267869e-01 4.321174e-01 -3.601362e-01 5.803280e-01 6.314369e-01 -5.143023e-01 - 8.439295e-02 -7.316890e-01 6.763942e-01 +-8.439295e-02 7.316890e-01 -6.763942e-01 7.364994e-01 -4.819887e-01 4.746109e-01 8.886615e-01 -3.218241e-01 3.266648e-01 9.566940e-01 -1.999576e-01 2.115502e-01 @@ -32296,7 +32296,7 @@ VECTORS director float 9.650486e-01 -7.251869e-02 -2.518379e-01 8.818711e-01 -1.478654e-01 -4.477043e-01 6.776364e-01 -4.332438e-01 -5.942295e-01 - 3.018906e-01 -5.712052e-01 -7.632737e-01 +-3.018906e-01 5.712052e-01 7.632737e-01 6.738873e-01 6.738873e-01 3.029054e-01 4.365037e-01 5.397769e-01 7.197954e-01 7.394983e-01 3.887734e-01 5.495431e-01 @@ -32462,7 +32462,7 @@ VECTORS director float 7.312758e-01 6.273001e-01 2.678250e-01 5.189127e-01 7.824555e-01 3.442281e-01 5.423070e-02 8.932256e-01 4.463261e-01 - 6.386509e-01 -7.013641e-01 -3.165650e-01 +-6.386509e-01 7.013641e-01 3.165650e-01 8.876442e-01 -4.133028e-01 -2.031468e-01 9.645975e-01 -2.345155e-01 -1.206403e-01 9.878238e-01 -1.379541e-01 -7.192150e-02 @@ -32651,7 +32651,7 @@ VECTORS director float 9.876498e-01 -1.306040e-01 8.654755e-02 9.617539e-01 -2.296589e-01 1.492855e-01 8.697598e-01 -4.151028e-01 2.668474e-01 - 6.068296e-01 -6.633336e-01 4.378885e-01 +-6.068296e-01 6.633336e-01 -4.378885e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 6.738873e-01 6.738873e-01 3.029054e-01 @@ -32684,7 +32684,7 @@ VECTORS director float 9.745131e-01 -2.017625e-01 9.806181e-02 9.363210e-01 -3.172841e-01 1.504452e-01 8.511048e-01 -4.774893e-01 2.182308e-01 - 6.406978e-01 -7.105592e-01 2.908813e-01 +-6.406978e-01 7.105592e-01 -2.908813e-01 3.354769e-01 8.749702e-01 -3.491166e-01 7.362192e-01 6.287854e-01 -2.502202e-01 8.947531e-01 4.110083e-01 -1.746112e-01 diff --git a/docs/tutorial/test3/op-q-00010000.vtk b/docs/tutorial/test3/lcs-00010000.vtk similarity index 99% rename from docs/tutorial/test3/op-q-00010000.vtk rename to docs/tutorial/test3/lcs-00010000.vtk index 0ac0ad103..bd577f88e 100644 --- a/docs/tutorial/test3/op-q-00010000.vtk +++ b/docs/tutorial/test3/lcs-00010000.vtk @@ -1,12 +1,12 @@ # vtk DataFile Version 2.0 -Generated by vtk_extract.c +Generated by ludwig extract.c ASCII DATASET STRUCTURED_POINTS DIMENSIONS 32 32 32 ORIGIN 0 0 0 SPACING 1 1 1 POINT_DATA 32768 -SCALARS scalar_op float 1 +SCALARS Q_ab_scalar_order float 1 LOOKUP_TABLE default 3.508007e-01 3.506645e-01 diff --git a/docs/tutorial/test3/stdout b/docs/tutorial/test3/stdout index 9894eafd3..76443b5bd 100644 --- a/docs/tutorial/test3/stdout +++ b/docs/tutorial/test3/stdout @@ -1,8 +1,14 @@ -Welcome to Ludwig v0.8.9 (MPI version running on 8 processes) +Welcome to Ludwig v0.15.0 (MPI version running on 8 processes) +Start time: Mon Jan 31 12:36:50 2022 -Note assertions via standard C assert() are on. +Compiler: + name: Gnu 11.2.0 + version-string: 11.2.0 -Read 110 user parameters from input +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. + +Read 59 user parameters from input System details -------------- @@ -64,7 +70,7 @@ External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 Lattice Boltzmann distributions ------------------------------- Model: d3q19 -SIMD vector len: 1 +SIMD vector len: 4 Number of sets: 1 Halo type: full Input format: binary @@ -142,8 +148,8 @@ Scalars - total mean variance min max [phi] 0.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 Momentum - x y z -[total ] 4.4732273e-13 0.0000000e+00 0.0000000e+00 -[fluid ] 4.4732273e-13 0.0000000e+00 0.0000000e+00 +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 [colloids] 0.0000000e+00 0.0000000e+00 0.0000000e+00 Starting time step loop. @@ -168,7 +174,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 250 -2.5691473794e+01 3.2234000000e+04 -7.9703027219e-04 2.8008994219e-01 6.8400000000e+02 4.0948821958e-04 Momentum - x y z -[total ] 1.1587302e-13 -2.9315959e-14 2.6305997e-13 +[total ] 1.1414524e-13 -2.8819828e-14 2.6448592e-13 [fluid ] -7.5874217e-04 -4.1757017e-03 3.3845278e-03 [colloids] 7.5874217e-04 4.1757017e-03 -3.3845278e-03 @@ -187,7 +193,7 @@ Colloid velocities - x y z [maximum ] 1.1009094e-05 1.2205180e-05 3.4221517e-06 Scalars - total mean variance min max -[rho] 32234.00 1.00000000000 2.0094514e-08 0.99894219945 1.00179207493 +[rho] 32234.00 1.00000000000 2.0094513e-08 0.99894219945 1.00179207493 [phi] 1.1176517e+04 3.4673068e-01 7.1288812e-04 -1.0440897e-01 3.5952694e-01 [phi] 3.0706484e+00 9.5261166e-05 3.0226581e-04 -2.4222051e-01 2.4210291e-01 [phi] 2.2232501e-01 6.8972207e-06 3.0268398e-04 -2.4120491e-01 2.4436719e-01 @@ -198,7 +204,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 500 -2.5876558501e+01 3.2234000000e+04 -8.0277218158e-04 2.4200427209e-01 6.8400000000e+02 3.5380741533e-04 Momentum - x y z -[total ] -4.8068537e-14 -4.7007754e-14 1.7194406e-13 +[total ] -4.7794668e-14 -4.3847087e-14 1.7173936e-13 [fluid ] 1.3802415e-03 -5.0044766e-04 2.6229366e-03 [colloids] -1.3802415e-03 5.0044766e-04 -2.6229366e-03 @@ -228,7 +234,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 750 -2.5879557278e+01 3.2234000000e+04 -8.0286521306e-04 2.1159203316e-01 6.8400000000e+02 3.0934507772e-04 Momentum - x y z -[total ] 5.4424781e-15 -1.0865028e-13 1.6002716e-13 +[total ] 8.0931355e-15 -1.0867457e-13 1.5948267e-13 [fluid ] 6.5984198e-04 1.2106605e-03 -4.4205716e-04 [colloids] -6.5984198e-04 -1.2106605e-03 4.4205716e-04 @@ -253,7 +259,7 @@ Writing q file at step 1000! Writing velocity output at step 1000! Scalars - total mean variance min max -[rho] 32235.00 1.00000000000 1.0408425e-08 0.99943742846 1.00171413626 +[rho] 32235.00 1.00000000000 1.0408426e-08 0.99943742846 1.00171413626 [phi] 1.1157969e+04 3.4614452e-01 8.8380803e-04 -1.1020020e-01 3.6174636e-01 [phi] 4.9202215e+00 1.5263600e-04 4.3944164e-04 -2.4903429e-01 2.4729904e-01 [phi] -5.3074466e-02 -1.6464857e-06 4.3548989e-04 -2.4804892e-01 2.5086585e-01 @@ -264,7 +270,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 1000 -2.5879520755e+01 3.2235000000e+04 -8.0283917343e-04 1.8782940399e-01 6.8400000000e+02 2.7460439180e-04 Momentum - x y z -[total ] 1.0039517e-13 2.2963836e-14 1.4935102e-14 +[total ] 9.7522576e-14 2.4594476e-14 1.5507561e-14 [fluid ] -3.8461110e-04 1.6423911e-03 -2.8992428e-03 [colloids] 3.8461110e-04 -1.6423911e-03 2.8992428e-03 @@ -294,7 +300,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 1250 -2.5878641887e+01 3.2235000000e+04 -8.0281190901e-04 1.6946022053e-01 6.8400000000e+02 2.4774886043e-04 Momentum - x y z -[total ] 2.7348805e-13 -1.0778184e-13 1.1012285e-13 +[total ] 2.7143066e-13 -1.0661264e-13 1.1013022e-13 [fluid ] 4.3257648e-04 2.7088548e-03 -3.1890322e-03 [colloids] -4.3257648e-04 -2.7088548e-03 3.1890322e-03 @@ -324,7 +330,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 1500 -2.5874942269e+01 3.2232000000e+04 -8.0277185000e-04 1.5785283156e-01 6.8600000000e+02 2.3010616846e-04 Momentum - x y z -[total ] 2.2721235e-13 -1.7080131e-13 2.8413535e-13 +[total ] 2.2619233e-13 -1.7156805e-13 2.8452761e-13 [fluid ] 3.8834213e-03 2.6430459e-03 2.1299695e-04 [colloids] -3.8834213e-03 -2.6430459e-03 -2.1299695e-04 @@ -354,7 +360,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 1750 -2.5873445255e+01 3.2231000000e+04 -8.0275031041e-04 1.4822886849e-01 6.8800000000e+02 2.1544893676e-04 Momentum - x y z -[total ] -3.0776943e-13 -3.6028775e-13 3.7025851e-13 +[total ] -3.0985804e-13 -3.5989874e-13 3.7025851e-13 [fluid ] 3.9291552e-03 2.2622076e-03 2.0750633e-03 [colloids] -3.9291552e-03 -2.2622076e-03 -2.0750633e-03 @@ -390,7 +396,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 2000 -2.5873284535e+01 3.2231000000e+04 -8.0274532391e-04 1.4047710787e-01 6.9000000000e+02 2.0359001140e-04 Momentum - x y z -[total ] -3.2200241e-13 -1.3378404e-13 5.5623236e-13 +[total ] -3.2314017e-13 -1.3293056e-13 5.5581960e-13 [fluid ] -5.2337543e-04 -9.8616034e-04 7.7906140e-04 [colloids] 5.2337543e-04 9.8616034e-04 -7.7906140e-04 @@ -420,7 +426,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 2250 -2.5873157712e+01 3.2231000000e+04 -8.0274138911e-04 1.3586798102e-01 6.9000000000e+02 1.9691011743e-04 Momentum - x y z -[total ] -5.1725074e-13 -4.5579534e-14 5.6882374e-13 +[total ] -5.1743809e-13 -4.4566428e-14 5.6869537e-13 [fluid ] 1.4568926e-03 -1.8194471e-04 7.1839940e-04 [colloids] -1.4568926e-03 1.8194471e-04 -7.1839939e-04 @@ -450,7 +456,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 2500 -2.5873056375e+01 3.2231000000e+04 -8.0273824500e-04 1.3266211536e-01 6.9000000000e+02 1.9226393530e-04 Momentum - x y z -[total ] -9.2982826e-13 3.7375430e-14 4.5067075e-13 +[total ] -9.2764555e-13 3.8572390e-14 4.4909215e-13 [fluid ] 3.7343991e-03 -2.7461661e-04 2.9228500e-03 [colloids] -3.7343991e-03 2.7461661e-04 -2.9228500e-03 @@ -469,7 +475,7 @@ Colloid velocities - x y z [maximum ] 3.9643357e-06 1.0102794e-06 1.4727277e-06 Scalars - total mean variance min max -[rho] 32231.00 1.00000000000 4.5006920e-09 0.99941970686 1.00150847223 +[rho] 32231.00 1.00000000000 4.5006918e-09 0.99941970686 1.00150847223 [phi] 1.1110375e+04 3.4471082e-01 1.1694828e-03 -1.2372763e-01 3.6274698e-01 [phi] 1.5690690e+01 4.8681983e-04 6.5876359e-04 -2.5452471e-01 2.5487247e-01 [phi] 3.6779165e+00 1.1411115e-04 6.4183770e-04 -2.5465680e-01 2.5760706e-01 @@ -480,7 +486,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 2750 -2.5872445933e+01 3.2231000000e+04 -8.0271930542e-04 1.2914828530e-01 6.9200000000e+02 1.8663047008e-04 Momentum - x y z -[total ] -6.0621907e-13 1.0963946e-13 5.6036556e-13 +[total ] -6.0252389e-13 1.1039932e-13 5.6031004e-13 [fluid ] 1.2561046e-03 -4.0745269e-04 2.9737728e-04 [colloids] -1.2561046e-03 4.0745269e-04 -2.9737728e-04 @@ -516,7 +522,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 3000 -2.5872227347e+01 3.2231000000e+04 -8.0271252358e-04 1.2673938406e-01 6.9200000000e+02 1.8314939894e-04 Momentum - x y z -[total ] -3.5396003e-13 2.1231671e-13 7.7220576e-13 +[total ] -3.5621170e-13 2.1168874e-13 7.7186228e-13 [fluid ] 8.5588580e-04 -1.9087081e-04 -6.1963585e-04 [colloids] -8.5588580e-04 1.9087081e-04 6.1963585e-04 @@ -535,7 +541,7 @@ Colloid velocities - x y z [maximum ] 2.7344714e-06 1.0963189e-06 4.1859733e-06 Scalars - total mean variance min max -[rho] 32231.00 1.00000000000 4.0482935e-09 0.99943921596 1.00150756036 +[rho] 32231.00 1.00000000000 4.0482933e-09 0.99943921596 1.00150756036 [phi] 1.1104609e+04 3.4453195e-01 1.1978260e-03 -1.2629938e-01 3.6277629e-01 [phi] 1.9921134e+01 6.1807372e-04 6.8883538e-04 -2.5474878e-01 2.5566358e-01 [phi] 3.5937832e+00 1.1150083e-04 6.7252396e-04 -2.5507224e-01 2.5804166e-01 @@ -546,7 +552,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 3250 -2.5872114756e+01 3.2231000000e+04 -8.0270903031e-04 1.2496733944e-01 6.9200000000e+02 1.8058864080e-04 Momentum - x y z -[total ] -1.5117432e-13 1.0999280e-13 7.8592298e-13 +[total ] -1.5042492e-13 1.0710622e-13 7.8619695e-13 [fluid ] 7.7635077e-04 -1.3061465e-04 -9.7403250e-04 [colloids] -7.7635077e-04 1.3061465e-04 9.7403250e-04 @@ -565,7 +571,7 @@ Colloid velocities - x y z [maximum ] 3.1886083e-06 8.8928281e-08 2.3534653e-06 Scalars - total mean variance min max -[rho] 32232.00 1.00000000000 3.9349253e-09 0.99944099877 1.00151187731 +[rho] 32232.00 1.00000000000 3.9349257e-09 0.99944099877 1.00151187731 [phi] 1.1102564e+04 3.4445781e-01 1.2092102e-03 -1.2725819e-01 3.6279566e-01 [phi] 2.2204944e+01 6.8890992e-04 7.0162418e-04 -2.5477310e-01 2.5597486e-01 [phi] 3.6266489e+00 1.1251703e-04 6.8549267e-04 -2.5522296e-01 2.5823050e-01 @@ -576,7 +582,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 3500 -2.5872812473e+01 3.2232000000e+04 -8.0270577292e-04 1.2293509864e-01 6.9200000000e+02 1.7765187665e-04 Momentum - x y z -[total ] 7.3092574e-15 1.8329191e-13 7.9832701e-13 +[total ] 8.0794746e-15 1.8276457e-13 7.9751863e-13 [fluid ] 6.8898897e-04 7.5608770e-05 -8.5071148e-04 [colloids] -6.8898897e-04 -7.5608770e-05 8.5071148e-04 @@ -595,7 +601,7 @@ Colloid velocities - x y z [maximum ] 3.0290909e-06 9.5327832e-07 2.4071344e-06 Scalars - total mean variance min max -[rho] 32232.00 1.00000000000 3.7786199e-09 0.99944060201 1.00150661282 +[rho] 32232.00 1.00000000000 3.7786201e-09 0.99944060201 1.00150661282 [phi] 1.1100647e+04 3.4439834e-01 1.2174888e-03 -1.2793163e-01 3.6283377e-01 [phi] 2.4471765e+01 7.5923819e-04 7.1239147e-04 -2.5473571e-01 2.5619629e-01 [phi] 3.6489883e+00 1.1321011e-04 6.9632369e-04 -2.5530713e-01 2.5834478e-01 @@ -606,7 +612,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 3750 -2.5872756487e+01 3.2232000000e+04 -8.0270403596e-04 1.2187417943e-01 6.9200000000e+02 1.7611875640e-04 Momentum - x y z -[total ] 4.3093242e-14 3.1061525e-13 6.5204049e-13 +[total ] 4.2177308e-14 3.0976870e-13 6.5173865e-13 [fluid ] 7.1810757e-04 8.1154609e-05 -9.8069834e-04 [colloids] -7.1810757e-04 -8.1154609e-05 9.8069834e-04 @@ -642,7 +648,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 4000 -2.5874234956e+01 3.2233000000e+04 -8.0272500097e-04 1.2084597399e-01 6.9200000000e+02 1.7463291039e-04 Momentum - x y z -[total ] 4.4252948e-13 3.2402767e-13 4.5550141e-13 +[total ] 4.4477421e-13 3.2394096e-13 4.5549447e-13 [fluid ] 1.4766704e-03 2.2269757e-04 -7.3378547e-04 [colloids] -1.4766704e-03 -2.2269757e-04 7.3378548e-04 @@ -661,7 +667,7 @@ Colloid velocities - x y z [maximum ] 3.7942680e-06 1.5943477e-06 2.0454715e-06 Scalars - total mean variance min max -[rho] 32233.00 1.00000000000 3.5580558e-09 0.99944792496 1.00143083264 +[rho] 32233.00 1.00000000000 3.5580556e-09 0.99944792496 1.00143083264 [phi] 1.1098004e+04 3.4430566e-01 1.2302720e-03 -1.2885128e-01 3.6289748e-01 [phi] 2.9485068e+01 9.1474788e-04 7.3025959e-04 -2.5466990e-01 2.5660245e-01 [phi] 3.1594733e+00 9.8019834e-05 7.1363739e-04 -2.5545930e-01 2.5854423e-01 @@ -672,7 +678,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 4250 -2.5874227535e+01 3.2233000000e+04 -8.0272477073e-04 1.2014636542e-01 6.9200000000e+02 1.7362191534e-04 Momentum - x y z -[total ] 3.5523255e-13 4.4194151e-13 7.1126460e-13 +[total ] 3.6109939e-13 4.4380808e-13 7.1109806e-13 [fluid ] 5.5621309e-04 1.2539989e-04 -5.0159774e-04 [colloids] -5.5621309e-04 -1.2539989e-04 5.0159775e-04 @@ -702,7 +708,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 4500 -2.5874265051e+01 3.2233000000e+04 -8.0272593464e-04 1.1967581047e-01 6.9200000000e+02 1.7294192265e-04 Momentum - x y z -[total ] 3.1420981e-13 4.7161748e-13 6.5007938e-13 +[total ] 3.1423052e-13 4.7039971e-13 6.5021469e-13 [fluid ] 4.7975999e-04 1.3496431e-04 -5.4946507e-04 [colloids] -4.7975999e-04 -1.3496431e-04 5.4946507e-04 @@ -721,7 +727,7 @@ Colloid velocities - x y z [maximum ] 4.1258579e-06 -7.5738169e-08 9.4786924e-07 Scalars - total mean variance min max -[rho] 32232.00 1.00000000000 3.7122636e-09 0.99894650192 1.00141498051 +[rho] 32232.00 1.00000000000 3.7122641e-09 0.99894650192 1.00141498051 [phi] 1.1095456e+04 3.4423727e-01 1.2379647e-03 -1.2950444e-01 3.6291150e-01 [phi] 3.4705011e+01 1.0767253e-03 7.4307437e-04 -2.5359309e-01 2.5687619e-01 [phi] 3.6404245e+00 1.1294442e-04 7.2794966e-04 -2.5556466e-01 2.5874563e-01 @@ -732,7 +738,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 4750 -2.5873494499e+01 3.2232000000e+04 -8.0272693283e-04 1.2028637795e-01 6.9400000000e+02 1.7332331117e-04 Momentum - x y z -[total ] 3.1267003e-13 4.5764434e-13 5.1243580e-13 +[total ] 3.1194838e-13 4.6028806e-13 5.1154079e-13 [fluid ] 4.1976227e-03 3.3147329e-03 8.1348620e-04 [colloids] -4.1976227e-03 -3.3147329e-03 -8.1348620e-04 @@ -768,7 +774,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 5000 -2.5874591525e+01 3.2233000000e+04 -8.0273606319e-04 1.1946900995e-01 6.9200000000e+02 1.7264307796e-04 Momentum - x y z -[total ] 2.0803921e-13 4.1592538e-13 5.4156430e-13 +[total ] 2.0616224e-13 4.1402759e-13 5.4273697e-13 [fluid ] 1.4667234e-04 -4.2054838e-04 6.0520526e-04 [colloids] -1.4667234e-04 4.2054838e-04 -6.0520526e-04 @@ -798,7 +804,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 5250 -2.5874542713e+01 3.2233000000e+04 -8.0273454886e-04 1.1972300163e-01 6.9200000000e+02 1.7301011797e-04 Momentum - x y z -[total ] 1.6418529e-13 2.3983680e-13 8.4427994e-13 +[total ] 1.6358507e-13 2.3954189e-13 8.4422768e-13 [fluid ] -1.6242794e-03 -2.8177255e-03 1.6892728e-03 [colloids] 1.6242794e-03 2.8177255e-03 -1.6892728e-03 @@ -828,7 +834,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 5500 -2.5873508389e+01 3.2232000000e+04 -8.0272736378e-04 1.2067413015e-01 6.9400000000e+02 1.7388203191e-04 Momentum - x y z -[total ] 2.5736357e-13 2.7770473e-13 6.1185117e-13 +[total ] 2.5938626e-13 2.7814535e-13 6.1111554e-13 [fluid ] 4.2518667e-03 -9.1400656e-04 -9.5412444e-04 [colloids] -4.2518667e-03 9.1400656e-04 9.5412444e-04 @@ -847,7 +853,7 @@ Colloid velocities - x y z [maximum ] 1.6471639e-05 8.1496084e-06 4.2041734e-06 Scalars - total mean variance min max -[rho] 32229.00 1.00000000000 4.4291610e-09 0.99682927991 1.00141772695 +[rho] 32229.00 1.00000000000 4.4291613e-09 0.99682927991 1.00141772695 [phi] 1.1091862e+04 3.4415781e-01 1.2473106e-03 -1.3031339e-01 3.6250405e-01 [phi] 4.7557606e+01 1.4756153e-03 7.5838678e-04 -2.5346030e-01 2.5751615e-01 [phi] 1.5920502e+00 4.9398065e-05 7.4497379e-04 -2.5535874e-01 2.5900378e-01 @@ -858,7 +864,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 5750 -2.5871283651e+01 3.2229000000e+04 -8.0273305566e-04 1.2088730075e-01 6.9600000000e+02 1.7368865050e-04 Momentum - x y z -[total ] 1.2863170e-13 3.0789087e-13 4.1462428e-13 +[total ] 1.2747269e-13 3.0781801e-13 4.1388529e-13 [fluid ] 4.4954581e-04 -1.9264814e-03 1.0391653e-03 [colloids] -4.4954581e-04 1.9264814e-03 -1.0391653e-03 @@ -883,7 +889,7 @@ Writing q file at step 6000! Writing velocity output at step 6000! Scalars - total mean variance min max -[rho] 32227.00 1.00000000000 3.3409775e-09 0.99944480594 1.00140426199 +[rho] 32227.00 1.00000000000 3.3409777e-09 0.99944480594 1.00140426199 [phi] 1.1089820e+04 3.4411580e-01 1.2553359e-03 -1.3049686e-01 3.6300382e-01 [phi] 4.9874187e+01 1.5475901e-03 7.6365408e-04 -2.5331612e-01 2.5744355e-01 [phi] 1.8866696e+00 5.8543134e-05 7.5180128e-04 -2.5553596e-01 2.5892672e-01 @@ -894,7 +900,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 6000 -2.5869071572e+01 3.2227000000e+04 -8.0271423253e-04 1.1995766322e-01 6.9600000000e+02 1.7235296439e-04 Momentum - x y z -[total ] -1.5648485e-13 3.9348743e-13 4.2680323e-13 +[total ] -1.5515269e-13 3.9600278e-13 4.2579720e-13 [fluid ] 4.9995489e-04 4.5631552e-04 -5.7953834e-04 [colloids] -4.9995489e-04 -4.5631552e-04 5.7953834e-04 @@ -913,7 +919,7 @@ Colloid velocities - x y z [maximum ] 3.3893433e-06 3.0922778e-06 2.4876435e-06 Scalars - total mean variance min max -[rho] 32227.00 1.00000000000 3.2566594e-09 0.99944375789 1.00140128352 +[rho] 32227.00 1.00000000000 3.2566596e-09 0.99944375789 1.00140128352 [phi] 1.1088586e+04 3.4407751e-01 1.2610852e-03 -1.3069215e-01 3.6309067e-01 [phi] 5.2121192e+01 1.6173144e-03 7.7037502e-04 -2.5329891e-01 2.5748645e-01 [phi] 2.3705984e+00 7.3559389e-05 7.5794588e-04 -2.5559295e-01 2.5900608e-01 @@ -924,7 +930,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 6250 -2.5868849707e+01 3.2227000000e+04 -8.0270734810e-04 1.1924097605e-01 6.9600000000e+02 1.7132324145e-04 Momentum - x y z -[total ] -2.9546070e-13 2.1047248e-13 5.8001368e-13 +[total ] -2.9015592e-13 2.0946634e-13 5.8025991e-13 [fluid ] 4.7204405e-04 5.5985282e-04 -7.1073086e-04 [colloids] -4.7204405e-04 -5.5985282e-04 7.1073086e-04 @@ -954,7 +960,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 6500 -2.5868115101e+01 3.2226000000e+04 -8.0270946133e-04 1.1902329455e-01 6.9600000000e+02 1.7101048067e-04 Momentum - x y z -[total ] -4.1925664e-14 3.9674947e-13 6.2513970e-13 +[total ] -4.3042826e-14 3.9408494e-13 6.2576116e-13 [fluid ] 2.5284185e-03 2.9932555e-03 2.0754728e-03 [colloids] -2.5284185e-03 -2.9932555e-03 -2.0754728e-03 @@ -973,7 +979,7 @@ Colloid velocities - x y z [maximum ] 4.9960486e-06 1.8299189e-06 1.2085769e-06 Scalars - total mean variance min max -[rho] 32227.00 1.00000000000 3.1650875e-09 0.99944448378 1.00139974549 +[rho] 32227.00 1.00000000000 3.1650877e-09 0.99944448378 1.00139974549 [phi] 1.1086693e+04 3.4401876e-01 1.2688279e-03 -1.3107675e-01 3.6304054e-01 [phi] 5.6796019e+01 1.7623738e-03 7.8194072e-04 -2.5327152e-01 2.5756821e-01 [phi] 3.5374350e+00 1.0976619e-04 7.6744834e-04 -2.5565509e-01 2.5910787e-01 @@ -984,7 +990,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 6750 -2.5868667187e+01 3.2227000000e+04 -8.0270168452e-04 1.1815971895e-01 6.9400000000e+02 1.7025896103e-04 Momentum - x y z -[total ] 1.0546143e-13 1.7813301e-13 4.6301119e-13 +[total ] 1.0189836e-13 1.7728299e-13 4.6336161e-13 [fluid ] 3.6503859e-04 5.3557033e-04 -1.1847295e-04 [colloids] -3.6503859e-04 -5.3557033e-04 1.1847295e-04 @@ -1009,7 +1015,7 @@ Writing q file at step 7000! Writing velocity output at step 7000! Scalars - total mean variance min max -[rho] 32228.00 1.00000000000 3.1442751e-09 0.99944291032 1.00139901060 +[rho] 32228.00 1.00000000000 3.1442753e-09 0.99944291032 1.00139901060 [phi] 1.1086228e+04 3.4399368e-01 1.2717677e-03 -1.3125094e-01 3.6301740e-01 [phi] 5.9143074e+01 1.8351456e-03 7.8726423e-04 -2.5322461e-01 2.5764673e-01 [phi] 3.9112540e+00 1.2136198e-04 7.7159598e-04 -2.5560956e-01 2.5914492e-01 @@ -1020,7 +1026,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 7000 -2.5869580098e+01 3.2228000000e+04 -8.0270510421e-04 1.1752887640e-01 6.9400000000e+02 1.6934996600e-04 Momentum - x y z -[total ] 4.7012394e-13 2.2748372e-13 3.6727918e-13 +[total ] 4.7209459e-13 2.2884028e-13 3.6721326e-13 [fluid ] 4.9794107e-04 2.7659266e-04 1.5147956e-06 [colloids] -4.9794107e-04 -2.7659265e-04 -1.5147952e-06 @@ -1050,7 +1056,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 7250 -2.5869559164e+01 3.2228000000e+04 -8.0270445465e-04 1.1735890037e-01 6.9400000000e+02 1.6910504376e-04 Momentum - x y z -[total ] 5.6570937e-13 1.6129416e-13 6.5432436e-13 +[total ] 5.6484548e-13 1.6056904e-13 6.5437646e-13 [fluid ] 4.9129838e-04 2.3195917e-04 -2.6939669e-04 [colloids] -4.9129838e-04 -2.3195917e-04 2.6939669e-04 @@ -1080,7 +1086,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 7500 -2.5870248601e+01 3.2229000000e+04 -8.0270094017e-04 1.1663220088e-01 6.9400000000e+02 1.6805792634e-04 Momentum - x y z -[total ] 4.1853044e-13 1.9830134e-13 6.6643240e-13 +[total ] 4.1788860e-13 1.9485265e-13 6.6607155e-13 [fluid ] 4.2488985e-04 3.9435490e-04 -1.5436760e-04 [colloids] -4.2488985e-04 -3.9435490e-04 1.5436760e-04 @@ -1099,7 +1105,7 @@ Colloid velocities - x y z [maximum ] 7.3888110e-06 6.4173541e-06 5.1364693e-06 Scalars - total mean variance min max -[rho] 32230.00 1.00000000000 3.0885878e-09 0.99944100276 1.00140070194 +[rho] 32230.00 1.00000000000 3.0885881e-09 0.99944100276 1.00140070194 [phi] 1.1085135e+04 3.4393843e-01 1.2774114e-03 -1.3171708e-01 3.6297820e-01 [phi] 6.6221863e+01 2.0546653e-03 7.9750146e-04 -2.5317200e-01 2.5766866e-01 [phi] 5.0971389e+00 1.5814890e-04 7.8251822e-04 -2.5564208e-01 2.5910664e-01 @@ -1110,7 +1116,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 7750 -2.5871025749e+01 3.2230000000e+04 -8.0270014735e-04 1.1647731551e-01 6.9400000000e+02 1.6783474857e-04 Momentum - x y z -[total ] 5.6805125e-13 2.7434619e-13 7.4986870e-13 +[total ] 5.7015362e-13 2.7464803e-13 7.4937604e-13 [fluid ] -3.7803638e-05 -6.1092525e-04 -1.0106364e-03 [colloids] 3.7803638e-05 6.1092525e-04 1.0106364e-03 @@ -1146,7 +1152,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 8000 -2.5871140338e+01 3.2230000000e+04 -8.0270370270e-04 1.1649429653e-01 6.9400000000e+02 1.6785921690e-04 Momentum - x y z -[total ] 2.8472038e-13 1.5661355e-13 7.7103601e-13 +[total ] 2.8713165e-13 1.5616599e-13 7.7167092e-13 [fluid ] 3.7900204e-04 -1.2142973e-04 -8.6754569e-04 [colloids] -3.7900204e-04 1.2142973e-04 8.6754569e-04 @@ -1165,7 +1171,7 @@ Colloid velocities - x y z [maximum ] 4.1642569e-06 5.7677480e-06 4.6596498e-06 Scalars - total mean variance min max -[rho] 32230.00 1.00000000000 3.0770464e-09 0.99943959405 1.00139828961 +[rho] 32230.00 1.00000000000 3.0770468e-09 0.99943959405 1.00139828961 [phi] 1.1084515e+04 3.4391917e-01 1.2787519e-03 -1.3199262e-01 3.6293350e-01 [phi] 7.1181893e+01 2.2085601e-03 8.0164704e-04 -2.5303382e-01 2.5784360e-01 [phi] 6.1119740e+00 1.8963618e-04 7.8664014e-04 -2.5565641e-01 2.5924774e-01 @@ -1176,7 +1182,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 8250 -2.5871174902e+01 3.2230000000e+04 -8.0270477511e-04 1.1645667978e-01 6.9400000000e+02 1.6780501410e-04 Momentum - x y z -[total ] 2.1333022e-13 3.3380525e-13 7.2688372e-13 +[total ] 2.1307359e-13 3.3420770e-13 7.2699128e-13 [fluid ] 4.4181060e-04 4.3595540e-05 -8.0009705e-04 [colloids] -4.4181060e-04 -4.3595540e-05 8.0009705e-04 @@ -1206,7 +1212,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 8500 -2.5871189373e+01 3.2230000000e+04 -8.0270522411e-04 1.1640200769e-01 6.9400000000e+02 1.6772623587e-04 Momentum - x y z -[total ] 4.6935220e-13 3.2594565e-13 6.8683633e-13 +[total ] 4.6656971e-13 3.2839855e-13 6.8763094e-13 [fluid ] 4.6045810e-04 1.2639905e-04 -7.7877039e-04 [colloids] -4.6045810e-04 -1.2639905e-04 7.7877039e-04 @@ -1236,7 +1242,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 8750 -2.5870420005e+01 3.2229000000e+04 -8.0270625850e-04 1.1616604760e-01 6.9600000000e+02 1.6690524080e-04 Momentum - x y z -[total ] 6.0157955e-13 3.5174207e-13 6.5167576e-13 +[total ] 6.0123261e-13 3.5266863e-13 6.5180413e-13 [fluid ] 2.3548964e-04 -1.2822769e-03 -5.1536100e-04 [colloids] -2.3548964e-04 1.2822769e-03 5.1536100e-04 @@ -1261,7 +1267,7 @@ Writing q file at step 9000! Writing velocity output at step 9000! Scalars - total mean variance min max -[rho] 32229.00 1.00000000000 3.0635880e-09 0.99943826667 1.00139639558 +[rho] 32229.00 1.00000000000 3.0635883e-09 0.99943826667 1.00139639558 [phi] 1.1083084e+04 3.4388544e-01 1.2824037e-03 -1.3234579e-01 3.6290880e-01 [phi] 7.8850610e+01 2.4465733e-03 8.0762443e-04 -2.5292067e-01 2.5792453e-01 [phi] 7.5507285e+00 2.3428367e-04 7.9305014e-04 -2.5565274e-01 2.5927627e-01 @@ -1272,7 +1278,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 9000 -2.5870371471e+01 3.2229000000e+04 -8.0270475257e-04 1.1600649061e-01 6.9600000000e+02 1.6667599226e-04 Momentum - x y z -[total ] 3.5769413e-13 4.2132530e-13 6.4729938e-13 +[total ] 3.6349851e-13 4.2137734e-13 6.4754918e-13 [fluid ] 4.6211095e-04 -4.9303275e-04 -6.4266093e-04 [colloids] -4.6211095e-04 4.9303275e-04 6.4266093e-04 @@ -1291,7 +1297,7 @@ Colloid velocities - x y z [maximum ] 4.9706409e-06 8.9614154e-06 6.6469281e-06 Scalars - total mean variance min max -[rho] 32227.00 1.00000000000 3.0852643e-09 0.99944174345 1.00139926339 +[rho] 32227.00 1.00000000000 3.0852640e-09 0.99944174345 1.00139926339 [phi] 1.1082032e+04 3.4387414e-01 1.2847889e-03 -1.3248295e-01 3.6293814e-01 [phi] 8.1054758e+01 2.5151196e-03 8.1013312e-04 -2.5288107e-01 2.5792522e-01 [phi] 7.6455897e+00 2.3724174e-04 7.9367843e-04 -2.5566798e-01 2.5691603e-01 @@ -1302,7 +1308,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 9250 -2.5868573091e+01 3.2227000000e+04 -8.0269876475e-04 1.1618481121e-01 6.9800000000e+02 1.6645388426e-04 Momentum - x y z -[total ] 6.8379547e-14 6.2593116e-13 9.0502367e-13 +[total ] 7.1370102e-14 6.2698935e-13 9.0613736e-13 [fluid ] 4.0787545e-04 -1.0769510e-03 -5.5560791e-04 [colloids] -4.0787545e-04 1.0769510e-03 5.5560791e-04 @@ -1332,7 +1338,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 9500 -2.5868475068e+01 3.2227000000e+04 -8.0269572310e-04 1.1594789295e-01 6.9800000000e+02 1.6611445982e-04 Momentum - x y z -[total ] 1.1683298e-13 4.2802806e-13 8.5636034e-13 +[total ] 1.2196082e-13 4.2867337e-13 8.5701617e-13 [fluid ] 4.3271357e-04 -6.3882195e-04 -5.5078245e-04 [colloids] -4.3271357e-04 6.3882195e-04 5.5078246e-04 @@ -1351,7 +1357,7 @@ Colloid velocities - x y z [maximum ] -5.3404239e-09 2.5350067e-06 2.1849765e-06 Scalars - total mean variance min max -[rho] 32228.00 1.00000000000 3.3206542e-09 0.99825504371 1.00139604301 +[rho] 32228.00 1.00000000000 3.3206544e-09 0.99825504371 1.00139604301 [phi] 1.1081685e+04 3.4385271e-01 1.2849667e-03 -1.3265664e-01 3.6265699e-01 [phi] 8.5788186e+01 2.6619147e-03 8.1529479e-04 -2.5283536e-01 2.5818881e-01 [phi] 9.0442017e+00 2.8063180e-04 7.9833995e-04 -2.5572046e-01 2.5698894e-01 @@ -1362,7 +1368,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 9750 -2.5869683480e+01 3.2228000000e+04 -8.0270831202e-04 1.1628872572e-01 6.9600000000e+02 1.6708150247e-04 Momentum - x y z -[total ] -7.0847191e-14 4.3860851e-13 9.4321198e-13 +[total ] -7.0861069e-14 4.3763707e-13 9.4407585e-13 [fluid ] 1.2678932e-03 -1.3837676e-04 -8.7350325e-05 [colloids] -1.2678932e-03 1.3837676e-04 8.7350326e-05 @@ -1399,7 +1405,7 @@ Free energies - timestep f v f/v f_s a f_s/a [fe] 10000 -2.5870998351e+01 3.2229000000e+04 -8.0272420337e-04 1.1507156593e-01 6.9600000000e+02 1.6533270967e-04 Momentum - x y z -[total ] -5.3422327e-14 3.6719976e-13 7.7413922e-13 +[total ] -5.3030334e-14 3.6942042e-13 7.7413224e-13 [fluid ] -1.1314820e-05 1.0174461e-03 -4.8713002e-05 [colloids] 1.1314820e-05 -1.0174461e-03 4.8713003e-05 @@ -1418,27 +1424,32 @@ Timer resolution: 1e-06 second Timer statistics Section: tmin tmax total - Total: 541.298 541.299 541.299 541.298501 (1 call) - Time step loop: 0.042 0.259 540.777 0.054078 (10000 calls) - Propagation: 0.002 0.015 32.872 0.003287 (10000 calls) - Propagtn (krnl) : 0.002 0.015 32.833 0.003283 (10000 calls) - Collision: 0.003 0.027 68.728 0.006873 (10000 calls) - Collision (krnl) : 0.003 0.027 68.656 0.006866 (10000 calls) - Lattice halos: 0.001 0.050 44.400 0.002220 (20000 calls) - phi gradients: 0.003 0.073 67.799 0.006780 (10000 calls) - phi halos: 0.000 0.061 8.579 0.000858 (10000 calls) - Forces: 0.000 0.001 0.028 0.000003 (10000 calls) - Rebuild: 0.000 0.002 3.212 0.000321 (10000 calls) - BBL: 0.000 0.019 6.570 0.000657 (10000 calls) - Particle halos: 0.000 0.020 3.067 0.000307 (10000 calls) - Force calculation: 0.005 0.071 135.482 0.013548 (10000 calls) - Phi force (krnl) : 0.002 0.014 44.510 0.004451 (10000 calls) - phi update: 0.007 0.081 174.913 0.017491 (10000 calls) - Velocity Halo : 0.000 0.052 13.468 0.001347 (10000 calls) -BE mol field (krnl) : 0.001 0.027 39.724 0.003972 (10000 calls) -BP BE update (krnl) : 0.002 0.046 59.045 0.005904 (10000 calls) - Advectn (krnl) : 0.002 0.034 50.492 0.005049 (10000 calls) - Advectn BCS (krnl) : 0.000 0.010 9.426 0.000943 (10000 calls) - Free1: 0.000 0.037 0.410 0.000014 (30000 calls) - Free3: 0.000 0.002 0.109 0.000011 (10000 calls) + Total: 214.814 214.818 214.815 214.814680 (1 call) + Time step loop: 0.017 0.041 214.388 0.021439 (10000 calls) + Propagation: 0.000 0.003 11.921 0.001192 (10000 calls) + Propagtn (krnl) : 0.000 0.003 11.848 0.001185 (10000 calls) + Collision: 0.000 0.003 8.174 0.000817 (10000 calls) + Collision (krnl) : 0.000 0.003 8.059 0.000806 (10000 calls) + Lattice halos: 0.001 0.009 40.684 0.002034 (20000 calls) + phi gradients: 0.001 0.016 30.297 0.003030 (10000 calls) + phi halos: 0.001 0.016 18.940 0.001894 (10000 calls) + Forces: 0.000 0.000 0.020 0.000002 (10000 calls) + Rebuild: 0.000 0.001 1.482 0.000148 (10000 calls) + BBL: 0.000 0.009 5.580 0.000558 (10000 calls) + Particle halos: 0.000 0.006 0.971 0.000097 (10000 calls) + Force calculation: 0.002 0.012 56.072 0.005607 (10000 calls) + Phi force (krnl) : 0.001 0.009 40.079 0.004008 (10000 calls) + phi update: 0.003 0.013 51.273 0.005127 (10000 calls) + Velocity Halo : 0.001 0.012 19.041 0.001904 (10000 calls) +BE mol field (krnl) : 0.000 0.004 7.189 0.000719 (10000 calls) +BP BE update (krnl) : 0.000 0.005 8.145 0.000815 (10000 calls) + Advectn (krnl) : 0.000 0.007 6.486 0.000649 (10000 calls) + Advectn BCS (krnl) : 0.000 0.006 5.867 0.000587 (10000 calls) + Free1: 0.000 0.038 0.381 0.000013 (30000 calls) + Free3: 0.000 0.000 0.062 0.000006 (10000 calls) +Warning: key/value present in input but not used: +(Line 204): colloid_cell_min +Warning: key/value present in input but not used: +(Line 203): colloid_cell_list_interactions +End time: Mon Jan 31 12:40:25 2022 Ludwig finished normally. diff --git a/docs/tutorial/test3/vel-00010000.vtk b/docs/tutorial/test3/vel-00010000.vtk index dd4cd1ceb..195a9dbd2 100644 --- a/docs/tutorial/test3/vel-00010000.vtk +++ b/docs/tutorial/test3/vel-00010000.vtk @@ -1,12 +1,12 @@ # vtk DataFile Version 2.0 -Generated by vtk_extract.c +Generated by ludwig extract.c ASCII DATASET STRUCTURED_POINTS DIMENSIONS 32 32 32 ORIGIN 0 0 0 SPACING 1 1 1 POINT_DATA 32768 -VECTORS vel float +VECTORS velocity_field float -3.516103e-06 -7.735533e-06 7.225344e-06 -3.110552e-06 -4.435490e-06 5.830857e-06 -5.039787e-06 6.595314e-07 5.141593e-06 diff --git a/docs/tutorial/tutorial.tex b/docs/tutorial/tutorial.tex index b95139e9c..5a6f0cf59 100644 --- a/docs/tutorial/tutorial.tex +++ b/docs/tutorial/tutorial.tex @@ -67,13 +67,6 @@ \begin{document} - -\setcounter{page}{1} - -% We're not including the table of contents just at the moment -%\tableofcontents - -\newpage \lstset{style=terminalverbatim} \setcounter{page}{1} @@ -175,21 +168,25 @@ \subsection{Configuration and Build}\label{configbuild} The following section outlines the configuration and compilation procedure. The configuration step is based on the GNU Compiler Collection gcc. - \begin{enumerate} -\item Go to the top level directory \texttt{/ludwig}: \\ +\item Go to the top level directory \texttt{/ludwig}: \begin{lstlisting} $ cd ludwig \end{lstlisting} \item Copy the (parallel) configuration file \texttt{lunix-mpicc-default.mk} to top level directory -and rename to \texttt{config.mk} (both steps exectued below at once): \\ +and rename to \texttt{config.mk} (both steps exectued below at once): \begin{lstlisting} $ cp config/unix-mpicc-default.mk ./config.mk \end{lstlisting} Note that you may need to specify the correct path to the MPI wrapper compiler in this file (assumed to be \texttt{mpicc}). -\item Issue \texttt{make} in the top level directory: \\ + +For production runs you may want to use thie compiler flag below instead of the default one: +\begin{lstlisting} +CFLAGS = -O3 -g -DNDEBUG -DNSIMDVL=4 +\end{lstlisting} +\item Issue \texttt{make} in the top level directory: \begin{lstlisting} $ make \end{lstlisting} @@ -199,13 +196,15 @@ \subsection{Configuration and Build}\label{configbuild} \begin{lstlisting} $ make -j 4 \end{lstlisting} -If you want a serial build, use the conifguation file -\texttt{config/unix-gcc-default.mk} and include the extra step +If you want a serial build, clean your directory tree with +\begin{lstlisting} +$ make clean +\end{lstlisting} +use the conifguation file +\texttt{config/unix-gcc-default.mk} and include the extra keyword \texttt{serial}: \begin{lstlisting} $ make serial -$ make \end{lstlisting} - \end{enumerate} \section{Tutorial Test Exercises} @@ -226,17 +225,11 @@ \subsection{Test 1: Poiseuille Flow of a Simple Fluid in a Cavity} \begin{lstlisting} $ mpirun -np 4 ./Ludwig.exe input \end{lstlisting} - \item You should now see statistics being reported on your standard output and output files being created with names of the form \texttt{vel-XXXXXXXX.001-001}. These files contain the components of the velocity vectors in Cartesian coordinates at each lattice point in the simulation. -\item The first step to the post-processing of the data is to compile the \texttt{extract.c} -routine in \texttt{/util}. This requires the \texttt{Ludwig} code to be compiled in serial -(see section \ref{configbuild}). Compile with -\begin{lstlisting} -$ make extract -\end{lstlisting} -and copy the executable \texttt{extract} into your working directory. +\item The first step to the post-processing is to get hold of the \texttt{extract} executable in \texttt{/util}, +which is created during the main compilation of \texttt{Ludwig}, and copy it into your tutorial working directory. \item Post-process the raw data by issuing \begin{lstlisting} $ ./extract -a -i meta_file_name data_file_name_stub @@ -244,8 +237,7 @@ \subsection{Test 1: Poiseuille Flow of a Simple Fluid in a Cavity} replacing the filenames with those of the present case (i.e. \texttt{vel.001-001.meta} and e.g. \texttt{vel-00010000}). The command line options '\texttt{-a}' and '\texttt{-i}' give output in ASCII format and a lattice index for easy visualisation in \texttt{gnuplot}. - -\item You should now see files named \texttt{vel-XXXXXXXX}. The first three columns of these ASCII files are the spatial lattice indices followed by the Cartesian components of the velocity vectors.\\ +\item You should now see files named \texttt{vel-XXXXXXXX}. The first three columns of these ASCII files are the spatial lattice indices followed by the Cartesian components of the velocity vectors. \item To plot the velocity profile of the system, you can plot the $y$-component of the velocity against the spatial $x$-coordinate on the lattice with the command: \begin{lstlisting} @@ -256,7 +248,6 @@ \subsection{Test 1: Poiseuille Flow of a Simple Fluid in a Cavity} In the directory \texttt{/docs/tutorial/test1} a reference file of the final output at time step $10,000$ can be found, in addition to a file containing the standard output of the code. \end{enumerate} - \begin{figure}[h] \begin{center} \includegraphics[width=0.8\linewidth]{velProf.png} @@ -286,28 +277,23 @@ \subsection{Test 2: Spinodal Decomposition of a Binary Fluid} in this case two sets of output files are being created, one containing the velocity and the other compositional order parameter ($\phi$) data at each lattice point in the simulation. In this example, these data are in binary format. -\item It should be possible to use the same exectuable \texttt{extract} from the previous -example for the post-processing. Alternatively, compile with +\item You are able to use the same exectuable \texttt{extract} from the previous +example for the post-processing with different arguments and the \texttt{-k} flag to produce +files in VTK-format: \begin{lstlisting} -make extract -\end{lstlisting} -and copy the executable \texttt{extract} into your working directory. -Remember that this requires the \texttt{Ludwig} code to be compiled in serial -(see section \ref{configbuild}). -\item A python script \texttt{extract.py} -can be used for convenient post-processing of multiple raw data files and time steps. - Edit \texttt{extract.py} and set: -\begin{enumerate} -\item \texttt{nstart=1000}, \texttt{nint=1000} and \texttt{nend=10000} to set the range and -increments of the velocity data -to be processed. -\item \texttt{vel=1} for velocity post-processing, -\item \texttt{phi=1} for $\phi$ post-processing, -\item The other flags should be set to zero. -\end{enumerate} -\item Issue the command: +$ ./extract -k vel.001-001.meta vel-00010000.001-001 +$ ./extract -k phi.001-001.meta phi-00010000.001-001 +\end{lstlisting} +\item A bash script like this one below can be used for convenient post-processing of multiple +raw data files and time steps (with appropriate start, increment and end in the \texttt{for} loop): \begin{lstlisting} -$ python extract.py +#!/bin/bash +for i in `seq 1000 1000 10000`; +do + tstep=$(printf "%08d" $i) + ./extract -k vel.001-001.meta vel-${tstep}.001-001 + ./extract -k phi.001-001.meta phi-${tstep}.001-001 +done \end{lstlisting} \item You should now see files with the extension \texttt{.vtk} corresponding to the velocity and $\phi$ data ready to be visualised using ParaView. @@ -382,7 +368,6 @@ \subsection{Test 3: Colloids Dispersed in a Liquid Crystalline Fluid} demonstrating the ways to visualise liquid crystals in ParaView. As before, the code should be compiled in parallel and the executable \texttt{Ludwig.exe} should be copied into your working directory. - \begin{enumerate} \item Copy the input file \texttt{input} located in the directory \texttt{/docs/tutorial/test3} to your working directory. We see in this input file that @@ -390,7 +375,6 @@ \subsection{Test 3: Colloids Dispersed in a Liquid Crystalline Fluid} than in the previous examples. Specifically, we note that \texttt{colloid\_cell\_min} must be set if colloids are present and must be at least $2r + \delta$ where $r$ is colloid radius and $\delta$ - here set to 0.5 - catches any colloid-colloid interactions. This is shown for our example - where this value is set to 8.0 - in Fig. \ref{fig:colloid_int}. - \begin{figure}[H] \begin{center} \includegraphics[width=0.5\linewidth]{colloidInit.png} @@ -398,7 +382,6 @@ \subsection{Test 3: Colloids Dispersed in a Liquid Crystalline Fluid} \label{fig:colloid_int} \end{center} \end{figure} - \item The following steps outline the preliminary stages required in order to initialise the colloidal system and for the visualisation of colloids. Firstly, and as before, compile the \texttt{Ludwig} code in serial (see section \ref{configbuild}) and go to the directory \texttt{ludwig/util}. There you should see the files \texttt{colloid\_init.c} and \texttt{extract\_colloid.c}. These are the files required for the initialisation and post-processing of colloids, respectively. \item In the file, \texttt{colloid\_init.c} set the flags for: \begin{enumerate} @@ -410,45 +393,50 @@ \subsection{Test 3: Colloids Dispersed in a Liquid Crystalline Fluid} \item \texttt{vf = 0.02} \\ this sets the volume fraction of colloids to 2\%, for our system of size 32$^2$ with colloids of radius 3.5, this will result in 3 colloids, \item \texttt{dh = 0.5} \\ to set the grace distance for interactions (note that this means that one colloid plus this distance is less than \texttt{colloid\_cell\_min} which was set in the input file. \end{enumerate} -\item Now issue: \\ +\item Now issue \begin{lstlisting} $ make colloid_init $ ./colloid_init \end{lstlisting} this produces a file \texttt{config.cds.init.001-001}, which you have to copy into your working directory. - \item Next, run the code in your working directory by issuing the command: \begin{lstlisting} $ mpirun -np 8 ./Ludwig.exe input \end{lstlisting} - -\item In the file, \texttt{extract\_colloids.c} set: +\item An \texttt{extract\_colloids} executable is produced in \texttt{/util} during the main compilation of \texttt{Ludwig}. +For our problem we need to set potentially different parameters. In the file, \texttt{extract\_colloids.c} set: \begin{enumerate} \item The system size, \texttt{NX}, \texttt{NY}, \texttt{NZ} all = 32, -\item \texttt{iread\_ascii = 1} \\ since the output is in ASCII, +\item \texttt{iread\_ascii = 1} \\ since the output is in ASCII format, \item \texttt{cds\_with\_v = 1} \\ which will output the positions and velocity data of the colloids, \end{enumerate} -\item Now issue: \\ +\item Now issue \begin{lstlisting} $ make extract_colloids \end{lstlisting} and copy the executable \texttt{extract\_colloids} into your working directory. \item For the post-processing of other data either copy the existing executable \texttt{extract} from previous examples or compile in \texttt{/util} in the usual manner. -Remember that this requires the \texttt{Ludwig} code to be compiled in serial -(see section \ref{configbuild}). - -\item Copy the script \texttt{extract.py} as well into your working directory and set: -\begin{enumerate} -\item \texttt{vel = 1}, \\ to visualise the velocity field, -\item \texttt{q = 1}, \\ since there are liquid crystals present, -\item \texttt{colcds = 0} and -\item \texttt{colcdsvel = 1} so that the colloid position and velocity data are both available. -\end{enumerate} - -\item Run the post-processing routine as before using the python script. +\item Run the post-processing routines as before using different arguments: +\begin{lstlisting} +$ ./extract -k vel.001-001.meta vel-00010000.001-001 +$ ./extract -k -s -d q.001-001.meta q-00010000.001-001 +$ ./extract_colloids config.cds00010000 1 col-cdsvel-00010000.csv +\end{lstlisting} +The \texttt{-s} and \texttt{-d} flags produce scalar order parameter and director field output. \texttt{.csv} files with the colloid data should be seen in addition to the \texttt{.vtk} files for the velocity, order parameter and director field. +\item Again, a bash script like this one below can be used for convenient post-processing of multiple raw data files and time steps (with appropriate start, increment and end in the \texttt{for} loop): +\begin{lstlisting} +#!/bin/bash +for i in `seq 1000 1000 10000`; +do + tstep=$(printf "%08d" $i) + ./extract -k vel.001-001.meta vel-${tstep}.001-001 + ./extract -k -s -d q.001-001.meta q-${tstep}.001-001 + ./extract_colloids config.cds${tstep} 1 col-cdsvel-${tstep}.csv +done +\end{lstlisting} \item The system can now be visualised, again using ParaView: \begin{enumerate} \item The liquid crystal, scalar order parameter can be visualised by opening the files: From ea47e6a8b41290d42fa17c646dabb7628b76856c Mon Sep 17 00:00:00 2001 From: not populated Date: Wed, 9 Feb 2022 16:15:24 +0000 Subject: [PATCH 33/64] Add field halo switch for lc droplet --- src/ludwig.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ludwig.c b/src/ludwig.c index a4f9e8f1d..ba74a84a2 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -1698,6 +1698,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { { field_options_t opts = field_options_ndata_nhalo(nf, nhalo); + + if (rt_switch(rt, "field_halo_openmp")) { + opts.haloscheme = FIELD_HALO_OPENMP; + opts.haloverbose = rt_switch(rt, "field_halo_verbose"); + } field_create(pe, cs, le, "phi", &opts, &ludwig->phi); field_grad_create(pe, ludwig->phi, ngrad, &ludwig->phi_grad); phi_ch_create(pe, cs, le, &ch_options, &ludwig->pch); @@ -1731,6 +1736,11 @@ int free_energy_init_rt(ludwig_t * ludwig) { { field_options_t opts = field_options_ndata_nhalo(NQAB, nhalo); + + if (rt_switch(rt, "field_halo_openmp")) { + opts.haloscheme = FIELD_HALO_OPENMP; + opts.haloverbose = rt_switch(rt, "field_halo_verbose"); + } field_create(pe, cs, le, "q", &opts, &ludwig->q); field_grad_create(pe, ludwig->q, ngrad, &ludwig->q_grad); } From 8296d9e6773305824a7c14d7ed00aa7e9f53699e Mon Sep 17 00:00:00 2001 From: not populated Date: Thu, 10 Feb 2022 08:54:39 +0000 Subject: [PATCH 34/64] LC droplet emulsion benchmark --- tests/performance/cray-archer2-drop/input | 114 ++ tests/performance/cray-archer2-drop/qscript | 38 + .../cray-archer2-drop/slurm-1046434.out | 1088 +++++++++++++++++ 3 files changed, 1240 insertions(+) create mode 100644 tests/performance/cray-archer2-drop/input create mode 100644 tests/performance/cray-archer2-drop/qscript create mode 100644 tests/performance/cray-archer2-drop/slurm-1046434.out diff --git a/tests/performance/cray-archer2-drop/input b/tests/performance/cray-archer2-drop/input new file mode 100644 index 000000000..ff334503b --- /dev/null +++ b/tests/performance/cray-archer2-drop/input @@ -0,0 +1,114 @@ +############################################################################## +# +# Ludwig input file liquid crystal emulsion (droplet) benchmkark +# +############################################################################## + +N_cycles 1000 + +############################################################################## +# +# System and MPI +# +############################################################################## + +size 128_128_128 + +lb_halo_scheme lb_halo_openmp_reduced +field_halo_openmp yes +hydro_halo_scheme hydro_u_halo_openmp + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.5 +viscosity_bulk 0.5 + +isothermal_fluctuations off + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy lc_droplet + +fe_use_stress_relaxation yes +fd_advection_scheme_order 3 +fd_gradient_calculation 3d_7pt_fluid + +############################################################################### +# +# Free energy / order parameters +# +############################################################################### + +symmetric_a -0.000625 +symmetric_b 0.000625 +symmetric_kappa 0.00053 + +mobility 5.0 +phi_initialisation patches +phi_init_patch_size 4 +phi_init_patch_vol 0.01 + +lc_a0 0.05 +lc_q0 0.06942 +lc_kappa0 0.14 +lc_kappa1 0.14 +lc_xi 0.7 + +lc_Gamma 0.5 + +lc_q_initialisation o8m +lc_q_init_amplitude -0.2 +lc_init_redshift 1.0 + +lc_anchoring_method none + +lc_droplet_gamma 2.586 +lc_droplet_delta 0.25 +lc_droplet_W 0.0 + + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init no_colloids + +############################################################################### +# +# Periodic conditions / boundaries +# +############################################################################### + +periodicity 1_1_1 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 1000 +config_at_end no + +timer_lap_report yes +timer_lap_report_freq 1000 + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/tests/performance/cray-archer2-drop/qscript b/tests/performance/cray-archer2-drop/qscript new file mode 100644 index 000000000..c9c991b36 --- /dev/null +++ b/tests/performance/cray-archer2-drop/qscript @@ -0,0 +1,38 @@ +#!/bin/bash + +#SBATCH --exclusive +#SBATCH --export=none +#SBATCH --partition=standard +#SBATCH --qos=standard + +#SBATCH --nodes=1 +#SBATCH --time=0:20:00 +#SBATCH --ntasks-per-node=8 + +#SBATCH --cpus-per-task=16 +#SBATCH --distribution=block:block +#SBATCH --hint=nomultithread + +module load cpe/21.09 +module load PrgEnv-aocc +module list + +export OMP_NUM_THREADS=16 +export OMP_PLACES=cores + +module load xthi + +srun -n 1 xthi +srun -n 1 ./Ludwig.exe + +srun -n 2 xthi +srun -n 2 ./Ludwig.exe + +srun -n 4 xthi +srun -n 4 ./Ludwig.exe + +srun -n 8 xthi +srun -n 8 ./Ludwig.exe + + + diff --git a/tests/performance/cray-archer2-drop/slurm-1046434.out b/tests/performance/cray-archer2-drop/slurm-1046434.out new file mode 100644 index 000000000..83cfa1e28 --- /dev/null +++ b/tests/performance/cray-archer2-drop/slurm-1046434.out @@ -0,0 +1,1088 @@ + +The following have been reloaded with a version change: + 1) PrgEnv-cray/8.0.0 => PrgEnv-cray/8.1.0 + 2) cce/11.0.4 => cce/12.0.3 + 3) cray-libsci/21.04.1.1 => cray-libsci/21.08.1.2 + 4) cray-mpich/8.1.4 => cray-mpich/8.1.9 + 5) craype/2.7.6 => craype/2.7.10 + + +Lmod is automatically replacing "cce/12.0.3" with "aocc/3.0.0". + + +Lmod is automatically replacing "PrgEnv-cray/8.1.0" with "PrgEnv-aocc/8.1.0". + + +Due to MODULEPATH changes, the following have been reloaded: + 1) cray-mpich/8.1.9 + + +Currently Loaded Modules: + 1) cpe/21.09 6) craype-network-ofi 11) epcc-setup-env + 2) aocc/3.0.0 7) cray-dsmml/0.2.1 12) load-epcc-module + 3) craype/2.7.10 8) cray-mpich/8.1.9 13) PrgEnv-aocc/8.1.0 + 4) craype-x86-rome 9) cray-libsci/21.08.1.2 + 5) libfabric/1.11.0.4.71 10) bolt/0.7 + + + +Node summary for 1 nodes: +Node 0, hostname nid002230, mpi 1, omp 16, executable xthi +MPI summary: 1 ranks +Node 0, rank 0, thread 0, (affinity = 0) +Node 0, rank 0, thread 1, (affinity = 1) +Node 0, rank 0, thread 2, (affinity = 2) +Node 0, rank 0, thread 3, (affinity = 3) +Node 0, rank 0, thread 4, (affinity = 4) +Node 0, rank 0, thread 5, (affinity = 5) +Node 0, rank 0, thread 6, (affinity = 6) +Node 0, rank 0, thread 7, (affinity = 7) +Node 0, rank 0, thread 8, (affinity = 8) +Node 0, rank 0, thread 9, (affinity = 9) +Node 0, rank 0, thread 10, (affinity = 10) +Node 0, rank 0, thread 11, (affinity = 11) +Node 0, rank 0, thread 12, (affinity = 12) +Node 0, rank 0, thread 13, (affinity = 13) +Node 0, rank 0, thread 14, (affinity = 14) +Node 0, rank 0, thread 15, (affinity = 15) +Welcome to Ludwig v0.15.0 (Serial version running on 1 process) +Start time: Thu Feb 3 08:54:03 2022 + +Compiler: + name: Clang 12.0.0 + version-string: 12.0.0 (CLANG: AOCC_3.0.0-Build#78 2020_12_10) + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. + +Read 39 user parameters from input + +Liquid crystal droplet free energy selected + +System details +-------------- +System size: 128 128 128 +Decomposition: 1 1 1 +Local domain: 128 128 128 +Periodic: 1 1 1 +Halo nhalo: 2 +Reorder: true +Initialised: 1 + +Free energy details +------------------- + +Symmetric phi^4 free energy selected. + +Parameters: +Bulk parameter A = -6.25000e-04 +Bulk parameter B = 6.25000e-04 +Surface penalty kappa = 5.30000e-04 +Surface tension = 5.42627e-04 +Interfacial width = 1.30231e+00 + +Using Cahn-Hilliard finite difference solver. +Mobility M = 5.00000e+00 +Force calculation: divergence method + +Free energy details +------------------- + +Blue phase free energy selected. + +Liquid crystal blue phase free energy +Bulk parameter A0: = 5.0000000e-02 +Magnitude of order gamma = 0.0000000e+00 +Pitch wavevector q0 = 6.9420000e-02 +... gives pitch length = 9.0509728e+01 +Elastic constant kappa0 = 1.4000000e-01 +Elastic constant kappa1 = 1.4000000e-01 +Amplitude (uniaxial) order = -2.0000000e-01 +Effective aspect ratio xi = 7.0000000e-01 +Chirality = inf +Reduced temperature = inf +Initial redshift = 1.0000000e+00 +Dynamic redshift update = no +Liquid crystal activity No + +Using Beris-Edwards solver: +Rotational diffusion const = 5.0000000e-01 + +Liquid crystal droplet coupling parameters +Isotropic/LC control gamma0 = 2.58600e+00 +Isotropic/LC control delta = 2.50000e-01 +Anchoring parameter W = 0.00000e+00 + +Split symmetric/antisymmetric stress relaxation/force + +System properties +---------------- +Mean fluid density: 1.00000e+00 +Shear viscosity 5.00000e-01 +Bulk viscosity 5.00000e-01 +Temperature 0.00000e+00 +External body force density 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field amplitude 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field frequency 0.00000e+00 +External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 + +Lattice Boltzmann distributions +------------------------------- +Model: d3q19 +SIMD vector len: 2 +Number of sets: 1 +Halo type: full +Input format: binary +Output format: binary +I/O grid: 1 1 1 +Halo scheme: lb_halo_openmp_reduced + +Lattice Boltzmann collision +--------------------------- +Relaxation time scheme: M10 +Hydrodynamic modes: on +Ghost modes: on +Isothermal fluctuations: off +Shear relaxation time: 2.00000e+00 +Bulk relaxation time: 2.00000e+00 +Ghost relaxation time: 1.00000e+00 +[User ] Random number seed: 8361235 + +Hydrodynamics +------------- +Hydrodynamics: on +Hydro halo: hydro_u_halo_openmp + +Order parameter I/O +------------------- +Order parameter I/O format: +I/O decomposition: 1 1 1 + +Advection scheme order: 3 +Initialising phi in patches +Gradient calculation: 3d_7pt_fluid +Gradient calculation: 3d_7pt_fluid + + +Initialising Q_ab using O8M (BPI) +Initial conditions. + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[phi] 2.0533760e+06 9.7912598e-01 4.1312322e-02 -1.0000000e+00 1.0000000e+00 +[phi] 1.2842893e-11 6.1239688e-18 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063169e-07 -1.1951050e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.5062984e-07 -1.1950962e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.4095448e-12 -1.1489605e-18 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063149e-07 -1.1951041e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 + +Momentum - x y z +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Starting time step loop. + +Lap time at step 1000 is: 450.529 seconds at Thu Feb 3 09:01:34 2022 + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 3.4267272e-08 0.99952741126 1.00101985946 +[phi] 2.0533760e+06 9.7912598e-01 6.0807473e-03 -9.4946680e-01 1.0194923e+00 +[phi] -1.7583129e+02 -8.3842891e-05 2.2923048e-02 -1.8127091e-01 3.6079870e-01 +[phi] -8.1261292e+01 -3.8748404e-05 1.6198950e-02 -2.6192893e-01 2.6189590e-01 +[phi] -9.6422565e+00 -4.5977862e-06 1.6196111e-02 -2.6190016e-01 2.6190208e-01 +[phi] 1.0391124e+02 4.9548738e-05 2.2942077e-02 -1.8126459e-01 3.6082540e-01 +[phi] 3.8654612e+01 1.8431955e-05 1.6210944e-02 -2.6197563e-01 2.6193383e-01 + +Free energy density - timestep total fluid +[fed] 1000 -5.4817966053e-04 -5.4817966053e-04 + +Momentum - x y z +[total ] 3.0260919e-11 2.0686231e-13 8.0804460e-13 +[fluid ] 3.0260919e-11 2.0686231e-13 8.0804460e-13 + +Velocity - x y z +[minimum ] -1.7568896e-04 -1.3950162e-04 -1.2873475e-04 +[maximum ] 1.1618850e-04 1.4667660e-04 1.2562697e-04 + +Completed cycle 1000 + +Timer resolution: 2e-08 second + +Timer statistics + Section: tmin tmax total + Total: 452.385 452.385 452.385 452.384680 (1 call) + Time step loop: 0.448 0.490 449.345 0.449345 (1000 calls) + Propagation: 0.044 0.045 44.024 0.044024 (1000 calls) + Propagtn (krnl) : 0.044 0.045 44.019 0.044019 (1000 calls) + Collision: 0.051 0.058 50.768 0.050768 (1000 calls) + Collision (krnl) : 0.051 0.058 50.760 0.050760 (1000 calls) + Lattice halos: 0.001 0.002 1.537 0.001537 (1000 calls) + -> irecv: 0.000 0.000 0.006 0.000006 (1000 calls) + -> pack: 0.001 0.001 0.905 0.000905 (1000 calls) + -> isend: 0.000 0.000 0.009 0.000009 (1000 calls) + -> waitall: 0.000 0.000 0.019 0.000019 (1000 calls) + -> unpack: 0.001 0.001 0.595 0.000595 (1000 calls) + phi gradients: 0.038 0.055 38.041 0.038041 (1000 calls) + phi grad (krnl) : 0.005 0.036 29.783 0.014892 (2000 calls) + phi halos: 0.000 0.002 2.090 0.001045 (2000 calls) + -> irecv: 0.000 0.000 0.018 0.000009 (2000 calls) + -> pack: 0.000 0.001 1.336 0.000668 (2000 calls) + -> isend: 0.000 0.000 0.023 0.000012 (2000 calls) + -> waitall: 0.000 0.000 0.041 0.000020 (2000 calls) + -> unpack: 0.000 0.001 0.671 0.000335 (2000 calls) + BBL: 0.000 0.000 0.001 0.000001 (1000 calls) + Force calculation: 0.138 0.146 138.330 0.138330 (1000 calls) + Phi force (krnl) : 0.010 0.011 10.472 0.010472 (1000 calls) + phi update: 0.173 0.195 173.483 0.173483 (1000 calls) + Velocity Halo : 0.000 0.001 0.533 0.000533 (1000 calls) + -> irecv: 0.000 0.000 0.014 0.000007 (2000 calls) + -> pack: 0.000 0.001 0.608 0.000304 (2000 calls) + -> isend: 0.000 0.000 0.023 0.000011 (2000 calls) + -> waitall: 0.000 0.000 0.039 0.000019 (2000 calls) + -> unpack: 0.000 0.000 0.241 0.000120 (2000 calls) +BE mol field (krnl) : 0.026 0.029 25.840 0.025840 (1000 calls) +BP BE update (krnl) : 0.021 0.024 20.659 0.020659 (1000 calls) + Advectn (krnl) : 0.009 0.049 44.002 0.022001 (2000 calls) + Advectn BCS (krnl) : 0.003 0.021 22.696 0.011348 (2000 calls) + Free1: 0.000 1.420 1.422 0.001422 (1000 calls) +End time: Thu Feb 3 09:01:36 2022 +Ludwig finished normally. +Node summary for 1 nodes: +Node 0, hostname nid002230, mpi 2, omp 16, executable xthi +MPI summary: 2 ranks +Node 0, rank 0, thread 0, (affinity = 0) +Node 0, rank 0, thread 1, (affinity = 1) +Node 0, rank 0, thread 2, (affinity = 2) +Node 0, rank 0, thread 3, (affinity = 3) +Node 0, rank 0, thread 4, (affinity = 4) +Node 0, rank 0, thread 5, (affinity = 5) +Node 0, rank 0, thread 6, (affinity = 6) +Node 0, rank 0, thread 7, (affinity = 7) +Node 0, rank 0, thread 8, (affinity = 8) +Node 0, rank 0, thread 9, (affinity = 9) +Node 0, rank 0, thread 10, (affinity = 10) +Node 0, rank 0, thread 11, (affinity = 11) +Node 0, rank 0, thread 12, (affinity = 12) +Node 0, rank 0, thread 13, (affinity = 13) +Node 0, rank 0, thread 14, (affinity = 14) +Node 0, rank 0, thread 15, (affinity = 15) +Node 0, rank 1, thread 0, (affinity = 16) +Node 0, rank 1, thread 1, (affinity = 17) +Node 0, rank 1, thread 2, (affinity = 18) +Node 0, rank 1, thread 3, (affinity = 19) +Node 0, rank 1, thread 4, (affinity = 20) +Node 0, rank 1, thread 5, (affinity = 21) +Node 0, rank 1, thread 6, (affinity = 22) +Node 0, rank 1, thread 7, (affinity = 23) +Node 0, rank 1, thread 8, (affinity = 24) +Node 0, rank 1, thread 9, (affinity = 25) +Node 0, rank 1, thread 10, (affinity = 26) +Node 0, rank 1, thread 11, (affinity = 27) +Node 0, rank 1, thread 12, (affinity = 28) +Node 0, rank 1, thread 13, (affinity = 29) +Node 0, rank 1, thread 14, (affinity = 30) +Node 0, rank 1, thread 15, (affinity = 31) +Welcome to Ludwig v0.15.0 (MPI version running on 2 processes) +Start time: Thu Feb 3 09:01:37 2022 + +Compiler: + name: Clang 12.0.0 + version-string: 12.0.0 (CLANG: AOCC_3.0.0-Build#78 2020_12_10) + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. + +Read 39 user parameters from input + +Liquid crystal droplet free energy selected + +System details +-------------- +System size: 128 128 128 +Decomposition: 2 1 1 +Local domain: 64 128 128 +Periodic: 1 1 1 +Halo nhalo: 2 +Reorder: true +Initialised: 1 + +Free energy details +------------------- + +Symmetric phi^4 free energy selected. + +Parameters: +Bulk parameter A = -6.25000e-04 +Bulk parameter B = 6.25000e-04 +Surface penalty kappa = 5.30000e-04 +Surface tension = 5.42627e-04 +Interfacial width = 1.30231e+00 + +Using Cahn-Hilliard finite difference solver. +Mobility M = 5.00000e+00 +Force calculation: divergence method + +Free energy details +------------------- + +Blue phase free energy selected. + +Liquid crystal blue phase free energy +Bulk parameter A0: = 5.0000000e-02 +Magnitude of order gamma = 0.0000000e+00 +Pitch wavevector q0 = 6.9420000e-02 +... gives pitch length = 9.0509728e+01 +Elastic constant kappa0 = 1.4000000e-01 +Elastic constant kappa1 = 1.4000000e-01 +Amplitude (uniaxial) order = -2.0000000e-01 +Effective aspect ratio xi = 7.0000000e-01 +Chirality = inf +Reduced temperature = inf +Initial redshift = 1.0000000e+00 +Dynamic redshift update = no +Liquid crystal activity No + +Using Beris-Edwards solver: +Rotational diffusion const = 5.0000000e-01 + +Liquid crystal droplet coupling parameters +Isotropic/LC control gamma0 = 2.58600e+00 +Isotropic/LC control delta = 2.50000e-01 +Anchoring parameter W = 0.00000e+00 + +Split symmetric/antisymmetric stress relaxation/force + +System properties +---------------- +Mean fluid density: 1.00000e+00 +Shear viscosity 5.00000e-01 +Bulk viscosity 5.00000e-01 +Temperature 0.00000e+00 +External body force density 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field amplitude 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field frequency 0.00000e+00 +External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 + +Lattice Boltzmann distributions +------------------------------- +Model: d3q19 +SIMD vector len: 2 +Number of sets: 1 +Halo type: full +Input format: binary +Output format: binary +I/O grid: 1 1 1 +Halo scheme: lb_halo_openmp_reduced + +Lattice Boltzmann collision +--------------------------- +Relaxation time scheme: M10 +Hydrodynamic modes: on +Ghost modes: on +Isothermal fluctuations: off +Shear relaxation time: 2.00000e+00 +Bulk relaxation time: 2.00000e+00 +Ghost relaxation time: 1.00000e+00 +[User ] Random number seed: 8361235 + +Hydrodynamics +------------- +Hydrodynamics: on +Hydro halo: hydro_u_halo_openmp + +Order parameter I/O +------------------- +Order parameter I/O format: +I/O decomposition: 1 1 1 + +Advection scheme order: 3 +Initialising phi in patches +Gradient calculation: 3d_7pt_fluid +Gradient calculation: 3d_7pt_fluid + + +Initialising Q_ab using O8M (BPI) +Initial conditions. + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[phi] 2.0533760e+06 9.7912598e-01 4.1312322e-02 -1.0000000e+00 1.0000000e+00 +[phi] 1.2993837e-11 6.1959444e-18 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063171e-07 -1.1951051e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.5062983e-07 -1.1950961e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.4582799e-12 -1.1721992e-18 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063141e-07 -1.1951037e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 + +Momentum - x y z +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Starting time step loop. + +Lap time at step 1000 is: 229.729 seconds at Thu Feb 3 09:05:27 2022 + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 3.4267385e-08 0.99952741126 1.00101985946 +[phi] 2.0533760e+06 9.7912598e-01 6.0807473e-03 -9.4946680e-01 1.0194923e+00 +[phi] -1.7583129e+02 -8.3842891e-05 2.2923048e-02 -1.8127091e-01 3.6079870e-01 +[phi] -8.1261292e+01 -3.8748404e-05 1.6198950e-02 -2.6192893e-01 2.6189590e-01 +[phi] -9.6422565e+00 -4.5977862e-06 1.6196111e-02 -2.6190016e-01 2.6190208e-01 +[phi] 1.0391124e+02 4.9548738e-05 2.2942077e-02 -1.8126459e-01 3.6082540e-01 +[phi] 3.8654612e+01 1.8431955e-05 1.6210944e-02 -2.6197563e-01 2.6193383e-01 + +Free energy density - timestep total fluid +[fed] 1000 -5.4817966053e-04 -5.4817966053e-04 + +Momentum - x y z +[total ] 2.8291005e-11 1.9228022e-13 -4.7379808e-13 +[fluid ] 2.8291005e-11 1.9228022e-13 -4.7379808e-13 + +Velocity - x y z +[minimum ] -1.7568896e-04 -1.3950162e-04 -1.2873475e-04 +[maximum ] 1.1618850e-04 1.4667660e-04 1.2562697e-04 + +Completed cycle 1000 + +Timer resolution: 2e-08 second + +Timer statistics + Section: tmin tmax total + Total: 230.670 230.671 230.671 230.670741 (1 call) + Time step loop: 0.228 0.285 229.136 0.229136 (1000 calls) + Propagation: 0.022 0.033 22.150 0.022150 (1000 calls) + Propagtn (krnl) : 0.022 0.033 22.145 0.022145 (1000 calls) + Collision: 0.025 0.039 25.497 0.025497 (1000 calls) + Collision (krnl) : 0.025 0.039 25.489 0.025489 (1000 calls) + Lattice halos: 0.001 0.027 1.443 0.001443 (1000 calls) + -> irecv: 0.000 0.000 0.006 0.000006 (1000 calls) + -> pack: 0.001 0.001 0.567 0.000567 (1000 calls) + -> isend: 0.000 0.000 0.014 0.000014 (1000 calls) + -> waitall: 0.000 0.026 0.470 0.000470 (1000 calls) + -> unpack: 0.000 0.001 0.384 0.000384 (1000 calls) + phi gradients: 0.020 0.033 20.766 0.020766 (1000 calls) + phi grad (krnl) : 0.002 0.019 15.133 0.007567 (2000 calls) + phi halos: 0.000 0.012 2.698 0.001349 (2000 calls) + -> irecv: 0.000 0.000 0.017 0.000009 (2000 calls) + -> pack: 0.000 0.001 0.876 0.000438 (2000 calls) + -> isend: 0.000 0.000 0.043 0.000022 (2000 calls) + -> waitall: 0.000 0.011 1.189 0.000594 (2000 calls) + -> unpack: 0.000 0.001 0.572 0.000286 (2000 calls) + BBL: 0.000 0.000 0.001 0.000001 (1000 calls) + Force calculation: 0.070 0.090 70.581 0.070581 (1000 calls) + Phi force (krnl) : 0.006 0.007 5.604 0.005604 (1000 calls) + phi update: 0.087 0.111 87.289 0.087289 (1000 calls) + Velocity Halo : 0.000 0.013 0.474 0.000474 (1000 calls) + -> irecv: 0.000 0.000 0.014 0.000007 (2000 calls) + -> pack: 0.000 0.000 0.280 0.000140 (2000 calls) + -> isend: 0.000 0.000 0.037 0.000019 (2000 calls) + -> waitall: 0.000 0.013 0.511 0.000256 (2000 calls) + -> unpack: 0.000 0.000 0.169 0.000084 (2000 calls) +BE mol field (krnl) : 0.013 0.017 13.542 0.013542 (1000 calls) +BP BE update (krnl) : 0.010 0.012 10.460 0.010460 (1000 calls) + Advectn (krnl) : 0.004 0.026 21.645 0.010823 (2000 calls) + Advectn BCS (krnl) : 0.002 0.012 10.661 0.005331 (2000 calls) + Free1: 0.000 0.710 0.711 0.000711 (1000 calls) +End time: Thu Feb 3 09:05:28 2022 +Ludwig finished normally. +Node summary for 1 nodes: +Node 0, hostname nid002230, mpi 4, omp 16, executable xthi +MPI summary: 4 ranks +Node 0, rank 0, thread 0, (affinity = 0) +Node 0, rank 0, thread 1, (affinity = 1) +Node 0, rank 0, thread 2, (affinity = 2) +Node 0, rank 0, thread 3, (affinity = 3) +Node 0, rank 0, thread 4, (affinity = 4) +Node 0, rank 0, thread 5, (affinity = 5) +Node 0, rank 0, thread 6, (affinity = 6) +Node 0, rank 0, thread 7, (affinity = 7) +Node 0, rank 0, thread 8, (affinity = 8) +Node 0, rank 0, thread 9, (affinity = 9) +Node 0, rank 0, thread 10, (affinity = 10) +Node 0, rank 0, thread 11, (affinity = 11) +Node 0, rank 0, thread 12, (affinity = 12) +Node 0, rank 0, thread 13, (affinity = 13) +Node 0, rank 0, thread 14, (affinity = 14) +Node 0, rank 0, thread 15, (affinity = 15) +Node 0, rank 1, thread 0, (affinity = 16) +Node 0, rank 1, thread 1, (affinity = 17) +Node 0, rank 1, thread 2, (affinity = 18) +Node 0, rank 1, thread 3, (affinity = 19) +Node 0, rank 1, thread 4, (affinity = 20) +Node 0, rank 1, thread 5, (affinity = 21) +Node 0, rank 1, thread 6, (affinity = 22) +Node 0, rank 1, thread 7, (affinity = 23) +Node 0, rank 1, thread 8, (affinity = 24) +Node 0, rank 1, thread 9, (affinity = 25) +Node 0, rank 1, thread 10, (affinity = 26) +Node 0, rank 1, thread 11, (affinity = 27) +Node 0, rank 1, thread 12, (affinity = 28) +Node 0, rank 1, thread 13, (affinity = 29) +Node 0, rank 1, thread 14, (affinity = 30) +Node 0, rank 1, thread 15, (affinity = 31) +Node 0, rank 2, thread 0, (affinity = 32) +Node 0, rank 2, thread 1, (affinity = 33) +Node 0, rank 2, thread 2, (affinity = 34) +Node 0, rank 2, thread 3, (affinity = 35) +Node 0, rank 2, thread 4, (affinity = 36) +Node 0, rank 2, thread 5, (affinity = 37) +Node 0, rank 2, thread 6, (affinity = 38) +Node 0, rank 2, thread 7, (affinity = 39) +Node 0, rank 2, thread 8, (affinity = 40) +Node 0, rank 2, thread 9, (affinity = 41) +Node 0, rank 2, thread 10, (affinity = 42) +Node 0, rank 2, thread 11, (affinity = 43) +Node 0, rank 2, thread 12, (affinity = 44) +Node 0, rank 2, thread 13, (affinity = 45) +Node 0, rank 2, thread 14, (affinity = 46) +Node 0, rank 2, thread 15, (affinity = 47) +Node 0, rank 3, thread 0, (affinity = 48) +Node 0, rank 3, thread 1, (affinity = 49) +Node 0, rank 3, thread 2, (affinity = 50) +Node 0, rank 3, thread 3, (affinity = 51) +Node 0, rank 3, thread 4, (affinity = 52) +Node 0, rank 3, thread 5, (affinity = 53) +Node 0, rank 3, thread 6, (affinity = 54) +Node 0, rank 3, thread 7, (affinity = 55) +Node 0, rank 3, thread 8, (affinity = 56) +Node 0, rank 3, thread 9, (affinity = 57) +Node 0, rank 3, thread 10, (affinity = 58) +Node 0, rank 3, thread 11, (affinity = 59) +Node 0, rank 3, thread 12, (affinity = 60) +Node 0, rank 3, thread 13, (affinity = 61) +Node 0, rank 3, thread 14, (affinity = 62) +Node 0, rank 3, thread 15, (affinity = 63) +Welcome to Ludwig v0.15.0 (MPI version running on 4 processes) +Start time: Thu Feb 3 09:05:30 2022 + +Compiler: + name: Clang 12.0.0 + version-string: 12.0.0 (CLANG: AOCC_3.0.0-Build#78 2020_12_10) + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. + +Read 39 user parameters from input + +Liquid crystal droplet free energy selected + +System details +-------------- +System size: 128 128 128 +Decomposition: 2 2 1 +Local domain: 64 64 128 +Periodic: 1 1 1 +Halo nhalo: 2 +Reorder: true +Initialised: 1 + +Free energy details +------------------- + +Symmetric phi^4 free energy selected. + +Parameters: +Bulk parameter A = -6.25000e-04 +Bulk parameter B = 6.25000e-04 +Surface penalty kappa = 5.30000e-04 +Surface tension = 5.42627e-04 +Interfacial width = 1.30231e+00 + +Using Cahn-Hilliard finite difference solver. +Mobility M = 5.00000e+00 +Force calculation: divergence method + +Free energy details +------------------- + +Blue phase free energy selected. + +Liquid crystal blue phase free energy +Bulk parameter A0: = 5.0000000e-02 +Magnitude of order gamma = 0.0000000e+00 +Pitch wavevector q0 = 6.9420000e-02 +... gives pitch length = 9.0509728e+01 +Elastic constant kappa0 = 1.4000000e-01 +Elastic constant kappa1 = 1.4000000e-01 +Amplitude (uniaxial) order = -2.0000000e-01 +Effective aspect ratio xi = 7.0000000e-01 +Chirality = inf +Reduced temperature = inf +Initial redshift = 1.0000000e+00 +Dynamic redshift update = no +Liquid crystal activity No + +Using Beris-Edwards solver: +Rotational diffusion const = 5.0000000e-01 + +Liquid crystal droplet coupling parameters +Isotropic/LC control gamma0 = 2.58600e+00 +Isotropic/LC control delta = 2.50000e-01 +Anchoring parameter W = 0.00000e+00 + +Split symmetric/antisymmetric stress relaxation/force + +System properties +---------------- +Mean fluid density: 1.00000e+00 +Shear viscosity 5.00000e-01 +Bulk viscosity 5.00000e-01 +Temperature 0.00000e+00 +External body force density 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field amplitude 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field frequency 0.00000e+00 +External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 + +Lattice Boltzmann distributions +------------------------------- +Model: d3q19 +SIMD vector len: 2 +Number of sets: 1 +Halo type: full +Input format: binary +Output format: binary +I/O grid: 1 1 1 +Halo scheme: lb_halo_openmp_reduced + +Lattice Boltzmann collision +--------------------------- +Relaxation time scheme: M10 +Hydrodynamic modes: on +Ghost modes: on +Isothermal fluctuations: off +Shear relaxation time: 2.00000e+00 +Bulk relaxation time: 2.00000e+00 +Ghost relaxation time: 1.00000e+00 +[User ] Random number seed: 8361235 + +Hydrodynamics +------------- +Hydrodynamics: on +Hydro halo: hydro_u_halo_openmp + +Order parameter I/O +------------------- +Order parameter I/O format: +I/O decomposition: 1 1 1 + +Advection scheme order: 3 +Initialising phi in patches +Gradient calculation: 3d_7pt_fluid +Gradient calculation: 3d_7pt_fluid + + +Initialising Q_ab using O8M (BPI) +Initial conditions. + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[phi] 2.0533760e+06 9.7912598e-01 4.1312322e-02 -1.0000000e+00 1.0000000e+00 +[phi] 1.2124196e-11 5.7812674e-18 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063170e-07 -1.1951051e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.5063025e-07 -1.1950982e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -9.6280945e-13 -4.5910332e-19 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5063327e-07 -1.1951125e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 + +Momentum - x y z +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Starting time step loop. + +Lap time at step 1000 is: 124.203 seconds at Thu Feb 3 09:07:34 2022 + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 3.4267326e-08 0.99952741126 1.00101985946 +[phi] 2.0533760e+06 9.7912598e-01 6.0807473e-03 -9.4946680e-01 1.0194923e+00 +[phi] -1.7583129e+02 -8.3842891e-05 2.2923048e-02 -1.8127091e-01 3.6079870e-01 +[phi] -8.1261292e+01 -3.8748404e-05 1.6198950e-02 -2.6192893e-01 2.6189590e-01 +[phi] -9.6422565e+00 -4.5977862e-06 1.6196111e-02 -2.6190016e-01 2.6190208e-01 +[phi] 1.0391124e+02 4.9548738e-05 2.2942077e-02 -1.8126459e-01 3.6082540e-01 +[phi] 3.8654612e+01 1.8431955e-05 1.6210944e-02 -2.6197563e-01 2.6193383e-01 + +Free energy density - timestep total fluid +[fed] 1000 -5.4817966053e-04 -5.4817966053e-04 + +Momentum - x y z +[total ] 2.8026220e-11 5.2511814e-13 -7.1139969e-13 +[fluid ] 2.8026220e-11 5.2511814e-13 -7.1139969e-13 + +Velocity - x y z +[minimum ] -1.7568896e-04 -1.3950162e-04 -1.2873475e-04 +[maximum ] 1.1618850e-04 1.4667660e-04 1.2562697e-04 + +Completed cycle 1000 + +Timer resolution: 2e-08 second + +Timer statistics + Section: tmin tmax total + Total: 124.719 124.719 124.719 124.719141 (1 call) + Time step loop: 0.123 0.145 123.878 0.123878 (1000 calls) + Propagation: 0.011 0.011 10.730 0.010730 (1000 calls) + Propagtn (krnl) : 0.011 0.011 10.724 0.010724 (1000 calls) + Collision: 0.016 0.017 15.954 0.015954 (1000 calls) + Collision (krnl) : 0.016 0.017 15.947 0.015947 (1000 calls) + Lattice halos: 0.001 0.004 1.129 0.001129 (1000 calls) + -> irecv: 0.000 0.000 0.006 0.000006 (1000 calls) + -> pack: 0.000 0.001 0.365 0.000365 (1000 calls) + -> isend: 0.000 0.000 0.015 0.000015 (1000 calls) + -> waitall: 0.000 0.003 0.484 0.000484 (1000 calls) + -> unpack: 0.000 0.001 0.258 0.000258 (1000 calls) + phi gradients: 0.010 0.018 10.447 0.010447 (1000 calls) + phi grad (krnl) : 0.001 0.010 7.357 0.003679 (2000 calls) + phi halos: 0.000 0.002 1.959 0.000980 (2000 calls) + -> irecv: 0.000 0.000 0.012 0.000006 (2000 calls) + -> pack: 0.000 0.001 0.436 0.000218 (2000 calls) + -> isend: 0.000 0.000 0.039 0.000020 (2000 calls) + -> waitall: 0.000 0.002 1.114 0.000557 (2000 calls) + -> unpack: 0.000 0.001 0.356 0.000178 (2000 calls) + BBL: 0.000 0.000 0.001 0.000001 (1000 calls) + Force calculation: 0.040 0.044 40.544 0.040544 (1000 calls) + Phi force (krnl) : 0.003 0.006 3.079 0.003079 (1000 calls) + phi update: 0.044 0.057 44.398 0.044398 (1000 calls) + Velocity Halo : 0.000 0.004 0.411 0.000411 (1000 calls) + -> irecv: 0.000 0.000 0.013 0.000007 (2000 calls) + -> pack: 0.000 0.001 0.160 0.000080 (2000 calls) + -> isend: 0.000 0.000 0.040 0.000020 (2000 calls) + -> waitall: 0.000 0.004 0.499 0.000249 (2000 calls) + -> unpack: 0.000 0.000 0.119 0.000060 (2000 calls) +BE mol field (krnl) : 0.008 0.010 8.110 0.008110 (1000 calls) +BP BE update (krnl) : 0.005 0.006 4.933 0.004933 (1000 calls) + Advectn (krnl) : 0.003 0.013 9.243 0.004622 (2000 calls) + Advectn BCS (krnl) : 0.001 0.006 5.333 0.002667 (2000 calls) + Free1: 0.000 0.387 0.369 0.000369 (1000 calls) +End time: Thu Feb 3 09:07:34 2022 +Ludwig finished normally. +Node summary for 1 nodes: +Node 0, hostname nid002230, mpi 8, omp 16, executable xthi +MPI summary: 8 ranks +Node 0, rank 0, thread 0, (affinity = 0) +Node 0, rank 0, thread 1, (affinity = 1) +Node 0, rank 0, thread 2, (affinity = 2) +Node 0, rank 0, thread 3, (affinity = 3) +Node 0, rank 0, thread 4, (affinity = 4) +Node 0, rank 0, thread 5, (affinity = 5) +Node 0, rank 0, thread 6, (affinity = 6) +Node 0, rank 0, thread 7, (affinity = 7) +Node 0, rank 0, thread 8, (affinity = 8) +Node 0, rank 0, thread 9, (affinity = 9) +Node 0, rank 0, thread 10, (affinity = 10) +Node 0, rank 0, thread 11, (affinity = 11) +Node 0, rank 0, thread 12, (affinity = 12) +Node 0, rank 0, thread 13, (affinity = 13) +Node 0, rank 0, thread 14, (affinity = 14) +Node 0, rank 0, thread 15, (affinity = 15) +Node 0, rank 1, thread 0, (affinity = 16) +Node 0, rank 1, thread 1, (affinity = 17) +Node 0, rank 1, thread 2, (affinity = 18) +Node 0, rank 1, thread 3, (affinity = 19) +Node 0, rank 1, thread 4, (affinity = 20) +Node 0, rank 1, thread 5, (affinity = 21) +Node 0, rank 1, thread 6, (affinity = 22) +Node 0, rank 1, thread 7, (affinity = 23) +Node 0, rank 1, thread 8, (affinity = 24) +Node 0, rank 1, thread 9, (affinity = 25) +Node 0, rank 1, thread 10, (affinity = 26) +Node 0, rank 1, thread 11, (affinity = 27) +Node 0, rank 1, thread 12, (affinity = 28) +Node 0, rank 1, thread 13, (affinity = 29) +Node 0, rank 1, thread 14, (affinity = 30) +Node 0, rank 1, thread 15, (affinity = 31) +Node 0, rank 2, thread 0, (affinity = 32) +Node 0, rank 2, thread 1, (affinity = 33) +Node 0, rank 2, thread 2, (affinity = 34) +Node 0, rank 2, thread 3, (affinity = 35) +Node 0, rank 2, thread 4, (affinity = 36) +Node 0, rank 2, thread 5, (affinity = 37) +Node 0, rank 2, thread 6, (affinity = 38) +Node 0, rank 2, thread 7, (affinity = 39) +Node 0, rank 2, thread 8, (affinity = 40) +Node 0, rank 2, thread 9, (affinity = 41) +Node 0, rank 2, thread 10, (affinity = 42) +Node 0, rank 2, thread 11, (affinity = 43) +Node 0, rank 2, thread 12, (affinity = 44) +Node 0, rank 2, thread 13, (affinity = 45) +Node 0, rank 2, thread 14, (affinity = 46) +Node 0, rank 2, thread 15, (affinity = 47) +Node 0, rank 3, thread 0, (affinity = 48) +Node 0, rank 3, thread 1, (affinity = 49) +Node 0, rank 3, thread 2, (affinity = 50) +Node 0, rank 3, thread 3, (affinity = 51) +Node 0, rank 3, thread 4, (affinity = 52) +Node 0, rank 3, thread 5, (affinity = 53) +Node 0, rank 3, thread 6, (affinity = 54) +Node 0, rank 3, thread 7, (affinity = 55) +Node 0, rank 3, thread 8, (affinity = 56) +Node 0, rank 3, thread 9, (affinity = 57) +Node 0, rank 3, thread 10, (affinity = 58) +Node 0, rank 3, thread 11, (affinity = 59) +Node 0, rank 3, thread 12, (affinity = 60) +Node 0, rank 3, thread 13, (affinity = 61) +Node 0, rank 3, thread 14, (affinity = 62) +Node 0, rank 3, thread 15, (affinity = 63) +Node 0, rank 4, thread 0, (affinity = 64) +Node 0, rank 4, thread 1, (affinity = 65) +Node 0, rank 4, thread 2, (affinity = 66) +Node 0, rank 4, thread 3, (affinity = 67) +Node 0, rank 4, thread 4, (affinity = 68) +Node 0, rank 4, thread 5, (affinity = 69) +Node 0, rank 4, thread 6, (affinity = 70) +Node 0, rank 4, thread 7, (affinity = 71) +Node 0, rank 4, thread 8, (affinity = 72) +Node 0, rank 4, thread 9, (affinity = 73) +Node 0, rank 4, thread 10, (affinity = 74) +Node 0, rank 4, thread 11, (affinity = 75) +Node 0, rank 4, thread 12, (affinity = 76) +Node 0, rank 4, thread 13, (affinity = 77) +Node 0, rank 4, thread 14, (affinity = 78) +Node 0, rank 4, thread 15, (affinity = 79) +Node 0, rank 5, thread 0, (affinity = 80) +Node 0, rank 5, thread 1, (affinity = 81) +Node 0, rank 5, thread 2, (affinity = 82) +Node 0, rank 5, thread 3, (affinity = 83) +Node 0, rank 5, thread 4, (affinity = 84) +Node 0, rank 5, thread 5, (affinity = 85) +Node 0, rank 5, thread 6, (affinity = 86) +Node 0, rank 5, thread 7, (affinity = 87) +Node 0, rank 5, thread 8, (affinity = 88) +Node 0, rank 5, thread 9, (affinity = 89) +Node 0, rank 5, thread 10, (affinity = 90) +Node 0, rank 5, thread 11, (affinity = 91) +Node 0, rank 5, thread 12, (affinity = 92) +Node 0, rank 5, thread 13, (affinity = 93) +Node 0, rank 5, thread 14, (affinity = 94) +Node 0, rank 5, thread 15, (affinity = 95) +Node 0, rank 6, thread 0, (affinity = 96) +Node 0, rank 6, thread 1, (affinity = 97) +Node 0, rank 6, thread 2, (affinity = 98) +Node 0, rank 6, thread 3, (affinity = 99) +Node 0, rank 6, thread 4, (affinity = 100) +Node 0, rank 6, thread 5, (affinity = 101) +Node 0, rank 6, thread 6, (affinity = 102) +Node 0, rank 6, thread 7, (affinity = 103) +Node 0, rank 6, thread 8, (affinity = 104) +Node 0, rank 6, thread 9, (affinity = 105) +Node 0, rank 6, thread 10, (affinity = 106) +Node 0, rank 6, thread 11, (affinity = 107) +Node 0, rank 6, thread 12, (affinity = 108) +Node 0, rank 6, thread 13, (affinity = 109) +Node 0, rank 6, thread 14, (affinity = 110) +Node 0, rank 6, thread 15, (affinity = 111) +Node 0, rank 7, thread 0, (affinity = 112) +Node 0, rank 7, thread 1, (affinity = 113) +Node 0, rank 7, thread 2, (affinity = 114) +Node 0, rank 7, thread 3, (affinity = 115) +Node 0, rank 7, thread 4, (affinity = 116) +Node 0, rank 7, thread 5, (affinity = 117) +Node 0, rank 7, thread 6, (affinity = 118) +Node 0, rank 7, thread 7, (affinity = 119) +Node 0, rank 7, thread 8, (affinity = 120) +Node 0, rank 7, thread 9, (affinity = 121) +Node 0, rank 7, thread 10, (affinity = 122) +Node 0, rank 7, thread 11, (affinity = 123) +Node 0, rank 7, thread 12, (affinity = 124) +Node 0, rank 7, thread 13, (affinity = 125) +Node 0, rank 7, thread 14, (affinity = 126) +Node 0, rank 7, thread 15, (affinity = 127) +Welcome to Ludwig v0.15.0 (MPI version running on 8 processes) +Start time: Thu Feb 3 09:07:36 2022 + +Compiler: + name: Clang 12.0.0 + version-string: 12.0.0 (CLANG: AOCC_3.0.0-Build#78 2020_12_10) + +Target thread model: OpenMP. +OpenMP threads: 16; maximum number of threads: 16. + +Read 39 user parameters from input + +Liquid crystal droplet free energy selected + +System details +-------------- +System size: 128 128 128 +Decomposition: 2 2 2 +Local domain: 64 64 64 +Periodic: 1 1 1 +Halo nhalo: 2 +Reorder: true +Initialised: 1 + +Free energy details +------------------- + +Symmetric phi^4 free energy selected. + +Parameters: +Bulk parameter A = -6.25000e-04 +Bulk parameter B = 6.25000e-04 +Surface penalty kappa = 5.30000e-04 +Surface tension = 5.42627e-04 +Interfacial width = 1.30231e+00 + +Using Cahn-Hilliard finite difference solver. +Mobility M = 5.00000e+00 +Force calculation: divergence method + +Free energy details +------------------- + +Blue phase free energy selected. + +Liquid crystal blue phase free energy +Bulk parameter A0: = 5.0000000e-02 +Magnitude of order gamma = 0.0000000e+00 +Pitch wavevector q0 = 6.9420000e-02 +... gives pitch length = 9.0509728e+01 +Elastic constant kappa0 = 1.4000000e-01 +Elastic constant kappa1 = 1.4000000e-01 +Amplitude (uniaxial) order = -2.0000000e-01 +Effective aspect ratio xi = 7.0000000e-01 +Chirality = inf +Reduced temperature = inf +Initial redshift = 1.0000000e+00 +Dynamic redshift update = no +Liquid crystal activity No + +Using Beris-Edwards solver: +Rotational diffusion const = 5.0000000e-01 + +Liquid crystal droplet coupling parameters +Isotropic/LC control gamma0 = 2.58600e+00 +Isotropic/LC control delta = 2.50000e-01 +Anchoring parameter W = 0.00000e+00 + +Split symmetric/antisymmetric stress relaxation/force + +System properties +---------------- +Mean fluid density: 1.00000e+00 +Shear viscosity 5.00000e-01 +Bulk viscosity 5.00000e-01 +Temperature 0.00000e+00 +External body force density 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field amplitude 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field frequency 0.00000e+00 +External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 + +Lattice Boltzmann distributions +------------------------------- +Model: d3q19 +SIMD vector len: 2 +Number of sets: 1 +Halo type: full +Input format: binary +Output format: binary +I/O grid: 1 1 1 +Halo scheme: lb_halo_openmp_reduced + +Lattice Boltzmann collision +--------------------------- +Relaxation time scheme: M10 +Hydrodynamic modes: on +Ghost modes: on +Isothermal fluctuations: off +Shear relaxation time: 2.00000e+00 +Bulk relaxation time: 2.00000e+00 +Ghost relaxation time: 1.00000e+00 +[User ] Random number seed: 8361235 + +Hydrodynamics +------------- +Hydrodynamics: on +Hydro halo: hydro_u_halo_openmp + +Order parameter I/O +------------------- +Order parameter I/O format: +I/O decomposition: 1 1 1 + +Advection scheme order: 3 +Initialising phi in patches +Gradient calculation: 3d_7pt_fluid +Gradient calculation: 3d_7pt_fluid + + +Initialising Q_ab using O8M (BPI) +Initial conditions. + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 +[phi] 2.0533760e+06 9.7912598e-01 4.1312322e-02 -1.0000000e+00 1.0000000e+00 +[phi] -1.3453058e-12 -6.4149180e-19 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5062072e-07 -1.1950527e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -2.5061957e-07 -1.1950472e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 +[phi] -6.6716424e-13 -3.1812870e-19 6.0000000e-02 -4.4966070e-01 4.4966073e-01 +[phi] -2.5062494e-07 -1.1950728e-13 5.0000000e-02 -6.0000000e-01 6.0000000e-01 + +Momentum - x y z +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Starting time step loop. + +Lap time at step 1000 is: 59.575 seconds at Thu Feb 3 09:08:36 2022 + +Scalars - total mean variance min max +[rho] 2097152.00 1.00000000000 3.4267345e-08 0.99952741126 1.00101985946 +[phi] 2.0533760e+06 9.7912598e-01 6.0807473e-03 -9.4946680e-01 1.0194923e+00 +[phi] -1.7583129e+02 -8.3842891e-05 2.2923048e-02 -1.8127091e-01 3.6079870e-01 +[phi] -8.1261292e+01 -3.8748404e-05 1.6198950e-02 -2.6192893e-01 2.6189590e-01 +[phi] -9.6422565e+00 -4.5977862e-06 1.6196111e-02 -2.6190016e-01 2.6190208e-01 +[phi] 1.0391124e+02 4.9548738e-05 2.2942077e-02 -1.8126459e-01 3.6082540e-01 +[phi] 3.8654612e+01 1.8431955e-05 1.6210944e-02 -2.6197563e-01 2.6193383e-01 + +Free energy density - timestep total fluid +[fed] 1000 -5.4817966053e-04 -5.4817966053e-04 + +Momentum - x y z +[total ] 2.8606381e-11 -3.3211281e-13 -1.2041201e-12 +[fluid ] 2.8606381e-11 -3.3211281e-13 -1.2041201e-12 + +Velocity - x y z +[minimum ] -1.7568896e-04 -1.3950162e-04 -1.2873475e-04 +[maximum ] 1.1618850e-04 1.4667660e-04 1.2562697e-04 + +Completed cycle 1000 + +Timer resolution: 2e-08 second + +Timer statistics + Section: tmin tmax total + Total: 59.837 59.837 59.837 59.837044 (1 call) + Time step loop: 0.058 0.084 59.423 0.059423 (1000 calls) + Propagation: 0.003 0.005 3.339 0.003339 (1000 calls) + Propagtn (krnl) : 0.003 0.005 3.333 0.003333 (1000 calls) + Collision: 0.008 0.011 8.127 0.008127 (1000 calls) + Collision (krnl) : 0.008 0.011 8.120 0.008120 (1000 calls) + Lattice halos: 0.001 0.007 0.977 0.000977 (1000 calls) + -> irecv: 0.000 0.000 0.007 0.000007 (1000 calls) + -> pack: 0.000 0.001 0.211 0.000211 (1000 calls) + -> isend: 0.000 0.001 0.017 0.000017 (1000 calls) + -> waitall: 0.000 0.007 0.590 0.000590 (1000 calls) + -> unpack: 0.000 0.001 0.151 0.000151 (1000 calls) + phi gradients: 0.005 0.024 5.741 0.005741 (1000 calls) + phi grad (krnl) : 0.001 0.006 3.325 0.001662 (2000 calls) + phi halos: 0.000 0.019 1.809 0.000905 (2000 calls) + -> irecv: 0.000 0.000 0.016 0.000008 (2000 calls) + -> pack: 0.000 0.001 0.301 0.000151 (2000 calls) + -> isend: 0.000 0.000 0.048 0.000024 (2000 calls) + -> waitall: 0.000 0.018 1.233 0.000617 (2000 calls) + -> unpack: 0.000 0.001 0.208 0.000104 (2000 calls) + BBL: 0.000 0.000 0.001 0.000001 (1000 calls) + Force calculation: 0.020 0.027 20.032 0.020032 (1000 calls) + Phi force (krnl) : 0.001 0.002 1.509 0.001509 (1000 calls) + phi update: 0.020 0.029 20.764 0.020764 (1000 calls) + Velocity Halo : 0.000 0.004 0.459 0.000459 (1000 calls) + -> irecv: 0.000 0.000 0.015 0.000008 (2000 calls) + -> pack: 0.000 0.000 0.114 0.000057 (2000 calls) + -> isend: 0.000 0.000 0.044 0.000022 (2000 calls) + -> waitall: 0.000 0.004 0.659 0.000329 (2000 calls) + -> unpack: 0.000 0.001 0.079 0.000040 (2000 calls) +BE mol field (krnl) : 0.004 0.006 3.954 0.003954 (1000 calls) +BP BE update (krnl) : 0.002 0.003 2.540 0.002540 (1000 calls) + Advectn (krnl) : 0.001 0.007 3.516 0.001758 (2000 calls) + Advectn BCS (krnl) : 0.001 0.004 2.467 0.001233 (2000 calls) + Free1: 0.000 0.182 0.183 0.000183 (1000 calls) +End time: Thu Feb 3 09:08:36 2022 +Ludwig finished normally. From e38323698c206e9a380465d1b63e634f671a13eb Mon Sep 17 00:00:00 2001 From: not populated Date: Thu, 10 Feb 2022 09:20:18 +0000 Subject: [PATCH 35/64] Add comments on new message types --- src/colloid_sums.c | 12 +++++++++++- src/colloid_sums.h | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/colloid_sums.c b/src/colloid_sums.c index a105bdc20..d980b844c 100644 --- a/src/colloid_sums.c +++ b/src/colloid_sums.c @@ -4,11 +4,21 @@ * * Communication for sums over colloid links. * + * Adding a new type of message: + * 1. Add a tag in colloid_sums.h e.g., COLLOID_SUM_NEW + * 2. Add a new message load/unload routine colloid_sum_m + * which must have the same prototype; + * 3. Add the message size (bytes) to the array "msize_[]" so + * that msize_[COLLOID_SUM_NEW] = sizeof(message); + * 4. Add a line in colloid_sums_process() to set the relevant + * function pointer. + * 5. Write a test for colloids_sums_halo(cinfo, COLLOID_SUM_NEW)! + * * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) diff --git a/src/colloid_sums.h b/src/colloid_sums.h index 16749a09d..4407cc3be 100644 --- a/src/colloid_sums.h +++ b/src/colloid_sums.h @@ -2,11 +2,15 @@ * * colloid_sums.h * + * Adding a new type of message: + * Enter a new tag in the colloid_sum_enum_type + * before COLLOID_SUM_MAX, and increment the later + * (the tags must be in order). * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) From 8b25ac9e90fd8be19e7c648712a7952668971dec Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 16 Feb 2022 13:27:52 +0000 Subject: [PATCH 36/64] Fix GPU performance regression --- src/field.c | 10 ++++++++-- src/hydro.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/field.c b/src/field.c index 8759284c7..ca3071cb3 100644 --- a/src/field.c +++ b/src/field.c @@ -432,7 +432,10 @@ __host__ int field_leesedwards(field_t * obj) { /* At the moment we require some copies for device version ... */ /* ... here and at the end. */ - field_memcpy(obj, tdpMemcpyDeviceToHost); + { + int nplane = lees_edw_nplane_total(obj->le); + if (nplane > 0) field_memcpy(obj, tdpMemcpyDeviceToHost); + } if (mpi_cartsz[Y] > 1) { /* This has its own routine. */ @@ -485,7 +488,10 @@ __host__ int field_leesedwards(field_t * obj) { } } - field_memcpy(obj, tdpMemcpyHostToDevice); + { + int nplane = lees_edw_nplane_total(obj->le); + if (nplane > 0) field_memcpy(obj, tdpMemcpyHostToDevice); + } return 0; } diff --git a/src/hydro.c b/src/hydro.c index e995718b9..00ee44c24 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -651,7 +651,11 @@ __host__ int hydro_lees_edwards(hydro_t * obj) { cs_cartsz(obj->cs, mpi_cartsz); /* All on host at the moment, so copy here and copy back at end */ - hydro_memcpy(obj, tdpMemcpyDeviceToHost); + + { + int nplane = lees_edw_nplane_total(obj->le); + if (nplane > 0) hydro_memcpy(obj, tdpMemcpyDeviceToHost); + } if (mpi_cartsz[Y] > 1) { hydro_lees_edwards_parallel(obj); @@ -701,7 +705,10 @@ __host__ int hydro_lees_edwards(hydro_t * obj) { } } - hydro_memcpy(obj, tdpMemcpyHostToDevice); + { + int nplane = lees_edw_nplane_total(obj->le); + if (nplane > 0) hydro_memcpy(obj, tdpMemcpyHostToDevice); + } return 0; } From 8097e53833887206752710ceacb81b62513f03a4 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Thu, 17 Feb 2022 12:05:48 +0000 Subject: [PATCH 37/64] Add missing stdint.h --- src/field.h | 2 ++ src/hydro.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/field.h b/src/field.h index 56881e5e5..8333b2f61 100644 --- a/src/field.h +++ b/src/field.h @@ -15,6 +15,8 @@ #ifndef LUDWIG_FIELD_H #define LUDWIG_FIELD_H +#include + #define NVECTOR 3 /* Storage requirement for vector (per site) */ #define NQAB 5 /* Storage requirement for symmetric, traceless tensor */ diff --git a/src/hydro.h b/src/hydro.h index a303c3638..d610a9f9a 100644 --- a/src/hydro.h +++ b/src/hydro.h @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -17,6 +17,8 @@ #ifndef LUDWIG_HYDRO_H #define LUDWIG_HYDRO_H +#include + #include "pe.h" #include "coords.h" #include "halo_swap.h" From 15c2e3c948efa5ce7663137688d8bde6483b6699 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Mon, 28 Feb 2022 20:21:46 +0000 Subject: [PATCH 38/64] Remove unused input keys and check --- tests/regression/d3q19/long08-le3d-fd1.inp | 1 - tests/regression/d3q19/pmpi08-chol-s01.inp | 3 --- tests/regression/d3q19/pmpi08-le2d-fd1.inp | 2 -- tests/regression/d3q19/pmpi08-le2d-fd2.inp | 1 - tests/regression/d3q19/pmpi08-le2d-lb1.inp | 2 -- tests/regression/d3q19/pmpi08-le3d-fd1.inp | 2 -- tests/regression/d3q19/pmpi08-le3d-lb1.inp | 2 -- 7 files changed, 13 deletions(-) diff --git a/tests/regression/d3q19/long08-le3d-fd1.inp b/tests/regression/d3q19/long08-le3d-fd1.inp index 68c9ad361..638ccff43 100644 --- a/tests/regression/d3q19/long08-le3d-fd1.inp +++ b/tests/regression/d3q19/long08-le3d-fd1.inp @@ -59,7 +59,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-chol-s01.inp b/tests/regression/d3q19/pmpi08-chol-s01.inp index 48ff1910a..ca1ed714d 100644 --- a/tests/regression/d3q19/pmpi08-chol-s01.inp +++ b/tests/regression/d3q19/pmpi08-chol-s01.inp @@ -52,12 +52,10 @@ lc_kappa1 0.000648456 lc_xi 0.7 lc_Gamma 0.5 -lc_active_zeta 0.0 lc_q_initialisation twist lc_q_init_amplitude 0.333333333333333 lc_init_redshift 1.0 -lc_init_nematic 1.0_0.0_0.0 lc_anchoring_method two lc_wall_anchoring normal @@ -78,7 +76,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-fd1.inp b/tests/regression/d3q19/pmpi08-le2d-fd1.inp index a65664427..0372e96ce 100644 --- a/tests/regression/d3q19/pmpi08-le2d-fd1.inp +++ b/tests/regression/d3q19/pmpi08-le2d-fd1.inp @@ -42,7 +42,6 @@ free_energy symmetric A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -65,7 +64,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-fd2.inp b/tests/regression/d3q19/pmpi08-le2d-fd2.inp index 8b706e6c9..9b6013187 100644 --- a/tests/regression/d3q19/pmpi08-le2d-fd2.inp +++ b/tests/regression/d3q19/pmpi08-le2d-fd2.inp @@ -68,7 +68,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le2d-lb1.inp b/tests/regression/d3q19/pmpi08-le2d-lb1.inp index 3926ce976..2ae4d1b3f 100644 --- a/tests/regression/d3q19/pmpi08-le2d-lb1.inp +++ b/tests/regression/d3q19/pmpi08-le2d-lb1.inp @@ -43,7 +43,6 @@ free_energy symmetric_lb A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -65,7 +64,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le3d-fd1.inp b/tests/regression/d3q19/pmpi08-le3d-fd1.inp index 7f122acdc..fbdb2349d 100644 --- a/tests/regression/d3q19/pmpi08-le3d-fd1.inp +++ b/tests/regression/d3q19/pmpi08-le3d-fd1.inp @@ -35,7 +35,6 @@ free_energy symmetric A -0.0625 B 0.0625 K 0.04 -C 0.000 phi0 0.0 phi_initialisation spinodal @@ -58,7 +57,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### diff --git a/tests/regression/d3q19/pmpi08-le3d-lb1.inp b/tests/regression/d3q19/pmpi08-le3d-lb1.inp index e57458082..218699a16 100644 --- a/tests/regression/d3q19/pmpi08-le3d-lb1.inp +++ b/tests/regression/d3q19/pmpi08-le3d-lb1.inp @@ -42,7 +42,6 @@ free_energy symmetric_lb A -0.0625 B 0.0625 K 0.04 -C 0.0 phi0 0.0 fd_gradient_calculation 3d_27pt_fluid @@ -63,7 +62,6 @@ colloid_init no_colloids # ############################################################################### -boundary_walls_on no periodicity 1_1_1 ############################################################################### From f6ebd673ead1ff606dfb3a8cf85082979510362b Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:35:32 +0000 Subject: [PATCH 39/64] Correction to out of range check --- src/field.c | 6 +++--- src/hydro.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/field.c b/src/field.c index 8759284c7..44567ebbc 100644 --- a/src/field.c +++ b/src/field.c @@ -1130,9 +1130,9 @@ int field_halo_create(const field_t * field, field_halo_t * h) { nbr[X] = coords[X] + h->cv[p][X]; nbr[Y] = coords[Y] + h->cv[p][Y]; nbr[Z] = coords[Z] + h->cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; diff --git a/src/hydro.c b/src/hydro.c index e995718b9..3626980bc 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -1457,9 +1457,9 @@ int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { nbr[X] = coords[X] + h->cv[p][X]; nbr[Y] = coords[Y] + h->cv[p][Y]; nbr[Z] = coords[Z] + h->cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; From ddf69033131019ca6a87bb364769db0bc8a16d2d Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:36:31 +0000 Subject: [PATCH 40/64] Replaced by lb_data.h --- src/model.h | 126 ---------------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 src/model.h diff --git a/src/model.h b/src/model.h deleted file mode 100644 index 52d2f1de6..000000000 --- a/src/model.h +++ /dev/null @@ -1,126 +0,0 @@ -/***************************************************************************** - * - * model.h - * - * This includes the appropriate lattice Boltzmann - * model d2q9, d3q15, or d3q19 (see Makefile). - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_MODEL_H -#define LUDWIG_MODEL_H - -/* Here is the choice of model (and it's here only). */ - -#ifdef _D2Q9_ -#include "d2q9.h" - -enum {NDIM = NDIM9, - NVEL = NVEL9, - CVXBLOCK = CVXBLOCK9, - CVYBLOCK = CVYBLOCK9, - CVZBLOCK = CVZBLOCK9}; - -#define LB_CV(cv) LB_CV_D2Q9(cv) - -#endif - -#ifdef _D3Q15_ -#include "d3q15.h" - -enum {NDIM = NDIM15, - NVEL = NVEL15, - CVXBLOCK = CVXBLOCK15, - CVYBLOCK = CVYBLOCK15, - CVZBLOCK = CVZBLOCK15}; - -#define LB_CV(cv) LB_CV_D3Q15(cv) - -#endif - -#ifdef _D3Q19_ - -#include "d3q19.h" - -enum {NDIM = NDIM19, - NVEL = NVEL19, - CVXBLOCK = CVXBLOCK19, - CVYBLOCK = CVYBLOCK19, - CVZBLOCK = CVZBLOCK19}; - -#define LB_CV(cv) LB_CV_D3Q19(cv) - -#endif - -#include "pe.h" -#include "coords.h" -#include "io_harness.h" -#include "memory.h" - -/* Number of hydrodynamic modes */ -enum {NHYDRO = 1 + NDIM + NDIM*(NDIM+1)/2}; - -/* Labels to locate relaxation times in array[NVEL] */ -/* Bulk viscosity is XX in stress */ -/* Shear is XY in stress */ - -enum {LB_TAU_BULK = 1 + NDIM + XX, LB_TAU_SHEAR = 1 + NDIM + XY}; - -#define LB_CS2_DOUBLE(cs2) const double cs2 = (1.0/3.0) -#define LB_RCS2_DOUBLE(rcs2) const double rcs2 = 3.0 - -typedef enum lb_dist_enum_type{LB_RHO = 0, LB_PHI = 1} lb_dist_enum_t; -typedef enum lb_mode_enum_type{LB_GHOST_ON = 0, LB_GHOST_OFF = 1} lb_mode_enum_t; - -typedef struct lb_data_s lb_t; -typedef enum lb_halo_enum_type {LB_HALO_FULL, - LB_HALO_REDUCED, - LB_HALO_HOST, - LB_HALO_TARGET} lb_halo_enum_t; - -typedef enum {LB_RELAXATION_M10, LB_RELAXATION_BGK, LB_RELAXATION_TRT} - lb_relaxation_enum_t; - -#include "lb_model_s.h" - -__host__ int lb_create_ndist(pe_t * pe, cs_t * cs, int ndist, lb_t ** lb); -__host__ int lb_create(pe_t * pe, cs_t * cs, lb_t ** lb); -__host__ int lb_init(lb_t * lb); -__host__ int lb_free(lb_t * lb); -__host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag); -__host__ int lb_collide_param_commit(lb_t * lb); -__host__ int lb_halo(lb_t * lb); -__host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag); -__host__ int lb_halo_via_copy(lb_t * lb); -__host__ int lb_halo_via_struct(lb_t * lb); -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t halo); -__host__ int lb_io_info(lb_t * lb, io_info_t ** io_info); -__host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int fin, int fout); -__host__ int lb_io_rho_set(lb_t *lb, io_info_t * io_rho, int fin, int fout); - -__host__ int lb_io_info_commit(lb_t * lb, io_info_args_t args); - -__host__ __device__ int lb_ndist(lb_t * lb, int * ndist); -__host__ __device__ int lb_f(lb_t * lb, int index, int p, int n, double * f); -__host__ __device__ int lb_f_set(lb_t * lb, int index, int p, int n, double f); -__host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, - double * rho); -/* These could be __host__ __device__ pending removal of - * static constants */ - -__host__ int lb_init_rest_f(lb_t * lb, double rho0); -__host__ int lb_ndist_set(lb_t * lb, int ndist); -__host__ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]); -__host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]); -__host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); -__host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); - -#endif From 652554c637892ce2a1806e016c14ff8f62d9d3e9 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:37:33 +0000 Subject: [PATCH 41/64] Remove old reduced halo and related global symbols --- src/lb_data.h | 55 +--- src/model.c | 815 ++----------------------------------------------- src/model_le.c | 217 ++++--------- 3 files changed, 80 insertions(+), 1007 deletions(-) diff --git a/src/lb_data.h b/src/lb_data.h index 2b1c52ef6..31ef3b48b 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2014-2021 The University of Edinburgh + * (c) 2014-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -27,35 +27,18 @@ #include "io_harness.h" #include "halo_swap.h" +/* Residual compile-time switches scheduled for removal */ #ifdef _D2Q9_ -#include "d2q9.h" - -enum {NDIM = NDIM9, - NVEL = NVEL9, - CVXBLOCK = CVXBLOCK9, - CVYBLOCK = CVYBLOCK9, - CVZBLOCK = CVZBLOCK9}; +enum {NDIM = 2, NVEL = 9}; #endif - #ifdef _D3Q15_ -#include "d3q15.h" - -enum {NDIM = NDIM15, - NVEL = NVEL15, - CVXBLOCK = CVXBLOCK15, - CVYBLOCK = CVYBLOCK15, - CVZBLOCK = CVZBLOCK15}; +enum {NDIM = 3, NVEL = 15}; #endif - #ifdef _D3Q19_ - -#include "d3q19.h" - -enum {NDIM = NDIM19, - NVEL = NVEL19, - CVXBLOCK = CVXBLOCK19, - CVYBLOCK = CVYBLOCK19, - CVZBLOCK = CVZBLOCK19}; +enum {NDIM = 3, NVEL = 19}; +#endif +#ifdef _D3Q27_ +enum {NDIM = 3, NVEL = 27}; #endif typedef struct lb_collide_param_s lb_collide_param_t; @@ -132,23 +115,7 @@ struct lb_data_s { lb_data_options_t opts; /* Copy of run time options */ lb_halo_t h; /* halo information/buffers */ - /* MPI data types for halo swaps; these are comupted at runtime - * to conform to the model selected at compile time */ - - MPI_Datatype plane_xy_full; - MPI_Datatype plane_xz_full; - MPI_Datatype plane_yz_full; - MPI_Datatype plane_xy_reduced[2]; - MPI_Datatype plane_xz_reduced[2]; - MPI_Datatype plane_yz_reduced[2]; - MPI_Datatype plane_xy[2]; - MPI_Datatype plane_xz[2]; - MPI_Datatype plane_yz[2]; - MPI_Datatype site_x[2]; - MPI_Datatype site_y[2]; - MPI_Datatype site_z[2]; - - lb_t * target; /* copy of this structure on target */ + lb_t * target; /* copy of this structure on target */ }; /* Data storage: A rank two object */ @@ -180,9 +147,6 @@ __host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag); __host__ int lb_collide_param_commit(lb_t * lb); __host__ int lb_halo(lb_t * lb); __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag); -__host__ int lb_halo_via_copy(lb_t * lb); -__host__ int lb_halo_via_struct(lb_t * lb); -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t halo); __host__ int lb_io_info(lb_t * lb, io_info_t ** io_info); __host__ int lb_io_info_set(lb_t * lb, io_info_t * io_info, int fin, int fout); __host__ int lb_io_rho_set(lb_t *lb, io_info_t * io_rho, int fin, int fout); @@ -200,7 +164,6 @@ __host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, __host__ int lb_init_rest_f(lb_t * lb, double rho0); __host__ int lb_1st_moment(lb_t * lb, int index, lb_dist_enum_t nd, double g[3]); __host__ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]); -__host__ int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho); __host__ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]); #endif diff --git a/src/model.c b/src/model.c index 69381635d..f9b5b304a 100644 --- a/src/model.c +++ b/src/model.c @@ -7,17 +7,16 @@ * for performance-critical operations ehich, for space * considerations, are not included in this file. * - * The LB model is either D2Q9, D3Q15 or D3Q19, as included in model.h. - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * Alan Gray (alang@epcc.ed.ac.uk) - * Erlend Davidson provided the original reduced halo swap. + * Erlend Davidson provided the original reduced halo swap + * (now retired, the code that is). * *****************************************************************************/ @@ -35,9 +34,6 @@ #include "util.h" static int lb_mpi_init(lb_t * lb); -static int lb_set_types(int, MPI_Datatype *); -static int lb_set_blocks(lb_t * lb, int, int *, int, const int *); -static int lb_set_displacements(lb_t * lb, int, MPI_Aint *, int, const int *); static int lb_f_read(FILE *, int index, void * self); static int lb_f_read_ascii(FILE *, int index, void * self); static int lb_f_write(FILE *, int index, void * self); @@ -166,25 +162,6 @@ __host__ int lb_free(lb_t * lb) { if (lb->fprime) free(lb->fprime); lb_halo_free(lb, &lb->h); - - MPI_Type_free(&lb->plane_xy_full); - MPI_Type_free(&lb->plane_xz_full); - MPI_Type_free(&lb->plane_yz_full); - - MPI_Type_free(&lb->plane_xy_reduced[0]); - MPI_Type_free(&lb->plane_xy_reduced[1]); - MPI_Type_free(&lb->plane_xz_reduced[0]); - MPI_Type_free(&lb->plane_xz_reduced[1]); - MPI_Type_free(&lb->plane_yz_reduced[0]); - MPI_Type_free(&lb->plane_yz_reduced[1]); - - MPI_Type_free(&lb->site_x[0]); - MPI_Type_free(&lb->site_x[1]); - MPI_Type_free(&lb->site_y[0]); - MPI_Type_free(&lb->site_y[1]); - MPI_Type_free(&lb->site_z[0]); - MPI_Type_free(&lb->site_z[1]); - lb_model_free(&lb->model); free(lb->param); @@ -251,7 +228,6 @@ static int lb_init(lb_t * lb) { int nlocal[3]; int nx, ny, nz; - int nhalolocal = 1; int ndata; int nhalo; int ndevice; @@ -296,25 +272,6 @@ static int lb_init(lb_t * lb) { tdpMemcpyHostToDevice); } - /* Set up the MPI Datatypes used for full halo messages: - * - * in XY plane nx*ny blocks of 1 site with stride nz; - * in XZ plane nx blocks of nz sites with stride ny*nz; - * in YZ plane one contiguous block of ny*nz sites. */ - - MPI_Type_vector(nx*ny, lb->ndist*lb->nvel*nhalolocal, lb->ndist*lb->nvel*nz, - MPI_DOUBLE, &lb->plane_xy_full); - MPI_Type_commit(&lb->plane_xy_full); - - MPI_Type_vector(nx, lb->ndist*lb->nvel*nz*nhalolocal, - lb->ndist*lb->nvel*ny*nz, - MPI_DOUBLE, &lb->plane_xz_full); - MPI_Type_commit(&lb->plane_xz_full); - - MPI_Type_vector(1, lb->ndist*lb->nvel*ny*nz*nhalolocal, 1, MPI_DOUBLE, - &lb->plane_yz_full); - MPI_Type_commit(&lb->plane_yz_full); - lb_mpi_init(lb); lb_model_param_init(lb); lb_memcpy(lb, tdpMemcpyHostToDevice); @@ -400,9 +357,10 @@ __host__ int lb_init_rest_f(lb_t * lb, double rho0) { for (ic = 1; ic <= nlocal[X]; ic++) { for (jc = 1; jc <= nlocal[Y]; jc++) { for (kc = 1; kc <= nlocal[Z]; kc++) { + double u0[3] = {}; index = cs_index(lb->cs, ic, jc, kc); - lb_0th_moment_equilib_set(lb, index, 0, rho0); + lb_1st_moment_equilib_set(lb, index, rho0, u0); } } } @@ -420,140 +378,7 @@ __host__ int lb_init_rest_f(lb_t * lb, double rho0) { static int lb_mpi_init(lb_t * lb) { - int count; - int nlocal[3]; - int nx, ny, nz; - int * blocklen; - int nhalo; - MPI_Aint extent; - MPI_Aint * disp_fwd; - MPI_Aint * disp_bwd; - MPI_Datatype * types; - MPI_Datatype tmpf, tmpb; - assert(lb); - assert(CVXBLOCK > 0); - - cs_nhalo(lb->cs, &nhalo); - cs_nlocal(lb->cs, nlocal); - - nx = nlocal[X] + 2*nhalo; - ny = nlocal[Y] + 2*nhalo; - nz = nlocal[Z] + 2*nhalo; - - /* extent of single site (AOS) */ - extent = sizeof(double)*lb->nvel*lb->ndist; - - /* X direction */ - - count = lb->ndist*CVXBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVXBLOCK, xblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVXBLOCK, xdisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVXBLOCK, xdisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_x[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_x[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_x[CS_FORW]); - MPI_Type_commit(&lb->site_x[CS_BACK]); - - MPI_Type_contiguous(ny*nz, lb->site_x[FORWARD], &lb->plane_yz_reduced[FORWARD]); - MPI_Type_contiguous(ny*nz, lb->site_x[BACKWARD], &lb->plane_yz_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_yz_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_yz_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); - - /* Y direction */ - - count = lb->ndist*CVYBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVYBLOCK, yblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVYBLOCK, ydisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVYBLOCK, ydisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_y[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_y[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_y[CS_FORW]); - MPI_Type_commit(&lb->site_y[CS_BACK]); - - MPI_Type_vector(nx, nz, ny*nz, lb->site_y[FORWARD], - &lb->plane_xz_reduced[FORWARD]); - MPI_Type_vector(nx, nz, ny*nz, lb->site_y[BACKWARD], - &lb->plane_xz_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_xz_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_xz_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); - - /* Z direction */ - - count = lb->ndist*CVZBLOCK; - - blocklen = (int *) malloc(count*sizeof(int)); - disp_fwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - disp_bwd = (MPI_Aint *) malloc(count*sizeof(MPI_Aint)); - types = (MPI_Datatype *) malloc(count*sizeof(MPI_Datatype)); - - lb_set_types(count, types); - lb_set_blocks(lb, count, blocklen, CVZBLOCK, zblocklen_cv); - lb_set_displacements(lb, count, disp_fwd, CVZBLOCK, zdisp_fwd_cv); - lb_set_displacements(lb, count, disp_bwd, CVZBLOCK, zdisp_bwd_cv); - - MPI_Type_create_struct(count, blocklen, disp_fwd, types, &tmpf); - MPI_Type_create_struct(count, blocklen, disp_bwd, types, &tmpb); - MPI_Type_commit(&tmpf); - MPI_Type_commit(&tmpb); - MPI_Type_create_resized(tmpf, 0, extent, &lb->site_z[CS_FORW]); - MPI_Type_create_resized(tmpb, 0, extent, &lb->site_z[CS_BACK]); - MPI_Type_free(&tmpf); - MPI_Type_free(&tmpb); - - MPI_Type_commit(&lb->site_z[CS_FORW]); - MPI_Type_commit(&lb->site_z[CS_BACK]); - - MPI_Type_vector(nx*ny, 1, nz, lb->site_z[FORWARD], &lb->plane_xy_reduced[FORWARD]); - MPI_Type_vector(nx*ny, 1, nz, lb->site_z[BACKWARD], - &lb->plane_xy_reduced[BACKWARD]); - MPI_Type_commit(&lb->plane_xy_reduced[FORWARD]); - MPI_Type_commit(&lb->plane_xy_reduced[BACKWARD]); - - free(blocklen); - free(disp_fwd); - free(disp_bwd); - free(types); halo_swap_create_r2(lb->pe, lb->cs, 1, lb->nsite, lb->ndist, lb->nvel, &lb->halo); @@ -562,81 +387,6 @@ static int lb_mpi_init(lb_t * lb) { return 0; } -/***************************************************************************** - * - * lb_set_types - * - * Set the type signature for reduced halo struct. - * - *****************************************************************************/ - -static int lb_set_types(int ntype, MPI_Datatype * type) { - - int n; - - assert(type); - - for (n = 0; n < ntype; n++) { - type[n] = MPI_DOUBLE; - } - - return 0; -} - -/***************************************************************************** - * - * lb_set_blocks - * - * Set the blocklengths for the reduced halo struct. - * This means 'expanding' the basic blocks for the current DdQn model - * to the current number of distributions. - * - *****************************************************************************/ - -static int lb_set_blocks(lb_t * lb, int nblock, int * block, int nbasic, - const int * basic_block) { - - int n, p; - - assert(lb); - - for (n = 0; n < lb->ndist; n++) { - for (p = 0; p < nbasic; p++) { - block[n*nbasic + p] = basic_block[p]; - } - } - - return 0; -} - -/***************************************************************************** - * - * lb_set_displacements - * - * Set the displacements for the reduced halo struct. - * - *****************************************************************************/ - -static int lb_set_displacements(lb_t * lb, int ndisp, MPI_Aint * disp, - int nbasic, const int * disp_basic) { - int n, p; - MPI_Aint disp0, disp1; - - assert(lb); - - /* Lower end */ - MPI_Get_address(lb->f, &disp0); - - for (n = 0; n < lb->ndist; n++) { - for (p = 0; p < nbasic; p++) { - MPI_Get_address(lb->f + n*lb->nvel + disp_basic[p], &disp1); - disp[n*nbasic + p] = disp1 - disp0; - } - } - - return 0; -} - /***************************************************************************** * * lb_io_info_commit @@ -769,200 +519,27 @@ __host__ int lb_halo(lb_t * lb) { __host__ int lb_halo_swap(lb_t * lb, lb_halo_enum_t flag) { double * data; - const char * msg = "Attempting halo via struct with NSIMDVL > 1 or (AO)SOA"; assert(lb); switch (flag) { - case LB_HALO_HOST: - lb_halo_via_copy(lb); - break; case LB_HALO_TARGET: tdpMemcpy(&data, &lb->target->f, sizeof(double *), tdpMemcpyDeviceToHost); halo_swap_packed(lb->halo, data); break; - case LB_HALO_FULL: - if (NSIMDVL > 1) pe_fatal(lb->pe, "%s\n", msg); - if (DATA_MODEL != DATA_MODEL_AOS) pe_fatal(lb->pe, "%s\n", msg); - lb_halo_set(lb, LB_HALO_FULL); - lb_halo_via_struct(lb); - break; - case LB_HALO_REDUCED: - if (NSIMDVL > 1) pe_fatal(lb->pe, "%s\n", msg); - if (DATA_MODEL != DATA_MODEL_AOS) pe_fatal(lb->pe, "%s\n", msg); - lb_halo_set(lb, LB_HALO_REDUCED); - lb_halo_via_struct(lb); - break; case LB_HALO_OPENMP_FULL: - { - lb_halo_post(lb, &lb->h); - lb_halo_wait(lb, &lb->h); - } + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); break; case LB_HALO_OPENMP_REDUCED: - { - lb_halo_post(lb, &lb->h); - lb_halo_wait(lb, &lb->h); - } + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); break; default: - /* Should not be here... */ - assert(0); - } - - /* In the limited case MODEL order and NSIMDVL is 1 the struct - * approach is still available. */ - - return 0; -} - -/***************************************************************************** - * - * lb_halo_via_struct - * - * Uses MPI datatypes to perform distribution halo swap, either 'full' - * or 'reduced', depending on what is currently selected. - * - * This works only for MODEL, not MODEL_R. - * - *****************************************************************************/ - -__host__ int lb_halo_via_struct(lb_t * lb) { - - int ic, jc, kc; - int ihalo, ireal; - int nhalo; - int pforw, pback; - int nlocal[3]; - int mpi_cartsz[3]; - int periodic[3]; - int persite; - - const int tagf = 900; - const int tagb = 901; - - MPI_Request request[4]; - MPI_Status status[4]; - MPI_Comm comm; - - assert(lb); - - persite = lb->ndist*lb->nvel; - - cs_nhalo(lb->cs, &nhalo); - cs_nlocal(lb->cs, nlocal); - cs_cart_comm(lb->cs, &comm); - cs_periodic(lb->cs, periodic); - cs_cartsz(lb->cs, mpi_cartsz); - - /* The x-direction (YZ plane) */ - - if (mpi_cartsz[X] == 1) { - if (periodic[X]) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - ihalo = persite*cs_index(lb->cs, 0, jc, kc); - ireal = persite*cs_index(lb->cs, nlocal[X], jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, nlocal[X]+1, jc, kc); - ireal = persite*cs_index(lb->cs, 1, jc, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, X); - pback = cs_cart_neighb(lb->cs, CS_BACK, X); - ihalo = persite*cs_index(lb->cs, nlocal[X] + 1, 1 - nhalo, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[BACKWARD], - pforw, tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 0, 1 - nhalo, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_yz[FORWARD], - pback, tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1, 1-nhalo, 1-nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_yz[BACKWARD], - pback, tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, nlocal[X], 1-nhalo, 1-nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_yz[FORWARD], - pforw, tagf, comm, &request[3]); - MPI_Waitall(4, request, status); + lb_halo_post(lb, &lb->h); + lb_halo_wait(lb, &lb->h); } - - /* The y-direction (XZ plane) */ - if (mpi_cartsz[Y] == 1) { - if (periodic[Y]) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - ihalo = persite*cs_index(lb->cs, ic, 0, kc); - ireal = persite*cs_index(lb->cs, ic, nlocal[Y], kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - ireal = persite*cs_index(lb->cs, ic, 1, kc); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, Y); - pback = cs_cart_neighb(lb->cs, CS_BACK, Y); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y] + 1, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[BACKWARD], - pforw, tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 0, 1 - nhalo); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xz[FORWARD], pback, - tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1, 1 - nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_xz[BACKWARD], pback, - tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, nlocal[Y], 1 - nhalo); - MPI_Issend(lb->f + ireal, 1, lb->plane_xz[FORWARD], pforw, - tagf, comm, &request[3]); - MPI_Waitall(4, request, status); - } - - /* Finally, z-direction (XY plane) */ - - if (mpi_cartsz[Z] == 1) { - if (periodic[Z]) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - ihalo = persite*cs_index(lb->cs, ic, jc, 0); - ireal = persite*cs_index(lb->cs, ic, jc, nlocal[Z]); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - - ihalo = persite*cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - ireal = persite*cs_index(lb->cs, ic, jc, 1); - memcpy(lb->f + ihalo, lb->f + ireal, persite*sizeof(double)); - } - } - } - } - else { - pforw = cs_cart_neighb(lb->cs, CS_FORW, Z); - pback = cs_cart_neighb(lb->cs, CS_BACK, Z); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z] + 1); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[BACKWARD], pforw, - tagb, comm, &request[0]); - ihalo = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 0); - MPI_Irecv(lb->f + ihalo, 1, lb->plane_xy[FORWARD], pback, - tagf, comm, &request[1]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, 1); - MPI_Issend(lb->f + ireal, 1, lb->plane_xy[BACKWARD], pback, - tagb, comm, &request[2]); - ireal = persite*cs_index(lb->cs, 1 - nhalo, 1 - nhalo, nlocal[Z]); - MPI_Issend(lb->f + ireal, 1, lb->plane_xy[FORWARD], pforw, - tagf, comm, &request[3]); - MPI_Waitall(4, request, status); - } - return 0; } @@ -971,7 +548,8 @@ __host__ int lb_halo_via_struct(lb_t * lb) { * lb_f_read * * Read one lattice site (index) worth of distributions. - * Note that read-write is always 'MODEL' order. + * Note that read-write is always the same order irrespective + * of memory ordering (host/device). * *****************************************************************************/ @@ -1003,7 +581,6 @@ static int lb_f_read(FILE * fp, int index, void * self) { * lb_f_read_ascii * * Read one lattice site (index) worth of distributions. - * Note that read-write is always 'MODEL' order. * *****************************************************************************/ @@ -1043,7 +620,6 @@ static int lb_f_read_ascii(FILE * fp, int index, void * self) { * lb_f_write * * Write one lattice site (index) worth of distributions. - * Note that read/write is always 'MODEL' order. * *****************************************************************************/ @@ -1075,7 +651,6 @@ static int lb_f_write(FILE * fp, int index, void * self) { * lb_f_write_ascii * * Write one lattice site (index) worth of distributions. - * Note that read/write is always 'MODEL' order. * *****************************************************************************/ @@ -1169,39 +744,6 @@ static int lb_rho_write_ascii(FILE * fp, int index, void * self) { return 0; } -/***************************************************************************** - * - * lb_halo_set - * - * Set the actual halo datatype. - * - *****************************************************************************/ - -__host__ int lb_halo_set(lb_t * lb, lb_halo_enum_t type) { - - assert(lb); - - if (type == LB_HALO_REDUCED) { - lb->plane_xy[FORWARD] = lb->plane_xy_reduced[FORWARD]; - lb->plane_xy[BACKWARD] = lb->plane_xy_reduced[BACKWARD]; - lb->plane_xz[FORWARD] = lb->plane_xz_reduced[FORWARD]; - lb->plane_xz[BACKWARD] = lb->plane_xz_reduced[BACKWARD]; - lb->plane_yz[FORWARD] = lb->plane_yz_reduced[FORWARD]; - lb->plane_yz[BACKWARD] = lb->plane_yz_reduced[BACKWARD]; - } - else { - /* Default to full halo. */ - lb->plane_xy[FORWARD] = lb->plane_xy_full; - lb->plane_xy[BACKWARD] = lb->plane_xy_full; - lb->plane_xz[FORWARD] = lb->plane_xz_full; - lb->plane_xz[BACKWARD] = lb->plane_xz_full; - lb->plane_yz[FORWARD] = lb->plane_yz_full; - lb->plane_yz[BACKWARD] = lb->plane_yz_full; - } - - return 0; -} - /***************************************************************************** * * lb_ndist @@ -1273,8 +815,6 @@ int lb_f_set(lb_t * lb, int index, int p, int n, double fvalue) { __host__ __device__ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, double * rho) { - int p; - assert(lb); assert(rho); assert(index >= 0 && index < lb->nsite); @@ -1282,7 +822,7 @@ int lb_0th_moment(lb_t * lb, int index, lb_dist_enum_t nd, double * rho) { *rho = 0.0; - for (p = 0; p < lb->nvel; p++) { + for (int p = 0; p < lb->nvel; p++) { *rho += lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, nd, p)]; } @@ -1360,33 +900,6 @@ int lb_2nd_moment(lb_t * lb, int index, lb_dist_enum_t nd, double s[3][3]) { return 0; } -/***************************************************************************** - * - * lb_0th_moment_equilib_set - * - * Project the given value of rho onto the equilibrium distribution via - * - * f_i = w_i rho - * - *****************************************************************************/ - -__host__ -int lb_0th_moment_equilib_set(lb_t * lb, int index, int n, double rho) { - - int p; - - assert(lb); - assert (n >= 0 && n < lb->ndist); - assert(index >= 0 && index < lb->nsite); - - for (p = 0; p < lb->model.nvel; p++) { - double f = lb->model.wv[p]*rho; - lb->f[LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p)] = f; - } - - return 0; -} - /***************************************************************************** * * lb_1st_moment_equilib_set @@ -1423,298 +936,6 @@ int lb_1st_moment_equilib_set(lb_t * lb, int index, double rho, double u[3]) { return 0; } -/***************************************************************************** - * - * lb_halo_via_copy - * - * A version of the halo swap which uses a flat buffer to copy the - * relevant data rathar than MPI data types. It is therefore a 'full' - * halo swapping nvel distributions at each site. - * - * It works for both MODEL and MODEL_R, but the loop order favours - * MODEL_R. - * - *****************************************************************************/ - -__host__ int lb_halo_via_copy(lb_t * lb) { - - int ic, jc, kc; - int n, p; - int pforw, pback; - int index, indexhalo, indexreal; - int nsend, count; - int nlocal[3]; - int mpi_cartsz[3]; - - const int tagf = 900; - const int tagb = 901; - - double * sendforw; - double * sendback; - double * recvforw; - double * recvback; - - MPI_Request request[4]; - MPI_Status status[4]; - MPI_Comm comm; - - assert(lb); - - cs_nlocal(lb->cs, nlocal); - cs_cart_comm(lb->cs, &comm); - cs_cartsz(lb->cs, mpi_cartsz); - - /* The x-direction (YZ plane) */ - - nsend = lb->model.nvel*lb->ndist*nlocal[Y]*nlocal[Z]; - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - assert(sendback && sendforw); - assert(recvforw && recvback); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, nlocal[X], jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, 1, jc, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - if (mpi_cartsz[X] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, X); - pback = cs_cart_neighb(lb->cs, CS_BACK, X); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait for receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, 0, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, nlocal[X] + 1, jc, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - - free(recvback); - free(recvforw); - - if (mpi_cartsz[X] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - - /* The y-direction (XZ plane) */ - - nsend = lb->model.nvel*lb->ndist*(nlocal[X] + 2)*nlocal[Z]; - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, ic, nlocal[Y], kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, ic, 1, kc); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - - if (mpi_cartsz[Y] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, Y); - pback = cs_cart_neighb(lb->cs, CS_BACK, Y); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait of receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = cs_index(lb->cs, ic, 0, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, ic, nlocal[Y] + 1, kc); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - free(recvback); - free(recvforw); - - if (mpi_cartsz[Y] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - /* Finally, z-direction (XY plane) */ - - nsend = lb->model.nvel*lb->ndist*(nlocal[X] + 2)*(nlocal[Y] + 2); - sendforw = (double *) malloc(nsend*sizeof(double)); - sendback = (double *) malloc(nsend*sizeof(double)); - recvforw = (double *) malloc(nsend*sizeof(double)); - recvback = (double *) malloc(nsend*sizeof(double)); - if (sendforw == NULL) pe_fatal(lb->pe, "malloc(sendforw) failed\n"); - if (sendback == NULL) pe_fatal(lb->pe, "malloc(sendback) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvforw) failed\n"); - if (recvforw == NULL) pe_fatal(lb->pe, "malloc(recvback) failed\n"); - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - index = cs_index(lb->cs, ic, jc, nlocal[Z]); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendforw[count] = lb->f[indexreal]; - - index = cs_index(lb->cs, ic, jc, 1); - indexreal = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - sendback[count] = lb->f[indexreal]; - ++count; - } - } - } - } - assert(count == nsend); - - if (mpi_cartsz[Z] == 1) { - memcpy(recvback, sendforw, nsend*sizeof(double)); - memcpy(recvforw, sendback, nsend*sizeof(double)); - } - else { - - pforw = cs_cart_neighb(lb->cs, CS_FORW, Z); - pback = cs_cart_neighb(lb->cs, CS_BACK, Z); - - MPI_Irecv(recvforw, nsend, MPI_DOUBLE, pforw, tagb, comm, request); - MPI_Irecv(recvback, nsend, MPI_DOUBLE, pback, tagf, comm, request + 1); - - MPI_Issend(sendback, nsend, MPI_DOUBLE, pback, tagb, comm, request + 2); - MPI_Issend(sendforw, nsend, MPI_DOUBLE, pforw, tagf, comm, request + 3); - - /* Wait for receives */ - MPI_Waitall(2, request, status); - } - - count = 0; - for (p = 0; p < lb->model.nvel; p++) { - for (n = 0; n < lb->ndist; n++) { - for (ic = 0; ic <= nlocal[X] + 1; ic++) { - for (jc = 0; jc <= nlocal[Y] + 1; jc++) { - - index = cs_index(lb->cs, ic, jc, 0); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvback[count]; - - index = cs_index(lb->cs, ic, jc, nlocal[Z] + 1); - indexhalo = LB_ADDR(lb->nsite, lb->ndist, lb->nvel, index, n, p); - lb->f[indexhalo] = recvforw[count]; - ++count; - } - } - } - } - assert(count == nsend); - free(recvback); - free(recvforw); - - if (mpi_cartsz[Z] > 1) { - /* Wait for sends */ - MPI_Waitall(2, request + 2, status); - } - - free(sendback); - free(sendforw); - - return 0; -} - /* We will not exceed 27 directions! Direction index 0, in keeping * with the LB model definition, is (0,0,0) - so no communication. */ @@ -1898,7 +1119,7 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { int periods[3] = {}; int coords[3] = {}; - MPI_Cart_get(h->comm, h->map.ndim, dims, periods, coords); + MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->map.nvel; p++) { int nbr[3] = {}; @@ -1910,9 +1131,9 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { nbr[X] = coords[X] + h->map.cv[p][X]; nbr[Y] = coords[Y] + h->map.cv[p][Y]; nbr[Z] = coords[Z] + h->map.cv[p][Z]; - out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X])); - out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y])); - out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z])); + out[X] = (!periods[X] && (nbr[X] < 0 || nbr[X] > dims[X] - 1)); + out[Y] = (!periods[Y] && (nbr[Y] < 0 || nbr[Y] > dims[Y] - 1)); + out[Z] = (!periods[Z] && (nbr[Z] < 0 || nbr[Z] > dims[Z] - 1)); if (out[X] || out[Y] || out[Z]) { h->nbrrank[i][j][k] = MPI_PROC_NULL; diff --git a/src/model_le.c b/src/model_le.c index c1d4de288..5ada15c3a 100644 --- a/src/model_le.c +++ b/src/model_le.c @@ -8,12 +8,10 @@ * not u*(t-1) returned by le_get_displacement(). * This is for reasons of backwards compatability. * - * Issue: a 'MODEL_R' implementation of communication is required - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -34,7 +32,6 @@ #include "util.h" static int le_reproject(lb_t * lb, lees_edw_t * le); -static int le_reproject_all(lb_t * lb, lees_edw_t * le); static int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le); static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le); @@ -59,7 +56,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le); __host__ int lb_le_apply_boundary_conditions(lb_t * lb, lees_edw_t * le) { - const int irepro = 0; int mpi_cartsz[3]; assert(lb); @@ -75,8 +71,7 @@ __host__ int lb_le_apply_boundary_conditions(lb_t * lb, lees_edw_t * le) { /* ... and copy back at the end */ lb_memcpy(lb, tdpMemcpyDeviceToHost); - if (irepro == 0) le_reproject(lb, le); - if (irepro != 0) le_reproject_all(lb, le); + le_reproject(lb, le); if (mpi_cartsz[Y] > 1) { le_displace_and_interpolate_parallel(lb, le); @@ -119,8 +114,8 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { int nplane, plane, side; int ia, ib; int nlocal[3]; - int poffset, np, p; int n, ndist; + int8_t cx = 0; double rho, ds[3][3], udotc, sdotq; double g[3], du[3]; @@ -130,7 +125,6 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { assert(lb); assert(le); - assert(CVXBLOCK == 1); lb_ndist(lb, &ndist); nplane = lees_edw_nplane_local(le); @@ -151,13 +145,13 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { lees_edw_plane_uy_now(le, t, &du[Y]); du[Y] *= -1.0; ic = lees_edw_plane_location(le, plane); - poffset = xdisp_fwd_cv[0]; + cx = +1; } else { /* Finally, deal with plane above LEBC */ lees_edw_plane_uy_now(le, t, &du[Y]); ic = lees_edw_plane_location(le, plane) + 1; - poffset = xdisp_bwd_cv[0]; + cx = -1; } for (jc = 1; jc <= nlocal[Y]; jc++) { @@ -179,14 +173,11 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { } /* Now update the distribution */ - - for (np = 0; np < xblocklen_cv[0]; np++) { + for (int p = 1; p < lb->model.nvel; p++) { double cs2 = lb->model.cs2; double rcs2 = 1.0/cs2; - - /* Pick up the correct velocity indices */ - p = poffset + np; + if (lb->model.cv[p][X] != cx) continue; udotc = du[Y]*lb->model.cv[p][Y]; sdotq = 0.0; @@ -215,118 +206,6 @@ static int le_reproject(lb_t * lb, lees_edw_t * le) { return 0; } - -/**************************************************************************** - * - * le_reproject_all - * - * An experiemental routine to reproject the ghost currents in - * addition to the hydrodynamic modes. - * - * D3Q19, single fluid - * - * jchi1[Y] = chi1 rho u_y -> chi1 (rho u_y +/- rho u_le) - * jchi2[Y] = chi2 rho u_y -> chi2 (rho u_y +/- rho u_le) - * - ****************************************************************************/ - -static int le_reproject_all(lb_t * lb, lees_edw_t * le) { - - int ic, jc, kc, index; - int nplane, plane, side; - int nlocal[3]; - int p, m, np; - int poffset, ndist; - - double mode[NVEL]; - double rho; - double g[3], du[3]; - double t; - physics_t * phys = NULL; - - assert(le); - assert(lb); - assert(CVXBLOCK == 1); - - lb_ndist(lb, &ndist); - nplane = lees_edw_nplane_local(le); - physics_ref(&phys); - - t = 1.0*physics_control_timestep(phys); - lees_edw_nlocal(le, nlocal); - - for (plane = 0; plane < nplane; plane++) { - for (side = 0; side < 2; side++) { - - du[X] = 0.0; - du[Y] = 0.0; - du[Z] = 0.0; - - if (side == 0) { - /* Start with plane below Lees-Edwards BC */ - lees_edw_plane_uy_now(le, t, &du[Y]); - du[Y] = -du[Y]; - ic = lees_edw_plane_location(le, plane); - poffset = xdisp_fwd_cv[0]; - } - else { - /* Finally, deal with plane above LEBC */ - lees_edw_plane_uy_now(le, t, &du[Y]); - ic = lees_edw_plane_location(le, plane) + 1; - poffset = xdisp_bwd_cv[0]; - } - - for (jc = 1; jc <= nlocal[Y]; jc++) { - for (kc = 1; kc <= nlocal[Z]; kc++) { - - index = lees_edw_index(le, ic, jc, kc); - - /* Compute modes */ - - for (m = 0; m < lb->model.nvel; m++) { - mode[m] = 0.0; - for (p = 0; p < lb->model.nvel; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, 0, p); - mode[m] += lb->f[ijk]*lb->param->ma[m][p]; - } - } - - /* Transform */ - - rho = mode[0]; - g[X] = mode[1]; - g[Y] = mode[2]; - g[Z] = mode[3]; - - mode[2] = mode[2] + rho*du[Y]; - mode[5] = mode[5] + g[X]*du[Y]; - mode[7] = mode[7] + 2.0*g[Y]*du[Y] + rho*du[Y]*du[Y]; - mode[8] = mode[8] + g[Z]*du[Y]; - - /* All ghosts unaltered */ - - /* Reproject */ - - for (np = 0; np < xblocklen_cv[0]; np++) { - p = poffset + np; - { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, 0, p); - lb->f[ijk] = 0.0; - for (m = 0; m < lb->model.nvel; m++) { - lb->f[ijk] += mode[m]*lb->param->mi[p][m]; - } - } - } - - /* next site */ - } - } - } - } - - return 0; -} - /***************************************************************************** * * le_displace_and_interpolate @@ -343,7 +222,6 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { int index0, index1; int nlocal[3]; int n, nplane, plane; - int p; int jdy, j1, j2; int ndist; int nprop; @@ -372,7 +250,14 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { * of plane-crossing distributions. */ lb_ndist(lb, &ndist); - nprop = xblocklen_cv[0]; + + /* Allocate a buffer large enough for all cvp[][X] = +1 */ + + nprop = 0; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == +1) nprop += 1; + } + ndata = ndist*nprop*nlocal[Y]*nlocal[Z]; recv_buff = (double *) malloc(ndata*sizeof(double)); assert(recv_buff); @@ -401,12 +286,12 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { /* xdisp_fwd_cv[0] identifies cv[p][X] = +1 */ for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_fwd_cv[0] + p; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; recv_buff[ndata++] = (1.0 - fr)* - lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index0,n, pcv)] + lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index0,n, p)] + fr* - lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index1,n, pcv)]; + lb->f[LB_ADDR(lb->nsite,ndist,lb->model.nvel,index1,n, p)]; } } /* Next site */ @@ -422,9 +307,9 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index0 = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_fwd_cv[0] + p; - int la = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, pcv); + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int la = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, p); lb->f[la] = recv_buff[ndata++]; } } @@ -454,11 +339,12 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index1 = lees_edw_index(le, ic, j2, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_bwd_cv[0] + p; - int l0 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, pcv); - int l1 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index1, n, pcv); - recv_buff[ndata++] = (1.0 - fr)*lb->f[l0] + fr*lb->f[l1]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == -1) { + int l0 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index0, n, p); + int l1 = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index1, n, p); + recv_buff[ndata++] = (1.0 - fr)*lb->f[l0] + fr*lb->f[l1]; + } } } /* Next site */ @@ -474,10 +360,11 @@ int le_displace_and_interpolate(lb_t * lb, lees_edw_t * le) { index0 = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int pcv = xdisp_bwd_cv[0] + p; - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel,index0,n,pcv); - lb->f[ijkp] = recv_buff[ndata++]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == -1) { + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel,index0,n,p); + lb->f[ijkp] = recv_buff[ndata++]; + } } } } @@ -544,7 +431,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { assert(lb); assert(le); - assert(CVXBLOCK == 1); lees_edw_ltot(le, ltot); lees_edw_ntotal(le, ntotal); @@ -559,7 +445,12 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { t = 1.0*physics_control_timestep(phys); lb_ndist(lb, &ndist); - nprop = xblocklen_cv[0]; + + + nprop = 0; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] == +1) nprop += 1; + } ndata = ndist*nprop*nlocal[Y]*nlocal[Z]; send_buff = (double *) malloc(ndata*sizeof(double)); @@ -610,9 +501,9 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { index = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_fwd_cv[0] + p); + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); send_buff[ndata++] = lb->f[ijkp]; } } @@ -640,11 +531,10 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { for (n = 0; n < ndist; n++) { ind1 = ind0 + n*nprop; ind2 = ind0 + ndist*nprop*nlocal[Z] + n*nprop; - - for (p = 0; p < nprop; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_fwd_cv[0] + p); - lb->f[ijk] = (1.0-fr)*recv_buff[ind1 + p] + fr*recv_buff[ind2 + p]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != +1) continue; + int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); + lb->f[ijk] = (1.0-fr)*recv_buff[ind1++] + fr*recv_buff[ind2++]; } } /* Next site */ @@ -695,9 +585,9 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { index = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 0; p < nprop; p++) { - int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_bwd_cv[0] + p); + for (p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != -1) continue; + int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); send_buff[ndata++] = lb->f[ijkp]; } } @@ -725,11 +615,10 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { for (n = 0; n < ndist; n++) { ind1 = ind0 + n*nprop; ind2 = ind0 + ndist*nprop*nlocal[Z] + n*nprop; - - for (p = 0; p < nprop; p++) { - int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, - xdisp_bwd_cv[0] + p); - lb->f[ijk] = (1.0-fr)*recv_buff[ind1 + p] + fr*recv_buff[ind2 + p]; + for (int p = 1; p < lb->model.nvel; p++) { + if (lb->model.cv[p][X] != -1) continue; + int ijk = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); + lb->f[ijk] = (1.0-fr)*recv_buff[ind1++] + fr*recv_buff[ind2++]; } } /* Next site */ From 3e714ad86e738bfb4875804c5d59bcb95eab8615 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:37:58 +0000 Subject: [PATCH 42/64] Allow d3q27 --- src/lb_model.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lb_model.c b/src/lb_model.c index f65a02810..c18dfc7e3 100644 --- a/src/lb_model.c +++ b/src/lb_model.c @@ -38,6 +38,7 @@ int lb_model_is_available(int nvel) { available += (nvel == NVEL_D2Q9); available += (nvel == NVEL_D3Q15); available += (nvel == NVEL_D3Q19); + available += (nvel == NVEL_D3Q27); return available; } From 8a29d26d914306483eb146e50c3bf7e21715cf61 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:39:43 +0000 Subject: [PATCH 43/64] Add d3q27 unit test --- tests/unit/test_lb_d3q27.c | 76 ++++++++++++++++++++++++++++++++++++++ tests/unit/tests.c | 3 +- tests/unit/tests.h | 3 +- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 tests/unit/test_lb_d3q27.c diff --git a/tests/unit/test_lb_d3q27.c b/tests/unit/test_lb_d3q27.c new file mode 100644 index 000000000..5f2b475d9 --- /dev/null +++ b/tests/unit/test_lb_d3q27.c @@ -0,0 +1,76 @@ +/***************************************************************************** + * + * lb_d3q27.c + * + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#include +#include +#include + +#include "pe.h" +#include "lb_d3q27.h" + +__host__ int test_lb_d3q27_create(void); + +/***************************************************************************** + * + * test_lb_d3q27_suite + * + *****************************************************************************/ + +__host__ int test_lb_d3q27_suite(void) { + + pe_t * pe = NULL; + + pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); + + test_lb_d3q27_create(); + + pe_info(pe, "PASS ./unit/test_lb_d3q27\n"); + + pe_free(pe); + + return 0; +} + +/***************************************************************************** + * + * test_lb_d3q27_create + * + *****************************************************************************/ + +__host__ int test_lb_d3q27_create(void) { + + lb_model_t model = {}; + + lb_d3q27_create(&model); + + assert(model.ndim == 3); + assert(model.nvel == 27); + assert(model.cv); + assert(model.wv); + assert(model.na); + assert(model.ma); + + assert(fabs(model.cs2 - 1.0/3.0) < DBL_EPSILON); + + lb_model_free(&model); + + assert(model.nvel == 0); + assert(model.cv == NULL); + assert(model.wv == NULL); + assert(model.na == NULL); + assert(model.ma == NULL); + + return 0; +} diff --git a/tests/unit/tests.c b/tests/unit/tests.c index 03c57288a..9f7bec54b 100644 --- a/tests/unit/tests.c +++ b/tests/unit/tests.c @@ -8,7 +8,7 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ @@ -75,6 +75,7 @@ __host__ int tests_create() { test_lb_d2q9_suite(); test_lb_d3q15_suite(); test_lb_d3q19_suite(); + test_lb_d3q27_suite(); test_lb_model_suite(); test_lb_bc_inflow_opts_suite(); test_lb_bc_inflow_rhou_suite(); diff --git a/tests/unit/tests.h b/tests/unit/tests.h index 800ff3110..981bb5cae 100644 --- a/tests/unit/tests.h +++ b/tests/unit/tests.h @@ -6,7 +6,7 @@ * Edinburgh Parallel Computing Centre * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * *****************************************************************************/ @@ -55,6 +55,7 @@ int test_io_options_rt_suite(void); int test_lb_d2q9_suite(void); int test_lb_d3q15_suite(void); int test_lb_d3q19_suite(void); +int test_lb_d3q27_suite(void); int test_lb_model_suite(void); int test_lb_bc_inflow_opts_suite(void); int test_lb_bc_inflow_rhou_suite(void); From 8f2d649e835b1524dfc72a955336f28fc3f68718 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:41:05 +0000 Subject: [PATCH 44/64] Add explicit test on speed of sound --- tests/unit/test_lb_model.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_lb_model.c b/tests/unit/test_lb_model.c index 648a00f09..f2ae71a90 100644 --- a/tests/unit/test_lb_model.c +++ b/tests/unit/test_lb_model.c @@ -2,13 +2,13 @@ * * test_lb_model.c * - * Tests that all model should pass. + * Tests that all models should pass. * * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -127,7 +127,7 @@ int test_lb_model_cv(const lb_model_t * model) { ifail += (sum[X] + sum[Y] + sum[Z]); } - /* Check cv[p][] = -cv[NVEL-p][] (p != 0) */ + /* Check cv[p][] = -cv[nvel-p][] (p != 0) */ for (int p = 1; p < model->nvel; p++) { assert(model->cv[p][X] == -model->cv[model->nvel-p][X]); From 7c0486c5c82ced72f483edc33683d39ea413cde6 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:42:25 +0000 Subject: [PATCH 45/64] Add explicit test on speed of sound --- tests/unit/test_lb_d3q19.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/test_lb_d3q19.c b/tests/unit/test_lb_d3q19.c index 4f5a39727..091b755e2 100644 --- a/tests/unit/test_lb_d3q19.c +++ b/tests/unit/test_lb_d3q19.c @@ -69,6 +69,8 @@ __host__ int test_lb_d3q19_create(void) { assert(model.na); assert(model.ma); + assert(fabs(model.cs2 - 1.0/3.0) < DBL_EPSILON); + lb_model_free(&model); assert(model.nvel == 0); From 7f51433ad02f51eb270973579f0d5594fbe31713 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:43:14 +0000 Subject: [PATCH 46/64] Add different model versions --- tests/unit/test_lb_bc_inflow_rhou.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index 2298041e7..78a49d522 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -41,8 +41,13 @@ __host__ int test_lb_bc_inflow_rhou_suite(void) { cs_init(cs); test_lb_bc_inflow_rhou_create(pe, cs); - test_lb_bc_inflow_rhou_update(pe, cs, NVEL); - test_lb_bc_inflow_rhou_impose(pe, cs, NVEL); + /* Need to check (2, 9) in 2d system */ + test_lb_bc_inflow_rhou_update(pe, cs, 15); + test_lb_bc_inflow_rhou_impose(pe, cs, 15); + test_lb_bc_inflow_rhou_update(pe, cs, 19); + test_lb_bc_inflow_rhou_impose(pe, cs, 19); + test_lb_bc_inflow_rhou_update(pe, cs, 27); + test_lb_bc_inflow_rhou_impose(pe, cs, 27); pe_info(pe, "PASS ./unit/test_lb_bc_inflow_rhou\n"); @@ -209,6 +214,8 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { lb_bc_inflow_rhou_create(pe, cs, &options, &inflow); hydro_create(pe, cs, NULL, &hopts, &hydro); + + lb_options.nvel = nvel; lb_data_create(pe, cs, &lb_options, &lb); /* Set the relevant domain values (rho only here) */ From 35565ddc50f9eb525606f70b530277f4c2fc834f Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 19:44:57 +0000 Subject: [PATCH 47/64] Remove old reduced halo and update --- tests/unit/test_halo.c | 124 +++++++++++++++++----------------------- tests/unit/test_model.c | 83 +++++---------------------- tests/unit/test_prop.c | 37 ++++++------ 3 files changed, 87 insertions(+), 157 deletions(-) diff --git a/tests/unit/test_halo.c b/tests/unit/test_halo.c index 03ea35328..9dad569d3 100644 --- a/tests/unit/test_halo.c +++ b/tests/unit/test_halo.c @@ -27,9 +27,9 @@ #include "control.h" #include "tests.h" -int do_test_const_blocks(void); -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); -int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_halo_enum_t halo); +int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel); +int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts); +int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_data_options_t opts); /***************************************************************************** * @@ -46,21 +46,10 @@ int test_halo_suite(void) { cs_create(pe, &cs); cs_init(cs); - do_test_const_blocks(); - - do_test_halo_null(pe, cs, LB_HALO_FULL); - do_test_halo_null(pe, cs, LB_HALO_REDUCED); - - do_test_halo(pe, cs, X, LB_HALO_FULL); - do_test_halo(pe, cs, Y, LB_HALO_FULL); - do_test_halo(pe, cs, Z, LB_HALO_FULL); - - if (pe_mpi_size(pe) == 1) { - do_test_halo(pe, cs, X, LB_HALO_REDUCED); - do_test_halo(pe, cs, Y, LB_HALO_REDUCED); - do_test_halo(pe, cs, Z, LB_HALO_REDUCED); - } - + /* Use a 2d system for test_lb_halo1(pe, cs, 2, 9); */ + test_lb_halo1(pe, cs, 3, 15); + test_lb_halo1(pe, cs, 3, 19); + test_lb_halo1(pe, cs, 3, 27); pe_info(pe, "PASS ./unit/test_halo\n"); cs_free(cs); @@ -69,32 +58,47 @@ int test_halo_suite(void) { return 0; } -int do_test_const_blocks(void) { +/***************************************************************************** + * + * test_lb_halo + * + *****************************************************************************/ -#ifdef TEST_TO_BE_REMOVED_WITH_GLOBAL_SYMBOLS - int i, k; +int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel) { - for (i = 0; i < CVXBLOCK; i++) { - for (k = 0; k < xblocklen_cv[i]; k++) { - test_assert(cv[xdisp_fwd_cv[i] + k][X] == +1); - test_assert(cv[xdisp_bwd_cv[i] + k][X] == -1); - } - } + lb_data_options_t opts = lb_data_options_default(); - for (i = 0; i < CVYBLOCK; i++) { - for (k = 0; k < yblocklen_cv[i]; k++) { - test_assert(cv[ydisp_fwd_cv[i] + k][Y] == +1); - test_assert(cv[ydisp_bwd_cv[i] + k][Y] == -1); - } - } + opts.ndim = ndim; + opts.nvel = nvel; + opts.ndist = 1; + opts.halo = LB_HALO_TARGET; + + do_test_halo_null(pe, cs, opts); + do_test_halo(pe, cs, X, opts); + do_test_halo(pe, cs, Y, opts); + do_test_halo(pe, cs, Z, opts); + + opts.ndist = 1; + opts.halo = LB_HALO_OPENMP_FULL; + + do_test_halo_null(pe, cs, opts); + do_test_halo(pe, cs, X, opts); + do_test_halo(pe, cs, Y, opts); + do_test_halo(pe, cs, Z, opts); + + opts.ndist = 1; + opts.halo = LB_HALO_OPENMP_REDUCED; + + do_test_halo_null(pe, cs, opts); + + opts.ndist = 2; + opts.halo = LB_HALO_TARGET; + + do_test_halo_null(pe, cs, opts); + do_test_halo(pe, cs, X, opts); + do_test_halo(pe, cs, Y, opts); + do_test_halo(pe, cs, Z, opts); - for (i = 0; i < CVZBLOCK; i++) { - for (k = 0; k < zblocklen_cv[i]; k++) { - test_assert(cv[zdisp_fwd_cv[i] + k][Z] == +1); - test_assert(cv[zdisp_bwd_cv[i] + k][Z] == -1); - } - } -#endif return 0; } @@ -107,17 +111,14 @@ int do_test_const_blocks(void) { * *****************************************************************************/ -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts) { int nlocal[3], n[3]; int index, nd, p; - int ndist = 2; - int rank; int nhalo; int nextra; double f_actual; - MPI_Comm comm = MPI_COMM_WORLD; lb_t * lb = NULL; assert(pe); @@ -126,16 +127,8 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { cs_nhalo(cs, &nhalo); nextra = nhalo - 1; - MPI_Comm_rank(comm, &rank); + lb_data_create(pe, cs, &opts, &lb); - { - lb_data_options_t options = lb_data_options_default(); - options.ndim = NDIM; - options.nvel = NVEL; - options.ndist = ndist; - lb_data_create(pe, cs, &options, &lb); - lb_halo_set(lb, halo); - } cs_nlocal(cs, nlocal); /* Set entire distribution (all sites including halos) to 1.0 */ @@ -146,7 +139,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 1.0); } @@ -164,7 +157,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 0.0); } @@ -186,7 +179,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f(lb, index, p, nd, &f_actual); @@ -215,7 +208,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { * *****************************************************************************/ -int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { +int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_data_options_t opts) { int nhalo; int nlocal[3], n[3]; @@ -223,7 +216,6 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { int mpi_cartsz[3]; int mpi_cartcoords[3]; int nd; - int ndist = 2; int nextra; int index, p, d; @@ -235,15 +227,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { assert(cs); assert(dim == X || dim == Y || dim == Z); - - { - lb_data_options_t options = lb_data_options_default(); - options.nvel = NVEL; - options.ndim = NDIM; - options.ndist = ndist; - lb_data_create(pe, cs, &options, &lb); - lb_halo_set(lb, halo); - } + lb_data_create(pe, cs, &opts, &lb); cs_nhalo(cs, &nhalo); nextra = nhalo; @@ -262,7 +246,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, -1.0); } @@ -285,7 +269,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { n[Y] <= nhalo || n[Y] > nlocal[Y] - nhalo || n[Z] <= nhalo || n[Z] > nlocal[Z] - nhalo) { - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (p = 0; p < lb->model.nvel; p++) { lb_f_set(lb, index, p, nd, 1.0*(offset[dim] + n[dim])); } @@ -313,7 +297,7 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_halo_enum_t halo) { index = cs_index(cs, n[X], n[Y], n[Z]); - for (nd = 0; nd < ndist; nd++) { + for (nd = 0; nd < lb->ndist; nd++) { for (d = 0; d < 3; d++) { /* 'Left' side */ diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index 9668b2923..54fe3201d 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -2,7 +2,10 @@ * * test_model.c * - * Unit test for the currently compiled model (D3Q15 or D3Q19). + * Tests for model data: distributions, halos, i/o (pending!). + * PENDING: This is to be merged with test_halo.c under "test_lb_data.c". + * PENDING: Coverage check. + * * * Edinburgh Soft Matter and Statistical Physics Group * Edinburgh Parallel Computing Centre @@ -25,7 +28,6 @@ #include "lb_data.h" #include "tests.h" -static void test_model_constants(void); static void test_model_velocity_set(void); int do_test_model_distributions(pe_t * pe, cs_t * cs); @@ -196,8 +198,6 @@ int test_lb_halo_post_wait(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { assert(pe); assert(cs); - printf("test halo create ndim = %2d nvel = %2d full = %2d\n", - ndim, nvel, full); options.ndim = ndim; options.nvel = nvel; lb_data_create(pe, cs, &options, &lb); @@ -237,6 +237,7 @@ int test_lb_halo(pe_t * pe) { cs_ntotal_set(cs, ntotal); cs_init(cs); + /*test_lb_data_create(pe, cs, 2, 9);*/ test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_REDUCED); test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_FULL); @@ -254,11 +255,8 @@ int test_lb_halo(pe_t * pe) { test_lb_halo_post_wait(pe, cs, 3, 15, LB_HALO_OPENMP_FULL); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_REDUCED); test_lb_halo_post_wait(pe, cs, 3, 19, LB_HALO_OPENMP_FULL); - - /* TODO: add when NVEL is not fixed... - * "3, 27, LB_HALO_OPENMP_REDUCED" - * "3, 27, LB_HALO_OPENMP_FULL" - */ + test_lb_halo_post_wait(pe, cs, 3, 27, LB_HALO_OPENMP_REDUCED); + test_lb_halo_post_wait(pe, cs, 3, 27, LB_HALO_OPENMP_FULL); cs_free(cs); } @@ -287,16 +285,13 @@ int test_model_suite(void) { /* Test model structure (coordinate-independent stuff) */ - test_model_constants(); test_model_velocity_set(); /* Now test actual distributions */ do_test_model_distributions(pe, cs); do_test_model_halo_swap(pe, cs); - if (DATA_MODEL == DATA_MODEL_AOS && NSIMDVL == 1) { - do_test_model_reduced_halo_swap(pe, cs); - } + do_test_model_reduced_halo_swap(pe, cs); do_test_lb_model_io(pe, cs); pe_info(pe, "PASS ./unit/test_model\n"); @@ -306,61 +301,11 @@ int test_model_suite(void) { return 0; } -/***************************************************************************** - * - * test_model_constants - * - * Check the various constants associated with the reduced halo swap. - * - *****************************************************************************/ - -static void test_model_constants(void) { - -#ifdef TEST_TO_BE_REMOVED_WITH_GLOBAL_SYMBOLS - int i, k, p; - - for (i = 0; i < CVXBLOCK; i++) { - for (k = 0; k < xblocklen_cv[i]; k++) { - p = xdisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][X] == +1); - p = xdisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][X] == -1); - } - } - - for (i = 0; i < CVYBLOCK; i++) { - for (k = 0; k < yblocklen_cv[i]; k++) { - p = ydisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Y] == +1); - p = ydisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Y] == -1); - } - } - - for (i = 0; i < CVZBLOCK; i++) { - for (k = 0; k < zblocklen_cv[i]; k++) { - p = zdisp_fwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Z] == +1); - p = zdisp_bwd_cv[i] + k; - test_assert(p >= 0 && p < NVEL); - test_assert(cv[p][Z] == -1); - } - } -#endif - return; -} - /***************************************************************************** * * test_model_velocity_set * - * Check the velocities, kinetic projector, tables of eigenvectors - * etc etc are all consistent for the current model. + * Some residual older tests which remain relevant. * *****************************************************************************/ @@ -368,6 +313,9 @@ static void test_model_velocity_set(void) { test_assert(NHYDRO == (1 + NDIM + NDIM*(NDIM+1)/2)); + printf("Compiled model NDIM %2d NVEL %2d\n", NDIM, NVEL); + printf("sizeof(lb_collide_param_t) %ld bytes\n", sizeof(lb_collide_param_t)); + return; } @@ -458,7 +406,6 @@ int do_test_model_halo_swap(pe_t * pe, cs_t * cs) { options.nvel = NVEL; options.ndist = ndist; lb_data_create(pe, cs, &options, &lb); - assert(lb); cs_nlocal(cs, nlocal); @@ -543,7 +490,7 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { int i, j, k, p; int icdt, jcdt, kcdt; int index, nlocal[3]; - int n, ndist = 2; + int n, ndist = 1; const int nextra = 1; double f_expect; @@ -558,9 +505,9 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { options.ndim = NDIM; options.nvel = NVEL; options.ndist = ndist; + options.halo = LB_HALO_OPENMP_REDUCED; lb_data_create(pe, cs, &options, &lb); assert(lb); - lb_halo_set(lb, LB_HALO_REDUCED); cs_nlocal(cs, nlocal); @@ -580,7 +527,7 @@ int do_test_model_reduced_halo_swap(pe_t * pe, cs_t * cs) { } } - lb_halo_via_struct(lb); + lb_halo(lb); /* Now check that the interior sites are unchanged */ diff --git a/tests/unit/test_prop.c b/tests/unit/test_prop.c index b81842518..6691fcad4 100644 --- a/tests/unit/test_prop.c +++ b/tests/unit/test_prop.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 Ths University of Edinburgh + * (c) 2010-2022 Ths University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -25,8 +25,10 @@ #include "propagation.h" #include "tests.h" -__host__ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); -__host__ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo); +__host__ int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo); +__host__ int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo); /***************************************************************************** * @@ -43,19 +45,15 @@ int test_lb_prop_suite(void) { cs_create(pe, &cs); cs_init(cs); - if (NSIMDVL == 1 && DATA_MODEL == DATA_MODEL_AOS) { - do_test_velocity(pe, cs, LB_HALO_FULL); - do_test_velocity(pe, cs, LB_HALO_REDUCED); + do_test_velocity(pe, cs, 1, LB_HALO_TARGET); + do_test_velocity(pe, cs, 2, LB_HALO_TARGET); + do_test_velocity(pe, cs, 1, LB_HALO_OPENMP_FULL); + do_test_velocity(pe, cs, 1, LB_HALO_OPENMP_REDUCED); - do_test_source_destination(pe, cs, LB_HALO_FULL); - do_test_source_destination(pe, cs, LB_HALO_REDUCED); - } - - do_test_velocity(pe, cs, LB_HALO_HOST); - do_test_source_destination(pe, cs, LB_HALO_HOST); - - do_test_velocity(pe, cs, LB_HALO_TARGET); - do_test_source_destination(pe, cs, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 1, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 2, LB_HALO_TARGET); + do_test_source_destination(pe, cs, 1, LB_HALO_OPENMP_FULL); + do_test_source_destination(pe, cs, 1, LB_HALO_OPENMP_REDUCED); pe_info(pe, "PASS ./unit/test_prop\n"); cs_free(cs); @@ -73,13 +71,12 @@ int test_lb_prop_suite(void) { * *****************************************************************************/ -int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { int ndevice; int nlocal[3]; int ic, jc, kc, index, p; int nd; - int ndist = 2; double f_actual; lb_data_options_t options = lb_data_options_default(); @@ -87,6 +84,7 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { assert(pe); assert(cs); + assert(ndist == 1 || ndist == 2); options.ndim = NDIM; options.nvel = NVEL; @@ -161,14 +159,14 @@ int do_test_velocity(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { * *****************************************************************************/ -int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { +int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, + lb_halo_enum_t halo) { int ndevice; int nlocal[3], offset[3]; int ntotal[3]; int ic, jc, kc, index, p; int nd; - int ndist = 2; int isource, jsource, ksource; double f_actual, f_expect; double ltot[3]; @@ -178,6 +176,7 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, lb_halo_enum_t halo) { assert(pe); assert(cs); + assert(ndist == 1 || ndist == 2); options.ndim = NDIM; options.nvel = NVEL; From c83748a77c70f6c77528c02205a2e78459663142 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 20:47:52 +0000 Subject: [PATCH 48/64] Update comments --- src/lb_d3q27.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lb_d3q27.c b/src/lb_d3q27.c index 907f0d0d0..50796f5fb 100644 --- a/src/lb_d3q27.c +++ b/src/lb_d3q27.c @@ -2,13 +2,13 @@ * * lb_d3q27.c * - * D3Q27 definition. Not yet complete. + * D3Q27 definition. * * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) From 881d0786b75bdcac01c7de15eb60afdaf1d233b1 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 20:48:40 +0000 Subject: [PATCH 49/64] Remove shadow --- src/model_le.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/model_le.c b/src/model_le.c index 5ada15c3a..57ce04750 100644 --- a/src/model_le.c +++ b/src/model_le.c @@ -406,7 +406,6 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { int nhalo; int ind0, ind1, ind2, index; int n, nplane, plane; - int p; int ntotal[3]; int nlocal[3]; int offset[3]; @@ -585,7 +584,7 @@ static int le_displace_and_interpolate_parallel(lb_t * lb, lees_edw_t * le) { index = lees_edw_index(le, ic, jc, kc); for (n = 0; n < ndist; n++) { - for (p = 1; p < lb->model.nvel; p++) { + for (int p = 1; p < lb->model.nvel; p++) { if (lb->model.cv[p][X] != -1) continue; int ijkp = LB_ADDR(lb->nsite, ndist, lb->model.nvel, index, n, p); send_buff[ndata++] = lb->f[ijkp]; From fab24e988958559d2fb828c948680a61e382afcb Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 2 Mar 2022 20:48:51 +0000 Subject: [PATCH 50/64] Fix alerts --- tests/unit/test_halo.c | 44 ++++++++++++++++++++++------------------- tests/unit/test_model.c | 1 - 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/tests/unit/test_halo.c b/tests/unit/test_halo.c index 9dad569d3..6354ef64c 100644 --- a/tests/unit/test_halo.c +++ b/tests/unit/test_halo.c @@ -28,8 +28,8 @@ #include "tests.h" int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel); -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts); -int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_data_options_t opts); +int do_test_halo_null(pe_t * pe, cs_t * cs, const lb_data_options_t * opts); +int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_data_options_t * opts); /***************************************************************************** * @@ -46,9 +46,11 @@ int test_halo_suite(void) { cs_create(pe, &cs); cs_init(cs); - /* Use a 2d system for test_lb_halo1(pe, cs, 2, 9); */ + /* Use a 2d system for ndim = 2, nvel = 9 */ test_lb_halo1(pe, cs, 3, 15); + pe_info(pe, "PASS ./unit/test_halo 15\n"); test_lb_halo1(pe, cs, 3, 19); + pe_info(pe, "PASS ./unit/test_halo 19\n"); test_lb_halo1(pe, cs, 3, 27); pe_info(pe, "PASS ./unit/test_halo\n"); @@ -73,31 +75,31 @@ int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel) { opts.ndist = 1; opts.halo = LB_HALO_TARGET; - do_test_halo_null(pe, cs, opts); - do_test_halo(pe, cs, X, opts); - do_test_halo(pe, cs, Y, opts); - do_test_halo(pe, cs, Z, opts); + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); opts.ndist = 1; opts.halo = LB_HALO_OPENMP_FULL; - do_test_halo_null(pe, cs, opts); - do_test_halo(pe, cs, X, opts); - do_test_halo(pe, cs, Y, opts); - do_test_halo(pe, cs, Z, opts); + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); opts.ndist = 1; opts.halo = LB_HALO_OPENMP_REDUCED; - do_test_halo_null(pe, cs, opts); + do_test_halo_null(pe, cs, &opts); opts.ndist = 2; opts.halo = LB_HALO_TARGET; - do_test_halo_null(pe, cs, opts); - do_test_halo(pe, cs, X, opts); - do_test_halo(pe, cs, Y, opts); - do_test_halo(pe, cs, Z, opts); + do_test_halo_null(pe, cs, &opts); + do_test_halo(pe, cs, X, &opts); + do_test_halo(pe, cs, Y, &opts); + do_test_halo(pe, cs, Z, &opts); return 0; } @@ -111,7 +113,7 @@ int test_lb_halo1(pe_t * pe, cs_t * cs, int ndim, int nvel) { * *****************************************************************************/ -int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts) { +int do_test_halo_null(pe_t * pe, cs_t * cs, const lb_data_options_t * opts) { int nlocal[3], n[3]; int index, nd, p; @@ -123,11 +125,12 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts) { assert(pe); assert(cs); + assert(opts); cs_nhalo(cs, &nhalo); nextra = nhalo - 1; - lb_data_create(pe, cs, &opts, &lb); + lb_data_create(pe, cs, opts, &lb); cs_nlocal(cs, nlocal); @@ -208,7 +211,7 @@ int do_test_halo_null(pe_t * pe, cs_t * cs, lb_data_options_t opts) { * *****************************************************************************/ -int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_data_options_t opts) { +int do_test_halo(pe_t * pe, cs_t * cs, int dim, const lb_data_options_t * opts) { int nhalo; int nlocal[3], n[3]; @@ -226,8 +229,9 @@ int do_test_halo(pe_t * pe, cs_t * cs, int dim, lb_data_options_t opts) { assert(pe); assert(cs); assert(dim == X || dim == Y || dim == Z); + assert(opts); - lb_data_create(pe, cs, &opts, &lb); + lb_data_create(pe, cs, opts, &lb); cs_nhalo(cs, &nhalo); nextra = nhalo; diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index 54fe3201d..19b7fd6ae 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -237,7 +237,6 @@ int test_lb_halo(pe_t * pe) { cs_ntotal_set(cs, ntotal); cs_init(cs); - /*test_lb_data_create(pe, cs, 2, 9);*/ test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_REDUCED); test_lb_halo_post_wait(pe, cs, 2, 9, LB_HALO_OPENMP_FULL); From 60c31e976ca99698b8164f3643641da647fb96e4 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Thu, 3 Mar 2022 19:35:51 +0000 Subject: [PATCH 51/64] Used fixed size lb collision param --- src/lb_data.h | 12 ++++++------ src/model.c | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lb_data.h b/src/lb_data.h index 31ef3b48b..827b88a50 100644 --- a/src/lb_data.h +++ b/src/lb_data.h @@ -47,7 +47,7 @@ typedef struct lb_data_s lb_t; struct lb_collide_param_s { int8_t isghost; /* switch for ghost modes */ - int8_t cv[NVEL][3]; + int8_t cv[27][3]; int nsite; int ndist; int nvel; @@ -56,11 +56,11 @@ struct lb_collide_param_s { double var_shear; double eta_bulk; double var_bulk; - double rna[NVEL]; /* reciprocal of normaliser[p] */ - double rtau[NVEL]; - double wv[NVEL]; - double ma[NVEL][NVEL]; - double mi[NVEL][NVEL]; + double rna[27]; /* reciprocal of normaliser[p] */ + double rtau[27]; + double wv[27]; + double ma[27][27]; + double mi[27][27]; }; /* Halo */ diff --git a/src/model.c b/src/model.c index f9b5b304a..6ce70a597 100644 --- a/src/model.c +++ b/src/model.c @@ -310,6 +310,7 @@ static int lb_model_param_init(lb_t * lb) { assert(lb); assert(lb->param); + assert(lb->model.nvel <= 27); /* Currently largest model supported */ lb->param->nsite = lb->nsite; lb->param->ndist = lb->ndist; From ddfce6d536f464ce90ba4cde12375e6f86dcd4e7 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Sat, 2 Apr 2022 20:22:58 +0100 Subject: [PATCH 52/64] Re-instate wall colloid potential --- CHANGES.md | 6 + src/colloids_rt.c | 57 +++++- src/wall_ss_cut.c | 135 +++++-------- src/wall_ss_cut.h | 13 +- .../d3q19-short/serial-wall-st5.inp | 98 ++++++++++ .../d3q19-short/serial-wall-st5.log | 163 ++++++++++++++++ tests/unit/test_wall_ss_cut.c | 177 ++++++++++++++++++ tests/unit/tests.c | 1 + tests/unit/tests.h | 1 + 9 files changed, 555 insertions(+), 96 deletions(-) create mode 100644 tests/regression/d3q19-short/serial-wall-st5.inp create mode 100644 tests/regression/d3q19-short/serial-wall-st5.log create mode 100644 tests/unit/test_wall_ss_cut.c diff --git a/CHANGES.md b/CHANGES.md index 8c77e2361..afa582ee8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ ### Changes +version 0.16.0 + +- Reinstated the boundary (wall) - colloid soft sphere potential. + See https://ludwig.epcc.ed.ac.uk/inputs/colloid.html + Thanks to Rishish Mishra for spotting this problem. + version 0.15.0 - Active stress implementation is updated to conform to the documented diff --git a/src/colloids_rt.c b/src/colloids_rt.c index 19d93b327..004ba3bdf 100644 --- a/src/colloids_rt.c +++ b/src/colloids_rt.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2014-2021 The University of Edinburgh + * (c) 2014-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -32,6 +32,7 @@ #include "pair_yukawa.h" #include "bond_fene.h" #include "angle_cosine.h" +#include "wall_ss_cut.h" #include "colloids_halo.h" #include "colloids_init.h" @@ -47,9 +48,11 @@ int pair_yukawa_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * inter); int pair_lj_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * inter); int bond_fene_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * interact); int angle_cosine_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * interact); - int pair_ss_cut_ij_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * intrct); +int wall_ss_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, wall_t * wall, + interact_t * inter); + int colloids_rt_dynamics(cs_t * cs, colloids_info_t * cinfo, wall_t * wall, map_t * map, const lb_model_t * model); int colloids_rt_gravity(pe_t * pe, rt_t * rt, colloids_info_t * cinfo); @@ -146,6 +149,8 @@ int colloids_init_rt(pe_t * pe, rt_t * rt, cs_t * cs, colloids_info_t ** pinfo, pair_ss_cut_ij_init(pe, cs, rt, *interact); + wall_ss_cut_init(pe, cs, rt, wall, *interact); + colloids_rt_cell_list_checks(pe, cs, pinfo, *interact); colloids_init_halo_range_check(pe, cs, *pinfo); if (nc > 1) interact_range_check(*interact, *pinfo); @@ -756,18 +761,13 @@ int pair_ss_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * inter) { double epsilon ; double sigma; int nu; - double kt; double cutoff; - physics_t * phys = NULL; pair_ss_cut_t * pair = NULL; assert(pe); assert(rt); - physics_ref(&phys); - physics_kt(phys, &kt); - rt_int_parameter(rt, "soft_sphere_on", &on); if (on) { @@ -1071,3 +1071,46 @@ int colloids_init_halo_range_check(pe_t * pe, cs_t * cs, return ifail; } + +/***************************************************************************** + * + * wall_ss_cut_init + * + *****************************************************************************/ + +int wall_ss_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, wall_t * wall, + interact_t * interact) { + + int have_wall_ss_cut = 0; + + assert(pe); + assert(cs); + assert(rt); + + have_wall_ss_cut = rt_switch(rt, "wall_ss_cut_on"); + + if (have_wall_ss_cut) { + + wall_ss_cut_t * wall_ss_cut = NULL; + wall_ss_cut_options_t opts = {}; + + rt_key_required(rt, "wall_ss_cut_epsilon", RT_FATAL); + rt_key_required(rt, "wall_ss_cut_sigma", RT_FATAL); + rt_key_required(rt, "wall_ss_cut_nu", RT_FATAL); + rt_key_required(rt, "wall_ss_cut_hc", RT_FATAL); + + rt_double_parameter(rt, "wall_ss_cut_epsilon", &opts.epsilon); + rt_double_parameter(rt, "wall_ss_cut_sigma", &opts.sigma); + rt_double_parameter(rt, "wall_ss_cut_nu", &opts.nu); + rt_double_parameter(rt, "wall_ss_cut_hc", &opts.hc); + + if (opts.nu <= 0) pe_fatal(pe, "Please ensure wall_ss_cut_nu is +ve\n"); + if (opts.hc <= 0) pe_fatal(pe, "Please ensure wall_ss_cut_hc is +ve\n"); + + wall_ss_cut_create(pe, cs, wall, &opts, &wall_ss_cut); + wall_ss_cut_register(wall_ss_cut, interact); + wall_ss_cut_info(wall_ss_cut); + } + + return 0; +} diff --git a/src/wall_ss_cut.c b/src/wall_ss_cut.c index 982cc544e..741de6fc0 100644 --- a/src/wall_ss_cut.c +++ b/src/wall_ss_cut.c @@ -23,7 +23,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2016 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * Juho Lintuvuori (juho.lintuvuori@u-psud.fr) * *****************************************************************************/ @@ -47,7 +47,7 @@ struct wall_ss_cut_s { double hc; /* cut-off */ double vlocal; /* local contribution to energy */ double hminlocal; /* local nearest separation */ - double rminlocal; /* local min centre-centre separation */ + double rminlocal; /* local min wall-centre separation */ }; /***************************************************************************** @@ -57,12 +57,15 @@ struct wall_ss_cut_s { *****************************************************************************/ int wall_ss_cut_create(pe_t * pe, cs_t * cs, wall_t * wall, + const wall_ss_cut_options_t * opts, wall_ss_cut_t ** pobj) { wall_ss_cut_t * obj = NULL; assert(pe); assert(cs); + assert(wall); + assert(opts); assert(pobj); obj = (wall_ss_cut_t *) calloc(1, sizeof(wall_ss_cut_t)); @@ -73,6 +76,11 @@ int wall_ss_cut_create(pe_t * pe, cs_t * cs, wall_t * wall, obj->cs = cs; obj->wall = wall; + obj->epsilon = opts->epsilon; + obj->sigma = opts->sigma; + obj->nu = opts->nu; + obj->hc = opts->hc; + *pobj = obj; return 0; @@ -93,24 +101,6 @@ int wall_ss_cut_free(wall_ss_cut_t * obj) { return 0; } -/***************************************************************************** - * - * wall_ss_cut_param_set - * - *****************************************************************************/ - -int wall_ss_cut_param_set(wall_ss_cut_t * obj, double epsilon, double sigma, - int nu, double hc) { - assert(obj); - - obj->epsilon = epsilon; - obj->sigma = sigma; - obj->nu = nu; - obj->hc = hc; - - return 0; -} - /***************************************************************************** * * wall_ss_cut_info @@ -126,11 +116,12 @@ int wall_ss_cut_info(wall_ss_cut_t * obj) { physics_kt(phys, &kt); pe_info(obj->pe, "\n"); - pe_info(obj->pe, "Soft sphere for wall potential\n"); + pe_info(obj->pe, "Wall-colloid soft-sphere potential\n"); + pe_info(obj->pe, "----------------------------------\n"); pe_info(obj->pe, "epsilon: %14.7e\n", obj->epsilon); pe_info(obj->pe, "sigma: %14.7e\n", obj->sigma); pe_info(obj->pe, "exponent nu: %14.7e\n", obj->nu); - pe_info(obj->pe, "cut off (surface-surface) %14.7e\n", obj->hc); + pe_info(obj->pe, "cut off hc (wall-surface) %14.7e\n", obj->hc); if (kt > 0.0) { pe_info(obj->pe, "epsilon / kT %14.7e\n", obj->epsilon/kt); } @@ -166,23 +157,11 @@ int wall_ss_cut_compute(colloids_info_t * cinfo, void * obj) { wall_ss_cut_t * self = (wall_ss_cut_t *) obj; - int ic1, jc1, kc1; - int ncell[3]; - int ia; - int iswall[3]; - - double r; /* centre-centre sepration */ - double h; /* surface-surface separation */ - double rh; /* reciprocal h */ - double rsigma; /* reciproal sigma */ - double vcut; /* potential at cut off */ - double dvcut; /* derivative at cut off */ - double forcewall[3]; /* force on the wall for accounting purposes */ + double forcewall[3] = {}; /* force on the wall for accounting */ double lmin[3]; double ltot[3]; - double f; - colloid_t * pc1; + colloid_t * pc = NULL; assert(cinfo); assert(self); @@ -194,65 +173,49 @@ int wall_ss_cut_compute(colloids_info_t * cinfo, void * obj) { self->hminlocal = dmax(ltot[X], dmax(ltot[Y], ltot[Z])); self->rminlocal = self->hminlocal; - rsigma = 1.0/self->sigma; - vcut = self->epsilon*pow(self->sigma/self->hc, self->nu); - dvcut = -self->epsilon*self->nu*rsigma*pow(self->sigma/self->hc, self->nu+1); + colloids_info_local_head(cinfo, &pc); - forcewall[X] = 0.0; - forcewall[Y] = 0.0; - forcewall[Z] = 0.0; + for (; pc; pc = pc->nextlocal) { - wall_present_dim(self->wall, iswall); - colloids_info_ncell(cinfo, ncell); + for (int ia = 0; ia < 3; ia++) { - for (ic1 = 1; ic1 <= ncell[X]; ic1++) { - for (jc1 = 1; jc1 <= ncell[Y]; jc1++) { - for (kc1 = 1; kc1 <= ncell[Z]; kc1++) { - - colloids_info_cell_list_head(cinfo, ic1, jc1, kc1, &pc1); - for (; pc1; pc1 = pc1->next) { + double f = 0.0; + double r = 0.0; /* wall-centre sepration */ + double h = 0.0; /* wall-surface separation */ - for (ia = 0; ia < 3; ia++) { - if (iswall[ia]) { - - f = 0.0; - /* lower wall */ - r = pc1->s.r[ia] - lmin[ia]; - if (r < self->rminlocal) self->rminlocal = r; + if (self->wall->param->isboundary[ia] == 0) continue; - h = r - pc1->s.ah; - assert(h > 0.0); - if (h < self->hminlocal) self->hminlocal = h; - - if (h < self->hc) { - rh = 1.0/h; - self->vlocal += self->epsilon*pow(rh*self->sigma, self->nu) - - vcut - (h - self->hc)*dvcut; - f = -(-self->epsilon*self->nu*rsigma - *pow(rh*self->sigma, self->nu+1) - dvcut); - } + /* lower wall */ + r = pc->s.r[ia] - lmin[ia]; + h = r - pc->s.ah; + + if (h < self->hminlocal) self->hminlocal = h; + if (r < self->rminlocal) self->rminlocal = r; - /*upper wall*/ - r = lmin[ia] + ltot[ia] - pc1->s.r[ia]; - if (r < self->rminlocal) self->rminlocal = r; + if (h < self->hc) { + double v = 0.0; + double fl = 0.0; + wall_ss_cut_single(self, h, &fl, &v); + self->vlocal += v; + f += fl; + } - h = r - pc1->s.ah; - assert(h > 0.0); - if (h < self->hminlocal) self->hminlocal = h; + /* upper wall */ + r = lmin[ia] + ltot[ia] - pc->s.r[ia]; + h = r - pc->s.ah; + + if (r < self->rminlocal) self->rminlocal = r; + if (h < self->hminlocal) self->hminlocal = h; - if (h < self->hc) { - rh = 1.0/h; - self->vlocal += self->epsilon*pow(rh*self->sigma, self->nu) - - vcut - (h - self->hc)*dvcut; - f -= -(-self->epsilon*self->nu*rsigma - *pow(rh*self->sigma, self->nu+1) - dvcut); - } - pc1->force[ia] += f; - forcewall[ia] -= f; - } - } - } + if (h < self->hc) { + double v = 0.0; + double fu = 0.0; + wall_ss_cut_single(self, h, &fu, &v); + self->vlocal += v; + f -= fu; /* upper wall gives -ve (repulsive) force */ } + pc->force[ia] += f; + forcewall[ia] -= f; } } diff --git a/src/wall_ss_cut.h b/src/wall_ss_cut.h index 82dc98f54..5ec9984bd 100644 --- a/src/wall_ss_cut.h +++ b/src/wall_ss_cut.h @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) The University of Edinburgh (2014) + * (c) 2014-2022 The University of Edinburgh * Juho Lintuvuori (juho.lintuvuori@u-psud.fr) * *****************************************************************************/ @@ -19,9 +19,18 @@ #include "colloids.h" #include "interaction.h" +typedef struct wall_ss_cut_options_s wall_ss_cut_options_t; typedef struct wall_ss_cut_s wall_ss_cut_t; +struct wall_ss_cut_options_s { + double epsilon; /* Energy scale */ + double sigma; /* Sigma (length) */ + double nu; /* exponent */ + double hc; /* Surface-surface cut off */ +}; + int wall_ss_cut_create(pe_t * pe, cs_t * cs, wall_t * wall, + const wall_ss_cut_options_t * opts, wall_ss_cut_t ** pobj); int wall_ss_cut_free(wall_ss_cut_t * obj); int wall_ss_cut_info(wall_ss_cut_t * obj); @@ -29,7 +38,5 @@ int wall_ss_cut_register(wall_ss_cut_t * obj, interact_t * parent); int wall_ss_cut_compute(colloids_info_t * cinfo, void * self); int wall_ss_cut_stats(void * self, double * stats); int wall_ss_cut_single(wall_ss_cut_t * obj, double h, double * f, double * v); -int wall_ss_cut_param_set(wall_ss_cut_t * obj, double epsilon, double sigma, - int nu, double hc); #endif diff --git a/tests/regression/d3q19-short/serial-wall-st5.inp b/tests/regression/d3q19-short/serial-wall-st5.inp new file mode 100644 index 000000000..ed112730d --- /dev/null +++ b/tests/regression/d3q19-short/serial-wall-st5.inp @@ -0,0 +1,98 @@ +############################################################################## +# +# Wall / soft-sphere smoke test +# +# A colloid close to the wall with wall_ss_cut potential +# +############################################################################## + +N_cycles 10 + +############################################################################## +# +# System and MPI +# +############################################################################## + +size 24_24_24 +periodicity 0_0_0 +reduced_halo no + +############################################################################## +# +# Fluid parameters +# +############################################################################## + +viscosity 0.1 + +isothermal_fluctuations off + +############################################################################## +# +# Free energy parameters +# +############################################################################### + +free_energy none + +############################################################################### +# +# Colloid parameters +# +############################################################################### + +colloid_init input_one + +colloid_one_a0 2.3 +colloid_one_ah 2.3 +colloid_one_r 3.0_12.5_12.5 +colloid_one_v 0.0_0.0_0.0 + +# Constant body force on all colloids ("gravity") [default is zero] + +colloid_gravity -0.001_0.0_0.0 + + +wall_ss_cut_on yes +wall_ss_cut_epsilon 0.001 +wall_ss_cut_sigma 0.1 +wall_ss_cut_nu 2.0 +wall_ss_cut_hc 0.5 + +############################################################################### +# +# Walls / boundaries +# +############################################################################### + +boundary_walls 1_1_1 +boundary_speed_bottom 0.0 +boundary_speed_top 0.0 + +############################################################################### +# +# Output frequency and type +# +############################################################################### + +freq_statistics 10 +config_at_end no + +############################################################################## +# +# colloid i/o +# +############################################################################## + +colloid_io_freq 100000 + +############################################################################### +# +# Miscellaneous +# +# random_seed +ve integer is the random number generator seed +# +############################################################################### + +random_seed 8361235 diff --git a/tests/regression/d3q19-short/serial-wall-st5.log b/tests/regression/d3q19-short/serial-wall-st5.log new file mode 100644 index 000000000..186f0c7e8 --- /dev/null +++ b/tests/regression/d3q19-short/serial-wall-st5.log @@ -0,0 +1,163 @@ +Welcome to Ludwig v0.15.0 (Serial version running on 1 process) +Start time: Sat Apr 2 20:13:41 2022 + +Compiler: + name: Clang 13.1.6 + version-string: 13.1.6 (clang-1316.0.21.2) + +Note assertions via standard C assert() are on. + +Target thread model: None. + +Read 25 user parameters from serial-wall-st5.inp + +No free energy selected + +System details +-------------- +System size: 24 24 24 +Decomposition: 1 1 1 +Local domain: 24 24 24 +Periodic: 0 0 0 +Halo nhalo: 1 +Reorder: true +Initialised: 1 + +System properties +---------------- +Mean fluid density: 1.00000e+00 +Shear viscosity 1.00000e-01 +Bulk viscosity 1.00000e-01 +Temperature 0.00000e+00 +External body force density 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field amplitude 0.00000e+00 0.00000e+00 0.00000e+00 +External E-field frequency 0.00000e+00 +External magnetic field 0.00000e+00 0.00000e+00 0.00000e+00 + +Lattice Boltzmann distributions +------------------------------- +Model: d3q19 +SIMD vector len: 1 +Number of sets: 1 +Halo type: full +Input format: binary +Output format: binary +I/O grid: 1 1 1 + +Lattice Boltzmann collision +--------------------------- +Relaxation time scheme: M10 +Hydrodynamic modes: on +Ghost modes: on +Isothermal fluctuations: off +Shear relaxation time: 8.00000e-01 +Bulk relaxation time: 8.00000e-01 +Ghost relaxation time: 1.00000e+00 +[User ] Random number seed: 8361235 + +Hydrodynamics +------------- +Hydrodynamics: on + +Boundary walls +-------------- +Boundary walls: X Y Z +Boundary speed u_x (bottom): 0.0000000e+00 +Boundary speed u_x (top): 0.0000000e+00 +Boundary normal lubrication rc: 0.0000000e+00 +Wall boundary links allocated: 16992 +Memory (total, bytes): 271872 +Boundary shear initialise: 0 + +Colloid information +------------------- + +Colloid I/O settings +-------------------- +Decomposition: 1 1 1 +Number of files: 1 +Input format: ascii +Output format: ascii +Single file read flag: 0 + +Requested one colloid via input: +colloid_one_a0 2.3000000e+00 +colloid_one_ah 2.3000000e+00 +colloid_one_r 3.0000000e+00 1.2500000e+01 1.2500000e+01 +colloid_one_v 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Initialised 1 colloid + +Wall-colloid soft-sphere potential +---------------------------------- +epsilon: 1.0000000e-03 +sigma: 1.0000000e-01 +exponent nu: 2.0000000e+00 +cut off hc (wall-surface) 5.0000000e-01 + +Colloid cell list information +----------------------------- +Input radius maximum: 2.3000000e+00 +Final cell list: 8 8 8 +Final cell lengths: 3.0000000e+00 3.0000000e+00 3.0000000e+00 + +Sedimentation force on: yes +Sedimentation force: -1.0000000e-03 0.0000000e+00 0.0000000e+00 + +Initial conditions. + +Scalars - total mean variance min max +[rho] 13776.00 1.00000000000 2.2204460e-16 1.00000000000 1.00000000000 + +Momentum - x y z +[total ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[fluid ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[colloids] 0.0000000e+00 0.0000000e+00 0.0000000e+00 +[walls ] 0.0000000e+00 0.0000000e+00 0.0000000e+00 + +Starting time step loop. + +Particle statistics: +Wall potential minimum h is: 2.0037974e-01 +Wall potential energy is: 1.6111411e-04 + +Colloid velocities - x y z +[minimum ] 6.0667740e-05 3.8982092e-18 4.4175480e-18 +[maximum ] 6.0667740e-05 3.8982092e-18 4.4175480e-18 + +Scalars - total mean variance min max +[rho] 13776.00 1.00000000000 2.4273028e-11 0.99987097316 1.00002663247 + +Momentum - x y z +[total ] 4.9460956e-13 6.7014322e-15 2.1248064e-14 +[fluid ] 8.8394048e-03 -1.6157561e-13 7.2809814e-14 +[colloids] 3.1708202e-03 3.2805819e-16 2.9260438e-16 +[walls ] -1.2010225e-02 1.6794899e-13 -5.1854354e-14 + +Velocity - x y z +[minimum ] -8.5205736e-06 -2.9745063e-05 -2.9745063e-05 +[maximum ] 4.3807348e-05 2.9745063e-05 2.9745063e-05 + +Completed cycle 10 + +Timer resolution: 1e-06 second + +Timer statistics + Section: tmin tmax total + Total: 0.195 0.195 0.195 0.194830 (1 call) + Time step loop: 0.016 0.017 0.169 0.016875 (10 calls) + Propagation: 0.003 0.004 0.035 0.003459 (10 calls) + Propagtn (krnl) : 0.003 0.004 0.035 0.003452 (10 calls) + Collision: 0.007 0.008 0.075 0.007523 (10 calls) + Collision (krnl) : 0.007 0.008 0.075 0.007515 (10 calls) + Lattice halos: 0.001 0.001 0.022 0.001118 (20 calls) + phi gradients: 0.000 0.000 0.000 0.000001 (10 calls) + Forces: 0.000 0.000 0.001 0.000103 (10 calls) + Rebuild: 0.000 0.001 0.004 0.000412 (10 calls) + BBL: 0.003 0.003 0.027 0.002731 (10 calls) + Particle halos: 0.000 0.000 0.000 0.000023 (10 calls) + Force calculation: 0.000 0.000 0.000 0.000001 (10 calls) + phi update: 0.000 0.000 0.000 0.000000 (10 calls) + Free1: 0.000 0.007 0.007 0.000248 (30 calls) +End time: Sat Apr 2 20:13:41 2022 +Ludwig finished normally. diff --git a/tests/unit/test_wall_ss_cut.c b/tests/unit/test_wall_ss_cut.c new file mode 100644 index 000000000..fd3dddfb5 --- /dev/null +++ b/tests/unit/test_wall_ss_cut.c @@ -0,0 +1,177 @@ +/***************************************************************************** + * + * test_wall_ss_cut.c + * + * Test for wall-colloid 'pair' interaction. + * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * + *****************************************************************************/ + +#include +#include +#include + +#include "wall_ss_cut.h" + +int test_wall_ss_cut_create(pe_t * pe, cs_t * cs, wall_t * wall); +int test_wall_ss_cut_single(pe_t * pe, cs_t * cs, wall_t * wall); +int test_wall_ss_cut_compute(pe_t * pe, cs_t * cs, wall_t * wall); + +/***************************************************************************** + * + * test_wall_ss_cut_suite + * + *****************************************************************************/ + +int test_wall_ss_cut_suite(void) { + + pe_t * pe = NULL; + cs_t * cs = NULL; + + pe_create(MPI_COMM_WORLD, PE_QUIET, &pe); + cs_create(pe, &cs); + cs_init(cs); + + { + lb_t * lb = NULL; + map_t * map = NULL; + wall_t * wall = NULL; + + wall_param_t param = {.iswall = 1, .isboundary = {1,1,1}}; + lb_data_options_t opts = lb_data_options_default(); + + lb_data_create(pe, cs, &opts, &lb); + map_create(pe, cs, 1, &map); + wall_create(pe, cs, map, lb, &wall); + wall_commit(wall, ¶m); + + test_wall_ss_cut_create(pe, cs, wall); + test_wall_ss_cut_single(pe, cs, wall); + test_wall_ss_cut_compute(pe, cs, wall); + + wall_free(wall); + map_free(map); + lb_free(lb); + } + + pe_info(pe, "PASS ./unit/test_wall_ss_cut\n"); + cs_free(cs); + pe_free(pe); + + return 0; +} + +/***************************************************************************** + * + * test_wall_ss_cut_create + * + *****************************************************************************/ + +int test_wall_ss_cut_create(pe_t * pe, cs_t * cs, wall_t * wall) { + + wall_ss_cut_t * wall_ss_cut = NULL; + wall_ss_cut_options_t opts = {.epsilon = 0.1, .sigma = 0.2, .nu = 0.3, + .hc = 0.4}; + assert(pe); + assert(cs); + assert(wall); + + wall_ss_cut_create(pe, cs, wall, &opts, &wall_ss_cut); + assert(wall_ss_cut); + + wall_ss_cut_free(wall_ss_cut); + + return 0; +} + +/***************************************************************************** + * + * test_wall_ss_cut_single + * + *****************************************************************************/ + +int test_wall_ss_cut_single(pe_t * pe, cs_t * cs, wall_t * wall) { + + wall_ss_cut_t * wall_ss_cut = NULL; + wall_ss_cut_options_t opts = {.epsilon = 0.001, + .sigma = 0.8, + .nu = 2.0, + .hc = 0.25}; + assert(pe); + assert(cs); + assert(wall); + + wall_ss_cut_create(pe, cs, wall, &opts, &wall_ss_cut); + + { + double h = 0.0125; + double f = 0.0; + double v = 0.0; + + wall_ss_cut_single(wall_ss_cut, h, &f, &v); + assert(fabs(f - 655.27808) < FLT_EPSILON); + assert(fabs(v - 4.0663040) < FLT_EPSILON); + } + wall_ss_cut_free(wall_ss_cut); + + return 0; +} + +/***************************************************************************** + * + * test_wall_ss_cut_compute + * + *****************************************************************************/ + +int test_wall_ss_cut_compute(pe_t * pe, cs_t * cs, wall_t * wall) { + + int ncell[3] = {2, 2, 2}; + colloids_info_t * cinfo = NULL; + + wall_ss_cut_t * wall_ss_cut = NULL; + wall_ss_cut_options_t opts = {.epsilon = 0.001, + .sigma = 0.8, + .nu = 2.0, + .hc = 0.25}; + + assert(pe); + assert(cs); + assert(wall); + + colloids_info_create(pe, cs, ncell, &cinfo); + wall_ss_cut_create(pe, cs, wall, &opts, &wall_ss_cut); + + { + /* Add a colloid at a suitable position */ + double a0 = 1.0; + double ah = 1.0; + double h = 0.0125; + double r[3] = {0.5 + a0 + h, 0.5 + a0 + opts.hc, 0.5 + a0 + opts.hc}; + colloid_t * pc = NULL; + + colloids_info_add_local(cinfo, 1, r, &pc); + if (pc) { + pc->s.a0 = a0; + pc->s.ah = ah; + } + /* Need the local list up-to-date... */ + colloids_info_list_local_build(cinfo); + + wall_ss_cut_compute(cinfo, wall_ss_cut); + if (pc) { + assert(fabs(pc->force[X] - 655.27808) < FLT_EPSILON); + assert(fabs(pc->force[Y] - 0.0) < DBL_EPSILON); + assert(fabs(pc->force[Z] - 0.0) < DBL_EPSILON); + } + } + + wall_ss_cut_free(wall_ss_cut); + colloids_info_free(cinfo); + + return 0; +} diff --git a/tests/unit/tests.c b/tests/unit/tests.c index 03c57288a..7bdde2b13 100644 --- a/tests/unit/tests.c +++ b/tests/unit/tests.c @@ -104,6 +104,7 @@ __host__ int tests_create() { test_util_sum_suite(); test_visc_arrhenius_suite(); test_wall_suite(); + test_wall_ss_cut_suite(); test_fe_surfactant1_suite(); test_fe_symmetric_suite(); diff --git a/tests/unit/tests.h b/tests/unit/tests.h index 800ff3110..2fb77823c 100644 --- a/tests/unit/tests.h +++ b/tests/unit/tests.h @@ -89,5 +89,6 @@ int test_util_suite(void); int test_util_sum_suite(void); int test_visc_arrhenius_suite(void); int test_wall_suite(void); +int test_wall_ss_cut_suite(void); #endif From 4de5c25e6aefb3ded4cac83bfbf1ca324c9653ae Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:35:14 +0100 Subject: [PATCH 53/64] Replaced by lb_* --- src/d2q9.c | 121 ---------------------------------------- src/d2q9.h | 43 --------------- src/d3q15.c | 134 --------------------------------------------- src/d3q15.h | 44 --------------- src/d3q19.c | 155 ---------------------------------------------------- src/d3q19.h | 45 --------------- 6 files changed, 542 deletions(-) delete mode 100644 src/d2q9.c delete mode 100644 src/d2q9.h delete mode 100644 src/d3q15.c delete mode 100644 src/d3q15.h delete mode 100644 src/d3q19.c delete mode 100644 src/d3q19.h diff --git a/src/d2q9.c b/src/d2q9.c deleted file mode 100644 index afb79a7f9..000000000 --- a/src/d2q9.c +++ /dev/null @@ -1,121 +0,0 @@ -/***************************************************************************** - * - * d2q9.c - * - * D2Q9 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D2Q9 basis. - * - *****************************************************************************/ - -#include "d2q9.h" - -const char * model_name_d2q9 = "D2Q9"; - -#ifdef _D2Q9_ - -/***************************************************************************** - * - * There are 9 eigenvectors: - * - * rho (density) - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][Y][Y] (yy ... - * chi1[p] (1st ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*rho*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*rho*cv[p][Y]) - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * blocklens reduced halo datatype blocklengths - * disp_fwd reduced halo datatype displacements - * disp_bwd reduced halo datatype displacements - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - * Note that all z-components are zero. - * - *****************************************************************************/ - -#define w0 (16.0/36.0) -#define w1 (4.0/36.0) -#define w2 (1.0/36.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define c4 4.0 -#define r3 (1.0/3.0) -#define t3 (2.0/3.0) -#define r4 (1.0/4.0) -#define r6 (1.0/6.0) - -/* -const double ma_[NVEL9][NVEL9] = { - { c1, c1, c1, c1, c1, c1, c1, c1, c1}, - { c0, c1, c1, c1, c0, c0, -c1, -c1, -c1}, - { c0, c1, c0, -c1, c1, -c1, c1, c0, -c1}, - {-r3, t3, t3, t3, -r3, -r3, t3, t3, t3}, - { c0, c1, c0, -c1, c0, c0, -c1, c0, c1}, - {-r3, t3, -r3, t3, t3, t3, t3, -r3, t3}, - { c1, c4, -c2, c4, -c2, -c2, c4, -c2, c4}, - { c0, c4, -c2, c4, c0, c0, -c4, c2, -c4}, - { c0, c4, c0, -c4, -c2, c2, c4, c0, -c4}}; - - -#define wa (6.0/72.0) -#define wb (4.0/72.0) -#define wc (3.0/72.0) - -const double mi_[NVEL9][NVEL9] = { - {w0, c0, c0, -t3, c0, -t3, w1, c0, c0}, - {w2, wa, wa, wa, r4, wa, w2, wc, wc}, - {w1, r3, c0, r3, c0, -r6, -wb, -wa, c0}, - {w2, wa, -wa, wa, -r4, wa, w2, wc, -wc}, - {w1, c0, r3, -r6, c0, r3, -wb, c0, -wa}, - {w1, c0, -r3, -r6, c0, r3, -wb, c0, wa}, - {w2, -wa, wa, wa, -r4, wa, w2, -wc, wc}, - {w1, -r3, c0, r3, c0, -r6, -wb, wa, c0}, - {w2, -wa, -wa, wa, r4, wa, w2, -wc, -wc}}; -*/ - -const int xblocklen_cv[CVXBLOCK9] = {3}; -const int xdisp_fwd_cv[CVXBLOCK9] = {1}; -const int xdisp_bwd_cv[CVXBLOCK9] = {6}; - -const int yblocklen_cv[CVYBLOCK9] = {1, 1, 1}; -const int ydisp_fwd_cv[CVYBLOCK9] = {1, 4, 6}; -const int ydisp_bwd_cv[CVYBLOCK9] = {3, 5, 8}; - -const int zblocklen_cv[CVZBLOCK9] = {0}; -const int zdisp_fwd_cv[CVZBLOCK9] = {0}; -const int zdisp_bwd_cv[CVZBLOCK9] = {0}; - -#endif diff --git a/src/d2q9.h b/src/d2q9.h deleted file mode 100644 index a802bba42..000000000 --- a/src/d2q9.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * - * d2q9.h - * - * D2Q9 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2010-2021 The University of Edinburgh - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_D2Q9_MODEL_H -#define LUDWIG_D2Q9_MODEL_H - -enum {NDIM9 = 2}; -enum {NVEL9 = 9}; -enum {CVXBLOCK9 = 1}; -enum {CVYBLOCK9 = 3}; -enum {CVZBLOCK9 = 1}; - -#include "lb_d2q9.h" - -#ifdef _D2Q9_ - -extern const int xblocklen_cv[CVXBLOCK9]; -extern const int xdisp_fwd_cv[CVXBLOCK9]; -extern const int xdisp_bwd_cv[CVXBLOCK9]; - -extern const int yblocklen_cv[CVYBLOCK9]; -extern const int ydisp_fwd_cv[CVYBLOCK9]; -extern const int ydisp_bwd_cv[CVYBLOCK9]; - -extern const int zblocklen_cv[CVZBLOCK9]; -extern const int zdisp_fwd_cv[CVZBLOCK9]; -extern const int zdisp_bwd_cv[CVZBLOCK9]; - -#endif - -#endif diff --git a/src/d3q15.c b/src/d3q15.c deleted file mode 100644 index 8fd9bd6f0..000000000 --- a/src/d3q15.c +++ /dev/null @@ -1,134 +0,0 @@ -/***************************************************************************** - * - * d3q15.c - * - * D3Q15 model definitions. - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q15 basis. - * - *****************************************************************************/ - -#include "d3q15.h" - -const char * model_name_d3q15 = "D3Q15"; - -#ifdef _D3Q15_ - -/***************************************************************************** - * - * There are 15 eigenvectors: - * - * rho density - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * rho cv[p][Z] (z-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][X][Z] (xz ... - * q[p][Y][Y] (yy ... - * q[p][Y][Z] (yz ... - * q[p][Z][Z] (zz ... - * chi1[p] (1st ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*cv[p][Y]) - * jchi1[p][Z] (z-component of ghost current chi1[p]*cv[p][Z]) - * chi3[p] (2nd ghost mode cv[p][X]*cv[p][Y]*cv[p][Z]) - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * The eigenvectors are the rows of the matrix ma_[NVEL][NVEL]. - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - *****************************************************************************/ - -#define w0 (16.0/72.0) -#define w1 ( 8.0/72.0) -#define w3 ( 1.0/72.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define r3 (1.0/3.0) -#define r6 (1.0/6.0) -#define t3 (2.0/3.0) - -#define wa ( 3.0/72.0) -#define wb ( 9.0/72.0) -#define wc ( 4.0/72.0) - -/* -const double ma_[NVEL15][NVEL15] = - {{ c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1}, - { c0, c1, c1, c1, c1, c1, c0, c0, c0, c0,-c1,-c1,-c1,-c1,-c1}, - { c0, c1, c1, c0,-c1,-c1, c1, c0, c0,-c1, c1, c1, c0,-c1,-c1}, - { c0, c1,-c1, c0, c1,-c1, c0, c1,-c1, c0, c1,-c1, c0, c1,-c1}, - {-r3, t3, t3, t3, t3, t3,-r3,-r3,-r3,-r3, t3, t3, t3, t3, t3}, - { c0, c1, c1, c0,-c1,-c1, c0, c0, c0, c0,-c1,-c1, c0, c1, c1}, - { c0, c1,-c1, c0, c1,-c1, c0, c0, c0, c0,-c1, c1, c0,-c1, c1}, - {-r3, t3, t3,-r3, t3, t3, t3,-r3,-r3, t3, t3, t3,-r3, t3, t3}, - { c0, c1,-c1, c0,-c1, c1, c0, c0, c0, c0, c1,-c1, c0,-c1, c1}, - {-r3, t3, t3,-r3, t3, t3,-r3, t3, t3,-r3, t3, t3,-r3, t3, t3}, - {-c2,-c2,-c2, c1,-c2,-c2, c1, c1, c1, c1,-c2,-c2, c1,-c2,-c2}, - { c0,-c2,-c2, c1,-c2,-c2, c0, c0, c0, c0, c2, c2,-c1, c2, c2}, - { c0,-c2,-c2, c0, c2, c2, c1, c0, c0,-c1,-c2,-c2, c0, c2, c2}, - { c0,-c2, c2, c0,-c2, c2, c0, c1,-c1, c0,-c2, c2, c0,-c2, c2}, - { c0, c1,-c1, c0,-c1, c1, c0, c0, c0, c0,-c1, c1, c0, c1,-c1}}; - -const double mi_[NVEL15][NVEL15] = - {{ w0, c0, c0, c0,-r3, c0, c0,-r3, c0,-r3,-w0, c0, c0, c0, c0}, - { w3, wa, wa, wa, wa, wb, wb, wa, wb, wa,-w3,-wa,-wa,-wa, wb}, - { w3, wa, wa,-wa, wa, wb,-wb, wa,-wb, wa,-w3,-wa,-wa, wa,-wb}, - { w1, r3, c0, c0, r3, c0, c0,-r6, c0,-r6, wc, r6, c0, c0, c0}, - { w3, wa,-wa, wa, wa,-wb, wb, wa,-wb, wa,-w3,-wa, wa,-wa,-wb}, - { w3, wa,-wa,-wa, wa,-wb,-wb, wa, wb, wa,-w3,-wa, wa, wa, wb}, - { w1, c0, r3, c0,-r6, c0, c0, r3, c0,-r6, wc, c0, r6, c0, c0}, - { w1, c0, c0, r3,-r6, c0, c0,-r6, c0, r3, wc, c0, c0, r6, c0}, - { w1, c0, c0,-r3,-r6, c0, c0,-r6, c0, r3, wc, c0, c0,-r6, c0}, - { w1, c0,-r3, c0,-r6, c0, c0, r3, c0,-r6, wc, c0,-r6, c0, c0}, - { w3,-wa, wa, wa, wa,-wb,-wb, wa, wb, wa,-w3, wa,-wa,-wa,-wb}, - { w3,-wa, wa,-wa, wa,-wb, wb, wa,-wb, wa,-w3, wa,-wa, wa, wb}, - { w1,-r3, c0, c0, r3, c0, c0,-r6, c0,-r6, wc,-r6, c0, c0, c0}, - { w3,-wa,-wa, wa, wa, wb,-wb, wa,-wb, wa,-w3, wa, wa,-wa, wb}, - { w3,-wa,-wa,-wa, wa, wb, wb, wa, wb, wa,-w3, wa, wa, wa,-wb}}; -*/ - -const int xblocklen_cv[CVXBLOCK15] = {5}; -const int xdisp_fwd_cv[CVXBLOCK15] = {1}; -const int xdisp_bwd_cv[CVXBLOCK15] = {10}; - -const int yblocklen_cv[CVYBLOCK15] = {2, 1, 2}; -const int ydisp_fwd_cv[CVYBLOCK15] = {1, 6, 10}; -const int ydisp_bwd_cv[CVYBLOCK15] = {4, 9, 13}; - -const int zblocklen_cv[CVZBLOCK15] = {1, 1, 1, 1, 1}; -const int zdisp_fwd_cv[CVZBLOCK15] = {1, 4, 7, 10, 13}; -const int zdisp_bwd_cv[CVZBLOCK15] = {2, 5, 8, 11, 14}; - -#endif diff --git a/src/d3q15.h b/src/d3q15.h deleted file mode 100644 index 3121127ad..000000000 --- a/src/d3q15.h +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * - * d3q15.h - * - * D3Q15 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group - * and Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * - *****************************************************************************/ - -#ifndef LUDWIG_D3Q15_MODEL_H -#define LUDWIG_D3Q15_MODEL_H - -enum {NDIM15 = 3}; -enum {NVEL15 = 15}; -enum {CVXBLOCK15 = 1}; -enum {CVYBLOCK15 = 3}; -enum {CVZBLOCK15 = 5}; - -#include "lb_d3q15.h" - -#ifdef _D3Q15_ - -extern const int xblocklen_cv[CVXBLOCK15]; -extern const int xdisp_fwd_cv[CVXBLOCK15]; -extern const int xdisp_bwd_cv[CVXBLOCK15]; - -extern const int yblocklen_cv[CVYBLOCK15]; -extern const int ydisp_fwd_cv[CVYBLOCK15]; -extern const int ydisp_bwd_cv[CVYBLOCK15]; - -extern const int zblocklen_cv[CVZBLOCK15]; -extern const int zdisp_fwd_cv[CVZBLOCK15]; -extern const int zdisp_bwd_cv[CVZBLOCK15]; - -#endif - -#endif - diff --git a/src/d3q19.c b/src/d3q19.c deleted file mode 100644 index 153fed780..000000000 --- a/src/d3q19.c +++ /dev/null @@ -1,155 +0,0 @@ -/***************************************************************************** - * - * d3q19.c - * - * D3Q19 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel Computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q19 basis. - * - *****************************************************************************/ - -#include "d3q19.h" - -const char * model_name_d3q19 = "D3Q19"; - -#ifdef _D3Q19_ - -/***************************************************************************** - * - * There are 19 eigenvectors (rows of ma): - * - * rho (eigenvector implicitly {1}) - * rho cv[p][X] (x-component of velocity) - * rho cv[p][Y] (y-component of velocity) - * rho cv[p][Z] (z-component of velocity) - * q[p][X][X] (xx component of deviatoric stress) - * q[p][X][Y] (xy component of deviatoric stress) - * q[p][X][Z] (xz ... - * q[p][Y][Y] (yy ... - * q[p][Y][Z] (yz ... - * q[p][Z][Z] (zz ... - * chi1[p] (1st scalar ghost mode) - * jchi1[p][X] (x-component of ghost current chi1[p]*rho*cv[p][X]) - * jchi1[p][Y] (y-component of ghost current chi1[p]*rho*cv[p][Y]) - * jchi1[p][Z] (z-component of ghost current chi1[p]*rho*cv[p][Z]) - * chi2[p] (2nd scalar ghost mode) - * jchi2[p][X] (x-component of ghost current chi2[p]*rho*cv[p][X]) - * jchi2[p][Y] (y-component of ghost current chi2[p]*rho*cv[p][Y]) - * jchi2[p][Z] (z-component of ghost current chi2[p]*rho*cv[p][Z]) - * chi3[p] (3rd scalar ghost mode) - * - * - * We define the following: - * - * cv[NVEL][3] lattice velocities (integers) - * q_[NVEL][3][3] kinetic projector c[p][i]*c[p][j] - c_s^2 d_[i][j] - * wv[NVEL] quadrature weight for each velocity - * norm_[NVEL] normaliser for each mode - * - * ma_[NVEL][NVEL] full matrix of eigenvectors (doubles) - * mi_[NVEL][NVEL] inverse of ma_[][] - * - * blocklens reduced halo datatype blocklengths - * disp_fwd reduced halo datatype displacements - * disp_bwd reduced halo datatype displacements - * - * Reduced halo swap information - * CVXBLOCK number of separate blocks to send in x-direction - * CVYBLOCK ditto ... y-direction - * CVZBLOCK ditto ... z-direction - * - * For each direction there is then an array of ... - * - * blocklen block lengths - * disp_fwd displacements of block from start (forward direction) - * disp_bwd displacements of block from start (backward direction) - * - * - *****************************************************************************/ - -#define w0 (12.0/36.0) -#define w1 (2.0/36.0) -#define w2 (1.0/36.0) - -#define c0 0.0 -#define c1 1.0 -#define c2 2.0 -#define r3 (1.0/3.0) -#define r6 (1.0/6.0) -#define t3 (2.0/3.0) -#define r2 (1.0/2.0) -#define r4 (1.0/4.0) -#define r8 (1.0/8.0) - -#define wc ( 1.0/72.0) -#define wb ( 3.0/72.0) -#define wa ( 6.0/72.0) -#define t4 (16.0/72.0) -#define wd ( 1.0/48.0) -#define we ( 3.0/48.0) - -/* Global symbols are replaced by lb_model_t ... -const double ma_[NVEL19][NVEL19] = { -{ c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1, c1}, -{ c0, c1, c1, c1, c1, c1, c0, c0, c0, c0, c0, c0, c0, c0,-c1,-c1,-c1,-c1,-c1}, -{ c0, c1, c0, c0, c0,-c1, c1, c1, c1, c0, c0,-c1,-c1,-c1, c1, c0, c0, c0,-c1}, -{ c0, c0, c1, c0,-c1, c0, c1, c0,-c1, c1,-c1, c1, c0,-c1, c0, c1, c0,-c1, c0}, -{-r3, t3, t3, t3, t3, t3,-r3,-r3,-r3,-r3,-r3,-r3,-r3,-r3, t3, t3, t3, t3, t3}, -{ c0, c1, c0, c0, c0,-c1, c0, c0, c0, c0, c0, c0, c0, c0,-c1, c0, c0, c0, c1}, -{ c0, c0, c1, c0,-c1, c0, c0, c0, c0, c0, c0, c0, c0, c0, c0,-c1, c0, c1, c0}, -{-r3, t3,-r3,-r3,-r3, t3, t3, t3, t3,-r3,-r3, t3, t3, t3, t3,-r3,-r3,-r3, t3}, -{ c0, c0, c0, c0, c0, c0, c1, c0,-c1, c0, c0,-c1, c0, c1, c0, c0, c0, c0, c0}, -{-r3,-r3, t3,-r3, t3,-r3, t3,-r3, t3, t3, t3, t3,-r3, t3,-r3, t3,-r3, t3,-r3}, -{ c0,-c2, c1, c1, c1,-c2, c1, c1, c1,-c2,-c2, c1, c1, c1,-c2, c1, c1, c1,-c2}, -{ c0,-c2, c1, c1, c1,-c2, c0, c0, c0, c0, c0, c0, c0, c0, c2,-c1,-c1,-c1, c2}, -{ c0,-c2, c0, c0, c0, c2, c1, c1, c1, c0, c0,-c1,-c1,-c1,-c2, c0, c0, c0, c2}, -{ c0, c0, c1, c0,-c1, c0, c1, c0,-c1,-c2, c2, c1, c0,-c1, c0, c1, c0,-c1, c0}, -{ c0, c0,-c1, c1,-c1, c0, c1,-c1, c1, c0, c0, c1,-c1, c1, c0,-c1, c1,-c1, c0}, -{ c0, c0,-c1, c1,-c1, c0, c0, c0, c0, c0, c0, c0, c0, c0, c0, c1,-c1, c1, c0}, -{ c0, c0, c0, c0, c0, c0, c1,-c1, c1, c0, c0,-c1, c1,-c1, c0, c0, c0, c0, c0}, -{ c0, c0,-c1, c0, c1, c0, c1, c0,-c1, c0, c0, c1, c0,-c1, c0,-c1, c0, c1, c0}, -{ c1, c1, c1,-c2, c1, c1, c1,-c2, c1,-c2,-c2, c1,-c2, c1, c1, c1,-c2, c1, c1} -}; - -const double mi_[NVEL19][NVEL19] = { -{w0, c0, c0, c0,-r2, c0, c0,-r2, c0,-r2, c0, c0, c0, c0, c0, c0, c0, c0, r6}, -{w2, wa, wa, c0, wa, r4, c0, wa, c0,-wb,-wb,-wa,-wa, c0, c0, c0, c0, c0, wc}, -{w2, wa, c0, wa, wa, c0, r4,-wb, c0, wa, wd, wb, c0, wb,-we,-r8, c0,-r8, wc}, -{w1, r6, c0, c0, r6, c0, c0,-wa, c0,-wa, wb, wa, c0, c0, r8, r4, c0, c0,-w1}, -{w2, wa, c0,-wa, wa, c0,-r4,-wb, c0, wa, wd, wb, c0,-wb,-we,-r8, c0, r8, wc}, -{w2, wa,-wa, c0, wa,-r4, c0, wa, c0,-wb,-wb,-wa, wa, c0, c0, c0, c0, c0, wc}, -{w2, c0, wa, wa,-wb, c0, c0, wa, r4, wa, wd, c0, wb, wb, we, c0, r8, r8, wc}, -{w1, c0, r6, c0,-wa, c0, c0, r6, c0,-wa, wb, c0, wa, c0,-r8, c0,-r4, c0,-w1}, -{w2, c0, wa,-wa,-wb, c0, c0, wa,-r4, wa, wd, c0, wb,-wb, we, c0, r8,-r8, wc}, -{w1, c0, c0, r6,-wa, c0, c0,-wa, c0, r6,-wa, c0, c0,-r6, c0, c0, c0, c0,-w1}, -{w1, c0, c0,-r6,-wa, c0, c0,-wa, c0, r6,-wa, c0, c0, r6, c0, c0, c0, c0,-w1}, -{w2, c0,-wa, wa,-wb, c0, c0, wa,-r4, wa, wd, c0,-wb, wb, we, c0,-r8, r8, wc}, -{w1, c0,-r6, c0,-wa, c0, c0, r6, c0,-wa, wb, c0,-wa, c0,-r8, c0, r4, c0,-w1}, -{w2, c0,-wa,-wa,-wb, c0, c0, wa, r4, wa, wd, c0,-wb,-wb, we, c0,-r8,-r8, wc}, -{w2,-wa, wa, c0, wa,-r4, c0, wa, c0,-wb,-wb, wa,-wa, c0, c0, c0, c0, c0, wc}, -{w2,-wa, c0, wa, wa, c0,-r4,-wb, c0, wa, wd,-wb, c0, wb,-we, r8, c0,-r8, wc}, -{w1,-r6, c0, c0, r6, c0, c0,-wa, c0,-wa, wb,-wa, c0, c0, r8,-r4, c0, c0,-w1}, -{w2,-wa, c0,-wa, wa, c0, r4,-wb, c0, wa, wd,-wb, c0,-wb,-we, r8, c0, r8, wc}, -{w2,-wa,-wa, c0, wa, r4, c0, wa, c0,-wb,-wb, wa, wa, c0, c0, c0, c0, c0, wc} -}; -*/ -const int xblocklen_cv[CVXBLOCK19] = {5}; -const int xdisp_fwd_cv[CVXBLOCK19] = {1}; -const int xdisp_bwd_cv[CVXBLOCK19] = {14}; - -const int yblocklen_cv[CVYBLOCK19] = {1, 3, 1}; -const int ydisp_fwd_cv[CVYBLOCK19] = {1, 6, 14}; -const int ydisp_bwd_cv[CVYBLOCK19] = {5, 11, 18}; - -const int zblocklen_cv[CVZBLOCK19] = {1, 1, 1, 1, 1}; -const int zdisp_fwd_cv[CVZBLOCK19] = {2, 6, 9, 11, 15}; -const int zdisp_bwd_cv[CVZBLOCK19] = {4, 8, 10, 13, 17}; - -#endif diff --git a/src/d3q19.h b/src/d3q19.h deleted file mode 100644 index b53e8a101..000000000 --- a/src/d3q19.h +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * - * d3q19.h - * - * D3Q19 definitions. - * - * Edinburgh Soft Matter and Statistical Physics Group and - * Edinburgh Parallel computing Centre - * - * (c) 2008-2021 The University of Edinburgh - * - * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) - * Ronojoy Adhikari computed this D3Q19 basis. - * - *****************************************************************************/ - -#ifndef LUDWIG_D3Q19_MODEL_H -#define LUDWIG_D3Q19_MODEL_H - -enum {NDIM19 = 3}; -enum {NVEL19 = 19}; -enum {CVXBLOCK19 = 1}; -enum {CVYBLOCK19 = 3}; -enum {CVZBLOCK19 = 5}; - -#include "lb_d3q19.h" - -#ifdef _D3Q19_ - -extern const int xblocklen_cv[CVXBLOCK19]; -extern const int xdisp_fwd_cv[CVXBLOCK19]; -extern const int xdisp_bwd_cv[CVXBLOCK19]; - -extern const int yblocklen_cv[CVYBLOCK19]; -extern const int ydisp_fwd_cv[CVYBLOCK19]; -extern const int ydisp_bwd_cv[CVYBLOCK19]; - -extern const int zblocklen_cv[CVZBLOCK19]; -extern const int zdisp_fwd_cv[CVZBLOCK19]; -extern const int zdisp_bwd_cv[CVZBLOCK19]; - -#endif - -#endif From 41ca197e63354ee717e52d0bcf6bc2004bb0f64d Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:35:43 +0100 Subject: [PATCH 54/64] Check this please --- src/compiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler.c b/src/compiler.c index f2784c46e..27c210763 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -109,7 +109,8 @@ int compiler_id(compiler_info_t * compiler) { compiler->major = __GNUC__; compiler->minor = __GNUC_MINOR__; compiler->patchlevel = __GNUC_PATCHLEVEL__; - strncpy(compiler->version, __VERSION__, 1 + strnlen(__VERSION__, BUFSIZ-1)); + strncpy(compiler->version, __VERSION__, 1 + strlen(__VERSION__)); + /*strncpy(compiler->version, __VERSION__, 1 + strnlen(__VERSION__, BUFSIZ-1));*/ sprintf(compiler->name, "%s", "Gnu"); ierr = 0; From 453a159b7117423f04bfb72148cea01fbeac1742 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:35:59 +0100 Subject: [PATCH 55/64] Remove old key --- src/input.ref | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/input.ref b/src/input.ref index 07c0a8425..a9a2f4118 100644 --- a/src/input.ref +++ b/src/input.ref @@ -1,7 +1,8 @@ ############################################################################## # # Ludwig input file -# Reference. +# Example. +# Please see https://ludwig.epcc.ed.ac.uk for details. # # Lines introduced with # and blank lines are ignored. # @@ -16,10 +17,6 @@ # If a given keyword does not appear, or is commented out, a default # value will be used. # -# $Id$ -# -# Public comment. -# ############################################################################## ############################################################################## @@ -47,17 +44,12 @@ N_cycles 100001 # MPI will choose a default (may be implementation-dependent). # # periodicity Periodicity of MPI Cartesian communicator -# -# reduced_halo [yes|no] use reduced or full halos. Using reduced halos -# is *only* appropriate for fluid only problems. -# Default is no. # ############################################################################## size 64_2_2 grid 4_1_1 periodicity 0_1_1 -reduced_halo no ############################################################################## # @@ -615,5 +607,4 @@ electrosymmetric_delta_mu1 2.0 # ############################################################################### -#random_seed 7361237 random_seed 8361235 From ef3ba38fef27384cbfd3c864004f4dacd4622fd2 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:37:09 +0100 Subject: [PATCH 56/64] Remove old halo options --- src/distribution_rt.c | 102 +++++++++++++++++++++--------------------- src/lb_data_options.c | 2 + src/lb_data_options.h | 5 +-- src/ludwig.c | 2 +- 4 files changed, 54 insertions(+), 57 deletions(-) diff --git a/src/distribution_rt.c b/src/distribution_rt.c index f68069308..f405e87b7 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -75,9 +75,6 @@ int lb_ndist_rt(rt_t * rt) { * Some old keys are trapped with advice before accepting new keys. * * Miscellaneous input keys - * - * "lb_reduced_halo" - * * I/O * * If no options at all are specfied in the input, io_options_t information @@ -133,7 +130,6 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { * * Input key default * ----------------------------------------- - * "reduced_halo" "no" * "distribution_io_grid" {1,1,1} * "distribution_io_format_input" "binary" * @@ -146,7 +142,6 @@ int lb_run_time(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { int ndist; - int nreduced; int io_grid[3] = {1, 1, 1}; char string[FILENAME_MAX] = ""; char memory = ' '; @@ -165,9 +160,43 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { assert(rt); assert(lb); - nreduced = 0; - rt_string_parameter(rt,"reduced_halo", string, FILENAME_MAX); - if (strcmp(string, "yes") == 0) nreduced = 1; + /* Number of distributions */ + + ndist = lb_ndist_rt(rt); + assert(ndist == 1 || ndist == 2); + + /* Halo options */ + + options.ndim = NDIM; + options.nvel = NVEL; + options.ndist = ndist; + + /* Halo options */ + { + char htype[BUFSIZ] = {}; + int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); + if (strcmp(htype, "lb_halo_target") == 0) { + options.halo = LB_HALO_TARGET; + } + else if (strcmp(htype, "lb_halo_openmp_full") == 0) { + options.halo = LB_HALO_OPENMP_FULL; + } + else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { + options.halo = LB_HALO_OPENMP_REDUCED; + } + else if (havetype) { + pe_fatal(pe, "lb_halo_scheme not recognised\n"); + } + + options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); + + if (lb_data_options_valid(&options) == 0) { + pe_fatal(pe, "lb_data_options are invalid. Please check halo.\n"); + } + } + + + /* I//O Grid */ rt_int_parameter_vector(rt, "distribution_io_grid", io_grid); @@ -179,9 +208,6 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* TODO: r -> "AOS" or "SOA" or "AOSOA" */ if (DATA_MODEL == DATA_MODEL_SOA) memory = 'R'; - ndist = lb_ndist_rt(rt); - assert(ndist == 1 || ndist == 2); - pe_info(pe, "\n"); pe_info(pe, "Lattice Boltzmann distributions\n"); pe_info(pe, "-------------------------------\n"); @@ -189,7 +215,19 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { pe_info(pe, "Model: d%dq%d %c\n", NDIM, NVEL, memory); pe_info(pe, "SIMD vector len: %d\n", NSIMDVL); pe_info(pe, "Number of sets: %d\n", ndist); - pe_info(pe, "Halo type: %s\n", (nreduced == 1) ? "reduced" : "full"); + + if (options.halo == LB_HALO_TARGET) { + pe_info(pe, "Halo type: %s\n", "lb_halo_target (full halo)"); + } + if (options.halo == LB_HALO_OPENMP_FULL) { + pe_info(pe, "Halo type: %s\n", "lb_halo_openmp_full (host)"); + } + if (options.halo == LB_HALO_OPENMP_REDUCED) { + pe_info(pe, "Halo type: %s\n", "lb_halo_openmp_reduced (host)"); + } + if (options.reportimbalance) { + pe_info(pe, "Imbalance time: %s\n", "reported"); + } if (strcmp("BINARY_SERIAL", string) == 0) { pe_info(pe, "Input format: binary single serial file\n"); @@ -245,46 +283,6 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* Initialise */ - options.ndim = NDIM; - options.nvel = NVEL; - options.ndist = ndist; - - /* Halo options */ - if (nreduced == 1) options.halo = LB_HALO_REDUCED; - { - char htype[BUFSIZ] = {}; - int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); - if (strcmp(htype, "lb_halo_host") == 0) { - options.halo = LB_HALO_HOST; - } - else if (strcmp(htype, "lb_halo_target") == 0) { - options.halo = LB_HALO_TARGET; - } - else if (strcmp(htype, "lb_halo_full") == 0) { - options.halo = LB_HALO_FULL; - } - else if (strcmp(htype, "lb_halo_reduced") == 0) { - options.halo = LB_HALO_REDUCED; - } - else if (strcmp(htype, "lb_halo_openmp_full") == 0) { - options.halo = LB_HALO_OPENMP_FULL; - } - else if (strcmp(htype, "lb_halo_openmp_reduced") == 0) { - options.halo = LB_HALO_OPENMP_REDUCED; - } - else if (havetype) { - pe_fatal(pe, "lb_halo_scheme not recognised\n"); - } - if (havetype) { - pe_info(pe, "Halo scheme: %s\n", htype); - } - - options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); - if (options.reportimbalance) { - pe_info(pe, "Imbalance time: %s\n", "reported"); - } - } - lb_data_create(pe, cs, &options, lb); /* distribution i/o */ diff --git a/src/lb_data_options.c b/src/lb_data_options.c index 63f4943d3..cec709b21 100644 --- a/src/lb_data_options.c +++ b/src/lb_data_options.c @@ -50,5 +50,7 @@ int lb_data_options_valid(const lb_data_options_t * opts) { if (!(opts->ndim == 2 || opts->ndim == 3)) valid = 0; if (!(opts->ndist == 1 || opts->ndist == 2)) valid = 0; + if (opts->ndist == 2 && opts->halo != LB_HALO_TARGET) valid = 0; + return valid; } diff --git a/src/lb_data_options.h b/src/lb_data_options.h index 5accb8ad0..2b8496e04 100644 --- a/src/lb_data_options.h +++ b/src/lb_data_options.h @@ -22,10 +22,7 @@ typedef enum lb_relaxation_enum {LB_RELAXATION_M10, LB_RELAXATION_TRT} lb_relaxation_enum_t; -typedef enum lb_halo_enum {LB_HALO_FULL, - LB_HALO_REDUCED, - LB_HALO_HOST, - LB_HALO_TARGET, +typedef enum lb_halo_enum {LB_HALO_TARGET, LB_HALO_OPENMP_FULL, LB_HALO_OPENMP_REDUCED} lb_halo_enum_t; diff --git a/src/ludwig.c b/src/ludwig.c index ba74a84a2..8d5aa9fbb 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -2079,7 +2079,7 @@ int ludwig_colloids_update(ludwig_t * ludwig) { lb_halo(ludwig->lb); } else { - lb_halo_swap(ludwig->lb, LB_HALO_HOST); + lb_halo_swap(ludwig->lb, LB_HALO_OPENMP_FULL); } TIMER_stop(TIMER_HALO_LATTICE); From e2d4ffa54693a76ad615ff3939876a3a13ddcd28 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:38:04 +0100 Subject: [PATCH 57/64] Attempt to rationalise haloe option --- tests/unit/test_prop.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/tests/unit/test_prop.c b/tests/unit/test_prop.c index 6691fcad4..b850cf6b0 100644 --- a/tests/unit/test_prop.c +++ b/tests/unit/test_prop.c @@ -73,7 +73,6 @@ int test_lb_prop_suite(void) { int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { - int ndevice; int nlocal[3]; int ic, jc, kc, index, p; int nd; @@ -89,6 +88,8 @@ int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { options.ndim = NDIM; options.nvel = NVEL; options.ndist = ndist; + options.halo = halo; + lb_data_create(pe, cs, &options, &lb); assert(lb); @@ -112,15 +113,10 @@ int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { } } - tdpGetDeviceCount(&ndevice); - if (ndevice > 0 && halo == LB_HALO_HOST) { - lb_halo_swap(lb, halo); - lb_memcpy(lb, tdpMemcpyHostToDevice); - } - else { - lb_memcpy(lb, tdpMemcpyHostToDevice); - lb_halo_swap(lb, halo); - } + /* Halo swap, and make sure values are on device */ + + lb_memcpy(lb, tdpMemcpyHostToDevice); + lb_halo(lb); lb_propagation(lb); lb_memcpy(lb, tdpMemcpyDeviceToHost); @@ -162,7 +158,6 @@ int do_test_velocity(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, lb_halo_enum_t halo) { - int ndevice; int nlocal[3], offset[3]; int ntotal[3]; int ic, jc, kc, index, p; @@ -180,7 +175,9 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, options.ndim = NDIM; options.nvel = NVEL; + options.halo = halo; options.ndist = ndist; + lb_data_create(pe, cs, &options, &lb); assert(lb); @@ -210,15 +207,10 @@ int do_test_source_destination(pe_t * pe, cs_t * cs, int ndist, } } - tdpGetDeviceCount(&ndevice); - if (ndevice > 0 && halo == LB_HALO_HOST) { - lb_halo_swap(lb, halo); - lb_memcpy(lb, tdpMemcpyHostToDevice); - } - else { - lb_memcpy(lb, tdpMemcpyHostToDevice); - lb_halo_swap(lb, halo); - } + /* Initial values update to device */ + lb_memcpy(lb, tdpMemcpyHostToDevice); + lb_halo(lb); + lb_propagation(lb); lb_memcpy(lb, tdpMemcpyDeviceToHost); From e8c546f4923a9c0f9678afa673932af67758755e Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:40:23 +0100 Subject: [PATCH 58/64] Cosmetic change to remove reduce_halo key --- tests/regression/d2q9/serial-2khz-bm1.inp | 2 +- tests/regression/d2q9/serial-2khz-bm1.log | 2 +- tests/regression/d2q9/serial-flct-t01.inp | 2 +- tests/regression/d2q9/serial-flct-t01.log | 2 +- tests/regression/d2q9/serial-open-phi.log | 2 +- tests/regression/d2q9/serial-surf-t01.log | 2 +- tests/regression/d2q9/serial-surf-t02.log | 2 +- tests/regression/d3q15/pmpi08-auto-c01.inp | 2 +- tests/regression/d3q15/pmpi08-auto-c01.log | 2 +- tests/regression/d3q15/serial-auto-c01.inp | 2 +- tests/regression/d3q15/serial-auto-c01.log | 2 +- tests/regression/d3q15/serial-auto-c02.inp | 2 +- tests/regression/d3q15/serial-auto-c02.log | 2 +- tests/regression/d3q15/serial-le2d-lb1.log | 2 +- tests/regression/d3q15/serial-rect-ct1.inp | 2 +- tests/regression/d3q15/serial-rect-ct1.log | 2 +- tests/regression/d3q15/serial-rect-ct2.inp | 2 +- tests/regression/d3q15/serial-rect-ct2.log | 2 +- tests/regression/d3q15/serial-rect-ct3.inp | 2 +- tests/regression/d3q15/serial-rect-ct3.log | 2 +- tests/regression/d3q15/serial-rect-ct4.inp | 2 +- tests/regression/d3q15/serial-rect-ct4.log | 2 +- tests/regression/d3q15/serial-rect-ct5.inp | 2 +- tests/regression/d3q15/serial-rect-ct5.log | 2 +- tests/regression/d3q19-short/serial-actv-s01.inp | 1 - tests/regression/d3q19-short/serial-actv-s01.log | 2 +- tests/regression/d3q19-short/serial-actv-s02.inp | 1 - tests/regression/d3q19-short/serial-actv-s02.log | 2 +- tests/regression/d3q19-short/serial-bond-c01.log | 2 +- tests/regression/d3q19-short/serial-bond-c02.log | 2 +- tests/regression/d3q19-short/serial-chol-n01.inp | 1 - tests/regression/d3q19-short/serial-chol-n01.log | 2 +- tests/regression/d3q19-short/serial-chol-n02.inp | 1 - tests/regression/d3q19-short/serial-chol-n02.log | 2 +- tests/regression/d3q19-short/serial-chol-n03.inp | 1 - tests/regression/d3q19-short/serial-chol-n03.log | 2 +- tests/regression/d3q19-short/serial-chol-n04.inp | 1 - tests/regression/d3q19-short/serial-chol-n04.log | 2 +- tests/regression/d3q19-short/serial-chol-p01.inp | 1 - tests/regression/d3q19-short/serial-chol-p01.log | 2 +- tests/regression/d3q19-short/serial-chol-st1.inp | 1 - tests/regression/d3q19-short/serial-chol-st1.log | 2 +- tests/regression/d3q19-short/serial-chol-st2.inp | 1 - tests/regression/d3q19-short/serial-chol-st2.log | 2 +- tests/regression/d3q19-short/serial-chol-st3.inp | 1 - tests/regression/d3q19-short/serial-chol-st3.log | 2 +- tests/regression/d3q19-short/serial-chol-st4.inp | 1 - tests/regression/d3q19-short/serial-chol-st4.log | 2 +- tests/regression/d3q19-short/serial-chol-st5.inp | 1 - tests/regression/d3q19-short/serial-chol-st5.log | 2 +- tests/regression/d3q19-short/serial-chol-st6.inp | 1 - tests/regression/d3q19-short/serial-chol-st6.log | 2 +- tests/regression/d3q19-short/serial-chol-st7.inp | 1 - tests/regression/d3q19-short/serial-chol-st7.log | 2 +- tests/regression/d3q19-short/serial-chol-w01.inp | 1 - tests/regression/d3q19-short/serial-chol-w01.log | 2 +- tests/regression/d3q19-short/serial-chol-w02.inp | 1 - tests/regression/d3q19-short/serial-chol-w02.log | 2 +- tests/regression/d3q19-short/serial-chol-w03.inp | 1 - tests/regression/d3q19-short/serial-chol-w03.log | 2 +- tests/regression/d3q19-short/serial-chol-w04.inp | 1 - tests/regression/d3q19-short/serial-chol-w04.log | 2 +- tests/regression/d3q19-short/serial-chol-w05.inp | 1 - tests/regression/d3q19-short/serial-chol-w05.log | 2 +- tests/regression/d3q19-short/serial-coll-st1.log | 2 +- tests/regression/d3q19-short/serial-dist-1dp.inp | 3 ++- tests/regression/d3q19-short/serial-dist-1dp.log | 2 +- tests/regression/d3q19-short/serial-dist-2kh.inp | 3 ++- tests/regression/d3q19-short/serial-dist-2kh.log | 2 +- tests/regression/d3q19-short/serial-dist-2sw.inp | 3 ++- tests/regression/d3q19-short/serial-dist-2sw.log | 2 +- tests/regression/d3q19-short/serial-dist-3du.inp | 3 ++- tests/regression/d3q19-short/serial-dist-3du.log | 2 +- tests/regression/d3q19-short/serial-drop-lc1.log | 2 +- tests/regression/d3q19-short/serial-drop-lc2.log | 2 +- tests/regression/d3q19-short/serial-drop-lc3.inp | 1 - tests/regression/d3q19-short/serial-drop-lc3.log | 2 +- tests/regression/d3q19-short/serial-drop-lc4.inp | 1 - tests/regression/d3q19-short/serial-drop-lc4.log | 2 +- tests/regression/d3q19-short/serial-drop-lc5.inp | 1 - tests/regression/d3q19-short/serial-drop-lc5.log | 2 +- tests/regression/d3q19-short/serial-ewld-s01.log | 2 +- tests/regression/d3q19-short/serial-fene-st1.inp | 1 - tests/regression/d3q19-short/serial-fene-st1.log | 2 +- tests/regression/d3q19-short/serial-fene-st2.inp | 1 - tests/regression/d3q19-short/serial-fene-st2.log | 2 +- tests/regression/d3q19-short/serial-fene-st3.inp | 1 - tests/regression/d3q19-short/serial-fene-st3.log | 2 +- tests/regression/d3q19-short/serial-init-bp1.log | 2 +- tests/regression/d3q19-short/serial-init-bp2.log | 2 +- tests/regression/d3q19-short/serial-init-br1.log | 2 +- tests/regression/d3q19-short/serial-init-br2.log | 2 +- tests/regression/d3q19-short/serial-init-lcb.log | 2 +- tests/regression/d3q19-short/serial-init-lcr.log | 2 +- tests/regression/d3q19-short/serial-le2d-fd1.log | 2 +- tests/regression/d3q19-short/serial-le2d-fd2.log | 2 +- tests/regression/d3q19-short/serial-le2d-lb1.log | 2 +- tests/regression/d3q19-short/serial-le3d-st1.log | 2 +- tests/regression/d3q19-short/serial-le3d-st2.log | 2 +- tests/regression/d3q19-short/serial-le3d-st3.log | 2 +- tests/regression/d3q19-short/serial-le3d-st4.log | 2 +- tests/regression/d3q19-short/serial-le3d-st5.log | 2 +- tests/regression/d3q19-short/serial-le3d-st6.log | 2 +- tests/regression/d3q19-short/serial-le3d-st7.log | 2 +- tests/regression/d3q19-short/serial-le3d-st8.log | 2 +- tests/regression/d3q19-short/serial-muex-st1.log | 2 +- tests/regression/d3q19-short/serial-open-ru1.log | 2 +- tests/regression/d3q19-short/serial-open-ru2.log | 2 +- tests/regression/d3q19-short/serial-pola-r01.inp | 1 - tests/regression/d3q19-short/serial-pola-r01.log | 2 +- tests/regression/d3q19-short/serial-poly-st1.inp | 1 - tests/regression/d3q19-short/serial-poly-st1.log | 2 +- tests/regression/d3q19-short/serial-rect-ct1.inp | 2 +- tests/regression/d3q19-short/serial-rect-ct1.log | 2 +- tests/regression/d3q19-short/serial-rect-ct2.inp | 2 +- tests/regression/d3q19-short/serial-rect-ct2.log | 2 +- tests/regression/d3q19-short/serial-rect-ct3.inp | 2 +- tests/regression/d3q19-short/serial-rect-ct3.log | 2 +- tests/regression/d3q19-short/serial-rect-ct4.inp | 2 +- tests/regression/d3q19-short/serial-rect-ct4.log | 2 +- tests/regression/d3q19-short/serial-rect-ct5.inp | 2 +- tests/regression/d3q19-short/serial-rect-ct5.log | 2 +- tests/regression/d3q19-short/serial-relx-bp1.log | 2 +- tests/regression/d3q19-short/serial-rest-c01.inp | 2 +- tests/regression/d3q19-short/serial-rest-c01.log | 2 +- tests/regression/d3q19-short/serial-rest-c02.inp | 2 +- tests/regression/d3q19-short/serial-rest-c02.log | 2 +- tests/regression/d3q19-short/serial-rest-ec1.log | 2 +- tests/regression/d3q19-short/serial-rest-ec2.log | 2 +- tests/regression/d3q19-short/serial-sgrd-st1.inp | 2 +- tests/regression/d3q19-short/serial-sgrd-st1.log | 2 +- tests/regression/d3q19-short/serial-sgrd-st2.inp | 2 +- tests/regression/d3q19-short/serial-sgrd-st2.log | 2 +- tests/regression/d3q19-short/serial-spin-c01.log | 2 +- tests/regression/d3q19-short/serial-spin-c02.log | 2 +- tests/regression/d3q19-short/serial-spin-fd1.log | 2 +- tests/regression/d3q19-short/serial-spin-fd2.log | 2 +- tests/regression/d3q19-short/serial-spin-lb1.log | 2 +- tests/regression/d3q19-short/serial-spin-lb2.log | 2 +- tests/regression/d3q19-short/serial-spin-n01.log | 2 +- tests/regression/d3q19-short/serial-spin-n02.log | 2 +- tests/regression/d3q19-short/serial-sqmr-st1.inp | 2 +- tests/regression/d3q19-short/serial-sqmr-st1.log | 2 +- tests/regression/d3q19-short/serial-sqmr-st2.inp | 2 +- tests/regression/d3q19-short/serial-sqmr-st2.log | 2 +- tests/regression/d3q19-short/serial-ssij-01.inp | 2 +- tests/regression/d3q19-short/serial-ssij-01.log | 2 +- tests/regression/d3q19-short/serial-symm-dr1.log | 2 +- tests/regression/d3q19-short/serial-symm-dr2.log | 2 +- tests/regression/d3q19-short/serial-symm-pat.log | 2 +- tests/regression/d3q19-short/serial-tern-st1.log | 2 +- tests/regression/d3q19-short/serial-tern-st2.log | 2 +- tests/regression/d3q19-short/serial-tern-st3.log | 2 +- tests/regression/d3q19-short/serial-tern-st4.log | 2 +- tests/regression/d3q19-short/serial-tern-st5.log | 2 +- tests/regression/d3q19-short/serial-wall-st1.log | 2 +- tests/regression/d3q19-short/serial-wall-st2.inp | 2 +- tests/regression/d3q19-short/serial-wall-st2.log | 2 +- tests/regression/d3q19-short/serial-wall-st3.inp | 2 +- tests/regression/d3q19-short/serial-wall-st3.log | 2 +- tests/regression/d3q19-short/serial-wall-st4.inp | 2 +- tests/regression/d3q19-short/serial-wall-st4.log | 2 +- 162 files changed, 139 insertions(+), 162 deletions(-) diff --git a/tests/regression/d2q9/serial-2khz-bm1.inp b/tests/regression/d2q9/serial-2khz-bm1.inp index c7f423639..433f9a7d5 100644 --- a/tests/regression/d2q9/serial-2khz-bm1.inp +++ b/tests/regression/d2q9/serial-2khz-bm1.inp @@ -66,7 +66,6 @@ N_cycles 2560 size 64_64_1 grid 2_2_1 -reduced_halo yes ############################################################################## # @@ -78,6 +77,7 @@ viscosity 0.000128 isothermal_fluctuations off lb_relaxation_scheme m10 +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d2q9/serial-2khz-bm1.log b/tests/regression/d2q9/serial-2khz-bm1.log index 2346e6115..5068152b2 100644 --- a/tests/regression/d2q9/serial-2khz-bm1.log +++ b/tests/regression/d2q9/serial-2khz-bm1.log @@ -40,7 +40,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-flct-t01.inp b/tests/regression/d2q9/serial-flct-t01.inp index aff14a876..ff9080b5c 100644 --- a/tests/regression/d2q9/serial-flct-t01.inp +++ b/tests/regression/d2q9/serial-flct-t01.inp @@ -13,7 +13,7 @@ N_cycles 200 ############################################################################## size 96_96_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d2q9/serial-flct-t01.log b/tests/regression/d2q9/serial-flct-t01.log index af559c989..04a9658f9 100644 --- a/tests/regression/d2q9/serial-flct-t01.log +++ b/tests/regression/d2q9/serial-flct-t01.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-open-phi.log b/tests/regression/d2q9/serial-open-phi.log index 414ea8ade..c272651a6 100644 --- a/tests/regression/d2q9/serial-open-phi.log +++ b/tests/regression/d2q9/serial-open-phi.log @@ -54,7 +54,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-surf-t01.log b/tests/regression/d2q9/serial-surf-t01.log index e71954c6a..bb2c93d51 100644 --- a/tests/regression/d2q9/serial-surf-t01.log +++ b/tests/regression/d2q9/serial-surf-t01.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d2q9/serial-surf-t02.log b/tests/regression/d2q9/serial-surf-t02.log index 5eadcc014..662ab5280 100644 --- a/tests/regression/d2q9/serial-surf-t02.log +++ b/tests/regression/d2q9/serial-surf-t02.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d2q9 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/pmpi08-auto-c01.inp b/tests/regression/d3q15/pmpi08-auto-c01.inp index 25c248bf5..508988376 100644 --- a/tests/regression/d3q15/pmpi08-auto-c01.inp +++ b/tests/regression/d3q15/pmpi08-auto-c01.inp @@ -14,7 +14,7 @@ N_cycles 40 size 64_64_64 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/pmpi08-auto-c01.log b/tests/regression/d3q15/pmpi08-auto-c01.log index ac7215a86..708efcb03 100644 --- a/tests/regression/d3q15/pmpi08-auto-c01.log +++ b/tests/regression/d3q15/pmpi08-auto-c01.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q15 R SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-auto-c01.inp b/tests/regression/d3q15/serial-auto-c01.inp index 574208413..c65445dec 100644 --- a/tests/regression/d3q15/serial-auto-c01.inp +++ b/tests/regression/d3q15/serial-auto-c01.inp @@ -13,7 +13,7 @@ N_cycles 40 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-auto-c01.log b/tests/regression/d3q15/serial-auto-c01.log index faf06b134..41c58ef47 100644 --- a/tests/regression/d3q15/serial-auto-c01.log +++ b/tests/regression/d3q15/serial-auto-c01.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-auto-c02.inp b/tests/regression/d3q15/serial-auto-c02.inp index f25f4d0cb..37994925e 100644 --- a/tests/regression/d3q15/serial-auto-c02.inp +++ b/tests/regression/d3q15/serial-auto-c02.inp @@ -13,7 +13,7 @@ N_cycles 40 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-auto-c02.log b/tests/regression/d3q15/serial-auto-c02.log index 73b463f1d..8b2afdae2 100644 --- a/tests/regression/d3q15/serial-auto-c02.log +++ b/tests/regression/d3q15/serial-auto-c02.log @@ -40,7 +40,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-le2d-lb1.log b/tests/regression/d3q15/serial-le2d-lb1.log index 4e56da31a..e1eecc061 100644 --- a/tests/regression/d3q15/serial-le2d-lb1.log +++ b/tests/regression/d3q15/serial-le2d-lb1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct1.inp b/tests/regression/d3q15/serial-rect-ct1.inp index e62e6c102..42bc2cab5 100644 --- a/tests/regression/d3q15/serial-rect-ct1.inp +++ b/tests/regression/d3q15/serial-rect-ct1.inp @@ -31,7 +31,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct1.log b/tests/regression/d3q15/serial-rect-ct1.log index fe710e77e..7c68c1b20 100644 --- a/tests/regression/d3q15/serial-rect-ct1.log +++ b/tests/regression/d3q15/serial-rect-ct1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct2.inp b/tests/regression/d3q15/serial-rect-ct2.inp index 7ac1e1277..84f3d3093 100644 --- a/tests/regression/d3q15/serial-rect-ct2.inp +++ b/tests/regression/d3q15/serial-rect-ct2.inp @@ -20,7 +20,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct2.log b/tests/regression/d3q15/serial-rect-ct2.log index 1f3bce201..14f9f80f9 100644 --- a/tests/regression/d3q15/serial-rect-ct2.log +++ b/tests/regression/d3q15/serial-rect-ct2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct3.inp b/tests/regression/d3q15/serial-rect-ct3.inp index db02e0f1c..d2b4ef938 100644 --- a/tests/regression/d3q15/serial-rect-ct3.inp +++ b/tests/regression/d3q15/serial-rect-ct3.inp @@ -26,7 +26,7 @@ N_start 0 size 1_31_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct3.log b/tests/regression/d3q15/serial-rect-ct3.log index ce3039517..214ddae3f 100644 --- a/tests/regression/d3q15/serial-rect-ct3.log +++ b/tests/regression/d3q15/serial-rect-ct3.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct4.inp b/tests/regression/d3q15/serial-rect-ct4.inp index 760074c18..75fd03dbc 100644 --- a/tests/regression/d3q15/serial-rect-ct4.inp +++ b/tests/regression/d3q15/serial-rect-ct4.inp @@ -19,7 +19,7 @@ N_start 0 size 31_15_1 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct4.log b/tests/regression/d3q15/serial-rect-ct4.log index b0565f08e..662f3ab5f 100644 --- a/tests/regression/d3q15/serial-rect-ct4.log +++ b/tests/regression/d3q15/serial-rect-ct4.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q15/serial-rect-ct5.inp b/tests/regression/d3q15/serial-rect-ct5.inp index 1101322df..abc9f9767 100644 --- a/tests/regression/d3q15/serial-rect-ct5.inp +++ b/tests/regression/d3q15/serial-rect-ct5.inp @@ -19,7 +19,7 @@ N_start 0 size 31_1_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q15/serial-rect-ct5.log b/tests/regression/d3q15/serial-rect-ct5.log index 83b37d477..52f075246 100644 --- a/tests/regression/d3q15/serial-rect-ct5.log +++ b/tests/regression/d3q15/serial-rect-ct5.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q15 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-actv-s01.inp b/tests/regression/d3q19-short/serial-actv-s01.inp index c45d2e377..5c44c617f 100644 --- a/tests/regression/d3q19-short/serial-actv-s01.inp +++ b/tests/regression/d3q19-short/serial-actv-s01.inp @@ -20,7 +20,6 @@ N_start 0 size 64_64_1 grid 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-actv-s01.log b/tests/regression/d3q19-short/serial-actv-s01.log index 2ad3ca22b..a4eadef20 100644 --- a/tests/regression/d3q19-short/serial-actv-s01.log +++ b/tests/regression/d3q19-short/serial-actv-s01.log @@ -57,7 +57,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-actv-s02.inp b/tests/regression/d3q19-short/serial-actv-s02.inp index 0c2c5fbda..3593bcf94 100644 --- a/tests/regression/d3q19-short/serial-actv-s02.inp +++ b/tests/regression/d3q19-short/serial-actv-s02.inp @@ -19,7 +19,6 @@ N_start 0 size 64_64_1 grid 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-actv-s02.log b/tests/regression/d3q19-short/serial-actv-s02.log index 88f662fc0..2a747d2a2 100644 --- a/tests/regression/d3q19-short/serial-actv-s02.log +++ b/tests/regression/d3q19-short/serial-actv-s02.log @@ -57,7 +57,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-bond-c01.log b/tests/regression/d3q19-short/serial-bond-c01.log index 42163fb60..fd54e1163 100644 --- a/tests/regression/d3q19-short/serial-bond-c01.log +++ b/tests/regression/d3q19-short/serial-bond-c01.log @@ -54,7 +54,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-bond-c02.log b/tests/regression/d3q19-short/serial-bond-c02.log index 58815f26c..6ed3c4c08 100644 --- a/tests/regression/d3q19-short/serial-bond-c02.log +++ b/tests/regression/d3q19-short/serial-bond-c02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n01.inp b/tests/regression/d3q19-short/serial-chol-n01.inp index d4f736498..78a7011c1 100644 --- a/tests/regression/d3q19-short/serial-chol-n01.inp +++ b/tests/regression/d3q19-short/serial-chol-n01.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n01.log b/tests/regression/d3q19-short/serial-chol-n01.log index 67b626271..7e9d1135a 100644 --- a/tests/regression/d3q19-short/serial-chol-n01.log +++ b/tests/regression/d3q19-short/serial-chol-n01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n02.inp b/tests/regression/d3q19-short/serial-chol-n02.inp index 068b7dfb1..0268e6776 100644 --- a/tests/regression/d3q19-short/serial-chol-n02.inp +++ b/tests/regression/d3q19-short/serial-chol-n02.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n02.log b/tests/regression/d3q19-short/serial-chol-n02.log index c635de976..7cc01315b 100644 --- a/tests/regression/d3q19-short/serial-chol-n02.log +++ b/tests/regression/d3q19-short/serial-chol-n02.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n03.inp b/tests/regression/d3q19-short/serial-chol-n03.inp index 70490c39b..4eddf12a3 100644 --- a/tests/regression/d3q19-short/serial-chol-n03.inp +++ b/tests/regression/d3q19-short/serial-chol-n03.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n03.log b/tests/regression/d3q19-short/serial-chol-n03.log index 784c3781e..917d9462f 100644 --- a/tests/regression/d3q19-short/serial-chol-n03.log +++ b/tests/regression/d3q19-short/serial-chol-n03.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-n04.inp b/tests/regression/d3q19-short/serial-chol-n04.inp index 231f41d96..0e1c22021 100644 --- a/tests/regression/d3q19-short/serial-chol-n04.inp +++ b/tests/regression/d3q19-short/serial-chol-n04.inp @@ -14,7 +14,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-n04.log b/tests/regression/d3q19-short/serial-chol-n04.log index 61a43a78d..430f20564 100644 --- a/tests/regression/d3q19-short/serial-chol-n04.log +++ b/tests/regression/d3q19-short/serial-chol-n04.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-p01.inp b/tests/regression/d3q19-short/serial-chol-p01.inp index ea58c54b7..db793521a 100644 --- a/tests/regression/d3q19-short/serial-chol-p01.inp +++ b/tests/regression/d3q19-short/serial-chol-p01.inp @@ -15,7 +15,6 @@ N_cycles 5 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-p01.log b/tests/regression/d3q19-short/serial-chol-p01.log index 067cc8832..07ac7dc61 100644 --- a/tests/regression/d3q19-short/serial-chol-p01.log +++ b/tests/regression/d3q19-short/serial-chol-p01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st1.inp b/tests/regression/d3q19-short/serial-chol-st1.inp index 9ee64a9ba..5cfa2b648 100644 --- a/tests/regression/d3q19-short/serial-chol-st1.inp +++ b/tests/regression/d3q19-short/serial-chol-st1.inp @@ -24,7 +24,6 @@ N_cycles 20 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st1.log b/tests/regression/d3q19-short/serial-chol-st1.log index 9289a3ee0..98ab6fc41 100644 --- a/tests/regression/d3q19-short/serial-chol-st1.log +++ b/tests/regression/d3q19-short/serial-chol-st1.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st2.inp b/tests/regression/d3q19-short/serial-chol-st2.inp index 769981793..bb08f2d9d 100644 --- a/tests/regression/d3q19-short/serial-chol-st2.inp +++ b/tests/regression/d3q19-short/serial-chol-st2.inp @@ -22,7 +22,6 @@ N_cycles 20 size 16_32_32 periodicity 0_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st2.log b/tests/regression/d3q19-short/serial-chol-st2.log index 64419a571..099c0031b 100644 --- a/tests/regression/d3q19-short/serial-chol-st2.log +++ b/tests/regression/d3q19-short/serial-chol-st2.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st3.inp b/tests/regression/d3q19-short/serial-chol-st3.inp index 93bdbd656..8080bfa4b 100644 --- a/tests/regression/d3q19-short/serial-chol-st3.inp +++ b/tests/regression/d3q19-short/serial-chol-st3.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st3.log b/tests/regression/d3q19-short/serial-chol-st3.log index 5e70ebafb..03cd6a2d0 100644 --- a/tests/regression/d3q19-short/serial-chol-st3.log +++ b/tests/regression/d3q19-short/serial-chol-st3.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st4.inp b/tests/regression/d3q19-short/serial-chol-st4.inp index 309c1915d..8e6a22400 100644 --- a/tests/regression/d3q19-short/serial-chol-st4.inp +++ b/tests/regression/d3q19-short/serial-chol-st4.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st4.log b/tests/regression/d3q19-short/serial-chol-st4.log index 5d6835dff..f27c6bbca 100644 --- a/tests/regression/d3q19-short/serial-chol-st4.log +++ b/tests/regression/d3q19-short/serial-chol-st4.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st5.inp b/tests/regression/d3q19-short/serial-chol-st5.inp index c53530023..4d28eb5a9 100644 --- a/tests/regression/d3q19-short/serial-chol-st5.inp +++ b/tests/regression/d3q19-short/serial-chol-st5.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st5.log b/tests/regression/d3q19-short/serial-chol-st5.log index e32304184..64eb64ce3 100644 --- a/tests/regression/d3q19-short/serial-chol-st5.log +++ b/tests/regression/d3q19-short/serial-chol-st5.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st6.inp b/tests/regression/d3q19-short/serial-chol-st6.inp index 3d9c8ea0c..29263e329 100644 --- a/tests/regression/d3q19-short/serial-chol-st6.inp +++ b/tests/regression/d3q19-short/serial-chol-st6.inp @@ -16,7 +16,6 @@ N_cycles 10 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st6.log b/tests/regression/d3q19-short/serial-chol-st6.log index 10d02e48a..712cb2842 100644 --- a/tests/regression/d3q19-short/serial-chol-st6.log +++ b/tests/regression/d3q19-short/serial-chol-st6.log @@ -74,7 +74,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-st7.inp b/tests/regression/d3q19-short/serial-chol-st7.inp index b8f234d36..e97299d29 100644 --- a/tests/regression/d3q19-short/serial-chol-st7.inp +++ b/tests/regression/d3q19-short/serial-chol-st7.inp @@ -25,7 +25,6 @@ N_cycles 20 size 32_32_32 periodicity 1_1_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-st7.log b/tests/regression/d3q19-short/serial-chol-st7.log index f4e4e59b8..7fd244cf4 100644 --- a/tests/regression/d3q19-short/serial-chol-st7.log +++ b/tests/regression/d3q19-short/serial-chol-st7.log @@ -66,7 +66,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w01.inp b/tests/regression/d3q19-short/serial-chol-w01.inp index d30d3a773..521955d8e 100644 --- a/tests/regression/d3q19-short/serial-chol-w01.inp +++ b/tests/regression/d3q19-short/serial-chol-w01.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w01.log b/tests/regression/d3q19-short/serial-chol-w01.log index 884e1bd4d..ccf161520 100644 --- a/tests/regression/d3q19-short/serial-chol-w01.log +++ b/tests/regression/d3q19-short/serial-chol-w01.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w02.inp b/tests/regression/d3q19-short/serial-chol-w02.inp index f5ae493f2..4936f7fd6 100644 --- a/tests/regression/d3q19-short/serial-chol-w02.inp +++ b/tests/regression/d3q19-short/serial-chol-w02.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w02.log b/tests/regression/d3q19-short/serial-chol-w02.log index 156befed2..aca0e2bf0 100644 --- a/tests/regression/d3q19-short/serial-chol-w02.log +++ b/tests/regression/d3q19-short/serial-chol-w02.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w03.inp b/tests/regression/d3q19-short/serial-chol-w03.inp index d59063884..94cd075d7 100644 --- a/tests/regression/d3q19-short/serial-chol-w03.inp +++ b/tests/regression/d3q19-short/serial-chol-w03.inp @@ -14,7 +14,6 @@ N_cycles 2 size 64_64_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w03.log b/tests/regression/d3q19-short/serial-chol-w03.log index 3df78e577..1aefa74cf 100644 --- a/tests/regression/d3q19-short/serial-chol-w03.log +++ b/tests/regression/d3q19-short/serial-chol-w03.log @@ -72,7 +72,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w04.inp b/tests/regression/d3q19-short/serial-chol-w04.inp index a239f51fe..0a592761e 100644 --- a/tests/regression/d3q19-short/serial-chol-w04.inp +++ b/tests/regression/d3q19-short/serial-chol-w04.inp @@ -14,7 +14,6 @@ N_cycles 2 size 32_32_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w04.log b/tests/regression/d3q19-short/serial-chol-w04.log index 23d6e83e0..a00f1f6dd 100644 --- a/tests/regression/d3q19-short/serial-chol-w04.log +++ b/tests/regression/d3q19-short/serial-chol-w04.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-chol-w05.inp b/tests/regression/d3q19-short/serial-chol-w05.inp index eea80df97..3d85173d2 100644 --- a/tests/regression/d3q19-short/serial-chol-w05.inp +++ b/tests/regression/d3q19-short/serial-chol-w05.inp @@ -14,7 +14,6 @@ N_cycles 2 size 32_32_64 grid 2_2_2 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-chol-w05.log b/tests/regression/d3q19-short/serial-chol-w05.log index 99222886c..c56258d1b 100644 --- a/tests/regression/d3q19-short/serial-chol-w05.log +++ b/tests/regression/d3q19-short/serial-chol-w05.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-coll-st1.log b/tests/regression/d3q19-short/serial-coll-st1.log index 09f8e1ed9..8feaa5e2d 100644 --- a/tests/regression/d3q19-short/serial-coll-st1.log +++ b/tests/regression/d3q19-short/serial-coll-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-1dp.inp b/tests/regression/d3q19-short/serial-dist-1dp.inp index 5b1805348..4f0ce015b 100644 --- a/tests/regression/d3q19-short/serial-dist-1dp.inp +++ b/tests/regression/d3q19-short/serial-dist-1dp.inp @@ -14,7 +14,8 @@ N_cycles 10 size 32_32_32 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-1dp.log b/tests/regression/d3q19-short/serial-dist-1dp.log index 9634fa31a..15656581b 100644 --- a/tests/regression/d3q19-short/serial-dist-1dp.log +++ b/tests/regression/d3q19-short/serial-dist-1dp.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-2kh.inp b/tests/regression/d3q19-short/serial-dist-2kh.inp index 03674f5cf..1f115f3fd 100644 --- a/tests/regression/d3q19-short/serial-dist-2kh.inp +++ b/tests/regression/d3q19-short/serial-dist-2kh.inp @@ -14,7 +14,8 @@ N_cycles 10 size 64_64_1 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced (host) ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-2kh.log b/tests/regression/d3q19-short/serial-dist-2kh.log index 86838963f..625a9b2d8 100644 --- a/tests/regression/d3q19-short/serial-dist-2kh.log +++ b/tests/regression/d3q19-short/serial-dist-2kh.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-2sw.inp b/tests/regression/d3q19-short/serial-dist-2sw.inp index 1b2dff5f5..14e6f9a1f 100644 --- a/tests/regression/d3q19-short/serial-dist-2sw.inp +++ b/tests/regression/d3q19-short/serial-dist-2sw.inp @@ -14,7 +14,8 @@ N_cycles 10 size 64_64_1 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-2sw.log b/tests/regression/d3q19-short/serial-dist-2sw.log index 30eddcb58..573f4695c 100644 --- a/tests/regression/d3q19-short/serial-dist-2sw.log +++ b/tests/regression/d3q19-short/serial-dist-2sw.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-dist-3du.inp b/tests/regression/d3q19-short/serial-dist-3du.inp index 0272fc2a6..adbb21c18 100644 --- a/tests/regression/d3q19-short/serial-dist-3du.inp +++ b/tests/regression/d3q19-short/serial-dist-3du.inp @@ -14,7 +14,8 @@ N_cycles 10 size 32_32_32 grid 2_2_1 -reduced_halo yes + +lb_halo_scheme lb_halo_openmp_reduced ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-dist-3du.log b/tests/regression/d3q19-short/serial-dist-3du.log index 32e0aca3b..92aef24a2 100644 --- a/tests/regression/d3q19-short/serial-dist-3du.log +++ b/tests/regression/d3q19-short/serial-dist-3du.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_openmp_reduced (host) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc1.log b/tests/regression/d3q19-short/serial-drop-lc1.log index 7d1a94e2d..2a4f29b9f 100644 --- a/tests/regression/d3q19-short/serial-drop-lc1.log +++ b/tests/regression/d3q19-short/serial-drop-lc1.log @@ -77,7 +77,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc2.log b/tests/regression/d3q19-short/serial-drop-lc2.log index b4fd5da84..14fa3ff70 100644 --- a/tests/regression/d3q19-short/serial-drop-lc2.log +++ b/tests/regression/d3q19-short/serial-drop-lc2.log @@ -77,7 +77,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc3.inp b/tests/regression/d3q19-short/serial-drop-lc3.inp index df6474162..474e453bc 100644 --- a/tests/regression/d3q19-short/serial-drop-lc3.inp +++ b/tests/regression/d3q19-short/serial-drop-lc3.inp @@ -110,7 +110,6 @@ N_cycles 2 ############################################################################## size 64_64_64 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc3.log b/tests/regression/d3q19-short/serial-drop-lc3.log index b1ccab785..ecacb8fc6 100644 --- a/tests/regression/d3q19-short/serial-drop-lc3.log +++ b/tests/regression/d3q19-short/serial-drop-lc3.log @@ -84,7 +84,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc4.inp b/tests/regression/d3q19-short/serial-drop-lc4.inp index 0492eba45..1c4b2be8a 100644 --- a/tests/regression/d3q19-short/serial-drop-lc4.inp +++ b/tests/regression/d3q19-short/serial-drop-lc4.inp @@ -47,7 +47,6 @@ N_cycles 10 ############################################################################## size 32_32_32 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc4.log b/tests/regression/d3q19-short/serial-drop-lc4.log index e08dc0ab5..70485701b 100644 --- a/tests/regression/d3q19-short/serial-drop-lc4.log +++ b/tests/regression/d3q19-short/serial-drop-lc4.log @@ -78,7 +78,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-drop-lc5.inp b/tests/regression/d3q19-short/serial-drop-lc5.inp index 54c6c7bc6..32b9e10cb 100644 --- a/tests/regression/d3q19-short/serial-drop-lc5.inp +++ b/tests/regression/d3q19-short/serial-drop-lc5.inp @@ -59,7 +59,6 @@ N_cycles 10 ############################################################################## size 32_32_32 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-drop-lc5.log b/tests/regression/d3q19-short/serial-drop-lc5.log index 86f4cf127..09b9a2388 100644 --- a/tests/regression/d3q19-short/serial-drop-lc5.log +++ b/tests/regression/d3q19-short/serial-drop-lc5.log @@ -78,7 +78,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-ewld-s01.log b/tests/regression/d3q19-short/serial-ewld-s01.log index d9348c18b..b4fd85218 100644 --- a/tests/regression/d3q19-short/serial-ewld-s01.log +++ b/tests/regression/d3q19-short/serial-ewld-s01.log @@ -38,7 +38,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st1.inp b/tests/regression/d3q19-short/serial-fene-st1.inp index 9f3d80a95..dfcc9cb29 100644 --- a/tests/regression/d3q19-short/serial-fene-st1.inp +++ b/tests/regression/d3q19-short/serial-fene-st1.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st1.log b/tests/regression/d3q19-short/serial-fene-st1.log index d62af1769..401de1ba6 100644 --- a/tests/regression/d3q19-short/serial-fene-st1.log +++ b/tests/regression/d3q19-short/serial-fene-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st2.inp b/tests/regression/d3q19-short/serial-fene-st2.inp index ad8cd362b..402ee1483 100644 --- a/tests/regression/d3q19-short/serial-fene-st2.inp +++ b/tests/regression/d3q19-short/serial-fene-st2.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st2.log b/tests/regression/d3q19-short/serial-fene-st2.log index 20d901e9a..1d3607bc2 100644 --- a/tests/regression/d3q19-short/serial-fene-st2.log +++ b/tests/regression/d3q19-short/serial-fene-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-fene-st3.inp b/tests/regression/d3q19-short/serial-fene-st3.inp index af6277dee..63a52543c 100644 --- a/tests/regression/d3q19-short/serial-fene-st3.inp +++ b/tests/regression/d3q19-short/serial-fene-st3.inp @@ -15,7 +15,6 @@ N_cycles 20 ############################################################################## size 16_16_16 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-fene-st3.log b/tests/regression/d3q19-short/serial-fene-st3.log index 3681fdc12..d447caa4b 100644 --- a/tests/regression/d3q19-short/serial-fene-st3.log +++ b/tests/regression/d3q19-short/serial-fene-st3.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-bp1.log b/tests/regression/d3q19-short/serial-init-bp1.log index 2ecb8c6f2..f0ffa37c7 100644 --- a/tests/regression/d3q19-short/serial-init-bp1.log +++ b/tests/regression/d3q19-short/serial-init-bp1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-bp2.log b/tests/regression/d3q19-short/serial-init-bp2.log index d12e4306b..dd9a193f6 100644 --- a/tests/regression/d3q19-short/serial-init-bp2.log +++ b/tests/regression/d3q19-short/serial-init-bp2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-br1.log b/tests/regression/d3q19-short/serial-init-br1.log index d604da5d3..068d82acc 100644 --- a/tests/regression/d3q19-short/serial-init-br1.log +++ b/tests/regression/d3q19-short/serial-init-br1.log @@ -61,7 +61,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-br2.log b/tests/regression/d3q19-short/serial-init-br2.log index ad1ea27fc..12620c991 100644 --- a/tests/regression/d3q19-short/serial-init-br2.log +++ b/tests/regression/d3q19-short/serial-init-br2.log @@ -61,7 +61,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-lcb.log b/tests/regression/d3q19-short/serial-init-lcb.log index 5371a417c..3f834a5e1 100644 --- a/tests/regression/d3q19-short/serial-init-lcb.log +++ b/tests/regression/d3q19-short/serial-init-lcb.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-init-lcr.log b/tests/regression/d3q19-short/serial-init-lcr.log index 4fba55816..f6baf7840 100644 --- a/tests/regression/d3q19-short/serial-init-lcr.log +++ b/tests/regression/d3q19-short/serial-init-lcr.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-fd1.log b/tests/regression/d3q19-short/serial-le2d-fd1.log index f0f4b0258..1fcd21aa5 100644 --- a/tests/regression/d3q19-short/serial-le2d-fd1.log +++ b/tests/regression/d3q19-short/serial-le2d-fd1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-fd2.log b/tests/regression/d3q19-short/serial-le2d-fd2.log index 39ff35681..434f73cba 100644 --- a/tests/regression/d3q19-short/serial-le2d-fd2.log +++ b/tests/regression/d3q19-short/serial-le2d-fd2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le2d-lb1.log b/tests/regression/d3q19-short/serial-le2d-lb1.log index 8f2fe6ac3..53c82b930 100644 --- a/tests/regression/d3q19-short/serial-le2d-lb1.log +++ b/tests/regression/d3q19-short/serial-le2d-lb1.log @@ -59,7 +59,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st1.log b/tests/regression/d3q19-short/serial-le3d-st1.log index f1b2a8653..9495344b6 100644 --- a/tests/regression/d3q19-short/serial-le3d-st1.log +++ b/tests/regression/d3q19-short/serial-le3d-st1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st2.log b/tests/regression/d3q19-short/serial-le3d-st2.log index bd4c28416..c750b6e5e 100644 --- a/tests/regression/d3q19-short/serial-le3d-st2.log +++ b/tests/regression/d3q19-short/serial-le3d-st2.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st3.log b/tests/regression/d3q19-short/serial-le3d-st3.log index 18b8ce593..3d4ac8493 100644 --- a/tests/regression/d3q19-short/serial-le3d-st3.log +++ b/tests/regression/d3q19-short/serial-le3d-st3.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st4.log b/tests/regression/d3q19-short/serial-le3d-st4.log index 03aabd4c2..9a0b95863 100644 --- a/tests/regression/d3q19-short/serial-le3d-st4.log +++ b/tests/regression/d3q19-short/serial-le3d-st4.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st5.log b/tests/regression/d3q19-short/serial-le3d-st5.log index ddb2b479b..26d4cfd3b 100644 --- a/tests/regression/d3q19-short/serial-le3d-st5.log +++ b/tests/regression/d3q19-short/serial-le3d-st5.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st6.log b/tests/regression/d3q19-short/serial-le3d-st6.log index c7448f56f..9dc35fc07 100644 --- a/tests/regression/d3q19-short/serial-le3d-st6.log +++ b/tests/regression/d3q19-short/serial-le3d-st6.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st7.log b/tests/regression/d3q19-short/serial-le3d-st7.log index db70f9443..c74fa4509 100644 --- a/tests/regression/d3q19-short/serial-le3d-st7.log +++ b/tests/regression/d3q19-short/serial-le3d-st7.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-le3d-st8.log b/tests/regression/d3q19-short/serial-le3d-st8.log index 6cd275880..2a7afb620 100644 --- a/tests/regression/d3q19-short/serial-le3d-st8.log +++ b/tests/regression/d3q19-short/serial-le3d-st8.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-muex-st1.log b/tests/regression/d3q19-short/serial-muex-st1.log index 8ff320528..d544e9578 100644 --- a/tests/regression/d3q19-short/serial-muex-st1.log +++ b/tests/regression/d3q19-short/serial-muex-st1.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-open-ru1.log b/tests/regression/d3q19-short/serial-open-ru1.log index d5f69266e..3d4cca95a 100644 --- a/tests/regression/d3q19-short/serial-open-ru1.log +++ b/tests/regression/d3q19-short/serial-open-ru1.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-open-ru2.log b/tests/regression/d3q19-short/serial-open-ru2.log index ac243a575..fdc0463aa 100644 --- a/tests/regression/d3q19-short/serial-open-ru2.log +++ b/tests/regression/d3q19-short/serial-open-ru2.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-pola-r01.inp b/tests/regression/d3q19-short/serial-pola-r01.inp index 715566919..4caa91aee 100644 --- a/tests/regression/d3q19-short/serial-pola-r01.inp +++ b/tests/regression/d3q19-short/serial-pola-r01.inp @@ -21,7 +21,6 @@ N_cycles 10 size 64_64_64 grid 2_2_2 periodicity 1_1_1 -reduced_halo yes ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-pola-r01.log b/tests/regression/d3q19-short/serial-pola-r01.log index bc098a3bb..662e53bdb 100644 --- a/tests/regression/d3q19-short/serial-pola-r01.log +++ b/tests/regression/d3q19-short/serial-pola-r01.log @@ -52,7 +52,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: reduced +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-poly-st1.inp b/tests/regression/d3q19-short/serial-poly-st1.inp index fb932848b..f418ae623 100644 --- a/tests/regression/d3q19-short/serial-poly-st1.inp +++ b/tests/regression/d3q19-short/serial-poly-st1.inp @@ -19,7 +19,6 @@ N_cycles 100 size 18_18_18 grid 2_2_1 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-poly-st1.log b/tests/regression/d3q19-short/serial-poly-st1.log index 537abad4c..cf870f794 100644 --- a/tests/regression/d3q19-short/serial-poly-st1.log +++ b/tests/regression/d3q19-short/serial-poly-st1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct1.inp b/tests/regression/d3q19-short/serial-rect-ct1.inp index 32c9742fe..605aa34fe 100644 --- a/tests/regression/d3q19-short/serial-rect-ct1.inp +++ b/tests/regression/d3q19-short/serial-rect-ct1.inp @@ -31,7 +31,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct1.log b/tests/regression/d3q19-short/serial-rect-ct1.log index 2607cb4c5..de044713b 100644 --- a/tests/regression/d3q19-short/serial-rect-ct1.log +++ b/tests/regression/d3q19-short/serial-rect-ct1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct2.inp b/tests/regression/d3q19-short/serial-rect-ct2.inp index 7ac1e1277..84f3d3093 100644 --- a/tests/regression/d3q19-short/serial-rect-ct2.inp +++ b/tests/regression/d3q19-short/serial-rect-ct2.inp @@ -20,7 +20,7 @@ N_start 0 size 1_62_30 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct2.log b/tests/regression/d3q19-short/serial-rect-ct2.log index eb73d8681..d8e93c5e1 100644 --- a/tests/regression/d3q19-short/serial-rect-ct2.log +++ b/tests/regression/d3q19-short/serial-rect-ct2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct3.inp b/tests/regression/d3q19-short/serial-rect-ct3.inp index 004831d88..d2b8ed857 100644 --- a/tests/regression/d3q19-short/serial-rect-ct3.inp +++ b/tests/regression/d3q19-short/serial-rect-ct3.inp @@ -26,7 +26,7 @@ N_start 0 size 1_31_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct3.log b/tests/regression/d3q19-short/serial-rect-ct3.log index 3cd7554af..abfbe0dc0 100644 --- a/tests/regression/d3q19-short/serial-rect-ct3.log +++ b/tests/regression/d3q19-short/serial-rect-ct3.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct4.inp b/tests/regression/d3q19-short/serial-rect-ct4.inp index 760074c18..75fd03dbc 100644 --- a/tests/regression/d3q19-short/serial-rect-ct4.inp +++ b/tests/regression/d3q19-short/serial-rect-ct4.inp @@ -19,7 +19,7 @@ N_start 0 size 31_15_1 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct4.log b/tests/regression/d3q19-short/serial-rect-ct4.log index 021bfbe2c..b57bb799e 100644 --- a/tests/regression/d3q19-short/serial-rect-ct4.log +++ b/tests/regression/d3q19-short/serial-rect-ct4.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rect-ct5.inp b/tests/regression/d3q19-short/serial-rect-ct5.inp index 1101322df..abc9f9767 100644 --- a/tests/regression/d3q19-short/serial-rect-ct5.inp +++ b/tests/regression/d3q19-short/serial-rect-ct5.inp @@ -19,7 +19,7 @@ N_start 0 size 31_1_15 grid 1_1_1 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rect-ct5.log b/tests/regression/d3q19-short/serial-rect-ct5.log index ffa7a686e..119ffb838 100644 --- a/tests/regression/d3q19-short/serial-rect-ct5.log +++ b/tests/regression/d3q19-short/serial-rect-ct5.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-relx-bp1.log b/tests/regression/d3q19-short/serial-relx-bp1.log index 4a8e8cdb7..aa06a361d 100644 --- a/tests/regression/d3q19-short/serial-relx-bp1.log +++ b/tests/regression/d3q19-short/serial-relx-bp1.log @@ -55,7 +55,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-c01.inp b/tests/regression/d3q19-short/serial-rest-c01.inp index 1da9853ef..cd788a06b 100644 --- a/tests/regression/d3q19-short/serial-rest-c01.inp +++ b/tests/regression/d3q19-short/serial-rest-c01.inp @@ -14,7 +14,7 @@ N_cycles 20 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rest-c01.log b/tests/regression/d3q19-short/serial-rest-c01.log index 170d14456..8d9744c8d 100644 --- a/tests/regression/d3q19-short/serial-rest-c01.log +++ b/tests/regression/d3q19-short/serial-rest-c01.log @@ -38,7 +38,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-c02.inp b/tests/regression/d3q19-short/serial-rest-c02.inp index 805103f63..59ae44434 100644 --- a/tests/regression/d3q19-short/serial-rest-c02.inp +++ b/tests/regression/d3q19-short/serial-rest-c02.inp @@ -15,7 +15,7 @@ N_cycles 20 ############################################################################## size 64_64_64 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-rest-c02.log b/tests/regression/d3q19-short/serial-rest-c02.log index beb6a5cb2..bfe9decec 100644 --- a/tests/regression/d3q19-short/serial-rest-c02.log +++ b/tests/regression/d3q19-short/serial-rest-c02.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-ec1.log b/tests/regression/d3q19-short/serial-rest-ec1.log index 443d00e3d..7f26f5745 100644 --- a/tests/regression/d3q19-short/serial-rest-ec1.log +++ b/tests/regression/d3q19-short/serial-rest-ec1.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-rest-ec2.log b/tests/regression/d3q19-short/serial-rest-ec2.log index 82231c43f..e837911ff 100644 --- a/tests/regression/d3q19-short/serial-rest-ec2.log +++ b/tests/regression/d3q19-short/serial-rest-ec2.log @@ -56,7 +56,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sgrd-st1.inp b/tests/regression/d3q19-short/serial-sgrd-st1.inp index a205c932e..2d9857027 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st1.inp +++ b/tests/regression/d3q19-short/serial-sgrd-st1.inp @@ -16,7 +16,7 @@ N_cycles 2000 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sgrd-st1.log b/tests/regression/d3q19-short/serial-sgrd-st1.log index 948367d81..4883fbfc2 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st1.log +++ b/tests/regression/d3q19-short/serial-sgrd-st1.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sgrd-st2.inp b/tests/regression/d3q19-short/serial-sgrd-st2.inp index 0b795a9f3..6868742bb 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st2.inp +++ b/tests/regression/d3q19-short/serial-sgrd-st2.inp @@ -15,7 +15,7 @@ N_cycles 2000 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sgrd-st2.log b/tests/regression/d3q19-short/serial-sgrd-st2.log index 3b221c183..fb64b084b 100644 --- a/tests/regression/d3q19-short/serial-sgrd-st2.log +++ b/tests/regression/d3q19-short/serial-sgrd-st2.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-c01.log b/tests/regression/d3q19-short/serial-spin-c01.log index 08159dfab..88d700c45 100644 --- a/tests/regression/d3q19-short/serial-spin-c01.log +++ b/tests/regression/d3q19-short/serial-spin-c01.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-c02.log b/tests/regression/d3q19-short/serial-spin-c02.log index 62736ea72..bae6c7e0e 100644 --- a/tests/regression/d3q19-short/serial-spin-c02.log +++ b/tests/regression/d3q19-short/serial-spin-c02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-fd1.log b/tests/regression/d3q19-short/serial-spin-fd1.log index e054c6378..d0a24498a 100644 --- a/tests/regression/d3q19-short/serial-spin-fd1.log +++ b/tests/regression/d3q19-short/serial-spin-fd1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-fd2.log b/tests/regression/d3q19-short/serial-spin-fd2.log index 0adc1b8fd..b51e96d63 100644 --- a/tests/regression/d3q19-short/serial-spin-fd2.log +++ b/tests/regression/d3q19-short/serial-spin-fd2.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-lb1.log b/tests/regression/d3q19-short/serial-spin-lb1.log index dc2ddd702..1f376c601 100644 --- a/tests/regression/d3q19-short/serial-spin-lb1.log +++ b/tests/regression/d3q19-short/serial-spin-lb1.log @@ -51,7 +51,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-lb2.log b/tests/regression/d3q19-short/serial-spin-lb2.log index dada75c63..60f21935b 100644 --- a/tests/regression/d3q19-short/serial-spin-lb2.log +++ b/tests/regression/d3q19-short/serial-spin-lb2.log @@ -46,7 +46,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 2 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-n01.log b/tests/regression/d3q19-short/serial-spin-n01.log index fc4e5bb06..7d8e9b8cd 100644 --- a/tests/regression/d3q19-short/serial-spin-n01.log +++ b/tests/regression/d3q19-short/serial-spin-n01.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-spin-n02.log b/tests/regression/d3q19-short/serial-spin-n02.log index f4568785c..a8147dc8e 100644 --- a/tests/regression/d3q19-short/serial-spin-n02.log +++ b/tests/regression/d3q19-short/serial-spin-n02.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sqmr-st1.inp b/tests/regression/d3q19-short/serial-sqmr-st1.inp index 67c8f3eff..408187b5a 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st1.inp +++ b/tests/regression/d3q19-short/serial-sqmr-st1.inp @@ -14,7 +14,7 @@ N_cycles 50 size 32_32_32 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sqmr-st1.log b/tests/regression/d3q19-short/serial-sqmr-st1.log index 92c9f068a..210e831e7 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st1.log +++ b/tests/regression/d3q19-short/serial-sqmr-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-sqmr-st2.inp b/tests/regression/d3q19-short/serial-sqmr-st2.inp index 75b5ba56f..329dfd95c 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st2.inp +++ b/tests/regression/d3q19-short/serial-sqmr-st2.inp @@ -14,7 +14,7 @@ N_cycles 50 size 32_32_32 grid 2_2_2 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-sqmr-st2.log b/tests/regression/d3q19-short/serial-sqmr-st2.log index c4a47f180..eb65c6aea 100644 --- a/tests/regression/d3q19-short/serial-sqmr-st2.log +++ b/tests/regression/d3q19-short/serial-sqmr-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-ssij-01.inp b/tests/regression/d3q19-short/serial-ssij-01.inp index f53fe8e6b..aab605e07 100644 --- a/tests/regression/d3q19-short/serial-ssij-01.inp +++ b/tests/regression/d3q19-short/serial-ssij-01.inp @@ -15,7 +15,7 @@ N_cycles 10 ############################################################################## size 16_16_16 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-ssij-01.log b/tests/regression/d3q19-short/serial-ssij-01.log index 7efcc61a8..61f858e2f 100644 --- a/tests/regression/d3q19-short/serial-ssij-01.log +++ b/tests/regression/d3q19-short/serial-ssij-01.log @@ -34,7 +34,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-dr1.log b/tests/regression/d3q19-short/serial-symm-dr1.log index 96e0f3edd..9eb09fae2 100644 --- a/tests/regression/d3q19-short/serial-symm-dr1.log +++ b/tests/regression/d3q19-short/serial-symm-dr1.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-dr2.log b/tests/regression/d3q19-short/serial-symm-dr2.log index cdfef768e..7afd17608 100644 --- a/tests/regression/d3q19-short/serial-symm-dr2.log +++ b/tests/regression/d3q19-short/serial-symm-dr2.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-symm-pat.log b/tests/regression/d3q19-short/serial-symm-pat.log index 47bc41396..9b4a82f43 100644 --- a/tests/regression/d3q19-short/serial-symm-pat.log +++ b/tests/regression/d3q19-short/serial-symm-pat.log @@ -53,7 +53,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st1.log b/tests/regression/d3q19-short/serial-tern-st1.log index 99589511e..feb125024 100644 --- a/tests/regression/d3q19-short/serial-tern-st1.log +++ b/tests/regression/d3q19-short/serial-tern-st1.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st2.log b/tests/regression/d3q19-short/serial-tern-st2.log index f664445a4..c1cf4f0ba 100644 --- a/tests/regression/d3q19-short/serial-tern-st2.log +++ b/tests/regression/d3q19-short/serial-tern-st2.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st3.log b/tests/regression/d3q19-short/serial-tern-st3.log index 8cf2347fc..c6f81ec0a 100644 --- a/tests/regression/d3q19-short/serial-tern-st3.log +++ b/tests/regression/d3q19-short/serial-tern-st3.log @@ -60,7 +60,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st4.log b/tests/regression/d3q19-short/serial-tern-st4.log index 117163bc4..577a73dfd 100644 --- a/tests/regression/d3q19-short/serial-tern-st4.log +++ b/tests/regression/d3q19-short/serial-tern-st4.log @@ -68,7 +68,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-tern-st5.log b/tests/regression/d3q19-short/serial-tern-st5.log index 339a6ec68..8fc93fd7c 100644 --- a/tests/regression/d3q19-short/serial-tern-st5.log +++ b/tests/regression/d3q19-short/serial-tern-st5.log @@ -67,7 +67,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st1.log b/tests/regression/d3q19-short/serial-wall-st1.log index fa9cea046..9a9a60824 100644 --- a/tests/regression/d3q19-short/serial-wall-st1.log +++ b/tests/regression/d3q19-short/serial-wall-st1.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st2.inp b/tests/regression/d3q19-short/serial-wall-st2.inp index 0ab087bd1..e45365066 100644 --- a/tests/regression/d3q19-short/serial-wall-st2.inp +++ b/tests/regression/d3q19-short/serial-wall-st2.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st2.log b/tests/regression/d3q19-short/serial-wall-st2.log index 7bb05bdd5..c699a4ed0 100644 --- a/tests/regression/d3q19-short/serial-wall-st2.log +++ b/tests/regression/d3q19-short/serial-wall-st2.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st3.inp b/tests/regression/d3q19-short/serial-wall-st3.inp index dbc96857f..4cbe7c795 100644 --- a/tests/regression/d3q19-short/serial-wall-st3.inp +++ b/tests/regression/d3q19-short/serial-wall-st3.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st3.log b/tests/regression/d3q19-short/serial-wall-st3.log index c0703de6c..4117233da 100644 --- a/tests/regression/d3q19-short/serial-wall-st3.log +++ b/tests/regression/d3q19-short/serial-wall-st3.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 diff --git a/tests/regression/d3q19-short/serial-wall-st4.inp b/tests/regression/d3q19-short/serial-wall-st4.inp index 00a9b603a..cdc1ff434 100644 --- a/tests/regression/d3q19-short/serial-wall-st4.inp +++ b/tests/regression/d3q19-short/serial-wall-st4.inp @@ -17,7 +17,7 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no + ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st4.log b/tests/regression/d3q19-short/serial-wall-st4.log index 79ffbf84c..7ff924399 100644 --- a/tests/regression/d3q19-short/serial-wall-st4.log +++ b/tests/regression/d3q19-short/serial-wall-st4.log @@ -33,7 +33,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 From 5a9a99f1b3b022f6c28524b8b8b86187ddec3d08 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 11:44:24 +0100 Subject: [PATCH 59/64] Updated halo information --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 8c77e2361..41e1ebd57 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ ### Changes +- Improved host halo swaps are available. + The implementation of the reduced distribution halo has been replaced + with one that will work in all circumstances for a single distribution. + See https://ludwig.epcc.ed.ac.uk/inputs/index.html Parallelism for details. + No user action is required if you are not interested. + version 0.15.0 - Active stress implementation is updated to conform to the documented From 37f3bd94d8cff2da08b053fe4778aa56fb321233 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 12:04:06 +0100 Subject: [PATCH 60/64] Remove unused key --- tests/regression/d3q19-short/serial-wall-st5.inp | 1 - tests/regression/d3q19-short/serial-wall-st5.log | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/regression/d3q19-short/serial-wall-st5.inp b/tests/regression/d3q19-short/serial-wall-st5.inp index ed112730d..a852eb229 100644 --- a/tests/regression/d3q19-short/serial-wall-st5.inp +++ b/tests/regression/d3q19-short/serial-wall-st5.inp @@ -16,7 +16,6 @@ N_cycles 10 size 24_24_24 periodicity 0_0_0 -reduced_halo no ############################################################################## # diff --git a/tests/regression/d3q19-short/serial-wall-st5.log b/tests/regression/d3q19-short/serial-wall-st5.log index 186f0c7e8..2222367fe 100644 --- a/tests/regression/d3q19-short/serial-wall-st5.log +++ b/tests/regression/d3q19-short/serial-wall-st5.log @@ -39,7 +39,7 @@ Lattice Boltzmann distributions Model: d3q19 SIMD vector len: 1 Number of sets: 1 -Halo type: full +Halo type: lb_halo_target (full halo) Input format: binary Output format: binary I/O grid: 1 1 1 From 49d50e2e48c0826502b029ae17e037931babe3ca Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 8 Apr 2022 14:52:44 +0100 Subject: [PATCH 61/64] No __device__ cudaDeviceSynchronize --- target/target.h | 4 ++-- target/target_cuda.c | 6 ++++-- target/target_cuda.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/target.h b/target/target.h index 1d17e4ce1..418c659cc 100644 --- a/target/target.h +++ b/target/target.h @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2018 The University of Edinburgh + * (c) 2018-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) @@ -38,12 +38,12 @@ __host__ tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig); __host__ tdpError_t tdpGetDeviceProperties(struct tdpDeviceProp * prop, int); __host__ tdpError_t tdpSetDevice(int device); +__host__ tdpError_t tdpDeviceSynchronize(void); __host__ __device__ tdpError_t tdpDeviceGetAttribute(int * value, tdpDeviceAttr attr, int device); __host__ __device__ tdpError_t tdpDeviceGetCacheConfig(tdpFuncCache * cache); -__host__ __device__ tdpError_t tdpDeviceSynchronize(void); __host__ __device__ tdpError_t tdpGetDevice(int * device); __host__ __device__ tdpError_t tdpGetDeviceCount(int * count); diff --git a/target/target_cuda.c b/target/target_cuda.c index 9b730979e..9cd0a6f0e 100644 --- a/target/target_cuda.c +++ b/target/target_cuda.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2019 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) @@ -240,7 +240,9 @@ __host__ tdpError_t tdpDeviceSetCacheConfig(tdpFuncCache cacheConfig) { return cudaDeviceSetCacheConfig(cacheConfig); } -__host__ __device__ tdpError_t tdpDeviceSynchronize(void) { +/* nb. CUDA 11.6 has deprecated the __device__ version of + * cudaDeviceSynchronize(). It should be used only on the host. */ +__host__ tdpError_t tdpDeviceSynchronize(void) { return cudaDeviceSynchronize(); } diff --git a/target/target_cuda.h b/target/target_cuda.h index 1be96e07e..02297e855 100644 --- a/target/target_cuda.h +++ b/target/target_cuda.h @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2018 The University of Edinburgh + * (c) 2018-2022 The University of Edinburgh * * Contributing authors: * Alan Gray (alang@epcc.ed.ac.uk) From f6061661d43906f8f8d981ba5de1957778a8bbdb Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Wed, 13 Apr 2022 16:46:36 +0100 Subject: [PATCH 62/64] Repair various GPU tests --- src/distribution_rt.c | 11 ++++++++++- src/model.c | 6 ++++-- src/stats_distribution.c | 28 +++++++++++++++++++++------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/distribution_rt.c b/src/distribution_rt.c index f405e87b7..3e994687e 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -188,6 +188,15 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { pe_fatal(pe, "lb_halo_scheme not recognised\n"); } + /* I'm going to trap this silently here - which is slightly + * better than having the wrong halo. I avoid a message so + * not as to disrupt the regression tests. */ + { + int ndevice = 0; + tdpGetDeviceCount(&ndevice); + if (ndevice > 0) options.halo = LB_HALO_TARGET; + } + options.reportimbalance = rt_switch(rt, "lb_halo_report_imbalance"); if (lb_data_options_valid(&options) == 0) { diff --git a/src/model.c b/src/model.c index 6ce70a597..ea00c8c79 100644 --- a/src/model.c +++ b/src/model.c @@ -199,8 +199,10 @@ __host__ int lb_memcpy(lb_t * lb, tdpMemcpyKind flag) { switch (flag) { case tdpMemcpyHostToDevice: - tdpMemcpy(&lb->target->ndist, &lb->ndist, sizeof(int), flag); - tdpMemcpy(&lb->target->nsite, &lb->nsite, sizeof(int), flag); + tdpMemcpy(&lb->target->ndim, &lb->ndim, sizeof(int), flag); + tdpMemcpy(&lb->target->nvel, &lb->nvel, sizeof(int), flag); + tdpMemcpy(&lb->target->ndist, &lb->ndist, sizeof(int), flag); + tdpMemcpy(&lb->target->nsite, &lb->nsite, sizeof(int), flag); tdpMemcpy(tmpf, lb->f, nsz, flag); break; case tdpMemcpyDeviceToHost: diff --git a/src/stats_distribution.c b/src/stats_distribution.c index 898e333df..a9cc0ca0f 100644 --- a/src/stats_distribution.c +++ b/src/stats_distribution.c @@ -11,7 +11,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -27,13 +27,18 @@ #include "util_sum.h" #include "stats_distribution.h" +/* Kernel utility continaer */ +typedef struct gm_util_s { + int8_t cv[27][3]; +} gm_util_t; + __host__ int stats_distribution_momentum_serial(lb_t * lb, map_t * map, double g[3]); __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, MPI_Comm comm, double gm[3]); __global__ void distribution_gm_kernel(kernel_ctxt_t * ktxt, lb_t * lb, - map_t * map, kahan_t * gm); + map_t * map, gm_util_t u, kahan_t * gm); /***************************************************************************** @@ -199,6 +204,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, int nlocal[3]; dim3 nblk, ntpb; + gm_util_t util = {0}; kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; @@ -210,6 +216,12 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, tdpAssert(tdpMalloc((void **) &sum_d, 3*sizeof(kahan_t))); tdpAssert(tdpMemcpy(sum_d, sum, 3*sizeof(kahan_t), tdpMemcpyHostToDevice)); + for (int p = 0; p < lb->model.nvel; p++) { + util.cv[p][X] = lb->model.cv[p][X]; + util.cv[p][Y] = lb->model.cv[p][Y]; + util.cv[p][Z] = lb->model.cv[p][Z]; + } + /* Local kernel */ cs_nlocal(lb->cs, nlocal); @@ -221,7 +233,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, kernel_ctxt_launch_param(ctxt, &nblk, &ntpb); tdpLaunchKernel(distribution_gm_kernel, nblk, ntpb, 0, 0, - ctxt->target, lb->target, map->target, sum_d); + ctxt->target, lb->target, map->target, util, sum_d); tdpAssert(tdpPeekAtLastError()); tdpAssert(tdpDeviceSynchronize()); @@ -249,6 +261,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, kernel_ctxt_free(ctxt); tdpFree(sum_d); + /*printf("Affter mpi: %14.7e %14.7e %14.7e\n", gm[X], gm[Y], gm[Z]);*/ return 0; } @@ -263,7 +276,8 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, *****************************************************************************/ __global__ void distribution_gm_kernel(kernel_ctxt_t * ktx, lb_t * lb, - map_t * map, kahan_t * gm) { + map_t * map, gm_util_t util, + kahan_t * gm) { assert(ktx); assert(lb); @@ -304,9 +318,9 @@ __global__ void distribution_gm_kernel(kernel_ctxt_t * ktx, lb_t * lb, if (status == MAP_FLUID) { for (int p = 1; p < lb->nvel; p++) { double f = lb->f[LB_ADDR(lb->nsite,lb->ndist,lb->nvel,index,LB_RHO,p)]; - double gxf = f*lb->model.cv[p][X]; - double gyf = f*lb->model.cv[p][Y]; - double gzf = f*lb->model.cv[p][Z]; + double gxf = f*util.cv[p][X]; + double gyf = f*util.cv[p][Y]; + double gzf = f*util.cv[p][Z]; kahan_add_double(&gx[tid], gxf); kahan_add_double(&gy[tid], gyf); kahan_add_double(&gz[tid], gzf); From 3d02ba5b5ef45faf77b8e5ad800c5838ee1687e7 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Thu, 14 Apr 2022 17:23:17 +0100 Subject: [PATCH 63/64] Remove warning --- src/compiler.c | 3 +-- src/stats_distribution.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler.c b/src/compiler.c index 27c210763..6319e05b8 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phyiscs Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -110,7 +110,6 @@ int compiler_id(compiler_info_t * compiler) { compiler->minor = __GNUC_MINOR__; compiler->patchlevel = __GNUC_PATCHLEVEL__; strncpy(compiler->version, __VERSION__, 1 + strlen(__VERSION__)); - /*strncpy(compiler->version, __VERSION__, 1 + strnlen(__VERSION__, BUFSIZ-1));*/ sprintf(compiler->name, "%s", "Gnu"); ierr = 0; diff --git a/src/stats_distribution.c b/src/stats_distribution.c index a9cc0ca0f..939431c48 100644 --- a/src/stats_distribution.c +++ b/src/stats_distribution.c @@ -261,7 +261,6 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, kernel_ctxt_free(ctxt); tdpFree(sum_d); - /*printf("Affter mpi: %14.7e %14.7e %14.7e\n", gm[X], gm[Y], gm[Z]);*/ return 0; } From 069837d70dac33225c827797ce26059ffffa6578 Mon Sep 17 00:00:00 2001 From: Kevin Stratford Date: Fri, 15 Apr 2022 14:44:44 +0100 Subject: [PATCH 64/64] Standardise --- mpi_s/mpi_serial.c | 10 ++--- mpi_s/mpi_tests.c | 4 +- src/blue_phase_beris_edwards.c | 4 +- src/blue_phase_init.c | 18 ++++---- src/blue_phase_rt.c | 4 +- src/cahn_hilliard_stats.c | 10 ++--- src/colloid_io.c | 4 +- src/colloids_rt.c | 10 ++--- src/coords.c | 8 ++-- src/distribution_rt.c | 10 ++--- src/fe_ternary_rt.c | 12 ++--- src/field.c | 16 +++---- src/hydro.c | 16 +++---- src/lb_bc_inflow_opts.c | 4 +- src/lb_bc_inflow_rhou.c | 38 ++++++++-------- src/lb_bc_open_rt.c | 14 +++--- src/lb_bc_outflow_opts.c | 4 +- src/lb_bc_outflow_rhou.c | 44 +++++++++--------- src/lb_d2q9.c | 4 +- src/lb_d3q15.c | 4 +- src/lb_d3q19.c | 4 +- src/lb_d3q27.c | 2 +- src/lb_model.c | 4 +- src/lc_droplet.c | 4 +- src/lc_droplet_rt.c | 4 +- src/ludwig.c | 14 +++--- src/map.c | 4 +- src/map_init.c | 30 ++++++------- src/map_rt.c | 6 +-- src/model.c | 14 +++--- src/noise.c | 4 +- src/pe.c | 10 ++--- src/phi_bc_inflow_fixed.c | 6 +-- src/phi_bc_inflow_opts.c | 4 +- src/phi_bc_open_rt.c | 14 +++--- src/phi_bc_outflow_free.c | 8 ++-- src/phi_bc_outflow_opts.c | 10 ++++- src/phi_cahn_hilliard.c | 8 ++-- src/phi_force.c | 4 +- src/phi_grad_mu.c | 28 ++++++------ src/psi.c | 4 +- src/runtime.c | 5 ++- src/stats_colloid_force_split.c | 12 ++--- src/stats_distribution.c | 6 +-- src/subgrid.c | 4 +- src/symmetric_rt.c | 5 ++- src/timer.c | 8 ++-- src/util_sum.c | 8 ++-- src/wall_ss_cut.c | 2 +- tests/unit/test_assumptions.c | 2 +- tests/unit/test_blue_phase.c | 32 +++++++------- tests/unit/test_build.c | 8 ++-- tests/unit/test_fe_lc_droplet.c | 10 ++--- tests/unit/test_fe_surfactant1.c | 64 ++++++++++++++------------- tests/unit/test_fe_ternary.c | 8 ++-- tests/unit/test_field.c | 4 +- tests/unit/test_io_options.c | 4 +- tests/unit/test_io_options_rt.c | 6 +-- tests/unit/test_lb_bc_inflow_opts.c | 4 +- tests/unit/test_lb_bc_inflow_rhou.c | 18 ++++---- tests/unit/test_lb_bc_outflow_rhou.c | 14 +++--- tests/unit/test_lb_d2q9.c | 4 +- tests/unit/test_lb_d3q15.c | 4 +- tests/unit/test_lb_d3q19.c | 4 +- tests/unit/test_lb_d3q27.c | 2 +- tests/unit/test_lb_model.c | 6 +-- tests/unit/test_map_init.c | 25 ++++++----- tests/unit/test_model.c | 14 +++--- tests/unit/test_pair_ss_cut.c | 2 +- tests/unit/test_pair_ss_cut_ij.c | 13 ++++-- tests/unit/test_phi_bc_inflow_fixed.c | 12 ++++- tests/unit/test_phi_bc_outflow_free.c | 14 ++++-- tests/unit/test_runtime.c | 10 ++--- util/capillary.c | 14 +++--- util/extract.c | 4 +- 75 files changed, 407 insertions(+), 369 deletions(-) diff --git a/mpi_s/mpi_serial.c b/mpi_s/mpi_serial.c index 3758bc9d2..04ea6e3e9 100644 --- a/mpi_s/mpi_serial.c +++ b/mpi_s/mpi_serial.c @@ -660,7 +660,7 @@ int MPI_Type_indexed(int count, int * array_of_blocklengths, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; @@ -685,7 +685,7 @@ int MPI_Type_contiguous(int count, MPI_Datatype old, MPI_Datatype * newtype) { assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = mpi_sizeof(old)*count; /* contiguous */ @@ -756,7 +756,7 @@ int MPI_Type_vector(int count, int blocklength, int stride, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; @@ -1164,7 +1164,7 @@ int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, assert(newtype); { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = extent; @@ -1198,7 +1198,7 @@ int MPI_Type_create_struct(int count, int array_of_blocklengths[], { - data_t dt = {}; + data_t dt = {0}; dt.handle = MPI_DATATYPE_NULL; dt.bytes = 0; diff --git a/mpi_s/mpi_tests.c b/mpi_s/mpi_tests.c index cf2ab98b0..1d11b8c26 100644 --- a/mpi_s/mpi_tests.c +++ b/mpi_s/mpi_tests.c @@ -253,10 +253,10 @@ int test_mpi_type_create_struct(void) { { /* Commit */ - test_t data = {}; + test_t data = {0}; int count = 2; int blocklengths[2] = {1, 1}; - MPI_Aint displacements[3] = {}; + MPI_Aint displacements[3] = {0}; MPI_Datatype datatypes[2] = {MPI_INT, MPI_DOUBLE}; MPI_Get_address(&data, displacements + 0); diff --git a/src/blue_phase_beris_edwards.c b/src/blue_phase_beris_edwards.c index c8f55baf1..580139280 100644 --- a/src/blue_phase_beris_edwards.c +++ b/src/blue_phase_beris_edwards.c @@ -31,7 +31,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2021 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -322,7 +322,7 @@ __host__ int beris_edw_update_host(beris_edw_t * be, fe_t * fe, field_t * fq, double gamma; double chi[NQAB], chi_qab[3][3]; - double tmatrix[3][3][NQAB] = {}; + double tmatrix[3][3][NQAB] = {0}; double var = 0.0; const double dt = 1.0; diff --git a/src/blue_phase_init.c b/src/blue_phase_init.c index 7234c4927..ea549fbae 100644 --- a/src/blue_phase_init.c +++ b/src/blue_phase_init.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Oliver Henrich (oliver.henrich@strath.ac.uk) @@ -64,7 +64,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double root2; double q0; double amplitude0; - rotation_t rot = {}; + rotation_t rot = {0}; assert(cs); assert(fq); @@ -82,7 +82,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, /* So we add a sign here. */ { - double angles[3] = {}; /* radians */ + double angles[3] = {0}; /* radians */ PI_DOUBLE(pi); angles[0] = -1.0*pi*euler_angles[0]/180.0; @@ -98,7 +98,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double y = noffset[Y] + jc; for (int kc = 1; kc <= nlocal[Z]; kc++) { double z = noffset[Z] + kc; - double r[3] = {}; + double r[3] = {0}; /* Rotate around the centre */ r[X] = x - 0.5*ntotal[X]; @@ -119,7 +119,7 @@ int blue_phase_O8M_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double sinx = sin(root2*q0*r[X]); double siny = sin(root2*q0*r[Y]); double sinz = sin(root2*q0*r[Z]); - double q[3][3] = {}; + double q[3][3] = {0}; q[X][X] = amplitude0*( -2.0*cosy*sinz + sinx*cosz + cosx*siny); q[X][Y] = amplitude0*(root2*cosy*cosz + root2*sinx*sinz - sinx*cosy); @@ -159,7 +159,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double q0; double amplitude0; - rotation_t rot = {}; + rotation_t rot = {0}; assert(cs); assert(fq); @@ -176,7 +176,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, /* Hence the factor of -1.0 below. */ { - double angles[3] = {}; /* radians */ + double angles[3] = {0}; /* radians */ PI_DOUBLE(pi); angles[0] = -1.0*pi*euler_angles[0]/180.0; @@ -192,7 +192,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double y = noffset[Y] + jc; for (int kc = 1; kc <= nlocal[Z]; kc++) { double z = noffset[Z] + kc; - double r[3] = {}; + double r[3] = {0}; r[X] = x - 0.5*ntotal[X]; r[Y] = y - 0.5*ntotal[Y]; @@ -212,7 +212,7 @@ int blue_phase_O2_init(cs_t * cs, fe_lc_param_t * param, field_t * fq, double sinx = sin(2.0*q0*r[X]); double siny = sin(2.0*q0*r[Y]); double sinz = sin(2.0*q0*r[Z]); - double q[3][3] = {}; + double q[3][3] = {0}; q[X][X] = amplitude0*(cosz - cosy); q[X][Y] = amplitude0*sinz; diff --git a/src/blue_phase_rt.c b/src/blue_phase_rt.c index 73cb14df4..2bb7f30d6 100644 --- a/src/blue_phase_rt.c +++ b/src/blue_phase_rt.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2009-2021 The University of Edinburgh + * (c) 2009-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -72,7 +72,7 @@ __host__ int blue_phase_init_rt(pe_t * pe, rt_t *rt, pe_info(pe, "Blue phase free energy selected.\n"); { - char description[BUFSIZ] = {}; + char description[BUFSIZ] = {0}; rt_string_parameter(rt, "free_energy", description, BUFSIZ); fe_is_lc_droplet = (strcmp(description, "lc_droplet") == 0); } diff --git a/src/cahn_hilliard_stats.c b/src/cahn_hilliard_stats.c index 587372413..2ac6f06cb 100644 --- a/src/cahn_hilliard_stats.c +++ b/src/cahn_hilliard_stats.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributions: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -59,7 +59,7 @@ __global__ void cahn_stats_min_kernel(kernel_ctxt_t * ktx, field_t * phi, __host__ int cahn_hilliard_stats_time0(phi_ch_t * pch, field_t * phi, map_t * map) { - phi_stats_t stats = {}; + phi_stats_t stats = {0}; MPI_Comm comm = MPI_COMM_NULL; assert(pch); @@ -83,8 +83,8 @@ __host__ int cahn_hilliard_stats_time0(phi_ch_t * pch, field_t * phi, __host__ int cahn_hilliard_stats(phi_ch_t * pch, field_t * phi, map_t * map) { - phi_stats_t stats = {.sum1 = {}, - .sum2 = {}, + phi_stats_t stats = {.sum1 = {0}, + .sum2 = {0}, .sum = 0.0, .var = 0.0, .min = +FLT_MAX, @@ -123,7 +123,7 @@ __host__ int cahn_hilliard_stats(phi_ch_t * pch, field_t * phi, map_t * map) { __host__ int cahn_stats_reduce(phi_ch_t * pch, field_t * phi, map_t * map, phi_stats_t * stats, int root, MPI_Comm comm) { - phi_stats_t local = {}; + phi_stats_t local = {0}; phi_stats_t * stats_d = NULL; int nlocal[3]; diff --git a/src/colloid_io.c b/src/colloid_io.c index 3c2344fa4..9681902c6 100644 --- a/src/colloid_io.c +++ b/src/colloid_io.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -429,7 +429,7 @@ int colloid_io_write_buffer_binary(FILE * fp, int nc, colloid_state_t * buf) { int colloid_io_read(colloid_io_t * cio, const char * filename) { int ngroup; - char filename_io[FILENAME_MAX] = {}; + char filename_io[FILENAME_MAX] = {0}; FILE * fp_state; assert(cio->f_header_read); diff --git a/src/colloids_rt.c b/src/colloids_rt.c index 004ba3bdf..6127cac33 100644 --- a/src/colloids_rt.c +++ b/src/colloids_rt.c @@ -814,10 +814,10 @@ int pair_ss_cut_ij_init(pe_t * pe, cs_t * cs, rt_t * rt, interact_t * intrct) { if (ison) { int ntypes = 0; int nsymm = 0; - double epsilon[BUFSIZ] = {}; - double sigma[BUFSIZ] = {}; - double nu[BUFSIZ] = {}; - double hc[BUFSIZ] = {}; + double epsilon[BUFSIZ] = {0}; + double sigma[BUFSIZ] = {0}; + double nu[BUFSIZ] = {0}; + double hc[BUFSIZ] = {0}; pair_ss_cut_ij_t * pair = NULL; rt_key_required(rt, "pair_ss_cut_ij_ntypes", RT_FATAL); @@ -1092,7 +1092,7 @@ int wall_ss_cut_init(pe_t * pe, cs_t * cs, rt_t * rt, wall_t * wall, if (have_wall_ss_cut) { wall_ss_cut_t * wall_ss_cut = NULL; - wall_ss_cut_options_t opts = {}; + wall_ss_cut_options_t opts = {0}; rt_key_required(rt, "wall_ss_cut_epsilon", RT_FATAL); rt_key_required(rt, "wall_ss_cut_sigma", RT_FATAL); diff --git a/src/coords.c b/src/coords.c index 2d5e29962..3cb298107 100644 --- a/src/coords.c +++ b/src/coords.c @@ -546,14 +546,14 @@ static __host__ int cs_rectilinear_decomposition(cs_t * cs) { int idim; int n, ntot, nremainder; int ntotal[3]; - int mpisz[3] = {}; + int mpisz[3] = {0}; assert(cs); { - int dims[3] = {}; - int coords[3] = {}; - int periods[3] = {}; + int dims[3] = {0}; + int coords[3] = {0}; + int periods[3] = {0}; MPI_Cart_get(cs->commcart, 3, dims, coords, periods); mpisz[X] = dims[X]; mpisz[Y] = dims[Y]; mpisz[Z] = dims[Z]; } diff --git a/src/distribution_rt.c b/src/distribution_rt.c index f405e87b7..815d95ee1 100644 --- a/src/distribution_rt.c +++ b/src/distribution_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -60,7 +60,7 @@ int lb_ndist_rt(rt_t * rt) { { /* The only exception ... */ - char description[BUFSIZ] = {}; + char description[BUFSIZ] = {0}; rt_string_parameter(rt, "free_energy", description, BUFSIZ); if (strcmp(description, "symmetric_lb") == 0) ndist = 2; } @@ -173,7 +173,7 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* Halo options */ { - char htype[BUFSIZ] = {}; + char htype[BUFSIZ] = {0}; int havetype = rt_string_parameter(rt, "lb_halo_scheme", htype, BUFSIZ); if (strcmp(htype, "lb_halo_target") == 0) { options.halo = LB_HALO_TARGET; @@ -287,7 +287,7 @@ int lb_run_time_prev(pe_t * pe, cs_t * cs, rt_t * rt, lb_t ** lb) { /* distribution i/o */ { - io_info_args_t tmp = {}; + io_info_args_t tmp = io_info_args_default(); tmp.grid[X] = io_grid[X]; tmp.grid[Y] = io_grid[Y]; tmp.grid[Z] = io_grid[Z]; @@ -339,7 +339,7 @@ int lb_rt_initial_conditions(pe_t * pe, rt_t * rt, lb_t * lb, double u0 = 0.0; double delta = 0.0; double kappa = 0.0; - kh_2d_param_t kh = {}; + kh_2d_param_t kh = {0}; rt_key_required(rt, "2d_kelvin_helmholtz_u0", RT_FATAL); rt_key_required(rt, "2d_kelvin_helmholtz_delta", RT_FATAL); diff --git a/src/fe_ternary_rt.c b/src/fe_ternary_rt.c index a1df9112e..794cfcc65 100644 --- a/src/fe_ternary_rt.c +++ b/src/fe_ternary_rt.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * - * (c) 2019-2021 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Shan Chen (shan.chen@epfl.ch) @@ -110,7 +110,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_double_emulsion") == 0) { - fti_block_t param = {}; + fti_block_t param = {0}; /* Default parameters (historically to give roughly equal areas) */ param.xf1 = 0.2; @@ -139,7 +139,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_tee") == 0) { - fti_block_t param = {}; + fti_block_t param = {0}; /* Default parameters (roughly equal area) */ @@ -160,7 +160,7 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_lens") == 0) { - fti_drop_t drop = {}; + fti_drop_t drop = {0}; /* No defaults */ rt_key_required(rt, "ternary_2d_lens_centre", RT_FATAL); @@ -174,8 +174,8 @@ __host__ int fe_ternary_init_rt(pe_t * pe, rt_t * rt, fe_ternary_t * fe, if (p != 0 && strcmp(value, "2d_double_drop") == 0) { - fti_drop_t drop1 = {}; - fti_drop_t drop2 = {}; + fti_drop_t drop1 = {0}; + fti_drop_t drop2 = {0}; /* No defaults */ rt_key_required(rt, "ternary_2d_drop1_centre", RT_FATAL); diff --git a/src/field.c b/src/field.c index 8fa6529f4..5c517f8a7 100644 --- a/src/field.c +++ b/src/field.c @@ -14,7 +14,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -284,7 +284,7 @@ __host__ __device__ int field_nf(field_t * obj, int * nf) { __host__ int field_init_io_info(field_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(obj->info == NULL); @@ -1094,7 +1094,7 @@ int field_halo_dequeue_recv(field_t * field, const field_halo_t * h, int ireq) { int field_halo_create(const field_t * field, field_halo_t * h) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int nhalo = 0; assert(field); @@ -1120,15 +1120,15 @@ int field_halo_create(const field_t * field, field_halo_t * h) { /* Ranks of Cartesian neighbours */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->cv[p][X]; int j = 1 + h->cv[p][Y]; int k = 1 + h->cv[p][Z]; diff --git a/src/hydro.c b/src/hydro.c index ed884543e..dd9eb8867 100644 --- a/src/hydro.c +++ b/src/hydro.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -306,7 +306,7 @@ __host__ int hydro_halo_swap(hydro_t * obj, hydro_halo_enum_t flag) { __host__ int hydro_init_io_info(hydro_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(grid); @@ -1423,7 +1423,7 @@ int hydro_halo_dequeue_recv(hydro_t * hydro, const hydro_halo_t * h, int ireq) { int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(hydro); assert(h); @@ -1448,15 +1448,15 @@ int hydro_halo_create(const hydro_t * hydro, hydro_halo_t * h) { /* Ranks of Cartesian neighbours */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->cv[p][X]; int j = 1 + h->cv[p][Y]; int k = 1 + h->cv[p][Z]; diff --git a/src/lb_bc_inflow_opts.c b/src/lb_bc_inflow_opts.c index 541eefaca..804bd946b 100644 --- a/src/lb_bc_inflow_opts.c +++ b/src/lb_bc_inflow_opts.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -28,7 +28,7 @@ lb_bc_inflow_opts_t lb_bc_inflow_opts_default(void) { - lb_bc_inflow_opts_t opts = {.nvel = 19, .flow = {}, .u0 = {}}; + lb_bc_inflow_opts_t opts = {.nvel = 19, .flow = {0}, .u0 = {0}}; return opts; } diff --git a/src/lb_bc_inflow_rhou.c b/src/lb_bc_inflow_rhou.c index 69b82069e..7fe0aa1ed 100644 --- a/src/lb_bc_inflow_rhou.c +++ b/src/lb_bc_inflow_rhou.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * *****************************************************************************/ @@ -141,7 +141,7 @@ __host__ int lb_bc_inflow_init_link(lb_bc_inflow_rhou_t * inflow, link_init_enum_t init, int id) { cs_t * cs = NULL; - int noffset[3] = {}; + int noffset[3] = {0}; int nlink = 0; assert(inflow); @@ -151,10 +151,10 @@ __host__ int lb_bc_inflow_init_link(lb_bc_inflow_rhou_t * inflow, cs_nlocal_offset(cs, noffset); if (noffset[id] == 0) { - int ntotal[3] = {}; - int nlocal[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(inflow->options.nvel, &model); cs_ntotal(cs, ntotal); @@ -237,7 +237,7 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, cs_t * cs = NULL; int id = -1; - int noffset[3] = {}; + int noffset[3] = {0}; assert(inflow); assert(hydro); @@ -251,7 +251,7 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, if (noffset[id] == 0) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int idx = inflow->options.flow[X]; int jdy = inflow->options.flow[Y]; int kdz = inflow->options.flow[Z]; @@ -293,8 +293,8 @@ __host__ int lb_bc_inflow_rhou_update(lb_bc_inflow_rhou_t * inflow, __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, hydro_t * hydro) { cs_t * cs = NULL; - int noffset[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int nlocal[3] = {0}; const int tag = 12347; @@ -311,10 +311,10 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, if (noffset[X] == 0) { MPI_Comm comm = MPI_COMM_NULL; - MPI_Request req[8] = {}; - double *buf[8] = {}; - int ngbr[8] = {}; - int count[8] = {}; /* Data items */ + MPI_Request req[8] = {0}; + double *buf[8] = {0}; + int ngbr[8] = {0}; + int count[8] = {0}; /* Data items */ int nhalo = 1; /* Only ever one if distributions are involved. */ /* Recv from ... */ @@ -361,7 +361,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, int m = 4 + ms; int ib = 0; int nhm1 = nhalo-1; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 4) { /* send to Y-1,Z */ lim.jmin = 1; lim.jmax = nhalo; @@ -385,7 +385,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); buf[m][ib++] = rho; @@ -402,7 +402,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, /* Process */ for (int ms = 0; ms < 8; ms++) { int m = -1; - MPI_Status status = {}; + MPI_Status status = {0}; MPI_Waitany(8, req, &m, &status); if (m == MPI_UNDEFINED) continue; @@ -416,7 +416,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, else { /* Recv has arrived: unpack to correct destination */ int ib = 0; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 0) { /* recv from Y+1,Z */ lim.jmin = nlocal[Y] + 1; lim.jmax = nlocal[Y] + nhalo; @@ -440,7 +440,7 @@ __host__ int lb_bc_inflow_rhou_halo_update(lb_bc_inflow_rhou_t * inflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; rho = buf[m][ib++]; u[X] = buf[m][ib++]; u[Y] = buf[m][ib++]; @@ -497,7 +497,7 @@ __host__ int lb_bc_inflow_rhou_impose(lb_bc_inflow_rhou_t * inflow, int8_t p = inflow->linkp[n]; double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); diff --git a/src/lb_bc_open_rt.c b/src/lb_bc_open_rt.c index 154bc4a3f..d2086c014 100644 --- a/src/lb_bc_open_rt.c +++ b/src/lb_bc_open_rt.c @@ -13,7 +13,7 @@ * Edinburgh Parallel Computing Centre * * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contibuting authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -45,7 +45,7 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, lb_bc_open_t ** outflow) { int have_bc = 0; /* inflow/outflow required */ - int flow[3] = {}; /* flow direction */ + int flow[3] = {0}; /* flow direction */ assert(pe); assert(rt); @@ -55,8 +55,8 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, have_bc = rt_switch(rt, "lb_bc_open"); if (have_bc) { - int wall[3] = {}; - int periodic[3] = {}; + int wall[3] = {0}; + int periodic[3] = {0}; /* Take flow direction from non-wall direction. */ /* There must be D-1 walls in D dimensions */ @@ -94,8 +94,8 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, if (have_bc) { - char intype[BUFSIZ] = {}; - double u0[3] = {}; + char intype[BUFSIZ] = {0}; + double u0[3] = {0}; rt_string_parameter(rt, "lb_bc_inflow_type", intype, BUFSIZ/2); rt_double_parameter_vector(rt, "lb_bc_inflow_rhou_u0", u0); @@ -136,7 +136,7 @@ __host__ int lb_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, lb_t * lb, /* Outflow */ if (have_bc) { - char outtype[BUFSIZ] = {}; + char outtype[BUFSIZ] = {0}; double rho0 = 1.0; rt_string_parameter(rt, "lb_bc_outflow_type", outtype, BUFSIZ/2); diff --git a/src/lb_bc_outflow_opts.c b/src/lb_bc_outflow_opts.c index 406dae84f..d35895441 100644 --- a/src/lb_bc_outflow_opts.c +++ b/src/lb_bc_outflow_opts.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -22,7 +22,7 @@ lb_bc_outflow_opts_t lb_bc_outflow_opts_default(void) { - lb_bc_outflow_opts_t opts = {.nvel = 19, .flow = {}, .rho0 = 1.0}; + lb_bc_outflow_opts_t opts = {.nvel = 19, .flow = {0}, .rho0 = 1.0}; return opts; } diff --git a/src/lb_bc_outflow_rhou.c b/src/lb_bc_outflow_rhou.c index 122258534..996671d6b 100644 --- a/src/lb_bc_outflow_rhou.c +++ b/src/lb_bc_outflow_rhou.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * *****************************************************************************/ @@ -138,9 +138,9 @@ __host__ int lb_bc_outflow_init_link(lb_bc_outflow_rhou_t * outflow, link_init_enum_t init, int id) { cs_t * cs = NULL; - int noffset[3] = {}; - int ntotal[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; int nlink = 0; assert(outflow); @@ -155,7 +155,7 @@ __host__ int lb_bc_outflow_init_link(lb_bc_outflow_rhou_t * outflow, if (noffset[id] + nlocal[id] == ntotal[id]) { int nmin[3] = {1, 1, 1}; - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(outflow->options.nvel, &model); nmin[id] = nlocal[id]; /* Only rightmost edge in the relevant direction */ @@ -235,9 +235,9 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, cs_t * cs = NULL; int id = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; assert(outflow); assert(hydro); @@ -267,7 +267,7 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, int index0 = cs_index(cs, ic + idx, jc + jdy, kc + kdz); int index1 = cs_index(cs, ic, jc, kc); - double u[3] = {}; + double u[3] = {0}; hydro_rho_set(hydro, index0, outflow->options.rho0); hydro_u(hydro, index1, u); @@ -294,9 +294,9 @@ __host__ int lb_bc_outflow_rhou_update(lb_bc_outflow_rhou_t * outflow, __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, hydro_t * hydro) { cs_t * cs = NULL; - int noffset[3] = {}; - int ntotal[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; const int tag = 12348; @@ -314,10 +314,10 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, if (noffset[X] + nlocal[X] == ntotal[X]) { MPI_Comm comm = MPI_COMM_NULL; - MPI_Request req[8] = {}; - double *buf[8] = {}; - int ngbr[8] = {}; - int count[8] = {}; /* Data items */ + MPI_Request req[8] = {0}; + double *buf[8] = {0}; + int ngbr[8] = {0}; + int count[8] = {0}; /* Data items */ int nhalo = 1; /* Only ever one if distributions are involved. */ /* Recv from ... */ @@ -364,7 +364,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, int m = 4 + ms; int ib = 0; int nhm1 = nhalo-1; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 4) { /* send to Y-1,Z */ lim.jmin = 1; lim.jmax = nhalo; @@ -388,7 +388,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); buf[m][ib++] = rho; @@ -405,7 +405,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, /* Process */ for (int ms = 0; ms < 8; ms++) { int m = -1; - MPI_Status status = {}; + MPI_Status status = {0}; MPI_Waitany(8, req, &m, &status); if (m == MPI_UNDEFINED) continue; @@ -419,7 +419,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, else { /* Recv has arrived: unpack to correct destination */ int ib = 0; - cs_limits_t lim = {}; + cs_limits_t lim = {0}; if (m == 0) { /* recv from Y+1,Z */ lim.jmin = nlocal[Y] + 1; lim.jmax = nlocal[Y] + nhalo; @@ -443,7 +443,7 @@ __host__ int lb_bc_outflow_rhou_halo_update(lb_bc_outflow_rhou_t * outflow, for (int kc = lim.kmin; kc <= lim.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; rho = buf[m][ib++]; u[X] = buf[m][ib++]; u[Y] = buf[m][ib++]; @@ -499,7 +499,7 @@ __host__ int lb_bc_outflow_rhou_impose(lb_bc_outflow_rhou_t * outflow, int8_t p = outflow->linkp[n]; double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); diff --git a/src/lb_d2q9.c b/src/lb_d2q9.c index bc27730ad..9871230a3 100644 --- a/src/lb_d2q9.c +++ b/src/lb_d2q9.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -31,7 +31,7 @@ int lb_d2q9_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 2; model->nvel = NVEL_D2Q9; diff --git a/src/lb_d3q15.c b/src/lb_d3q15.c index 26808b04f..34922a1b3 100644 --- a/src/lb_d3q15.c +++ b/src/lb_d3q15.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -32,7 +32,7 @@ int lb_d3q15_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q15; diff --git a/src/lb_d3q19.c b/src/lb_d3q19.c index 4d88904d9..9be1f2eeb 100644 --- a/src/lb_d3q19.c +++ b/src/lb_d3q19.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -31,7 +31,7 @@ int lb_d3q19_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q19; diff --git a/src/lb_d3q27.c b/src/lb_d3q27.c index 50796f5fb..d3ca369c2 100644 --- a/src/lb_d3q27.c +++ b/src/lb_d3q27.c @@ -32,7 +32,7 @@ int lb_d3q27_create(lb_model_t * model) { assert(model); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; model->ndim = 3; model->nvel = NVEL_D3Q27; diff --git a/src/lb_model.c b/src/lb_model.c index c18dfc7e3..7c1301e71 100644 --- a/src/lb_model.c +++ b/src/lb_model.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -112,7 +112,7 @@ int lb_model_free(lb_model_t * model) { if (model->cv) free(model->cv); if (model->wv) free(model->wv); - *model = (lb_model_t) {}; + *model = (lb_model_t) {0}; return 0; } diff --git a/src/lc_droplet.c b/src/lc_droplet.c index 195ff24a1..9d170152b 100644 --- a/src/lc_droplet.c +++ b/src/lc_droplet.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Juho Lituvuori (juho.lintuvuori@u-bordeaux.fr) @@ -598,7 +598,7 @@ int fe_lc_droplet_str_symm(fe_lc_droplet_t * fe, int index, double sth[3][3]){ { double phi = 0.0; - double sa[3][3] = {}; + double sa[3][3] = {0}; field_scalar(fe->symm->phi, index, &phi); fe_lc_droplet_active_stress(fe->param, phi, q, sa); diff --git a/src/lc_droplet_rt.c b/src/lc_droplet_rt.c index 51befec57..82ae92642 100644 --- a/src/lc_droplet_rt.c +++ b/src/lc_droplet_rt.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * ****************************************************************************/ @@ -29,7 +29,7 @@ int fe_lc_droplet_run_time(pe_t * pe, rt_t * rt, fe_lc_droplet_t * fe) { int n; - fe_lc_droplet_param_t param = {}; + fe_lc_droplet_param_t param = {0}; assert(fe); diff --git a/src/ludwig.c b/src/ludwig.c index 7f26e5ca5..3d7599593 100644 --- a/src/ludwig.c +++ b/src/ludwig.c @@ -1282,7 +1282,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { strcmp(description, "symmetric_noise") == 0) { int use_stress_relaxation; - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * fe = NULL; /* Symmetric free energy via finite difference */ @@ -1405,7 +1405,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { /* Brazovskii (always finite difference). */ - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_brazovskii_t * fe = NULL; nf = 1; /* 1 scalar order parameter */ nhalo = 3; /* Required for stress diveregnce. */ @@ -1452,7 +1452,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { else if (strcmp(description, "surfactant") == 0) { fe_surf_param_t param; - ch_info_t options = {}; + ch_info_t options = {0}; fe_surf_t * fe = NULL; nf = 2; /* Composition, surfactant: "phi" and "psi" */ @@ -1511,7 +1511,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { else if (strcmp(description, "ternary") == 0) { fe_ternary_param_t param = {0}; - ch_info_t options = {}; + ch_info_t options = {0}; fe_ternary_t * fe = NULL; nf = 2; /* Composition, ternary: "phi" and "psi" */ @@ -1672,7 +1672,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { } else if(strcmp(description, "lc_droplet") == 0) { - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * symm = NULL; fe_lc_t * lc = NULL; fe_lc_droplet_t * fe = NULL; @@ -1818,7 +1818,7 @@ int free_energy_init_rt(ludwig_t * ludwig) { } else if(strcmp(description, "fe_electro_symmetric") == 0) { - phi_ch_info_t ch_options = {}; + phi_ch_info_t ch_options = {0}; fe_symm_t * fe_symm = NULL; fe_electro_t * fe_elec = NULL; fe_es_t * fes = NULL; @@ -2174,7 +2174,7 @@ int io_replace_values(field_t * field, map_t * map, int map_id, double value) { __host__ int ludwig_timekeeper_init(ludwig_t * ludwig) { - timekeeper_options_t opts = {}; + timekeeper_options_t opts = {0}; assert(ludwig); diff --git a/src/map.c b/src/map.c index c5ff3ed3e..b83cb3a15 100644 --- a/src/map.c +++ b/src/map.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -214,7 +214,7 @@ __host__ int map_memcpy(map_t * map, tdpMemcpyKind flag) { __host__ int map_init_io_info(map_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); size_t sz; assert(obj); diff --git a/src/map_init.c b/src/map_init.c index 914b9a1ae..02875adbd 100644 --- a/src/map_init.c +++ b/src/map_init.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 + * (c) 2021-2022 * * Contributing authors; * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -33,9 +33,9 @@ int map_init_status_circle_xy(map_t * map) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double x0, y0, r0; cs_t * cs = NULL; @@ -94,9 +94,9 @@ int map_init_status_circle_xy(map_t * map) { __host__ int map_init_status_wall(map_t * map, int id) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(id == X || id == Y || id == Z); @@ -145,8 +145,8 @@ __host__ int map_init_status_wall(map_t * map, int id) { int map_init_status_simple_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(map); @@ -194,8 +194,8 @@ int map_init_status_simple_cubic(map_t * map, int acell) { int map_init_status_body_centred_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double radius; assert(map); @@ -260,8 +260,8 @@ int map_init_status_body_centred_cubic(map_t * map, int acell) { int map_init_status_face_centred_cubic(map_t * map, int acell) { cs_t * cs = NULL; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double radius; assert(map); @@ -345,7 +345,7 @@ int map_init_status_print_section(map_t * map, int id, int ord) { pe_t * pe = NULL; cs_t * cs = NULL; - int nlocal[3] = {}; + int nlocal[3] = {0}; int status = -1; assert(map); @@ -428,7 +428,7 @@ int map_init_data_uniform(map_t * map, int target, double * data) { { cs_t * cs = map->cs; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nlocal(cs, nlocal); for (int ic = 1; ic <= nlocal[X]; ic++) { diff --git a/src/map_rt.c b/src/map_rt.c index b8d689d23..9f3203bdf 100644 --- a/src/map_rt.c +++ b/src/map_rt.c @@ -11,7 +11,7 @@ * Not to be confused with wall initialisations, which update * the map status, but are separate (see wall_rt.c). * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -79,7 +79,7 @@ int map_init_rt(pe_t * pe, cs_t * cs, rt_t * rt, map_t ** map) { * access to C, H, that is, ndata = 2 */ /* Colloids plus porous media is a non-feature at this time. */ - map_options_t options = {}; + map_options_t options = {0}; options.ndata = 2; map_init_options_parse(pe, cs, rt, &options); @@ -323,7 +323,7 @@ __host__ int map_init_option_acell(pe_t * pe, cs_t * cs, rt_t * rt) { } else { /* Check (and possibly fail) */ - int ntotal[3] = {}; + int ntotal[3] = {0}; cs_ntotal(cs, ntotal); if (acell < 1) pe_fatal(pe, "acell must be positive\n"); diff --git a/src/model.c b/src/model.c index 6ce70a597..7c438083e 100644 --- a/src/model.c +++ b/src/model.c @@ -89,7 +89,7 @@ int lb_data_create(pe_t * pe, cs_t * cs, const lb_data_options_t * options, { /* Allocate storage following cs specification */ int nhalo = 1; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nhalo(cs, &nhalo); cs_nlocal(cs, nlocal); @@ -358,7 +358,7 @@ __host__ int lb_init_rest_f(lb_t * lb, double rho0) { for (ic = 1; ic <= nlocal[X]; ic++) { for (jc = 1; jc <= nlocal[Y]; jc++) { for (kc = 1; kc <= nlocal[Z]; kc++) { - double u0[3] = {}; + double u0[3] = {0}; index = cs_index(lb->cs, ic, jc, kc); lb_1st_moment_equilib_set(lb, index, rho0, u0); @@ -1116,15 +1116,15 @@ int lb_halo_create(const lb_t * lb, lb_halo_t * h, lb_halo_enum_t scheme) { /* Determine look-up table of ranks of neighbouring processes */ { - int dims[3] = {}; - int periods[3] = {}; - int coords[3] = {}; + int dims[3] = {0}; + int periods[3] = {0}; + int coords[3] = {0}; MPI_Cart_get(h->comm, 3, dims, periods, coords); for (int p = 0; p < h->map.nvel; p++) { - int nbr[3] = {}; - int out[3] = {}; /* Out-of-range is erroneous for non-perioidic dims */ + int nbr[3] = {0}; + int out[3] = {0}; /* Out-of-range is erroneous for non-perioidic dims */ int i = 1 + h->map.cv[p][X]; int j = 1 + h->map.cv[p][Y]; int k = 1 + h->map.cv[p][Z]; diff --git a/src/noise.c b/src/noise.c index 696c90f5d..49b88e7b0 100644 --- a/src/noise.c +++ b/src/noise.c @@ -20,7 +20,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2013-2018 The University of Edinburgh + * (c) 2013-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -296,7 +296,7 @@ __host__ int noise_init_io_info(noise_t * obj, int grid[3], int form_in, const char * name = "Lattice noise RNG state"; const char * stubname = "noise"; - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); diff --git a/src/pe.c b/src/pe.c index 34b37d9f9..f9ab0310d 100644 --- a/src/pe.c +++ b/src/pe.c @@ -15,7 +15,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -130,7 +130,7 @@ __host__ int pe_free(pe_t * pe) { if (pe->nref <= 0) { MPI_Comm_free(&pe->comm); if (pe->unquiet) { - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "End time: %s", strctime); pe_info(pe, "Ludwig finished normally.\n"); @@ -161,14 +161,14 @@ __host__ int pe_message(pe_t * pe) { (pe->mpi_size == 1) ? "" : "es"); { - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "Start time: %s\n", strctime); /* Extra \n ! */ } if (pe->mpi_rank == 0) { - compiler_info_t compiler = {}; + compiler_info_t compiler = {0}; compiler_id(&compiler); @@ -375,7 +375,7 @@ __host__ int pe_time(char * str, int bufsiz) { strncpy(str, strdefault, strnlen(strdefault, bufsiz-1)); if (now != (time_t) -1) { - char buf[BUFSIZ] = {}; + char buf[BUFSIZ] = {0}; char * c_time = ctime_r(&now, buf); if (c_time != NULL) { strncpy(str, buf, strnlen(buf, bufsiz-1)); diff --git a/src/phi_bc_inflow_fixed.c b/src/phi_bc_inflow_fixed.c index 42202694c..a3081f47e 100644 --- a/src/phi_bc_inflow_fixed.c +++ b/src/phi_bc_inflow_fixed.c @@ -14,7 +14,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * ****************************************************************************/ @@ -89,8 +89,8 @@ __host__ int phi_bc_inflow_fixed_update(phi_bc_inflow_fixed_t * inflow, field_t * phi) { int id = -1; int nhalo = 0; - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(inflow); diff --git a/src/phi_bc_inflow_opts.c b/src/phi_bc_inflow_opts.c index 3e178ded4..95732824b 100644 --- a/src/phi_bc_inflow_opts.c +++ b/src/phi_bc_inflow_opts.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcced.ac.uk) @@ -24,7 +24,7 @@ phi_bc_inflow_opts_t phi_bc_inflow_opts_default(void) { - phi_bc_inflow_opts_t options = {}; /* Uninterestingly, NULL */ + phi_bc_inflow_opts_t options = {0}; /* Uninterestingly, NULL */ return options; } diff --git a/src/phi_bc_open_rt.c b/src/phi_bc_open_rt.c index e2392e001..00d9110b3 100644 --- a/src/phi_bc_open_rt.c +++ b/src/phi_bc_open_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -39,8 +39,8 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, phi_bc_open_t ** inflow, phi_bc_open_t ** outflow) { - int have_bc = 0; /* inflow/outflow required? */ - int flow[3] = {}; /* flow direction (one only, or none) */ + int have_bc = 0; /* inflow/outflow required? */ + int flow[3] = {0}; /* flow direction (one only, or none) */ assert(pe); assert(cs); @@ -51,8 +51,8 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, have_bc = rt_switch(rt, "phi_bc_open"); if (have_bc) { - int wall[3] = {}; - int periodic[3] = {}; + int wall[3] = {0}; + int periodic[3] = {0}; /* Take flow direction from non-wall direction */ @@ -77,7 +77,7 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, /* Inflow */ if (have_bc) { - char intype[BUFSIZ] = {}; + char intype[BUFSIZ] = {0}; double phib = -999.999; rt_string_parameter(rt, "phi_bc_inflow_type", intype, BUFSIZ); @@ -117,7 +117,7 @@ __host__ int phi_bc_open_rt(pe_t * pe, rt_t * rt, cs_t * cs, if (have_bc) { - char outtype[BUFSIZ] = {}; + char outtype[BUFSIZ] = {0}; rt_string_parameter(rt, "phi_bc_outflow_type", outtype, BUFSIZ); diff --git a/src/phi_bc_outflow_free.c b/src/phi_bc_outflow_free.c index bfebd50de..898b738ca 100644 --- a/src/phi_bc_outflow_free.c +++ b/src/phi_bc_outflow_free.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -92,9 +92,9 @@ __host__ int phi_bc_outflow_free_update(phi_bc_outflow_free_t * outflow, field_t * phi) { int id = -1; int nhalo = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; cs_t * cs = NULL; assert(outflow); diff --git a/src/phi_bc_outflow_opts.c b/src/phi_bc_outflow_opts.c index 30686a109..0beb6c525 100644 --- a/src/phi_bc_outflow_opts.c +++ b/src/phi_bc_outflow_opts.c @@ -2,6 +2,14 @@ * * phi_bc_outflow_opts.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -16,7 +24,7 @@ phi_bc_outflow_opts_t phi_bc_outflow_opts_default(void) { - phi_bc_outflow_opts_t options = {}; + phi_bc_outflow_opts_t options = {0}; return options; } diff --git a/src/phi_cahn_hilliard.c b/src/phi_cahn_hilliard.c index 4426a0e1c..dabe4a3ac 100644 --- a/src/phi_cahn_hilliard.c +++ b/src/phi_cahn_hilliard.c @@ -28,7 +28,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributions: * Thanks to Markus Gross, who helped to validate the noise implementation. @@ -1087,7 +1087,7 @@ static int phi_ch_subtract_sum_phi_after_forward_step(phi_ch_t * pch, field_t * kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; - phi_correct_t local = {}; + phi_correct_t local = {0}; phi_correct_t * local_d = NULL; assert(pch); @@ -1118,7 +1118,7 @@ static int phi_ch_subtract_sum_phi_after_forward_step(phi_ch_t * pch, field_t * { MPI_Comm comm = MPI_COMM_NULL; - phi_correct_t global = {}; + phi_correct_t global = {0}; cs_cart_comm(pch->cs, &comm); @@ -1169,7 +1169,7 @@ __global__ void phi_ch_csum_kernel(kernel_ctxt_t * ktx, lees_edw_t *le, for_simt_parallel(kindex, kiterations, 1) { - kahan_t phi = {}; + kahan_t phi = {0}; ic = kernel_coords_ic(ktx, kindex); jc = kernel_coords_jc(ktx, kindex); diff --git a/src/phi_force.c b/src/phi_force.c index 86b0cb061..ac64b580c 100644 --- a/src/phi_force.c +++ b/src/phi_force.c @@ -18,7 +18,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2011-2021 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -246,7 +246,7 @@ __host__ int phi_force_external_chemical_potential(cs_t * cs, field_t * phi, { int is_gradmu = 0; - double gradmu[3] = {}; + double gradmu[3] = {0}; physics_t * phys = NULL; physics_ref(&phys); diff --git a/src/phi_grad_mu.c b/src/phi_grad_mu.c index e3b076b80..90a6d375b 100644 --- a/src/phi_grad_mu.c +++ b/src/phi_grad_mu.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -133,7 +133,7 @@ __host__ int phi_grad_mu_external(cs_t * cs, field_t * phi, hydro_t * hydro) { int nlocal[3]; int is_grad_mu = 0; /* Short circuit the kernel if not required. */ dim3 nblk, ntpb; - double3 grad_mu = {}; + double3 grad_mu = {0}; kernel_info_t limits; kernel_ctxt_t * ctxt = NULL; @@ -146,7 +146,7 @@ __host__ int phi_grad_mu_external(cs_t * cs, field_t * phi, hydro_t * hydro) { { physics_t * phys = NULL; - double mu[3] = {}; + double mu[3] = {0}; physics_ref(&phys); physics_grad_mu(phys, mu); @@ -213,7 +213,7 @@ __global__ void phi_grad_mu_fluid_kernel(kernel_ctxt_t * ktx, field_t * phi, /* NVECTOR is max size of order parameter field as need fixed array[] */ assert(phi->nf <= NVECTOR); - double force[3] = {}; + double force[3] = {0}; double mum1[NVECTOR + 1]; /* Ugly gotcha: extra chemical potential */ double mup1[NVECTOR + 1]; /* may exist, but not required ... */ double phi0[NVECTOR]; /* E.g., in ternary implementation. */ @@ -302,9 +302,9 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int kc = kernel_coords_kc(ktx, kindex); int index0 = kernel_coords_index(ktx, ic, jc, kc); - double force[3] = {}; - double phi[NVECTOR] = {}; - double mu[NVECTOR+1] = {}; + double force[3] = {0}; + double phi[NVECTOR] = {0}; + double mu[NVECTOR+1] = {0}; field_scalar_array(field, index0, phi); fe->func->mu(fe, index0, mu); @@ -316,8 +316,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -348,8 +348,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -380,8 +380,8 @@ __global__ void phi_grad_mu_solid_kernel(kernel_ctxt_t * ktx, field_t * field, int mapm1 = MAP_FLUID; int mapp1 = MAP_FLUID; - double mum1[NVECTOR+1] = {}; - double mup1[NVECTOR+1] = {}; + double mum1[NVECTOR+1] = {0}; + double mup1[NVECTOR+1] = {0}; fe->func->mu(fe, indexm1, mum1); fe->func->mu(fe, indexp1, mup1); @@ -440,7 +440,7 @@ __global__ void phi_grad_mu_external_kernel(kernel_ctxt_t * ktx, field_t * phi, int kc = kernel_coords_kc(ktx, kindex); int index = kernel_coords_index(ktx, ic, jc, kc); - double force[3] = {}; + double force[3] = {0}; double phi0 = phi->data[addr_rank1(phi->nsites, 1, index, 0)]; force[X] = -phi0*grad_mu.x; diff --git a/src/psi.c b/src/psi.c index 48752c38f..978cb5927 100644 --- a/src/psi.c +++ b/src/psi.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2020 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -255,7 +255,7 @@ int psi_diffusivity(psi_t * obj, int n, double * diff) { int psi_init_io_info(psi_t * obj, int grid[3], int form_in, int form_out) { - io_info_args_t args = {}; + io_info_args_t args = io_info_args_default(); assert(obj); assert(grid); diff --git a/src/runtime.c b/src/runtime.c index 502c56e1f..0ab76a4d6 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -31,8 +31,9 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2010-2022 The University of Edinburgh + * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh * *****************************************************************************/ @@ -836,7 +837,7 @@ static int rt_look_up_key(rt_t * rt, const char * key, char * value) { int rt_key_required(rt_t * rt, const char * key, rt_enum_t level) { int ierr = 0; - char value[NKEY_LENGTH] = {}; + char value[NKEY_LENGTH] = {0}; assert(rt); assert(key); diff --git a/src/stats_colloid_force_split.c b/src/stats_colloid_force_split.c index 9f8d7127a..58b2c5369 100644 --- a/src/stats_colloid_force_split.c +++ b/src/stats_colloid_force_split.c @@ -9,7 +9,7 @@ * Edinburgh Soft Matter and Staticial Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Oliver Henrich (o.henrich@strath.ac.uk) @@ -136,7 +136,7 @@ int stats_colloid_force_split_output(colloids_info_t * cinfo, int timestep) { if (pe_mpi_rank(pe) > 0) { /* Send to root: a count, and a data buffer */ - MPI_Request req[2] = {}; + MPI_Request req[2] = {0}; MPI_Isend(&count, 1, MPI_INT, 0, 211129, comm, req + 0); MPI_Isend(buf, count*sz, MPI_CHAR, 0, 211130, comm, req + 1); @@ -147,7 +147,7 @@ int stats_colloid_force_split_output(colloids_info_t * cinfo, int timestep) { /* Root: output own, then those for everyone else */ - char filename[BUFSIZ] = {}; + char filename[BUFSIZ] = {0}; FILE * fp = NULL; sprintf(filename, "colloid-diag-%8.8d.dat", timestep); @@ -235,7 +235,7 @@ int stat_diagnostic_write(colloid_diagnostic_t * array, int count, int colloid_force_from_pth(colloid_t * pc, pth_t * pth, double f[3]) { - lb_model_t model = {}; + lb_model_t model = {0}; assert(pc); assert(pth); @@ -315,7 +315,7 @@ int stat_colloids_force(colloids_info_t * cinfo, pth_t * pth, int contrib) { int stat_stress_compute(pth_t * pth, fe_t * fe, fe_lc_str_ft stress) { - int nlocal[3] = {}; + int nlocal[3] = {0}; int nextra = 2; /* Kludge: Must be liquid crystal */ assert(pth); @@ -327,7 +327,7 @@ int stat_stress_compute(pth_t * pth, fe_t * fe, fe_lc_str_ft stress) { for (int jc = 1 - nextra; jc <= nlocal[Y] + nextra; jc++) { for (int kc = 1 - nextra; kc <= nlocal[Z] + nextra; kc++) { - double sth[3][3] = {}; + double sth[3][3] = {0}; int index = cs_index(pth->cs, ic, jc, kc); stress((fe_lc_t *) fe, index, sth); diff --git a/src/stats_distribution.c b/src/stats_distribution.c index 898e333df..59bbe8b74 100644 --- a/src/stats_distribution.c +++ b/src/stats_distribution.c @@ -11,7 +11,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -204,7 +204,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, /* Device memory for stats */ - kahan_t sum[3] = {}; + kahan_t sum[3] = {0}; kahan_t * sum_d = NULL; tdpAssert(tdpMalloc((void **) &sum_d, 3*sizeof(kahan_t))); @@ -233,7 +233,7 @@ __host__ int distribution_stats_momentum(lb_t * lb, map_t * map, int root, { MPI_Datatype dt = MPI_DATATYPE_NULL; MPI_Op op = MPI_OP_NULL; - kahan_t gmlocal[3] = {}; + kahan_t gmlocal[3] = {0}; kahan_mpi_datatype(&dt); kahan_mpi_op_sum(&op); diff --git a/src/subgrid.c b/src/subgrid.c index 42afc1ef2..e8cbbc3f3 100644 --- a/src/subgrid.c +++ b/src/subgrid.c @@ -169,8 +169,8 @@ int subgrid_force_from_particles(colloids_info_t * cinfo, hydro_t * hydro, hydro_f_local_add(hydro, index, force); } else { - double rd[3] = {}; - double torque[3] = {}; + double rd[3] = {0}; + double torque[3] = {0}; presolved->force[X] += force[X]; presolved->force[Y] += force[Y]; presolved->force[Z] += force[Z]; diff --git a/src/symmetric_rt.c b/src/symmetric_rt.c index d4dca3c28..2e51b3039 100644 --- a/src/symmetric_rt.c +++ b/src/symmetric_rt.c @@ -7,8 +7,9 @@ * Edinburgh Soft Matter and Statistical Physics Group * and Edinburgh Parallel Computing Centre * + * (c) 2010-2022 The University of Edinburgh + * * Kevin Stratford (kevin@epcc.ed.ac.uk) - * (c) 2010-2021 The University of Edinburgh * ****************************************************************************/ @@ -34,7 +35,7 @@ int fe_symmetric_init_rt(pe_t * pe, rt_t * rt, fe_symm_t * fe) { int old_keys = 0; double sigma; double xi; - fe_symm_param_t param = {}; + fe_symm_param_t param = {0}; assert(pe); assert(rt); diff --git a/src/timer.c b/src/timer.c index 795a13053..3f71da603 100644 --- a/src/timer.c +++ b/src/timer.c @@ -10,7 +10,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2010-2021 The University of Edinburgh + * (c) 2010-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -253,7 +253,7 @@ __host__ int timekeeper_create(pe_t * pe, const timekeeper_options_t * opts, assert(opts); assert(tk); - *tk = (timekeeper_t) {}; + *tk = (timekeeper_t) {0}; tk->pe = pe; tk->options = *opts; @@ -278,7 +278,7 @@ __host__ int timekeeper_step(timekeeper_t * tk) { if (tk->timestep % tk->options.lap_report_freq == 0) { /* Recell strctime from pe_time() has a new line */ pe_t * pe = tk->pe; - char strctime[BUFSIZ] = {}; + char strctime[BUFSIZ] = {0}; pe_time(strctime, BUFSIZ); pe_info(pe, "\nLap time at step %9d is: %8.3f seconds at %s", tk->timestep, timer_lapse(TIMER_LAP), strctime); @@ -298,7 +298,7 @@ __host__ int timekeeper_free(timekeeper_t * tk) { assert(tk); - *tk = (timekeeper_t) {}; + *tk = (timekeeper_t) {0}; return 0; } diff --git a/src/util_sum.c b/src/util_sum.c index 73bb4172d..ed9fe7b07 100644 --- a/src/util_sum.c +++ b/src/util_sum.c @@ -177,10 +177,10 @@ __host__ __device__ void klein_add(klein_t * sum, klein_t val) { __host__ int kahan_mpi_datatype(MPI_Datatype * type) { int blocklengths[3] = {1, 1, 1}; - MPI_Aint displacements[4] = {}; + MPI_Aint displacements[4] = {0}; MPI_Datatype types[3] = {MPI_INT, MPI_DOUBLE, MPI_DOUBLE}; - kahan_t sum = {}; + kahan_t sum = {0}; assert(type); @@ -252,10 +252,10 @@ __host__ int klein_mpi_datatype(MPI_Datatype * type) { int ierr = 0; int blocklengths[4] = {1, 1, 1, 1}; - MPI_Aint displacements[5] = {}; + MPI_Aint displacements[5] = {0}; MPI_Datatype types[4] = {MPI_INT, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE}; - klein_t sum = {}; + klein_t sum = {0}; assert(type); diff --git a/src/wall_ss_cut.c b/src/wall_ss_cut.c index 741de6fc0..b0fd24848 100644 --- a/src/wall_ss_cut.c +++ b/src/wall_ss_cut.c @@ -157,7 +157,7 @@ int wall_ss_cut_compute(colloids_info_t * cinfo, void * obj) { wall_ss_cut_t * self = (wall_ss_cut_t *) obj; - double forcewall[3] = {}; /* force on the wall for accounting */ + double forcewall[3] = {0}; /* force on the wall for accounting */ double lmin[3]; double ltot[3]; diff --git a/tests/unit/test_assumptions.c b/tests/unit/test_assumptions.c index fd607361e..5a51cb7d5 100644 --- a/tests/unit/test_assumptions.c +++ b/tests/unit/test_assumptions.c @@ -42,7 +42,7 @@ int test_macro_abuse(void); int test_assumptions_suite(void) { double pi; - char s0[BUFSIZ] = {}; + char s0[BUFSIZ] = {0}; char s1[BUFSIZ] = {0}; PI_DOUBLE(pi_); diff --git a/tests/unit/test_blue_phase.c b/tests/unit/test_blue_phase.c index fc8c41026..3fc20d8ba 100644 --- a/tests/unit/test_blue_phase.c +++ b/tests/unit/test_blue_phase.c @@ -247,7 +247,7 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, * so an exhaustive test is probably not worth while. */ { - double angles[3] = {}; /* No rotation. */ + double angles[3] = {0}; /* No rotation. */ blue_phase_O8M_init(cs, ¶m, fq, angles); } @@ -682,9 +682,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, * to test the decomposition into bulk and gradient parts */ { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 1; @@ -703,9 +703,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 2; @@ -724,9 +724,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 1; kc = 3; @@ -745,9 +745,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 1; jc = 12; kc = 4; @@ -766,9 +766,9 @@ int test_o8m_struct(pe_t * pe, cs_t * cs, lees_edw_t * le, fe_lc_t * fe, } { - double sfull[3][3] = {}; - double sbulk[3][3] = {}; - double sgrad[3][3] = {}; + double sfull[3][3] = {0}; + double sbulk[3][3] = {0}; + double sgrad[3][3] = {0}; ic = 2; jc = 6; kc = 7; diff --git a/tests/unit/test_build.c b/tests/unit/test_build.c index 99b0f5ca5..626fc3fff 100644 --- a/tests/unit/test_build.c +++ b/tests/unit/test_build.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2013-2017 The University of Edinburgh + * (c) 2013-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -110,7 +110,7 @@ static int test_build_links_model_c1(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {2, 2, 2}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; @@ -173,7 +173,7 @@ static int test_build_links_model_c2(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {4, 4, 4}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; @@ -246,7 +246,7 @@ static int test_build_rebuild_c1(pe_t * pe, cs_t * cs, int nvel, int ncell[3] = {2, 2, 2}; map_t * map = NULL; - lb_model_t model = {}; + lb_model_t model = {0}; colloid_t * pc = NULL; colloids_info_t * cinfo = NULL; diff --git a/tests/unit/test_fe_lc_droplet.c b/tests/unit/test_fe_lc_droplet.c index 62eff719a..fe95b2d23 100644 --- a/tests/unit/test_fe_lc_droplet.c +++ b/tests/unit/test_fe_lc_droplet.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -65,8 +65,8 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { double phi = 1.0; fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; - double q[3][3] = {}; - double s[3][3] = {}; + double q[3][3] = {0}; + double s[3][3] = {0}; fe_lc_droplet_active_stress(&fp, phi, q, s); @@ -92,7 +92,7 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; double q[3][3] = { {1., 2., 3.,}, {2., 4., 5.}, {3., 5., -3.} }; - double s[3][3] = {}; + double s[3][3] = {0}; fe_lc_droplet_active_stress(&fp, phi, q, s); @@ -117,7 +117,7 @@ __host__ int test_fe_lc_droplet_active_stress(pe_t * pe) { fe_lc_droplet_param_t fp = {.zeta0 = zeta0, .zeta1 = zeta1}; double q[3][3] = { {1., 1., 1.,}, {1., 1., 1.}, {1., 1., 1.} }; - double s[3][3] = {}; + double s[3][3] = {0}; double phi = -1.0; diff --git a/tests/unit/test_fe_surfactant1.c b/tests/unit/test_fe_surfactant1.c index 06d0943fd..cf681c51c 100644 --- a/tests/unit/test_fe_surfactant1.c +++ b/tests/unit/test_fe_surfactant1.c @@ -182,7 +182,6 @@ __host__ int test_fe_surf_fed(pe_t * pe, cs_t * cs, field_t * phi) { int index = 0; double psi, phisq, phipsi[2]; double fed, fedref; - double dphiref[2][3]; field_grad_t * dphi = NULL; fe_surf_t * fe = NULL; @@ -218,12 +217,15 @@ __host__ int test_fe_surf_fed(pe_t * pe, cs_t * cs, field_t * phi) { /* Interface: gradient in phi */ - dphiref[0][X] = 0.1; dphiref[0][Y] = 0.0; dphiref[0][Z] = 0.0; - field_grad_pair_grad_set(dphi, index, dphiref); + { + const double dphiref[2][3] = {{0.1,0.0,0.0}, {0.0,0.0,0.0}}; - fe_surf_fed(fe, index, &fed); - fedref += 0.5*(pref.kappa - pref.epsilon*psi)*dphiref[0][X]*dphiref[0][X]; - assert(fabs(fed - fedref) < TEST_DOUBLE_TOLERANCE); + field_grad_pair_grad_set(dphi, index, dphiref); + + fe_surf_fed(fe, index, &fed); + fedref += 0.5*(pref.kappa - pref.epsilon*psi)*dphiref[0][X]*dphiref[0][X]; + assert(fabs(fed - fedref) < TEST_DOUBLE_TOLERANCE); + } fe_surf_free(fe); field_grad_free(dphi); @@ -242,7 +244,7 @@ __host__ int test_fe_surf_mu(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double psi, phisq; double phipsi[2]; - double dpref[2][3], dsq[2]; + double dsq[2]; double muref, mu[2]; field_grad_t * dphi = NULL; @@ -269,41 +271,43 @@ __host__ int test_fe_surf_mu(pe_t * pe, cs_t * cs, field_t * phi) { test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); /* Gradients phi */ - dpref[0][X] = 0.0; dpref[0][Y] = 0.1; dpref[0][Z] = 0.0; - dpref[1][X] = 0.0; dpref[1][Y] = 0.0; dpref[1][Z] = 0.0; - dsq[0] = 0.0; dsq[1] = 0.0; + { + const double dpref[2][3] = {{0.0,0.1,0.0}, {0.0,0.0,0.0}}; + dsq[0] = 0.0; dsq[1] = 0.0; - field_grad_pair_grad_set(dphi, index, dpref); - field_grad_pair_delsq_set(dphi, index, dsq); + field_grad_pair_grad_set(dphi, index, dpref); + field_grad_pair_delsq_set(dphi, index, dsq); - fe_surf_mu(fe, index, mu); + fe_surf_mu(fe, index, mu); - muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0]; - test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); + muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0]; + test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); - muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq - - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; - test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq + - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; + test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + } /* Gradients phi, psi */ - dpref[0][X] = 0.0; dpref[0][Y] = 0.1; dpref[0][Z] = 0.0; - dpref[1][X] = 0.2; dpref[1][Y] = 0.3; dpref[1][Z] = 0.0; - dsq[0] = 0.0; dsq[1] = 0.0; + { + const double dpref[2][3] = {{0.0,0.1,0.0}, {0.2,0.3,0.0}}; + dsq[0] = 0.0; dsq[1] = 0.0; - field_grad_pair_grad_set(dphi, index, dpref); - field_grad_pair_delsq_set(dphi, index, dsq); + field_grad_pair_grad_set(dphi, index, dpref); + field_grad_pair_delsq_set(dphi, index, dsq); - fe_surf_mu(fe, index, mu); + fe_surf_mu(fe, index, mu); - muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0] - + pref.epsilon*dpref[0][Y]*dpref[1][Y]; - test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); + muref = (pref.a + pref.b*phisq + pref.w*psi)*phipsi[0] + + pref.epsilon*dpref[0][Y]*dpref[1][Y]; + test_assert(fabs(mu[0] - muref) < TEST_DOUBLE_TOLERANCE); - muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq - - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; - test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + muref = pref.kt*(log(psi) - log(1.0-psi)) + 0.5*pref.w*phisq + - 0.5*pref.epsilon*dpref[0][Y]*dpref[0][Y]; + test_assert(fabs(mu[1] - muref) < TEST_DOUBLE_TOLERANCE); + } fe_surf_free(fe); field_grad_free(dphi); diff --git a/tests/unit/test_fe_ternary.c b/tests/unit/test_fe_ternary.c index 419c78e98..46d367550 100644 --- a/tests/unit/test_fe_ternary.c +++ b/tests/unit/test_fe_ternary.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Phsyics Group and * Edinburgh Parallel Computing Centre * - * (c) 2019 The University of Edinburgh + * (c) 2019-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -127,7 +127,7 @@ __host__ int test_fe_ternary_fed(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; - double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; + const double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; double fed; assert(pe); @@ -169,7 +169,7 @@ __host__ int test_fe_ternary_mu(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; - double d2phi[2] = {0.1, 0.4}; + const double d2phi[2] = {0.1, 0.4}; double mu[3]; assert(pe); @@ -216,7 +216,7 @@ __host__ int test_fe_ternary_str(pe_t * pe, cs_t * cs, field_t * phi) { int index = 1; double phi0[2] = {-0.3, 0.7}; double d2phi[2] = {0.1, 0.4}; - double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; + const double grad[2][3] = {{0.1, -0.2, 0.3}, {-0.4, 0.5, -0.7}}; double s[3][3]; assert(pe); diff --git a/tests/unit/test_field.c b/tests/unit/test_field.c index dfa4cf50a..6660cb62c 100644 --- a/tests/unit/test_field.c +++ b/tests/unit/test_field.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2012-2021 The University of Edinburgh + * (c) 2012-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -453,7 +453,7 @@ int test_field_halo_create(pe_t * pe) { field_t * field = NULL; field_options_t opts = field_options_default(); - field_halo_t h = {}; + field_halo_t h = {0}; { int nhalo = 2; diff --git a/tests/unit/test_io_options.c b/tests/unit/test_io_options.c index dd14d1419..567ebc1f7 100644 --- a/tests/unit/test_io_options.c +++ b/tests/unit/test_io_options.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2020 The University of Edinburgh + * (c) 2020-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -111,7 +111,7 @@ __host__ int test_io_options_record_format_valid(void) { __host__ int test_io_options_metadata_version_valid(void) { - io_options_t opts = {}; + io_options_t opts = io_options_default(); int isvalid = 0; /* Wrong */ diff --git a/tests/unit/test_io_options_rt.c b/tests/unit/test_io_options_rt.c index 5a1036dc1..f02b71a82 100644 --- a/tests/unit/test_io_options_rt.c +++ b/tests/unit/test_io_options_rt.c @@ -8,7 +8,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2020 The University of Edinburgh + * (c) 2020-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -116,7 +116,7 @@ __host__ int test_io_options_rt_rformat(pe_t * pe) { __host__ int test_io_options_rt_default(pe_t * pe) { rt_t * rt = NULL; - io_options_t opts = {}; + io_options_t opts = io_options_default(); io_options_t defs = io_options_default(); assert(pe); @@ -148,7 +148,7 @@ __host__ int test_io_options_rt_default(pe_t * pe) { __host__ int test_io_options_rt(pe_t * pe) { rt_t * rt = NULL; - io_options_t opts = {}; + io_options_t opts = io_options_default(); assert(pe); diff --git a/tests/unit/test_lb_bc_inflow_opts.c b/tests/unit/test_lb_bc_inflow_opts.c index f10743536..deae12771 100644 --- a/tests/unit/test_lb_bc_inflow_opts.c +++ b/tests/unit/test_lb_bc_inflow_opts.c @@ -6,7 +6,7 @@ * Edinburgh Solft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -129,7 +129,7 @@ __host__ int test_lb_bc_inflow_opts_valid(void) { } { - lb_bc_inflow_opts_t options = {}; /* Not valid */ + lb_bc_inflow_opts_t options = {0}; /* Not valid */ ierr = lb_bc_inflow_opts_valid(options); assert(ierr == 0); diff --git a/tests/unit/test_lb_bc_inflow_rhou.c b/tests/unit/test_lb_bc_inflow_rhou.c index 78a49d522..20441030e 100644 --- a/tests/unit/test_lb_bc_inflow_rhou.c +++ b/tests/unit/test_lb_bc_inflow_rhou.c @@ -2,13 +2,13 @@ * * test_lb_bc_inflow_rhou.c * - * (c) 2021 The University of Edinburgh - * * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2021-2022 The University of Edinburgh + * * Contributing authors: - * Kevin Stratford (kevin@epcc.ed.ac.uk) + * Kevin Stratford (kevin@epcc.ed.ac.uk) * *****************************************************************************/ @@ -104,8 +104,8 @@ __host__ int test_lb_bc_inflow_rhou_create(pe_t * pe, cs_t * cs) { __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; double rho0 = 2.0; lb_bc_inflow_opts_t options = {.nvel = nvel, @@ -155,7 +155,7 @@ __host__ int test_lb_bc_inflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { for (int kc = limits.kmin; kc <= limits.kmax; kc++) { int index = cs_index(cs, ic, jc, kc); double rho = 0.0; - double u[3] = {}; + double u[3] = {0}; hydro_rho(hydro, index, &rho); hydro_u(hydro, index, u); @@ -186,9 +186,9 @@ __host__ int test_lb_bc_inflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { int ierr = 0; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; double rho0 = 1.0; diff --git a/tests/unit/test_lb_bc_outflow_rhou.c b/tests/unit/test_lb_bc_outflow_rhou.c index a544f57ba..e557aa9e3 100644 --- a/tests/unit/test_lb_bc_outflow_rhou.c +++ b/tests/unit/test_lb_bc_outflow_rhou.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -93,9 +93,9 @@ __host__ int test_lb_bc_outflow_rhou_create(pe_t * pe, cs_t * cs) { __host__ int test_lb_bc_outflow_rhou_update(pe_t * pe, cs_t * cs, int nvel) { - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; lb_bc_outflow_opts_t options = {.nvel = nvel, .flow = {0, 1, 0}, @@ -153,9 +153,9 @@ __host__ int test_lb_bc_outflow_rhou_impose(pe_t * pe, cs_t * cs, int nvel) { int ierr = 0; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; lb_bc_outflow_opts_t options = {.nvel = nvel, .flow = {0, 0, 1}, diff --git a/tests/unit/test_lb_d2q9.c b/tests/unit/test_lb_d2q9.c index 5c78a2994..b5ae52155 100644 --- a/tests/unit/test_lb_d2q9.c +++ b/tests/unit/test_lb_d2q9.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -52,7 +52,7 @@ __host__ int test_lb_d2q9_suite(void) { __host__ int test_lb_d2q9_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d2q9_create(&model); diff --git a/tests/unit/test_lb_d3q15.c b/tests/unit/test_lb_d3q15.c index 8a9861abf..472d628ba 100644 --- a/tests/unit/test_lb_d3q15.c +++ b/tests/unit/test_lb_d3q15.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -51,7 +51,7 @@ __host__ int test_lb_d3q15_suite(void) { __host__ int test_lb_d3q15_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d3q15_create(&model); diff --git a/tests/unit/test_lb_d3q19.c b/tests/unit/test_lb_d3q19.c index 091b755e2..335cb7248 100644 --- a/tests/unit/test_lb_d3q19.c +++ b/tests/unit/test_lb_d3q19.c @@ -6,7 +6,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2021 The University of Edinburgh + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -58,7 +58,7 @@ __host__ int test_lb_d3q19_suite(void) { __host__ int test_lb_d3q19_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d3q19_create(&model); diff --git a/tests/unit/test_lb_d3q27.c b/tests/unit/test_lb_d3q27.c index 5f2b475d9..df2d8fa5f 100644 --- a/tests/unit/test_lb_d3q27.c +++ b/tests/unit/test_lb_d3q27.c @@ -51,7 +51,7 @@ __host__ int test_lb_d3q27_suite(void) { __host__ int test_lb_d3q27_create(void) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_d3q27_create(&model); diff --git a/tests/unit/test_lb_model.c b/tests/unit/test_lb_model.c index f2ae71a90..a3cd88dd4 100644 --- a/tests/unit/test_lb_model.c +++ b/tests/unit/test_lb_model.c @@ -78,7 +78,7 @@ int test_lb_model_nhydro(void) { int test_lb_model_create(int nvel) { - lb_model_t model = {}; + lb_model_t model = {0}; lb_model_create(nvel, &model); @@ -114,7 +114,7 @@ int test_lb_model_cv(const lb_model_t * model) { /* Check \sum_p cv_pa = 0 */ { - int8_t sum[3] = {}; + int8_t sum[3] = {0}; for (int p = 0; p < model->nvel; p++) { sum[X] += model->cv[p][X]; @@ -155,7 +155,7 @@ int test_lb_model_wv(const lb_model_t * model) { { double sumwv = 0.0; - double sumcv[3] = {}; + double sumcv[3] = {0}; for (int p = 0; p < model->nvel; p++) { sumwv += model->wv[p]; diff --git a/tests/unit/test_map_init.c b/tests/unit/test_map_init.c index 693469efe..54399060a 100644 --- a/tests/unit/test_map_init.c +++ b/tests/unit/test_map_init.c @@ -4,7 +4,10 @@ * * Test of map initialisations is relevant. * - * (c) 2021 The University of Edinburgh + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Comuting Centre + * + * (c) 2021-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -85,8 +88,8 @@ int test_map_init_status_wall(pe_t * pe) { int test_map_init_status_wall_x(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -145,9 +148,9 @@ int test_map_init_status_wall_x(pe_t * pe, cs_t * cs) { int test_map_init_status_wall_y(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -192,9 +195,9 @@ int test_map_init_status_wall_y(pe_t * pe, cs_t * cs) { int test_map_init_status_wall_z(pe_t * pe, cs_t * cs) { - int ntotal[3] = {}; - int nlocal[3] = {}; - int noffset[3] = {}; + int ntotal[3] = {0}; + int nlocal[3] = {0}; + int noffset[3] = {0}; assert(pe); assert(cs); @@ -267,8 +270,8 @@ int test_map_init_status_circle_odd(pe_t * pe) { { /* All the edges at least should be solid (no 'leaks') */ - int noffset[3] = {}; - int nlocal[3] = {}; + int noffset[3] = {0}; + int nlocal[3] = {0}; int status1 = -1; int status2 = -1; diff --git a/tests/unit/test_model.c b/tests/unit/test_model.c index 19b7fd6ae..7a8bc3cd2 100644 --- a/tests/unit/test_model.c +++ b/tests/unit/test_model.c @@ -49,12 +49,12 @@ static int test_model_is_domain(cs_t * cs, int ic, int jc, int kc); int64_t lb_data_index(lb_t * lb, int ic, int jc, int kc, int p) { int64_t index = INT64_MIN; - int64_t nall[3] = {}; - int64_t nstr[3] = {}; + int64_t nall[3] = {0}; + int64_t nstr[3] = {0}; int64_t pstr = 0; - int ntotal[3] = {}; - int offset[3] = {}; + int ntotal[3] = {0}; + int offset[3] = {0}; int nhalo = 0; assert(lb); @@ -105,7 +105,7 @@ int64_t lb_data_index(lb_t * lb, int ic, int jc, int kc, int p) { int util_lb_data_check_set(lb_t * lb) { - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(lb); @@ -139,7 +139,7 @@ int util_lb_data_check(lb_t * lb, int full) { int ifail = 0; int nh = 1; int nhk = nh; - int nlocal[3] = {}; + int nlocal[3] = {0}; assert(lb); @@ -205,7 +205,7 @@ int test_lb_halo_post_wait(pe_t * pe, cs_t * cs, int ndim, int nvel, int full) { util_lb_data_check_set(lb); { - lb_halo_t h = {}; + lb_halo_t h = {0}; lb_halo_create(lb, &h, LB_HALO_OPENMP_FULL); lb_halo_post(lb, &h); lb_halo_wait(lb, &h); diff --git a/tests/unit/test_pair_ss_cut.c b/tests/unit/test_pair_ss_cut.c index a91890774..2bcb8d98d 100644 --- a/tests/unit/test_pair_ss_cut.c +++ b/tests/unit/test_pair_ss_cut.c @@ -5,7 +5,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2014-2021 The University of Edinburgh + * (c) 2014-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) diff --git a/tests/unit/test_pair_ss_cut_ij.c b/tests/unit/test_pair_ss_cut_ij.c index f1afd6709..27aa306ae 100644 --- a/tests/unit/test_pair_ss_cut_ij.c +++ b/tests/unit/test_pair_ss_cut_ij.c @@ -2,6 +2,11 @@ * * test_pair_ss_cut_ij.c * + * Edinburgh Soft Matter and Statictical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -57,10 +62,10 @@ int test_pair_ss_cut_ij_create(pe_t * pe, cs_t * cs) { pair_ss_cut_ij_t * obj = NULL; - double epsilon[2] = {}; - double sigma[2] = {}; - double nu[2] = {}; - double hc[2] = {}; + double epsilon[2] = {0}; + double sigma[2] = {0}; + double nu[2] = {0}; + double hc[2] = {0}; pair_ss_cut_ij_create(pe, cs, 2, epsilon, sigma, nu, hc, &obj); assert(obj); diff --git a/tests/unit/test_phi_bc_inflow_fixed.c b/tests/unit/test_phi_bc_inflow_fixed.c index 943d0db4e..bf38e9081 100644 --- a/tests/unit/test_phi_bc_inflow_fixed.c +++ b/tests/unit/test_phi_bc_inflow_fixed.c @@ -2,6 +2,14 @@ * * test_phi_bc_inflow_fixed.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -77,7 +85,7 @@ __host__ int test_phi_bc_inflow_fixed_create(pe_t * pe, cs_t * cs) { __host__ int test_phi_bc_inflow_fixed_update(pe_t * pe, cs_t * cs) { - int noffset[3] = {}; + int noffset[3] = {0}; phi_bc_inflow_opts_t options = {.phi0 = 999.999, .flow = {1,0,0}}; phi_bc_inflow_fixed_t * inflow = NULL; @@ -102,7 +110,7 @@ __host__ int test_phi_bc_inflow_fixed_update(pe_t * pe, cs_t * cs) { if (noffset[X] == 0) { /* Check x-inflow region */ int nhalo = 0; - int nlocal[3] = {}; + int nlocal[3] = {0}; cs_nhalo(cs, &nhalo); cs_nlocal(cs, nlocal); diff --git a/tests/unit/test_phi_bc_outflow_free.c b/tests/unit/test_phi_bc_outflow_free.c index e41ebecf3..cc9f363ff 100644 --- a/tests/unit/test_phi_bc_outflow_free.c +++ b/tests/unit/test_phi_bc_outflow_free.c @@ -2,6 +2,14 @@ * * test_phi_bc_outflow_free.c * + * Edinburgh Soft Matter and Statistical Physics Group and + * Edinburgh Parallel Computing Centre + * + * (c) 2022 The University of Edinburgh + * + * Contributing authors: + * Kevin Stratford (kevin@epcc.ed.ac.uk) + * *****************************************************************************/ #include @@ -77,9 +85,9 @@ __host__ int test_phi_bc_outflow_free_create(pe_t * pe, cs_t * cs) { __host__ int test_phi_bc_outflow_free_update(pe_t * pe, cs_t * cs) { int nhalo = -1; - int nlocal[3] = {}; - int ntotal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int ntotal[3] = {0}; + int noffset[3] = {0}; phi_bc_outflow_opts_t options = {.flow = {1,0,0}}; phi_bc_outflow_free_t * outflow = NULL; diff --git a/tests/unit/test_runtime.c b/tests/unit/test_runtime.c index 20023d51c..f868e8324 100644 --- a/tests/unit/test_runtime.c +++ b/tests/unit/test_runtime.c @@ -7,7 +7,7 @@ * Edinburgh Soft Matter and Statistical Physics Group and * Edinburgh Parallel Computing Centre * - * (c) 2011-2021 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) @@ -242,7 +242,7 @@ int test_rt_nvector(pe_t * pe) { rt_add_key_value(rt, "bad_val", "1_x"); { - int i2[2] = {}; + int i2[2] = {0}; key_ret = rt_int_nvector(rt, "ki2", 2, i2, RT_NONE); assert(key_ret == 0); assert(i2[0] == 1); @@ -250,13 +250,13 @@ int test_rt_nvector(pe_t * pe) { } { - int i3[3] = {}; + int i3[3] = {0}; key_ret = rt_int_nvector(rt, "ki2", 3, i3, RT_NONE); /* Wrong length */ assert(key_ret != 0); } { - double v4[4] = {}; + double v4[4] = {0}; key_ret = rt_double_nvector(rt, "kd4", 4, v4, RT_NONE); assert(key_ret == 0); assert(fabs(v4[0] - 1.0) < DBL_EPSILON); @@ -266,7 +266,7 @@ int test_rt_nvector(pe_t * pe) { } { - int i2[2] = {}; + int i2[2] = {0}; key_ret = rt_int_nvector(rt, "bad_val", 2, i2, RT_NONE); /* bad value */ assert(key_ret != 0); diff --git a/util/capillary.c b/util/capillary.c index a0de78d95..59e17c947 100644 --- a/util/capillary.c +++ b/util/capillary.c @@ -11,11 +11,11 @@ * The output should be capillary.dat [for human consumption] * capillary.001-001 [for initial input to run] * - * (c) 2008-2021 The University of Edinburgh - * * Edinburgh Soft Matter and Statistcal Physics Group and * Edinburgh Parallel Computing Centre * + * (c) 2008-2022 The University of Edinburgh + * * Contributing authors: * Kevin Stratford (kevin@epcc.ed.ac.uk) * @@ -225,8 +225,8 @@ int main(int argc, char ** argv) { map_init_status_wall(map, X); { - int nlocal[3] = {}; - int noffset[3] = {}; + int nlocal[3] = {0}; + int noffset[3] = {0}; cs_nlocal(cs, nlocal); cs_nlocal_offset(cs, noffset); if (noffset[X] == 0) { @@ -318,7 +318,7 @@ int map_special_cross(map_t * map) { const int w = 5; const int w_arm = 4; - int nlocal[3] = {}; + int nlocal[3] = {0}; int x0, x1, j0, j1; cs_t * cs = NULL; @@ -398,7 +398,7 @@ int map_special_cross(map_t * map) { int map_xwall_obstacles(map_t * map, double sigma) { cs_t * cs = NULL; - int nlocal[3] = {}; + int nlocal[3] = {0}; int obst_start[2*obstacle_number][3]; int obst_stop[2*obstacle_number][3]; @@ -536,7 +536,7 @@ int capillary_write_ascii_serial(pe_t * pe, cs_t * cs, map_t * map) { const char * filename = "capillary.dat"; - int nlocal[3] = {}; + int nlocal[3] = {0}; FILE * fp = NULL; assert(pe); diff --git a/util/extract.c b/util/extract.c index 8b956cfa9..bde00fd79 100644 --- a/util/extract.c +++ b/util/extract.c @@ -47,7 +47,7 @@ * Kevin Stratford (kevin@epcc.ed.ac.uk) * Oliver Henrich (oliver.henrich@strath.ac.uk) * - * (c) 2011-2020 The University of Edinburgh + * (c) 2011-2022 The University of Edinburgh * ****************************************************************************/ @@ -310,7 +310,7 @@ int extract_driver(const char * filename, metadata_v1_t * meta, int version) { /* Write a single file with the final section */ { - char tmp[FILENAME_MAX/2] = {}; /* Avoid potential buffer overflow */ + char tmp[FILENAME_MAX/2] = {0}; /* Avoid potential buffer overflow */ strncpy(tmp, meta->stub, FILENAME_MAX/2 - strnlen(meta->stub, FILENAME_MAX/2-1) - 1); snprintf(io_data, sizeof(io_data), "%s-%8.8d", tmp, ntime);