Why this message :Warning: Unused primitive (type: LinPoly)

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
jam
Posts: 18
Joined: Wed 28 Mar 2012, 00:17

Why this message :Warning: Unused primitive (type: LinPoly)

Post by jam » Sun 01 Apr 2012, 18:46

I would like to understand how to insure that this message never appears. At first, I thought that the mesh size was involved but after many tests, it does not seem so. When this message appears on an electrode source, the source is not activated which means that nothing is happening at any step.
Any help would be welcome.
Thanks

sebastian
Posts: 114
Joined: Mon 27 Jun 2011, 12:36
Contact:

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by sebastian » Sun 01 Apr 2012, 19:52

This warning tells you, that the choosen mesh does not provide an edge to map the primitive on.
Have a look at your structure using the AppCSXCAD viewer and zoom in on your primitive. Check that the mesh is fine enough.

It also may be a problem with floating point accuracy. Values like 1/3 cannot be represented as floats and constructing the mesh with numbers like this and afterwards putting a primitive at the very same value may nevertheless lead to different truncated floats.

The last resort is to have a look at the generated xml file.

Sebastian

jam
Posts: 18
Joined: Wed 28 Mar 2012, 00:17

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by jam » Sun 01 Apr 2012, 22:53

I cannot see anything wrong by zooming. All the electrode part is there. Still I get zero energy and zero excitation.
Should I see a different color for unused primitive?

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

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by thorsten » Mon 02 Apr 2012, 14:30

Hello jam,

keep in mind that an electric field excitation is taking place on the edges of an FDTD cell. Have a look at the FDTD article on Wikipedia for example.
This means: Your primitive may be intersecting with a cell node, but it is more important that it intersects with an edge. For example, if you want to excite an E-Field in x-direction, the primitive should span over 1 cell in x-direction and can be exactly on a line in y- and z- direction. Additionally you may want to avoid infinite floating points as Sebastian mentioned...

You may also just attach your m-file, so that I can have a look and give you some feedback...

regards
Thorsten

jam
Posts: 18
Joined: Wed 28 Mar 2012, 00:17

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by jam » Thu 05 Apr 2012, 00:31

Thank you for the explanation. I have solve the problem by using a rotated Box instead of a rotated LinPoly.

I don't see how can a source be positioned as accurately as you suggest if you have millions of cells and the source is not orthogonal to the mesh!

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

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by thorsten » Thu 05 Apr 2012, 08:44

With just a surface object, this should be impossible. What you should do is use a thin slab. E.g. a box with a thickness of 1 or 2 cells and rotate this box. Thereby you should hit enough E-fields to excite.

I'm curious if all this works as you intent. Please keep me informed about your progress...

regards
Thorsten

dlharmon
Posts: 6
Joined: Sun 17 Feb 2013, 01:44

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by dlharmon » Sun 17 Feb 2013, 02:11

I'm getting this same warning and simulation results the same as if the metal I am adding does not exist. I have simplified my model so that I am creating a box using AddLinPoly(). If I create the same thing with AddBox, it works fine. Also, I can create it with no thickness using AddPolygon().

There are multiple mesh lines across the width of the metal created by AddLinPoly and a mesh line at the top and bottom in Z. The metal appears in the geometry preview. I would appreciate any help. I am using version v0.0.30.

This gives the error:

Code: Select all

xpoints = [ms_xmin, ms_xmin, ms_xmax, ms_xmax];
ypoints = [ms1_ymin, ms1_ymax, ms1_ymax, ms1_ymin];
points = cat(1,xpoints,ypoints);
CSX = AddLinPoly( CSX, 'copper', 3, 2, substrate_top, points, foil_thickness);
Dropping back to AddPolygon() works:

Code: Select all

xpoints = [ms_xmin, ms_xmin, ms_xmax, ms_xmax];
ypoints = [ms1_ymin, ms1_ymax, ms1_ymax, ms1_ymin];
points = cat(1,xpoints,ypoints);
CSX = AddPolygon( CSX, 'copper', 3, 2, substrate_top, points);
Using AddBox() works:

Code: Select all

start = [ms_xmin, ms1_ymin, substrate_top];
stop  = [ms_xmax, ms1_ymax, foil_top];
CSX = AddBox( CSX, 'copper', 1, start, stop );
Thanks,
Darrell Harmon

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

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by thorsten » Sun 17 Feb 2013, 10:57

Hi,

I don't see any obvious error. Maybe the LinPoly has a bug. I have never really used it so it would be possible.

Have you tried:

Code: Select all

xpoints = [ms_xmin, ms_xmin, ms_xmax, ms_xmax];
ypoints = [ms1_ymin, ms1_ymax, ms1_ymax, ms1_ymin];
points = cat(1,xpoints,ypoints);
CSX = AddLinPoly( CSX, 'copper', 3, 2, substrate_top-foil_thickness/2, points, foil_thickness);
What happens?

I will have a look what is going wrong...

By the way, do you want to simulate a finite thick copper sheet? Usually it is impossible to resolve a thickness in micrometer scale.
If you really want to simulate the losses of copper and the skin-effects etc. you should use the Conducting Sheet model "AddConductingSheet" and only use a 2D box or polygon.
But I still need to do some validation for that model.

regards
Thorsten

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

Re: Why this message :Warning: Unused primitive (type: LinPo

Post by thorsten » Sun 17 Feb 2013, 11:52

Hi,

I found the bug, it is a bad one :(
It will be fixed for v0.0.31!

Workaround: Apply a (useless) transformation:

Code: Select all

xpoints = [ms_xmin, ms_xmin, ms_xmax, ms_xmax];
ypoints = [ms1_ymin, ms1_ymax, ms1_ymax, ms1_ymin];
points = cat(1,xpoints,ypoints);
CSX = AddLinPoly( CSX, 'copper', 3, 2, substrate_top, points, foil_thickness,'Transform',{'Translate',[0 0 0]});
That should circumvent the bug...

But keep in mind, that polygon still suffer from the problem that points exactly ON the boundary are not detected properly as discussed here: http://openems.de/forum/viewtopic.php?f=3&t=112
I have not found a solution to that problem yet.
My recommendation, use a (transformed) box if possible...

regards
Thorsten

Post Reply