aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-01-13 13:51:27 +0100
committerAnton Khirnov <anton@khirnov.net>2019-01-13 13:51:27 +0100
commit685f204c329a59ae2245fa55b8639da73877f39d (patch)
treeebdd393fd11bb1783dc7bdba5e0fc80454c913cb
parentfe66d06cddc60124eb7cd6ba251749432a47111c (diff)
mg2d: make the cfl factor runtime-configurable
-rw-r--r--libmg2d.v2
-rw-r--r--mg2d.c1
-rw-r--r--mg2d.h5
3 files changed, 7 insertions, 1 deletions
diff --git a/libmg2d.v b/libmg2d.v
index e4b7b24..a51d313 100644
--- a/libmg2d.v
+++ b/libmg2d.v
@@ -1,4 +1,4 @@
-LIBMG2D_2 {
+LIBMG2D_3 {
global: mg2d_*;
local: *;
};
diff --git a/mg2d.c b/mg2d.c
index cc75a6e..f64e0ae 100644
--- a/mg2d.c
+++ b/mg2d.c
@@ -421,6 +421,7 @@ static int mg_levels_init(MG2DContext *ctx)
cur->solver->cpuflags = priv->cpuflags;
cur->solver->fd_stencil = ctx->fd_stencil;
+ cur->solver->relax_factor = ctx->cfl_factor;
prev = cur;
cur = cur->child;
diff --git a/mg2d.h b/mg2d.h
index c487215..f697b76 100644
--- a/mg2d.h
+++ b/mg2d.h
@@ -267,6 +267,11 @@ typedef struct MG2DContext {
* Set to 0 to autodetect. Defaults to 1.
*/
unsigned int nb_threads;
+
+ /**
+ * Time-stepping factor to use for relaxation.
+ */
+ double cfl_factor;
} MG2DContext;
/**