unit BasicUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Spin, ComCtrls, ShellCtrls, DBCtrls, FileCtrl,
  Math, HCArrays, HCConduct, HCMaterial, HCModel, UPohMath, UPohStrConv;

function InitMat(var MatDtb: tMatDB; str:string):integer;
procedure InitModel(var model:tHCModel; L:double; InitTemp:double; MatID:integer; max_volL:double);

const
  mm=0.001;
  Cel_Kel=273.15;

implementation

function InitMat(var MatDtb: tMatDB; str:string):integer;
begin
  fHC_Init(MatDtb);
	fHC_LoadMatDB(MatDtb, PChar(ExtractFilePath(Application.ExeName) + 'MaterialDB.TXT'));
	fHC_Prepare(MatDtb);
  result := fHC_Find(MatDtb, PChar(str));
end;

procedure InitModel(var model:tHCModel; L:double; InitTemp:double; MatID:integer; max_volL:double);

begin
  fHC_Init(model);
	fHC_SetModelAccuracy(0.01 * mm);
  fHC_Create1D(model, 0, L, InitTemp+Cel_Kel, MatID, 0);
  fHC_ReduceVolSizeX(model, max_volL, 1, model.vBorderX.n - 1);
  fHC_PrepareModel(model);
end;

end.
