// Scalar_Helmholtz - A linear solver for the scalar helmholtz equation
// Copyright (C) 2012-2026 Eric Bechet
//
// See the LICENSE file for license information.
// Please report all bugs and problems to <bechet@cadxfem.org>.


#include "GmshGlobal.h"
#include "scalar_helmholtz.h"
#include <iostream>

int main (int argc, char* argv[])
{
  if (argc != 2){
    printf("usage : test_scalar_helmholtz input_file_name\n");
    return -1;
  }

  GmshInitialize(argc, argv);

  // instanciate a solver
  ScalarHelmholtzSolver mySolver;

  // read the input file
  mySolver.readInputFile(argv[1]);
  // call test function (returns a single value)
  double error=mySolver.test();

  // stop gmsh
  GmshFinalize();

  // compare the hash value with a known value  
  std::cout.precision(16);
  std::cout << std::showpos;
  std::cout << std::scientific;
  std::cout << error <<  std::endl;
  if (error>1e-12) return 1;
  return 0;
}
