// This program tests the functionality of the function parser
// wrapper with respect to the ability to deal with units.
+// because units are deprecated and muparser can not deal with this,
+// recycle the test to use constants instead of units
#include "../tests.h"
#include <fstream>
std::map<std::string, double> units;
constants["PI"] = 3.141592654;
- units["cm"] = 10;
- units["m"] = 1000;
+ constants["cm"] = 10;
+ constants["m"] = 1000;
Point<2> point(2.0, 3.0);
//initialized with units
FunctionParser<2> fp;
- function[0] = "x cm + y m + PI";
+ function[0] = "x * cm + y * m + PI";
fp.initialize(FunctionParser<2>::default_variable_names(),
function, constants, units);
-DEAL::Function [x cm + y m + PI] @point [2.00000 3.00000] is [3023.14]
-DEAL::Function [x cm + y m + PI] @point [2.00000 3.00000] is [3023.14]
+DEAL::Function [x * cm + y * m + PI] @point [2.00000 3.00000] is [3023.14]
+DEAL::Function [x * cm + y * m + PI] @point [2.00000 3.00000] is [3023.14]
DEAL::Function [x + y + PI] @point [2.00000 3.00000] is [8.14159]
DEAL::Function [x + y + PI] @point [2.00000 3.00000] is [8.14159]