Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
tutorials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documentation
tutorials
Commits
342fabe7
There was a problem fetching the pipeline summary.
Commit
342fabe7
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
up
parent
8f25df53
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Magnetostatics/electromagnet.pro
+14
-0
14 additions, 0 deletions
Magnetostatics/electromagnet.pro
PendulumPython/pend.py
+11
-7
11 additions, 7 deletions
PendulumPython/pend.py
with
25 additions
and
7 deletions
Magnetostatics/electromagnet.pro
+
14
−
0
View file @
342fabe7
...
@@ -108,14 +108,28 @@ Group {
...
@@ -108,14 +108,28 @@ Group {
Function
{
Function
{
mu0
=
4.e-7
*
Pi
;
mu0
=
4.e-7
*
Pi
;
/* New ONELAB variables can then be defined using defineNumber, e.g.: */
murCore
=
DefineNumber
[
100
,
Name
"Model parameters/Mur core"
,
murCore
=
DefineNumber
[
100
,
Name
"Model parameters/Mur core"
,
Help
"Magnetic relative permeability of 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
[
Region
[{
Air
,
Ind
,
AirInf
}]
]
=
1.
/
mu0
;
nu
[
Core
]
=
1.
/
(
murCore
*
mu0
);
nu
[
Core
]
=
1.
/
(
murCore
*
mu0
);
Current
=
DefineNumber
[
0.01
,
Name
"Model parameters/Current"
,
Current
=
DefineNumber
[
0.01
,
Name
"Model parameters/Current"
,
Help
"Current injected in coil [A]"
];
Help
"Current injected in coil [A]"
];
NbTurns
=
1000
;
// number of turns in the coil
NbTurns
=
1000
;
// number of turns in the coil
js_fct
[
Ind
]
=
-
NbTurns
*
Current
/
SurfaceArea
[];
js_fct
[
Ind
]
=
-
NbTurns
*
Current
/
SurfaceArea
[];
/* The minus sign is to have the current in -e_z direction,
/* The minus sign is to have the current in -e_z direction,
...
...
This diff is collapsed.
Click to expand it.
PendulumPython/pend.py
+
11
−
7
View file @
342fabe7
...
@@ -43,6 +43,16 @@ m = 0.3 # mass of pendulum balls
...
@@ -43,6 +43,16 @@ m = 0.3 # mass of pendulum balls
# New ONELAB variables can then be defined using defineNumber, e.g.:
# New ONELAB variables can then be defined using defineNumber, e.g.:
l
=
c
.
defineNumber
(
'
Geom/arm length [m]
'
,
value
=
1.0
)
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
)
time
=
c
.
defineNumber
(
'
Dyna/time [s]
'
,
value
=
0.0
)
dt
=
c
.
defineNumber
(
'
Dyna/time step [s]
'
,
value
=
0.001
)
dt
=
c
.
defineNumber
(
'
Dyna/time step [s]
'
,
value
=
0.001
)
tmax
=
c
.
defineNumber
(
'
Dyna/max time [s]
'
,
value
=
20
)
tmax
=
c
.
defineNumber
(
'
Dyna/max time [s]
'
,
value
=
20
)
...
@@ -52,13 +62,7 @@ theta0 = c.defineNumber('Init/initial theta angle [deg]', value=10,
...
@@ -52,13 +62,7 @@ theta0 = c.defineNumber('Init/initial theta angle [deg]', value=10,
phi0
=
c
.
defineNumber
(
'
Init/initial phi angle [deg]
'
,
value
=
180
,
phi0
=
c
.
defineNumber
(
'
Init/initial phi angle [deg]
'
,
value
=
180
,
attributes
=
{
'
Highlight
'
:
'
Pink
'
})
attributes
=
{
'
Highlight
'
:
'
Pink
'
})
# When the script is run, if the parameter Geom/arm length [m] has not been
# When Gmsh runs a ONELAB client, the client can be run in two modes:
# 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:
# c.action=='check' to check the coherence of the ONELAB database and make
# c.action=='check' to check the coherence of the ONELAB database and make
# adjustments if necessary, and c.action=='compute' to perform the actual
# adjustments if necessary, and c.action=='compute' to perform the actual
# computation. For instance, in 'check' mode, the double pendulum client simply
# computation. For instance, in 'check' mode, the double pendulum client simply
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment