v2f - 'if' and 'else' condition
Hello,
I need help to add an 'if' condition to my turbulence model. Unfortunately I have some difficulties with C++, I would be very happy if someone could help me. The code example is as follows (from the v2f.C file): Code:
if (Ts() > Ls()) Would I also need to add something to v2f.H? Please, whoever can teach me how to do it... as I said, is an example (that is, the concept I want). *OF5 |
You can't have if / else statements around function definitions and declarations. Your use case is screaming for templates, which is how we would deal with that most commonly. Take the following source code as an example
Code:
#include <iostream> Well, the above code is quite shor but has several concepts which are important here, most importantly templates, but also template type deduction which are probaby concepts which are quite heavy to diggest if you have not come across them before. So to answer your question, yes, it can be done, but it requires some more in depth c++ knowledge. Hope this helps anyways |
All times are GMT -4. The time now is 09:34. |