Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] 3D CPML FDTD C Code is available here

Status
Not open for further replies.

jithesh

Member level 5
Joined
Oct 11, 2007
Messages
92
Helped
41
Reputation
80
Reaction score
29
Trophy points
1,298
Location
India
Activity points
1,921
cpml fdtd

Hi

A 3D FDTD code with CPML boundary conditions is attached.
It is implemented in C language and it simulates the radiation from a dipole (Near field only).
I have added proper comments in the code so that anybody who wants to modify can do the same without much trouble.

This code is actually a modified version of the Fortran code provided with Taflove's book, 3rd edition (which is available in the forum).
A Matlab file is also attached, which can be used for visualizing the fields in animated format.
Hope that this may be useful.

Best Regards
Jithesh
 

Surrender

Newbie level 2
Joined
Jun 9, 2008
Messages
2
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,293
cpml c code

Thanks, been having trouble with this.

Silly question maybe but what's a Cpml as opposed to a PML?
 

jithesh

Member level 5
Joined
Oct 11, 2007
Messages
92
Helped
41
Reputation
80
Reaction score
29
Trophy points
1,298
Location
India
Activity points
1,921
implementation of cpml

CPML is Convolutional PML.
It is more accurate than Berenger's PML.
Moreover the memory requirement for CPML is less compared to Berenger's PML
For more details you can refer Taflove's Book (Second or third edition)
Best Regards
Jithesh
 

m101miri

Newbie level 1
Joined
Oct 4, 2009
Messages
1
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Tehran
Activity points
1,284
Hi
I'm not familiar with C, how should I run this code. I tried to compile and run it with Dev-C++ 4.9.9.2, but there is a problem. What is this error mean: "Source file not compiled"
 
  • Like
Reactions: blin

    blin

    Points: 2
    Helpful Answer Positive Rating

ravi8331

Full Member level 4
Joined
Jul 4, 2008
Messages
237
Helped
33
Reputation
66
Reaction score
16
Trophy points
1,298
Location
India
Activity points
2,726
hii
can u tell me how can i calculate the field distribution with in the 3D strucutre using CPML boundary with 3D FDTD method.........i want to calculate the field disrtribution in the dielectric slab due to antenna in direct contact with the slab.... i hv the matlab code for antenna but i don't understand how can i calculate the field distrubution using FDTD in dielctric slab.............
 

rashidmirza

Junior Member level 1
Joined
Oct 24, 2004
Messages
16
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
105
m101miri said:
Hi
I'm not familiar with C, how should I run this code. I tried to compile and run it with Dev-C++ 4.9.9.2, but there is a problem. What is this error mean: "Source file not compiled"

Hi,
First you must Compile the code, in Dev-C you can press F9 to Compile&Run.
 

cissie

Newbie level 1
Joined
Jul 18, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,284
Thanks so much. I have been looking for CPML implementation so long.
 

wilcherrera

Newbie level 1
Joined
Sep 17, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
Hi...I have a question about the code, specifically In the section where the PML parameters are intialized: to initialize, for example ce_x_1, there is an
if ((sige_x_PML_1==0.0)&&(alphae_x_PML_1==0.0)&&(i == nxPML_1-1)){

ce_x_1=0.0;
} else {
ce_x_1=sige_x_PML_1*(be_x_1 - (sige_x_PML_1 + kappae_x_PML_1 * alphae_x_PML_1)/ kappae_x_PML_1;
}

The question is why is the "if" condition needed. Is not enough with the "else" part, without any conditional???

Thanks
 

rodgerwxh

Banned
Joined
Aug 24, 2012
Messages
113
Helped
25
Reputation
56
Reaction score
22
Trophy points
1,298
Location
North Carolina
Activity points
0
Convolutional PML is not better than Brenger's PML, there are papers discussed about this. Convolutional PML is developed by S. D. Gedney and Roden Allen, the major part of this work is to understand the PML as a Uniaxial absorbing media rather than split field stretched media, This understanding makes more sense when defining PML's parameters and the implementation is relatively more straight forward. However, the performance is actually the same.

Newer PMLs are actually called CFS-PML (Complex Frequency Shifted PML), Such PML absorbs evanescent waves.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top