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

#ifndef _HELMHOLTZ_LEVELSET_DOMAIN_H_
#define _HELMHOLTZ_LEVELSET_DOMAIN_H_

#include <string>
#include <vector>
#include <boost/concept_check.hpp>

#include "scalar_helmholtz.h"
#include "genDataIO.h"
#include "genDataLS.h"

class HelmholtzLevelsetSolution
{
public:
  int tag;
  int dim;
  std::string kind;
  genSimpleFunction<genTensor0<double> >* fscalar_real;
  genSimpleFunction<genTensor0<double> >* fscalar_im;

public :
  HelmholtzLevelsetSolution( ) {}
  ~HelmholtzLevelsetSolution()
  {
    delete fscalar_real;
    delete fscalar_im;
  }
  friend std::istream & operator>>(std::istream &is, HelmholtzLevelsetSolution &obj);
  friend std::ostream & operator<<(std::ostream &os, HelmholtzLevelsetSolution &obj);
};

std::istream & operator>>(std::istream &is, HelmholtzLevelsetSolution &obj);
std::ostream & operator<<(std::ostream &os, HelmholtzLevelsetSolution &obj);


class genDataHLS : public genDataLS
{
public:
  std::vector<HelmholtzLevelsetSolution*> HLSsolutions;
  int Using_xfem;
public:
  genDataHLS() : genDataLS() {}
  virtual ~genDataHLS() { for (int i=0; i<HLSsolutions.size(); ++i) delete HLSsolutions[i]; }
  virtual void readToken(std::istream &is, std::string &token);
  virtual void dumpContent(std::ostream &os);
};


class HelmholtzLevelsetDomain : public ScalarHelmholtzDomain
{
public:
  genSimpleFunction<genTensor0<double> >* fscalar_real;
  genSimpleFunction<genTensor0<double> >* fscalar_im;
public:
  HelmholtzLevelsetDomain(const HelmholtzLevelsetSolution &p,  const genDomain &s) : ScalarHelmholtzDomain(s), fscalar_im(0), fscalar_real(0)
  {
    fscalar_real = p.fscalar_real;
    fscalar_im = p.fscalar_im;
  }
virtual ~HelmholtzLevelsetDomain() {};
};

#endif// _HELMHOLTZ_LEVELSET_DOMAIN_H_