From 8fa30c0db1ef0c7dcd7880fc2ba35589390e56db Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 1 Jul 2014 15:25:25 +0000 Subject: [PATCH] Properly important the Python 'math' module, and use it. In particular, I can use math.cos in the initial values. [[Imported from SVN: r9808]] --- cosserat-continuum-wong-pellegrino-wrinkling.parset | 4 +--- cosserat-continuum.cc | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cosserat-continuum-wong-pellegrino-wrinkling.parset b/cosserat-continuum-wong-pellegrino-wrinkling.parset index 6e911f02..bb02f57c 100644 --- a/cosserat-continuum-wong-pellegrino-wrinkling.parset +++ b/cosserat-continuum-wong-pellegrino-wrinkling.parset @@ -90,6 +90,4 @@ kappa = 1 dirichletVerticesPredicate = "x[1] < 0.0001 or x[1] > 0.128 - 0.0001" # Initial deformation -#initialDeformation = "[x[0], x[1], 0.002*cos(1e4*x[0])]" -# Series expansion of the cosine, because I haven't figured out how to use math stuff in dunepython yet -initialDeformation = "[x[0], x[1], 1e-15*(1- 0.5*(1e4*x[0])*(1e4*x[0]) + (1.0/24)*(1e4*x[0])*(1e4*x[0])*(1e2*x[0])*(1e4*x[0]))]" +initialDeformation = "[x[0], x[1], 0.002*math.cos(1e4*x[0])]" diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc index e4a14226..f9d529d7 100644 --- a/cosserat-continuum.cc +++ b/cosserat-continuum.cc @@ -171,6 +171,7 @@ int main (int argc, char *argv[]) try // Start Python interpreter Python::start(); Python::Reference main = Python::import("__main__"); + Python::run("import math"); //feenableexcept(FE_INVALID); -- GitLab