/*
sample2.c

OpenTHFDデータ作成ライブラリ、サンプルプログラム No.2

コンパイル+実行:
Windows + VC++:
> cl.exe /O2 sample2.c oth_datalib.c
> sample2.exe
Linux + gcc:
$ gcc -O sample2.c oth_datalib.c -o sample2
$ ./sample2
*/

#include "oth_datalib.h"

int main()
{
	// initialize

	oth_init();

	// title

	oth_title("sample2");

	// mesh

	oth_xsection(2, -150e-3, +150e-3);
	oth_xdivision(1, 30);

	oth_ysection(2, -150e-3, +150e-3);
	oth_ydivision(1, 30);

	oth_zsection(2, -150e-3, +150e-3);
	oth_zdivision(1, 30);

	// material

	//oth_material(2.0, 0.0, 1.0, 0.0);

	// geometry

	oth_geometry(1, 1, -50e-3, +50e-3, -50e-3, +50e-3, -50e-3, +50e-3);
	oth_geometry_name("cube");

	// source

	oth_planewave(90, 0, 1);

	// ABC

	//oth_pml(5, 2, 1e-5);

	// frequency

	oth_frequency(3e9, 3e9, 0);

	// solver

	oth_solver(2000, 100, 1e-6);

	// iteration

	oth_plotiter(1, 1);

	// frequency

	//oth_plotzin(1, 0, 0, 0);

	// far1d field

	oth_plotfar1d('Z', 180, 0);

	// far2d field

	oth_plotfar2d(18, 36);

	// near1d field

	oth_plotnear1d("E", 'X', 0e-3, 0e-3);

	// near2d field

	oth_plotnear2d("E", 'Z', 0e-3);

	// output options

	//oth_far1dstyle(1);
	//oth_far1dcomponent(1, 0, 0);
	//oth_far1ddb(1);
	//oth_far1dscale(-30, +10, 4);
	//oth_far2dcomponent(1, 0, 0, 0, 0, 0,0);
	//oth_far2ddb(1);
	//oth_far2dscale(-30, +10);
	//oth_near1ddb(1);
	//oth_near1dscale(-30, +10, 4);
	//oth_near1dexclude();
	//oth_near2ddb(1);
	//oth_near2dscale(-30, +10);
	//oth_near2dcontour(0);
	//oth_near2dobj(1);
	//oth_near2dexclude();
	//oth_window2d(600, 400, 12, 0);
	//oth_window3d(500, 500, 10, 60, 30);

	// output

	oth_outdata("sample2.oth");

	return 0;
}
