#include <stdio.h>    // to get "printf" function
#include <stdlib.h>   // to get "free" function
#include <iostream>
#include "WriteMeshVtu.hpp"
#include "ReadMeshVtu.hpp"
#include "Mesh.hpp"
#include "ElementIterator.hpp"

#include "FELib.hpp"
#include <time.h>

const unsigned int dim = 3;

using namespace SpaMesh;
int main(int argc, char **argv)
{
  FELib::FELibInit init(argc, argv);
  Mesh<dim> mesh;
  ReadMeshVtu vtuReader;
  vtuReader.load_mesh("./aneurism.vtu", mesh);

  mesh.printInfo();

  double start_time = clock();
  bool computeFaces = true;
  mesh.computeElemNeighbors(computeFaces);
  double end_time = clock();
  std::cout<<"topology computation time "<<(end_time - start_time)/CLOCKS_PER_SEC<<std::endl;
  mesh.printInfo();

  WriteMeshVtu vtuWriter;
  vtuWriter.write_file("output.vtu", mesh);

  return EXIT_SUCCESS;
};
 
