Example "Comsol" does not show the component

@ hschindl
Hi, hschindl,

I found the component gem does not show in the Example “Comsol”, I tried to install the Garfield++ again, but the situation is the same, I don’t know the reason, could you please help me?
Thanks very much.

Best regards,
Jiechen

Hi,
you mean the gem executable produced by building this example?

What steps did you do to build it?

Yes, I just built the default files, but the plot didn’t show the component gem.
As you can see the following output plots. Only tracks are shown.
The plot codes are also shown here.
code

Hi,

Indeed, the ComponentCOMSOL class is currently configured to only import the mesh, material properties, and potential values of the domains identified as the gas medium (with eps_r = 1). As a result, the components not associated with these domains are not plotted in the graphs you’ve generated, since their information isn’t saved.

Maybe we should clarify this in the example.

I hope this helps.

Kind regards,

Djunes

Hi, djjansse,
Thanks for explanation, I check the function “SetGas()” in the source file, the function only associates with a relative permittivity of unity to a given Medium class. So I modified the permittivity value of gem with 1 (default value is 4), then the graph shows the gem.
I also curious about why the following code could not work,
MediumPlastic pl;// just assume the gem material
fm.SetMedium(1, &pl);
fm.SetMedium(0, &gas);
Although I add the gem component, but the graph would not show the gem.
Thanks for helping.

Best regards,
Jiechen

Hi @jiangjc-github,

Do you import the geometry using a dielectric.dat file where ‘eps_r = 1’ for all domains before the snippet of code you sent?

Kind regards,

Djunes

Hi, Djunes,

The first graph shows the gem as I changed the permittivity value of gem [4 ->1]

The second graph is the snippet of code used to set different parts of domain, but it does not work.

Could you please help to check it?

Best regards,
Jiechen

Hi Jiechen,

I attempted to replicate the scenario you described.

Indeed, when I set eps_r = 1 for domain 1 (the polyimide foil) in the dielectric.dat file, the ComponentCOMSOL class imports the domain and saves it. After importing, when I define domain 1 as plastic using the command fm.SetMedium(1, &pl), the polyimide foil still appears in the drift line plot.

Could it be that in the second case you mentioned, you reset eps_r = 4 in the dielectric.dat file before using the fm.SetMedium(1, &pl) command? If that’s the case, domain 1 would not be saved initially, and setting it as MediumPlastic afterward does not alter this outcome.

I hope this clarification is helpful.

Kind regards,

Djunes

Hi, Djunes

Thank you for checking, yes, I reset eps_r = 4 in the dielectric.dat file before.
From your point, only domain with eps_r = 1 could be saved and output even if we use ’SetMedium()’?

Best regards,
Jiechen

Hi Jiechen,

That’s exactly right! This approach was implemented to minimize the memory usage by the field map.

However, there’s a valid argument that the standard import function should import all domains unless specifically directed to import only those with eps_r = 1. We will contemplate whether to implement this change.

Kind regards,

Djunes

Hi, Djunes,

Thanks for patiently reply, now, I understand.
Looking forward for the implementation.
Thanks again.

Best regards,
Jiechen

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.