I have built a C++ code last year for my Master's Thesis.
Now, I would like to make this code easier to use for an external user.
The idea is that the external user enters in .txt files the different inputs of the model.
For the .txt files wherein information is just double numbers, there is no problem for me. But, in one of these .txt files, we have to introduce the analytical expression of one my boundary conditions. So for example, I have to read the following expression :
50.*exp(x[i]+y[i])
where x and y are one-dimensionnal arrays in my main code.
So, I would like read this expression and after obtain its value that I'll register in an other variable as a double number.
Sorry for my approximative english... I hope it's quite understandable...
Is there anyone that can helps me about this problem.
is the expression one of recursion or a nested loop? Are you asking how to explain it in lay-mans terms for a type of help command? what are the arrays derived from would help determine the functions purpose. Are you saying you wanna use the same exp() function to register a different variable type, well that would be solved by using a function template, or function overloading.
template<typename T> T exp( T x, T y)
{}
I guess as I dig deeper into it, I see the problem why not do *exp(*exp(x[i] + y[i]), z) if *exp generates a double number than have z be the second variable.
I would like to known how carry out it in practice, so the command lines...
In fact, x[i] with i=0=>50 is known, y[i] with i=0=>30 is known. It doesn't matter...
Suppose that x and y are simple constant double numbers whose the values are given in my main C++ code. So, it has to read the expression written in my .txt file : 50.*exp(x+y) and put this expression in a "double" variable to evaluate the value of the expression knowing x and y...
It's difficult for me to explain my problem in english...
Are you asking how to read the expression from the text file or how create the function like 50.*exp(x,y). When you say double do you mean two variables or the type double.