nia
(si)
February 15, 2021, 1:56pm
1
Hello colleagues
I have imported a 3D mesh from gmsh with different physical volumes inside it in freefem, all are imported in one mesh.
I need to define different epsilon on each region. I can get my physical volumes tages by command
fespace Ph(Th, P1); Ph reg = region; plot(reg); real[int] tags; Unique(reg[], tags); cout << "tags"<<tags << endl;
May you suggest me a command so to define epsilons for each region based on physical volumes tags?
Thanks in advance.
henkel
February 21, 2021, 10:40pm
2
You’ve probably already figured it out, but if you’re still looking for an answer (untested code):
fespace V0(Th, P0);
// region tags
int air1 = 3;
int porcelain1 = 4;
int air2 = 5;
real eps0 = 8.8541878128e-12;
real epsr_air = 1.00059;
real epsr_porcelain = 4;
V0 eps = eps0 * ( epsr_air *(region == air1 || region == air2) +
epsr_porcelain * (region == porcelain1) );
nia
(si)
February 23, 2021, 10:33am
3
henkel:
8.8541878128e-12
Thanks alot for your response,
So eps considers separate permittivity of each region?