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/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/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/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/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/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/8Antenna example crush2021-12-23T09:46:16ZDmitry KonkinAntenna example crushWhile trying to run mstrip.pro gmsh pass meshing stage and then it closes.
Is there any specific requirement for hardware e.g. RAM more than 8 GB etc. which could potentially results in such behavior?While trying to run mstrip.pro gmsh pass meshing stage and then it closes.
Is there any specific requirement for hardware e.g. RAM more than 8 GB etc. which could potentially results in such behavior?https://gitlab.onelab.info/doc/tutorials/-/issues/13Thermics Regularize Field: Position of Thin Volume Region (Minor Issue)2021-09-11T13:08:42ZErik SchnaubeltThermics Regularize Field: Position of Thin Volume Region (Minor Issue)The position of the thin volume when `Flag_Regularization == 1` in the thermics tutorial seems to be off slightly (as far as I understand the model). Talking only about the left boundary of window 1, the line for the thin shell is locate...The position of the thin volume when `Flag_Regularization == 1` in the thermics tutorial seems to be off slightly (as far as I understand the model). Talking only about the left boundary of window 1, the line for the thin shell is located at x = 15mm while the outer bound for the thin volume is at x = 13.5mm and the inner boundary at x = 14.5mm. Hence, the regularized window is slightly bigger than the thin shell window.
This is of course only a minor issue (but possibly confusing) and can be easily fixed by changing the assignments in this part of `brick_common.pro`
```
If( Flag_Regularization )
dx_Win1 += 1*e_layer;
dy_Win1 += 1*e_layer;
EndIf
```
into either `+= 0*e_layer //i.e. equiv to deleting the assignment` (thin shell coincides with inner boundary of the thin volume window), `-= 1*e_layer` (thin shell is in the middle of the two boundaries of the thin volume, probably preferred?) or `-= 2*e_layer` (thin shell coincides with outer boundary).
Many thanks for the great tutorial and GetDP/gmsh in general!François HenrotteFrançois Henrottehttps://gitlab.onelab.info/doc/tutorials/-/issues/12How to import an already drawn model into gmsh2021-07-26T21:13:06ZJie LiHow to import an already drawn model into gmshIs there a possibility that I can import an ansys or femag model that I have already drawn into gmsh?Is there a possibility that I can import an ansys or femag model that I have already drawn into gmsh?https://gitlab.onelab.info/doc/tutorials/-/issues/11How to use Code to build a Model2021-07-10T14:35:10ZJie LiHow to use Code to build a ModelHallo everyone,
it's my first time to use gmsh, I already know how to build a model with interface operations, but I still don't have a clue about building a model using code, for example a hollow cylinder, is there some corresponding ex...Hallo everyone,
it's my first time to use gmsh, I already know how to build a model with interface operations, but I still don't have a clue about building a model using code, for example a hollow cylinder, is there some corresponding example?https://gitlab.onelab.info/doc/models/-/issues/7Ordering of cuts in 2D Gmsh-GetDP (homology-cohomology)2021-05-20T19:53:57ZFrederic TrillaudOrdering of cuts in 2D Gmsh-GetDP (homology-cohomology)Dear all,
This is not per se an issue but an inconveniency in some cases. I am running a case study 1n 2D having different conductors in series.
For each conductor, I assign a cut to impress the transport current. As all the conductor...Dear all,
This is not per se an issue but an inconveniency in some cases. I am running a case study 1n 2D having different conductors in series.
For each conductor, I assign a cut to impress the transport current. As all the conductors are in series, they have the same current. However, building the cuts and assigning the current result in random orientation of the latter. It seems that the edges of the mesh making the cuts are not necessary in the same "direction" for all overlapping cuts.
A colleague of mine as a manual fixed reordering the direction of the edges, however, I think tat it would be more appropriate to have it already arranged directly in the code. The idea would be that the direction of the cuts are all the same for all the conductors and only the sign of the impressed current should be defined.
I am attaching a figure showing the current density resulting of impressing the current through the cuts with the basic ordering of Gmsh.
The cuts are associated with branches in an electrical circuit each branch is a conductor form node 2 to 11:
{ Region cut_0; Branch{2, 3}; }
{ Region cut_1; Branch{3, 4}; }
{ Region cut_2; Branch{4, 5}; }
{ Region cut_3; Branch{5, 6}; }
{ Region cut_4; Branch{6, 7}; }
{ Region cut_5; Branch{7, 8}; }
{ Region cut_6; Branch{8, 9}; }
{ Region cut_7; Branch{9, 10}; }
{ Region cut_8; Branch{10, 11}; }
{ Region cut_9; Branch{11, 0}; }
Some of the cuts:
![circuitCouplingDCAC](/uploads/c07cb70430199767fe5c70561f091fd7/circuitCouplingDCAC.png)
Current density:
![currentDensityDirection](/uploads/2be1f030bd0aee02bc952eafb149c3a3/currentDensityDirection.png)
Best,
Frederichttps://gitlab.onelab.info/doc/tutorials/-/issues/9Example for structural eigenvalue problem wanted2021-04-06T09:21:01ZAlexander ShendiExample for structural eigenvalue problem wantedI'm trying to use onelab for structural mechanics. In particular I would like to compute the eigenfrequencies and eigenmodes of a structure.
As an excercise I have converted the supplied 2D wrench example to 3D. I was able to do a 3D s...I'm trying to use onelab for structural mechanics. In particular I would like to compute the eigenfrequencies and eigenmodes of a structure.
As an excercise I have converted the supplied 2D wrench example to 3D. I was able to do a 3D static calculation, but still have some questions. Do you know whom I could contact? Also I have some further questions regarding the eigenproblem.
Many thanks in advance for your help.https://gitlab.onelab.info/doc/tutorials/-/issues/10How to output conductivity data?2021-04-06T05:51:15ZTryphenaHow to output conductivity data?Hello, I am new to onelab. I would like to use onelab to do some electrical mechanical coupling simulation. But for the beginning, I would like to simulate simple test to calculate conductivity of a cylinder. I merged the Interactive_Ele...Hello, I am new to onelab. I would like to use onelab to do some electrical mechanical coupling simulation. But for the beginning, I would like to simulate simple test to calculate conductivity of a cylinder. I merged the Interactive_Electrostatics.pro template with my mesh. Onelab runs and plots the voltage drop. But how can I know the conductivity of the cylinder? And is there any template for electrical mechanical coupling simulation? Thank you very much.
![cylinder](/uploads/12aa4e1e9056f78bb400c4afbc974a30/cylinder.JPG)https://gitlab.onelab.info/doc/website/-/issues/1Can not find repository for onelab software bundle including versioned, tagge...2021-01-24T19:05:19ZUser_NCan not find repository for onelab software bundle including versioned, tagged, released and pgp signed codeOn http://onelab.info/files/onelab-source.zip, I can find the source code for the latest onelab package.
Within this gitlab, I can find the gmsh project and the getdp project and the documentation and the models.
But I can not find the ...On http://onelab.info/files/onelab-source.zip, I can find the source code for the latest onelab package.
Within this gitlab, I can find the gmsh project and the getdp project and the documentation and the models.
But I can not find the repository for the downloaded files above.
Where can I find this repository (which creates http://onelab.info/files/onelab-source.zip) with versioned, tagged, released and pgp signed code?https://gitlab.onelab.info/doc/tutorials/-/issues/6Conveks Error2021-01-27T19:09:58ZshahinConveks ErrorI have downloaded the ONELAB bundle and tried to run the shape.py tutorial. I am getting this error:
Abnormal server termination (socket listening timeout on socket 127:0:0:1:0)I have downloaded the ONELAB bundle and tried to run the shape.py tutorial. I am getting this error:
Abnormal server termination (socket listening timeout on socket 127:0:0:1:0)