#include"../Interface/FEM_Interface.h"

#include <fstream>
#include <iostream>
#include <string>

int main(int argc, char* argv[])
{
	std::string jsonFile = "sbc3d_sbc.json";
	if (argc > 1)
		jsonFile = argv[1];

	std::ifstream fd(jsonFile);
	if (!fd.is_open())
	{
		std::cout << "cannot open " << jsonFile << std::endl;
		return -1;
	}
	std::string str((std::istreambuf_iterator<char>(fd)), std::istreambuf_iterator<char>());

	OpticsFEM_API femAPI;
	OpticsFEMData data;
	data.test1 = 1;
	data.test2 = 2;
	data.data = const_cast<char*>(str.c_str());

	int ret = femAPI.OpticsFEM_All(data);
	std::cout << "OpticsFEM_All returned " << ret << std::endl;
	return ret;
}
