CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   General Question about code developing (https://www.cfd-online.com/Forums/openfoam-programming-development/238619-general-question-about-code-developing.html)

mostanad September 22, 2021 22:23

General Question about code developing
 
Hi everyone,
I have a general question about OF coding. Considering that I have started a simulation using OF. Then during running this case, I have changed the OF library and compiled it. So does it affect the running case with the previously compiled configuration?
Cheers,
Mohammad

mostanad September 24, 2021 10:11

Nobody interested in answering my question?

guin September 24, 2021 12:20

Quote:

Originally Posted by mostanad (Post 812831)
Hi everyone,
I have a general question about OF coding. Considering that I have started a simulation using OF. Then during running this case, I have changed the OF library and compiled it. So does it affect the running case with the previously compiled configuration?
Cheers,
Mohammad

A general answer to your general question: well, it depends...

Being more pragmatic: In principle it shall not affect your already-running case. Of course, if you stop&resume it the system will make use of the new binaries.

mostanad September 25, 2021 03:40

Quote:

Originally Posted by guin (Post 812961)
A general answer to your general question: well, it depends...

Being more pragmatic: In principle it shall not affect your already-running case. Of course, if you stop&resume it the system will make use of the new binaries.


You was so specific indeed. I mean the already-running case. So in your opinion, making a change in library and compiling it doesn't affect that case.

fra76 September 26, 2021 02:06

Quote:

Originally Posted by mostanad (Post 812982)
You was so specific indeed. I mean the already-running case. So in your opinion, making a change in library and compiling it doesn't affect that case.


As guin wrote, it depends.
I had systems in which changing a binary used by a simulation was causing the simulation stopping with a "BUS error", while on other systems it did not stop.


However, it's never a good idea...

mostanad September 26, 2021 19:24

Quote:

Originally Posted by fra76 (Post 813014)
As guin wrote, it depends.
I had systems in which changing a binary used by a simulation was causing the simulation stopping with a "BUS error", while on other systems it did not stop.


However, it's never a good idea...


Got it. Thanks Francesco for your nice reply.

baratian September 30, 2021 06:39

hello everybody
i wonder whether it is possible to run OF codes on a generic compiler (not through the TERMINAL determined by the official releases)?
for example can i run the Cavity tutorial codes on CodeBlocks C++ compiler?
i think if OF is a real open source code it must be possible!
thanks in advance.

fra76 September 30, 2021 14:45

Quote:

Originally Posted by baratian (Post 813292)
hello everybody
i wonder whether it is possible to run OF codes on a generic compiler (not through the TERMINAL determined by the official releases)?
for example can i run the Cavity tutorial codes on CodeBlocks C++ compiler?
i think if OF is a real open source code it must be possible!
thanks in advance.

Sure, you can choose a different compiler, recompile everything and run the software. Compilation rules are in wmake, they do exist for some compiler (and mpi), might be added for other ones. Configuration files in etc, like bashrc, might need to be adapted as well.

baratian October 30, 2021 12:07

You mean it is possible for example to copy paste OF codes in a generic c++ compiler and run?
If that is! I am really wondered by that.

fra76 October 31, 2021 08:13

Quote:

Originally Posted by baratian (Post 815432)
You mean it is possible for example to copy paste OF codes in a generic c++ compiler and run?
If that is! I am really wondered by that.


No, I am not saying that. To be honest, I'm not sure I understood what you mean with that.


What I am saying is that you can use different compilers to recompile the whole OpenFOAM package, including your custom libraries and applications.
OpenFOAM is C++ code, although with a unique code style, but you cannot take just a solver source, it includes headers and imports lots of libraries from the openfoam source directories that must be recompiled as well.


All times are GMT -4. The time now is 13:09.