/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#include <iostream>
#include <fstream>
#include "matrices_all.h"
#include "groupedboundary.h"
#include "config.h"

void helpMsg(int ac, char**av)
{
	std::cerr<<"Usage: "<<av[0]<<" sourceMatrixDirectory sourceMatrixName groupFile outMatrixDirectory outMatrixName groupMethod\n";
	exit(-1);
}

int main(int ac, char**av)
{
	Matrices::init_logging();
	if (ac != 7)
	{
		helpMsg(ac,av);
	}
	std::string groupFilename = av[3];
	std::string matrixDir = av[1];
	std::string matrixName = av[2];

	BoundaryGrouper b(groupFilename, matrixDir, matrixName, av[4], av[5], av[6]);

	b.loadGroups();
	b.loadSourceMatrix();
	b.createResultMatrix();
	b.saveResultMatrix();
}
