documentation issueshttps://gitlab.onelab.info/groups/doc/-/issues2024-02-24T23:39:55Zhttps://gitlab.onelab.info/doc/tutorials/-/issues/26Sharing parameters between PY and PRO2024-02-24T23:39:55ZTommy ASharing parameters between PY and PRODear Developers and Users,
I'm looking for a way to share parameters between a PY file and a PRO file without using gmsh GUI.
I create a geometry and mesh through python API of Gmsh, i.e., by running `python geometry.py`.
Then, I r...Dear Developers and Users,
I'm looking for a way to share parameters between a PY file and a PRO file without using gmsh GUI.
I create a geometry and mesh through python API of Gmsh, i.e., by running `python geometry.py`.
Then, I run `getdp main.pro -msh MESH.msh ...` to run a solver and output results. All work fine.
My problem is as the following:
I have a bulky set of parameters defined in `geometry.py`, for example `freq = 3e9` and so on. These parameters are also used in `main.pro`, so, for now, I just copy&paste the relevant portion of codes from the PY file to PRO.
What is a good way to share all these parameters between codes ?
Refering to this tutorial wiki ([ONELAB-onelab.py-module](https://gitlab.onelab.info/doc/tutorials/-/wikis/ONELAB-onelab.py-module) and [ONELAB-syntax-for-Gmsh-and-GetDP](https://gitlab.onelab.info/doc/tutorials/-/wikis/ONELAB-syntax-for-Gmsh-and-GetDP)), I tried to make use of ONELAB.py.
Simplified codes are shown below, attempting to share a parameter `freq` but no success.
```py
"""geometry.py"""
import onelab
c = onelab.client(__file__)
c.defineNumber("freq", value=3e9) # or c.setNumber("freq", value=3e9)
c.run(name="geometry", command="getdp main.pro")
```
```pro
// main.pro
DefineConstant [ freq = { 1, Name "freq" }]; // I want to update this value programmatically
Printf("FREQ: %f", freq); // this returns "Freq: 1.000000"
```
Then, from a terminal I can run the above two codes.
```sh
>> python geometry.py
```
I have a feeling that I'm using an onelab client in a wrong way. Could someone please enlighten me? Thank you so much in advance.
On a side note, if I use GEO scripts (.geo) than python scripts to generate a geometry, I don't have a problem because GEO scripts can be included in a PRO file and all parameters are shared.
The versions I use:
GetDP 3.5.0
Gmsh 4.12.2
on Windows 11.
Tomhttps://gitlab.onelab.info/doc/tutorials/-/issues/25Magnetic field calculation of a permanent magnet with a nonlinear demagnetiza...2023-12-04T10:27:04ZBertold FroehlichMagnetic field calculation of a permanent magnet with a nonlinear demagnetization curveI try to calculate a magnetic field of a permanent magnet with a nonlinear demagnetization curve. I am using the template magnets.pro and an interpolated function instead of a constant mu, nu, as given in the template. As arguments for t...I try to calculate a magnetic field of a permanent magnet with a nonlinear demagnetization curve. I am using the template magnets.pro and an interpolated function instead of a constant mu, nu, as given in the template. As arguments for the calculation of the field in the section Formulation, and also in the postprocessing part, I use mu\[{d phi}\] and nu\[{Curl a}\] instead of a mu\[\] and nu\[\]. I also include some demagnetization curve from the manufacturer of the permanent magnet. Should it work this way? I have already sucessfully tested the method described here for a nonlinear steel material.https://gitlab.onelab.info/doc/tutorials/-/issues/23Foucault Dynamics Internship2023-11-22T13:51:30ZAravin ThiruFoucault Dynamics Internshiphttps://gitlab.onelab.info/doc/models/-/issues/16Wrong result of "Shielding" model2023-09-20T07:03:07Ztatsuya kimuraWrong result of "Shielding" modelI tried the "Shielding" model in 3D, but the results seems wrong.
Fortunately, an error was found in "fomuration.pro",line 133 :
Wrong:
{ Name B; NameOfFormulation Form_BC; DestinationSystem A; }
Correct:
{ Name B; NameOfFor...I tried the "Shielding" model in 3D, but the results seems wrong.
Fortunately, an error was found in "fomuration.pro",line 133 :
Wrong:
{ Name B; NameOfFormulation Form_BC; DestinationSystem A; }
Correct:
{ Name B; NameOfFormulation Form_BC; Type Complex; DestinationSystem A; }https://gitlab.onelab.info/doc/tutorials/-/issues/22Constraint with Lagrange multipliers2023-10-06T13:01:10ZCrisBabConstraint with Lagrange multipliersHi,
Is there any example which shows how to use Lagrange multipliers to set a constraint?
ThanksHi,
Is there any example which shows how to use Lagrange multipliers to set a constraint?
Thankshttps://gitlab.onelab.info/doc/tutorials/-/issues/21Export Global Quantity Values (Custom Format)2023-09-24T01:38:15ZStuart BarthExport Global Quantity Values (Custom Format)I understand that we can use the Print\[\] function in a `PostOperation` to export to a file, e.g., `Print [ Q, OnRegion Conductor, Format SimpleTable, File > "Q.txt"]`. However, this doesn't really give us the option of outputting data ...I understand that we can use the Print\[\] function in a `PostOperation` to export to a file, e.g., `Print [ Q, OnRegion Conductor, Format SimpleTable, File > "Q.txt"]`. However, this doesn't really give us the option of outputting data in any desired format -- we seem to be limited to the options of `Format`, e.g., `SimpleTable`
In the electrostatics tutorial for example, we have a global quantity `Q`. Say I had multiple such quantities `Q~{i}`, and I wanted to export a list of them in CSV format. Is there a way to easily print out the global values to a file, in any desired format? I've tried `StoreInVariable $Q~{i}` and then directly writing `Printf(Sprintf("%g", $Q~{i})) >> "Q.txt";` -- but OneLab gives an error saying it doesn't recognize the global variable symbol `$`.
Is there any way the value of a Global Quanity can be directly written to a file, in a custom format?
Thank you!https://gitlab.onelab.info/doc/tutorials/-/issues/20Which is the correct stable version?2023-08-04T10:27:43ZBertold FroehlichWhich is the correct stable version?I have downloaded Onelab from the page https:\\onlab.info. When I open Onelab (Windows) it shows the version number 4.12.0 ![grafik](/uploads/196dc243e85c9e175203f001ad592825/grafik.png)
When I go to the https:\\gmsh.info page the curren...I have downloaded Onelab from the page https:\\onlab.info. When I open Onelab (Windows) it shows the version number 4.12.0 ![grafik](/uploads/196dc243e85c9e175203f001ad592825/grafik.png)
When I go to the https:\\gmsh.info page the current stable release is version 4.11.1
![grafik](/uploads/17614d164889477c6a6c31e49f989a01/grafik.png)https://gitlab.onelab.info/doc/tutorials/-/issues/19creating a contour plot2023-12-04T14:24:35ZBertold Froehlichcreating a contour plotAt the post processing stage of the template code magnets I would like to make a contour plot. In the manual I can only find a very brief description about the option Iso. Unfortunately I cannot find a tutorial or model to use as a templ...At the post processing stage of the template code magnets I would like to make a contour plot. In the manual I can only find a very brief description about the option Iso. Unfortunately I cannot find a tutorial or model to use as a template. The floating.pro file seems very similar to what I want to do (PostOperation{ {Name Map;...). But I cannot find any documentation on the postprocessing part. Could you please help me and give an example code of how to use the Iso option (I think it should be this) for creating a contour plot from scalar values?https://gitlab.onelab.info/doc/models/-/issues/15How to use Double sweep preconditioner?2023-03-28T07:26:59Zjiaqiang maHow to use Double sweep preconditioner?I modified the PRECONDITIONER to '1' in file marmousi.pro.
I try to use Double sweep preconditioner instead of Unpreconditioned in marmousi, but I failed when I use mpirun.
What should I do if I want to test Double sweep preconditioner...I modified the PRECONDITIONER to '1' in file marmousi.pro.
I try to use Double sweep preconditioner instead of Unpreconditioned in marmousi, but I failed when I use mpirun.
What should I do if I want to test Double sweep preconditioner in multiple processes?
Thank you for your reply!https://gitlab.onelab.info/doc/tutorials/-/issues/18Periodicity depends on constraints order2022-09-05T15:33:36ZRaphaël PilePeriodicity depends on constraints orderHello !
I have find a weird behavior. In the attached example, between line 24-33 of CDR.pro, if I put the initial condition constraint BEFORE the periodicity (as in CDR_bug.pro), the periodicity constraint seems to be ignored. But, sw...Hello !
I have find a weird behavior. In the attached example, between line 24-33 of CDR.pro, if I put the initial condition constraint BEFORE the periodicity (as in CDR_bug.pro), the periodicity constraint seems to be ignored. But, switching the constraints (as in CDR.pro) seems to work.
Am I missing something ?
Bonus question: I don't understand why my gaussian function is "crushed" over time in this purely convective problem...[Issue_Periodicity.zip](/uploads/09ca91a9021b650d816f26732e9903b9/Issue_Periodicity.zip)https://gitlab.onelab.info/doc/models/-/issues/14Waveguides - Erroneous Absorbing Boundary Conditions?2022-08-10T11:15:46ZBernd BreitkreutzWaveguides - Erroneous Absorbing Boundary Conditions?I have trouble with the waveguide ports in the straight waveguide model. My understanding is that the fields are excited by an analytical field distribution (i.e. sine half-waves), and the incoming waves are absorbed by some kind of abc....I have trouble with the waveguide ports in the straight waveguide model. My understanding is that the fields are excited by an analytical field distribution (i.e. sine half-waves), and the incoming waves are absorbed by some kind of abc. However, I am already failing to understand the result of the simulation.
With a sufficient discretization and excitation above cut-off frequency, I would expect a reflection free transmission from one port to the other. This corresponds to $`|s_{11}|=0=-\infty\,\mathrm{dB}`$ , $`|s_{21}|=1=0\,\mathrm{dB}`$, and identical field distributions for real part and imaginary part, but shifted by 90° in space. But I witness a strong reflection of $`|s_{11}|=-7.3\,\mathrm{dB}`$ and significant differences in the field plots.
May there a bug in the abc formulation of the model?
![waveguide_2d_real](/uploads/5922d46a53e92ec5570c3d373187eb5c/waveguide_2d_real.png)![waveguide_2d_imag](/uploads/890488acc2ec365a2a6a3fca179870d5/waveguide_2d_imag.png)https://gitlab.onelab.info/doc/tutorials/-/issues/17Electromagnet: No results (Time Domain)2022-08-01T11:16:38ZBernd BreitkreutzElectromagnet: No results (Time Domain)I have trouble running the time domain tutorial of `electromagnet.pro`:
- All results are zero.
- The I(t) plot does not look as expected.
## Steps
- ONELAB bundle from 13/05/2022
- Latest tutorials commit (070d2b1e)
- In Gmsh GUI, ope...I have trouble running the time domain tutorial of `electromagnet.pro`:
- All results are zero.
- The I(t) plot does not look as expected.
## Steps
- ONELAB bundle from 13/05/2022
- Latest tutorials commit (070d2b1e)
- In Gmsh GUI, open `electromagnet.pro`
- `GetDP/Resolution` = `Magnetodynamics2D_av`
- `GetDP/Post-processing` = `dyn`
- `Model parameters/Analysis Type` = `Time-domain`
- press `Run`
## Result
- `Post-processing/j` == 0, `az` == 0, and `b` == 0
- Plotting `Model parameters/Current` vs. `GetDP/Time` does not show the anticipated step-function (see code below), but a linear ramp from 1e-4 to 0.19
## Related Code (unmodified)
`electromagnet.pro`, line 67 ff.
```
TimeInit = 0; // start simulation at time = 0s
TimeFinal = 20e-3; // stop simulation at time = 20 ms
DeltaTime = 1e-3; // use time steps equal to 1 ms
// Define the time modulation of the current source, i.e. a linear ramp from
// 0 to 1 until 10 ms, then a constant value of 1:
myModulation[] = ($Time < TimeFinal / 2) ? (2 / TimeFinal * $Time) : 1;
```
![electromagnet](/uploads/f1d76c0de4e56c51d370d41615f6d3f5/electromagnet.png)https://gitlab.onelab.info/doc/models/-/issues/13Cohomology: gauge condition also in conductor2023-09-04T14:08:06ZErik SchnaubeltCohomology: gauge condition also in conductorHi all,
In the `Cohomology` example for the A formulation, the gauging condition is applied in all of `Omega`, i.e., including the conducting domain. If I'm not mistaken (only had a rather short look), it should be gauged only in the n...Hi all,
In the `Cohomology` example for the A formulation, the gauging condition is applied in all of `Omega`, i.e., including the conducting domain. If I'm not mistaken (only had a rather short look), it should be gauged only in the non-conducting domain `Omega_a`. However, this does not seem to affect the computed solution.
Thanks,
Erikhttps://gitlab.onelab.info/doc/tutorials/-/issues/16Closed2022-07-05T07:06:03ZCrisBabClosedhttps://gitlab.onelab.info/doc/tutorials/-/issues/15MagnetoStatic Simulation of Amperes Law2022-04-11T09:22:28ZGreenMaxMagnetoStatic Simulation of Amperes LawHello,
I had a quick question about setting up OneLab to calculate the magnetic field generated from current passed through a PCB trace. I have looked at the examples and am not sure which example is a good starting point. I am not able ...Hello,
I had a quick question about setting up OneLab to calculate the magnetic field generated from current passed through a PCB trace. I have looked at the examples and am not sure which example is a good starting point. I am not able to figure out how to setup the boundary conditions and input/output faces for the current.https://gitlab.onelab.info/doc/models/-/issues/12getdp or gmsh FEM for electric machine analysis?2022-03-07T10:07:54ZAlexander Shendigetdp or gmsh FEM for electric machine analysis?Dear onelab people,
for electric machine analysis, should I use getdp or can I use gmesh FEM? Which one is recommended?
Thanks in advance,
AlexanderDear onelab people,
for electric machine analysis, should I use getdp or can I use gmesh FEM? Which one is recommended?
Thanks in advance,
Alexanderhttps://gitlab.onelab.info/doc/models/-/issues/11Iq value in model ElectricMachines/pmsm_cbmag doesn't have any effect2022-03-07T10:09:28ZAlexander ShendiIq value in model ElectricMachines/pmsm_cbmag doesn't have any effectIn the model "ElectricMachines/pmsm_cbmag", when chosing current excitation, the input value for IQ doesn't seem to have any effect.
I always get a small cogging torque.
In the simplified pmsm model this works as expected.In the model "ElectricMachines/pmsm_cbmag", when chosing current excitation, the input value for IQ doesn't seem to have any effect.
I always get a small cogging torque.
In the simplified pmsm model this works as expected.Ruth SabariegoRuth Sabariegohttps://gitlab.onelab.info/doc/models/-/issues/10Correctly setting boundary condition for linear elasticity problem2022-05-14T10:36:19ZDenCorrectly setting boundary condition for linear elasticity problemDear all,
How to set the boundary condition on the dXdY boundary (problem - Elasticity), a rotating disk.
Best,
Denis![ipm2](/uploads/f2fcf49706b3edb555c9b0a807d6253b/ipm2.png)
![ipm1](/uploads/1bdb82590f953b471973cbde4d701a41/ipm1.png)Dear all,
How to set the boundary condition on the dXdY boundary (problem - Elasticity), a rotating disk.
Best,
Denis![ipm2](/uploads/f2fcf49706b3edb555c9b0a807d6253b/ipm2.png)
![ipm1](/uploads/1bdb82590f953b471973cbde4d701a41/ipm1.png)https://gitlab.onelab.info/doc/tutorials/-/issues/14Capacitor in 3D2021-12-02T16:53:21ZBianca AuwarterCapacitor in 3DHello everyone,
it's the first time I use gmsh, I already know how to build some models, but I still have no idea how to build a capacitor model in 3d, could someone help me?Hello everyone,
it's the first time I use gmsh, I already know how to build some models, but I still have no idea how to build a capacitor model in 3d, could someone help me?https://gitlab.onelab.info/doc/models/-/issues/9Electrical Machines2021-11-06T08:52:03ZDapu ZhangElectrical MachinesHi dear getdp users,
are there any ways to extract the flux densities elementwise? For example, I tried to use the **onGrid** Operation to compute the radial flux density along a circular line (Stator_arigap) in the pmsm example. But i...Hi dear getdp users,
are there any ways to extract the flux densities elementwise? For example, I tried to use the **onGrid** Operation to compute the radial flux density along a circular line (Stator_arigap) in the pmsm example. But it seems like that there are some accuracy problems or interpolation problems. Basically, if I want to extract the flux density in the airgap, the sample points along the circular line should match the number of elements in a certain layer of the airgap. I went through the pipermail from the geuz.org. But I didn't find a solution. Thanks in advance.
Regards,
Dapu from Hannover, Germany.
![br](/uploads/3d892d5a569f3b0cd92d22a9657b72af/br.png)