Skip to content
Snippets Groups Projects
Commit 342fabe7 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

up

parent 8f25df53
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -108,14 +108,28 @@ Group {
Function {
mu0 = 4.e-7 * Pi;
/* New ONELAB variables can then be defined using defineNumber, e.g.: */
murCore = DefineNumber[100, Name "Model parameters/Mur core",
Help "Magnetic relative permeability of Core"];
/* When the script is run, if the parameter named "Model parameters/Mur core"
has not been previously defined, it takes the value (100) provided in
defineNumber and is sent to the ONELAB server. The "/" character in the
variable name is interpreted as a path separator, and results in the
creation of a sub-tree in the graphical user interface. If the script is
re-run later, the value will be updated using the value from the server
(unless it is labeled as "ReadOnly").
Various attributes can be specified for ONELAB parameters: see
https://gitlab.onelab.info/doc/tutorials/wikis/ONELAB-syntax-for-Gmsh-and-GetDP */
nu [ Region[{Air, Ind, AirInf}] ] = 1. / mu0;
nu [ Core ] = 1. / (murCore * mu0);
Current = DefineNumber[0.01, Name "Model parameters/Current",
Help "Current injected in coil [A]"];
NbTurns = 1000 ; // number of turns in the coil
js_fct[ Ind ] = -NbTurns*Current/SurfaceArea[];
/* The minus sign is to have the current in -e_z direction,
......
......@@ -43,6 +43,16 @@ m = 0.3 # mass of pendulum balls
# New ONELAB variables can then be defined using defineNumber, e.g.:
l = c.defineNumber('Geom/arm length [m]', value=1.0)
# When the script is run, if the parameter named "Geom/arm length [m]" has not
# been previously defined, it takes the value (1.0) provided in defineNumber and
# is sent to the ONELAB server. The "/" character in the variable name is
# interpreted as a path separator, and results in the creation of a sub-tree in
# the graphical user interface. If the script is re-run later, the value will be
# updated using the value from the server (unless it is labeled as 'readOnly').
# Other ONELAB parameters are defined in the same way. Various attributes can be
# set: see https://gitlab.onelab.info/doc/tutorials/wikis/ONELAB-syntax-for-Python
time = c.defineNumber('Dyna/time [s]', value=0.0)
dt = c.defineNumber('Dyna/time step [s]', value=0.001)
tmax = c.defineNumber('Dyna/max time [s]', value=20)
......@@ -52,13 +62,7 @@ theta0 = c.defineNumber('Init/initial theta angle [deg]', value=10,
phi0 = c.defineNumber('Init/initial phi angle [deg]', value=180,
attributes={'Highlight':'Pink'})
# When the script is run, if the parameter Geom/arm length [m] has not been
# previously defined, it takes the value (1.0) provided in defineNumber and is
# sent to the ONELAB server. The "/" character in the variable name is
# interpreted as a path separator, and results in the creation of a sub-tree in
# the graphical user interface. If the script is re-run later, the value will be
# updated using the value from the server (unless it is labeled as readOnly: see
# below). When Gmsh runs a ONELAB client, the client can be run in two modes:
# When Gmsh runs a ONELAB client, the client can be run in two modes:
# c.action=='check' to check the coherence of the ONELAB database and make
# adjustments if necessary, and c.action=='compute' to perform the actual
# computation. For instance, in 'check' mode, the double pendulum client simply
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment