Install OK on Windows but problem on Ubuntu

Install support for openEMS

Moderators: thorsten, sebastian

Post Reply
wdbwdb1
Posts: 2
Joined: Wed 03 Feb 2021, 08:50

Install OK on Windows but problem on Ubuntu

Post by wdbwdb1 » Wed 03 Feb 2021, 10:03

Hello and thank you so much for the excellent software, I am working with the IFA example here: https://github.com/thliebig/openEMS/blo ... verted_f.m

I have everything working fine on Windows 10 but having a problem on Ubuntu. I am using Ubuntu 20.04.1 LTS in VMWare, Octave 5.2.0 and openEMS 64bit version v0.0.35. Also I have not run a successful simulation on Ubuntu at all yet with any example. I am using these instructions and have installed everything on the page, all optional were installed also: https://github.com/thliebig/openEMS-Project

Then updated with this:

Code: Select all

./update_openEMS.sh ~/opt/openEMS --with-hyp2mat --with-CTB --with-MPI
Here is the output when running "openEMS" (if I enter "./openEMS" it says this is a directory, I don't have much experience with Linux btw) in terminal (main terminal, not Octave) from "openEMS-project" directory:

Code: Select all

 ---------------------------------------------------------------------- 
 | openEMS 64bit -- version v0.0.35
 | (C) 2010-2018 Thorsten Liebig <thorsten.liebig@gmx.de>  GPL license
 ---------------------------------------------------------------------- 
	Used external libraries:
		CSXCAD -- Version: v0.6.2
		hdf5   -- Version: 1.10.4
		          compiled against: HDF5 library version: 1.10.4
		tinyxml -- compiled against: 2.6.2
		fparser
		boost  -- compiled against: 1_71
		vtk -- Version: 7.1.1
		       compiled against: 7.1.1

 Usage: openEMS <FDTD_XML_FILE> [<options>...]

 <options>
	--disable-dumps		Disable all field dumps for faster simulation
	--debug-material	Dump material distribution to a vtk file for debugging
	--debug-PEC		Dump metal distribution to a vtk file for debugging
	--debug-operator	Dump operator to vtk file for debugging
	--debug-boxes		Dump e.g. probe boxes to vtk file for debugging
	--debug-CSX		Write CSX geometry file to debugCSX.xml
	--engine=<type>		Choose engine type
		--engine=fastest		fastest available engine (default)
		--engine=basic			basic FDTD engine
		--engine=sse			engine using sse vector extensions
		--engine=sse-compressed		engine using compressed operator + sse vector extensions
		--engine=multithreaded		engine using compressed operator + sse vector extensions + multithreading
	--numThreads=<n>	Force use n threads for multithreaded engine (needs: --engine=multithreaded)
	--no-simulation		only run preprocessing; do not simulate
	--dump-statistics	dump simulation statistics to 'openEMS_run_stats.txt' and 'openEMS_stats.txt'

	 Additional global arguments 
	--showProbeDiscretization	Show probe discretization information
	--nativeFieldDumps		Dump all fields using the native field components
	-v,-vv,-vvv			Set debug level: 1 to 3
I asked a question on Facebook and got this reply, the question involved installation of pcbmodelgen also but I will figure pcbmodelgen out later:
First step is install openEMS
Second step, you need to add the following lines to the simulation_script.m indicating to octave where is located OpenEMS in, to my case:
addpath('/home/ingdesarrollo/opt/openEMS/share/openEMS/matlab');
addpath('/home/ingdesarrollo/opt/openEMS/share/CSXCAD/matlab');
addpath('/home/ingdesarrollo/opt/openEMS/share/hyp2mat/matlab');
addpath('/home/ingdesarrollo/opt/openEMS/share/CTB/matlab');

Also you need to install the octave package miscellaneous in order to be able to run the script physical_constants, which loads some constants like epsilon_0 and mu_0 for the electromagnetic simulation.
https://octave.sourceforge.io/miscellaneous/
However I don't have simulation_script.m file, I am just copy and pasting the code directly into the Octave console (same as I do in Windows), so addpath lines are entered there as well.

When I run the IFA code by itself it works fine in Windows/Octave, but on Ubuntu/Octave I run the IFA code but have these lines at the top (my username is "ben"):

Code: Select all

addpath('/home/ben/opt/openEMS/share/openEMS/matlab');
addpath('/home/ben/opt/openEMS/share/CSXCAD/matlab');
addpath('/home/ben/opt/openEMS/share/hyp2mat/matlab');
addpath('/home/ben/opt/openEMS/share/CTB/matlab');
And here is the output of that:

Code: Select all

>> addpath('/home/ben/opt/openEMS/share/openEMS/matlab');
>> addpath('/home/ben/opt/openEMS/share/CSXCAD/matlab');
>> addpath('/home/ben/opt/openEMS/share/hyp2mat/matlab');
>> addpath('/home/ben/opt/openEMS/share/CTB/matlab');
>> close all
>> clear
a_mesh>> clc
>>
0>>
.>>
5>>
)>> %% setup the simulation
>> physical_constants;
>> unit = 1e-3; % all length in mm
>>
l>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %                substrate.width
>> %  _______________________________________________    __ substrate.
>> % | A                        ifa.l                |\  __    thickness
>> % | |ifa.e         __________________________     | |
>> % | |             |    ___  _________________| w2 | |
>> % | |       ifa.h |   |   ||                      | |
>> % |_V_____________|___|___||______________________| |
>> % |                .w1   .wf\                     | |
>> % |                   |.fp|  \                    | |
>> % |                       |    feed point         | |
>> % |                       |                       | | substrate.length
>> % |<- substrate.width/2 ->|                       | |
>> % |                                               | |
>> % |_______________________________________________| |
>> %  \_______________________________________________\|
>> %
X]>> % Note: It's not checked whether your settings make sense, so check
>> %       graphical output carefully.
>> %
un>> substrate.width  = 80;             % width of substrate
>> substrate.length = 80;             % length of substrate
>> substrate.thickness = 1.5;         % thickness of substrate
>> substrate.cells = 4;               % use 4 cells for meshing substrate
>>
.>> ifa.h  = 8;            % height of short circuit stub
>> ifa.l  = 22.5;         % length of radiating element
>> ifa.w1 = 4;            % width of short circuit stub
>> ifa.w2 = 2.5;          % width of radiating element
>> ifa.wf = 1;            % width of feed element
>> ifa.fp = 4;            % position of feed element relative to short
>>                        %  circuit stub
>> ifa.e  = 10;           % distance to edge
>>
e>>
c>> % substrate setup
>> substrate.epsR   = 4.3;
>> substrate.kappa  = 1e-3 * 2*pi*2.45e9 * EPS0*substrate.epsR;
>>
'>> %setup feeding
>> feed.R = 50;     %feed resistance
>>
n>> %open AppCSXCAD and show ifa
>> show = 1;
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> % size of the simulation box
>> SimBox = [substrate.width*2 substrate.length*2 150];
>>
(>> %% setup FDTD parameter & excitation function
>> f0 = 2.5e9; % center frequency
>> fc = 1e9; % 20 dB corner frequency
>>
>> FDTD = InitFDTD('NrTS',  60000 );
>> FDTD = SetGaussExcite( FDTD, f0, fc );
>> BC = {'MUR' 'MUR' 'MUR' 'MUR' 'MUR' 'MUR'}; % boundary conditions
>> FDTD = SetBoundaryCond( FDTD, BC );
>>
'>> %% setup CSXCAD geometry & mesh
>> CSX = InitCSX();
>>
>> %initialize the mesh with the "air-box" dimensions
>> mesh.x = [-SimBox(1)/2 SimBox(1)/2];
>> mesh.y = [-SimBox(2)/2 SimBox(2)/2];
>> mesh.z = [-SimBox(3)/2 SimBox(3)/2];
>>
m>> %% create substrate
>> CSX = AddMaterial( CSX, 'substrate');
>> CSX = SetMaterialProperty( CSX, 'substrate', 'Epsilon',substrate.epsR, 'Kappa', substrate.kappa);
>> start = [-substrate.width/2  -substrate.length/2                    0];
>> stop  = [ substrate.width/2   substrate.length/2  substrate.thickness];
>> CSX = AddBox( CSX, 'substrate', 1, start, stop );
>> % add extra cells to discretize the substrate thickness
>> mesh.z = [linspace(0,substrate.thickness,substrate.cells+1) mesh.z];
>>
>> %% create ground plane
>> CSX = AddMetal( CSX, 'groundplane' ); % create a perfect electric conductor (PEC)
>> start = [-substrate.width/2  -substrate.length/2        substrate.thickness];
>> stop  = [ substrate.width/2   substrate.length/2-ifa.e  substrate.thickness];
>> CSX = AddBox(CSX, 'groundplane', 10, start,stop);
>>
>> %% create ifa
>> CSX = AddMetal( CSX, 'ifa' ); % create a perfect electric conductor (PEC)
>> tl = [0,substrate.length/2-ifa.e,substrate.thickness];   % translate
>> start = [0 0.5 0] + tl;
>> stop = start + [ifa.wf ifa.h-0.5 0];
>> CSX = AddBox( CSX, 'ifa', 10,  start, stop);  % feed element
>> start = [-ifa.fp 0 0] + tl;
>> stop =  start + [-ifa.w1 ifa.h 0];
>> CSX = AddBox( CSX, 'ifa', 10,  start, stop);  % short circuit stub
>> start = [(-ifa.fp-ifa.w1) ifa.h 0] + tl;
>> stop = start + [ifa.l -ifa.w2 0];
>> CSX = AddBox( CSX, 'ifa', 10, start, stop);   % radiating element
>>
>> ifa_mesh = DetectEdges(CSX, [], 'SetProperty','ifa');
>> mesh.x = [mesh.x SmoothMeshLines(ifa_mesh.x, 0.5)];
>> mesh.y = [mesh.y SmoothMeshLines(ifa_mesh.y, 0.5)];
>>
>> %% apply the excitation & resist as a current source
>> start = [0 0 0] + tl;
>> stop  = start + [ifa.wf 0.5 0];
>> [CSX port] = AddLumpedPort(CSX, 5 ,1 ,feed.R, start, stop, [0 1 0], true);
>>
>> %% finalize the mesh
>> % generate a smooth mesh with max. cell size: lambda_min / 20
>> mesh = DetectEdges(CSX, mesh);
>> mesh = SmoothMesh(mesh, c0 / (f0+fc) / unit / 20);
>> CSX = DefineRectGrid(CSX, unit, mesh);
>>
>> %% add a nf2ff calc box; size is 3 cells away from MUR boundary condition
>> start = [mesh.x(4)     mesh.y(4)     mesh.z(4)];
>> stop  = [mesh.x(end-3) mesh.y(end-3) mesh.z(end-3)];
>> [CSX nf2ff] = CreateNF2FFBox(CSX, 'nf2ff', start, stop);
>>
>> %% prepare simulation folder
>> Sim_Path = 'tmp_IFA';
>> Sim_CSX = 'IFA.xml';
>>
>> try confirm_recursive_rmdir(false,'local'); end
warning: "local" has no effect outside a function
>>
>> [status, message, messageid] = rmdir( Sim_Path, 's' ); % clear previousdirectory
>> [status, message, messageid] = mkdir( Sim_Path ); % create empty simulation folder
>>
>> %% write openEMS compatible xml-file
>> WriteOpenEMS( [Sim_Path '/' Sim_CSX], FDTD, CSX );
>>
>> %% show the structure
>> if (show == 1)
  CSXGeomPlot( [Sim_Path '/' Sim_CSX] );
end
invoking AppCSXCAD, exit to continue script...
/home/ben/opt/openEMS/share/CSXCAD/matlab/../../../bin/AppCSXCAD: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared objectfile: No such file or directory
>>
>>
>> %% run openEMS
>> RunOpenEMS( Sim_Path, Sim_CSX);  %RunOpenEMS( Sim_Path, Sim_CSX, '--debug-PEC -v');
args = "IFA.xml"
/home/ben/opt/openEMS/share/openEMS/matlab/private/../../../../bin/openEMS: error while loading shared libraries: libmpi_cxx.so.40: cannot open shared object file: No such file or directory
error: openEMS binary exited with error-code 127
error: called from
    invoke_openEMS at line 50 column 2
    RunOpenEMS at line 181 column 9
>>
>> %% postprocessing & do the plots
>> freq = linspace( max([1e9,f0-fc]), f0+fc, 501 );
>> port = calcPort(port, Sim_Path, freq);
error: load: unable to find file tmp_IFA/port_ut1
error: called from
    ReadUI at line 64 column 9
    calcLumpedPort at line 76 column 3
    calcPort at line 71 column 10
>>
>> Zin = port.uf.tot ./ port.if.tot;
error: structure has no member 'uf'
>> s11 = port.uf.ref ./ port.uf.inc;
error: structure has no member 'uf'
>> P_in = real(0.5 * port.uf.tot .* conj( port.if.tot )); % antenna feed power
error: structure has no member 'uf'
>>
>> % plot feed point impedance
>> figure
>> plot( freq/1e6, real(Zin), 'k-', 'Linewidth', 2 );
error: 'Zin' undefined near line 1 column 22
>> hold on
>> grid on
>> plot( freq/1e6, imag(Zin), 'r--', 'Linewidth', 2 );
error: 'Zin' undefined near line 1 column 22
>> title( 'feed point impedance' );
>> xlabel( 'frequency f / MHz' );
>> ylabel( 'impedance Z_{in} / Ohm' );
>> legend( 'real', 'imag' );
warning: legend: plot data is empty; setting key labels has no effect
warning: called from
    legend at line 426 column 9
>>
>> % plot reflection coefficient S11
>> figure
>> plot( freq/1e6, 20*log10(abs(s11)), 'k-', 'Linewidth', 2 );
error: 's11' undefined near line 1 column 30
>> grid on
>> title( 'reflection coefficient S_{11}' );
>> xlabel( 'frequency f / MHz' );
>> ylabel( 'reflection coefficient |S_{11}|' );
>>
>> drawnow
>>
>> %% NFFF contour plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %find resonance frequncy from s11
>> f_res_ind = find(s11==min(s11));
error: 's11' undefined near line 3 column 18
>> f_res = freq(f_res_ind);
error: 'f_res_ind' undefined near line 1 column 14
>>
>> %%
>> disp( 'calculating 3D far field pattern and dumping to vtk (use Paraview to visualize)...' );
calculating 3D far field pattern and dumping to vtk (use Paraview to visualize)...
>> thetaRange = (0:2:180);
>> phiRange = (0:2:360) - 180;
>> nf2ff = CalcNF2FF(nf2ff, Sim_Path, f_res, thetaRange*pi/180, phiRange*pi/180,'Verbose',1,'Outfile','3D_Pattern.h5');
error: 'f_res' undefined near line 1 column 36
>>
>> plotFF3D(nf2ff)
error: structure has no member 'E_norm'
error: called from
    plotFF3D at line 49 column 11
>>
>> % display power and directivity
>> disp( ['radiated power: Prad = ' num2str(nf2ff.Prad) ' Watt']);
error: structure has no member 'Prad'
>> disp( ['directivity: Dmax = ' num2str(nf2ff.Dmax) ' (' num2str(10*log10(nf2ff.Dmax)) ' dBi)'] );
error: structure has no member 'Dmax'
>> disp( ['efficiency: nu_rad = ' num2str(100*nf2ff.Prad./real(P_in(f_res_ind))) ' %']);
error: structure has no member 'Prad'
>>
>> E_far_normalized = nf2ff.E_norm{1} / max(nf2ff.E_norm{1}(:)) * nf2ff.Dmax;
error: structure has no member 'E_norm'
>> DumpFF2VTK([Sim_Path '/3D_Pattern.vtk'],E_far_normalized,thetaRange,phiRange,1e-3);
Everything works fine on the "First Steps" tutorial: http://www.openems.de/index.php/Tutoria ... Steps.html
...except when I run this, along w/ the result:

Code: Select all

>> RunOpenEMS( '.', 'nonexistant.xml', '' )
args = "nonexistant.xml"
/home/ben/opt/openEMS/share/openEMS/matlab/private/../../../../bin/openEMS: error while loading shared libraries: libmpi_cxx.so.40: cannot open shared object file: No such file or directory
error: openEMS binary exited with error-code 127
error: called from
    invoke_openEMS at line 50 column 2
    RunOpenEMS at line 181 column 9
I tried to install Octave Forge miscellaneous package in Octave terminal (not sure if related to openEMS) with this command and the resulting output:

Code: Select all

>> pkg install -forge miscellaneous
configure: error: Unable to find ncurses library headers.
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking term.h usability... no
checking term.h presence... no
checking for term.h... no
checking termcap.h usability... no
checking termcap.h presence... no
checking for termcap.h... no
checking ncurses/termcap.h usability... no
checking ncurses/termcap.h presence... no
checking for ncurses/termcap.h... no

pkg: error running the configure script for miscellaneous.
error: called from
    configure_make at line 82 column 9
    install at line 190 column 7
    pkg at line 441 column 9
Any help would be greatly appreciated. Thanks.

thorsten
Posts: 1438
Joined: Mon 27 Jun 2011, 12:26

Re: Install OK on Windows but problem on Ubuntu

Post by thorsten » Sat 06 Feb 2021, 13:58

Try to install the latest dev version. 0.0.35 is very old already:
https://github.com/thliebig/openEMS-Pro ... nd-install

The important part is the git clone of the master branch.

wdbwdb1
Posts: 2
Joined: Wed 03 Feb 2021, 08:50

Re: Install OK on Windows but problem on Ubuntu

Post by wdbwdb1 » Tue 09 Feb 2021, 09:35

Thank you very much for the reply, I'm still having some undefined errors in IFA code and openEMS version did not change, I reinstalled and now this what I see when entering "openEMS" (the original install that didn't work last time was less than a month ago) I deleted the "openEMS-Project" folder before reinstalling:

Code: Select all

ben@ben-virtual-machine:~/openEMS-Project$ openEMS
 ---------------------------------------------------------------------- 
 | openEMS 64bit -- version v0.0.35
 | (C) 2010-2018 Thorsten Liebig <thorsten.liebig@gmx.de>  GPL license
 ---------------------------------------------------------------------- 
	Used external libraries:
		CSXCAD -- Version: v0.6.2
		hdf5   -- Version: 1.10.4
		          compiled against: HDF5 library version: 1.10.4
		tinyxml -- compiled against: 2.6.2
		fparser
		boost  -- compiled against: 1_71
		vtk -- Version: 7.1.1
		       compiled against: 7.1.1

 Usage: openEMS <FDTD_XML_FILE> [<options>...]

 <options>
	--disable-dumps		Disable all field dumps for faster simulation
	--debug-material	Dump material distribution to a vtk file for debugging
	--debug-PEC		Dump metal distribution to a vtk file for debugging
	--debug-operator	Dump operator to vtk file for debugging
	--debug-boxes		Dump e.g. probe boxes to vtk file for debugging
	--debug-CSX		Write CSX geometry file to debugCSX.xml
	--engine=<type>		Choose engine type
		--engine=fastest		fastest available engine (default)
		--engine=basic			basic FDTD engine
		--engine=sse			engine using sse vector extensions
		--engine=sse-compressed		engine using compressed operator + sse vector extensions
		--engine=multithreaded		engine using compressed operator + sse vector extensions + multithreading
	--numThreads=<n>	Force use n threads for multithreaded engine (needs: --engine=multithreaded)
	--no-simulation		only run preprocessing; do not simulate
	--dump-statistics	dump simulation statistics to 'openEMS_run_stats.txt' and 'openEMS_stats.txt'

	 Additional global arguments 
	--showProbeDiscretization	Show probe discretization information
	--nativeFieldDumps		Dump all fields using the native field components
	-v,-vv,-vvv			Set debug level: 1 to 3
