//
//-----------------------------------------------------------------------------
-// Plot flow functions in library and check their consistency
+// Check consistency of function implementations
#include "../tests.h"
#include <base/data_out_base.h>
#include <fstream>
#include <string>
+#define CHECK(F) { deallog << #F << std::endl; \
+ F f; \
+ check_function_value_consistency(f, 5); \
+ check_function_gradient_consistency(f, 5); \
+}
+
+
+#define CHECKN(F,arg) { deallog << #F << '(' << arg << ')' << std::endl; \
+ F f(arg); \
+ check_function_value_consistency(f, arg+1); \
+ check_function_gradient_consistency(f, arg+1); \
+}
+
+
int main()
{
std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
std::ofstream logfile(logname.c_str());
deallog.attach(logfile);
deallog.depth_console(0);
+
+ CHECK(Functions::SquareFunction<1>);
+ CHECK(Functions::SquareFunction<2>);
+ CHECK(Functions::SquareFunction<3>);
+ CHECK(Functions::CosineFunction<1>);
+ CHECK(Functions::CosineFunction<2>);
+ CHECK(Functions::CosineFunction<3>);
+ CHECK(Functions::ExpFunction<1>);
+ CHECK(Functions::ExpFunction<2>);
+ CHECK(Functions::ExpFunction<3>);
}
+DEAL::Functions::SquareFunction<1>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::SquareFunction<2>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::SquareFunction<3>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::CosineFunction<1>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::CosineFunction<2>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::CosineFunction<3>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::ExpFunction<1>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::ExpFunction<2>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list
+DEAL::Functions::ExpFunction<3>
+DEAL::value vs vector value list
+DEAL::value list vs vector value list
+DEAL::gradient vs vector gradient list
+DEAL::gradient list vs vector gradient list