// thermal - A linear solver for elastic problems using FEM
// Copyright (C) 2010-2026 Eric Bechet
//
// See the LICENSE file for license information and contributions.
// Please report all bugs and problems to <bechet@cadxfem.org>.
//
// Initial design: Frederic Duboeuf (rev.2285)


#ifndef _THERMAL_SOLVER_H_
#define _THERMAL_SOLVER_H_

#include <memory>
#include "dofManager.h"
#include "genTerm.h"
#include "genSolver.h"
#include "thermalDomain.h"
#include "genCache.h"
#include "savedGenTermManager.h"
#include "genFSpace.h"


class ThermalSolver : public genSolver
{
protected :
  dofManager<double>* pAssembler;
  // function spaces
  genFSpace<genTensor0<double> >::Handle FSpace;

  // supports for elastic
  std::vector<ThermalDomain*> TDomains;

  // model name
  std::string modelname;

public :
  ThermalSolver() : genSolver(), pAssembler(0) {}
  virtual ~ThermalSolver();
  //read data file
  virtual void readInputFile(const std::string &fileName);
  // builds local supports
  virtual void CheckProperties();
  // build the problem function spaces
  virtual void CreateFunctionSpaces();
  virtual void BuildFunctionSpaces();
  // assemble the problem
  virtual void AssembleRHS();
  virtual void AssembleLHS();
  virtual void BuildLinearSystem();

  // assemble the residu
  virtual void AssembleResidual();
  // export K.txt b.txt in file
  virtual void exportKb();
  virtual void solve();
  virtual PView* buildTemperatureView(const std::string &postFileName);
  virtual PView* buildThermalEnergyView(const std::string &postFileName);
  virtual PView* buildThermalStressView(const std::string &postFileName);
  virtual PView* buildThermalStrainView(const std::string &postFileName);
};

#endif //_THERMAL_SOLVER_H_