First time here? Checkout the FAQ!
x
0 votes
by (640 points)
Hi,

I am trying to modify the code of openCARP in order to test a different solver which implies slightly modifying also some details in the original code (just writing a custom parab or ellipt solver opt file is not enough). I would like to do a clean work, so I thought to add a new parameter which can be set in a .par file. The problem is that the files defining the `param_globals` scope are autogenerated and shouldn't be modified manually and I don't understand how to re-generate them changing the name of the parameters or adding new ones.

Thank you in advance

1 Answer

0 votes
by (19.1k points)

Hi,

the parameters are defined in the following file from which the code (and also documentation) is auto-generated during the compilation workflow.

https://git.opencarp.org/openCARP/openCARP/-/blob/master/simulator/openCARP.prm

Cheers,

Axel

by (640 points)
Ok, I tried to modify that file following the syntax (I added a single parameter with description and defaults) and recompiled openCARP (with cmake --build _build), compiling was fine, but when I launched openCARP I got a segfault error. I don't understand why. Clearly restoring to the previous state solves the issue, which means adding a single parameter messed up with the memory.
by (19.1k points)
You can check the generated code if you see anything suspicious. Otherwise, feel free to open an issue with a minimal example to reproduce this behavior: https://git.opencarp.org/openCARP/openCARP/-/issues
by (640 points)
Removing the previously autogenerated file (openCARP_p, openCARP_d and openCARP_x) from the simulation/ folder and recompiling openCARP with cmake --build _build solved the issue
by (19.1k points)
Good to hear that you could solve the problem. With cmake, the files should automatically be regenerated whenerver openCARP.prm changes:

https://git.opencarp.org/openCARP/openCARP/-/blob/master/simulator/CMakeLists.txt#L19
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...