==============================================
INITIAL MAIN INSTALLATION AND OUTPUT
==============================================

Code: Select all

ben@ben-virtual-machine:~$ git clone --recursive https://github.com/thliebig/openEMS-Project.git
Cloning into 'openEMS-Project'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 336 (delta 2), reused 6 (delta 2), pack-reused 329
Receiving objects: 100% (336/336), 70.29 KiB | 2.70 MiB/s, done.
Resolving deltas: 100% (169/169), done.
Submodule 'AppCSXCAD' (https://github.com/thliebig/AppCSXCAD.git) registered for path 'AppCSXCAD'
Submodule 'CSXCAD' (https://github.com/thliebig/CSXCAD.git) registered for path 'CSXCAD'
Submodule 'CTB' (https://github.com/thliebig/CTB.git) registered for path 'CTB'
Submodule 'QCSXCAD' (https://github.com/thliebig/QCSXCAD.git) registered for path 'QCSXCAD'
Submodule 'fparser' (https://github.com/thliebig/fparser.git) registered for path 'fparser'
Submodule 'hyp2mat' (https://github.com/koendv/hyp2mat.git) registered for path 'hyp2mat'
Submodule 'openEMS' (https://github.com/thliebig/openEMS.git) registered for path 'openEMS'
Cloning into '/home/ben/openEMS-Project/AppCSXCAD'...
remote: Enumerating objects: 247, done.        
remote: Total 247 (delta 0), reused 0 (delta 0), pack-reused 247        
Receiving objects: 100% (247/247), 48.13 KiB | 770.00 KiB/s, done.
Resolving deltas: 100% (148/148), done.
Cloning into '/home/ben/openEMS-Project/CSXCAD'...
remote: Enumerating objects: 2964, done.        
remote: Total 2964 (delta 0), reused 0 (delta 0), pack-reused 2964        
Receiving objects: 100% (2964/2964), 969.79 KiB | 2.39 MiB/s, done.
Resolving deltas: 100% (1898/1898), done.
Cloning into '/home/ben/openEMS-Project/CTB'...
remote: Enumerating objects: 47, done.        
remote: Total 47 (delta 0), reused 0 (delta 0), pack-reused 47        
Cloning into '/home/ben/openEMS-Project/QCSXCAD'...
remote: Enumerating objects: 791, done.        
remote: Total 791 (delta 0), reused 0 (delta 0), pack-reused 791        
Receiving objects: 100% (791/791), 774.11 KiB | 1.96 MiB/s, done.
Resolving deltas: 100% (522/522), done.
Cloning into '/home/ben/openEMS-Project/fparser'...
remote: Enumerating objects: 89, done.        
remote: Total 89 (delta 0), reused 0 (delta 0), pack-reused 89        
Cloning into '/home/ben/openEMS-Project/hyp2mat'...
remote: Enumerating objects: 3, done.        
remote: Counting objects: 100% (3/3), done.        
remote: Compressing objects: 100% (3/3), done.        
remote: Total 1780 (delta 0), reused 1 (delta 0), pack-reused 1777        
Receiving objects: 100% (1780/1780), 3.55 MiB | 6.17 MiB/s, done.
Resolving deltas: 100% (1134/1134), done.
Cloning into '/home/ben/openEMS-Project/openEMS'...
remote: Enumerating objects: 83, done.        
remote: Counting objects: 100% (83/83), done.        
remote: Compressing objects: 100% (57/57), done.        
remote: Total 7292 (delta 30), reused 47 (delta 26), pack-reused 7209        
Receiving objects: 100% (7292/7292), 4.58 MiB | 18.91 MiB/s, done.
Resolving deltas: 100% (4218/4218), done.
Submodule path 'AppCSXCAD': checked out 'de8c271ec8b57e80233cb2a432e3d7fd54d30876'
Submodule path 'CSXCAD': checked out 'ef6e40931dbd80e0959f37c8e9614c437bf7e518'
Submodule path 'CTB': checked out '5ac29367ebb7e30e78dd3db13a21464756855599'
Submodule path 'QCSXCAD': checked out '0dabbaf2bc1190adec300871cf309791af842c8e'
Submodule path 'fparser': checked out 'a59e1f51e32096bfe2a0a2640d5dffc7ae6ba37b'
Submodule path 'hyp2mat': checked out 'b15f749849610066e6c09da5b5e3f97e3317ba8a'
Submodule path 'openEMS': checked out '9017d9159465436361b1bd465ba3eef90dbbb90f'
ben@ben-virtual-machine:~$ cd openEMS-Project
ben@ben-virtual-machine:~/openEMS-Project$ ./update_openEMS.sh ~/opt/openEMS
setting install path to: /home/ben/opt/openEMS
logging build output to: /home/ben/openEMS-Project/build_20210208_225113.log
running cmake in tmp dir: /tmp/tmp.20B9xynAP3
build openEMS and dependencies ... please wait
build successful, cleaning up tmp dir ...
 -------- 
openEMS and all modules have been updated successfully...

% add the required paths to Octave/Matlab:
addpath('/home/ben/opt/openEMS/share/openEMS/matlab')
addpath('/home/ben/opt/openEMS/share/CSXCAD/matlab')

% optional additional pckages:

Have fun using openEMS
ben@ben-virtual-machine:~/openEMS-Project$ 
==============================================
UPDATE INSTALLATION AND OUTPUT
==============================================

Here is update install and output:

Code: Select all

ben@ben-virtual-machine:~/openEMS-Project$ ./update_openEMS.sh ~/opt/openEMS --with-hyp2mat --with-CTB --with-MPI
enabling hyp2mat build
enabling CTB build
enabling MPI
setting install path to: /home/ben/opt/openEMS
logging build output to: /home/ben/openEMS-Project/build_20210208_230100.log
running cmake in tmp dir: /tmp/tmp.JQCxadl8e1
build openEMS and dependencies ... please wait
build successful, cleaning up tmp dir ...
bootstrapping hyp2mat ... please wait
configure.ac:33: installing 'config/compile'
configure.ac:36: installing 'config/config.guess'
configure.ac:36: installing 'config/config.sub'
configure.ac:8: installing 'config/install-sh'
configure.ac:8: installing 'config/missing'
lib/Makefile.am: installing 'config/depcomp'
configure.ac: installing 'config/ylwrap'
configuring hyp2mat ... please wait
compiling hyp2mat ... please wait
parse.yyparse.yy:21.1-5:21: .1-5warning::  warning:POSIX Yacc does not support %code [ -Wyacc]POSIX Yacc does not support %code
 [-Wyacc]
   21 | %code requires {
      | ^~~~~
   21 | parse.yy:26%.1c-14o: dewarning:  requirPOSIX Yacc does not support %error-verbosee [s-Wyacc {]

      | ^~~~   26 | %e~r
ror-verbose
      | ^~~parse.yy:26~.1~-14~~: ~warning:~ ~POSIX Yacc does not support %error-verbose~ [~-Wyacc]~
~
   26 | %error-verbose
      | ^~~~~~~~~~~~~~
parse.yy:26.1-14: warning: deprecated directive: ‘%error-verbose’, use ‘%define parse.error verbose’ [-Wdeprecated]
parse.yy   26 | :26%.1e-14: rrwarning:o rdeprecated directive: ‘%error-verbose’, use ‘%define parse.error verbose’-ve [rb-Wdeprecatedo]s
e   26 | 
%e      | r^~~r~o~r~-~~~v~e~r~b~os~e

      |       | %define parse.error verbose^
~~~~~~~~~~~~~
      | %define parse.error verboseparse.yy
:28.1-8: warning: POSIX Yacc does not support %defines [-Wyacc]parse.yy:28
.1-8:    28 | warning:% dPOSIX Yacc does not support %definesefi [ne-Wyaccs]

      | ^~~~~~~~
   28 | %defines
      | ^~~~~~~~
parse.yy: warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
parse.yy: warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
installing hyp2mat ... please wait
installing CTB ... please wait
 -------- 
openEMS and all modules have been updated successfully...

% add the required paths to Octave/Matlab:
addpath('/home/ben/opt/openEMS/share/openEMS/matlab')
addpath('/home/ben/opt/openEMS/share/CSXCAD/matlab')

% optional additional pckages:
addpath('/home/ben/opt/openEMS/share/hyp2mat/matlab'); % hyp2mat package
addpath('/home/ben/opt/openEMS/share/CTB/matlab'); % circuit toolbox

Have fun using openEMS
And here is when I run the IFA code:

Code: Select all

>> addpath('/home/ben/opt/openEMS/share/openEMS/matlab');
>> addpath('/home/ben/opt/openEMS/share/CSXCAD/matlab');
>> addpath('/home/ben/opt/openEMS/share/hyp2mat/matlab');
>> addpath('/home/ben/opt/openEMS/share/CTB/matlab');
>> close all
>> clear
esh.y,>> clc
>>
)>> %% setup the simulation
>> physical_constants;
>> unit = 1e-3; % all length in mm
rrent source
start = [0 0 0] + t>>
l>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %                substrate.width
>> %  _______________________________________________    __ substrate.
>> % | A                        ifa.l                |\  __    thickness
>> % | |ifa.e         __________________________     | |
>> % | |             |    ___  _________________| w2 | |
>> % | |       ifa.h |   |   ||                      | |
>> % |_V_____________|___|___||______________________| |
>> % |                .w1   .wf\                     | |
>> % |                   |.fp|  \                    | |
>> % |                       |    feed point         | |
>> % |                       |                       | | substrate.length
>> % |<- substrate.width/2 ->|                       | |
>> % |                                               | |
>> % |_______________________________________________| |
>> %  \_______________________________________________\|
>> %
X]>> % Note: It's not checked whether your settings make sense, so check
>> %       graphical output carefully.
>> %
un>> substrate.width  = 80;             % width of substrate
>> substrate.length = 80;             % length of substrate
>> substrate.thickness = 1.5;         % thickness of substrate
>> substrate.cells = 4;               % use 4 cells for meshing substrate
>>
.>> ifa.h  = 8;            % height of short circuit stub
>> ifa.l  = 22.5;         % length of radiating element
>> ifa.w1 = 4;            % width of short circuit stub
>> ifa.w2 = 2.5;          % width of radiating element
>> ifa.wf = 1;            % width of feed element
>> ifa.fp = 4;            % position of feed element relative to short
>>                        %  circuit stub
>> ifa.e  = 10;           % distance to edge
>>
e>>
c>> % substrate setup
>> substrate.epsR   = 4.3;
>> substrate.kappa  = 1e-3 * 2*pi*2.45e9 * EPS0*substrate.epsR;
>>
'>> %setup feeding
>> feed.R = 50;     %feed resistance
>>
n>> %open AppCSXCAD and show ifa
>> show = 1;
>>
f>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> % size of the simulation box
>> SimBox = [substrate.width*2 substrate.length*2 150];
>>
>> %% setup FDTD parameter & excitation function
(s11==min(s11));
f_res = freq(f_res_ind);

%%
d>> f0 = 2.5e9; % center frequency
>> fc = 1e9; % 20 dB corner frequency
>>
a>> FDTD = InitFDTD('NrTS',  60000 );
>> FDTD = SetGaussExcite( FDTD, f0, fc );
>> BC = {'MUR' 'MUR' 'MUR' 'MUR' 'MUR' 'MUR'}; % boundary conditions
>> FDTD = SetBoundaryCond( FDTD, BC );
>>
'>> %% setup CSXCAD geometry & mesh
>> CSX = InitCSX();
>>
w>> %initialize the mesh with the "air-box" dimensions
>> mesh.x = [-SimBox(1)/2 SimBox(1)/2];
>> mesh.y = [-SimBox(2)/2 SimBox(2)/2];
>> mesh.z = [-SimBox(3)/2 SimBox(3)/2];
>>
m>> %% create substrate
>> CSX = AddMaterial( CSX, 'substrate');
>> CSX = SetMaterialProperty( CSX, 'substrate', 'Epsilon',substrate.epsR, 'Kappa', substrate.kappa);
>> start = [-substrate.width/2  -substrate.length/2                    0];
>> stop  = [ substrate.width/2   substrate.length/2  substrate.thickness];
>> CSX = AddBox( CSX, 'substrate', 1, start, stop );
>> % add extra cells to discretize the substrate thickness
>> mesh.z = [linspace(0,substrate.thickness,substrate.cells+1) mesh.z];
>>
>> %% create ground plane
>> CSX = AddMetal( CSX, 'groundplane' ); % create a perfect electric conductor (PEC)
>> start = [-substrate.width/2  -substrate.length/2        substrate.thickness];
>> stop  = [ substrate.width/2   substrate.length/2-ifa.e  substrate.thickness];
>> CSX = AddBox(CSX, 'groundplane', 10, start,stop);
>>
>> %% create ifa
>> CSX = AddMetal( CSX, 'ifa' ); % create a perfect electric conductor (PEC)
>> tl = [0,substrate.length/2-ifa.e,substrate.thickness];   % translate
>> start = [0 0.5 0] + tl;
>> stop = start + [ifa.wf ifa.h-0.5 0];
>> CSX = AddBox( CSX, 'ifa', 10,  start, stop);  % feed element
>> start = [-ifa.fp 0 0] + tl;
>> stop =  start + [-ifa.w1 ifa.h 0];
>> CSX = AddBox( CSX, 'ifa', 10,  start, stop);  % short circuit stub
>> start = [(-ifa.fp-ifa.w1) ifa.h 0] + tl;
>> stop = start + [ifa.l -ifa.w2 0];
>> CSX = AddBox( CSX, 'ifa', 10, start, stop);   % radiating element
>>
>> ifa_mesh = DetectEdges(CSX, [], 'SetProperty','ifa');
>> mesh.x = [mesh.x SmoothMeshLines(ifa_mesh.x, 0.5)];
>> mesh.y = [mesh.y SmoothMeshLines(ifa_mesh.y, 0.5)];
>>
>> %% apply the excitation & resist as a current source
>> start = [0 0 0] + tl;
>> stop  = start + [ifa.wf 0.5 0];
>> [CSX port] = AddLumpedPort(CSX, 5 ,1 ,feed.R, start, stop, [0 1 0], true);
>>
>> %% finalize the mesh
>> % generate a smooth mesh with max. cell size: lambda_min / 20
>> mesh = DetectEdges(CSX, mesh);
>> mesh = SmoothMesh(mesh, c0 / (f0+fc) / unit / 20);
>> CSX = DefineRectGrid(CSX, unit, mesh);
>>
>> %% add a nf2ff calc box; size is 3 cells away from MUR boundary condition
>> start = [mesh.x(4)     mesh.y(4)     mesh.z(4)];
>> stop  = [mesh.x(end-3) mesh.y(end-3) mesh.z(end-3)];
>> [CSX nf2ff] = CreateNF2FFBox(CSX, 'nf2ff', start, stop);
>>
>> %% prepare simulation folder
>> Sim_Path = 'tmp_IFA';
>> Sim_CSX = 'IFA.xml';
>>
>> try confirm_recursive_rmdir(false,'local'); end
warning: "local" has no effect outside a function
>>
>> [status, message, messageid] = rmdir( Sim_Path, 's' ); % clear previousdirectory
>> [status, message, messageid] = mkdir( Sim_Path ); % create empty simulation folder
>>
>> %% write openEMS compatible xml-file
>> WriteOpenEMS( [Sim_Path '/' Sim_CSX], FDTD, CSX );
>>
>> %% show the structure
>> if (show == 1)
  CSXGeomPlot( [Sim_Path '/' Sim_CSX] );
end
invoking AppCSXCAD, exit to continue script...
/home/ben/opt/openEMS/share/CSXCAD/matlab/../../../bin/AppCSXCAD: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared objectfile: No such file or directory
>>
>>
>> %% run openEMS
>> RunOpenEMS( Sim_Path, Sim_CSX);  %RunOpenEMS( Sim_Path, Sim_CSX, '--debug-PEC -v');
args = "IFA.xml"
/home/ben/opt/openEMS/share/openEMS/matlab/private/../../../../bin/openEMS: error while loading shared libraries: libmpi_cxx.so.40: cannot open shared object file: No such file or directory
error: openEMS binary exited with error-code 127
error: called from
    invoke_openEMS at line 50 column 2
    RunOpenEMS at line 181 column 9
>>
>> %% postprocessing & do the plots
>> freq = linspace( max([1e9,f0-fc]), f0+fc, 501 );
>> port = calcPort(port, Sim_Path, freq);
error: load: unable to find file tmp_IFA/port_ut1
error: called from
    ReadUI at line 64 column 9
    calcLumpedPort at line 76 column 3
    calcPort at line 71 column 10
>>
>> Zin = port.uf.tot ./ port.if.tot;
error: structure has no member 'uf'
>> s11 = port.uf.ref ./ port.uf.inc;
error: structure has no member 'uf'
>> P_in = real(0.5 * port.uf.tot .* conj( port.if.tot )); % antenna feed power
error: structure has no member 'uf'
>>
>> % plot feed point impedance
>> figure
>> plot( freq/1e6, real(Zin), 'k-', 'Linewidth', 2 );
error: 'Zin' undefined near line 1 column 22
>> hold on
>> grid on
>> plot( freq/1e6, imag(Zin), 'r--', 'Linewidth', 2 );
error: 'Zin' undefined near line 1 column 22
>> title( 'feed point impedance' );
>> xlabel( 'frequency f / MHz' );
>> ylabel( 'impedance Z_{in} / Ohm' );
>> legend( 'real', 'imag' );
warning: legend: plot data is empty; setting key labels has no effect
warning: called from
    legend at line 426 column 9
>>
>> % plot reflection coefficient S11
>> figure
>> plot( freq/1e6, 20*log10(abs(s11)), 'k-', 'Linewidth', 2 );
error: 's11' undefined near line 1 column 30
>> grid on
>> title( 'reflection coefficient S_{11}' );
>> xlabel( 'frequency f / MHz' );
>> ylabel( 'reflection coefficient |S_{11}|' );
>>
>> drawnow
>>
>> %% NFFF contour plots %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> %find resonance frequncy from s11
>> f_res_ind = find(s11==min(s11));
error: 's11' undefined near line 3 column 18
>> f_res = freq(f_res_ind);
error: 'f_res_ind' undefined near line 1 column 14
>>
>> %%
>> disp( 'calculating 3D far field pattern and dumping to vtk (use Paraview to visualize)...' );
calculating 3D far field pattern and dumping to vtk (use Paraview to visualize)...
>> thetaRange = (0:2:180);
>> phiRange = (0:2:360) - 180;
>> nf2ff = CalcNF2FF(nf2ff, Sim_Path, f_res, thetaRange*pi/180, phiRange*pi/180,'Verbose',1,'Outfile','3D_Pattern.h5');
error: 'f_res' undefined near line 1 column 36
>>
>> plotFF3D(nf2ff)
error: structure has no member 'E_norm'
error: called from
    plotFF3D at line 49 column 11
>>
>> % display power and directivity
>> disp( ['radiated power: Prad = ' num2str(nf2ff.Prad) ' Watt']);
error: structure has no member 'Prad'
>> disp( ['directivity: Dmax = ' num2str(nf2ff.Dmax) ' (' num2str(10*log10(nf2ff.Dmax)) ' dBi)'] );
error: structure has no member 'Dmax'
>> disp( ['efficiency: nu_rad = ' num2str(100*nf2ff.Prad./real(P_in(f_res_ind))) ' %']);
error: structure has no member 'Prad'
>>
>> E_far_normalized = nf2ff.E_norm{1} / max(nf2ff.E_norm{1}(:)) * nf2ff.Dmax;
error: structure has no member 'E_norm'
>> DumpFF2VTK([Sim_Path '/3D_Pattern.vtk'],E_far_normalized,thetaRange,phiRange,1e-3);
error: 'E_far_normalized' undefined near line 1 column 41
Can you tell from the error messages what the problem is? And I wonder why openEMS version is not updating? Did I type something wrong? What is the current version? Thank you so much for your time.

Post Reply